diff --git a/scalablemcmcsamplingfornonsymmetricdeterminantalpointprocesses/db7abe09-3502-468a-b76c-b6441ac14a21_content_list.json b/scalablemcmcsamplingfornonsymmetricdeterminantalpointprocesses/db7abe09-3502-468a-b76c-b6441ac14a21_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..8f6185f912e9d38f6e113f79bff5894f81f21df8 --- /dev/null +++ b/scalablemcmcsamplingfornonsymmetricdeterminantalpointprocesses/db7abe09-3502-468a-b76c-b6441ac14a21_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bc10f977b9ae4134064643b8daca6bad257c3bd555ea5d3c6f2329bf512aabac +size 138984 diff --git a/scalablemcmcsamplingfornonsymmetricdeterminantalpointprocesses/db7abe09-3502-468a-b76c-b6441ac14a21_model.json b/scalablemcmcsamplingfornonsymmetricdeterminantalpointprocesses/db7abe09-3502-468a-b76c-b6441ac14a21_model.json new file mode 100644 index 0000000000000000000000000000000000000000..ea5272e5e778776b7cfde60b43de03028dcec630 --- /dev/null +++ b/scalablemcmcsamplingfornonsymmetricdeterminantalpointprocesses/db7abe09-3502-468a-b76c-b6441ac14a21_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4a54d1cbed548506a3ec87d9295e66bc99471139e1d735f7d2bd1c859388593d +size 165952 diff --git a/scalablemcmcsamplingfornonsymmetricdeterminantalpointprocesses/db7abe09-3502-468a-b76c-b6441ac14a21_origin.pdf b/scalablemcmcsamplingfornonsymmetricdeterminantalpointprocesses/db7abe09-3502-468a-b76c-b6441ac14a21_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..169006e07d24fc1a21a95726d21185c55d736bbd --- /dev/null +++ b/scalablemcmcsamplingfornonsymmetricdeterminantalpointprocesses/db7abe09-3502-468a-b76c-b6441ac14a21_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aba68ec78d6eb0935b1374b70c087cb313840b54aa6b4c75437978ff8be248e6 +size 709974 diff --git a/scalablemcmcsamplingfornonsymmetricdeterminantalpointprocesses/full.md b/scalablemcmcsamplingfornonsymmetricdeterminantalpointprocesses/full.md new file mode 100644 index 0000000000000000000000000000000000000000..dfd5b7e8ee4a8b345d59086261f219cd7d4bcd85 --- /dev/null +++ b/scalablemcmcsamplingfornonsymmetricdeterminantalpointprocesses/full.md @@ -0,0 +1,613 @@ +# Scalable MCMC Sampling for Nonsymmetric Determinantal Point Processes + +Insu Han1 Mike Gartrell2 Elvis Dohmatob3 Amin Karbasi1 + +# Abstract + +A determinantal point process (DPP) is an elegant model that assigns a probability to every subset of a collection of $n$ items. While conventionally a DPP is parameterized by a symmetric kernel matrix, removing this symmetry constraint, resulting in nonsymmetric DPPs (NDPPs), leads to significant improvements in modeling power and predictive performance. Recent work has studied an approximate Markov chain Monte Carlo (MCMC) sampling algorithm for NDPPs restricted to size- $k$ subsets (called $k$ -NDPPs). However, the runtime of this approach is quadratic in $n$ , making it infeasible for large-scale settings. In this work, we develop a scalable MCMC sampling algorithm for $k$ -NDPPs with low-rank kernels, thus enabling runtime that is sublinear in $n$ . Our method is based on a state-of-the-art NDPP rejection sampling algorithm, which we enhance with a novel approach for efficiently constructing the proposal distribution. Furthermore, we extend our scalable $k$ -NDPP sampling algorithm to NDPPs without size constraints. Our resulting sampling method has polynomial time complexity in the rank of the kernel, while the existing approach has runtime that is exponential in the rank. With both a theoretical analysis and experiments on real-world datasets, we verify that our scalable approximate sampling algorithms are orders of magnitude faster than existing sampling approaches for $k$ -NDPPs and NDPPs. + +# 1. Introduction + +Determinantal Point Processes (DPPs) are probability distributions defined on the set of all subsets of a collection of $n$ items. They have been applied to a variety of funda + +$^{1}$ Yale University $^{2}$ Criteo AI Lab, Paris, France $^{3}$ Facebook AI Lab, Paris, France. Correspondence to: Insu Han , Mike Gartrell . + +Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s). + +mental machine learning problems, including robustness learning (Pang et al., 2019), reinforcement learning (Yang et al., 2020), and bandit optimization (Kathuria et al., 2016), among many others. While conventionally a DPP is parameterized by a symmetric kernel matrix, Gartrell et al. (2019) showed that any nonsymmetric and positive semidefinite matrix can define a valid DPP, which they refer to as a nonsymmetric DPP (NDPP). In addition, they established a number of useful properties of NDPPs. For example, NDPPs are able to capture both positive and negative correlations among items, while symmetric DPPs can only represent negative correlations, leading to significant improvements in modeling power and predictive performance. + +Recent works have proposed efficient algorithms for various NDPP tasks, including learning (Gartrell et al., 2021), MAP inference (Anari & Vuong, 2021), and sampling (Han et al., 2022), where the NDPP kernel is given by a low-rank factorization. In this paper we focus on developing an efficient sampling algorithm for NDPPs restricted to size $k$ subsets, called $k$ -NDPPs. Such size-constrained DPPs are often more practical in applications such as video summarization (Sharghi et al., 2018), mini-batch optimization (Zhang et al., 2017), document summarization (Dupuy & Bach, 2018) and coreset sampling (Tremblay et al., 2019). The only existing approach for $k$ -NDPP sampling is an approximate method based on Markov chain Monte Carlo (MCMC) sampling (Alimohammadi et al., 2021; Anari & Vuong, 2021). The algorithm is based on a random walk, where in every iteration a pair of items is exchanged with some probability. These prior works primarily focused on the number of iterations required for convergence, and proved that with time polynomial in $k$ , the sampling algorithm converges to the $k$ -NDPP target distribution. However, each transition step needs time quadratic in $n$ , making this approach infeasible for large-scale settings. + +# 1.1. Contributions + +In this work, we develop a scalable MCMC sampling algorithm for $k$ -NDPPs with low-rank kernels. In particular, we accelerate the transition step of the MCMC sampling algorithm so that it runs in sublinear (polynomial-logarithmic) time in $n$ . We first show that this step is equivalent to sampling a subset of size 2 from a conditional NDPP. To achieve fast 2-NDPP sampling, we make use of a state- + +Table 1. Summary of recent NDPP sampling algorithms. The sampling time of Han et al. (2022)'s work assumes an orthogonal constraint on the kernel. Here, $n$ is the size of ground set, $d$ is the rank of the kernel, $k$ refers to the size of sampled set $\left( {k \leq d \ll n}\right)$ and $\alpha > 0$ is a data-dependent factor. Alimohammadi et al. (2021) showed that ${t}_{\text{iter }} = \operatorname{poly}\left( k\right)$ guarantees the convergence of MCMC sampling,where $\kappa > 0$ is a condition number of the NDPP kernel component (see Proposition 5 for details). + +
AlgorithmTaskPreprocessing TimeSampling Time
Cholesky-based Exact (Poulson, 2020)NDPP-O(n·d2)
Rejection-based Exact (Han et al., 2022)NDPPO(n·d2)O((log n·k3+k4+d)·(1+α)d)
Naïve MCMC (Alimohammadi et al., 2021)k-NDPP / NDPP-O(n2·k3·titer)
Scalable MCMC (This work)k-NDPP / NDPPO(n·d2)O((log n·d2+d3)·(1+κ)2·titer)
+ +of-the-art NDPP rejection sampling algorithm (Han et al., 2022), which we enhance with a novel approach for efficiently constructing a symmetric DPP this is used for the proposal distribution. When the NDPP kernel is given by a rank- $d$ factorization $(d\ll n)$ , the proposal DPP kernel can be constructed in only $\mathcal{O}(d^3)$ time. This type of proposal kernel is similar to a personalized version of the DPP kernel (Gillenwater et al., 2019; Han & Gillenwater, 2020), which consists of a global features matrix $X\in \mathbb{R}^{n\times d}$ and a personalization matrix $U\in \mathbb{R}^{d\times d}$ . This proposal distribution changes in every transition of the MCMC sampling, however according to our construction it suffices to update only the matrix $U$ . This allows us to utilize a fast tree-based DPP sampling algorithm (Gillenwater et al., 2019) suitable for personalized DPPs. This tree-based algorithm requires us to build a binary tree based on the global features, as a one-time preprocessing step. After preprocessing, the sampling algorithm runs in time that is logarithmic in $n$ . This makes a single iteration of the rejection sampling much faster. We further prove that the number of rejections does not depend on the dimensions of the NDPP kernel, but on some spectral bounds of the kernel. As a consequence, our MCMC sampling algorithm for $k$ -NDPPs runs in logarithmic time in $n$ , and polynomial time in both $d$ and $k$ . To the best of our knowledge, this is the first work on a sublinear time algorithm for $k$ -NDPP sampling. In our experiments, we observe that our proposed algorithm runs orders of magnitude faster than the existing sampling approach, which for kernels learned from some datasets does not terminate within 10 days. + +Furthermore, we extend our sampling algorithm to size-unconstrained NDPPs. The resulting algorithm has polynomial time complexity in the rank $d$ of the kernel, while the existing sampling algorithm for NDPPs (Han et al., 2022) has runtime that is exponential in $d$ . Through theoretical analysis and experiments on real-world datasets, we show that our approximate sampling algorithm is orders of magnitude faster than the fastest existing sampling approach for $k$ -NDPPs, and up to an order of magnitude faster for NDPPs. The source code for our NDPP sampling algorithms is publicly available at https://github.com/insuhan/ndpp-mcmc-sampling. + +# 1.2. Related Work + +Fast sampling algorithms for symmetric DPPs have been extensively studied, including a tree-based algorithm (Gillenwater et al., 2019), and an intermediate sampling method (Derezinski, 2019). These methods commonly require a one-time preprocessing step, with the subsequent sampling procedure running in time that is sublinear in the size of the ground set $n$ . Celis et al. (2017) studied a polynomial time sampling algorithm under partition constraints. For unconstrained-size NDPP sampling, Poulson (2020) developed the Cholesky-based sampling algorithm, which runs in time $\mathcal{O}(n^3)$ for general kernels. Recently, Han et al. (2022) showed that with a rank- $d$ kernel decomposition, the runtime of the Cholesky-based algorithm can be reduced to $\mathcal{O}(nd^2)$ . Moreover, they propose a tree-based rejection sampling algorithm for NDPPs that combines previous work for fast sampling of symmetric DPPs with an efficient approach for constructing the proposal distribution. However, although the sampling process has runtime that is sublinear in $n$ , they show that the average number of rejections is exponential in $d$ , which can be problematic in general. For $k$ -NDPPs, to the best of our knowledge, there is no prior work on an efficient algorithm for exact sampling. The only existing approach is an approximate MCMC sampling algorithm (Alimohammadi et al., 2021), which has runtime that is quadratic in $n$ . We summarize these $k$ -NDPP and NDPP sampling algorithms in Table 1. + +# 2. Background + +Notation. The set of first $n$ positive integers is denoted by $\{1, \ldots, n\} \coloneqq [n]$ . For a finite set $S$ , we denote by $\binom{S}{k}$ the collection of all $k$ -element subsets of a set $S$ . We use $I_d$ for the $d$ -by- $d$ identity matrix and drop the subscript when it is clear from the context. For a matrix $X \in \mathbb{R}^{m \times n}$ and indices $A \subseteq [m], B \subseteq [n]$ , we use $X_{A,B} \in \mathbb{R}^{|A| \times |B|}$ to denote a submatrix of $X$ whose rows and columns are indexed by $A$ and $B$ , respectively. We write $X_{:,B} \coloneqq X_{[m],B}$ to denote all rows of $X$ , and similarly $X_{A,:} \coloneqq X_{A,[n]}$ for all columns of $X$ . We denote the largest and smallest singular values of $X$ by $\sigma_{\max}(X)$ and $\sigma_{\min}(X)$ , respectively. We use $\succeq$ to denote the Loewner order, i.e., $A \succeq B$ implies $A - B$ is + +positive semidefinite (PSD), and $\operatorname{Diag}$ to denote the direct sum, i.e., $\operatorname{Diag}(\mathbf{A},\mathbf{B}) = \left[ \begin{array}{ll}\mathbf{A} & \mathbf{0}\\ \mathbf{0} & \mathbf{B} \end{array} \right]$ . + +# 2.1. Nonsymmetric DPPs + +Given a matrix $L\in \mathbb{R}^{n\times n}$ , a DPP assigns a probability + +$$ +\mathcal {P} _ {\boldsymbol {L}} (S) \propto \det (\boldsymbol {L} _ {S}) \tag {1} +$$ + +to every subset $S$ of $[n]$ . Any symmetric and PSD kernel $\pmb{L}$ guarantees that $\operatorname*{det}(\pmb{L}_S)$ is nonnegative, and therefore admits a DPP. Gartrell et al. (2019) extended the space of valid DPP kernels and proved that nonsymmetric and PSD $\pmb{L}$ kernels (i.e., $\pmb{L} + \pmb{L}^{\top} \succeq 0$ ) can be also used to define a DPP. An important property of NDPPs is that they can capture both positive and negative correlations, while symmetric DPPs only capture the negative correlations, resulting in significant improvements in modeling power and predictive performance for NDPPs. + +In particular, Gartrell et al. (2019) proposed a kernel construction for NDPPs that combines a symmetric PSD matrix and a skew-symmetric matrix: + +$$ +\boldsymbol {L} = \boldsymbol {V} \boldsymbol {V} ^ {\top} + \boldsymbol {B} (\boldsymbol {D} - \boldsymbol {D} ^ {\top}) \boldsymbol {B} ^ {\top}, \qquad (2) +$$ + +where $\pmb{V} \in \mathbb{R}^{n \times d_1}$ , $\pmb{B} \in \mathbb{R}^{n \times d_2}$ , and $\pmb{D} \in \mathbb{R}^{d_2 \times d_2}$ . For simplicity, we will write $\pmb{X} := [\pmb{V}, \pmb{B}] \in \mathbb{R}^{n \times d}$ , $\pmb{W} := \mathrm{Diag}(\pmb{I}, \pmb{D} - \pmb{D}^\top) \in \mathbb{R}^{d \times d}$ for $d = d_1 + d_2$ , and $\pmb{L} = \pmb{X} \pmb{W} \pmb{X}^\top$ . + +We refer to a $k$ -NDPP as a NDPP whose support is restricted to size- $k$ subsets of $[n]$ .1 As studied in Kulesza & Taskar (2011, Proposition 5.1), the normalization constant of a $k$ -NDPP can be computed using the eigenvalues of $\pmb{L}$ .2 Formally, when $\{\lambda_i\}_{i=1}^d$ are the nonzero eigenvalues of the rank- $d$ matrix $\pmb{L}$ , it holds that + +$$ +\sum_ {S \in \binom {[ n ]} {k}} \det (\boldsymbol {L} _ {S}) = \sum_ {S \in \binom {[ d ]} {k}} \prod_ {i \in S} \lambda_ {i} := e _ {k} \left(\left\{\lambda_ {i} \right\} _ {i = 1} ^ {d}\right), \tag {3} +$$ + +where $e_k$ is known as the $k$ -th elementary symmetric polynomial. Note that $\{\lambda_i\}_{i=1}^d$ are also eigenvalues of $\mathbf{W}\mathbf{X}^\top \mathbf{X} \in \mathbb{R}^{d \times d}$ , and therefore one can obtain them from matrix-matrix multiplications and the eigendecomposition, resulting in $\mathcal{O}(nd^2)$ runtime. In addition, Equation (3) can be computed in time $\mathcal{O}(dk)$ using the following recursive relation: + +$$ +e _ {k} (\{\lambda_ {i} \} _ {i = 1} ^ {d}) = e _ {k} (\{\lambda_ {i} \} _ {i = 1} ^ {d - 1}) + \lambda_ {d} \cdot e _ {k - 1} (\{\lambda_ {i} \} _ {i = 1} ^ {d - 1}), (4) +$$ + +where $e_0(\{\lambda_i\}_{i=1}^d) = 1$ . Since every determinant of a principal submatrix of $L$ is nonnegative, the $e_k$ 's for NDPPs are also nonnegative. + +# Algorithm 1 MCMC Sampling for $k$ -NDPP + +1: Input: $L \in \mathbb{R}^{n \times n}$ , $k \in \mathbb{N}$ , $t_{\mathrm{iter}} \in \mathbb{N}$ +2: Select $S \in \binom{n}{k}$ uniformly at random +3: for $t = 1, \ldots, t_{\mathrm{iter}}$ do +4: Select $A \in \binom{S}{k-2}$ uniformly at random +5: Select $a, b \in [n]$ with probability $\propto \det(L_{A \cup \{a, b\}})$ ( $\triangleright$ Run Algorithm 2) +6: $S\gets A\cup \{a,b\}$ +7: end for +8: Return $S$ + +# 2.2. MCMC Sampling for $k$ -NDPPs + +An MCMC sampling algorithm for a $k$ -DPP begins with a subset $S$ selected from $\binom{[n]}{k}$ uniformly at random, and then iteratively updates $S$ with some probability. For symmetric $k$ -DPPs, single-item-exchange Markov chains (i.e., $S$ is replaced with $S \cup \{i\} \setminus \{j\}$ for $i \notin S, j \in S$ in every iteration) can guarantee fast convergence to the approximate target distribution in total variation distance (Li et al., 2016; Anari et al., 2016; Rezaei & Gharan, 2019). However, the single-item-exchange chain does not mix well for $k$ -NDPPs because they are not negatively dependent, which is a key requirement for fast mixing (Anari et al., 2016). + +Recent work has shown that when a pair of items $S$ is exchanged, the chain can quickly converge to the target $k$ -NDPP distribution (Anari & Vuong, 2021; Alimohammadi et al., 2021). We provide pseudo-code for this MCMC algorithm in Algorithm 1. + +Alimohammadi et al. (2021) proved that the mixing time, i.e., the minimum number of iterations required to approximate the target distribution within $\varepsilon$ in terms of total variation distance, is bounded by a polynomial in $k$ . + +Proposition (Theorem 11 in (Alimohammadi et al., 2021)). For any $\varepsilon > 0$ , a sample $S$ obtained from Algorithm 1 with + +$$ +t _ {\text {i t e r}} = \mathcal {O} \left(k ^ {2} \cdot \log \left(\frac {1}{\varepsilon \cdot \Pr (S _ {0})}\right)\right), \tag {5} +$$ + +and randomly chosen subset $S_0 \in \binom{[n]}{k}$ , the total variation distance to the target $k$ -NDPP distribution is guaranteed to be less than $\varepsilon$ . + +Note that each iteration of MCMC sampling (line 5 in Algorithm 1) needs to compute determinants of $k$ -by- $k$ matrices for $\mathcal{O}(n^2)$ candidates, and therefore runs in time $\mathcal{O}(n^2k^3)$ . We call this step the "up operator". + +# 3. Scalable MCMC Sampling for $k$ -NDPPs + +As mentioned above, the naive up operator, which involves an exhaustive search over the space of possible candidates, + +requires time complexity that is quadratic in the ground set size $n$ . This runtime clearly suffers from scalability issues for large $n$ . In this section, we show how to significantly accelerate the up operator by utilizing the low-rank structure of the kernel matrix. + +We first observe that the up operator is equivalent to sampling a size 2 subset from the NDPP conditioned on $A$ . Formally, given a low-rank NDPP kernel $\pmb{L} = \pmb{X}\pmb{W}\pmb{X}^{\top}$ for $\pmb{X} \in \mathbb{R}^{n \times d}$ , $\pmb{W} \in \mathbb{R}^{d \times d}$ , and a subset $A \subseteq [n], |A| \leq d$ , one can check that $\operatorname*{det}\left(\pmb{L}_{A \cup \{a, b\}}\right) \propto \operatorname*{det}\left(\pmb{L}_{\{a, b\}}^{A}\right)$ , where $\pmb{L}^{A}$ is the kernel of the conditional NDPP on $A$ , given by + +$$ +\boldsymbol {L} ^ {A} := \boldsymbol {L} - \boldsymbol {L} _ {:, A} \boldsymbol {L} _ {A} ^ {- 1} \boldsymbol {L} _ {A,:} = \boldsymbol {X} \boldsymbol {W} ^ {A} \boldsymbol {X} ^ {\top}, \tag {6} +$$ + +where $W^{A} \coloneqq W - W X_{A,:}^{\top}(X_{A,:}, W X_{A,:}^{\top})^{-1} X_{A,:} W$ . Note that computing $W^{A}$ requires a matrix inversion of dimension $|A| \leq d$ and matrix-matrix multiplications of dimension $d$ , which results in $\mathcal{O}(d^3)$ operations in total. Therefore, the up operator can be seen as sampling a size 2 subset from the NDPP with kernel $L^{A}$ . In the next section, we present an approach for efficiently sampling from this conditional 2-NDPP. + +# 3.1. Up Operator via Rejection Sampling + +Our goal is an efficient sampling from a 2-NDPP whose kernel is given by Equation (6). To this end, we utilize recent work on a sublinear-time NDPP rejection sampling algorithm (Han et al., 2022). + +Specifically, given a NDPP kernel $L^A$ , assume that there exists a matrix $\widehat{L}$ such that + +$$ +\det \left(\boldsymbol {L} _ {S} ^ {A}\right) \leq \det (\widehat {\boldsymbol {L}} _ {S}) \tag {7} +$$ + +for every $S \subseteq [n]$ . The rejection sampling method proceeds as follows: first, draw a sample $S$ from the DPP with kernel $\widehat{\pmb{L}}$ and accept it with probability $\operatorname*{det}(\pmb{L}_S^A) / \operatorname*{det}(\widehat{\pmb{L}}_S)$ , otherwise repeat the draws until $S$ is accepted. The resulting sample $S$ has probability proportional to $\operatorname*{det}(\pmb{L}_S^A)$ . The distribution from which we actually draw a sample (i.e., the DPP with $\widehat{\pmb{L}}$ ) is called the proposal distribution. Furthermore, if $\widehat{\pmb{L}}$ is symmetric, one can make use of several symmetric DPP sampling algorithms. In particular, we adopt a sublinear-time tree-based method (Gillenwater et al., 2019) for our scalable MCMC sampling algorithm, which we describe in more detail in Section 3.2. + +Han et al. (2022) provided a proposal distribution with kernel $\widehat{L}$ , based on a spectral decomposition of $X W^{A} X^{\top}$ , and shows that it satisfies Equation (7). When $\pmb{L}$ is given by a rank- $d$ factorization, this spectral decomposition has a runtime of $\mathcal{O}(nd^{2})$ . However, this complexity makes the cost of the preprocessing steps for the sampler dominant when the subsequent sampling from the DPP with $\widehat{L}$ is performed in sublinear-time in $n$ (e.g., using tree-based sampling). Thus, + +# Algorithm 2 Up Operator via Rejection Sampling + +1: Input: $A \subseteq [n]$ , $X \in \mathbb{R}^{n \times d}$ , $W \in \mathbb{R}^{d \times d}$ +2: $\pmb{W}^{A}\gets \pmb {W} - \pmb{W}\pmb{X}_{A,:}^{\top}(\pmb{X}_{A,:}\pmb{W}\pmb{X}_{A,:}^{\top})^{-1}\pmb{X}_{A,:}\pmb{W}$ +3: $\{(\sigma_i, \pmb{y}_i, \pmb{z}_i)\}_{i=1}^{d/2} \gets \text{Youla decomposition. of } \frac{\pmb{W}^A - \pmb{W}^{A^\top}}{2}$ +4: $\widehat{\pmb{W}}^A\gets \frac{\pmb{W}^A + \pmb{W}^{A^\top}}{2} +\sum_{i = 1}^{d / 2}\sigma_i\left(\pmb {y}_i\pmb {y}_i^\top +\pmb {z}_i\pmb {z}_i^\top\right)$ + +# 5: while true do + +6: Sample $\{a,b\}$ with prob. $\propto \operatorname*{det}([X\widehat{W}^A X^\top ]_{\{a,b\}})$ (Run Algorithm 3) +7: if $\mathcal{U}([0,1])\leq \frac{\operatorname*{det}\big([X\boldsymbol{W}^A\boldsymbol{X}^\top]_{\{a,b\}}\big)}{\operatorname*{det}\big([X\widehat{\boldsymbol{W}}^A\boldsymbol{X}^\top]_{\{a,b\}}\big)}$ then +8: Return $\{a, b\}$ +9: end if + +# 10: end while + +we would not fully utilize the advantages of a scalable DPP sampling algorithm. We resolve this issue by developing a more efficient procedure for constructing the proposal DPP. + +Our key idea is to apply a similar spectral decomposition approach for computing the $d$ -by- $d$ matrix $\mathbf{W}^A$ , which allows us to compute the proposal DPP kernel in time $\mathcal{O}(d^3)$ . More specifically, we begin with writing the spectral decomposition of the skew-symmetric matrix $\frac{\mathbf{W}^A - \mathbf{W}^{A^\top}}{2}$ as + +$$ +\frac {\boldsymbol {W} ^ {A} - \boldsymbol {W} ^ {A \top}}{2} = \sum_ {i = 1} ^ {d / 2} \left[ \begin{array}{l l} \boldsymbol {y} _ {i} & \boldsymbol {z} _ {i} \end{array} \right] \left[ \begin{array}{c c} 0 & \sigma_ {i} \\ - \sigma_ {i} & 0 \end{array} \right] \left[ \begin{array}{l} \boldsymbol {y} _ {i} ^ {\top} \\ \boldsymbol {z} _ {i} ^ {\top} \end{array} \right], \tag {8} +$$ + +where $\{\pmb{y}_i,\pmb{z}_i\}_{i = 1}^{d / 2}$ is a set of eigenvectors, and the $\sigma_{i}$ 's are the nonnegative eigenvalues. The above decomposition is also known as the Youla decomposition (Youla, 1961). Given this, we define a symmetric matrix $\widehat{\pmb{W}}^A$ as follows: + +$$ +\widehat {\boldsymbol {W}} ^ {A} := \frac {\boldsymbol {W} ^ {A} + \boldsymbol {W} ^ {A}}{2} + \sum_ {i = 1} ^ {d / 2} \left[ \begin{array}{l l} \boldsymbol {y} _ {i} & \boldsymbol {z} _ {i} \end{array} \right] \left[ \begin{array}{c c} \sigma_ {i} & 0 \\ 0 & \sigma_ {i} \end{array} \right] \left[ \begin{array}{l} \boldsymbol {y} _ {i} ^ {\top} \\ \boldsymbol {z} _ {i} ^ {\top} \end{array} \right]. \tag {9} +$$ + +An important property is that every determinant of a principal submatrix of $\widehat{\pmb{W}}^A$ is equal to or greater than that of $\pmb{W}^{A}$ , i.e., $\operatorname*{det}(\pmb{W}_S^A) \leq \operatorname*{det}(\widehat{\pmb{W}}_S^A)$ for all $S \subseteq [d]$ , as shown in (Han et al., 2022, Theorem 1). We further prove that this property is preserved under the bilinear transformation $\pmb{W}^{A} \rightarrow \pmb{X}\pmb{W}^{A}\pmb{X}^{\top}$ for any $\pmb{X} \in \mathbb{R}^{n \times d}$ . + +Theorem 1. Given $\mathbf{X} \in \mathbb{R}^{n \times d}$ and $\mathbf{W}^A \in \mathbb{R}^{d \times d}$ , suppose $\widehat{\mathbf{W}}^A$ is obtained from Equation (9) with $\mathbf{W}^A$ . Then, + +$$ +\det \left(\left[ \boldsymbol {X} \boldsymbol {W} ^ {A} \boldsymbol {X} ^ {\top} \right] _ {S}\right) \leq \det \left(\left[ \boldsymbol {X} \widehat {\boldsymbol {W}} ^ {A} \boldsymbol {X} ^ {\top} \right] _ {S}\right) \tag {10} +$$ + +for every $S \subseteq [n]$ . In addition, equality holds when $|S| \geq d$ . + +We provide the proof of Theorem 1 in Appendix C.1. Theorem 1 allows us to use rejection sampling, with the kernel $\widehat{\pmb{L}} := \pmb{X} \widehat{\pmb{W}}^A \pmb{X}^\top$ as the proposal distribution. + +Pseudo-code for the up operator computed using rejection sampling is shown in Algorithm 2. Observe that $\widehat{\mathbf{W}}^A$ can be computed in time $\mathcal{O}(d^3)$ (lines 2-4 in Algorithm 2), because both matrix operations involve matrices with dimension $d$ , and the Youla decomposition of $\frac{\mathbf{W}^A - \mathbf{W}^{A^\top}}{2}$ , have complexities $\mathcal{O}(d^3)$ . Therefore, we can build each kernel component for the proposal DPP in time $\mathcal{O}(d^3)$ . This improves the previous method with runtime $\mathcal{O}(nd^2)$ , since $d \ll n$ , and potentially allows us to utilize the sublinear-time sampling algorithm. In the next section, we discuss the tree-based $k$ -DPP sampling algorithm that uses our proposal DPP. + +# 3.2. Sublinear-time Tree-based Sampling + +We now focus on sampling the 2-DPP with kernel $\widehat{\pmb{L}} = \pmb{X}\widehat{\pmb{W}}^{A}\pmb{X}^{\top}$ (line 6 in Algorithm 2). Observe that the matrix $\pmb{X} \in \mathbb{R}^{n \times d}$ remains unchanged, and only the inner matrix $\widehat{\pmb{W}}^{A} \in \mathbb{R}^{d \times d}$ changes in every iteration of the MCMC sampling algorithm. Fortunately, the sublinear-time tree-based DPP sampling algorithm (Gillenwater et al., 2019) is well suited to this type of kernel structure. We build a binary tree using $\pmb{X}$ , which can be used for 2-DPP sampling with the kernel $\pmb{X}\widehat{\pmb{W}}^{A}\pmb{X}^{\top}$ , and then the sampling process is equivalent to $k$ tree traversals with a $d$ -by- $d$ query matrix. Consequently, 2-DPP sampling can be done in time $\mathcal{O}(d^{2}\log n + d^{3})$ . + +We begin by explaining the workflow for tree-based $k$ -DPP sampling, where we set $k$ to 2. Formally, denote $\pmb{U} := (\widehat{\pmb{W}}^A)^{-\frac{1}{2}}$ , and let $\{(\lambda_i, \pmb{v}_i)\}_{i=1}^d$ be the eigendecomposition of $\pmb{U}(\pmb{X}^\top \pmb{X})\pmb{U}$ . From (Kulesza & Taskar, 2012, Eq. (187)), the probability of sampling $S \in \binom{[n]}{k}$ from the $k$ -DPP with $\widehat{\pmb{L}}$ can be decomposed into the following + +$$ +\frac {\operatorname* {d e t} \left(\widehat {\boldsymbol {L}} _ {S}\right)}{e _ {k} \left(\left\{\lambda_ {i} \right\} _ {i = 1} ^ {d}\right)} = \sum_ {E \in \binom {[ d ]} {k}} \frac {\prod_ {i \in E} \lambda_ {i}}{e _ {k} \left(\left\{\lambda_ {i} \right\} _ {i = 1} ^ {d}\right)} \cdot \det \left(\boldsymbol {K} _ {S} ^ {E}\right), \tag {11} +$$ + +where $\pmb{K}^{E} := \pmb{X}\pmb{U}\left(\sum_{i\in E}\lambda_{i}^{-1}\pmb{v}_{i}\pmb{v}_{i}^{\top}\right)\pmb{U}\pmb{X}^{\top}$ , and $e_k$ is the elementary symmetric polynomial defined in Equation (3). We observe that $\pmb{K}^{E}$ is a rank- $k$ projection matrix, because + +$$ +\boldsymbol {K} ^ {E} = \sum_ {i \in E} \frac {\boldsymbol {X U} \boldsymbol {v} _ {i}}{\sqrt {\lambda_ {i}}} \left(\frac {\boldsymbol {X U} \boldsymbol {v} _ {i}}{\sqrt {\lambda_ {i}}}\right) ^ {\top}, \tag {12} +$$ + +and $\frac{XUv_i}{\sqrt{\lambda_i}}$ 's are the eigenvectors of $\widehat{L}$ (Kulesza & Taskar, 2012, Proposition 3.1). Any projection matrix can define a DPP with a marginal kernel, called an elementary DPP. Equation (11) allows the following two-step $k$ -DPP sampling procedure: 1) select an index set $E \in \binom{[d]}{k}$ with probability $\frac{\prod_{i \in E} \lambda_i}{e_k(\{\lambda_i\}_{i=1}^d)}$ , and then 2) sample a subset $S$ from the elementary DPP with kernel $K^E$ . As studied in (Kulesza & Taskar, 2012, Algorithm 8), step 1) can be efficiently performed using the recursive property of $e_k$ introduced + +# Algorithm 3 Tree-based $k$ -DPP Sampling + +1: Input: $\mathbf{X} \in \mathbb{R}^{n \times d}$ , $\widehat{\mathbf{W}}^A \in \mathbb{R}^{d \times d}$ , $\mathbf{C} = \mathbf{X}^\top \mathbf{X} \in \mathbb{R}^{d \times d}$ , tree structure $\mathcal{T}$ + +2: $\pmb{U} \gets (\widehat{\pmb{W}}^A)^{-\frac{1}{2}}$ + +3: $\{(\pmb {v}_i,\lambda_i)\}_{i = 1}^d\gets$ Eigendecomp.of $U C U^{\top}$ + +4: Select size $k$ subset $E$ with prob. $\propto \prod_{i\in E}\lambda_{i}$ (Run Algorithm 8 in (Kulesza & Taskar, 2012)) + +5: $\pmb{Q} \gets \pmb{U}\left(\sum_{i \in E} \lambda_i^{-1} \pmb{v}_i \pmb{v}_i^\top\right) \pmb{U}^\top$ + +6: $Y\gets \emptyset$ + +7: for $j = 1, \dots, k$ do + +8: Sample $a$ with probability $\langle Q, x_a x_a^\top \rangle$ using the tree structure $\mathcal{T}$ (▷ Run Algorithm 3 in (Han et al., 2022)) + +9: $Y\gets Y\cup \{a\}$ + +10: $Q \gets Q - QX_{Y,:}^{\top}\left(X_{Y,:}QX_{Y,:}^{\top}\right)^{-1}X_{Y,:}Q$ + +11: end for + +12: Return $Y$ + +in Equation (4), resulting in $\mathcal{O}(dk)$ runtime. Notice that step 2) is a computational bottleneck for $k$ -DPP sampling. However, this step can be accelerated using tree-based sampling, which we describe next. + +Specifically, let $S \subseteq [n]$ be a subset that we wish to sample. For any $Y \subseteq [n]$ and $a \notin Y$ observe that + +$$ +\begin{array}{l} \mathcal {P} _ {\boldsymbol {K} ^ {E}} (a \in S | Y \subseteq S) = \frac {\det (\boldsymbol {K} _ {Y \cup \{a \}} ^ {E})}{\det (\boldsymbol {K} _ {Y} ^ {E})} \\ = \boldsymbol {K} _ {a, a} ^ {E} - \boldsymbol {K} _ {a, Y} ^ {E} \left(\boldsymbol {K} _ {Y} ^ {E}\right) ^ {- 1} \boldsymbol {K} _ {Y, a} ^ {E} = \left\langle \boldsymbol {Q} ^ {Y}, \boldsymbol {x} _ {a} ^ {\top} \boldsymbol {x} _ {a} \right\rangle , \tag {13} \\ \end{array} +$$ + +where $Q^{Y} \coloneqq M - MX_{Y,:}^{\top}(X_{Y,:}MX_{Y,:}^{\top})^{-1}X_{Y,:}M$ , $M \coloneqq U\left(\sum_{i\in E}\lambda_i^{-1}\pmb {v}_i\pmb {v}_i^{\top}\right)U$ , and $\pmb{x}_a\in \mathbb{R}^d$ is the $a$ -th row vector in $X$ . This implies that we can begin with $Y\gets \emptyset$ and iteratively append $a$ to $Y$ , where $a$ is selected with the probability described in Equation (13). The process of selecting a single element can be done in a divide-and-conquer manner by leveraging a binary tree structure. + +We construct a binary tree where the root contains $[n]$ and assigns a partition $A_{\ell}, A_{r}$ of $[n]$ to its left and right nodes. The branching proceeds until $n$ leaf nodes are created. In addition, every non-leaf node contains a $d$ -by- $d$ matrix $\sum_{a \in A} \boldsymbol{x}_a^\top \boldsymbol{x}_a$ , where $A$ is the stored subset. Sampling a single element can be done by traversing the tree with the query matrix $Q^Y$ . In every non-leaf node containing a subset $A$ , we move down to the left branch with probability + +$$ +\frac {\left\langle \boldsymbol {Q} ^ {Y} , \sum_ {a \in A _ {\ell}} \boldsymbol {x} _ {a} ^ {\top} \boldsymbol {x} _ {a} \right\rangle}{\left\langle \boldsymbol {Q} ^ {Y} , \sum_ {a \in A} \boldsymbol {x} _ {a} ^ {\top} \boldsymbol {x} _ {a} \right\rangle} \tag {14} +$$ + +or otherwise to the right branch, until we reach a leaf node. The tree traversal process is repeated for $k$ iterations, because every subset sampled from the elementary DPP has + +exactly $k$ elements. If we construct a binary tree of depth $\mathcal{O}(\log n)$ , which requires time $\mathcal{O}(nd^2)$ , then step 2 can run in time $\mathcal{O}(kd^2\log n + k^2 d^2)$ . We summarize the tree-based $k$ -DPP sampling in Algorithm 3 and provide the overall runtime in Theorem 2. + +Theorem 2. Given $\mathbf{X} \in \mathbb{R}^{n \times d}$ , and symmetric and PSD $\widehat{\mathbf{W}}^A \in \mathbb{R}^{d \times d}$ , Algorithm 3 samples a subset from the $k$ -DPP with kernel $\mathbf{L} = \mathbf{X}\widehat{\mathbf{W}}^A\mathbf{X}^\top$ , and runs in time $\mathcal{O}(kd^2\log n + k^2 d^2 + d^3)$ , after a one-time preprocessing step that runs in time $\mathcal{O}(nd^2)$ . + +We provide the proof of Theorem 2 in Appendix C.2. The runtime of our tree-based sampling algorithm improves that of previous work (Gillenwater et al., 2019), which is $\mathcal{O}(k^2 d^2\log n + d^3)$ . We also remark that the binary tree used in (Han et al., 2022) is slightly different from ours. They build a tree using the eigenvectors of the kernel, while our tree structure is based on the non-orthogonal features $\mathbf{X}$ . This allows our tree to be used for sublinear-time sampling for any DPP with kernel $XAX^{\top}$ , with an arbitrarily symmetric and PSD matrix $A\in \mathbb{R}^{d\times d}$ , as is the case for our MCMC-based $k$ -NDPP sampling approach. + +We remind the reader that the rejection-based up operator requires sampling from a 2-DPP (line 6 in Algorithm 2). From Theorem 2, sampling from the proposal distribution runs in $\mathcal{O}(d^2\log n + d^3)$ time. However, as discussed in Section 3.1, this process is repeated until the sample is accepted. In the next section, we examine the average number of rejections in Algorithm 2. + +# 4. Runtime Analysis + +We first define the ratio of the largest and smallest singular values of the conditional kernel components, which will affect the average number of rejections. + +Definition 3. Given $\mathbf{X} \in \mathbb{R}^{n \times d}$ and $\mathbf{W} \in \mathbb{R}^{d \times d}$ , such that $\mathbf{W} + \mathbf{W}^{\top} \succeq 0$ and $A \in \binom{[n]}{k-2}$ for $k \geq 2$ , consider $\mathbf{W}^A$ as defined in Equation (6). Define + +$$ +\kappa_ {A} := \frac {\sigma_ {\max} (\pmb {W} ^ {A} - \pmb {W} ^ {A ^ {\top}})}{\min _ {Y \in \binom {[ n ] \backslash A} {2}} \sigma_ {\min} ([ \pmb {X} (\pmb {W} ^ {A} + \pmb {W} ^ {A ^ {\top}}) \pmb {X} ^ {\top} ] _ {Y})}. +$$ + +and $\kappa \coloneqq \max_{A\subseteq [n],|A|\leq d - 2}\kappa_A$ + +We now provide an upper bound on the average number of rejections in Algorithm 2. + +Theorem 4. Given $\mathbf{X} \in \mathbb{R}^{n \times d}$ and $\mathbf{W} \in \mathbb{R}^{d \times d}$ , such that $\mathbf{W} + \mathbf{W}^{\top} \succeq 0$ and $A \in \binom{n}{k-2}$ for $k \geq 2$ , consider $\kappa_A$ as in Definition 3. Then, the average number of rejections of the rejection-based up operator (Algorithm 2) is no greater than $(1 + \sigma_{\max}(\mathbf{X})^2 \kappa_A)^2$ . + +Proof Sketch. First, we observe that the average number of + +rejections can be expressed as + +$$ +\frac {\sum_ {Y \in \binom {[ n ] \backslash A} {2}} \det \left(\left[ \boldsymbol {X} \widehat {\boldsymbol {W}} ^ {A} \boldsymbol {X} ^ {\top} \right] _ {Y}\right)}{\sum_ {Y \in \binom {[ n ] \backslash A} {2}} \det \left(\left[ \boldsymbol {X} \boldsymbol {W} ^ {A} \boldsymbol {X} ^ {\top} \right] _ {Y}\right)}. \tag {15} +$$ + +Instead of bounding the above directly, we consider $\max_{Y\in \binom{[n]\setminus A}{2}}\frac{\operatorname*{det}([\widehat{\boldsymbol{X}\widehat{\boldsymbol{W}}^A}\boldsymbol{X}^\top]_Y)}{\operatorname*{det}([\widehat{\boldsymbol{X}\boldsymbol{W}^A}\boldsymbol{X}^\top]_Y)}$ , which upper bounds Equation (15). In addition, observing that the denominator is no less than $\sum_{Y\in \binom{[n]\setminus A}{2}}\operatorname*{det}([\boldsymbol{X}(\frac{\boldsymbol{W}^A + \boldsymbol{W}^A^\top}{2})\boldsymbol{X}^\top]_Y)$ , we can derive the bound as a determinant of a 2-by-2 symmetric and PSD matrix. This can be bounded by the singular values of the kernel. A full proof is provided in Appendix C.3. + +We observe that the matrices in the numerator and denominator of the factor $\kappa_{A}$ in Definition 3 are bounded by the largest and smallest eigenvalues among some 2-by-2 matrices (see Equation (39) in Appendix C.3). There is no dependency on $d$ here, and therefore the number of rejections does not depend on either $n$ or $d$ . In Section 6.3, we empirically verify that the actual rejection numbers are very small compared to $n$ both for synthetic and real-world datasets. For example, for the Book recommendation dataset with $n\simeq 10^{6}$ (Wan & McAuley, 2018), we see only 3 rejections on average. This makes our rejection-based MCMC sampling algorithm practical for NDPPs with large $n$ . + +Putting all of the above together, we provide the overall runtime for our MCMC sampling algorithm for $k$ -NDPPs in the following proposition. + +Proposition 5. Given $\mathbf{X} \in \mathbb{R}^{n \times d}$ and $\mathbf{W} \in \mathbb{R}^{d \times d}$ , such that $\mathbf{W} + \mathbf{W}^{\top} \succeq 0$ and $k \geq 2$ , consider $\kappa$ as defined in Definition 3. With a preprocessing step that runs in time $\mathcal{O}(nd^2)$ , Algorithm 1 runs in time $\mathcal{O}(t_{\mathrm{iter}}(1 + \sigma_{\max}(\mathbf{X})^2\kappa)^2(d^2\log n + d^3))$ in expectation. + +The proof of Proposition 5 can be found in Appendix C.4. Note that the size $k$ only affects the number of MCMC iterations $t_{\mathrm{iter}}$ , since each transition of the MCMC algorithm requires sampling from a 2-NDPP. Moreover, as mentioned in Section 2.2, $t_{\mathrm{iter}} = \mathcal{O}(k^2\log \frac{1}{\varepsilon\operatorname*{Pr}(S_0)})$ guarantees convergence. Therefore, our MCMC algorithm runs in time that is sublinear in $n$ and polynomial in both $k$ and $d$ . In Section 6.1, we compare the MCMC sampling algorithm (Algorithm 1) to the exact sampler by empirically evaluating the total variation (TV) distance to the ground-truth distribution. We observe that the TV distance of the MCMC sampler with $t_{\mathrm{iter}} = k^2$ decreases as fast as the exact sampler when the number of samples increases. + +# 5. Extension from $k$ -NDPPs to Unconstrained NDPPs + +In this section we show that any $k$ -NDPP sampling algorithm can be transformed into an unconstrained-size NDPP + +![](images/693a7bf5bcf16223c87b1a5566bc637bd48c81584e83066b49aeeb3ef0911a8d.jpg) +(a) $k$ -NDPP + +![](images/cafd91e662da4359a74d9808b7e4529773303ddcbefe3f621f6d058c8dc20253.jpg) +(b) NDPP + +![](images/7d25eead61f256abb326ec73dadc6879bb022996908d975b2be53cf83280925a.jpg) +Figure 1. Total variation distance between the exact sampler and our proposed MCMC sampler for (a) a $k$ -NDPP and (b) a unconstrained-size NDPP. We use synthetically-generated NDPP kernels with $n = 10, d = 8, k = 5$ , and set $t_{\mathrm{iter}} = 25$ for our MCMC algorithm. +(a) +Figure 2. Wall-clock runtime for the preprocessing and sampling steps of our scalable MCMC algorithm, for $k$ -NDPPs with synthetic kernels. In (a) we vary $n \in \{10^2, \dots, 10^6\}$ and set $k = 10$ , and in (b) vary $k \in \{10, \dots, 100\}$ , and set $n = 10^6$ . + +![](images/ffae2c69d7cd319d793986f1c4df8b7a2dac49bf521bc8dd713592f84d836347.jpg) +(b) + +# Algorithm 4 MCMC Sampling for NDPP + +1: Input: $\mathbf{X} \in \mathbb{R}^{n \times d}$ , $\mathbf{W} \in \mathbb{R}^{d \times d}$ +2: $\{(\lambda_i, \boldsymbol{v}_i)\}_{i=1}^d \gets$ Eigendecomp. of $\boldsymbol{W} \boldsymbol{X}^\top \boldsymbol{X}$ +3: Compute elementary symmetric polynomials $\{e_k\}_{k=0}^d$ of $\{\lambda_i\}_{i=1}^d$ ( $\triangleright$ Run Algorithm 7 in (Kulesza & Taskar, 2012)) +4: Sample $k \in \{ 0,1,\ldots ,d\}$ with prob. $\propto {e}_{k}$ +5: Compute $t_{\mathrm{iter}}$ with the chosen $k$ (e.g., $t_{\mathrm{iter}} = k^2$ ) +6: Construct a binary tree $\mathcal{T}$ with $X$ +7: $S\gets$ Run Algorithm 1 with $\mathcal{T},\mathbf{X},\mathbf{W},k,t_{\mathrm{iter}}$ +8: Return $S$ + +sampling algorithm, with a marginal cost for preprocessing. A simple approach for using a $k$ -NDPP sampler to perform NDPP sampling consists of two steps: 1) first, sample a random variable $k \in \{0,1,\dots,d\}$ with probability proportional to the normalization constant of the $k$ -NDPP, and then 2) run any $k$ -NDPP sampling algorithm with the chosen $k$ . From Equation (3), the normalization constant of a $k$ -NDPP is equal to the $k$ -th elementary symmetric polynomial $e_k(\{\lambda_i\}_{i=1}^d)$ , where $\{\lambda_i\}_{i=1}^d$ are the nonzero eigenvalues of the rank- $d$ kernel. Once we obtain the eigenvalues in $\mathcal{O}(nd^2)$ time, the corresponding $e_k$ 's can be computed in $\mathcal{O}(dk)$ time using Equation (4). The MCMC sampling algorithm for NDPPs is outlined in Algorithm 4. + +We consider the computation of the $e_k$ 's as a preprocessing step, because we re-use these values for drawing subsequent NDPP samples. The runtime complexity of this preprocessing step is $\mathcal{O}(nd^2)$ , which is equivalent to the runtime complexity of preprocessing for our sublinear-time MCMC sampling algorithm for $k$ -NDPPs. + +We describe the overall runtime of Algorithm 4 in the following proposition. + +Proposition 6. Given $\mathbf{X} \in \mathbb{R}^{n \times d}$ and $\mathbf{W} \in \mathbb{R}^{d \times d}$ , such that $\mathbf{W} + \mathbf{W}^{\top} \succeq 0$ , consider $\kappa$ as in Definition 3. With a preprocessing step that runs in time $\mathcal{O}(nd^2)$ , Algorithm 4 runs in time $\mathcal{O}(t_{\mathrm{iter}}(1 + \sigma_{\max}(\mathbf{X})^2\kappa)^2(d^2\log n + d^3))$ in expectation. + +Previous work on exact NDPP sampling (Han et al., 2022) also has runtime that is sublinear in $n$ . However, their algorithm has runtime that is exponential in the rank of kernel $d$ (see Theorem 2 therein). In contrast, our MCMC-based approximate sampling algorithm runs in time polynomial in $d$ , because of $t_{\mathrm{iter}} = \widetilde{\mathcal{O}}(d^2)$ . Such a gap makes our approximate MCMC sampler feasible to run in cases where the exact sampler does not terminate for several days in some real-world settings; see Section 6.3 for details. + +# 6. Experiments + +In this section, we report empirical results for our experiments involving several NDPP sampling algorithms, for NDPPs with and without size constraints. + +# 6.1. Convergence of MCMC Sampling + +We first benchmark our MCMC sampling algorithm and compare it to the exact sampler for both $k$ -NDPPs and unconstrained-size NDPPs. We randomly generate $V, B \in \mathbb{R}^{n \times d/2}$ , where each entry is sampled from $\mathcal{N}(0, \sqrt{2/d})$ ; $D \in \mathbb{R}^{d/2 \times d/2}$ , where each entry is sampled from $\mathcal{N}(0, 1)$ ; and then construct the NDPP kernel as $L = V V^{\top} + B (D - D^{\top}) B^{\top}$ . We collect samples from each sampling algorithm and evaluate the empirical total variation (TV) distance, i.e., $\max_{S} |p(S) - q(S)|$ , where $p$ and $q$ correspond to the ground-truth and empirical distributions from the samplers, respectively. We set $n = 10, d = 8, k = 5$ , and draw up to $10^{6}$ random samples from each sampler. For our MCMC algorithm, we set $t_{\mathrm{iter}} = k^{2}$ . The results are shown in + +Table 2. Number of rejections and runtime (in seconds), for sampling and preprocessing, for $k$ -NDPP and unconstrained-size NDPP sampling algorithms. Runtimes in the top three rows report sampling times, and the bottom row shows the preprocessing times of our MCMC algorithm. Bold values indicate the fastest runtimes, and (*) indicates the expected results for those cases where the sampling algorithm does not terminate within a feasible timeframe. + +
TaskMetricAlgorithmUK Retail +n = 3,941Recipe +n = 7,993Instacart +n = 49,677Million Song +n = 371,410Book +n = 1,059,437
k=10RuntimeExact (Rejection)4062.193.70.130.46
MCMC (Ours)25.414.521.09.523.7
# of RejectionsExact (Rejection)2088079.231022.28.5
MCMC (Ours)7.83.56.00.86.8
k=50RuntimeExact (Rejection)(*)5.11×1012(*)9.55×105(*)9.50×105(*)1.45×1012(*)4.06×106
MCMC (Ours)334229242488374
# of RejectionsExact (Rejection)(*)2.83×1013(*)4.94×106(*)4.63×106(*)4.66×1012(*)1.65×107
MCMC (Ours)3.81.31.65.43.2
UnconstrainedRuntimeExact (Cholesky)5.611.571.15371540
Exact (Rejection)(*)1.34×1081.01351.6(*)1.89×10101022
MCMC (Ours)75.311.82128180
# of RejectionsExact (Rejection)(*)1.50×10945.327941.7(*)6.91×101013924.5
MCMC (Ours)6.03.65.77.29.8
PreprocessingRuntimeMCMC (Ours)1.02.214.030.874.3
+ +Figure 1. We observe that the TV distance of MCMC sampling decays as fast as that of the exact sampler for both $k$ -NDPPs and NDPPs. This indicates that setting the number of MCMC iterations to $k^2$ is sufficient for convergence to the target distribution. Therefore, we use $t_{\mathrm{iter}} = k^2$ for all of our experiments. In Appendix A.5, we additionally validate our choice for $t_{\mathrm{iter}}$ by evaluating the Potential Scale Reduction Factor (PSRF), commonly used to measure the convergence of the Markov chains (Gelman & Rubin, 1992). + +# 6.2. Runtimes for Synthetic Datasets + +Next, we report the runtimes of both the preprocessing and sampling steps of our proposed MCMC algorithm. We generate random NDPP kernels using the same approach described above, and measure the actual runtime in seconds. In Figure 2(a), we vary the size of ground set $n$ from $10^{2}$ to $10^{6}$ while fixing $d = 100$ , $k = 10$ . In Figure 2(b), we vary $k$ from 10 to 100 while $n = 10^{6}$ , $d = 100$ are fixed. As discussed in Proposition 5, we verify that the preprocessing time increases linearly with respect to $n$ , and that the sampling time tends to grow sublinearly in $n$ . Interestingly, we notice that the sampling times for both $n = 10^{2}$ and $10^{6}$ are almost identical, at about 10 seconds. This indicates that our algorithm scales well with respect to $n$ , and is suitable for large-scale settings. We also see that our sampling algorithm scales superlinearly with $k$ , because the number of MCMC iterations is set to $t_{\mathrm{iter}} = k^2$ . + +# 6.3. Runtimes for Recommendation Datasets + +To investigate the practical performance of our proposed sampling algorithms, we apply them to NDPP kernels learned from five real-world recommendation datasets, used in (Han et al., 2022). The ground set size $n$ varies from 3,941 to 1 million, while the rank of the kernel is generally set to $d = 200$ for all datasets. More details on these datasets can be found in Appendices A.2 and A.3. We learn the low-rank components of the NDPP kernels, $V, B, D$ , using gradient-based maximum likelihood estimation, as described in (Gartrell et al., 2021).3 We run our algorithms for $k$ -NDPPs with sizes $k = 10$ and 50, and unconstrained-size NDPPs, and compare our MCMC algorithms to the exact rejection-based sampling algorithm (Han et al., 2022). We omit the naïve MCMC algorithm (Alimohammadi et al., 2021), which runs in quadratic time in $n$ , from our experiments, because it is over 1,000 times slower than our sampling method for synthetic NDPP kernels with $n = 1,000$ . For NDPP sampling, we also test the Cholesky-based sampling algorithm (Poulson, 2020), which has linear runtime in $n$ . In Table 2, we report the runtimes of each sampling algorithm, as well as the number of rejections if the algorithm is based on rejection sampling. + +We observe that for the 10-NDPP, the exact sampling algo + +rithm often runs faster than our MCMC method, e.g., for the Recipe, Million Song, and Book datasets. However, for the 50-NDPP, the exact sampling algorithm results in a very large number of rejections on average, and thus is infeasible for all datasets. On the other hand, our MCMC sampler always terminates within a few minutes, running orders of magnitude faster than the exact sampling algorithm. For NDPP sampling, our algorithm is also orders of magnitude faster for the UK Retail and Million Song datasets. In Appendix A.4, we also apply those sampling algorithms to NDPP kernels learned with an orthogonality constraint (known as ONDPPs), which is tailored to ensure a small number of rejections for NDPP sampling (Han et al., 2022). These results show that reducing the runtime complexity from exponential to polynomial time can be very important in practice. Additionally, for NDPP sampling, we see up to a 13 times speedup for our method compared to the linear-time Cholesky-based sampling algorithm. + +# 7. Conclusion + +We have shown in this work how to accelerate MCMC sampling for $k$ -NDPPs by leveraging a tree-based rejection sampling algorithm. Our proposed sampling algorithm achieves runtime that is sublinear in $n$ , and polynomial in $d$ and $k$ . We have also extended our scalable $k$ -NDPP MCMC sampling approach to NDPP sampling, while preserving the same efficient runtime. Compared to the fastest state-of-the-art exact sampling algorithms for $k$ -NDPPs and NDPPs, which have runtime that is quadratic in $n$ or exponential in $d$ , respectively, our method makes sampling feasible for large-scale real-world settings by showing significantly faster and more scalable runtimes. + +# Acknowledgement + +Insu Han was supported by TATA DATA Analysis (grant no. 105676). Amin Karbasi acknowledges funding in direct support of this work from NSF (IIS-1845032), ONR (N00014-19-1-2406), and the AI Institute for Learning-Enabled Optimization at Scale (TILOS). + +# References + +Alimohammadi, Y., Anari, N., Shiragur, K., and Vuong, T.-D. Fractionally log-concave and sector-stable polynomials: counting planar matchings and more. In Symposium on the Theory of Computing (STOC), 2021. +Anari, N. and Vuong, T.-D. From Sampling to Optimization on Discrete Domains with Applications to Determinant Maximization. arXiv preprint arXiv:2102.05347, 2021. +Anari, N., Gharan, S. O., and Rezaei, A. Monte Carlo Markov Chain Algorithms for Sampling Strongly + +Rayleigh Distributions and Determinantal Point Processes. In Conference on Learning Theory (COLT), 2016. +Celis, L. E., Deshpande, A., Kathuria, T., Straszak, D., and Vishnoi, N. K. On the Complexity of Constrained Determinantal Point Processes. In APPROX/RANDOM, 2017. +Chen, D., Sain, S. L., and Guo, K. Data mining for the online retail industry: A case study of RFM model-based customer segmentation using data mining. Journal of Database Marketing & Customer Strategy Management, 2012. +Derezinski, M. Fast determinantal point processes via distortion-free intermediate sampling. In Conference on Learning Theory (COLT), 2019. +Dupuy, C. and Bach, F. Learning determinantal point processes in sublinear time. In Conference on Artificial Intelligence and Statistics (AISTATS), 2018. +Gartrell, M., Brunel, V.-E., Dohmatob, E., and Krichene, S. Learning Nonsymmetric Determinantal Point Processes. In Neural Information Processing Systems (NeurIPS), 2019. +Gartrell, M., Han, I., Dohmatob, E., Gillenwater, J., and Brunel, V.-E. Scalable Learning and MAP Inference for Nonsymmetric Determinantal Point Processes. In International Conference on Learning Representations (ICLR), 2021. +Gelman, A. and Rubin, D. B. Inference from iterative simulation using multiple sequences. Statistical science, 1992. +Gillenwater, J., Kulesza, A., Mariet, Z., and Vassilvtiskii, S. A Tree-Based Method for Fast Repeated Sampling of Determinantal Point Processes. In International Conference on Machine Learning (ICML), 2019. +Han, I. and Gillenwater, J. MAP Inference for Customized Determinantal Point Processes via Maximum Inner Product Search. In Conference on Artificial Intelligence and Statistics (AISTATS), 2020. +Han, I., Gartrell, M., Gillenwater, J., Dohmatob, E., and Karbasi, A. Scalable Sampling for Nonsymmetric Determinantal Point Processes. In International Conference on Learning Representations (ICLR), 2022. +Instacart. The Instacart Online Grocery Shopping Dataset, 2017. URL https://www.instacart.com/datasets/grocery-shopping-2017. Accessed May 2020. +Kathuria, T., Deshpande, A., and Kohli, P. Batched gaussian process bandit optimization via determinantal point processes. Neural Information Processing Systems (NIPS), 2016. + +Kingma, D. P. and Ba, J. Adam: A method for stochastic optimization. In International Conference on Learning Representations (ICLR), 2015. +Kulesza, A. and Taskar, B. k-DPPs: Fixed-size Determinantal Point Processes. In International Conference on Machine Learning (ICML), 2011. +Kulesza, A. and Taskar, B. Determinantal Point Processes for Machine Learning. Foundations and Trends® in Machine Learning, 2012. +Li, C., Jegelka, S., and Sra, S. Fast DPP Sampling for Nystrom with Application to Kernel Methods. In International Conference on Machine Learning (ICML), 2016. +Majumder, B. P., Li, S., Ni, J., and McAuley, J. J. Generating Personalized Recipes from Historical User Preferences. In Empirical Methods in Natural Language Processing (EMNLP), 2019. +McFee, B., Bertin-Mahieux, T., Ellis, D. P., and Lanckriet, G. R. The million song dataset challenge. In International Conference on the World Wide Web (WWW), 2012. +Pang, T., Xu, K., Du, C., Chen, N., and Zhu, J. Improving adversarial robustness via promoting ensemble diversity. In International Conference on Machine Learning (ICML). PMLR, 2019. +Poulson, J. High-performance sampling of generic Determinantal Point Processes. Philosophical Transactions of the Royal Society A, 2020. +Rezaei, A. and Gharan, S. O. A polynomial time MCMC method for sampling from continuous determinantal point processes. In International Conference on Machine Learning (ICML), 2019. +Sharghi, A., Borji, A., Li, C., Yang, T., and Gong, B. Improving Sequential Determinantal Point Processes for Supervised Video Summarization. In Proceedings of the European Conference on Computer Vision (ECCV), 2018. +Tremblay, N., Barthelmé, S., and Amblard, P.-O. Determinantal Point Processes for Coresets. Journal of Machine Learning Research (JMLR), 2019. +Wan, M. and McAuley, J. Item recommendation on monotonic behavior chains. In Conference on Recommender Systems (RecSys), 2018. +Yang, Y., Wen, Y., Wang, J., Chen, L., Shao, K., Mguni, D., and Zhang, W. Multi-agent determinantal q-learning. In International Conference on Machine Learning (ICML), 2020. + +Youla, D. A normal form for a matrix under the unitary congruence group. Canadian Journal of Mathematics, 1961. +Zhang, C., Kjellström, H., and Mandt, S. Determinantal Point Processes for Mini-Batch Diversification. In Conference on Uncertainty in Artificial Intelligence (UAI), 2017. + +# A. Additional Details on Experimental Results + +# A.1. Efficient Tree Construction + +Although our MCMC sampler can be very fast for large-scale settings, we do note that consideration of the preprocessing cost is important. Notably, preprocessing requires construction of a binary tree with $\mathcal{O}(nd^2)$ memory space, which can be problematic in practice. To alleviate this, we suggest a fat-leaf tree structure, where each leaf node contains $B > 1$ elements. This reduces the number of nodes in the tree to $\mathcal{O}\left(\frac{n}{B}\right)$ , and thus memory space can be reduced to $\mathcal{O}\left(d^{2}\frac{n}{B}\right)$ . However, since tree-based sampling returns a leaf node with some probability, according to Line 8 in Algorithm 3, an additional cost for computing the probabilities required for selecting a single item is required, with runtime $\mathcal{O}(d^2 B)$ . Therefore, with this change, the tree-based 2-DPP sampling runtime becomes $\mathcal{O}\left(d^{2}\left(\frac{\log n}{B} + B\right) + d^{3}\right)$ . We set $B = 8$ for datasets with $n \geq 10^5$ elements, and observe that the additional runtime overhead is very marginal, while memory consumption is reduced by a factor of 8. + +# A.2. Full Details on Datasets + +We perform experiments on the following real-world public datasets: + +- UK Retail: This dataset (Chen et al., 2012) contains baskets representing transactions from an online retail company that sells all-occasion gifts. We omit baskets with more than 100 items, leaving us with a dataset containing 19,762 baskets drawn from a catalog of $n = 3,941$ products. Baskets containing more than 100 items are in the long tail of the basket-size distribution. +- Recipe: This dataset (Majumder et al., 2019) contains recipes and food reviews from Food.com (formerly Genius Kitchen) $^4$ . Each recipe ("basket") is composed of a collection of ingredients, resulting in 178,265 recipes and a catalog of 7,993 ingredients. +- Instacart: This dataset (Instacart, 2017) contains baskets purchased by Instacart users5. We omit baskets with more than 100 items, resulting in 3.2 million baskets and a catalog of 49,677 products. +- Million Song: This dataset (McFee et al., 2012) contains playlists ("baskets") of songs from Echo Nest users6. We trim playlists with more than 100 items, leaving 968,674 playlists and a catalog of 371,410 songs. +- Book: This dataset (Wan & McAuley, 2018) contains reviews from the Goodreads book review website, including a variety of attributes describing the items7. For each user we build a subset ("basket") containing the books reviewed by that user. We trim subsets with more than 100 books, resulting in 430,563 subsets and a catalog of 1,059,437 books. + +# A.3. Full Details on Experimental Setup + +NDPP kernel learning. We use the learning algorithm described in (Gartrell et al., 2021), where we learn the kernel components $V, B \in \mathbb{R}^{n \times d/2}, D \in \mathbb{R}^{d/2 \times d/2}$ by minimizing the regularized negative log-likelihood using training example subsets $\{Y_1, \ldots, Y_m\}$ : + +$$ +\begin{array}{l} \min _ {\boldsymbol {V}, \boldsymbol {B}, \boldsymbol {D}} - \frac {1}{m} \sum_ {i = 1} ^ {m} \log \det \left(\boldsymbol {V} _ {Y _ {i}} \boldsymbol {V} _ {Y _ {i}} ^ {\top} + \boldsymbol {B} _ {Y _ {i}} (\boldsymbol {D} - \boldsymbol {D} ^ {\top}) \boldsymbol {B} _ {Y _ {i}} ^ {\top}\right) \\ + \log \det \left(\boldsymbol {V} \boldsymbol {V} ^ {\top} + \boldsymbol {B} (\boldsymbol {D} - \boldsymbol {D} ^ {\top}) \boldsymbol {B} ^ {\top} + \boldsymbol {I}\right) + \alpha \sum_ {i = 1} ^ {n} \frac {\| \boldsymbol {v} _ {i} \| _ {2} ^ {2}}{\mu_ {i}} + \beta \sum_ {i = 1} ^ {n} \frac {\| \boldsymbol {b} _ {i} \| _ {2} ^ {2}}{\mu_ {i}}, \tag {16} \\ \end{array} +$$ + +where $\pmb{v}_i$ and $\pmb{b}_i$ are the $i$ -th row vectors of $\pmb{V}$ and $\pmb{B}$ , respectively. We also use the training scheme from (Han et al., 2022), where 300 randomly-selected baskets are held-out as a validation set for tracking convergence during training, + +Table 3. Number of rejections and runtime (in seconds) for $k$ -NDPP and unconstrained-size NDPP sampling algorithms, for ONDPP kernels learned with regularization on the number of NDPP sampling rejections. Bold values indicate the fastest runtimes, and (*) indicates the expected results for those cases where the sampling algorithm does not terminate within a feasible timeframe. + +
TaskMetricAlgorithmUK Retail +n=3,941Recipe +n=7,993Instacart +n=49,677Million Song +n=371,410Book +n=1,059,437
k=10RuntimeExact (Rejection)0.040.61.90.20.8
MCMC (Ours)6.59.011.88.310.7
# of RejectionsExact (Rejection)012.436.62.113.4
MCMC (Ours)00.91.30.30.9
k=50RuntimeExact (Rejection)0.4(*)7.33×109(*)1.92×10899.1(*)7.95×106
MCMC (Ours)140.7450.8307.9182.9285.2
# of RejectionsExact (Rejection)0.1(*)2.08×108(*)4.96×108239.7(*)1.61×107
MCMC (Ours)0.16.22.60.52.1
UnconstrainedRuntimeExact (Rejection)0.10.76.07.52.8
MCMC (Ours)23.18.311.781.317.1
# of RejectionsExact (Rejection)0.115.091.627.534.0
MCMC (Ours)0.01.11.30.40.9
+ +another 2000 random subsets are used for testing, and the remaining baskets are used for training. Convergence is reached during training when the relative change in validation log-likelihood is below a predetermined threshold. We use the Adam optimizer (Kingma & Ba, 2015); we initialize $\pmb{D}$ from $\mathcal{N}(0,1)$ , and $\pmb{V}$ and $\pmb{B}$ are initialized from the $\mathcal{U}([0,1])$ . We set $\alpha = \beta = 0.01$ for all datasets. + +ONDPP kernel learning. Unlike the NDPP kernel, the orthogonal NDPP (ONDPP) kernel (Han et al., 2022) is parameterized as $\boldsymbol{L} = \boldsymbol{V}\boldsymbol{V}^{\top} + \boldsymbol{B}(\boldsymbol{D} - \boldsymbol{D}^{\top})\boldsymbol{B}^{\top}$ , where + +$$ +\boldsymbol {D} = \operatorname {D i a g} \left(\left[ \begin{array}{c c} 0 & \sigma_ {1} \\ 0 & 0 \end{array} \right], \ldots , \left[ \begin{array}{c c} 0 & \sigma_ {d / 2} \\ 0 & 0 \end{array} \right]\right) \in \mathbb {R} ^ {d / 2 \times d / 2} +$$ + +and $\sigma_{j} > 0$ . The training objective is + +$$ +\min _ {\boldsymbol {V}, \boldsymbol {B}, \left\{\sigma_ {j} \right\} _ {j = 1} ^ {d / 2}} - \frac {1}{m} \sum_ {i = 1} ^ {m} \log \left(\frac {\operatorname* {d e t} \left(\boldsymbol {L} _ {\boldsymbol {Y} _ {i}}\right)}{\operatorname* {d e t} (\boldsymbol {L} + \boldsymbol {I})}\right) + \alpha \sum_ {i = 1} ^ {n} \frac {\| \boldsymbol {v} _ {i} \| _ {2} ^ {2}}{\mu_ {i}} + \beta \sum_ {i = 1} ^ {n} \frac {\| \boldsymbol {b} _ {i} \| _ {2} ^ {2}}{\mu_ {i}} + \gamma \sum_ {j = 1} ^ {d / 2} \log \left(1 + \frac {2 \sigma_ {j}}{\sigma_ {j} ^ {2} + 1}\right), \tag {17} +$$ + +with constraints $B^{\top}B = I$ and $V^{\top}B = 0$ . To satisfy the first constraint, Han et al. (2022) applies QR decomposition on $B$ ; for the second constraint, we project $V$ to the column space of $B$ by updating $V \gets V - B(B^{\top}B)^{-1}(B^{\top}V)$ . We use the regularizer settings from Han et al. (2022): $\alpha = \beta = 0.01$ , $\gamma = 0.5$ for the UK Retail dataset, $\alpha = \beta = 0.01$ , $\gamma = 0.1$ for Recipe, $\alpha = \beta = 0.001$ , $\gamma = 0.001$ for Instacart, $\alpha = \beta = 0.01$ , $\gamma = 0.2$ for Million Song, and $\alpha = \beta = 0.01$ , $\gamma = 0.1$ for Book. + +# A.4. Additional Experiments with ONDPPs + +We apply NDPP sampling algorithms in Section 6.3 to NDPP kernels learned with an orthogonality constraint (known as ONDPPs), studied in (Han et al., 2022). In particular, these kernels are learned using a regularization mechanism that guarantees a small number of NDPP sampling rejections. Therefore, we expect exact sampling with ONDPP kernels to run very quickly. Table 3 shows the results with real-world datasets and ONDPP kernels learned on these datasets. As expected, exact ONDPP sampling runs faster than our MCMC approach for unconstrained-size NDPPs. It also runs faster for 10-NDPP sampling. However, we see that for 50-NDPP the expected exact sampling runtimes are over 92 days for three datasets, while our MCMC approach always terminates within a few minutes. This substantial slowdown for 50-NDPP sampling results from the runtime being exponential in $k$ for exact sampling, which we are unable to mitigate using regularization during training. This suggests that for 50-NDPP sampling, our scalable MCMC algorithm is the best and only viable choice in practice. + +# A.5. Empirical Mixing Time with Potential Scale Reduction Factor (PSRF) + +We additionally validate the mixing times of our MCMC sampling algorithm (Algorithm 1) using the Potential Scale Reduction Factor (PSRF). PSRF computes the ratio of within-chain and between-chain variances and is frequently used for measuring the empirical mixing times of MCMC samplers. We used the synthetic dataset described in Section 6.1, and the PSRF implementation in tensorflow(probability.mcmc, with 100 independent chains for $n = \{100,200,\dots ,3200\} ,k = \{2,3,\dots ,30\}$ , and a fixed $d = 20$ . Interestingly, as shown in Figure 3, we observe that empirical mixing times increase linearly in $k$ for all choices of $n$ . We leave the problem of further improving the mixing time of our NDPP MCMC sampling algorithm for future work. + +![](images/f4eb9e8f8a11c55b62bf91db3a5b7b74caf081fa173cbb35f5a4c4086dbcbb1c.jpg) +Figure 3. Empirical mixing time, computed using Potential Scale Reduction Factor (PSRF), for our proposed NDPP MCMC sampling algorithm. + +# B. MAP Inference for Initialization + +We observe that the mixing time in Equation (5) also depends on the initial subset $S_0$ . It is desirable to find a size- $k$ subset $S_0$ where $\operatorname{det}(\boldsymbol{L}_{S_0})$ is as large as possible, and then use $S_0$ as the initial subset in Algorithm 1. This is known as the MAP inference problem for a DPP; that is, + +$$ +\operatorname *{argmax}_{\substack{S\in \binom {[n]}{k}}}\det (L_{S}). +$$ + +MAP inference for a NDPP is generally known to be NP-hard, and a greedy algorithm is typically used as a heuristic (Gartrell et al., 2021). In particular, Gartrell et al. (2021) showed that with a rank- $d$ NDPP kernel, greedy MAP inference runs in $\mathcal{O}(nd^2)$ time. Once we find a proper size- $k$ subset $S_0$ , we can re-use $S_0$ for drawing subsequent $k$ -NDPP samples. Therefore, for a faster mixing time, we utilize greedy MAP inference as a preprocessing step, while preserving the total preprocessing runtime described previously. + +Furthermore, this MAP-based initialization approach can also be used for NDPP sampling without size constraints. We note that the greedy algorithm finds elements in the output subset in a sequential way. In other words, if $\{s_1,\dots ,s_d\}$ is the output of the greedy algorithm with size constraint $d$ , then the algorithm with size constraint $k\leq d$ returns $\{s_1,\ldots ,s_k\}$ . Therefore, for NDPP sampling, we run the greedy algorithm to find a sequence of $d$ items that maximize the determinant of each principal submatrix of size $d$ . While running our MCMC NDPP sampler (Algorithm 4), if the size random variable $k$ is selected, then we run the MCMC $k$ -NDPP sampling (Algorithm 1) with the chosen $k$ and a subset containing the first $k\leq d$ elements in the sequence obtained from the greedy algorithm. In practice, for our experiments in Section 6.1 we observe that our MCMC sampler without greedy initialization shows promising convergence, and thus we omit this procedure in our experiments. + +# C. Proofs + +# C.1. Proof of Theorem 1 + +Theorem 1. Given $\mathbf{X} \in \mathbb{R}^{n \times d}$ and $\mathbf{W}^A \in \mathbb{R}^{d \times d}$ , suppose $\widehat{\mathbf{W}}^A$ is obtained from Equation (9) with $\mathbf{W}^A$ . Then, + +$$ +\det \left(\left[ \boldsymbol {X} \boldsymbol {W} ^ {A} \boldsymbol {X} ^ {\top} \right] _ {S}\right) \leq \det \left(\left[ \boldsymbol {X} \widehat {\boldsymbol {W}} ^ {A} \boldsymbol {X} ^ {\top} \right] _ {S}\right) \tag {10} +$$ + +for every $S \subseteq [n]$ . In addition, equality holds when $|S| \geq d$ . + +Proof. For simplicity, we write that $\pmb{G} := \pmb{X}(\frac{\pmb{W}^A + \pmb{W}^{A^\top}}{2})\pmb{X}^\top$ and $\pmb{A} := \pmb{X}(\frac{\pmb{W}^A - \pmb{W}^{A^\top}}{2})\pmb{X}^\top$ , so that $\pmb{X}\pmb{W}^A\pmb{X}^\top = \pmb{G} + \pmb{A}$ . Also, denote $\pmb{B} := \pmb{X}\widehat{\pmb{W}}^A\pmb{X}^\top - \pmb{G}$ . Since $\pmb{G}$ is positive semi-definite, for any $S \subseteq [n]$ such that $|S| \leq d$ , we have + +$$ +\begin{array}{l} \det \left(\left[ \boldsymbol {X} \boldsymbol {W} ^ {A} \boldsymbol {X} ^ {\top} \right] _ {S}\right) = \det \left(\boldsymbol {G} _ {S} + \boldsymbol {A} _ {S}\right) \\ = \det \left(\boldsymbol {G} _ {S} ^ {1 / 2} \left(\boldsymbol {I} + \boldsymbol {G} _ {S} ^ {- 1 / 2} \boldsymbol {A} _ {S} \boldsymbol {G} _ {S} ^ {- 1 / 2}\right) \boldsymbol {G} _ {S} ^ {1 / 2}\right) \\ = \det \left(\boldsymbol {G} _ {S} ^ {1 / 2}\right) \cdot \det \left(\boldsymbol {I} + \boldsymbol {G} _ {S} ^ {- 1 / 2} \boldsymbol {A} _ {S} \boldsymbol {G} _ {S} ^ {- 1 / 2}\right) \cdot \det \left(\boldsymbol {G} _ {S} ^ {1 / 2}\right) \tag {18} \\ \end{array} +$$ + +where $\pmb{I}$ is the $|S|$ -by- $|S|$ identity matrix. Similarly, + +$$ +\det \left(\left[ \boldsymbol {X} \widehat {\boldsymbol {W}} ^ {A} \boldsymbol {X} ^ {\top} \right] _ {S}\right) = \det \left(\boldsymbol {G} _ {S} ^ {1 / 2}\right) \cdot \det \left(\boldsymbol {I} + \boldsymbol {G} _ {S} ^ {- 1 / 2} \boldsymbol {B} _ {S} \boldsymbol {G} _ {S} ^ {- 1 / 2}\right) \cdot \det \left(\boldsymbol {G} _ {S} ^ {1 / 2}\right). \tag {19} +$$ + +From Theorem 2.1 in (Kulesza & Taskar, 2012), we have + +$$ +\det \left(\boldsymbol {I} + \boldsymbol {G} _ {S} ^ {- 1 / 2} \boldsymbol {A} _ {S} \boldsymbol {G} _ {S} ^ {- 1 / 2}\right) = \sum_ {T \subseteq [ | S | ]} \det \left(\left[ \boldsymbol {G} _ {S} ^ {- 1 / 2} \boldsymbol {A} _ {S} \boldsymbol {G} _ {S} ^ {- 1 / 2} \right] _ {T}\right), \tag {20} +$$ + +$$ +\det \left(\boldsymbol {I} + \boldsymbol {G} _ {S} ^ {- 1 / 2} \boldsymbol {B} _ {S} \boldsymbol {G} _ {S} ^ {- 1 / 2}\right) = \sum_ {T \subseteq [ | S | ]} \det \left(\left[ \boldsymbol {G} _ {S} ^ {- 1 / 2} \boldsymbol {B} _ {S} \boldsymbol {G} _ {S} ^ {- 1 / 2} \right] _ {T}\right). \tag {21} +$$ + +Therefore, it is enough to prove that for every $T \subseteq [|S|]$ + +$$ +\det \left(\left[ \boldsymbol {G} _ {S} ^ {- 1 / 2} \boldsymbol {A} _ {S} \boldsymbol {G} _ {S} ^ {- 1 / 2} \right] _ {T}\right) \leq \det \left(\left[ \boldsymbol {G} _ {S} ^ {- 1 / 2} \boldsymbol {B} _ {S} \boldsymbol {G} _ {S} ^ {- 1 / 2} \right] _ {T}\right). \tag {22} +$$ + +Now consider the Youla decomposition on $\frac{W^A - W^{A^\top}}{2}$ as in Equation (8), i.e., + +$$ +\frac {\boldsymbol {W} ^ {A} - \boldsymbol {W} ^ {A ^ {\top}}}{2} = \sum_ {i = 1} ^ {d / 2} \sigma_ {i} \left(\boldsymbol {y} _ {i} \boldsymbol {z} _ {i} ^ {\top} - \boldsymbol {z} _ {i} \boldsymbol {y} _ {i} ^ {\top}\right) = \boldsymbol {V} \operatorname {D i a g} \left(\left[ \begin{array}{l l} 0 & \sigma_ {1} \\ - \sigma_ {1} & 0 \end{array} \right], \dots , \left[ \begin{array}{l l} 0 & \sigma_ {\frac {d}{2}}, \\ - \sigma_ {\frac {d}{2}} & 0 \end{array} \right]\right) \boldsymbol {V} ^ {\top}, \tag {23} +$$ + +where $\pmb{V} := [y_1, z_1, \dots, y_{\frac{d}{2}}, z_{\frac{d}{2}}]$ . Then, it can be written + +$$ +\boldsymbol {G} _ {S} ^ {- 1 / 2} \boldsymbol {A} _ {S} \boldsymbol {G} _ {S} ^ {- 1 / 2} = \boldsymbol {G} _ {S} ^ {- 1 / 2} \boldsymbol {X} _ {S,:} \boldsymbol {V} \cdot \operatorname {D i a g} \left(\left[ \begin{array}{l l} 0 & \sigma_ {1} \\ - \sigma_ {1} & 0 \end{array} \right], \dots , \left[ \begin{array}{c c} 0 & \sigma_ {\frac {d}{2}}, \\ - \sigma_ {\frac {d}{2}} & 0 \end{array} \right]\right) \cdot \boldsymbol {V} ^ {\top} \boldsymbol {X} _ {S,:} ^ {\top} \boldsymbol {G} _ {S} ^ {- 1 / 2} := \boldsymbol {R}, \tag {24} +$$ + +$$ +\boldsymbol {G} _ {S} ^ {- 1 / 2} \boldsymbol {B} _ {S} \boldsymbol {G} _ {S} ^ {- 1 / 2} = \boldsymbol {G} _ {S} ^ {- 1 / 2} \boldsymbol {X} _ {S,:} \boldsymbol {V} \cdot \operatorname {D i a g} \left(\sigma_ {1}, \sigma_ {1}, \dots , \sigma_ {\frac {d}{2}}, \sigma_ {\frac {d}{2}}\right) \cdot \boldsymbol {V} ^ {\top} \boldsymbol {X} _ {S,:} ^ {\top} \boldsymbol {G} _ {S} ^ {- 1 / 2} := \widehat {\boldsymbol {R}}. \tag {25} +$$ + +From Theorem 1 in (Han et al., 2022), it holds that $\operatorname{det}(\mathbf{R}_T) \leq \operatorname{det}(\widehat{\mathbf{R}}_T)$ for all $T \subseteq [|S|]$ . This completes the proof of Theorem 1. + +# C.2. Proof of Theorem 2 + +Theorem 2. Given $\mathbf{X} \in \mathbb{R}^{n \times d}$ , and symmetric and PSD $\widehat{\mathbf{W}}^A \in \mathbb{R}^{d \times d}$ , Algorithm 3 samples a subset from the $k$ -DPP with kernel $\mathbf{L} = \mathbf{X} \widehat{\mathbf{W}}^A \mathbf{X}^\top$ , and runs in time $\mathcal{O}(kd^2 \log n + k^2 d^2 + d^3)$ , after a one-time preprocessing step that runs in time $\mathcal{O}(nd^2)$ . + +Proof. The preprocessing for the $k$ -DPP sampler includes (1) a binary tree construction based on $\mathbf{X} \in \mathbb{R}^{n \times d}$ and (2) computing $\mathbf{C} = \mathbf{X}^{\top} \mathbf{X} \in \mathbb{R}^{d \times d}$ . Both can be done in $\mathcal{O}(nd^2)$ time. Given this preprocessing, Algorithm 3 first performs the eigendecomposition of $UCU^{\top}$ , which requires $\mathcal{O}(d^3)$ time. Then, a subset $E \subseteq [d]$ is sampled with probability proportional to $\prod_{i \in E} \lambda_i$ where the $\lambda_i$ 's are the eigenvalues of $UCU^{\top}$ . With (Kulesza & Taskar, 2012, Algorithm 8), this can be done in $\mathcal{O}(dk)$ time. Next, we need to perform tree-based sampling and query matrix updates for $k$ iterations. Since the tree has depth $\mathcal{O}(\log n)$ , and computing the required probability for moving down the tree takes $\mathcal{O}(d^2)$ time, the tree-based sampler requires $\mathcal{O}(d^2 \log n)$ time. In addition, computation of the query matrix runs in $\mathcal{O}(d^2 k)$ . Therefore, the overall runtime of Algorithm 3 (after preprocessing) is $\mathcal{O}(d^3 + kd^2 \log n + k^2 d^2)$ . This improves the runtime of $\mathcal{O}(d^3 + k^2 d^2 \log n)$ from previous work (Gillenwater et al., 2019), which uses an alternative probability formulation for the tree traversal in Equation (14) that needs several matrix multiplications in every tree node, resulting in $\mathcal{O}(k^2 d^2 \log n)$ runtime. In our algorithm, these matrix multiplications are computed with a query matrix, outside of the tree traversal. + +# C.3. Proof of Theorem 4 + +Theorem 4. Given $\mathbf{X} \in \mathbb{R}^{n \times d}$ and $\mathbf{W} \in \mathbb{R}^{d \times d}$ , such that $\mathbf{W} + \mathbf{W}^{\top} \succeq 0$ and $A \in \binom{[n]}{k-2}$ for $k \geq 2$ , consider $\kappa_A$ as in Definition 3. Then, the average number of rejections of the rejection-based up operator (Algorithm 2) is no greater than $(1 + \sigma_{\max}(\mathbf{X})^2 \kappa_A)^2$ . + +Proof. Let $p$ be the probability distribution of the target 2-NDPP with kernel $X\mathbf{W}^A\mathbf{X}^\top$ , and $q$ be that of the proposal 2-DPP with kernel $X\widehat{\mathbf{W}}^{A}\mathbf{X}^{\top}$ . For every $S \in \binom{[n]\backslash A}{2}$ , it holds that + +$$ +\begin{array}{l} p(S) = \frac{\operatorname*{det}([\boldsymbol{X}\boldsymbol{W}^{A}\boldsymbol{X}^{\top}]_{S})}{\sum_{\{a,b\} \in\binom{[n]\setminus A}{2}}\operatorname*{det}([\boldsymbol{X}\boldsymbol{W}^{A}\boldsymbol{X}^{\top}]_{\{a,b\}})} \\ \leq \frac {\operatorname* {d e t} ([ \boldsymbol {X} \widehat {\boldsymbol {W}} ^ {A} \boldsymbol {X} ^ {\top} ] _ {S})}{\sum_ {\{a , b \} \in \binom {[ n ] \backslash A} {2}} \operatorname* {d e t} ([ \boldsymbol {X} \boldsymbol {W} ^ {A} \boldsymbol {X} ^ {\top} ] _ {\{a , b \}})} \\ = \frac {\sum_ {\{a , b \} \in \binom {[ n ] \backslash A} {2}} \det ([ X \widehat {W} ^ {A} X ^ {\top} ] _ {\{a , b \}})}{\sum_ {\{a , b \} \in \binom {[ n ] \backslash A} {2}} \det ([ X W ^ {A} X ^ {\top} ] _ {\{a , b \}})} \cdot \frac {\det ([ X \widehat {W} ^ {A} X ^ {\top} ] _ {S})}{\sum_ {\{a , b \} \in \binom {[ n ] \backslash A} {2}} \det ([ X \widehat {W} ^ {A} X ^ {\top} ] _ {\{a , b \}})} \\ = \frac {\sum_ {\{a , b \} \in \binom {[ n ] \backslash A} {2}} \det ([ \boldsymbol {X} \widehat {\boldsymbol {W}} ^ {A} \boldsymbol {X} ^ {\top} ] _ {\{a , b \}})}{\sum_ {\{a , b \} \in \binom {[ n ] \backslash A} {2}} \det ([ \boldsymbol {X} \boldsymbol {W} ^ {A} \boldsymbol {X} ^ {\top} ] _ {\{a , b \}})} \cdot q (S), \\ \end{array} +$$ + +where the inequality comes from Theorem 1. This tells us that the average number of rejections is equal to + +$$ +\begin{array}{l} \sum_ {\{a, b \} \in \binom {[ n ] \backslash A} {2}} \det ([ \boldsymbol {X} \widehat {\boldsymbol {W}} ^ {A} \boldsymbol {X} ^ {\top} ] _ {\{a, b \}}) \\ \hline \sum_ {\{a, b \} \in \binom {[ n ] \backslash A} {2}} \det ([ \boldsymbol {X} \boldsymbol {W} ^ {A} \boldsymbol {X} ^ {\top} ] _ {\{a, b \}}). \end{array} \tag {26} +$$ + +Instead of finding an upper bound on the above directly, we consider the following + +$$ +\max_{\{a,b\} \in \binom {\lceil n\rceil \setminus A}{2}}\frac{\operatorname*{det}(\left[\boldsymbol{X}\widehat{\boldsymbol{W}}^{A}\boldsymbol{X}^{\top}\right]_{\{a,b\}})}{\operatorname*{det}(\left[\boldsymbol{X}\boldsymbol{W}^{A}\boldsymbol{X}^{\top}\right]_{\{a,b\}})}, +$$ + +which is greater than or equal to expression (26). + +Now, for any symmetric and positive semidefinite (SPSD) matrix $M$ , we denote by $\lambda_{\max}(M)$ and $\lambda_{\min}(M)$ the largest and smallest nonzero eigenvalues of $M$ , respectively. Let $S := \frac{W^A + W^{A^\top}}{2}$ and $\pmb{R} := \widehat{\pmb{W}}^A - \pmb{S}$ . From the construction of $\widehat{\pmb{W}}^A$ in Equation (9), it is easy to check that both $\pmb{S}$ and $\pmb{R}$ are SPSD. First we claim that for any $Y \subseteq [n] \setminus A$ , it holds that + +$$ +\det \left(\left[ \boldsymbol {X} \boldsymbol {W} ^ {A} \boldsymbol {X} ^ {\top} \right] _ {Y}\right) \geq \det \left(\left[ \boldsymbol {X} \boldsymbol {S} \boldsymbol {X} ^ {\top} \right] _ {Y}\right). \tag {27} +$$ + +This comes from the following. If $\operatorname*{det}([X\pmb {S}\pmb{X}^{\top}]_{Y}) = 0$ , the result is trivial due to $\operatorname *{det}([\pmb {X}\pmb {W}^{A}\pmb{X}^{\top}]_{Y})\geq 0$ for all $Y$ + +Assume that $\operatorname*{det}([X\mathbf{S}\mathbf{X}^{\top}]_{Y})\neq 0$ , then + +$$ +\begin{array}{l} \frac {\operatorname* {d e t} \left(\left[ \boldsymbol {X} \boldsymbol {W} ^ {A} \boldsymbol {X} ^ {\top} \right] _ {Y}\right)}{\operatorname* {d e t} \left(\left[ \boldsymbol {X} \boldsymbol {S} \boldsymbol {X} ^ {\top} \right] _ {Y}\right)} = \frac {\operatorname* {d e t} \left(\left[ \boldsymbol {X} \boldsymbol {S} \boldsymbol {X} ^ {\top} \right] _ {Y} + \left[ \boldsymbol {X} \left(\boldsymbol {W} ^ {A} - \boldsymbol {S}\right) \boldsymbol {X} ^ {\top} \right] _ {Y}\right)}{\operatorname* {d e t} \left(\left[ \boldsymbol {X} \boldsymbol {S} \boldsymbol {X} ^ {\top} \right] _ {Y}\right)} (28) \\ = \det \left(\boldsymbol {I} _ {| Y |} + \underbrace {\left[ \boldsymbol {X} \boldsymbol {S} \boldsymbol {X} ^ {\top} \right] _ {Y} ^ {- \frac {1}{2}} \boldsymbol {X} _ {Y , :}} _ {:= \boldsymbol {X} ^ {\prime}} \left(\boldsymbol {W} ^ {A} - \boldsymbol {S}\right) \boldsymbol {X} _ {Y, :} ^ {\top} \left[ \boldsymbol {X} \boldsymbol {S} \boldsymbol {X} ^ {\top} \right] _ {Y} ^ {- \frac {1}{2}}\right) (29) \\ = \det \left(\boldsymbol {I} _ {| Y |} + \boldsymbol {X} ^ {\prime} \left(\boldsymbol {W} ^ {A} - \boldsymbol {S}\right) \boldsymbol {X} ^ {\prime \top}\right) (30) \\ = \sum_ {T \subseteq [ | Y | ]} \det \left(\left[ \boldsymbol {X} ^ {\prime} \left(\boldsymbol {W} ^ {A} - \boldsymbol {S}\right) \boldsymbol {X} ^ {\prime \top} \right] _ {T}\right) (31) \\ \geq \det \left(\left[ \boldsymbol {X} ^ {\prime} \left(\boldsymbol {W} ^ {A} - \boldsymbol {S}\right) \boldsymbol {X} ^ {\prime \top} \right] _ {\emptyset}\right) = 1, (32) \\ \end{array} +$$ + +where the fourth line comes from (Kulesza & Taskar, 2012, Theorem 2.1), and the last line follows from the observation that $\boldsymbol{W}^A - \boldsymbol{S} = \frac{\boldsymbol{W}^A - \boldsymbol{W}^{A^\top}}{2}$ is a skew-symmetric matrix, so that every principal submatrix has a nonnegative determinant. Now we fix some $\{a, b\} \in \binom{[n] \setminus A}{2}$ and denote $Q := X_{\{a, b\}, :} \in \mathbb{R}^{2 \times d}$ . Then we have + +$$ +\begin{array}{l} \frac {\det \left(\left[ \boldsymbol {X} \widehat {\boldsymbol {W}} ^ {A} \boldsymbol {X} ^ {\top} \right] _ {\{a , b \}}\right)}{\det \left(\left[ \boldsymbol {X} \boldsymbol {W} ^ {A} \boldsymbol {X} ^ {\top} \right] _ {\{a , b \}}\right)} \leq \frac {\det \left(\left[ \boldsymbol {X} \widehat {\boldsymbol {W}} ^ {A} \boldsymbol {X} ^ {\top} \right] _ {\{a , b \}} \right.}{\det \left(\left[ \boldsymbol {X} \boldsymbol {S} \boldsymbol {X} ^ {\top} \right] _ {\{a , b \}}\right)} (33) \\ = \frac {\det (\boldsymbol {Q} (\boldsymbol {S} + \boldsymbol {R}) \boldsymbol {Q} ^ {\top})}{\det (\boldsymbol {Q} \boldsymbol {S} \boldsymbol {Q} ^ {\top})} (34) \\ = \det \left(\boldsymbol {I} _ {2} + \left(\boldsymbol {Q} \boldsymbol {S} \boldsymbol {Q} ^ {\top}\right) ^ {- 1 / 2} \boldsymbol {Q R} \boldsymbol {Q} ^ {\top} \left(\boldsymbol {Q} \boldsymbol {S} \boldsymbol {Q} ^ {\top}\right) ^ {- 1 / 2}\right) (35) \\ \leq \left(\frac {1}{2} \cdot \operatorname {t r} \left(\boldsymbol {I} _ {2} + \left(\boldsymbol {Q} \boldsymbol {S} \boldsymbol {Q} ^ {\top}\right) ^ {- 1 / 2} \boldsymbol {Q R Q} ^ {\top} \left(\boldsymbol {Q} \boldsymbol {S} \boldsymbol {Q} ^ {\top}\right) ^ {- 1 / 2}\right)\right) ^ {2} (36) \\ = \left(1 + \frac {1}{2} \cdot \operatorname {t r} \left(\boldsymbol {Q} \boldsymbol {R} \boldsymbol {Q} ^ {\top} \left(\boldsymbol {Q} \boldsymbol {S} \boldsymbol {Q} ^ {\top}\right) ^ {- 1}\right)\right) ^ {2} (37) \\ \leq \left(1 + \frac {1}{2} \cdot \operatorname {t r} \left(\boldsymbol {Q} \boldsymbol {R} \boldsymbol {Q} ^ {\top}\right) \cdot \lambda_ {\max } \left(\left(\boldsymbol {Q} \boldsymbol {S} \boldsymbol {Q} ^ {\top}\right) ^ {- 1}\right)\right) ^ {2} (38) \\ \leq \left(1 + \frac {\lambda_ {\max } \left(\boldsymbol {Q} \boldsymbol {R} \boldsymbol {Q} ^ {\top}\right)}{\lambda_ {\min } \left(\boldsymbol {Q} \boldsymbol {S} \boldsymbol {Q} ^ {\top}\right)}\right) ^ {2}, (39) \\ \end{array} +$$ + +where the first line follows from Equation (27), the fourth line is due to the fact that $\operatorname{det}(M) \leq (\operatorname{tr}(M) / d)^d$ for a SPSD matrix $M \in \mathbb{R}^{d \times d}$ (thanks to the AM-GM inequality), the fifth line comes from the cyclic property of a trace, and the sixth line is from the fact that $\operatorname{tr}(MN) \leq \operatorname{tr}(M) \cdot \lambda_{\max}(N)$ for SPSD matrices $M, N$ . For an arbitrary vector $\boldsymbol{v} \in \mathbb{R}^2$ , we observe that + +$$ +\boldsymbol {v} ^ {\top} \left(\boldsymbol {Q R Q} ^ {\top}\right) \boldsymbol {v} \leq \lambda_ {\max } (\boldsymbol {R}) \cdot \boldsymbol {v} ^ {\top} \boldsymbol {Q Q} ^ {\top} \boldsymbol {v} \leq \lambda_ {\max } (\boldsymbol {R}) \cdot \lambda_ {\max } (\boldsymbol {Q Q} ^ {\top}) \cdot \| \boldsymbol {v} \| _ {2} ^ {2}. +$$ + +Since $QQ^{\top} = X_{\{a,b\};:}X_{\{a,b\},:}^{\top} = [XX^{\top}]_{\{a,b\}} \in \mathbb{R}^{2\times 2}$ is a principal submatrix of $XX^{\top}$ , by Cauchy's interlace theorem, all eigenvalues of $QQ^{\top}$ interlace those of $XX^{\top}$ , and thus $\lambda_{\max}(QQ^{\top}) \leq \lambda_{\max}(XX^{\top}) = \sigma_{\max}(X)^{2}$ . Furthermore, since the matrix $\pmb{R}$ is obtained from the spectral symmetrization of $\frac{W^{A} - W^{A^{\top}}}{2}$ , their spectra are identical, i.e., $\lambda_{\max}(R) = \frac{\sigma_{\max}(W^{A} - W^{A^{\top}})}{2}$ . Therefore, + +$$ +\lambda_ {\max } \left(\boldsymbol {Q} \boldsymbol {R} \boldsymbol {Q} ^ {\top}\right) \leq \frac {\sigma_ {\max } \left(\boldsymbol {W} ^ {A} - \boldsymbol {W} ^ {A ^ {\top}}\right)}{2} \cdot \sigma_ {\max } (\boldsymbol {X}) ^ {2}. \tag {40} +$$ + +In addition, we have + +$$ +\lambda_ {\min } \left(\boldsymbol {Q} \boldsymbol {S} \boldsymbol {Q} ^ {\top}\right) = \frac {\sigma_ {\min } \left(\left[ \boldsymbol {X} \left(\boldsymbol {W} ^ {A} + \boldsymbol {W} ^ {A ^ {\top}}\right) \boldsymbol {X} ^ {\top} \right] _ {\{a , b \}}\right)}{2} \geq \frac {\min _ {Y \in \binom {[ n ] \backslash A} {2}} \sigma_ {\min } \left(\left[ \boldsymbol {X} \left(\boldsymbol {W} ^ {A} + \boldsymbol {W} ^ {A ^ {\top}}\right) \boldsymbol {X} ^ {\top} \right] _ {Y}\right)}{2}. \tag {41} +$$ + +Putting Equations (40) and (41) into Equation (39) gives + +$$ +\frac {\operatorname* {d e t} \left(\left[ \boldsymbol {X} \widehat {\boldsymbol {W}} ^ {A} \boldsymbol {X} ^ {\top} \right] _ {\{a , b \}}\right)}{\operatorname* {d e t} \left(\left[ \boldsymbol {X} \boldsymbol {W} ^ {A} \boldsymbol {X} ^ {\top} \right] _ {\{a , b \}}\right)} \leq \left(1 + \sigma_ {\max } (\boldsymbol {X}) ^ {2} \cdot \kappa_ {A}\right) ^ {2}, \tag {42} +$$ + +where, in Definition 3, $\kappa_{A}$ is defined as + +$$ +\kappa_ {A} := \frac {\sigma_ {\max} (\boldsymbol {W} ^ {A} - \boldsymbol {W} ^ {A ^ {\top}})}{\min _ {Y \in \binom {[ n ] \backslash A} {2}} \sigma_ {\min} ([ \boldsymbol {X} (\boldsymbol {W} ^ {A} + \boldsymbol {W} ^ {A ^ {\top}}) \boldsymbol {X} ^ {\top} ] _ {Y})}. +$$ + +This completes the proof of Theorem 4. + +# C.4. Proof of Proposition 5 + +Proposition 5. Given $\mathbf{X} \in \mathbb{R}^{n \times d}$ and $\mathbf{W} \in \mathbb{R}^{d \times d}$ , such that $\mathbf{W} + \mathbf{W}^{\top} \succeq 0$ and $k \geq 2$ , consider $\kappa$ as defined in Definition 3. With a preprocessing step that runs in time $\mathcal{O}(nd^2)$ , Algorithm 1 runs in time $\mathcal{O}(t_{\mathrm{iter}}(1 + \sigma_{\max}(\mathbf{X})^2\kappa)^2 (d^2\log n + d^3))$ in expectation. + +Proof. We remind the reader that our MCMC sampler (Algorithm 1) repeatedly runs tree-based rejection sampling for $t_{\mathrm{iter}}$ iterations. From Theorem 4, each iteration requires 2-DPP sampling for at most $(1 + \sigma_{\max}(\mathbf{X})^2\kappa)^2$ times on average. From Theorem 2, sampling from the 2-DPP can be done in time $\mathcal{O}(d^2\log n + d^3)$ . Combining all of these runtimes gives the result. \ No newline at end of file diff --git a/scalablemcmcsamplingfornonsymmetricdeterminantalpointprocesses/images.zip b/scalablemcmcsamplingfornonsymmetricdeterminantalpointprocesses/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..21761af0796b0287584a7a4014e1760c8eeffce4 --- /dev/null +++ b/scalablemcmcsamplingfornonsymmetricdeterminantalpointprocesses/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5435cb546cf2f84ce8491ac38b1fd85fd52de281b7f08dc0c5ae9b0579936aef +size 746380 diff --git a/scalablemcmcsamplingfornonsymmetricdeterminantalpointprocesses/layout.json b/scalablemcmcsamplingfornonsymmetricdeterminantalpointprocesses/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..1f80a528dcac5f42f48a3731709e11ddaa23938b --- /dev/null +++ b/scalablemcmcsamplingfornonsymmetricdeterminantalpointprocesses/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1b190a5d2289b5c74ca6af0893ec20eb50595ff45af7d136e38e31ef3ea9ecd5 +size 1027122 diff --git a/scalablespikeandslab/c6a3502d-b1f3-4641-8492-0b1e6c9f1e4f_content_list.json b/scalablespikeandslab/c6a3502d-b1f3-4641-8492-0b1e6c9f1e4f_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..40cdefed5e8aff360e0a84635e82a4c4e05e88b7 --- /dev/null +++ b/scalablespikeandslab/c6a3502d-b1f3-4641-8492-0b1e6c9f1e4f_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7a4129128cfe72d4ef9bb09d71dd194f26a3e1d5c5fba99db5daebc1c671f0df +size 154134 diff --git a/scalablespikeandslab/c6a3502d-b1f3-4641-8492-0b1e6c9f1e4f_model.json b/scalablespikeandslab/c6a3502d-b1f3-4641-8492-0b1e6c9f1e4f_model.json new file mode 100644 index 0000000000000000000000000000000000000000..2bd13a1310f99bb52eba19df3c8b47a692affa35 --- /dev/null +++ b/scalablespikeandslab/c6a3502d-b1f3-4641-8492-0b1e6c9f1e4f_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b8d9bfdb02f570d87bd193be090a03f9e65ddd875a25462918b19086d30842dc +size 190616 diff --git a/scalablespikeandslab/c6a3502d-b1f3-4641-8492-0b1e6c9f1e4f_origin.pdf b/scalablespikeandslab/c6a3502d-b1f3-4641-8492-0b1e6c9f1e4f_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..5649fdbd4af5a15cc7d989440f7bdfd756a36b6d --- /dev/null +++ b/scalablespikeandslab/c6a3502d-b1f3-4641-8492-0b1e6c9f1e4f_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cd09920c2b03d4a6abec9343d132d082450a2d6e3324aecaf9af2c881b61f52b +size 3657084 diff --git a/scalablespikeandslab/full.md b/scalablespikeandslab/full.md new file mode 100644 index 0000000000000000000000000000000000000000..9ead91e4209bfb8a72c9517b0b33dc6eeb9ff157 --- /dev/null +++ b/scalablespikeandslab/full.md @@ -0,0 +1,690 @@ +# Niloy Biswas1 Lester Mackey2 Xiao-Li Meng1 + +# Abstract + +Spike-and-slab priors are commonly used for Bayesian variable selection, due to their interpretability and favorable statistical properties. However, existing samplers for spike-and-slab posteriors incur prohibitive computational costs when the number of variables is large. In this article, we propose Scalable Spike-and-Slab $(\mathrm{S}^3)$ , a scalable Gibbs sampling implementation for high-dimensional Bayesian regression with the continuous spike-and-slab prior of George & McCulloch (1993). For a dataset with $n$ observations and $p$ covariates, $\mathrm{S}^3$ has order $\max \{n^2 p_t, np\}$ computational cost at iteration $t$ where $p_t$ never exceeds the number of covariates switching spike-and-slab states between iterations $t$ and $t - 1$ of the Markov chain. This improves upon the order $n^2 p$ per-iteration cost of state-of-the-art implementations as, typically, $p_t$ is substantially smaller than $p$ . We apply $\mathrm{S}^3$ on synthetic and real-world datasets, demonstrating orders of magnitude speed-ups over existing exact samplers and significant gains in inferential quality over approximate samplers with comparable cost. + +# 1. Introduction + +# 1.1. Bayesian computation in high dimensions + +We consider linear, logistic, and probit regression in high dimensions, where the number of observations $n$ is smaller than the number of covariates $p$ . This setting is common in modern applications such as genome-wide association studies (Guan & Stephens, 2011; Zhou et al., 2013) and astronomy (Kelly, 2007; Sereno, 2015). In the non-Bayesian paradigm, sparse point estimates such as the LASSO (Tibshirani, 1996), Elastic Net (Zou & Hastie, 2005) and SLOPE (Bogdan et al., 2015) offer a route to variable selection. + +$^{1}$ Department of Statistics, Harvard University $^{2}$ Microsoft Research New England. Correspondence to: Niloy Biswas . + +Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s). + +These estimates are based on optimization based approaches, which are computationally efficient and scale to datasets with hundreds of thousands of covariates. + +In the Bayesian paradigm, which will be our focus, one places a prior on the unknown parameters of interest and considers the corresponding posterior distribution. Sampling algorithms such as Markov chain Monte Carlo (MCMC) are then used to simulate from the posterior distribution. In modern high dimensional settings, general-purpose MCMC algorithms can have high computational cost per iteration. This has kindled a line of work on tailored algorithms for Bayesian regression (e.g., Polson et al., 2013; Yang et al., 2016; Narisetty et al., 2019; Johndrow et al., 2020; Biswas et al., 2022). Our manuscript participates in this wider effort to scale Bayesian inference to large data applications. Specifically, we propose computationally efficient MCMC algorithms for high-dimensional Bayesian linear, logistic and probit regression with spike-and-slab priors. + +# 1.2. Variable selection with spike-and-slab priors + +Consider Gaussian linear regression, logistic regression, and probit regression with $n$ observations and $p$ covariates. The respective likelihoods are given by $L_{\mathrm{lin}}(\boldsymbol {\beta},\sigma^2;\boldsymbol {X},\boldsymbol {y}) = \frac{1}{(2\pi\sigma^2)^{n / 2}}\exp \big(-\frac{\sum_{i = 1}^{n}(y_i - x_i^\top\boldsymbol{\beta})^2}{2\sigma^2}\big),$ $L_{\log}(\boldsymbol {\beta};\boldsymbol {X},\boldsymbol {y}) = \prod_{i = 1}^{n}\frac{\exp(y_i\boldsymbol{x}_i^\top\boldsymbol{\beta})}{1 + \exp(\boldsymbol{x}_i^\top\boldsymbol{\beta})},$ and $L_{\mathrm{prob}}(\boldsymbol {\beta};\boldsymbol {X},\boldsymbol {y}) =$ $\prod_{i = 1}^{n}\Phi (\boldsymbol{x}_{i}^{\top}\boldsymbol {\beta})^{y_{i}}(1 - \Phi (\boldsymbol{x}_{i}^{\top}\boldsymbol {\beta}))^{1 - y_{i}}.$ Here $\mathbf{X}\in \mathbb{R}^{n\times p}$ is the design matrix with rows $\boldsymbol {x}_i^\top$ $\boldsymbol {y}\in \mathbb{R}^n$ (for linear regression) or $\boldsymbol {y}\in \{0,1\} ^n$ (for logistic and probit regression) is the response vector, $\beta \in \mathbb{R}^p$ is the unknown signal, $\sigma^2\in (0,\infty)$ is the unknown Gaussian noise variance, and $\Phi$ is the cumulative density function of $\mathcal{N}(0,1)$ + +We focus on the high-dimensional setting with $n \ll p$ , where $\beta \in \mathbb{R}^p$ is assumed to be sparse. We use a continuous spike-and-slab prior on $\beta$ to capture sparsity: + +$$ +\sigma^ {2} \sim \operatorname {I n v G a m m a} \left(\frac {a _ {0}}{2}, \frac {b _ {0}}{2}\right), \quad (\text {f o r l i n e a r r e g r e s s i o n}) +$$ + +$$ +\sigma^ {2} = 1, \quad (\text {f o r l o g i s t i c a n d p r o b i t r e g r e s s i o n}) +$$ + +$$ +z_{j}\underset {j = 1,\ldots ,p}{\overset{i.i.d.}{\sim}}\operatorname{Bernoulli}(q), +$$ + +$$ +\beta_ {j} | z _ {j}, \sigma^ {2} \underset {j = 1, \dots , p} {\overset {i n d} {\sim}} (1 - z _ {j}) \mathcal {N} \left(0, \sigma^ {2} \tau_ {0} ^ {2}\right) + z _ {j} \mathcal {N} \left(0, \sigma^ {2} \tau_ {1} ^ {2}\right), \tag {1} +$$ + +where $q \in (0,1)$ , $\tau_1^2 \gg \tau_0^2 > 0$ , and $a_0, b_0 > 0$ are hyperparameters. Here, $\mathcal{N}(0, \sigma^2 \tau_0^2)$ and $\mathcal{N}(0, \sigma^2 \tau_1^2)$ correspond to the spike and slab parts of the prior respectively. In the high-dimensional setting, a small constant $q \ll 1$ is often chosen, but the algorithms in this manuscript also readily extend to hierarchical variants of (1) with a hyperprior placed on $q$ (Scott & Berger, 2010; Castillo & van der Vaart, 2012). + +Catalyzed by the works of George & McCulloch (1993; 1997), continuous spike-and-slab priors are now a mainstay of Bayesian variable selection (see the recent reviews of Tadesse & Vannucci (2021, Section I) and Banerjee et al. (2021)). The posterior probabilities $\mathbb{P}(z_j = 1|\boldsymbol{y})$ provide a natural interpretable approach to variable selection. The median probability model selects all covariates $j$ such that $\mathbb{P}(z_j = 1|\boldsymbol{y}) > 1/2$ , and it is easily fitted using Monte Carlo samples and provides the optimal predictive model in the case with orthogonal design matrix, as well as extensions with certain correlated matrices (Barbieri & Berger, 2004; Barbieri et al., 2021). Narisetty & He (2014) have further fine-tuned the optimal scaling of $q$ , $\tau_0^2$ , and $\tau_1^2$ with respect to the number of covariates and sample size to establish model selection consistency for linear regression with general design matrices in high dimensions. + +One could alternatively consider point-mass spike-and-slab priors (e.g., Mitchell & Beauchamp, 1988; Johnson & Rossell, 2012), where $\beta_{j}|z_{j}\sim (1 - z_{j})\delta_{0}(\cdot) + z_{j}\mathcal{N}(0,\sigma^{2}\tau_{1}^{2})$ such that a degenerate Dirac distribution about zero is chosen for the spike part. Point-mass priors have favorable statistical properties (e.g., Johnstone & Silverman, 2004; Castillo & van der Vaart, 2012) but can be computationally prohibitive (Bai et al., 2021). We hope to extend our algorithms to point-mass priors in follow-up work. + +# 1.3. Our contributions + +Our contributions are summarized below. Throughout, we use $\mathcal{O}$ and $\Omega$ to respectively denote asymptotic upper and lower bounds on computational complexity growth rates. + +Section 2 introduces Scalable Spike-and-Slab (S $^3$ ), a computationally efficient implementation of Gibbs samplers for linear and logistic regression with the prior given in (1). Section 2.1 investigates the computational bottlenecks of state-of-the-art (SOTA) implementations, which require $\Omega(n^2p)$ computational cost per iteration for datasets with $n$ observations and $p$ covariates. Section 2.2 develops S $^3$ , which overcomes existing computational bottlenecks by employing a pre-computation based strategy and requires $\mathcal{O}(\max\{n^2p_t, np\})$ computational cost at iteration $t$ , where $p_t$ is no greater than the number of covariates switching spike-and-slab states between iterations $t$ and $t-1$ of the Markov chain. Section 2.3 analyzes the favourable computational complexity of S $^3$ , showing that $p_t$ is typically much smaller than $p$ and that it can remain constant and even + +approach zero under various limiting regimes as $p$ increases. + +Section 3 compares $\mathrm{S}^3$ with the SOTA exact MCMC sampler and a recently proposed approximate MCMC sampler, which does not converge to the posterior distribution of interest. We demonstrate that $\mathrm{S}^3$ offers substantially faster numerical runtimes compared to the SOTA exact MCMC sampler, reporting $50\times$ speedups on synthetic datasets. In the same experiment, $\mathrm{S}^3$ and the approximate sampler have comparable runtimes, but the asymptotically exact $\mathrm{S}^3$ procedure provides more accurate variable selection. + +Section 4 demonstrates the benefits of $\mathrm{S}^3$ on a diverse suite of datasets, including two synthetic datasets and eight real-world experiments. For example, on a genome-wide association study (GWAS) dataset with with $n\approx 2000$ and $p\approx 100000$ , we again observe $50\times$ computational speedups over the SOTA exact MCMC sampler. Finally, Section 5 discusses directions for future work. The open-source packages ScaleSpikeSlab in R and Python (www.github.com/niloyb/ScaleSpikeSlab) implement our methods and recreate the experiments in this paper. + +# 2. Scalable Spike-and-Slab + +# 2.1. Status quo and computational bottlenecks + +Gibbs samplers have long been employed to sample from the posterior distributions corresponding to the prior in (1) (e.g., George & McCulloch, 1993; O'Brien & Dunson, 2004; Held & Holmes, 2006; Polson et al., 2013). The computational bottleneck of existing Gibbs samplers is linked to sampling from the full conditional of $\beta \in \mathbb{R}^p$ . This is given by + +$$ +\left. \boldsymbol {\beta} _ {t + 1} \right| \boldsymbol {z} _ {t}, \sigma_ {t} ^ {2} \sim \mathcal {N} \left(\boldsymbol {\Sigma} _ {t} ^ {- 1} \boldsymbol {X} ^ {\top} \boldsymbol {y}, \sigma_ {t} ^ {2} \boldsymbol {\Sigma} _ {t} ^ {- 1}\right) \tag {2} +$$ + +for $\pmb{\Sigma}_{t} = \pmb{X}^{\top}\pmb{X} + \pmb{D}_{t}$ , where $t$ indexes the iteration of the Markov chain, and $\pmb{D}_{t}$ is the diagonal matrix with the vector $\pmb{z}_{t}\tau_{1}^{-2} + (\pmb{1}_{p} - \pmb{z}_{t})\tau_{0}^{-2}$ populating its diagonal elements. + +Sampling from (2) using standard matrix multiplication and a generic Cholesky decomposition that ignores the specific structure of $\Sigma_t$ requires $\Omega(p^3)$ computational cost, which quickly becomes prohibitive for large $p$ . Hereafter we will refer to this generic method as the Naïve Sampler. Ishwaran & Rao (2005) recommend separating the components of $\beta$ into $B$ blocks of size $p/B$ each, and then updating each block using Gibbs sampling, which gives a reduced $\Omega(p^3 B^{-2})$ computational cost. However, this cost remains prohibitive for large $p$ , and using a larger number of blocks $B$ induces higher auto-correlation between successive iterations of the Gibbs sampler. Recently, Bhattacharya et al. (2016) developed an algorithm based on the Woodbury matrix identity (Hager, 1989) to sample from multivariate Gaussian distributions of the form in (2), which requires a more favourable $\Omega(n^2 p)$ computational cost and is given in Algorithm 1. + +Algorithm 1 An $\Omega(n^2p)$ sampler of (2) (Bhattacharya et al., 2016) + +Sample $r\sim \mathcal{N}(0,\pmb {I}_p),\pmb {\xi}\sim \mathcal{N}(0,\pmb {I}_n)$ + +Set $\pmb{u} = D_{t}^{-\frac{1}{2}}\pmb{r}$ and calculate $\pmb{v} = X\pmb{u} + \pmb{\xi}$ . + +Set $\pmb{v}^{*} = M_{t}^{-1}\left(\frac{1}{\sigma_{t}}\pmb{y} - \pmb{v}\right)$ for $M_{t} = I_{n} + X D_{t}^{-1}X^{\top}$ . + +Return $\beta = \sigma_t(\pmb{u} + \pmb{D}_t^{-1}\pmb{X}^\top \pmb{v}^*)$ . + +For large-scale datasets with $n$ in the thousands and $p$ in the hundreds of thousands, as found in modern scientific applications, the $\Omega (n^{2}p)$ cost per iteration is still too high. This has spurred recent work on approximate MCMC (Narisetty et al., 2019) for the continuous spike-and-slab prior on logistic regression and on variational inference methods for the point-mass spike-and-slab prior (Titsias & Lázaro-Gredilla, 2011; Ray et al., 2020; Ray & Szabó, 2021). Such approximate samplers can provide improved computational speeds but do not converge to the posterior distribution of interest. + +# 2.2. A scalable Gibbs sampler + +We now develop $\mathrm{S}^3$ . Our key insight is that successive pre-computation can be used to reduce the computational cost of Algorithm 1. In Algorithm 1, the $\Omega(n^2p)$ computational cost per iteration arises from the calculation of the matrix $M_t$ . Current algorithms calculate $M_t = I_n + X D_t^{-1} X^\top$ from scratch every iteration at $\Omega(n^2p)$ cost under standard matrix multiplication and then solve an $n$ by $n$ linear system to obtain $v^*$ at $\Omega(n^3)$ cost. We propose instead to use the previous state $z_{t-1}$ and the pre-computed matrices $M_{t-1}$ and $M_{t-1}^{-1}$ at each step to aid the calculation of $M_t^{-1}$ . Our strategy is given below. + +Specifically, denote $\mathbf{X} = [X_1, \dots, X_p] \in \mathbb{R}^{n \times p}$ and its sub-matrices $\mathbf{X}_{A_t} \triangleq [\mathbf{X}_j : j \in A_t] \in \mathbb{R}^{n \times \| \mathbf{z}_t\|}$ and $\mathbf{X}_{A_t^c} \triangleq [\mathbf{X}_j : j \in A_t^c] \in \mathbb{R}^{n \times (p - \| \mathbf{z}_t\|)}$ , where $A_t \triangleq \{j : z_{j,t} = 1\}$ and $A_t^c = \{j : z_{j,t} = 0\}$ , are the ordered index sets of covariates corresponding to slab states and to spike states respectively at iteration $t$ , and $\| \cdot \|_1$ is the $L^1$ norm on $\{0,1\}^p$ . Also denote $\Delta_t \triangleq \{j : z_{j,t} \neq z_{j,t-1}\}$ , the ordered index set of covariates which switch spike-and-slab states between iterations $t$ and $t-1$ ; $\delta_t \triangleq \| \mathbf{z}_t - \mathbf{z}_{t-1}\|_1 = |\Delta_t|$ , the number of switches; $D_{\Delta_t} \triangleq \mathrm{Diag}((D_t)_{j,j} : j \in \Delta_t) \in \mathrm{Diag}(\mathbb{R}^{\delta_t \times \delta_t})$ , the diagonal sub-matrix of $D_t$ composed of the diagonal entries with ordered indices in $\Delta_t$ ; and $C_{\Delta_t} \triangleq D_{\Delta_t}^{-1} - D_{\Delta_{t-1}}^{-1}$ . Finally, let $\tilde{M}_{\tau_0} \triangleq I_n + \tau_0^2\mathbf{X}\mathbf{X}^T \in \mathbb{R}^{n \times n}$ and $\tilde{M}_{\tau_1} \triangleq I_n + \tau_1^2\mathbf{X}\mathbf{X}^T \in \mathbb{R}^{n \times n}$ , which are fixed for all iterations. Under this notation, there are three expressions for $M_t$ : + +$$ +\begin{array}{l} \boldsymbol {M} _ {t} = \tilde {\boldsymbol {M}} _ {\tau_ {0}} + \left(\tau_ {1} ^ {2} - \tau_ {0} ^ {2}\right) \boldsymbol {X} _ {A _ {t}} \boldsymbol {X} _ {A _ {t}} ^ {\top} (3a) \\ = \tilde {\boldsymbol {M}} _ {\tau_ {1}} + \left(\tau_ {0} ^ {2} - \tau_ {1} ^ {2}\right) \boldsymbol {X} _ {A _ {t} ^ {c}} \boldsymbol {X} _ {A _ {t} ^ {c}} ^ {\top} (3b) \\ = \boldsymbol {M} _ {t - 1} + \boldsymbol {X} _ {\Delta_ {t}} \boldsymbol {C} _ {\Delta_ {t}} \boldsymbol {X} _ {\Delta_ {t}} ^ {\top}. (3c) \\ \end{array} +$$ + +In (3a)-(3c), calculating the matrix products $X_{A_t}X_{A_t}^\top$ , + +$\mathbf{X}_{A_t^c}\mathbf{X}_{A_t^c}^\top$ , and $\pmb {X}_{\Delta_t}\pmb {C}_{\Delta_t}\pmb {X}_\Delta t^\top$ requires $\mathcal{O}(n^{2}\| \pmb {z}_{t}\|_{1})$ $\mathcal{O}(n^{2}(p - \| \pmb {z}_{t}\|_{1}))$ , and $\mathcal{O}(n^{2}\delta_{t})$ cost respectively. Given $\tilde{M}_{\tau_0},\tilde{M}_{\tau_1},M_{t - 1}$ , and $z_{t - 1}$ , we evaluate whichever matrix product in (3a)-(3c) has minimal computational cost and thereby calculate $M_{t}$ at the reduced cost of $\mathcal{O}(n^{2}p_{t})$ where $p_t\triangleq \min \{\| \pmb {z}_t\| _1,p - \| \pmb {z}_t\| _1,\delta_t\}$ + +To calculate $M_t^{-1}$ , we consider the cases $n \leq p_t$ and $p_t < n$ separately. When $n \leq p_t$ , we calculate $M_t^{-1}$ by directly inverting the calculated matrix $M_t$ from (3), which requires $\mathcal{O}(n^3)$ cost. When $p_t < n$ , we apply the Woodbury matrix identity on (3). This gives + +$$ +\begin{array}{l} \boldsymbol {M} _ {t} ^ {- 1} = \tilde {\boldsymbol {M}} _ {\tau_ {0}} ^ {- 1} (4a) \\ - \tilde {\boldsymbol {M}} _ {\tau_ {0}} ^ {- 1} \boldsymbol {X} _ {A _ {t}} \left(\frac {1}{\tau_ {1} ^ {2} - \tau_ {0} ^ {2}} \boldsymbol {I} _ {\| \boldsymbol {z} _ {t} \| _ {1}} + \boldsymbol {X} _ {A _ {t}} ^ {\top} \tilde {\boldsymbol {M}} _ {\tau_ {0}} ^ {- 1} \boldsymbol {X} _ {A _ {t}}\right) ^ {- 1} \boldsymbol {X} _ {A _ {t}} ^ {\top} \tilde {\boldsymbol {M}} _ {\tau_ {0}} ^ {- 1} \\ = \tilde {M} _ {\tau_ {1}} ^ {- 1} (4b) \\ - \tilde {M} _ {\tau_ {1}} ^ {- 1} \mathbf {X} _ {A _ {t} ^ {c}} \left(\frac {1}{\tau_ {0} ^ {2} - \tau_ {1} ^ {2}} \mathbf {I} _ {p - \| \mathbf {z} _ {t} \| _ {1}} + \mathbf {X} _ {A _ {t} ^ {c}} ^ {\top} \tilde {M} _ {\tau_ {1}} ^ {- 1} \mathbf {X} _ {A _ {t} ^ {c}}\right) ^ {- 1} \mathbf {X} _ {A _ {t} ^ {c}} ^ {\top} \tilde {M} _ {\tau_ {1}} ^ {- 1} \\ = \boldsymbol {M} _ {t - 1} ^ {- 1} (4c) \\ - \boldsymbol {M} _ {t - 1} ^ {- 1} \boldsymbol {X} _ {\Delta_ {t}} \left(\boldsymbol {C} _ {\Delta_ {t}} ^ {- 1} + \boldsymbol {X} _ {\Delta_ {t}} ^ {\top} \boldsymbol {M} _ {t - 1} ^ {- 1} \boldsymbol {X} _ {\Delta_ {t}}\right) ^ {- 1} \boldsymbol {X} _ {\Delta_ {t}} ^ {\top} \boldsymbol {M} _ {t - 1} ^ {- 1}. \\ \end{array} +$$ + +Given $\tilde{M}_{\tau_0}^{-1}$ , $\tilde{M}_{\tau_1}^{-1}$ , $M_{t-1}^{-1}$ and $z_{t-1}$ , we evaluate whichever expression in (4a) - (4c) has minimal computational cost to calculate $M_t^{-1}$ . Similar to (3), this requires $\mathcal{O}(n^2 p_t)$ computational cost, which arises from matrix inversion and multiplication. + +Overall, this strategy of using the previous state $\boldsymbol{z}_{t-1}$ and the pre-computed matrices $\tilde{M}_{\tau_0}, \tilde{M}_{\tau_0}^{-1}, \tilde{M}_{\tau_1}, \tilde{M}_{\tau_1}^{-1}, M_{t-1}$ and $M_{t-1}^{-1}$ , reduces the computational cost of calculating the matrices $M_t$ and $M_t^{-1}$ from $\Omega(n^2 p)$ (as in all current implementations of Algorithm 1) to $\mathcal{O}(n^2 p_t)$ . As we show in Sections 2.3 and 3, in many large-scale applications $p_t$ is orders of magnitude smaller than both $n$ and $p$ , yielding substantial improvements in computational efficiency. Furthermore, we emphasize that the matrices $\tilde{M}_{\tau_0}, \tilde{M}_{\tau_0}^{-1}, \tilde{M}_{\tau_1}, \tilde{M}_{\tau_1}^{-1}$ are fixed for all iterations, and the state $\boldsymbol{z}_{t-1}$ and matrices $M_{t-1}$ and $M_{t-1}^{-1}$ only need to be stored temporarily to generate samples for iteration $t$ and can be deleted after. Therefore $S^3$ requires minimal additional memory compared to current implementations. + +The full Gibbs samplers for Bayesian linear, logistic, and probit regression which make use of this pre-computation are given in Algorithms 2 and 3. The Gibbs samplers for logistic and probit regression are based on data augmentation strategies (see, e.g., O'Brien & Dunson (2004); Narisetty et al. (2019)), and the Gibbs sampler for logistic regression requires an adjusted pre-computation strategy with $\mathcal{O}\big(\max \{n^2 p_t,n^3,np\} \big)$ cost. Appendix B contains derivations and details of Algorithms 2 and 3 (the implementation of logistic regression is based on a scaled $t$ -distribution approximation to the logistic distribution, as commonly done in the literature; see (Narisetty et al., 2019)). + +# Algorithm 2 Bayesian linear regression with $\mathbf{S}^3$ + +Input: State $C_t \triangleq (\beta_t, z_t, \sigma_t^2) \in \mathbb{R}^p \times \{0, 1\}^p \times (0, \infty)$ , state $z_{t-1}$ , and matrices $M_{t-1}, M_{t-1}^{-1}$ . + +1: Calculate $p_t$ and use (3) to calculate $M_t$ . +if $p_t \geq n$ then invert $M_t$ to calculate $M_t^{-1}$ else use (4) to calculate $M_t^{-1}$ . +2: Sample $\beta_{t + 1}|z_t,\sigma_t^2$ using Algorithm 1 from $\mathcal{N}\big(\pmb{\Sigma}_t^{-1}\pmb{X}^\top \pmb{y},\sigma_t^2\pmb{\Sigma}_t^{-1}\big)$ for $\pmb{\Sigma}_{t} = \pmb{X}^{\top}\pmb {X} + \pmb{D}_{t}$ +3: Sample each $z_{j,t + 1}|\beta_{t + 1},\sigma_t^2$ independently from Bernoulli $\left(\frac{q\mathcal{N}(\beta_{j,t + 1};0,\sigma_t^2\tau_1^2)}{q\mathcal{N}(\beta_{j,t + 1};0,\sigma_t^2\tau_1^2) + (1 - q)\mathcal{N}(\beta_{j,t + 1};0,\sigma_t^2\tau_0^2)}\right)$ . for $j = 1,\ldots ,p$ +4: Sample $\sigma_{t + 1}^2 |\beta_{t + 1},z_{t + 1}$ from + +$$ +\operatorname {I n v G a m m a} \left(\frac {a _ {0} + n + p}{2}, \frac {b _ {0} + \| \boldsymbol {y} - \boldsymbol {X} \boldsymbol {\beta} _ {t + 1} \| _ {2} ^ {2} + \boldsymbol {\beta} _ {t + 1} ^ {\top} \boldsymbol {D} _ {t + 1} \boldsymbol {\beta} _ {t + 1}}{2}\right). +$$ + +Output: $C_{t + 1} = (\beta_{t + 1},z_{t + 1},\sigma_{t + 1}^2),z_t,M_t,M_t^{-1}$ + +# Algorithm 3 Bayesian logistic & probit regression with $S^3$ + +Input: State $C_t \triangleq (\beta_t, z_t, \tilde{y}_t, \tilde{\sigma}_t^2) \in \mathbb{R}^p \times \{0, 1\}^p \times \mathbb{R}^n \times (0, \infty)^n$ , states $z_{t-1}$ , $\tilde{\sigma}_{t-1}^2$ , and matrices $M_{t-1}, M_{t-1}^{-1}$ . + +1: Logistic regression: Use pre-computation (see Appendix B.3) to calculate $M_t \triangleq I_n + W_t^{-1/2} X D_t^{-1} X^\top W_t^{-1/2}$ for $W_t = \mathrm{Diag}(\tilde{\sigma}_t^2)$ . Invert $M_t$ to calculate $M_t^{-1}$ . +Probit regression: Calculate $p_t$ and use (3) to calculate $M_t \triangleq I_n + X D_t^{-1} X^\top$ . If $p_t \geq n$ then invert $M_t$ to calculate $M_t^{-1}$ else use (4) to calculate $M_t^{-1}$ . +2: Sample $\beta_{t + 1}|z_t,\tilde{y}_t,\tilde{\sigma}_t^2$ using Algorithm 1 from $\mathcal{N}\left(\Sigma_t^{-1}X^\top W_t^{-1}\tilde{y}_t,\Sigma_t^{-1}\right)$ for $\boldsymbol {\Sigma}_t = \boldsymbol {X}^\top \boldsymbol {W}_t^{-1}\boldsymbol {X} + \boldsymbol {D}_t$ +3: Sample each $z_{j,t + 1}|\pmb{\beta}_{t + 1},\tilde{\pmb{y}}_t,\tilde{\pmb{\sigma}}_t^2$ independently from Bernoulli $\begin{array}{r}\left(\frac{q\mathcal{N}(\beta_{j,t + 1};0,\tau_1^2)}{q\mathcal{N}(\beta_{j,t + 1};0,\tau_1^2) + (1 - q)\mathcal{N}(\beta_{j,t + 1};0,\tau_0^2)}\right) \end{array}$ for $j = 1,\dots,p$ +4: Sample each $\tilde{y}_{i,t+1}|\beta_{t+1},\pmb{z}_{t+1},\tilde{\sigma}_t^2$ independently from $\mathcal{N}(\pmb{x}_i^\top\pmb{\beta}_{t+1},\tilde{\sigma}_{i,t}^2)\mathrm{I}_{[0,+\infty)}$ if $y_i = 1$ , $\mathcal{N}(\pmb{x}_i^\top\pmb{\beta}_{t+1},\tilde{\sigma}_{i,t}^2)\mathrm{I}_{(-\infty,0)}$ if $y_i = 0$ for $i = 1,\dots,n$ . + +5: Logistic regression: Sample each $\tilde{\sigma}_{i,t + 1}^2 |\beta_{t + 1},z_{t + 1},\tilde{y}_{t + 1}$ independently from + +$$ +\operatorname {I n v G a m m a} \left(\frac {v + 1}{2}, \frac {w ^ {2} \nu + \left(\tilde {y} _ {i , t + 1} - \boldsymbol {x} _ {i} ^ {\top} \boldsymbol {\beta} _ {t + 1}\right) ^ {2}}{2}\right) +$$ + +for $i = 1,\dots ,n$ where $\nu \triangleq 7.3$ and $w^{2}\triangleq \pi^{2}(\nu -2) / (3\nu)$ are constants. + +Probit regression: Set each $\tilde{\sigma}_{i,t+1}^2 = 1$ for $i = 1, \dots, n$ . + +Output: $C_{t + 1} = (\beta_{t + 1},z_{t + 1},\tilde{y}_{t + 1},\tilde{\sigma}_{t + 1}^2),z_t,M_t,M_{t - 1}^{-1}$ + +# 2.3. Analysis of computational complexity + +We now investigate the favorable computational complexity of Algorithms 2 and 3. Proposition 2.1, proved in Appendix A, gives the computational cost of these Gibbs samplers for linear and logistic regression, showing an improvement over existing implementations which have $\Omega(n^2 p)$ cost. + +Proposition 2.1 (Computational cost). Algorithm 2 and Algorithm 3 for probit regression both have a computational cost of $\mathcal{O}\big(\max \{n^2 p_t,np\} \big)$ at iteration $t$ ,and Algorithm 3 for logistic regression has a computational cost of $\mathcal{O}\big(\max \{n^{2}p_{t},n^{3},np\} \big)$ at iteration $t$ , where $p_t =$ $\min \{\| z_t\| _1,p - \| z_t\| _1,\delta_t\}$ for $\delta_t = \| z_t - z_{t - 1}\| _1$ + +In Proposition 2.1, $\| \pmb{z}_t\| _1$ and $p - \| z_{t}\|_{1}$ are the number of slab covariates and the number of spike covariates respectively at iteration $t$ of the Markov chain, and $\delta_t$ is the number of covariates switching spike-and-slab states between iterations $t$ and $t - 1$ of the Markov chain. Note that $p_t\leq \min \{\| \pmb {z}_t\| _1,p - \| \pmb {z}_t\| _1\} \leq p / 2$ directly. In practice, there are a variety of scenarios under which $p_t$ is significantly smaller than $p / 2$ . + +Sparse $\mathbf{z}_t$ . Whenever $\mathbf{z}_t$ is sparse relative to the full dimensionality $p$ , we have $p_t \leq \| \mathbf{z}_t \|_1 \ll p$ . Sparsity in $\mathbf{z}_t$ is a common occurrence in high-dimensional regression with a sparse signal vector $\beta^* \in \mathbb{R}^p$ , as $\| \mathbf{z}_t \|_1$ often closely approximates the true sparsity $s \triangleq \| \beta^* \|_0$ with high probability. This occurs, for instance, in the settings of Narisetty & He (2014) and Narisetty et al. (2019), where strong model selection consistency of the continuous spike-and-slab posterior is established for linear and logistic regression respectively. + +Posterior concentration. Even when $\min \{\| \pmb{z}_t\| _1,p - \| \pmb {z}_t\| _1\}$ is comparable to $p / 2$ , concentration of the spikeand-slab posterior targeted by the Gibbs sampler can lead to $\delta_t$ and hence $p_t$ remaining much smaller than $p / 2$ . Proposition 2.2, proved in Appendix A, calculates the expectation of $\delta_{t}$ explicitly in terms of the posterior distribution that is targeted by our algorithms and the auto-correlation of the states $(\pmb {z}_t)_{t\geq 0}$ + +Proposition 2.2 (Expected spike-and-slab swap count). For $\delta_t$ as given in Proposition 2.1, + +$$ +\mathbb {E} [ \delta_ {t} ] = \sum_ {j = 1} ^ {p} \mathbb {P} (z _ {j, t} = 1) \mathbb {P} (z _ {j, t - 1} = 0) + +$$ + +$$ +\mathbb {P} \left(z _ {j, t} = 0\right) \mathbb {P} \left(z _ {j, t - 1} = 1\right) - 2 \operatorname {c o v} \left(z _ {j, t}, z _ {j, t - 1}\right). \tag {5} +$$ + +Suppose the Markov chain generated by Algorithm 2 or 3 is at its stationary distribution $\pi$ at iteration $t - 1$ . Then, + +$$ +\mathbb {E} [ \delta_ {t} ] = 2 \sum_ {j = 1} ^ {p} \operatorname {v a r} _ {\pi} (z _ {j, t}) (1 - \operatorname {c o r r} _ {\pi} (z _ {j, t}, z _ {j, t - 1})). \tag {6} +$$ + +In (6), note $\mathrm{var}_{\pi}(z_{j,t}) = \mathbb{P}_{\pi}(z_{j,t} = 0)\mathbb{P}_{\pi}(z_{j,t} = 1) \leq 1/4$ for each component $j$ , with equality only when $z_{j,t} \sim \text{Bernoulli}(1/2)$ . Therefore all components $j$ with $\mathbb{P}_{\pi}(z_{j,t} = 1)$ close to 0 or 1 do not contribute significantly towards $\delta_t$ in expectation. Such posterior concentration is guaranteed whenever $\pmb{z}_t$ is convergent, be it to the true model selection vector as in Narisetty & He (2014) and Narisetty et al. (2019) or to any other value. In such circumstances we can have $\delta_t = \| \pmb{z}_t - \pmb{z}_{t-1} \|_1 = o(p)$ and even $\delta_t = o(\| \pmb{z}_t \|_1)$ , regardless of the magnitude of $\| \pmb{z}_t \|_1$ . + +High auto-correlation. High auto-correlation of the Gibbs sampler can also lead to smaller values of $\delta_t$ and hence $p_t$ . We already see from Proposition 2.2 that, even for components $j$ with bimodal marginal posterior distributions, high auto-correlation between successive states $z_{j,t-1}$ and $z_{j,t}$ can yield lower $\delta_t$ in expectation. Proposition 2.3, proved in Appendix A, provides an additional exact expression for $\delta_t$ in terms of the empirical correlation between $z_t$ and $z_{t-1}$ . + +Proposition 2.3 (Swap count decomposition). Let $\tau_t = \sqrt{\|\pmb{z}_t\|_1(p - \|\pmb{z}_t\|_1)}$ and $\rho_t$ be the empirical correlation between $\pmb{z}_t$ and $\pmb{z}_{t-1}$ (that is, the correlation between $z_{J,t}$ and $z_{J,t-1}$ when $J$ is uniform on $\{1, \ldots, p\}$ ). Then, for $\delta_t$ as given in Proposition 2.1, + +$$ +\delta_ {t} = \| \boldsymbol {z} _ {t} \| _ {1} + \| \boldsymbol {z} _ {t - 1} \| _ {1} - \frac {2 \| \boldsymbol {z} _ {t} \| _ {1} \| \boldsymbol {z} _ {t - 1} \| _ {1} + 2 \rho_ {t} \tau_ {t} \tau_ {t - 1}}{p}. \tag {7} +$$ + +Since $|\rho_t| \leq 1$ , Proposition 2.3 implies + +$$ +\delta_ {t} \geq \frac {\left(\| \boldsymbol {z} _ {t} \| _ {1} - \| \boldsymbol {z} _ {t - 1} \| _ {1}\right) ^ {2}}{p} + \frac {\left(\tau_ {t} - \tau_ {t - 1}\right) ^ {2}}{p} \text {a n d} \tag {8} +$$ + +$$ +\delta_ {t} \leq \frac {\left(\| \boldsymbol {z} _ {t} \| _ {1} - \| \boldsymbol {z} _ {t - 1} \| _ {1}\right) ^ {2}}{p} + \frac {\left(\tau_ {t} + \tau_ {t - 1}\right) ^ {2}}{p}. \tag {9} +$$ + +The lower bound in (8) is a good approximation to $\delta_t$ when $\rho_t$ is close to one, which is the case either when the Gibbs sampler is converging (such that $z_t$ becomes stable) or when it gets stuck (such that $z_t$ changes slowly with $t$ ). In either case, $\tau_t$ exhibits similar "stable/stuck" behavior, implying that the lower bound itself will be close to zero. This suggests $\delta_t$ and hence $p_t$ is close to zero when $\rho_t$ is close to 1, even if $\min \{\| z_t \|_1, p - \| z_t \|_1\}$ is not negligible. + +Motivated by such discussions and theoretical analysis, we now empirically examine how $p_t$ grows as the number of observations $n$ , the number of covariates $p$ , and the sparsity $s$ of the true signal varies. Figure 1 is based on synthetic linear regression datasets. For each dataset, one Markov chain is generated using Algorithm 2 to target the corresponding spike-and-slab posterior, from which the mean and one standard error bars of $(p_t)_{t=5000}^{10000}$ are plotted. For Figure 1 (Left), we consider datasets with $n = 100$ , varying $p$ with + +Figure 1. The $S^3$ cost parameter $p_t$ for averaged over iterations $5000 < t \leq 10000$ with one standard error bars, for synthetic linear regression datasets with varying number of covariates $p$ (Left), varying number of observations $n$ (Center), and varying sparsity $s$ (Right). The ground truth sparsity $s$ is also plotted for comparison. See Section 2.3 for details. +![](images/c35d94cac663347b6e29864570efbcdfabc8762279c057bd004985a7bf7da8a0.jpg) +- $\mathsf{p_t}$ Sparsity s + +![](images/d56aa5515f65c216c5648d09729ae41ec2ca688fb7f8675f72eddcc95c806de4.jpg) + +![](images/bb1a9668452f4ec124b5c0fc14511ccbc20908e55f826ae48c541b2d743644f4.jpg) + +$p \geq n$ , and a sparse true signal $\beta^{*} \in \mathbb{R}^{p}$ with components $\beta_{j}^{*} = 2\mathrm{I}\{j \leq s\}$ for sparsity $s = 10$ , and noise standard deviation $\sigma^{*} = 2$ . For Figure 1 (Center), we consider datasets with $p = 1000$ , varying $n$ with $n \leq p$ , $s = 10$ , and $\sigma^{*} = 2$ . For Figure 1 (Right), we consider datasets with $n = 10s$ , $p = 1000$ , and $\sigma^{*} = 2$ for varying $s \geq 1$ . Details of the synthetically generated datasets are in Appendix D. + +Figure 1 (Left) shows that both $p_t$ is substantially smaller than both $p$ and $n$ and that it does not increase with the number of covariates $p$ . Figure 1 (Center) shows that $p_t$ tends to zero as $n$ increases. Figure 1 (Right) shows that $p_t$ decreases as the sparsity $s$ increases. All figures suggest that $p_t$ is controlled by $\delta_t$ in these settings, because $\| z_t \|_1$ takes values close to $s$ , and $p - \| z_t \|_1$ tends to be much larger than $\| z_t \|_1$ . Overall, Figure 1 highlights that not only does $p_t$ tend to be substantially smaller than $p$ , but it also tends to be smaller than both $n$ and $s$ . By Proposition 2.1, this showcases the substantially lower computational cost of $S^3$ compared to current implementations which cost $\Omega(n^2 p)$ per iteration. + +# 2.4. Extensions to Scalable Spike-and-Slab + +With additional memory capacity and pre-computation, we can further improve the per-iteration costs of $S^3$ . + +For the matrices $\tilde{M}_{\tau_0}^{-1}$ and $\tilde{M}_{\tau_1}^{-1}$ in Section 2.2, suppose the matrices $X^{\top}X$ , $X^{\top}\tilde{M}_{\tau_0}^{-1}X$ , and $X^{\top}\tilde{M}_{\tau_1}^{-1}X$ are pre-computed. This initial step requires $\mathcal{O}(np^2)$ computational cost and $\mathcal{O}(p^2)$ memory. Then the matrices $X_{A_t}^\top X_{A_t}$ and $X_{A_t^c}^\top X_{A_t^c}$ in (3a)-(3b) correspond to pre-computed sub-matrices of $X^{\top}X$ , and calculating $M_t$ using (3a)-(3b) at iteration $t$ involves matrix addition which only requires $\mathcal{O}(n^2)$ cost. Similarly, matrices $X_{A_t}^\top \tilde{M}_{\tau_0}^{-1}X_{A_t}$ and + +Table 1. Comparison of $\mathrm{S}^3$ with alternatives $(p_t = \min \{\| z_t\|_1, p - \| z_t\|_1, \delta_t\})$ for $\delta_t = \| z_t - z_{t-1}\|_1$ . + +
MCMC SAMPLERCOSTCONVERGES TO POSTERIOR
NAïveΩ(p3)✓
STATE-OF-THE-ARTΩ(n2p)✓
SKINNY GIBBSΩ(max{n||zt||12, np})×
S3(LINEAR AND PROBIT)O(max{n2pt, np})✓
S3(LOGISTIC)O(max{n2pt, n3, np})✓
+ +$\pmb{X}_{A_t^c}^\top \tilde{\pmb{M}}_{\tau_1}^{-1}\pmb{X}_{A_t^c}$ in (4a)-(4b) correspond to pre-computed sub-matrices of $\pmb{X}^{\top}\tilde{\pmb{M}}_{\tau_0}^{-1}\pmb{X}$ and $\pmb{X}^{\top}\tilde{\pmb{M}}_{\tau_1}^{-1}\pmb{X}$ respectively and do not need to be recalculated at iteration $t$ . Therefore calculating $\left((\tau_1^2 -\tau_0^2)^{-1}\pmb{I}_{\| \pmb {z}_t\| _1} + \pmb{X}_{A_t}^\top \tilde{\pmb{M}}_{\tau_0}^{-1}\pmb{X}_{A_t}\right)^{-1}$ or $\left((\tau_0^2 -\tau_1^2)^{-1}\pmb{I}_{p - \| \pmb {z}_t\| _1} + \pmb{X}_{A_t}^\top \tilde{\pmb{M}}_{\tau_1}^{-1}\pmb{X}_{A_t^c}\right)^{-1}$ in (4a)-(4b) at each iteration $t$ only requires $\mathcal{O}(\| z_t\| _1^3)$ or $\mathcal{O}((p - \| z_t\| _1)^3)$ cost respectively. + +To sample from (2), consider the cases $n \leq \min\{\|z_t\|_1, p - \|z_t\|_1\}$ and $\min\{\|z_t\|_1, p - \|z_t\|_1\} < n$ separately. When $n \leq \min\{\|z_t\|_1, p - \|z_t\|_1\}$ , we calculate $M_t^{-1}$ by directly inverting the calculated matrix $M_t$ from (3), which requires $\mathcal{O}(n^3)$ cost. When $\min\{\|z_t\|_1, p - \|z_t\|_1\} < n$ , we avoid calculating $M_t^{-1}$ explicitly and instead calculate the matrix product $M_t^{-1}\left(\frac{1}{\sigma_t} \boldsymbol{y} - \boldsymbol{v}\right)$ in Algorithm 1 right-to-left, using whichever expression in (4a) - (4b) has minimal computational cost. Overall, now the Gibbs samplers for linear and probit regression require only $\mathcal{O}(\max\{\min\{\|z_t\|_1, p - \|z_t\|_1, n\}^3, np\})$ computational cost at iteration $t$ . This provides lower computational cost for S³ linear and probit regression whenever $\min\{\|z_t\|_1, p - \|z_t\|_1, n\}^3 < n^2 p_t$ . A similar extension for logistic regression requires only $\mathcal{O}(\max\{n^3, np\})$ computational cost at iteration $t$ and is given in Appendix B.3. + +# 3. Comparison with Alternatives + +In this section we compare $\mathrm{S}^3$ with the naive sampler, the SOTA exact MCMC sampler based on the sampling algorithm of Bhattacharya et al. (2016), and the Skinny Gibbs approximate MCMC sampler of Narisetty et al. (2019) for logistic regression. Table 1 highlights the favorable computational cost of $\mathrm{S}^3$ compared to the naive and SOTA samplers. The Skinny Gibbs sampler typically has lower computational cost compared to $\mathrm{S}^3$ for logistic regression, and can have lower or higher computational cost than $\mathrm{S}^3$ for probit regression depending on whether $\| z_t\| _1^2\leq np_t$ or not. However, unlike $\mathrm{S}^3$ , the Skinny Gibbs sampler does not converge to the correct posterior distribution. + +To assess the practical impact of computational cost and asymptotic bias, Figures 2 and 3 compares the numerical + +![](images/9d75763f017eb6039b7fc9cb5331f6edbf1a8b92c68719026624f880d4d7ef55.jpg) +Figure 2. Comparison of time per iteration between $\mathbf{S}^3$ , state-of-the-art (SOTA) exact MCMC sampler and the Skinny Gibbs approximate sampler of Narisetty et al. (2019) on synthetic binary classification datasets. See Section 3 for details. + +runtimes and statistical performance of $\mathrm{S}^3$ with the SOTA sampler and the Skinny Gibbs sampler. For the Skinny Gibbs sampler, we use the skinnybasad R package of Narisetty et al. (2019), which implements only logistic regression. We consider synthetically generated datasets with a true signal $\beta^{*}\in \mathbb{R}^{p}$ where $\beta_j^* = 2\mathrm{I}\{j\leq s\}$ for sparsity $s$ . We consider datasets with $n = 10s$ observations and $p = 100s$ covariates for varying sparsity $s\geq 1$ . Details of the synthetically generated dataset are in Appendix D. For each synthetic dataset, we run $\mathrm{S}^3$ for logistic and probit regression and the Skinny Gibbs sampler for 1000 iterations, run the SOTA sampler for 100 iterations, and record the average time taken per iteration. All timings were obtained using a single core of an Apple M1 chip on a Macbook Air 2020 laptop with 16 GB RAM. + +Figure 2 highlights that the numerical runtimes of $\mathrm{S}^3$ are orders of magnitude faster than the SOTA sampler and comparable to the Skinny Gibbs sampler. For example, for $n = 4000$ observations, $p = 40000$ covariates, and sparsity $s = 400$ , $\mathrm{S}^3$ for logistic regression requires 21500ms per iteration on average, which is approximately 15 times faster than the SOTA sampler for probit regression (which requires 335000ms per iteration on average) and 2.5 times faster than the Skinny Gibbs sampler (which requires 55600ms per iteration on average), and $\mathrm{S}^3$ for probit regression requires 1100ms per iteration on average, which is approximately 50 times faster than the SOTA sampler for probit regression (which requires 55800ms per iteration on average). For larger real-life datasets with hundreds of thousands of covariates, the numerical runtimes of $\mathrm{S}^3$ are similarly favorable compared to the SOTA sampler. This is showcased in Section 4, where for a genetics dataset, $\mathrm{S}^3$ is 50 times faster than the SOTA sampler. + +Figure 3 plots the true positive rate (TPR) and the false discovery rate (FDR) of variable selection based on samples + +Figure 3. Average true positive rate (TPR) and false discovery rate (FDR) of $\mathrm{S}^3$ and the Skinny Gibbs approximate sampler (Narisetty et al., 2019) across 20 independently generated datasets with one standard error bars. See Section 3 for details. +![](images/71ae7ff18cf944a4d1855474e138467fca3e6eb54d0df545bd770fedd72f1f34.jpg) +Sampler S³ Logistic - - - s³ Probit …… Skinny Gibbs Logistic + +![](images/9cab502020ecb7623b33e436b0c08e8359a9763a8e54846a8288b402ca3ac6fe.jpg) + +from $\mathbf{S}^3$ for logistic and probit regression and Skinny Gibbs on synthetic binary classification datasets. To assess variable selection for signals of varying magnitude, we consider an exponentially decaying sparse true signal $\beta^{*}\in \mathbb{R}^{p}$ such that $\beta_j^* = 2^{\frac{9 - j}{4}}$ for $j\leq s$ and $\beta_j^* = 0$ for $j > s$ for sparsity $s$ . The corresponding synthetically generated datasets have $n = 100$ observations, varying number of covariates $p$ with $p\geq n$ , and sparsity $s = 5$ . For each synthetic dataset, we implement $\mathbf{S}^3$ for logistic and probit regression and the Skinny Gibbs sampler for 5000 iterations with a burn-in of 1000 iterations and calculate the TPR and FDR from the samples. We use the same prior hyperparameters for all the algorithms, which are chosen according to Narisetty et al. (2019). Additional experimental details are included in Appendices C. The SOTA sampler is not shown in Figure 3, as SOTA and $\mathbf{S}^3$ are alternative implementations of the same Gibbs sampler and by definition have the same statistical performance. Figure 3 shows that in higher dimensions, samples from $\mathbf{S}^3$ yield significantly higher TPR and lower FDR than the Skinny Gibbs sampler. We observe similar results for other choices of prior hyperparameters, which give $\mathbf{S}^3$ to either have comparable or more favorable statistical performance to the Skinny Gibbs sampler. + +Overall, Figures 2 and 3 highlight that $\mathrm{S}^3$ can have comparable or even favorable computational cost to the Skinny Gibbs sampler, whilst having the correct stationary distribution and more favorable statistical properties in higher dimensions. Appendix E contains additional simulation results showcasing $\mathrm{S}^3$ performance for individual datasets as the chain length and the total time elapsed varies. + +# 4. Applications + +We now examine the benefits of $\mathrm{S}^3$ on a diverse suite of regression and binary classification datasets. Table 2 sum + +Table 2. Synthetic and real-life datasets considered in Section 4. + +
DATASETnpRESPONSE TYPE
BOROVECKI3122283BINARY
CHIN11822215BINARY
CHOWDARY10422283BINARY
GORDON18112533BINARY
LYMPH1484514BINARY
MAIZE226698385CONTINUOUS
MALWARE373503BINARY
PCR6022575CONTINUOUS
SYNTHETIC BINARY100050000CONTINUOUS
SYNTHETIC CONTINUOUS100050000BINARY
+ +marizes the two synthetic and eight real-world datasets considered, with further details in Appendix D. + +We first consider the Gordon microarray dataset (Gordon et al., 2002) with $n = 181$ observations (corresponding to a binary response vector indicating presence of lung cancer) and $p = 12533$ covariates (corresponding to genes expression levels). Figure 4 shows the marginal posterior probabilities estimated using samples from $S^3$ and the SOTA sampler for logistic and probit regression and the Skinny Gibbs sampler for logistic regression, as well as the corresponding average runtimes per iteration. The marginal posterior probabilities $\pi_j \triangleq \mathbb{P}_{\pi}(z_j = 1)$ are estimated by $\hat{\pi}_j = \frac{1}{I(T - S)}\sum_{i = 1}^{I}\sum_{t = S + 1}^{T}z_{j,t}^{(i)}$ , where $(\boldsymbol{z}_t^{(i)})_{t\geq 0}$ are samples from $i = 1,\dots,I$ independent Markov chains generated using $S^3$ . We sample $I = 5$ independent chains of length $T = 5000$ iterations with a burn-in of 1000 iterations for both $S^3$ and the SOTA sampler. The average runtime per iteration with one standard error bars are calculated based on these independent chains. + +Figure 4 (Left) plots $\hat{\pi}_j$ against $j$ in the decreasing order of $\hat{\pi}_j\mathrm{s}$ . It shows $\hat{\pi}_j\mathrm{s}$ based on samples from both $\mathrm{S}^3$ and the SOTA sampler. We simulate both $\mathrm{S}^3$ and the SOTA sampler with the same random numbers at each iteration, so that any differences will be due to numerical imprecision. Figure 4 (Left) shows that the estimates using $\mathrm{S}^3$ and the SOTA sampler are indistinguishable. Furthermore, in this example all components of $z_{t}$ are identical between $\mathrm{S}^3$ and the SOTA sampler chains for all iterations $t$ . Despite producing Markov chains with indistinguishable marginal distributions and hence statistical properties, Figure 4 (Right) shows that $\mathrm{S}^3$ has approximately 20 and 6 times faster runtime per iteration than SOTA for logistic and probit regression respectively. Furthermore, $\mathrm{S}^3$ for logistic regression has approximately 100 times faster runtime per iteration than the Skinny Gibbs sampler. Overall, Figure 4 highlights the practical value of $\mathrm{S}^3$ over the SOTA sampler and the Skinny Gibbs sampler. + +Figure 5, plotted with the y-axis on the log-scale, compares the runtimes of $\mathrm{S}^3$ and the SOTA sampler for linear and + +![](images/6c115083f081a85f8cde915bff18cd0cad53904781d995911b3c19f95b8da6c3.jpg) +Figure 4. Comparing Bayesian logistic and probit regression with $\mathrm{S}^3$ , SOTA, and Skinny Gibbs on the Gordon microarray dataset with $n = 181$ observations and $p = 12533$ covariates. (Left and Middle) Marginal posterior probabilities $\mathbb{P}_{\pi}(z_j = 1)$ estimated using samples from each chain: the recovered $\mathrm{S}^3$ and SOTA probabilities are indistinguishable but differ significantly from the Skinny Gibbs probabilities. (Right) Average runtime per sampler iteration with one standard error bars. See Section 4 for details. + +probit regression on ten regression and binary classification datasets respectively. It plots the average runtimes with one standard error bars based on 10 independent chains each of length 1000 and 100 for $\mathrm{S}^3$ and the SOTA sampler respectively. Figure 5 shows that $\mathrm{S}^3$ has lower runtimes per iteration compared to the SOTA sampler for all the datasets considered, with the most substantial speedups for larger datasets. For example, for the Maize GWAS dataset (Romay et al., 2013; Liu et al., 2016; Zeng & Zhou, 2017) with $n = 2266$ observations (corresponding to average number of days taken for silk emergence in different maize lines) and $p = 98385$ covariates (corresponding to single nucleotide polymorphisms (SNPs) in the genome), $\mathrm{S}^3$ requires 650ms per iteration on average, which is 48 times faster than the SOTA sampler requiring 31300ms per iteration. For researchers, such speedups can reduce algorithm runtime from days to hours, giving substantial time and computational cost savings at no compromise to inferential quality. Appendix E contains additional results of $\mathrm{S}^3$ applied to these datasets including effective sample size (ESS) calculations, marginal posterior probabilities, and performance under 10-fold cross-validation. + +# 5. Further Work + +The following questions arise from our work. + +Extensions of $\mathrm{S}^3$ to point-mass spike-and-slab priors, as well as to non-Gaussian tails. Whilst priors given in (1) are one of the most common formulations employed in practice, a number of alternatives are available. This includes point-mass spike-and-slab priors (e.g., Mitchell + +![](images/3f94bb141b8738304cb67ae52a6dd8fb70fc99fd9fc557de40445d5fcc441301.jpg) +Figure 5. Average runtime per iteration with one standard error bars for $\mathrm{S}^3$ and the SOTA sampler for linear and probit regression applied to the ten continuous and binary response datasets. See Section 4 for details. + +& Beauchamp, 1988; Johnson & Rossell, 2012), where a degenerate Dirac distribution about zero is chosen for the spike part, and extensions which consider the heavier-tailed Laplace distribution for the slab part instead of a Gaussian distribution (Castillo et al., 2015; Ročková, 2018; Ray et al., 2020; Ray & Szabó, 2021). An extension of $\mathrm{S}^3$ would to be employ similar pre-computation based strategy of Section 2 to MCMC samplers for these alternative formulations. + +Convergence complexity analysis of $\mathrm{S}^3$ . An important question that is not addressed in this article is the number of iterations required for $\mathrm{S}^3$ or other similar samplers to converge to the their target posterior distributions. For Gibbs samplers targeting posteriors corresponding to continuous shrinkage priors (e.g., Carvalho et al., 2010; Bhattacharya et al., 2015; Bhadra et al., 2019), much theoretical progress has been made (Pal & Khare, 2014; Qin & Hobert, 2019; Bhattacharya et al., 2022; Biswas et al., 2022). Convergence of Gibbs samplers targeting spike-and-slab posteriors has been less extensively studied and requires more attention. + +Diagnostics to assess the convergence of and asymptotic variance of $\mathrm{S}^3$ . Given some time and computational budget constraints, an immediate benefit of $\mathrm{S}^3$ is the ability to run longer Markov chains targeting spike-and-slab posteriors. This can alleviate some concerns linked to burn-in and asymptotic variance, but convergence and effective sample size diagnostics (Johnson, 1998; Biswas et al., 2019; Vats & Knudson, 2021; Vehtari et al., 2021) remain an important consideration particularly in high-dimensional settings. We hope to investigate convergence diagnostics in future work. + +Acknowledgments. We thank Juan Shen for sharing the PCR and the Lymph Node datasets, as well as Xiaolei Liu and Xiang Zhou for sharing the Maize GWAS dataset. NB was supported by the NSF grant DMS-1844695, a GSAS Merit Fellowship, and a Two Sigma Fellowship Award. XLM was partially supported by the NSF grant DMS-1811308. + +# References + +Bai, R., Ročková, V., and George, E. I. Spike-and-slab meets LASSO: A review of the spike-and-slab LASSO. Handbook of Bayesian Variable Selection, 2021. +Banerjee, S., Castillo, I., and Ghosal, S. Bayesian inference in high-dimensional models. Springer volume on Data Science, 2021. +Barbieri, M. M. and Berger, J. O. Optimal predictive model selection. Annals of Statistics, 32(3):870 - 897, 2004. doi: 10.1214/009053604000000238. URL https://doi.org/10.1214/009053604000000238. +Barbieri, M. M., Berger, J. O., George, E. I., and Ročková, V. The Median Probability Model and Correlated Variables. Bayesian Analysis, 16(4):1085 - 1112, 2021. doi: 10.1214/20-BA1249. URL https://doi.org/10.1214/20-BA1249. +Bhadra, A., Datta, J., Polson, N. G., and Willard, B. Lasso Meets Horseshoe: A Survey. Statistical Science, 34 (3):405 - 427, 2019. doi: 10.1214/19-STS700. URL https://doi.org/10.1214/19-STS700. +Bhattacharya, A., Pati, D., Pillai, N. S., and Dunson, D. B. Dirichlet-Laplace Priors for Optimal Shrinkage. Journal of the American Statistical Association, 110(512):1479-1490, 2015. doi: 10.1080/01621459.2014.960967. URL https://doi.org/10.1080/01621459.2014.960967. +Bhattacharya, A., Chakraborty, A., and Mallick, B. K. Fast sampling with Gaussian scale mixture priors in high-dimensional regression. Biometrika, 103 (4):985-991, 2016. ISSN 0006-3444. doi: 10.1093/biomet/asm042. URL https://doi.org/10.1093/biomet/asm042. +Bhattacharya, S., Khare, K., and Pal, S. Geometric ergodicity of Gibbs samplers for the Horseshoe and its regularized variants. *Electronic Journal of Statistics*, 16(1):1 - 57, 2022. doi: 10.1214/21-EJS1932. URL https://doi.org/10.1214/21-EJS1932. +Biswas, N., Jacob, P. E., and Vanetti, P. Estimating convergence of markov chains with l-lag couplings. In Advances in Neural Information Processing Systems, volume 32. Curran Associates, + +Inc., 2019. URL https://proceedings.neurips.cc/paper/2019/file/aec851e565646f6835e915293381e20a-Paper.pdf. +Biswas, N., Bhattacharya, A., Jacob, P. E., and Johndrow, J. E. Coupling-based convergence assessment of some gibbs samplers for high-dimensional bayesian regression with shrinkage priors. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 2022. doi: 10.1111/rssb.12495. URL https://doi.org/10.1111/rssb.12495. +Bogdan, M., van den Berg, E., Sabatti, C., Su, W., and Candès, E. J. SLOPE—Adaptive variable selection via convex optimization. The Annals of Applied Statistics, 9 (3):1103 - 1140, 2015. doi: 10.1214/15-AOAS842. URL https://doi.org/10.1214/15-AOAS842. +Carvalho, C. M., Polson, N. G., and Scott, J. G. The horseshoe estimator for sparse signals. Biometrika, 97 (2):465-480, 04 2010. ISSN 0006-3444. doi: 10.1093/biomet/asq017. URL https://doi.org/10.1093/biomet/asq017. +Castillo, I. and van der Vaart, A. Needles and Straw in a Haystack: Posterior concentration for possibly sparse sequences. Annals of Statistics, 40(4):2069 - 2101, 2012. doi: 10.1214/12-AOS1029. URL https://doi.org/10.1214/12-AOS1029. +Castillo, I., Schmidt-Hieber, J., and van der Vaart, A. Bayesian linear regression with sparse priors. Annals of Statistics, 43(5):1986-2018, 2015. doi: 10.1214/15-AOS1334. URL https://doi.org/10.1214/15-AOS1334. +Dua, D. and Graff, C. UCI machine learning repository, 2017. URL http://archive.ics.uci.edu/ml. +Flegal, J. M., Hughes, J., Vats, D., Dai, N., Gupta, K., and Maji, U. mcmcse: Monte Carlo Standard Errors for MCMC. Riverside, CA, and Kanpur, India, 2021. R package version 1.5-0. +George, E. I. and McCulloch, R. E. Variable Selection via Gibbs Sampling. Journal of the American Statistical Association, 88(423):881-889, 1993. doi: 10.1080/01621459.1993.10476353. URL https://www.tandfonline.com/doi/abs/10.1080/01621459.1993.10476353. +George, E. I. and McCulloch, R. E. Approaches for Bayesian Variable Selection. Statistica Sinica, 7(2): 339-373, 1997. ISSN 10170405, 19968507. URL http://www.jstor.org/stable/24306083. + +Gordon, G. J. G., Jensen, R. V. R., Hsiao, L.-L. L., Gullans, S. R. S., Blumenstock, J. E. J., Ramaswamy, S. S., Richards, W. G. W., Sugarbaker, D. J. D., and Bueno, R. R. Translation of Microarray Data into Clinically Relevant Cancer Diagnostic Tests Using Gene Expression Ratios in Lung Cancer and Mesothelioma. *Cancer Research*, 62(17):4963-4967, September 2002. +Guan, Y. and Stephens, M. Bayesian variable selection regression for genome-wide association studies and other large-scale problems. The Annals of Applied Statistics, 5 (3):1780 - 1815, 2011. doi: 10.1214/11-AOAS455. URL https://doi.org/10.1214/11-AOAS455. +Hager, W. W. Updating the inverse of a matrix. SIAM Review, 31(2):221-239, 1989. ISSN 00361445. URL http://www.jstor.org/stable/2030425. +Hans, C., Dobra, A., and West, M. Shotgun Stochastic Search for "Large p" Regression. Journal of the American Statistical Association, 102(478):507-516, 2007. doi: 10.1198/016214507000000121. URL https://doi.org/10.1198/016214507000000121. +Held, L. and Holmes, C. C. Bayesian auxiliary variable models for binary and multinomial regression. Bayesian Analysis, 1(1):145 - 168, 2006. doi: 10.1214/06-BA105. URL https://doi.org/10.1214/06-BA105. +Ishwaran, H. and Rao, J. S. Spike and slab variable selection: Frequentist and Bayesian strategies. Annals of Statistics, 33(2):730 - 773, 2005. doi: 10.1214/009053604000001147. URL https://doi.org/10.1214/009053604000001147. +Johndrow, J., Orenstein, P., and Bhattacharya, A. Scalable Approximate MCMC Algorithms for the Horseshoe Prior. Journal of Machine Learning Research, 21(73):1-61, 2020. URL http://jmlr.org/papers/v21/19-536.html. +Johnson, V. E. A coupling-regeneration scheme for diagnosing convergence in Markov chain Monte Carlo algorithms. Journal of the American Statistical Association, 93(441): 238-248, 1998. +Johnson, V. E. and Rossell, D. Bayesian Model Selection in High-Dimensional Settings. Journal of the American Statistical Association, 107(498):649-660, 2012. doi: 10.1080/01621459.2012.682536. URL https://doi.org/10.1080/01621459.2012.682536. +Johnstone, I. M. and Silverman, B. W. Needles and straw in haystacks: Empirical Bayes estimates of possibly sparse sequences. Annals of Statistics, 32(4):1594 - 1649, 2004. doi: 10.1214/009053604000000030. URL https://doi.org/10.1214/009053604000000030. + +Kelly, B. C. Some Aspects of Measurement Error in Linear Regression of Astronomical Data. The Astrophysical Journal, 665(2):1489-1506, aug 2007. doi: 10.1086/519947. URL https://doi.org/10.1086/519947. +Liang, F., Song, Q., and Yu, K. Bayesian Subset Modeling for High-Dimensional Generalized Linear Models. Journal of the American Statistical Association, 108(502):589-606, 2013. doi: 10.1080/01621459.2012.761942. URL https://doi.org/10.1080/01621459.2012.761942. +Liu, X., Huang, M., Fan, B., Buckler, E. S., and Zhang, Z. Iterative Usage of Fixed and Random Effect Models for Powerful and Efficient Genome-Wide Association Studies. PLOS Genetics, 12(2):1-24, 2016. doi: 10.1371/journal.pgen.1005767. URL https://doi.org/10.1371/journal.pgen.1005767. +Mitchell, T. J. and Beauchamp, J. J. Bayesian Variable Selection in Linear Regression. Journal of the American Statistical Association, 83(404):1023-1032, 1988. ISSN 01621459. URL http://www.jstor.org/stable/2290129. +Narisetty, N. N. and He, X. Bayesian variable selection with shrinking and diffusing priors. Annals of Statistics, 42 (2):789 - 817, 2014. doi: 10.1214/14-AOS1207. URL https://doi.org/10.1214/14-AOS1207. +Narisetty, N. N., Shen, J., and He, X. Skinny Gibbs: A Consistent and Scalable Gibbs Sampler for Model Selection. Journal of the American Statistical Association, 114(527):1205-1217, 2019. doi: 10.1080/01621459.2018.1482754. URL https://doi.org/10.1080/01621459.2018.1482754. +O'Brien, S. M. and Dunson, D. B. Bayesian multivariate logistic regression. Biometrics, 60(3):739-746, 2004. doi: 10.1111/j.0006-341X.2004.00224.x. URL https://doi:10.1111/j.0006-341X.2004.00224.x. +Pal, S. and Khare, K. Geometric ergodicity for Bayesian shrinkage models. Electronic Journal of Statistics, 8(1): 604-645, 2014. doi: 10.1214/14-EJS896. URL https://doi.org/10.1214/14-EJS896. +Polson, N. G., Scott, J. G., and Windle, J. Bayesian Inference for Logistic Models Using Polya-Gamma Latent Variables. Journal of the American Statistical Association, 108(504):1339-1349, 2013. doi: 10.1080/01621459.2013.829001. URL https://doi.org/10.1080/01621459.2013.829001. +Qin, Q. and Hobert, J. P. Convergence complexity analysis of Albert and Chib's algorithm for Bayesian probit regression. Annals of Statistics, 47(4):2320-2347, 2019. doi: + +10.1214/18-AOS1749. URL https://doi.org/10. 1214/18-AOS1749. +Ray, K. and Szabó, B. Variational bayes for high-dimensional linear regression with sparse priors. Journal of the American Statistical Association, 0(0):1-12, 2021. doi: 10.1080/01621459.2020.1847121. URL https://doi.org/10.1080/01621459.2020.1847121. +Ray, K., Szabo, B., and Clara, G. Spike and slab variational bayes for high dimensional logistic regression. In Advances in Neural Information Processing Systems, volume 33, pp. 14423-14434. Curran Associates, Inc., 2020. URL https://proceedings.neurips.cc/paper/2020/file/a5bad363fc47f424ddb5091c8471480a-Paper.pdf. +Romay, M. C., Millard, M. J., Glaubitz, J. C., Peiffer, J. A., Swarts, K. L., Casstevens, T. M., Elshire, R. J., Acharya, C. B., Mitchell, S. E., Flint-Garcia, S. A., McMullen, M. D., Holland, J. B., Buckler, E. S., and Gardner, C. A. Comprehensive genotyping of the USA national maize inbred seed bank. Genome Biology, 14(6):R55, 2013. doi: 10.1186/gb-2013-14-6-r55. URL https://doi.org/10.1186/gb-2013-14-6-r55. +Ročková, V. Bayesian estimation of sparse signals with a continuous spike-and-slab prior. Annals of Statistics, 46 (1):401 - 437, 2018. doi: 10.1214/17-AOS1554. URL https://doi.org/10.1214/17-AOS1554. +Scott, J. G. and Berger, J. O. Bayes and empirical-Bayes multiplicity adjustment in the variable-selection problem. Annals of Statistics, 38(5):2587 - 2619, 2010. doi: 10.1214/10-AOS792. URL https://doi.org/10.1214/10-AOS792. +Sereno, M. A Bayesian approach to linear regression in astronomy. Monthly Notices of the Royal Astronomical Society, 455(2):2149-2162, 11 2015. ISSN 0035-8711. doi: 10.1093/mnras/stv2374. URL https://doi.org/10.1093/mnras/stv2374. +Tadesse, M. G. and Vannucci, M. Handbook of Bayesian Variable Selection. Chapman and Hall/CRC, 2021. doi: 10.1201/9781003089018. URL https://doi.org/10.1201/9781003089018. +Tibshirani, R. Regression Shrinkage and Selection Via the Lasso. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 58(1): 267-288, 1996. doi: 10.1111/j.2517-6161.1996.tb02080.x. URL https://doi.org/10.1111/j.2517-6161.1996.tb02080.x. + +Titsias, M. and Lázaro-Gredilla, M. Spike and slab variational inference for multi-task and multiple kernel learning. In Advances in Neural Information Processing Systems, volume 24. Curran Associates, Inc., 2011. URL https://proceedings.neurips.cc/paper/2011/file/b495ce63ede0f4efc9eec62cb947c162-Paper.pdf. +Vats, D. and Knudson, C. Revisiting the Gelman-Rubin Diagnostic. Statistical Science, 36(4):518 - 529, 2021. doi: 10.1214/20-STS812. URL https://doi.org/10.1214/20-STS812. +Vats, D., Flegal, J. M., and Jones, G. L. Multivariate output analysis for Markov chain Monte Carlo. Biometrika, 106(2):321-337, 2019. ISSN 0006-3444. doi: 10.1093/biomet/asz002. URL https://doi.org/10.1093/biomet/asz002. +Vehtari, A., Gelman, A., Simpson, D., Carpenter, B., and Burkner, P.-C. Rank-Normalization, Folding, and Localization: An Improved $\widehat{R}$ for Assessing Convergence of MCMC (with Discussion). Bayesian Analysis, 16 (2):667 - 718, 2021. doi: 10.1214/20-BA1221. URL https://doi.org/10.1214/20-BA1221. +Yang, Y., Wainwright, M. J., and Jordan, M. I. On the computational complexity of high-dimensional Bayesian variable selection. Annals of Statistics, 44(6):2497-2532, 2016. doi: 10.1214/15-AOS1417. URL https://doi.org/10.1214/15-AOS1417. +Zeng, P. and Zhou, X. Non-parametric genetic prediction of complex traits with latent Dirichlet process regression models. Nature Communications, 8(1):456, 2017. doi: 10.1038/s41467-017-00470-2. URL https://doi.org/10.1038/s41467-017-00470-2. +Zhou, X., Carbonetto, P., and Stephens, M. Polygenic Modeling with Bayesian Sparse Linear Mixed Models. PLOS Genetics, 9(2):1-14, 02 2013. doi: 10.1371/journal.pgen.1003264. URL https://doi.org/10.1371/journal.pgen.1003264. +Zou, H. and Hastie, T. Regularization and variable selection via the elastic net. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 67 (2):301-320, 2005. doi: 10.1111/j.1467-9868.2005.00503.x. URL https://doi.org/10.1111/j.1467-9868.2005.00503.x. + +# A. Proofs + +Proof of Proposition 2.1. Consider Step 1 of Algorithm 2 and Algorithm 3 for probit regression. Given pre-computed matrices $\tilde{M}_{\tau_0}$ , $\tilde{M}_{\tau_0}$ , $M_{t-1}$ , $M_{t-1}^{-1}$ and state $\boldsymbol{z}_{t-1}$ , calculating $M_t$ , $M_t^{-1}$ requires $\mathcal{O}(n^2 p_t)$ cost by (3) and (4), where $p_t = \min \{\| \boldsymbol{z}_t \|_1, p - \| \boldsymbol{z}_t \|_1, \delta_t\}$ for $\delta_t = \| \boldsymbol{z}_t - \boldsymbol{z}_{t-1} \|_1$ . + +Consider Step 1 of Algorithm 3 for logistic regression. This requires $\mathcal{O}(\max\{n^2 p_t, n^3\})$ cost, where the $\mathcal{O}(n^2 p_t)$ cost arises from the calculation of $M_t$ using (21) and the $\mathcal{O}(n^3)$ cost arises from inverting $M_t$ to calculate $M_t^{-1}$ . + +Given $M_t^{-1}$ , Step 2 of Algorithms 2 and 3 then requires $\mathcal{O}(np)$ cost, which arises from the matrix vector product $X D_t^{-\frac{1}{2}} r$ for $r \sim \mathcal{N}(0, I_p)$ in Algorithm 1. By component-wise independence, Step 3 of Algorithms 2 and 3 costs $\mathcal{O}(p)$ and Step 4 of Algorithm 3 cost $\mathcal{O}(n)$ . Step 4 of Algorithm 3 and Step 5 of Algorithm 3 for probit regression both cost $\mathcal{O}(1)$ . Step 5 of Algorithm 3 for logistic regression both costs $\mathcal{O}(n)$ . + +This gives an overall computational cost of $\mathcal{O}(\max\{n^2 p_t, np\})$ for Algorithm 2 and Algorithm 3 for probit regression at iteration $t$ , and a cost of $\mathcal{O}(\max\{n^2 p_t, n^3, np\})$ for 3 for logistic regression. + +Proof of Proposition 2.2. By linearity, $\mathbb{E}[\delta_t] = \sum_{j=1}^p \mathbb{P}(z_{j,t} \neq z_{j,t-1})$ where for each component $j$ the random variables $z_{j,t}$ and $z_{j,t-1}$ are on $\{0,1\}$ . For each $j$ , we obtain + +$$ +\begin{array}{l} \mathbb {P} \left(z _ {j, t} \neq z _ {j, t - 1}\right) = \mathbb {P} \left(z _ {j, t} = 1, z _ {j, t - 1} = 0\right) + \mathbb {P} \left(z _ {j, t} = 0, z _ {j, t - 1} = 1\right) \\ = \left(\mathbb {P} \left(z _ {j, t} = 1\right) - \mathbb {P} \left(z _ {j, t} = 1, z _ {j, t - 1} = 1\right)\right) + \left(\mathbb {P} \left(z _ {j, t - 1} = 1\right) - \mathbb {P} \left(z _ {j, t} = 1, z _ {j, t - 1} = 1\right)\right) \\ = \left(\mathbb {P} \left(z _ {j, t} = 1\right) - \operatorname {c o v} \left(z _ {j, t}, z _ {j, t - 1}\right) - \mathbb {P} \left(z _ {j, t} = 1\right) \mathbb {P} \left(z _ {j, t - 1} = 1\right)\right) + \\ \left(\mathbb {P} \left(z _ {j, t - 1} = 1\right) - \operatorname {c o v} \left(z _ {j, t}, z _ {j, t - 1}\right) - \mathbb {P} \left(z _ {j, t} = 1\right) \mathbb {P} \left(z _ {j, t - 1} = 1\right)\right) \\ = \mathbb {P} \left(z _ {j, t} = 1\right) \mathbb {P} \left(z _ {j, t - 1} = 0\right) + \mathbb {P} \left(z _ {j, t} = 0\right) \mathbb {P} \left(z _ {j, t - 1} = 1\right) - 2 \operatorname {c o v} \left(z _ {j, t}, z _ {j, t - 1}\right). \\ \end{array} +$$ + +When $z_{j,t - 1}$ follows the stationary $\pi$ , $z_{j,t} \sim z_{j,t - 1}$ and $\mathrm{var}(z_{j,t}) = \mathbb{P}(z_{j,t} = 1)\mathbb{P}(z_{j,t - 1} = 0)$ . Consequently, + +$$ +\mathbb {P} \left(z _ {j, t} \neq z _ {j, t - 1}\right) = 2 \operatorname {v a r} _ {\pi} \left(z _ {j, t}\right) - 2 \operatorname {c o v} \left(z _ {j, t}, z _ {j, t - 1}\right) = 2 \operatorname {v a r} _ {\pi} \left(z _ {j, t}\right) \left(1 - \operatorname {c o r r} _ {\pi} \left(z _ {j, t}, z _ {j, t - 1}\right)\right). +$$ + +Proof of Proposition 2.3. Note that $a^2 = a$ if $a$ only takes the value 0 and 1. This gives + +$$ +\mathrm {I} \left\{z _ {j, t} \neq z _ {j, t - 1} \right\} = \left(z _ {j, t} - z _ {j, t - 1}\right) ^ {2} = z _ {j, t} + z _ {j, t - 1} - 2 z _ {j, t} z _ {j, t - 1}. \tag {10} +$$ + +Let $J$ be the uniform random variable on the integers $\{1, \ldots, p\}$ . Then, + +$$ +\delta_ {t} = p \left(\mathbb {E} _ {J} \left(z _ {J, t}\right) + \mathbb {E} _ {J} \left(z _ {J, t - 1}\right) - 2 \mathbb {E} _ {J} \left(z _ {J, t} z _ {J, t - 1}\right)\right), \tag {11} +$$ + +where the expectation is taken with respect to the random index $J$ . Note that $\mathbb{E}_J(z_{J,t}) = \| z_t\|_1 / p$ and $\mathrm{Var}_J(z_{J,t}) = (\| z_t\|_1 / p)(1 - \| z_t\|_1 / p) = \tau_t^2 /p^2$ . We obtain + +$$ +\mathbb {E} _ {J} \left(z _ {J, t} z _ {J, t - 1}\right) = \operatorname {C o v} _ {J} \left(z _ {J, t}, z _ {J, t - 1}\right) + \mathbb {E} _ {J} \left(z _ {J, t}\right) \mathbb {E} _ {J} \left(z _ {J, t - 1}\right) = \frac {\rho_ {t} \tau_ {t} \tau_ {t - 1} + \| \boldsymbol {z} _ {t} \| _ {1} \| \boldsymbol {z} _ {t - 1} \| _ {1}}{p ^ {2}}, \tag {12} +$$ + +where $\rho_{t} = \mathrm{corr}_{J}(z_{J,t},z_{J,t - 1})$ . Combining (11)-(12) yields (7). + +# B. Algorithm Derivations + +# B.1. Linear regression with spike-and-slab priors + +For linear regression with the continuous spike-and-slab priors in (1), the posterior density of $(\beta, z, \sigma^2) \in \mathbb{R}^p \times \{0, 1\}^p \times (0, \infty)$ is given by + +$$ +\pi (\boldsymbol {\beta}, \boldsymbol {z}, \sigma^ {2} | \boldsymbol {y}) \propto \mathcal {N} (\boldsymbol {y}; \boldsymbol {X} \boldsymbol {\beta}, \sigma^ {2}) \text {I n v G a m m a} \left(\sigma^ {2}; \frac {a _ {0}}{2}, \frac {b _ {0}}{2}\right) \tag {13} +$$ + +$$ +\prod_ {j = 1} ^ {p} \left(q \mathcal {N} \left(\beta_ {j}; 0, \sigma^ {2} \tau_ {1} ^ {2}\right)\right) ^ {z _ {j}} \left((1 - q) \mathcal {N} \left(\beta_ {j}; 0, \sigma^ {2} \tau_ {0} ^ {2}\right)\right) ^ {1 - z _ {j}}. \tag {14} +$$ + +From (13), we can calculate the conditional distributions. We have + +$$ +\begin{array}{l} \pi (\boldsymbol {\beta} | \boldsymbol {z}, \sigma^ {2}, \boldsymbol {y}) \propto \mathcal {N} (\boldsymbol {y}; \boldsymbol {X} \boldsymbol {\beta}, \sigma^ {2} \boldsymbol {I} _ {n}) \prod_ {j = 1} ^ {p} \mathcal {N} (\beta_ {j}; 0, \sigma^ {2} \tau_ {1} ^ {2}) ^ {z _ {j}} \mathcal {N} (\beta_ {j}; 0, \sigma^ {2} \tau_ {0} ^ {2}) ^ {1 - z _ {j}} \\ \propto \mathcal {N} (\boldsymbol {y}; \boldsymbol {X} \boldsymbol {\beta}, \sigma^ {2} \boldsymbol {I} _ {n}) \mathcal {N} (\boldsymbol {\beta}; 0, \sigma^ {2} \boldsymbol {D} ^ {- 1}) \text {f o r} \boldsymbol {D} \triangleq \operatorname {D i a g} (\boldsymbol {z} \tau_ {1} ^ {- 2} + (\boldsymbol {1} _ {p} - \boldsymbol {z}) \tau_ {0} ^ {- 2}) \\ \propto \exp \left\{- \frac {1}{2 \sigma^ {2} \boldsymbol {I} _ {n}} \left(\boldsymbol {\beta} ^ {\top} \boldsymbol {X} ^ {\top} \boldsymbol {X} \boldsymbol {\beta} - 2 \boldsymbol {\beta} ^ {\top} \boldsymbol {X} ^ {\top} \boldsymbol {y} + \boldsymbol {\beta} ^ {\top} \boldsymbol {D} \boldsymbol {\beta}\right) \right\} \\ \propto \mathcal {N} (\boldsymbol {\beta}; \boldsymbol {\Sigma} ^ {- 1} \boldsymbol {X} ^ {\top} \boldsymbol {y}, \sigma^ {2} \boldsymbol {\Sigma} ^ {- 1}) f o r \boldsymbol {\Sigma} = \boldsymbol {X} ^ {\top} \boldsymbol {X} + D, \\ \end{array} +$$ + +$$ +\begin{array}{l} \pi (\boldsymbol {z} | \boldsymbol {\beta}, \sigma^ {2}, \boldsymbol {y}) \propto \prod_ {j = 1} ^ {p} \left(q \mathcal {N} \left(\beta_ {j}; 0, \sigma^ {2} \tau_ {1} ^ {2}\right)\right) ^ {z _ {j}} \left((1 - q) \mathcal {N} \left(\beta_ {j}; 0, \sigma^ {2} \tau_ {0} ^ {2}\right)\right) ^ {1 - z _ {j}} \\ \propto \prod_ {j = 1} ^ {p} \mathrm {B e r n o u l l i} \Big (z _ {i}; \frac {q \mathcal {N} (\beta_ {j} ; 0 , \sigma^ {2} \tau_ {1} ^ {2})}{q \mathcal {N} (\beta_ {j} ; 0 , \sigma^ {2} \tau_ {1} ^ {2}) + (1 - q) \mathcal {N} (\beta_ {j} ; 0 , \sigma^ {2} \tau_ {0} ^ {2})} \Big), \mathrm {a n d} \\ \end{array} +$$ + +$$ +\begin{array}{l} \pi (\sigma^ {2} | \boldsymbol {\beta}, \boldsymbol {z}, \boldsymbol {y}) \propto \mathcal {N} (\boldsymbol {y}; \boldsymbol {X} \boldsymbol {\beta}, \sigma^ {2}) \mathrm {I n v G a m m a} \Big (\sigma^ {2}; \frac {a _ {0}}{2}, \frac {b _ {0}}{2} \Big) \mathcal {N} (\boldsymbol {\beta}; 0, \sigma^ {2} \boldsymbol {D} ^ {- 1}) \\ \propto \left(\frac {1}{\sigma^ {2}}\right) ^ {\frac {n}{2}} \exp \left\{- \frac {1}{2 \sigma^ {2}} \| \boldsymbol {y} - \boldsymbol {X} \boldsymbol {\beta} \| _ {2} ^ {2} \right\} \left(\frac {1}{\sigma^ {2}}\right) ^ {\frac {a _ {0}}{2}} \exp \left\{- \frac {1}{2 \sigma^ {2}} b _ {0} \right\} \left(\frac {1}{\sigma^ {2}}\right) ^ {\frac {p}{2}} \exp \left\{- \frac {1}{2 \sigma^ {2}} \boldsymbol {\beta} ^ {\top} \boldsymbol {D} \boldsymbol {\beta} \right\} \\ \propto \operatorname {I n v G a m m a} \left(\sigma^ {2}; \frac {a _ {0} + n + p}{2}, \frac {b _ {0} + \| \boldsymbol {y} - \boldsymbol {X} \boldsymbol {\beta} \| _ {2} ^ {2} + \boldsymbol {\beta} ^ {\top} \boldsymbol {D} \boldsymbol {\beta}}{2}\right) \\ \end{array} +$$ + +as given in Algorithm 2. + +# B.2. Probit regression with spike-and-slab priors + +Consider the probit regression likelihood, where for each observation $i = 1,\dots,n$ , $\mathbb{P}(y_i = 1|\pmb{x}_i,\beta) = 1 - \mathbb{P}(y_i = 0|\pmb{x}_i,\beta) = \Phi (\pmb{x}_i^\top \beta)$ for $\pmb{x}_i^\top$ the $i$ -th row of the design matrix $\pmb{X}$ . and $\Phi$ that cumulative density function of a univariate Normal distribution. We obtain $y_{i} = \mathrm{I}\{\tilde{y}_{i} > 0\}$ for $\tilde{y}_i|\beta \sim \mathcal{N}(\pmb{x}_i^\top \beta ,1)$ . The Bayesian probit regression model is then given by + +$$ +z _ {j} \stackrel {{i. i. d.}} {{\sim}} \operatorname {B e r n o u l l i} (q) \quad \text {f o r a l l} j = 1, \dots , p +$$ + +$$ +\beta_ {j} \left| z _ {j} \right. \stackrel {\text {i n d}} {\sim} (1 - z _ {j}) \mathcal {N} \left(0, \tau_ {0} ^ {2}\right) + z _ {j} \mathcal {N} \left(0, \tau_ {1} ^ {2}\right) \quad \text {f o r a l l} j = 1, \dots , p \tag {15} +$$ + +$$ +\tilde {y} _ {i} | \boldsymbol {\beta} \stackrel {{i n d}} {{\sim}} \mathcal {N} (\boldsymbol {x} _ {i} ^ {\top} \boldsymbol {\beta}, 1) \quad \text {f o r a l l} i = 1, \dots , n +$$ + +$$ +y _ {i} = \mathrm {I} \left\{\tilde {y} _ {i} > 0 \right\} \quad \text {f o r a l l} i = 1, \dots , n. +$$ + +For the prior and likelihood in (15), the posterior density of $(\beta, z, \tilde{y}) \in \mathbb{R}^p \times \{0, 1\}^p \times \mathbb{R}^p$ is given by + +$$ +\pi (\boldsymbol {\beta}, \boldsymbol {z}, \tilde {\boldsymbol {y}} | \boldsymbol {y}) \propto \Big (\prod_ {i = 1} ^ {n} \mathrm {I} \{\mathrm {I} \{\tilde {y} _ {i} > 0 \} = y _ {i} \} \mathcal {N} (\tilde {y} _ {i}; \boldsymbol {x} _ {\boldsymbol {i}} ^ {\top} \boldsymbol {\beta}, 1) \Big) +$$ + +$$ +\prod_ {j = 1} ^ {p} \left(q \mathcal {N} \left(\beta_ {j}; 0, \tau_ {1} ^ {2}\right)\right) ^ {z _ {j}} \left((1 - q) \mathcal {N} \left(\beta_ {j}; 0, \tau_ {0} ^ {2}\right)\right) ^ {1 - z _ {j}}. \tag {16} +$$ + +From (16), we can calculate the conditional distributions. We obtain + +$$ +\begin{array}{l} \pi (\boldsymbol {\beta} | \boldsymbol {z}, \tilde {\boldsymbol {y}}, \boldsymbol {y}) \propto \mathcal {N} (\tilde {\boldsymbol {y}}; \boldsymbol {X} \boldsymbol {\beta}, \boldsymbol {I} _ {n}) \mathcal {N} (\boldsymbol {\beta}; 0, \boldsymbol {D} ^ {- 1}) \text {f o r} \boldsymbol {D} \triangleq \operatorname {D i a g} (\boldsymbol {z} \tau_ {1} ^ {- 2} + (\mathbf {1} _ {p} - \boldsymbol {z}) \tau_ {0} ^ {- 2}) \\ \propto \mathcal {N} (\boldsymbol {\beta}; \boldsymbol {\Sigma} ^ {- 1} \boldsymbol {X} ^ {\top} \tilde {\boldsymbol {y}}, \boldsymbol {\Sigma} ^ {- 1}) \text {f o r} \boldsymbol {\Sigma} = \boldsymbol {X} ^ {\top} \boldsymbol {X} + \boldsymbol {D}, \\ \end{array} +$$ + +$$ +\pi (\boldsymbol {z} | \boldsymbol {\beta}, \tilde {\boldsymbol {y}}, \boldsymbol {y}) \propto \prod_ {j = 1} ^ {p} \operatorname {B e r n o u l l i} \left(z _ {i}; \frac {q \mathcal {N} \left(\beta_ {j} ; 0 , \tau_ {1} ^ {2}\right)}{q \mathcal {N} \left(\beta_ {j} ; 0 , \tau_ {1} ^ {2}\right) + (1 - q) \mathcal {N} \left(\beta_ {j} ; 0 , \tau_ {0} ^ {2}\right)}\right), \text {a n d} +$$ + +$$ +\pi (\tilde {\boldsymbol {y}} | \boldsymbol {\beta}, \boldsymbol {z}, \boldsymbol {y}) \propto \prod_ {i = 1} ^ {n} \mathcal {N} (\tilde {y} _ {i}; \boldsymbol {x} _ {i} ^ {\top} \boldsymbol {\beta}, 1) \mathrm {I} \left\{\mathrm {I} \left\{\tilde {y} _ {i} > 0 \right\} = y _ {i} \right\}. +$$ + +as required for probit regression in Algorithm 3. + +# B.3. Logistic regression with spike-and-slab priors + +We first describe the Bayesian logistic regression model considered. Consider the logistic regression likelihood, where for each observation $i = 1,\dots,n$ , $\mathbb{P}(y_i = 1|\pmb{x}_i,\beta) = 1 - \mathbb{P}(y_i = 0|\pmb{x}_i,\beta) = \frac{\exp(\pmb{x}_i^\top\beta)}{1 + \exp(\pmb{x}_i^\top\beta)}$ for $\pmb{x}_i^\top$ the $i$ -th row of the design matrix $\pmb{X}$ . We obtain $y_{i} = \mathrm{I}\{\tilde{y}_{i} > 0\}$ where $\tilde{y}_i \stackrel{\text{ind}}{\sim} \operatorname{Logistic}(\pmb{x}_i^\top \beta, 1)$ , corresponding to the logistic distribution centered about $\pmb{x}_i^\top \beta$ and scale parameter 1. + +# B.3.1. STUDENT'S $t$ -DISTRIBUTION BASED APPROXIMATION OF THE LOGISTIC REGRESSION LIKELIHOOD. + +Following O'Brien & Dunson (2004) and Narisetty et al. (2019), we can approximate $\operatorname{Logistic}(\boldsymbol{x}_i^\top \boldsymbol{\beta}, 1)$ with $\boldsymbol{x}_i^\top \boldsymbol{\beta} + w t_\nu$ , where $t_\nu$ denotes a $t$ -distribution with $\nu$ degrees of freedom and $w$ is a multiplicative factor. The constants $\nu \triangleq 7.3$ and $w^2 \triangleq \frac{\pi^2 (\nu - 2)}{3 \nu}$ are chosen following O'Brien & Dunson (2004), in order to match the variance of the logistic distribution and to minimize the integrated squared distance between the respective densities. The Gaussian scale representation of this $t$ -distribution is + +$$ +\tilde {y} _ {i} \left| \boldsymbol {x} _ {i}, \beta , \tilde {\sigma} _ {i} \sim \mathcal {N} \left(\boldsymbol {x} _ {i} ^ {\top} \beta , \tilde {\sigma} _ {i} ^ {2}\right), \quad \tilde {\sigma} _ {i} ^ {2} \sim \operatorname {I n v G a m m a} \left(\frac {v}{2}, \frac {w ^ {2} v}{2}\right), \right. \tag {17} +$$ + +where each $\tilde{\sigma}_i^2$ is an augmented variable. The Bayesian logistic regression model is then given by + +$$ +z _ {j} \stackrel {i. i. d.} {\sim} \operatorname {B e r n o u l l i} (q) \quad \text {f o r a l l} j = 1, \dots , p +$$ + +$$ +\beta_ {j} \left| z _ {j} \right. \stackrel {\text {i n d}} {\sim} (1 - z _ {j}) \mathcal {N} \left(0, \tau_ {0} ^ {2}\right) + z _ {j} \mathcal {N} \left(0, \tau_ {1} ^ {2}\right) \quad \text {f o r a l l} j = 1, \dots , p \tag {18} +$$ + +$$ +\tilde {\sigma} _ {i} ^ {2} \stackrel {i. i. d.} {\sim} \mathrm {I n v G a m m a} (\frac {\nu}{2}, \frac {w ^ {2} \nu}{2}) +$$ + +$$ +\tilde {y} _ {i} | \boldsymbol {\beta}, \tilde {\sigma} _ {i} ^ {2} \stackrel {{i n d}} {{\sim}} \mathcal {N} (\boldsymbol {x} _ {i} ^ {\top} \boldsymbol {\beta}, \tilde {\sigma} _ {i} ^ {2}) \quad \text {f o r a l l} i = 1, \dots , n +$$ + +$$ +y _ {i} = \mathrm {I} \left\{\tilde {y} _ {i} > 0 \right\} \quad \text {f o r a l l} i = 1, \dots , n. +$$ + +Let $\tilde{\sigma}^2$ denote the vector with entries $\tilde{\sigma}_i^2$ for $i = 1,\dots,n$ . For the prior and likelihood in (18), the posterior density of $(\beta, z, \tilde{y}, \tilde{\sigma}^2)$ on $\mathbb{R}^p \times \{0,1\}^p \times \mathbb{R}^n \times (0,\infty)^n$ is given by + +$$ +\pi (\boldsymbol {\beta}, \boldsymbol {z}, \tilde {\boldsymbol {y}}, \tilde {\boldsymbol {\sigma}} ^ {2} | \boldsymbol {y}) \propto \prod_ {j = 1} ^ {p} \left(q \mathcal {N} \left(\beta_ {j}; 0, \tau_ {1} ^ {2}\right)\right) ^ {z _ {j}} \left((1 - q) \mathcal {N} \left(\beta_ {j}; 0, \tau_ {0} ^ {2}\right)\right) ^ {1 - z _ {j}} +$$ + +$$ +\prod_ {i = 1} ^ {n} \mathrm {I} \left\{\mathrm {I} \left\{\tilde {y} _ {i} > 0 \right\} = y _ {i} \right\} \mathcal {N} \left(\tilde {y} _ {i}; \boldsymbol {x} _ {\boldsymbol {i}} ^ {\top} \beta , \tilde {\sigma} _ {i} ^ {2}\right) \text {I n v G a m m a} \left(\tilde {\sigma} _ {i} ^ {2}; \frac {\nu}{2}, \frac {w ^ {2} \nu}{2}\right). \tag {19} +$$ + +From (19), we can calculate the conditional distributions. Let $\mathbf{W} = \mathrm{Diag}(\tilde{\pmb{\sigma}}^2)$ . We obtain + +$$ +\begin{array}{l} \pi (\boldsymbol {\beta} | \boldsymbol {z}, \tilde {\boldsymbol {y}}, \tilde {\boldsymbol {\sigma}} ^ {2}, \boldsymbol {y}) \propto \mathcal {N} (\tilde {\boldsymbol {y}}; \boldsymbol {X} \boldsymbol {\beta}, \boldsymbol {W}) \mathcal {N} (\boldsymbol {\beta}; 0, \boldsymbol {D} ^ {- 1}) \text {f o r} \boldsymbol {D} \triangleq \operatorname {D i a g} (\boldsymbol {z} \tau_ {1} ^ {- 2} + (\mathbf {1} _ {p} - \boldsymbol {z}) \tau_ {0} ^ {- 2}) \\ \propto \mathcal {N} (\boldsymbol {\beta}; \boldsymbol {\Sigma} ^ {- 1} \boldsymbol {X} ^ {\top} \boldsymbol {W} ^ {- 1} \tilde {\boldsymbol {y}}, \boldsymbol {\Sigma} ^ {- 1}) \text {f o r} \boldsymbol {\Sigma} = \boldsymbol {X} ^ {\top} \boldsymbol {W} ^ {- 1} \boldsymbol {X} + \boldsymbol {D}, \\ \end{array} +$$ + +$$ +\begin{array}{l} \pi (\boldsymbol {z} | \boldsymbol {\beta}, \tilde {\boldsymbol {y}}, \tilde {\boldsymbol {\sigma}} ^ {2}, \boldsymbol {y}) \propto \prod_ {j = 1} ^ {p} \mathrm {B e r n o u l l i} \Big (z _ {i}; \frac {q \mathcal {N} (\beta_ {j} ; 0 , \tau_ {1} ^ {2})}{q \mathcal {N} (\beta_ {j} ; 0 , \tau_ {1} ^ {2}) + (1 - q) \mathcal {N} (\beta_ {j} ; 0 , \tau_ {0} ^ {2})} \Big), \\ \pi (\tilde {\boldsymbol {y}} | \boldsymbol {\beta}, \boldsymbol {z}, \tilde {\boldsymbol {\sigma}} ^ {2}, \boldsymbol {y}) \propto \prod_ {i = 1} ^ {n} \mathcal {N} (\tilde {y} _ {i}; \boldsymbol {x} _ {i} ^ {\top} \boldsymbol {\beta}, \tilde {\sigma} _ {i} ^ {2}) \mathrm {I} \left\{\mathrm {I} \left\{\tilde {y} _ {i} > 0 \right\} = y _ {i} \right\}, \text {a n d} \\ \pi (\tilde {\boldsymbol {\sigma}} ^ {2} | \boldsymbol {\beta}, \boldsymbol {z}, \tilde {\boldsymbol {y}}, \boldsymbol {y}) \propto \prod_ {i = 1} ^ {n} \mathcal {N} (\tilde {y} _ {i}; \boldsymbol {x} _ {i} ^ {\top} \boldsymbol {\beta}, \tilde {\sigma} _ {i} ^ {2}) \mathrm {I n v G a m m a} \left(\tilde {\sigma} _ {i} ^ {2}; \frac {\nu}{2}, \frac {w ^ {2} \nu}{2}\right) \\ \propto \prod_ {i = 1} ^ {n} \mathrm {I n v G a m m a} \Big (\tilde {\sigma} _ {i} ^ {2}; \frac {\nu + 1}{2}, \frac {w ^ {2} \nu + (\tilde {y} _ {i} - \boldsymbol {x} _ {i} ^ {\top} \boldsymbol {\beta}) ^ {2}}{2} \Big). \\ \end{array} +$$ + +as required for logistic regression in Algorithm 3. + +Algorithm 4 An $\Omega (n^{2}p)$ sampler of (20) (Bhattacharya et al., 2016) + +Sample $r\sim \mathcal{N}(0,\pmb {I}_p),\pmb {\xi}\sim \mathcal{N}(0,\pmb {I}_n)$ + +Set $\pmb{u} = D_{t}^{-\frac{1}{2}}\pmb{r}$ and calculate $\pmb{v} = W_{t}^{-1 / 2}\pmb {X}\pmb{u} + \pmb{\xi}$ . + +Set $\pmb{v}^{*} = M_{t}^{-1}\left(\pmb{W}_{t}^{-1 / 2}\tilde{\pmb{y}} -\pmb {v}\right)$ for $M_{t} = I_{n} + W_{t}^{-1 / 2}XD_{t}^{-1}X^{\top}W_{t}^{-1 / 2}$ + +Return $\beta = \pmb{u} + D_{t}^{-1}\pmb{X}^{\top}\pmb{W}_{t}^{-1 / 2}\pmb{v}^{*}$ + +A scalable Gibbs sampler for logistic regression. The computational bottleneck of existing Gibbs samplers for logistic regression is linked to sampling from the full conditional of $\beta \in \mathbb{R}^p$ . This is given by + +$$ +\left. \beta_ {t + 1} \right| \boldsymbol {z} _ {t}, \tilde {\sigma} _ {t} ^ {2} \sim \mathcal {N} \left(\boldsymbol {\Sigma} _ {t} ^ {- 1} \boldsymbol {X} ^ {\top} \boldsymbol {W} _ {t} ^ {- 1} \tilde {\boldsymbol {y}}, \boldsymbol {\Sigma} _ {t} ^ {- 1}\right) \quad \text {f o r} \quad \boldsymbol {\Sigma} _ {t} = \boldsymbol {X} ^ {\top} \boldsymbol {W} _ {t} ^ {- 1} \boldsymbol {X} + \boldsymbol {D} _ {t}, \tag {20} +$$ + +where $t$ indexes the iteration of the Markov chain, $\pmb{W}_{t}$ is the diagonal matrix with the vector $\tilde{\sigma}_t^2$ populating its diagonal elements, and $\pmb{D}_{t}$ is the diagonal matrix with the vector $\pmb{z}_t\tau_1^{-2} + (\pmb{1}_p - \pmb{z}_t)\tau_0^{-2}$ populating its diagonal elements. To sample from (20), we can use the $\Omega(n^{2}p)$ sampler of Bhattacharya et al. (2016), which is given in Algorithm 4. + +Following the strategy in Section 2.2, $\mathrm{S}^3$ for logistic regression uses pre-computation to reduce the computational cost of Algorithm 4. Using the notation from Section 2.2 with $M_t \triangleq I_n + W_t^{-1/2} X D_t^{-1} X^\top W_t^{-1/2}$ , we note + +$$ +\begin{array}{l} \boldsymbol {M} _ {t} = \boldsymbol {I} _ {n} + \boldsymbol {W} _ {t} ^ {- 1 / 2} \left(\tilde {\boldsymbol {M}} _ {\tau_ {0}} - I _ {n} + \left(\tau_ {1} ^ {2} - \tau_ {0} ^ {2}\right) \boldsymbol {X} _ {A _ {t} ^ {c}} \boldsymbol {X} _ {A _ {t} ^ {c}} ^ {T}\right) \boldsymbol {W} _ {t} ^ {- 1 / 2} (21a) \\ = \boldsymbol {I} _ {n} + \boldsymbol {W} _ {t} ^ {- 1 / 2} \left(\tilde {\boldsymbol {M}} _ {\tau_ {1}} - I _ {n} + \left(\tau_ {0} ^ {2} - \tau_ {1} ^ {2}\right) \boldsymbol {X} _ {A _ {t} ^ {c}} \boldsymbol {X} _ {A _ {t} ^ {c}} ^ {T}\right) \boldsymbol {W} _ {t} ^ {- 1 / 2} (21b) \\ = \boldsymbol {I} _ {n} + \boldsymbol {W} _ {t} ^ {- 1 / 2} \left(\boldsymbol {W} _ {t - 1} ^ {1 / 2} \left(\boldsymbol {M} _ {t - 1} - I _ {n}\right) \boldsymbol {W} _ {t - 1} ^ {1 / 2} + \boldsymbol {X} _ {\Delta_ {t}} \boldsymbol {C} _ {\Delta_ {t}} \boldsymbol {X} _ {\Delta_ {t}} ^ {T}\right) \boldsymbol {W} _ {t} ^ {- 1 / 2}. (21c) \\ \end{array} +$$ + +In (21a) - (21c), calculating the matrix products $X_{A_t}X_{A_t}^\top, X_{A_t^c}X_{A_t^c}^\top$ , and $X_{\Delta_t}C_{\Delta_t}X_{\Delta_t}^\top$ requires $\mathcal{O}(n^2\|z_t\|_1)$ , $\mathcal{O}(n^2(p-\|\pmb{z}_t\|_1))$ , and $\mathcal{O}(n^2\delta_t)$ cost respectively. Given $\tilde{M}_{\tau_0}$ , $\tilde{M}_{\tau_1}$ , $M_{t-1}$ , and $z_{t-1}$ , we evaluate whichever matrix product in (21a) - (21c) has minimal computational cost and thereby calculate $M_t$ at the reduced cost of $\mathcal{O}(n^2p_t)$ where $p_t \triangleq \min\{\|\pmb{z}_t\|_1, p-\|\pmb{z}_t\|_1, \delta_t\}$ . To calculate $M_t^{-1}$ , we calculate $M_t^{-1}$ by directly inverting the calculated matrix $M_t$ , which requires $\mathcal{O}(n^3)$ cost. Overall, this strategy reduces the computational cost of calculating the matrices $M_t$ and $M_t^{-1}$ from $\Omega(n^2p)$ to $\mathcal{O}(\max\{n^2p_t, n^3\})$ . + +Extensions to Scalable Spike-and-Slab for logistic regression. Suppose the matrices $\mathbf{X}^{\top}\mathbf{X}$ is pre-computed. This initial step requires $\mathcal{O}(np^2)$ computational cost and $\mathcal{O}(p^2)$ memory. Then the matrices $\mathbf{X}_{A_t}^\top \mathbf{X}_{A_t}$ and $\mathbf{X}_{A_t^c}^\top \mathbf{X}_{A_t^c}$ in (21a)-(21b) correspond to pre-computed sub-matrices of $\mathbf{X}^{\top}\mathbf{X}$ , and calculating $M_t$ using (21a)-(21b) each iteration $t$ involves matrix addition and diagonal matrix multiplication which only requires $\mathcal{O}(n^2)$ cost. To sample from (20), we calculate $M_t^{-1}$ by directly inverting the calculated matrix $M_t$ from (3), which requires $\mathcal{O}(n^3)$ cost. Overall, now the Gibbs samplers for logistic regression requires $\mathcal{O}(\max\{n^3, np\})$ computational cost at iteration $t$ , which is an improvement compared to $S^3$ . + +# C. Experiment Details + +Figure 3 of Section 3. In Figure 3, we use the same prior hyperparameters for all the algorithms. Following Narisetty et al. (2019), we choose $\tau_0^2 = \frac{1}{n}$ , $\tau_1^2 = \max \left\{\frac{p^{2.1}}{100n}, 1\right\}$ and $q = \mathbb{P}(z_j = 1)$ such that $\mathbb{P}(\sum_{j=1}^{p} \mathrm{I}\{z_j = 1\}) > K = \max \{10, \log n\}$ . The true positive rate (TPR) and the false discovery rate (FDR) correspond to the proportion of nonzero and zero components of $\beta_j^*$ that are correctly selected respectively. They are calculated as $\frac{1}{s} \sum_{j=1}^{s} \mathrm{I}\{\mathbb{P}_{\pi}(z_j = 1) > 0.5\}$ and $\frac{1}{p-s} \sum_{j=s+1}^{p} \mathrm{I}\{\mathbb{P}_{\pi}(z_j = 1) > 0.5\}$ respectively, where the marginal posterior probabilities $\pi_j \triangleq \mathbb{P}_{\pi}(z_j = 1)$ are estimated by $\hat{\pi}_j \triangleq \frac{1}{4000} \sum_{t=1001}^{5000} z_{j,t}$ for sample points $(z_t)_{t \geq 0}$ generated using S3 or Skinny Gibbs. The lines in Figure 3 correspond to the average TPR and FDR across 20 independently generated datasets, and the grey bands correspond to one standard error of the averages. + +# D. Dataset Details + +Synthetic continuous response dataset in Section 2.3. In Figure 1, synthetic linear regression datasets are considered. For number of observations $n$ and number of covariates $p$ , we generate a design matrix $\mathbf{X} \in \mathbb{R}^{n \times p}$ such that each + +$[X]_{i,j}\stackrel {i,i,d.}{\sim}\mathcal{N}(0,1)$ for all $1\leq i\leq n$ and $1\le j\le p$ , which is then scaled to ensure each column has a mean of 0 and a standard error of 1. We choose the true signal $\beta^{*}\in \mathbb{R}^{p}$ such that $\beta_j^* = 2\mathrm{I}\{j\leq s\}$ , where $s$ is the sparsity parameter corresponding to the number of non-zero components. Given $\mathbf{X}$ and $\beta^{*}$ , we generate $\boldsymbol {y} = \boldsymbol {X}\beta^{*} + \sigma^{*}\epsilon$ for $\epsilon \sim \mathcal{N}(0,\boldsymbol {I}_n)$ where $\sigma^{*} = 2$ is the Gaussian noise standard deviation. + +Synthetic binary response dataset in Section 3. In Figures 2 and 3, synthetic binary classification datasets are considered. For number of observations $n$ and number of covariates $p$ , we generate a design matrix $X \in \mathbb{R}^{n \times p}$ such that each $[X]_{i,j} \stackrel{i.i.d.}{\sim} \mathcal{N}(0,1)$ for all $1 \leq i \leq n$ and $1 \leq j \leq p$ , which is then scaled to ensure each column has a mean of 0 and a standard error of 1. We choose the true signal $\beta^* \in \mathbb{R}^p$ such that $\beta_j^* = 2^{\frac{9 - j}{4}} \mathrm{I}\{j \leq s\}$ , where $s$ is the sparsity parameter corresponding to the number of non-zero components. Given $X$ and $\beta^*$ , we generate $y_i = \mathrm{I}\{\tilde{y}_i > 0\}$ for $\tilde{y}_i \sim \operatorname{Logistic}(\boldsymbol{x}_i^\top \boldsymbol{\beta}^*, 1)$ for $i = 1, \dots, n$ , where $\boldsymbol{x}_i^\top$ is the $i$ -th row of $X$ and $\operatorname{Logistic}(\boldsymbol{x}_i^\top \boldsymbol{\beta}^*, 1)$ is the Logistic distribution with mean $\boldsymbol{x}_i^\top \boldsymbol{\beta}^*$ and scale parameter 1. + +Datasets in Section 4. The Malware detection dataset from the UCI machine learning repository (Dua & Graff, 2017) has $n = 373$ observations with binary responses and $p = 503$ covariates, and is publicly available on www.kaggle.com/piyushrumao/malware-executable-detection. + +The Borovecki, Chowdary, Chin and Gordon datasets are all high-dimensional microarray datasets. They are publicly available on the datamicroarray package in R. The Borovecki dataset has $n = 31$ observations with binary responses and $p = 22283$ covariates. The Chowdary dataset has $n = 104$ observations with binary responses and $p = 22283$ covariates. The Chin dataset has $n = 118$ observations with binary responses and $p = 22215$ covariates. The Gordon dataset has $n = 181$ observations with binary responses and $p = 12533$ covariates. + +The PCR GWAS dataset has $n = 60$ observations with continuous responses and $p = 22575$ covariates, and is publicly available on www.ncbi.nlm.nih.gov/geo (accession number GSE3330). The Lymph Node GWAS dataset has $n = 148$ observations with binary responses and $p = 4514$ covariates, and has been previously considered (Hans et al., 2007; Liang et al., 2013; Narisetty et al., 2019). The Maize GWAS dataset has $n = 2266$ observations with continuous responses and $p = 98385$ covariates, and has been previously considered (Romay et al., 2013; Liu et al., 2016; Zeng & Zhou, 2017). The Lymph Node GWAS and the Maize GWAS datasets are not publicly available. + +The synthetic continuous dataset has $n = 1000$ observations and $p = 50000$ covariates. The design matrix $X$ is generated such that each $[X]_{i,j} \stackrel{i.i.d.}{\sim} \mathcal{N}(0,1)$ for all $1 \leq i \leq n$ and $1 \leq j \leq p$ , which is then scaled to ensure each column has a mean of 0 and a standard error of 1. The true signal $\beta^{*} \in \mathbb{R}^{p}$ is chosen such that $\beta_{j}^{*} = 2^{\frac{9 - j}{4}} \mathrm{I}\{j \leq s\}$ , where $s$ is the sparsity parameter corresponding to the number of non-zero components. Given $X$ and $\beta^{*}$ , we generate $y = X\beta^{*} + \sigma^{*}\epsilon$ for $\epsilon \sim \mathcal{N}(0,I_n)$ , where $\sigma^{*} = 2$ is the Gaussian noise standard deviation. The synthetic binary classification dataset is generated as in Section 3, with $n = 1000$ observations and $p = 50000$ covariates. + +# E. Additional Experiments + +Variable selection performance as a function of time or number of iterations. Figure 6 plots the average true positive rate (TPR) and the false discovery rate (FDR) of variable selection based on samples from $\mathbf{S}^3$ and Skinny Gibbs as the length of the chains are varied. The TPR and FDR are averaged over 10 independent chains, and one standard error bars are shown. We consider a synthetic binary classification dataset generated using a logistic regression model as in Section 3, with $n = 200$ observations, $p = 1000$ covariates, sparsity $s = 10$ , and an exponentially decaying sparse true signal $\beta^{*} \in \mathbb{R}^{p}$ such that $\beta_{j}^{*} = 2^{\frac{9 - j}{4}}$ for $j \leq s$ and $\beta_{j}^{*} = 0$ for $j > s$ . The TPR and FDR are calculated as in Section 3 with the marginal posterior probabilities $\pi_{j} \triangleq \mathbb{P}_{\pi}(z_{j} = 1)$ now estimated by $\hat{\pi}_{j} \triangleq \frac{1}{T - 999} \sum_{t=1000}^{T} z_{j,t}$ for a burn-in of 1000, a varying chain length $T \geq 1000$ , and sample points $(z_{t})_{t \geq 0}$ generated using $\mathbf{S}^3$ or Skinny Gibbs. We use the same prior hyperparameters for all the algorithms, which are chosen according to Narisetty et al. (2019). + +Figure 6 Left and Center-Left plot the TPR and FDR against the chain length $T$ . It shows that $\mathrm{S}^3$ for both logistic and probit regression have higher TPR and lower FDR than Skinny Gibbs for all chain lengths. Furthermore, $\mathrm{S}^3$ for logistic regression has higher TPR and lower FDR than $\mathrm{S}^3$ for probit regression, which is expected as the synthetic dataset for this example is generated using a logistic regression model. The SOTA sampler is omitted from the Left and Center-Left plots as its output has the same marginal distribution and statistical performance as $\mathrm{S}^3$ . Figure 6 Center-Right and Right plot the TPR and FDR against total time elapsed in seconds to generate samples using $\mathrm{S}^3$ , SOTA, or Skinny Gibbs chains with a burn-in of 1000 + +![](images/faeb69e878544f1b3df15fc20b01d3331d87804bb85a496296b01a5a0006b01c.jpg) +Figure 6. Average rue positive rate (TPR) and false discovery rate (FDR) plotted against the number of iterations and the total time elapsed in seconds. We consider $\mathrm{S}^3$ , SOTA, and the Skinny Gibbs approximate sampler (Narisetty et al., 2019) applied to a synthetic binary classification dataset with $n = 200$ observations and $p = 1000$ covariates. The TPR and FDR are averaged over 10 independent chains, and one standard error bars are shown on the left and center-left plots and omitted on the right and center-right plots for visibility. The SOTA sampler is omitted from the Left and Center-Left plots as its output has the same marginal distribution and statistical performance as $\mathrm{S}^3$ . See Section E for details. + +![](images/3a96f6a2741659890ba6a85ff04259dd5d740c696e47d595f50382b0dd13d26d.jpg) + +iterations. The standard error bars are now omitted for better visibility. For each time budget, we observe better variable selection performance from $\mathrm{S}^3$ when compared with the slower SOTA implementation or with Skinny Gibbs. + +Effective Sample Size of $\mathrm{S}^3$ for the datasets in Section 4. Figure 7 shows the Effective Sample Size per iteration and per unit of time (in seconds) of $\mathrm{S}^3$ and the SOTA sampler for the datasets in Section 4. The ESS is calculated using the mcmcse package (Flegal et al., 2021; Vats et al., 2019) for one $\mathrm{S}^3$ chain of length 10000 iterations with a burn-in of 1000 iterations for each dataset. The average ESS of the $\beta$ components are then plotted. Figure 7 Right shows that $\mathrm{S}^3$ has significantly higher ESS per second compared to the corresponding SOTA sampler for all the datasets considered. + +Performance metrics for the datasets in Section 4. Figures 8 - 14 show various performance metrics of $\mathrm{S}^3$ for some of the datasets considered in Section 4. Figures 8 - 14 (Left) plot the marginal posterior probability estimates $\hat{\pi}_j$ against $j$ in the decreasing order of $\hat{\pi}_j\mathrm{s}$ , following the setup in Figure 4. For datasets with continuous valued responses, $\hat{\pi}_j\mathrm{s}$ are based on samples from $\mathrm{S}^3$ for linear regression. For datasets with binary valued responses, $\hat{\pi}_j\mathrm{s}$ are based on samples from $\mathrm{S}^3$ for logistic and probit regression, and the Skinny Gibbs sampler from logistic regression. We use samples from 5 independent chains of length 10000 iterations with a burn-in of 1000 iterations. Estimates based on samples from the SOTA sampler are not shown, as they implement the same Gibbs sampler as $\mathrm{S}^3$ (other than possible numerical discrepancies, as discussed in Section 4). + +Figures 8 - 14 (Center) show the average time taken per iteration with one standard error bars for $\mathrm{S}^3$ , the SOTA sampler, and the Skinny Gibbs sampler based on 5 independent chains of length 10000 iterations. + +Figures 8 - 14 (Right) show the 10-fold cross-validation average root-mean-square error (RMSE) against the total time elapsed to run one $\mathrm{S}^3$ and one SOTA chain. To compute this evaluation, we partition the observed dataset into 10 folds uniformly at random and, for each fold $k$ , run a chain conditioned on all data outside of fold $k$ and evaluate its performance on the held-out data in the $k$ -th fold. The average RMSE is calculated as $\frac{1}{10}\sum_{k=1}^{10}r_k$ , where $r_k$ is the RMSE for the $k^{th}$ fold. For datasets with continuous valued responses, the quantities $r_k$ for linear regression are calculated as $(\frac{1}{|D_k|}\sum_{i\in D_k}(y_i - \hat{y}_i)^2)^{1/2}$ where $D_k$ is the $k^{th}$ fold, $\hat{y}_i \triangleq \frac{1}{T-1000}\sum_{t=1001}^{T}x_i^T\beta_t$ are the predicted responses, and $(\beta_t)_{t\geq 0}$ are samples from $\mathrm{S}^3$ and SOTA targeting the posterior distribution of the $k^{th}$ training set. For datasets with binary valued responses, the quantities + +Dataset +![](images/02e444b18566c7d2d5605cc0f403749a19c5566a17cbce1d824b29dd63722201.jpg) +S3 Linear X S3 Logistic O S3 Probit + +Dataset +![](images/324099565a40f2cd5a7f3c7aff1b25c595f3511945f2c7dae574afdfaac44937.jpg) ++ S³ Linear O S³ Probit X SOTA Logistic + +Figure 7. Effective sample size (ESS) per iteration and per second of $S^3$ and the SOTA sampler for some of the datasets in Section 4. The ESS is calculated using one $S^3$ chain of length 10000 iterations with a burn-in of 1000 iterations. The ESS per iteration of the SOTA sampler is omitted from the Left plot as it implements the same Gibbs sampler as $S^3$ . +![](images/04dd6d5b544f639cdf91e3bbb37b7532363f356040c228e4d4e2fd3651cbac27.jpg) +S³ Logistic O S³ Probit + Skinny Gibbs Logistic + +Figure 8. Borovecki dataset with $n = 31$ observations, $p = 22283$ covariates and binary valued responses. +![](images/cab928128658b00b44402709877f2e510fdf776e805ecc153abf9dc6b5016d29.jpg) ++ Skinny Gibbs Logistic + +![](images/f942c9ded678640d593380bf8b1ef633fe6144ae4a3deab5fbcef2990ab4a55d.jpg) +X S3 Logistic SOTA Linear SOTA Probit +$\times$ S³ Logistic SOTA Logistic $\bigcirc$ S³ Probit SOTA Probit +S³ Logistic SOTA Logistic +S Probit SOTA Probit + +$r_k$ are calculated as $(\frac{1}{|D_k|}\sum_{i\in D_k}(y_i - \hat{p}_i)^2)^{1 / 2}$ , where $D_{k}$ is the $k^{th}$ fold, $\hat{p}_i\triangleq \frac{1}{T - 1000}\sum_{t = 1001}^T\mathrm{Logistic}(x_i^T\beta_t)$ and $\hat{p}_i\triangleq \frac{1}{T - 1000}\sum_{t = 1001}^T\Phi (x_i^T\beta_t)$ are the predicted probabilities for logistic and probit regression respectively, and $(\beta_{t})_{t\geq 0}$ are samples from $\mathrm{S}^3$ and SOTA targeting the posterior distribution of the $k^{th}$ training set. Figures 8 - 14 (Right) plot the average RMSE against total time elapsed in seconds to generate samples using $\mathrm{S}^3$ or SOTA chains with a burn-in of 1000 iterations. The RMSE of the Skinny Gibbs sampler is not available, as the skinnybasad package does not output the full chain trajectories required for RMSE calculations. + +Figure 9. Chin dataset with $n = 118$ observations, $p = 22215$ covariates and binary valued responses. +![](images/6ae5d5326bc01af774e351bc091e2b7fee70914d3d5920663b5f0e92bd584bd0.jpg) +X S3Logistic O S3 Probit + +![](images/33cf16bb3f14acd1156839d233115443c5ee2f2e16ab090cb3e8625a7e14941a.jpg) ++ Skinny Gibbs Logistic ++ Skinny Gibbs Logistic + +![](images/4648ea583d0cb2e2eb2c28959fc7980bb6853db3894c1ec57897fef328689a5c.jpg) +$\times$ S³ Logistic SOTA Logistic +S3 Probit SOTA Probit +S³ Logistic SOTA Logistic +S³ Probit SOTA Probit + +Figure 10. Chowdary dataset with $n = 104$ observations, $p = 22283$ covariates and binary valued responses. +![](images/144fb40171a3684c0516815200419ab8a60456ac1040b9d38b20e82d74e33278.jpg) +X S3Logistic O S3Probit ++ Skinny Gibbs Logistic + +![](images/d38b143c57bb00b697fe628fa7f6abab706a304dbe25572f9d6abb679965a141.jpg) ++ Skinny Gibbs Logistic + +![](images/5ce53ebc3ead1867d040467e5d39edb849a6adb668fd687f15466f45cdcf0b65.jpg) +$\times$ S³ Logistic $\times$ SOTA Logistic +$\mathrm{S}^3$ Probit SOTA Probit +S³ Logistic SOTA Logistic +S³ Probit - SOTA Probit + +Figure 11. Gordon dataset with $n = 181$ observations, $p = 12533$ covariates and binary valued responses. +![](images/8f132cf6fb364ec5e623088844329923355a94fddb104ca9505a38f6e6b03680.jpg) +S³ Logistic O S³ Probit Sampler ++ Skinny Gibbs Logistic + +![](images/af23af7070915e2a41cbdf06b1226ba1b2347a051aa23e941239a61b87b862e7.jpg) ++ Skinny Gibbs Logistic + +![](images/3989b3d5f8c45767096c9b4fa805be400c56ede18584742482d07acb0bc1f9ce.jpg) +X S³ Logistic SOTA Logistic +$\mathsf{S}^3$ Probit SOTA Probit +S³ Logistic SOTA Logistic +S3Probit SOTA Probit + +Figure 12. Lymph dataset with $n = 148$ observations, $p = 4514$ covariates and binary valued responses. +![](images/5d1bc5c4538a0b66e66abdefa46f288aab15c7130f5bd6255b9ae878bbd84eb1.jpg) +S³ Logistic O S³ Probit + Skinny Gibbs Logistic + +![](images/d8139e7a23b5ae946c458e70e4fe9f554e31647fd9be0f9a7a54e76c26374346.jpg) +$\times$ S³ Logistic SOTA Logistic + +![](images/408a18060fd75b776fdac7eac0d1758f8b4c71243a5c6cd22d07778dfba06d00.jpg) +$\mathrm{S}^3$ Probit SOTA Probit +S³ Logistic SOTA Logistic + +Figure 13. Malware dataset with $n = 373$ observations, $p = 503$ covariates and binary valued responses. +![](images/92947dc153fab911c5dd3233310aa5eeef3f252979da3ffb1162ed83865b1600.jpg) ++ Skinny Gibbs Logistic + +![](images/c8bdb6dffb07ed2afcd459bb8f924e97159ea1cb0a2daf98fd7a1f69ab278887.jpg) + +![](images/d1e8b4a42541706c6a97b11cac35b2504827c5824af853e5037beeae95b476ac.jpg) +S³ Probit SOTA Probit + +![](images/74a49b70ed3cc890177e1ce1c8671933c37f3a8593343d1a38226c9ed62ea549.jpg) +Figure 14. PCR dataset with $n = 60$ observations, $p = 22575$ covariates and continuous valued responses. + +![](images/0e1d36e1630be6b1844522bb4d81425d4a16eaed6e09eba6092f7ff55aef4df3.jpg) + +![](images/20e9ac1c76481bb0f636a025aeca2f50d174d19031bb8a7772683140761938f4.jpg) \ No newline at end of file diff --git a/scalablespikeandslab/images.zip b/scalablespikeandslab/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..4aea2775f2cba9fd9bc6d023071b678ad77b1187 --- /dev/null +++ b/scalablespikeandslab/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7aaeb3efb509676d7fe2fe353abbfd4c21decc3e49ae68fdfb4e07fba2093f53 +size 953715 diff --git a/scalablespikeandslab/layout.json b/scalablespikeandslab/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..c38b91679be60d241068fe1de989923465f4f627 --- /dev/null +++ b/scalablespikeandslab/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2190020d5cefdfa3b2c85c060efa0dad1c8a7b04de368b64a3402fdbd512cb9a +size 1247432 diff --git a/scalinggaussianprocessoptimizationbyevaluatingafewuniquecandidatesmultipletimes/6624daf1-f625-4f89-a23d-79db120494f7_content_list.json b/scalinggaussianprocessoptimizationbyevaluatingafewuniquecandidatesmultipletimes/6624daf1-f625-4f89-a23d-79db120494f7_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..7f17d6736ccafafe2c29fe9a50a7b8780fbc569d --- /dev/null +++ b/scalinggaussianprocessoptimizationbyevaluatingafewuniquecandidatesmultipletimes/6624daf1-f625-4f89-a23d-79db120494f7_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b882efc2dfd2f80b5c6a3605737495d60614cde080d2e680424b4b42729fa1e1 +size 133789 diff --git a/scalinggaussianprocessoptimizationbyevaluatingafewuniquecandidatesmultipletimes/6624daf1-f625-4f89-a23d-79db120494f7_model.json b/scalinggaussianprocessoptimizationbyevaluatingafewuniquecandidatesmultipletimes/6624daf1-f625-4f89-a23d-79db120494f7_model.json new file mode 100644 index 0000000000000000000000000000000000000000..fcf9f423ba6b6a1c5fd0c56eec60fb300a5b2441 --- /dev/null +++ b/scalinggaussianprocessoptimizationbyevaluatingafewuniquecandidatesmultipletimes/6624daf1-f625-4f89-a23d-79db120494f7_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9fdd16ae99064500c5282e0463b7f9f360dd3710368a21a3f59cc7ab74e8a230 +size 157370 diff --git a/scalinggaussianprocessoptimizationbyevaluatingafewuniquecandidatesmultipletimes/6624daf1-f625-4f89-a23d-79db120494f7_origin.pdf b/scalinggaussianprocessoptimizationbyevaluatingafewuniquecandidatesmultipletimes/6624daf1-f625-4f89-a23d-79db120494f7_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..8fb21acb3afc0574b1d2c54168c5e5ae31262194 --- /dev/null +++ b/scalinggaussianprocessoptimizationbyevaluatingafewuniquecandidatesmultipletimes/6624daf1-f625-4f89-a23d-79db120494f7_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a957b91d5c06174bef7fe017032d8509d127f2346ed59ed60c5feac076db1970 +size 805471 diff --git a/scalinggaussianprocessoptimizationbyevaluatingafewuniquecandidatesmultipletimes/full.md b/scalinggaussianprocessoptimizationbyevaluatingafewuniquecandidatesmultipletimes/full.md new file mode 100644 index 0000000000000000000000000000000000000000..4ee3c6c87a205d47257b42ce10cf88d8483b40cf --- /dev/null +++ b/scalinggaussianprocessoptimizationbyevaluatingafewuniquecandidatesmultipletimes/full.md @@ -0,0 +1,562 @@ +# Scaling Gaussian Process Optimization by Evaluating a Few Unique Candidates Multiple Times + +Daniele Calandriello1 Luigi Carratino2 Alessandro Lazaric3 Michal Valko1 Lorenzo Rosasco2,4,5 + +# Abstract + +Computing a Gaussian process (GP) posterior has a computational cost cubical in the number of historical points. A reformulation of the same GP posterior highlights that this complexity mainly depends on how many unique historical points are considered. This can have important implications in active learning settings, where the set of historical points is constructed sequentially by the learner. We show that sequential black-box optimization based on GPs (GP-Opt) can be made efficient by sticking to a candidate solution for multiple evaluation steps and switch only when necessary. Limiting the number of switches also limits the number of unique points in the history of the GP. Thus, the efficient GP reformulation can be used to exactly and cheaply compute the posteriors required to run the GP-Opt algorithms. This approach is especially useful in real-world applications of GP-Opt with high switch costs (e.g. switching chemicals in wet labs, data/model loading in hyperparameter optimization). As examples of this meta-approach, we modify two well-established GP-Opt algorithms, GP-UCB and GP-EI, to switch candidates as infrequently as possible adapting rules from batched GP-Opt. These versions preserve all the theoretical no-regret guarantees while improving practical aspects of the algorithms such as runtime, memory complexity, and the ability of batching candidates and evaluating them in parallel. + +$^{1}$ DeepMind $^{2}$ MaLGa, DIBRIS, University of Genova, Italy $^{3}$ Meta AI $^{4}$ Massachusetts Institute of Technology $^{5}$ Istituto Italiano di Tecnologia. Correspondence to: Daniele Calandriello . + +Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s). + +# 1. Introduction + +Bayesian and bandit optimization (Mockus, 1989; Lattimore & Szepesvári, 2020) are two well established frameworks for black-box function optimization under uncertainty. They model the optimization process as a sequential learning problem. For an unknown function $f$ and a decision set $\mathcal{A}$ (e.g., $\mathcal{A} \subseteq \mathbb{R}^d$ ) at each step $t$ the learner: + +(1) selects candidate $\mathbf{x}_t\in \mathcal{A}$ by maximizing an acquisition function $u_{t}$ as a surrogate of $f$ +(2) receives a noisy feedback $y_{t} \stackrel{\mathrm{def}}{=} f(\mathbf{x}_{t}) + \eta_{t}$ from the environment, where $\eta_{t} \stackrel{\mathrm{i.i.d.}}{\sim} \mathcal{N}(0, \xi^{2})$ ; +(3) uses $y_{t}$ to improve $u_{t}$ 's approximation of $f$ . + +A common approach to measure the learner's convergence is to study the cumulative regret $R_{T} \stackrel{\mathrm{def}}{=} \sum_{t=1}^{T} f^{\star} - f(\mathbf{x}_{t})$ of the learner's choice of candidates compared to the optimum of the function $f^{\star} = \max_{\mathbf{x}} f(\mathbf{x})$ . A learner is deemed no-regret when it converges on average (i.e., $\lim_{T \to \infty} R_{T} / T \to 0$ ). Thanks to their flexibility and capability of modeling uncertainty, Gaussian processes (GP) (Rasmussen & Williams, 2006) have emerged as an effective choice for regret minimization, jump-starting the field of GP optimization (GP-Opt). Decision rules that leverage GPs to estimate upper confidence bounds (GP-UCB (Srinivas et al., 2010; Chowdhury & Gopalan, 2017)) or expected improvement (GP-EI (Wang & de Freitas, 2014)) provably achieve a regret² $\tilde{\mathcal{O}}(\gamma_{T}\sqrt{T})$ over $T$ steps. Here, $\gamma_{T}$ is the so-called maximum information gain associated with $\mathcal{A}$ and the GP. It captures in a data-adaptive way the implicit number of parameters of the non-parametric GP model, quantifying the effective complexity of the optimization problem. Under appropriate assumptions $\gamma_{T}$ grows slowly in $T$ making GP based methods no-regret (Srinivas et al., 2010; Scarlett et al., 2017). However, as most non-parametric approaches, GP-Opt algorithms face scalability issues when $T$ grows large, severely limiting their applicability to large scale settings. For example, in some hyper-parameter optimization problems the solutions can still improve even after tens of thousands of candidate evaluations (e.g. the NAS-bench search (Ying et al., 2019) evaluated 5 million candidates). + +Even more, for recommender systems that continuously adapt to the users' behaviour, the horizon $T$ is unbounded and the optimization process never ends (e.g. (Saito et al., 2021; Li et al., 2010) record tens of millions of interactions with users). Many approaches have been proposed to extend GP-Opt algorithms to these settings. + +# 1.1. Approaches to scalable no-regret GP optimization + +GP's most commonly considered limitation is the computational bottleneck, which stems from the high cost of quantifying uncertainty using exact inference on the GP model. In particular, in the traditional i.i.d. learning setting the complexity of computing a GP posterior over $n$ training points is usually quantified as $\widetilde{\mathcal{O}}(n^3)$ time and $\widetilde{\mathcal{O}}(n^2)$ space (Rasmussen & Williams, 2006), which makes training GPs on large dataset unfeasible in general. A similar complexity analysis in the GP-Opt settings replaces $n$ with the $T$ candidates chosen by the algorithm, giving us a baseline complexity of $\widetilde{\mathcal{O}}(T^3)$ time and $\widetilde{\mathcal{O}}(T^2)$ space complexity. Two main approaches have emerged to reduce this complexity. The most common can provably preserve no-regret guarantees, and is based on approximating the GP model, using either inducing points (Quinonero-Candela et al., 2007; Calandriello et al., 2019) or quadrature Fourier features (Mutny & Krause, 2018). Another approach is to use approximate posterior inference, e.g., using iterative solvers (Gardner et al., 2018), but without no-regret guarantees. + +Beyond computations, vanilla GP-Opt algorithms suffer from a sequential experimentation bottleneck, which stems from having to wait for feedback at every step of the sequential interaction protocol. Whenever each function evaluation is time consuming this bottleneck can actually dominate the computational one, and even computationally efficient GP-Opt algorithms cannot scale as they spend most of their time waiting for feedback. However, even in this slow evaluation setting scalability can be achieved by selecting batches of candidates at the same time and evaluating them in parallel. Experimental parallelism greatly reduces total evaluation time, and millions of evaluations are possible resulting in much better final performance (Ying et al., 2019). The key trade-off is between batch sizes and regret, with larger batches increasing the potential for parallelism but also increase feedback delay and regret. Several approaches have been proposed over the year to manage this trade-off (Desautels et al., 2014; Kathuria et al., 2016; Daxberger & Low, 2017). + +Overall, to match existing state of the art GP-Opt algorithms in guarantees for regret, computational cost and batching capability, an algorithm should achieve $\widetilde{\mathcal{O}} (\gamma_T\sqrt{T})$ regret with a $\widetilde{\mathcal{O}} (T\gamma_T^3)$ time and $\widetilde{\mathcal{O}} (T\gamma_T + \gamma_T^2)$ space complexity, and only $\widetilde{\mathcal{O}} (\gamma_T)$ rounds of interactions (i.e., batches). + +# 1.2. Contributions + +In this paper we propose a meta-algorithm, MINI-META, that we use to generate scalable versions of many popular GP-Opt algorithm. Applying MINI-META to GP-UCB and GP-EI we obtain two new MINI-variants, MINI-GP-UCB and MINI-GP-EI, that achieve performance comparable to existing state-of-the-art scalable GP-Opt algorithms, but rely on very different underlying principles to achieve scalability. + +There are two main building blocks in MINI-META. The first is a reformulation of the posterior of a GP that highlights that scalability in a GP does not depend on the number of points in the GP, but rather on the number of unique (i.e., different from all others) points. Indicating with $q_{t}$ the number of unique points up to time $t$ , the time complexity of computing a GP can then be reduced from $\widetilde{\mathcal{O}}(T^3)$ to $\widetilde{\mathcal{O}}(q_T^3)$ . This is an elementary property of GPs, but its applicability greatly depends on the underlying task. It has little impact and is not used in i.i.d. learning settings where duplicates in the training data are exceedingly rare. It can bring more benefits in settings were multiple evaluations of the same candidate are naturally part of the solution, and it has been leveraged when possible in stochastic optimization (Picheny et al., 2013) and active learning (Binois et al., 2019). In this paper we show that this approach can be taken a step further in GP-Opt tasks. In particular, the second building block of MINI-META is a meta-strategy that given a GP-Opt algorithm as input, modifies the candidate selection strategy of the input learner to explicitly minimize $q_{t}$ to improve performance while preserving the same regret rate guarantees as the original candidate selection strategy. + +Out of the many meta-strategies that one can consider, a simple yet effective approach that we advocate is to limit the number of times the candidate selection strategy is allowed to switch candidates, since the number of candidate switches clearly bounds $q_{t}$ . This can be done transparently for many input learners by using the selection strategy, and then sticking to the same candidate for multiple steps before invoking the selection strategy again. Furthermore, the rule we derive to decide when to switch candidate does not depend on the function feedback. Therefore the algorithm can first select a candidate, then choose how many steps it should stick to it, and finally evaluate the candidate multiple times in parallel. In other words, our meta-approach can not only retro-fit existing GP-Opt algorithms to be computationally scalable, but also experimentally scalable thanks to batching. + +Theoretically, we study the impact of this generic modification both under the lenses of model freezing in the linear bandits (Abbasi-Yadkori et al., 2011) and delayed feedback in batch GP-Opt (Desautels et al., 2014; Calandriello et al., 2020). Using these tools we derive strong guarantees for two new variants of GP-UCB and GP-EI that balance between minimizing unique actions and achieving low regret, + +hence dubbed minimize-unique-GP-UCB (MINI-GP-UCB) and minimize-unique-GP-EI (MINI-GP-EI). Thanks to a careful balancing of the trade-off, both algorithms match the $\widetilde{\mathcal{O}} (\gamma_T\sqrt{T})$ regret of their traditional counterparts, while evaluating a number of unique candidates $q_{t}\leq \widetilde{\mathcal{O}} (\gamma_{t})$ that scales only with the maximum information gain. Moreover, these algorithms are extremely scalable, requiring only $\widetilde{\mathcal{O}} (T + Aq_T^3)\leq \widetilde{\mathcal{O}} (T + A\gamma_T^3)$ time, where $A$ is the time required to optimize $q_{t}$ , $\widetilde{\mathcal{O}} (T\gamma_T + \gamma_T^2)$ space, and $\widetilde{\mathcal{O}} (\gamma_T)$ rounds of interaction. + +Our approach also highlights an even less studied family of scalability bottlenecks for GPs, the candidate switch bottlenecks. Similar to the sequential experimentation bottleneck, this is an experimental bottleneck that stems from the fact that in some cases, changing the candidate being evaluated can be time or cost expensive (e.g., even if testing a chemical might be fast, re-calibrating instruments for different chemicals might be expensive). + +Finally, our approach is unique in the scalable GP literature in the sense that it completely side-steps the necessity of approximating inference or the GP model; avoiding the need of inducing points, randomized sketching, or iterative solvers. Instead, algorithms based on MINI-META can use exact inference on an exact GP model thanks to the efficient posterior reformulation and the different optimization path chosen to minimize unique candidates. This greatly simplifies the algorithm, making it more broadly applicable. + +# 2. Preliminaries + +Notation. We denote with $[t] = \{1, \dots, t\}$ the set of integers up to $t$ . At step $t$ , the matrix $\mathbf{X}_t \stackrel{\mathrm{def}}{=} [\mathbf{x}_1, \dots, \mathbf{x}_t]^{\top} \in \mathbb{R}^{t \times d}$ contains all the candidates selected so far, and $\mathbf{y}_t \stackrel{\mathrm{def}}{=} [y_1, \dots, y_t]^{\top}$ their corresponding feedbacks. We define a batch as a sequence of steps between $t \leq t'$ such that the learner must select all candidates $\mathbf{x}_t, \dots, \mathbf{x}_{t'}$ before observing the corresponding feedback $y_t, \dots, y_{t'}$ . To connect steps and batches we adopt a standard notation (Desautels et al., 2014; Calandriello et al., 2020) where $\mathsf{fb}(t)$ indicates the last step of the previous batch, i.e., at step $t$ the learner has access only to feedback $\mathbf{y}_{\mathsf{fb}(t)}$ up to step $\mathsf{fb}(t)$ . + +Gaussian processes. GPs (Rasmussen & Williams, 2006) are usually described using a mean function $\mu$ , which we assume to be zero, and a (bounded) covariance or kernel function $k: \mathcal{A} \times \mathcal{A} \to [0, \kappa^2]$ . Based on the prior $\mu$ and $k$ , the posterior of the GP conditioned on some data $\mathbf{X}_t, \mathbf{y}_t$ is traditionally formulated as + +$$ +\begin{array}{l} \mu_ {t} (\mathbf {x} _ {i}) = \mathrm {k} (\mathbf {x} _ {i}, \mathbf {X} _ {t}) (\mathbf {K} _ {t} + \lambda \mathbf {I}) ^ {- 1} \mathbf {K} _ {t} \mathbf {y} _ {t}, \\ \sigma_ {t} ^ {2} \left(\mathbf {x} _ {i}\right) = \mathrm {k} \left(\mathbf {x} _ {i}, \mathbf {x} _ {i}\right) - \mathrm {k} \left(\mathbf {x} _ {i}, \mathbf {X} _ {t}\right) \left(\mathbf {K} _ {t} + \lambda \mathbf {I}\right) ^ {- 1} \mathrm {k} \left(\mathbf {X} _ {t}, \mathbf {x} _ {i}\right), \tag {1} \\ \end{array} +$$ + +# Algorithm 1 Optimistic GP optimization + +Require: Set of candidates $\mathcal{A}$ , acq. func. $u_0$ + +1: Initialize $t = 0$ +2: for $t = \{1, \dots, T\}$ do +3: Select $\mathbf{x}_{t + 1} = \arg \max_{\mathbf{x}\in \mathcal{A}}u_t(\mathbf{x})$ +4: Get feedback $y_{t+1}$ +5: Update $\mu_t, \sigma_t, \beta_t$ and $u_t$ +6: end for + +where we shortened $\mathbf{K}_t = \mathrm{k}(\mathbf{X}_t, \mathbf{X}_t)$ , and use only the subscript $t$ to indicate that $\mu_t$ and $\sigma_t$ are conditioned on all data up to time $t$ . Note also that $\mu_t$ and $\sigma_t$ are only proper Bayesian GP posterior when $\lambda = \xi^2$ , but we leave here $\lambda$ as a free parameter as it will be useful in frequentist regret analysis. Given prior and posterior of the GP, we can also define the information gain between them as + +$$ +\gamma (\mathbf {X}, \mathbf {y}) \stackrel {\text {d e f}} {=} \frac {1}{2} \log \det (\mathbf {I} + \xi^ {- 2} \mathrm {k} (\mathbf {X}, \mathbf {X})). +$$ + +Based on $\gamma (\mathbf{X},\mathbf{y})$ we can also define the maximum information gain $\gamma_{t}\stackrel {\mathrm{def}}{=}\max_{\mathbf{X}:|\mathbf{X}| = t}\gamma (\mathbf{X},\mathbf{y})$ at step $t$ as a worst-case bound on the complexity of the optimization process. Large amounts of research have been dedicated to characterizing how $\gamma_T$ behaves under different assumptions on $\mathcal{A}$ and k (Srinivas et al., 2010; Scarlett et al., 2017). This includes sufficient conditions for $\gamma_T$ to be sublinear, both with polynomial and logarithmic rates in $T$ . We leave the reader to recent surveys (Vakili et al., 2021) for more results, and treat here $\gamma_T$ as a desirable data-adaptive measure of the intrinsic complexity of the problem. + +Optimistic Gaussian process optimization. Given a GP posterior, we can construct an acquisition function $u_{t}(\cdot): \mathcal{A} \to \mathbb{R}$ to guide us in the candidate selection. We focus specifically on acquisition functions based on upper confidence bounds (GP-UCB (Srinivas et al., 2010)) and expected improvement (GP-EI (Mockus, 1989)) + +$$ +\begin{array}{l} u _ {t} ^ {\mathrm {G P - U C B}} (\mathbf {x}) = \mu_ {t} (\mathbf {x}) + \beta_ {t} ^ {\mathrm {G P - U C B}} \sigma_ {t} (\mathbf {x}), (2) \\ u _ {t} ^ {\mathrm {G P - E I}} (\mathbf {x}) = \left(\beta_ {t} ^ {\mathrm {G P - E I}} \sigma_ {t} (\mathbf {x}) \right. (3) \\ \cdot \left[ \left(\frac {z}{\beta_ {t} ^ {\mathrm {G P - E I}}}\right) \mathrm {C D F} _ {\mathcal {N}} \left(\frac {z}{\beta_ {t} ^ {\mathrm {G P - E I}}}\right) + \mathrm {P D F} _ {\mathcal {N}} \left(\frac {z}{\beta_ {t} ^ {\mathrm {G P - E I}}}\right) \right], \\ \end{array} +$$ + +where $z = \frac{\mu_t(\mathbf{x}) - \max_{\mathbf{x}'}\mu_t(\mathbf{x}')}{\sigma_t(\mathbf{x})}$ , $\mathrm{CDF}_{\mathcal{N}}(\cdot)$ and $\mathrm{PDF}_{\mathcal{N}}(\cdot)$ are the cumulative and probability density functions of a standard Gaussian, and $\beta_{t}\in \mathbb{R}_{+}$ must be appropriately chosen. + +Given an acquisition function $u_{t}$ , a standard way to obtain a GP-Opt algorithm based on it is to apply the meta-algorithm reported in Algorithm 1. In particular, the acquisition function is used by the meta-algorithm to choose candidates optimistically/greedily w.r.t. $u_{t}$ . Applying Algorithm 1 to the GP-UCB and GP-EI acquisition function we obtain exactly the GP-UCB and GP-EI algorithms (Wang & de Freitas, 2014; Chowdhury & Gopalan, 2017), which are guaranteed + +# Algorithm 2 Meta-algorithm to minimize unique candidates (MINI-META) + +Require: Set of candidates $\mathcal{A}$ , acq. func. $u_0$ , threshold $C$ + +1: Initialize $t = 0$ +2: for $h = \{1, \ldots\}$ do +3: Select $\mathbf{x}_{t + 1} = \arg \max_{\mathbf{x}\in \mathcal{A}}u_t(\mathbf{x})$ +4: Evaluate $\mathbf{x}_{t + 1}$ for $B_{h} = \left\lfloor (C^{2} - 1) / \sigma_{t}^{2}(\mathbf{x}_{t + 1})\right\rfloor$ times (i.e., $\mathbf{x}_s = \mathbf{x}_{t + 1}$ for all $s\in [t + 1,t + B_h])$ +5: Get feedback $\{y_s\}_{s = t + 1}^{t + B_h}$ +6: Set $t = t + B_h$ , update posteriors $\mu_t, \sigma_t$ and acquisition function $u_t$ +7: end for + +to achieve low regret. Unfortunately, optimizing $u_{t}$ or even evaluating it is computationally inefficient, as it involves evaluating $\sigma_t(\mathbf{x})$ which requires at least $\mathcal{O}(t^2)$ time due to the multiplication $(\mathbf{K}_t + \lambda \mathbf{I})^{-1}\mathrm{k}(\mathbf{X}_t,\mathbf{x}_j)$ . Moreover, the sequential nature of the optimization protocol precludes the possibility of running experiments in parallel, which is also necessary to achieve true scalability. We propose now a new approach to address both bottlenecks. + +# 3. Efficient GP Optimization With Few Unique Candidates + +Our approach to achieve scalability will be composed by two main ingredients. The first ingredient is a reformulation of the GP posterior that can be efficiently computed when the GP is supported on a small number $q_{t}$ of unique candidates (i.e., the history $\mathbf{X}_t$ contains $t$ rows with repetitions, of which only $q_{t}$ are unique). To leverage this first ingredient we then need a second ingredient, a generic approach to guarantee that $q_{t}$ stays small. This takes the form of a modification of the usual GP-Opt loop of Algorithm 1 to reduce the number of candidate switches, which acts as an upper bound on $q_{t}$ . Since our switching rule is agnostic to $u_{t}$ , our approach remains a flexible meta-algorithm that can be applied to different acquisition functions to obtain different efficient GP-Opt algorithms. As an added bonus, we also show how these choices allow to seamlessly incorporate candidate batching in the resulting algorithm, which improves experimental scalability. + +# 3.1. A meta-algorithm to select few unique candidates + +To control the number of candidate switches we generalize and improve the rarely switching OFUL (RS-OFUL) algorithm (Abbasi-Yadkori et al., 2011). In particular, we extend RS-OFUL from euclidean to Hilbert spaces, modify it to operate with acquisition functions different than the GP-UCB one, and replace RS-OFUL's switching rule with an improved criteria recently proposed for batched GP + +optimization (Calandriello et al., 2020). Our final meta-algorithm MINI-META is reported in Algorithm 2. + +We refer to it as a meta-algorithm because it can generate different GP-Opt algorithms using different acquisition functions $u_{0}(\cdot)$ as input. As an example, if we use $u_{t}^{\mathrm{GP - UCB}}(\cdot)$ (Equation 2) we obtain an algorithm similar to GP-UCB that we call minimize-unique-GP-UCB or MINI-GP-UCB for short. Similarly, we can use Algorithm 2 to convert GP-EI into MINI-GP-EI. Moreover, all of the algorithms generated by MINI-META can compute posteriors efficiently using a reformulation of $\mu_t$ and $\sigma_t$ introduced later in Equation 4 rather than the standard formulation of Equation 1. + +The meta-algorithm operates in epochs/batches indexed by $h$ , where each epoch is delimited by a candidate switch. Inside each epoch, the meta-algorithm selects the next candidate $\mathbf{x}_{t+1}$ to be evaluated by maximizing the acquisition function $u_t$ , and we discuss more in detail later how easy or hard this inner optimization problem can be based on properties of $u_t$ and $\mathcal{A}$ . Then, after selecting the epoch's candidate the meta-algorithm must choose the length of the epoch. Since we do not switch candidate until the end of the epoch, this amounts to selecting how many times the candidate $\mathbf{x}_{t+1}$ will be repeatedly evaluated. The main trade-off here is between long epochs that improve scalability and short epochs that make it easier to switch often and explore/exploit efficiently. Specializing an approach used in the BBKB algorithm (Calandriello et al., 2020) to our setting, we propose to select $B_h = \lfloor (C^2 - 1) / \sigma_t(\mathbf{x}_{t+1}) \rfloor$ , which as we prove achieves both goals. Finally, at the end of the epoch we collect the feedback, and use it to update the GP posterior and the chosen acquisition function. The loop is then repeated forever or until a desired number of epochs/steps is reached. + +We also highlight that not all epoch-based GP-Opt algorithms are also batched GP-Opt algorithms. In particular, in batched GP algorithms candidates in a batch can be evaluated in parallel before feedback of previous candidates is available. Since there is no dependency on the feedback neither in our candidate selection (it is always the same candidate) nor in the epoch termination rule, our meta-algorithm can transform a sequential GP optimization algorithm to a batch variant, e.g., MINI-GP-EI is a batch algorithm even though GP-EI is not. + +# 3.2. GPs supported on few unique candidates. + +We can now show that if $h$ is small, all the relevant quantities from Algorithm 2 can be computed efficiently. In particular, after running Algorithm 2 for $h$ epochs let $\mathbf{X}_h$ indicate the $h \times d$ matrix containing the $h$ candidates selected so far. To simplify exposition, we will assume all $h$ candidates are distinct, and comment in the appendix how removing this assumption just involves slightly harder book-keeping + +to merge feedbacks coming from two identical candidates selected in different epochs. + +Given $\mathbf{X}_h$ , let $\mathbf{W}_h \in \mathbb{R}^{h \times h}$ be a diagonal matrix; where $[\mathbf{W}_h]_{i,i} = B_i$ contains the number of times the candidate of the $i$ -th epoch is contained in $\mathbf{X}_t$ (i.e., number of times it is selected), and let $t_i$ denote the starting time-step of the $i$ -th epoch. Then, we have + +$$ +\begin{array}{l} \mu_ {t _ {h}} (\mathbf {x}) = \mathrm {k} (\mathbf {x}, \mathbf {X} _ {h}) \left(\mathbf {K} _ {h} + \lambda \mathbf {W} _ {h} ^ {- 1}\right) ^ {- 1} \mathbf {y} _ {h}, \\ \sigma_ {t _ {h}} ^ {2} (\mathbf {x}) = \mathrm {k} (\mathbf {x}, \mathbf {x}) - \mathrm {k} (\mathbf {x}, \mathbf {X} _ {h}) \left(\mathbf {K} _ {h} + \lambda \mathbf {W} _ {h} ^ {- 1}\right) ^ {- 1} \mathrm {k} \left(\mathbf {X} _ {h}, \mathbf {x}\right) \tag {4} \\ \end{array} +$$ + +where $\mathbf{K}_h = \mathrm{k}(\mathbf{X}_h,\mathbf{X}_h)\in \mathbb{R}^{h\times h}$ , and $\mathbf{y}_h\in \mathbb{R}^h$ is such that $[\mathbf{y}_h]_i = \sum_{s = t_i}^{t_i + B_i}y_s$ . Using the feature-space view of GPs, it is straightforward to prove using basic linear algebra identities that the posterior Equation 4 is equal to Equation 1, i.e., that these are not approximations to the posterior but reformulations of the posterior (see Appendix A). However, when $h\ll t$ , Eq. 4 can be computed efficiently in $\mathcal{O}(h^3)$ since it only involves the inversion of an $h\times h$ matrix $\mathbf{K}_h$ . + +The reformulations of Equation 4 are not completely new, e.g., Picheny et al. (2013) presented similar reformulations based on averaged feedbacks. At a higher level, they can be seen as a special case of the more generic framework of reformulating GPs posteriors as distribution conditioned on a set of inducing points, also known as sparse GP approximation (Quinonero-Candela et al., 2007). Traditionally, this framework has been designed to identify a small number of inducing variables that could act as a bottleneck for the GP model, reducing its number of parameters and accuracy, but also the computational cost of inference. However, unlike previous approaches we propose to utilize the whole optimization history as inducing variables, removing this bottleneck. Therefore we are not approximating a full GP with a factorized GP, or a dense GP with a sparse GP, but simply exploiting the intrinsic sparseness and low number of implicit parameters that arise when GPs are defined on few unique candidates. Note that enforcing a candidate selection strategy that keeps $q_{t}$ under control is crucial in creating a gap between Equation 1 and Equation 4. This explains why historically this reformulation has not seen success in fields such as the standard supervised GP regression setting, where the selection process is not under the control of the learner. In particular, when $\mathbf{X}_t$ is sampled i.i.d. from some distribution the rows are all different w.p. 1, and our method offers no scalability improvement. Looking instead at the history of GP optimization methods, this reformulation has been largely ignored because most approaches try to evaluate a very diverse sets of candidates to improve initial exploration. This increases the number of unique historical candidates, and makes the impact of the reformulation negligible or even detrimental since it prevents other kinds of efficient incremental updates. + +# 4. Regret and computational meta-analysis + +Rather than designing a specialized analysis for every MINIvariant, we propose instead a meta-analysis that cover a generic $u_{t}$ acquisition function, and then will instantiate this analysis at the end of the section with $u_{t}^{\mathrm{GP-UCB}}$ and $u_{t}^{\mathrm{GP-EI}}$ . + +While the computational meta-analysis holds for any $u_{t}$ , the regret meta-analysis requires $u_{t}$ to satisfy a simple condition. Given feedback up to step $t - 1$ , candidates selected optimistically using the acquisition function $u_{t}$ at step $t$ must satisfy w.h.p. this bound on the instantaneous regret $r_{t}$ + +$$ +r _ {t} \stackrel {\mathrm {d e f}} {=} f ^ {\star} - f (\mathbf {x} _ {t}) \leq G _ {t} \sigma_ {t - 1} (\mathbf {x} _ {t}), \tag {5} +$$ + +for some non-decreasing sequence $G_{t}$ . This condition is satisfied for example by GP-UCB (Srinivas et al., 2010; Abbasi-Yadkori et al., 2011; Chowdhury & Gopalan, 2017) and GP-EI (Wang & de Freitas, 2014). Based on this condition, our paper's main result is the following meta-theorem. + +Theorem 4.1. For any $1 < C$ , set $\mathcal{A}$ and acquisition function $u_{0}$ , Algorithm 2 runs in $\widetilde{\mathcal{O}}(T + \gamma_{T} \cdot (A + \gamma_{T}^{3}))$ time, $\widetilde{\mathcal{O}}(T\gamma_{T})$ space, and $\widetilde{\mathcal{O}}(\gamma_{T})$ epochs/batches, where $A$ indicates the complexity of solving the inner optimization problem (i.e., $\arg \max_{\mathbf{x} \in \mathcal{A}} u_{t}(\mathbf{x})$ ). + +Moreover, if $u_{t}$ satisfies w.p. $1 - \delta$ the condition of Equation 5, then for all steps $t$ the instantaneous regret $r_{t}^{\mathrm{MINI-META}}$ of the candidates selected by Algorithm 1 satisfies $r_{t}^{\mathrm{MINI-META}} \leq CG_{t}\sigma_{t-1}(\mathbf{x}_{t})$ for the same sequence of $G_{t}$ and with the same probability. + +Focusing on regret, Theorem 4.1 shows that restricting the number of candidate switches does not greatly impact regret, just as in (Abbasi-Yadkori et al., 2011). Moreover MINI-META's improved switching rule reduces the regret amplification factor from $\mathcal{O}(2^C)$ of RS-OFUL to $\mathcal{O}(C)$ . Additionally, our result also highlights for the first time that approximating the GP model is not necessary to achieve scalability and no-regret, and simply using a different candidate selection strategy brings great computational savings. Moreover, compared to existing methods based on efficient reformulations of GPs (Picheny et al., 2013; Binois et al., 2019) we explicitly target minimizing unique candidates as a goal of our algorithm, and can rigorously quantify the computational improvement that we are guaranteed to achieve compared to a vanilla GP inference approach. + +On the computational side, we bound the number of switches and therefore of unique candidates using the information gain $\widetilde{O} (\gamma_T)$ . This, allows us to bound both the number of batches and the cost of evaluating the GP posterior, but unfortunately without knowing how expensive it is to optimize the acquisition function it is not possible to fully characterize the runtime. We postpone this to a later discussion. Nonetheless, an important aspect that can be already + +included in the meta-theorem is that this maximization only needs to be performed once per batch. Previous approaches tried to promote diverse batches, and therefore this optimization had to be repeatedly performed with a runtime of at least $\widetilde{\mathcal{O}}(TA)$ , while for the first time we achieve a runtime $\widetilde{\mathcal{O}}(T + A)$ linear in $T$ . However, this crucially relies on being able to repeatedly evaluate the same candidate, which is not possible in all optimization settings. + +# 4.1. Regret meta-analysis details + +Starting from the condition in Equation 5, the meta-analysis is based on well-established tools. First we have to deal with the fact that Algorithm 1 only updates the posterior and receives feedback at the end of the batches. In particular, this means that Equation 5 only applies for the first evaluation of the candidate, and not across the batch. Tools developed in the original RS-OFUL analysis (Abbasi-Yadkori et al., 2011) and refined in the context of batch GP optimization (Calandriello et al., 2020) can be used to control this. + +Lemma 4.2. Let $u_{t}$ be an acquisition function that satisfies Equation 5 at the beginning of each batch. Then running Algorithm 2 with parameter $C$ and the same $u_{t}$ guarantees that $r_{t} \leq CG_{t}\sigma_{t - 1}(\mathbf{x}_{t})$ w.p. $1 - \delta$ for all steps $t$ (i.e., not only at the beginning of each batch). + +Sketch of proof. Let $t$ be the first step of epoch/batch $h$ (i.e., we received feedback up to $t - 1$ ). Then + +$$ +\begin{array}{l} r _ {t ^ {\prime}} \leq G _ {t - 1} \sigma_ {t - 1} \left(\mathbf {x} _ {t ^ {\prime}}\right) = G _ {t - 1} \frac {\sigma_ {t - 1} \left(\mathbf {x} _ {t ^ {\prime}}\right)}{\sigma_ {t ^ {\prime} - 1} \left(\mathbf {x} _ {t ^ {\prime}}\right)} \cdot \sigma_ {t ^ {\prime} - 1} \left(\mathbf {x} _ {t ^ {\prime}}\right) \\ \leq G _ {t - 1} C \cdot \sigma_ {t ^ {\prime} - 1} (\mathbf {x} _ {t ^ {\prime}}), \\ \end{array} +$$ + +where the first inequality comes from applying Equation 5 to step $t'$ since $\mathbf{x}_t = \mathbf{x}_{t'}$ (all candidates in the batch are the same), and the second inequality comes from the fact that the length of each batch $B_h$ is designed to guarantee that for any $t' > t$ inside the batch we can bound the ratio $\sigma_{t-1}(\mathbf{x}) / \sigma_{t'-1}(\mathbf{x}) \leq \mathcal{O}(C)$ (details in the appendix). Therefore, simply by losing a constant factor $C$ we can recover the regret $r_{t'}$ as if we applied Equation 5 with all the feedback up to step $t' - 1$ . + +Established the $G_{t}C\sigma_{t - 1}(\mathbf{x}_{t})$ bound, the rest of each regret proofs slightly diverge depending on the acquisition function, differing mostly on the specific sequence of $G_{t}$ , and we discuss in Section 4.3 where we also discuss how the final regret of each of the alternatives scales. For now, we would like to highlight that the $1 - \delta$ success probability of Lemma 4.2, and therefore the probability of low regret, depends only on the randomness of the candidate selection, i.e., the same randomness present in the original variants. This is in stark contrast with existing results for scalable GP optimization where to provide guarantees on the regret the GP was approximated using technique relying on some + +form of additional randomness (e.g., random projections). In other words, our $\mu$ -variants are much more deterministic compared to other scalable methods. + +# 4.2. Computational meta-analysis. + +Similarly to regret, we provide here a meta-analysis for a generic $u_{t}$ , parametrizing the analysis in terms of a generic $A$ computational cost of optimizing $u_{t}$ (i.e., computing $\arg \max_{\mathbf{x} \in \mathcal{A}} u_{t}(\mathbf{x}))$ ). With this notation, the computational complexity of MINI-META is $\mathcal{O}(T + h \cdot A + h \cdot h^3)$ . The $\mathcal{O}(T)$ term covers the time necessary to store/load the $T$ feedbacks. The $hA$ term comes from the $h$ optimizations of $u_{t}$ , once for each loop. Finally the $\mathcal{O}(h \cdot h^3)$ term is due to the computation of the length $B_{h}$ of each batch, which requires at each loop to computing the posterior $\sigma_{t}$ using the $\mathcal{O}(h^3)$ efficient reformulation. We can refine this analysis along two axes: bounding $h$ , and bounding $A$ . + +Bounding the number of switches $h$ is fully part of the meta-analysis, since our bound on the number of epochs does not directly depend on the specific acquisition function $u_{t}$ . + +Lemma 4.3. After $T$ steps, MINI-META performs at most $h \leq \mathcal{O}\left(\frac{C^2}{C^2 - 1}\gamma_T\right)$ switches. + +Notice that once again this is a deterministic statement, since unlike existing methods our approach does not depend on randomized methods to increase scalability. Combining this result in the meta-analysis we obtain an overall runtime of $\mathcal{O}(T + \gamma_T \cdot (A + \gamma_T^3))$ . + +Bounding the optimization cost $A$ can only be done by making assumptions on $u_{t}$ and $\mathcal{A}$ , since in general maximizing the acquisition function is a non-convex optimization problem, often NP-hard. In the simpler case where $\mathcal{A}$ is finite with cardinality $|\mathcal{A}|$ , and $u_{t}$ is based only on $\mu_{t}$ and $\sigma_{t}$ of each candidate, then the runtime becomes $\mathcal{O}(T + h \cdot (|\mathcal{A}|h^{2} + h^{3})$ . Further combining this with Lemma 4.3 we obtain an overall runtime of $\mathcal{O}(T + |\mathcal{A}|\gamma_T^3 + \gamma_T^4)$ . We can compare this result with the $\widetilde{\mathcal{O}}(T|\mathcal{A}|\gamma_T^2)$ runtime complexity of the currently fastest no-regret algorithm, BBKB (Calandriello et al., 2020) to see that the potential runtime improvement is large (i.e., from $\mathcal{O}(T|\mathcal{A}|)$ to $\mathcal{O}(T + |\mathcal{A}|h)$ ). This is because MINI-META only needs to maximize $u_{t}$ once per batch, while existing batched algorithms need multiple maximization per batch to promote in-batch diversity, using different strategies such as feedback hallucination (Desautels et al., 2014). Even if we ignored the cost of optimizing $u_{t}$ , our result would still be the first to decouple the $\mathcal{O}(T)$ component from $\gamma_{T}$ . This is because for existing batching rule, even computing the batch length required to evaluate at least one $\sigma_{t}$ at each step, with each evaluation costing at least $\mathcal{O}(\gamma_T^2)$ . Instead, our batching rule is based only on $\sigma_{t}$ once at the beginning of the batch. + +# 4.3. Instantiating the meta-analysis + +Instantiating the results from the previous section we can now provide bounds for two popular acquisition functions. For simplicity and to guarantee that all steps of the algorithm can be implementable in accord with the regret analysis, we restrict ourselves to the assumption of finite $\mathcal{A}$ where the acquisition functions can be exactly maximized. For all of these variants, the run-time is bounded as $\mathcal{O}(T + |\mathcal{A}|\gamma_T^3 + \gamma_T^4)$ , so we will mainly discuss regret in this section. + +MINI-GP-UCB We consider frequentist $(\| f\| \leq F)$ and Bayesian $(f\sim GP)$ settings. + +Theorem 4.4. Assume $\| f\| \leq F$ . For any $1 < C, \delta \in [0,1]$ , run Algorithm 1 with $u_{t} = u_{t}^{\mathrm{GP - UCB}}$ , $\lambda = \xi^{2}$ , and + +$$ +\beta_ {h} = \Theta \left(\sqrt {\log \det \left(\frac {\mathbf {W} _ {h} ^ {1 / 2} \mathbf {K} _ {h} \mathbf {W} _ {h} ^ {1 / 2}}{\lambda} + \mathbf {I}\right) + \log \left(\frac {1}{\delta}\right)} + F\right). +$$ + +Then w.p. $1 - \delta$ , $R_{T} \leq \widetilde{\mathcal{O}}\left((\sqrt{\gamma_{T}} + F)C\sqrt{\gamma_{T}T}\right)$ . + +This result is a combination of Theorem 4.1 with (Chowdhury & Gopalan, 2017, Thm. 1). The proof of this result is straightforward using Theorem 4.1. In particular, the original GP-UCB provides a bound on the regret of the form $R_{T} \leq \widetilde{\mathcal{O}}(\beta_{T}\sum_{t=1}^{T}\sigma_{t-1}(\mathbf{x}_{t}))$ , which using Lemma 4.2 easily becomes $R_{T} \leq \widetilde{\mathcal{O}}(\beta_{T}C\sum_{t=1}^{T}\sigma_{t-1}(\mathbf{x}_{t}))$ , only a $C$ factor worse but with a much lower computational complexity. Compared to other approximations of GP-UCB, MINI-GP-UCB achieve logarithmic improvements due to a tighter $\beta_{h}$ . In particular, all previous approximate GP-UCB variants had to approximate log $\det(\mathbf{K}_t / \lambda + \mathbf{I})$ with a more or less loose upper bound, which resulted in excessive exploration and worse regret. Instead, MINI-GP-UCB uses the exact log-determinant of the GP, since it only needs to be defined on the unique candidates. + +Theorem 4.5. Assume $f \sim GP$ . For any $1 < C, \delta \in [0,1]$ , run Algorithm 1 with $u_{t} = u_{t}^{\mathrm{GP-UCB}}$ , setting $\lambda = \xi^{2}$ and $\beta_{t} = \sqrt{2\log(|\mathcal{A}|t^{2}\pi^{2} / (6\delta))}$ . Then w.p. $1 - \delta$ + +$$ +R _ {T} \leq \tilde {\mathcal {O}} (C \sqrt {T \gamma_ {T}})). +$$ + +This result is a combination of Theorem 4.1 and (Srinivas et al., 2010, Thm. 1). The main advantage of the Bayesian tuning of MINI-GP-UCB is that computing $\beta_{t}$ does not require to know a bound on the norm of the function $F$ (which is often infinite under the GP prior). However MINI-GP-UCB still needs access to the noise level $\xi$ to tune $\lambda$ . + +MINI-GP-EI We can combine Theorem 4.1 with (Wang & de Freitas, 2014, Thm. 1) under frequentist assumptions. + +Theorem 4.6. Assume $\| f\| \leq F$ . For any $1 < C$ and $\delta \in [0,1]$ , run Algorithm 1 with $u_{t} = u_{t}^{\mathrm{GP - EI}}$ , + +$$ +\begin{array}{l} \lambda = \xi^ {2}, a n d \beta_ {h} = \big (\log \det (\mathbf {W} _ {h} ^ {1 / 2} \mathbf {K} _ {h} \mathbf {W} _ {h} ^ {1 / 2} / \lambda + \\ \mathbf {I}) + \sqrt {\log \det (\mathbf {W} _ {h} ^ {1 / 2} \mathbf {K} _ {h} \mathbf {W} _ {h} ^ {1 / 2} / \lambda + \mathbf {I}) \log (\frac {t}{\delta}) + \log (\frac {t}{\delta})} \big) ^ {1 / 2}. \end{array} +$$ + +Then w.p. $1 - \delta$ , $R_{T} \leq \widetilde{\mathcal{O}}\left((\sqrt{\gamma_{T}} + F)C\sqrt{\gamma_{T}T}\right)$ . + +Again we can easily integrate Theorem 4.1 in the original proof. In particular, the original GP-EI analysis provides a bound on the regret of the form $R_{T} \leq \widetilde{\mathcal{O}}\left(\left(\sqrt{\lambda} F + \beta_{T}\right)\sum_{t = 1}^{T}\sigma_{t - 1}(\mathbf{x}_{t})\right)$ , which again using Lemma 4.2 easily becomes $R_{T} \leq \widetilde{\mathcal{O}}\left(\left(\sqrt{\lambda} F + \beta_{T}\right)C\sum_{t = 1}^{T}\sigma_{t - 1}(\mathbf{x}_{t})\right)$ recovering the original regret up to constants. Although the regret of MINI-GP-UCB and MINI-GP-EI are comparable, the underlying algorithms have important differences. In particular, tuning $\beta_{h}$ in MINI-GP-EI does not require knowing a bound $F$ on the norm of the function, which is hard to obtain in many cases. However the analysis of MINI-GP-EI requires to set $\lambda = \xi^2$ , which might be as hard to estimate. + +# 4.4. Extension to continuous spaces + +The computational and regret analysis in this section rely on the ability of the algorithm to optimize the acquisition function exactly (i.e., find the true minimizer of $\arg \max_{\mathbf{x} \in \mathcal{A}} u_t(\overline{\mathbf{x}})$ ), to avoid selecting sub-optimal actions, and efficiently (i.e., the $A$ term in Section 4.2 should not be too large), to avoid dominating the runtime. Both of these requirements are easy to satisfy on discrete $\mathcal{A}$ (where $u_t$ can be optimized by enumeration), which is why we focus on these decision sets. However, when optimizing continuous $u_t$ we can easily extend the MINI-META framework to replace enumeration with methods based on continuous solvers (Mutny & Krause, 2018; Jones et al., 1998) or sampling (Balandat et al., 2019). This does not come with theoretical guarantees (i.e., without exact and efficient acquisition optimization both regret and runtime can potentially be large), but the minimizing the number of unique candidates by infrequent switches preserves important practical advantages also when the number of candidates is large or infinite. In particular MINI-META optimizes the continuous acquisition function only $h$ times, once per batch, and much less frequently than other methods that to promote diversity need to re-optimize $u_t$ at each step. When $h \ll T$ this saves a large number of expensive invocations of the optimizer. Moreover, most optimizers/samplers look for a good candidate by repeated evaluation of the posterior. Even in continuous settings MINI-META's posterior remains sparse, and efficient to evaluate further compounding the computational gains. + +# 5. Experiments + +We now evaluate our proposed approach empirically, focusing here on real-world data and on synthetic data in the + +![](images/0b9a8a89ad74613ada6a18500597946a89a40d316b5a6bead8cc7d2a732e2a5b.jpg) + +![](images/45013ac550ad11c4fa667fa634f577eae42c8538b6f9ab861d5fa4e22e66369a.jpg) +(a) $R_{t} / t$ against step $t$ + +![](images/6a2b5e331ea0a1e2233f28a0da369837b967cf2e7c7e337efa87211c0cd21af7.jpg) +(b) $q_{t}$ against step $t$ + +![](images/d5d6b10870a58a7936b4af703339cb8eeabb2c6a5a33a1a38c64d2db3f2b046e.jpg) +(c) $R_{T}$ against wall-clock time (s) + +appendix. In particular, following the approach taken in (Calandriello et al., 2020) we evaluate MINI-GP-UCB and MINI-GP-EI on NAS-bench (Ying et al., 2019). We compare MINI-GP-UCB and MINI-GP-EI with BBKB (Calandriello et al., 2020), GP-UCB (Srinivas et al., 2010), GP-BUCB (Desautels et al., 2014), GP-BTS (Kandasamy et al., 2018), and an epsilon greedy strategy. For MINI-GP-UCB, MINI-GP-EI, and BBKB hyperparameters that need to be tuned are $C$ , the bandwidth of the Gaussian kernel $\sigma$ , while $\lambda$ is set to the 90-th percentile of the standard deviation of the target as an oracle for the noise level. For epsilon greedy epsilon is set as $a / t^b$ and $a \in \{0.1, 1, 10\}$ and $b \in \{1/3, 1/2, 1, 2\}$ is tuned via grid search. For each experiment we repeat the run 40 times with different seeds, and report mean and confidence intervals for the hyperparameter configuration (searched in a grid) that achieves lowest average regret (specific values reported in the appendix). All experiments are ran using a single, recent generation CPU core to avoid inconsistencies between some implementations using parallel BLAS and some not. The neural architecture search setting is the same as (Calandriello et al., 2020). In particular, the search space is the discrete combinatorial space of possible 1-hidden layer 4 node networks using either convolutions or max-pooling, that is then used as a module in an inception-like architecture. The final space $\mathcal{A}$ has $|\mathcal{A}| = 12416$ candidates in $d = 19$ dimensions. + +In Fig. (a) we report average regret vs steps (i.e., $t$ ). To compensate scale effect in the rewards, the average regret is normalized by the average regret achieved by a completely exploratory policy that selects candidates uniformly at random. Both MINI-variants are comparable to the current state of the art BBKB, and better than a tuned epsilon greedy. In Fig. (b) we report the number of unique candidates (note, not of switches) selected by each algorithm. We note that despite not explicitly being designed for this, BBKB does not select a very large number of unique arms. However, MINI-GP-UCB and MINI-GP-EI still select an even smaller number of unique candidates. In Fig. (c) we report average regret vs wallclock runtime rather than steps. Therefore a more efficient algorithm will terminate faster and achieve a lower average regret in the same span of time. We see that both MINI-GP-UCB and MINI-GP-EI are faster than BBKB, terminating earlier. However the empirical runtime gap does not seem to match the large theoretical runtime gap (i.e., $\mathcal{O}(T + A)$ vs $\mathcal{O}(TA)$ ). In particular, the actual empirical diversity in BBKB's batches seem to be limited, and allows for a large degree of lazy updates, which are not accounted for in the worst-case complexity. + +Another interesting figure to empirically measure is the difference between the number $h$ of batches/switches at step $T$ and the number of unique candidates $q_{T}$ selected. As we know, $h$ is an upper bound for $q_{T}$ , but looking at Fig. (d) and Fig. (e) we see that especially in the later stages of + +![](images/b816f90239790696e2dc781c29c0e7b76a322111db4e0f8e7137d87b13954161.jpg) +(d) Batch/epoch number $h$ against step $t$ + +![](images/b8cf86d037c64c7beaeef808afe07716d3e95cfcddde17b15f3432a10cda1b00.jpg) +(e) $q_{t}$ against step $t$ + +the optimization these two quantities have a significant gap between them. This can be explained by noticing that as the optimization progresses the algorithm tends to focus on a few good candidates, switching back and forth between them which increases $h$ but not $q_{T}$ . + +# 6. Conclusions, limitations and open questions + +Our paper highlighted how existing tools can be combined in a new effective approach, capable of positively impacting the GP optimization setting both theoretically and empirically. Theoretically, as to the best of our knowledge, our proposed MINI-variants achieve the tightest guarantees both in regret and runtime among scalable GP optimization methods, using a very different approach that does not require approximating the GP or other randomized approximations. Empirically, because our method comes with a number of + +practical properties, including scalability, adaptability to different acquisition functions, and being suitable to batched settings as well as settings where switching costs are be significant. However, there remain several limitations, which brings with them open questions. + +Our MINI-variants inherit the limitations of the original methods and while some (e.g., scalability) are removed, others remain. In particular, MINI-GP-UCB and MINI-GP-EI still rely on quantities that are hard to estimate, such as the function norm, noise level, kernel choice, or kernel bandwidth. It is unclear how an on-line tuning of these quantities might be done without losing the no-regret guarantees. It would be interesting to see if recent approaches to tune these quantities for traditional GP optimization (Berkenkamp et al., 2019; Durand et al., 2018) can be transferred to MINI-variants, leveraging their unique property of being based on exact GP inference. Furthermore, while MINI-META could be applied to other acquisition functions, not all would result in a scalable algorithm. For example GP-TS (Chowdhury & Gopalan, 2017) also satisfies Equation 5. However, sampling a TS posterior is not scalable (i.e., $\mathcal{O}(|\mathcal{A}|^2)$ for finite $\mathcal{A}$ ) even for sparse posteriors, and therefore a hypothetical MINI-GP-TS would remain not scalable. + +From a complexity perspective, optimizing the acquisition function exactly remains one of the hardest obstacles in GP optimization, and it is still not clear how the no-regret guarantees can be extended to approximate maximization. Generic non-convex optimizers such as DiRECT (Mutny & Krause, 2018; Jones, 2001) have an exponential complexity, and even considering the effective dimensionality reduction induced by Equation 4, which reduces the parameter space from $\mathcal{O}(t)$ to $\mathcal{O}(q_t)$ , they might remain infeasible. + +Despite not being explicitly optimized for this task, we empirically observe that other approximate GP-Opt methods, such as BBKB, also tend to achieve a small $q_{t}$ . Indeed, any algorithm that quickly converges to a small set of good candidates would evaluate a small number of unique candidates. Therefore, it is an important open question to try and bound the number of candidates evaluated by a generic GP optimization algorithm without low-switching enforcement, as it might show that the reformulations of Equation 4 might be more broadly applicable than expected. + +Finally, looking at the applicability of our method, our whole approach is based on the possibility of evaluating multiple times the same candidate without affecting the outcome. While this is a strength in settings with high switching costs, it also makes it unsuitable in settings where this is impossible (e.g., repeated medical testing of a single patient), or limited (e.g., news change over time and cannot be recommended over and over). More subtly, it also makes it poorly suited to low or noiseless settings, where multiple evaluations of the same candidate would not be very useful. + +# References + +Abbasi-Yadkori, Y., Pál, D., and Szepesvári, C. Improved algorithms for linear stochastic bandits. In Advances in Neural Information Processing Systems, pp. 2312-2320, 2011. +Balandat, M., Karrer, B., Jiang, D. R., Daulton, S., Letham, B., Wilson, A. G., and Bakshy, E. Botorch: Programmable bayesian optimization in pytorch. arXiv preprint arXiv:1910.06403, 2019. +Berkenkamp, F., Schoellig, A. P., and Krause, A. No-regret bayesian optimization with unknown hyperparameters. Journal of Machine Learning Research, 20(50):1-24, 2019. URL http://jmlr.org/papers/v20/18-213.html. +Binois, M., Huang, J., Gramacy, R. B., and Ludkovski, M. Replication or exploration? sequential design for stochastic simulation experiments. Technometrics, 61(1): 7-23, 2019. +Calandriello, D., Carratino, L., Lazaric, A., Valko, M., and Rosasco, L. Gaussian process optimization with adaptive sketching: Scalable and no regret. In _Conference on Learning Theory_, 2019. +Calandriello, D., Carratino, L., Valko, M., Lazaric, A., and Rosasco, L. Near-linear time gaussian process optimization with adaptive batching and resparsification. In International Conference on Machine Learning, 2020. +Chowdhury, S. R. and Gopalan, A. On kernelized multiarmed bandits. In International Conference on Machine Learning, pp. 844-853, 2017. +Daxberger, E. A. and Low, B. K. H. Distributed batch Gaussian process optimization. In Precup, D. and Teh, Y. W. (eds.), Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pp. 951-960, International Convention Centre, Sydney, Australia, 06-11 Aug 2017. PMLR. +Desautels, T., Krause, A., and Burdick, J. W. Parallelizing exploration-exploitation tradeoffs in Gaussian process bandit optimization. The Journal of Machine Learning Research, 15(1):3873-3923, 2014. +Durand, A., Maillard, O.-A., and Pineau, J. Streaming kernel regression with provably adaptive mean, variance, and regularization. The Journal of Machine Learning Research, 19(1):650-683, 2018. +Gardner, J. R., Pleiss, G., Bindel, D., Weinberger, K. Q., and Wilson, A. G. Gpytorch: Blackbox matrix-matrix gaussian process inference withgpu acceleration. Advances + +in Neural Information Processing Systems, 2018:7576-7586, 2018. +Jones, D. R. Direct global optimization algorithm +Global Optimization Algorithm, pp. 431-440. Springer +US, Boston, MA, 2001. ISBN 978-0-306-48332-5. +doi: 10.1007/0-306-48332-7_93. URL https://doi.org/10.1007/0-306-48332-7_93. +Jones, D. R., Schonlau, M., and Welch, W. J. Efficient global optimization of expensive black-box functions. Journal of Global optimization, 13(4):455-492, 1998. +Kandasamy, K., Krishnamurthy, A., Schneider, J., and Poczos, B. Parallelised bayesian optimisation via thompson sampling. In International Conference on Artificial Intelligence and Statistics, pp. 133-142, 2018. +Kathuria, T., Deshpande, A., and Kohli, P. Batched gaussian process bandit optimization via determinantal point processes. In Advances in Neural Information Processing Systems, pp. 4206-4214, 2016. +Lattimore, T. and Szepesvári, C. Bandit algorithms. Cambridge University Press, 2020. +Li, L., Chu, W., Langford, J., and Schapire, R. E. A contextual-bandit approach to personalized news article recommendation. International World Wide Web Conference, 2010. URL http://rob.schapire.net/papers/www10.pdf. +Mockus, J. Bayesian approach to global optimization: theory and applications. 1989. +Mutny, M. and Krause, A. Efficient High Dimensional Bayesian Optimization with Additivity and Quadrature Fourier Features. In Bengio, S., Wallach, H., Larochelle, H., Grauman, K., Cesa-Bianchi, N., and Garnett, R. (eds.), Advances in Neural Information Processing Systems 31, pp. 9019-9030. Curran Associates, Inc., 2018. +Picheny, V., Ginsbourger, D., Richet, Y., and Caplin, G. Quantile-based optimization of noisy computer experiments with tunable precision. Technometrics, 55(1):2-13, 2013. +Quinonero-Candela, J., Rasmussen, C. E., and Williams, C. K. Approximation methods for gaussian process regression. Large-scale kernel machines, pp. 203-224, 2007. +Rasmussen, C. E. and Williams, C. K. I. Gaussian processes for machine learning. Adaptive computation and machine learning. MIT Press, Cambridge, Mass, 2006. ISBN 978-0-262-18253-9. OCLC: ocm61285753. + +Saito, Y., Shunsuke, A., Megumi, M., and Yusuke, N. Open bandit dataset and pipeline: Towards realistic and reproducible off-policy evaluation. NeurIPS2021 Datasets and Benchmarks Track, 2021. +Scarlett, J., Bogunovic, I., and Cevher, V. Lower bounds on regret for noisy gaussian process bandit optimization. In Conference on Learning Theory, pp. 1723-1742, 2017. +Srinivas, N., Krause, A., Seeger, M., and Kakade, S. M. Gaussian process optimization in the bandit setting: No regret and experimental design. In International Conference on Machine Learning, pp. 1015-1022, 2010. +Vakili, S., Khezeli, K., and Picheny, V. On information gain and regret bounds in gaussian process bandits. In Banerjee, A. and Fukumizu, K. (eds.), Proceedings of The 24th International Conference on Artificial Intelligence and Statistics, volume 130 of Proceedings of Machine Learning Research, pp. 82-90. PMLR, 13-15 Apr 2021. +Wang, Z. and de Freitas, N. Theoretical analysis of bayesian optimisation with unknown gaussian process hyperparameters. arXiv preprint arXiv:1406.7758, 2014. +Ying, C., Klein, A., Real, E., Christiansen, E., Murphy, K., and Hutter, F. Nas-bench-101: Towards reproducible neural architecture search. arXiv preprint arXiv:1902.09635, 2019. + +# A. Proofs of Section 3 + +For several of the proofs in this section it will be useful to introduce the so-called feature space formulation of a GP posterior (Rasmussen & Williams, 2006). In particular, to every kernel function $k$ we can associate a feature map $\varphi(\cdot): \mathcal{A} \to \mathcal{H}$ where $\mathcal{H}$ is the reproducing kernel Hilbert space associated with $k$ and the GP. The main property of $\varphi(\cdot)$ is that for any $x$ and $x'$ we have $k(x, x') = \varphi(x)' \varphi(x')$ . With a slight abuse of notation, we will also indicate with $\varphi(X) = [\varphi(x_1), \ldots, \varphi(x_t)]^\top$ the linear operator obtained by stacking together the various $\varphi(\cdot)$ , such that $K_t = \varphi(X_t) \varphi(X_t)'$ . Note that this also allows us to define the equivalent of $K_t$ in $\mathcal{H}$ as $\varphi(X_t)' \varphi(X_t): \mathcal{H} \to \mathcal{H}$ . Finally, to connect $K_t$ and $\varphi(X_t)' \varphi(X_t)$ we will heavily use this fundamental linear algebra equality + +$$ +\mathbf {B} ^ {\intercal} \left(\mathbf {B} \mathbf {B} ^ {\intercal} + \lambda \mathbf {I}\right) ^ {- 1} \mathbf {B} = \mathbf {B} ^ {\intercal} \mathbf {B} \left(\mathbf {B} ^ {\intercal} \mathbf {B} + \lambda \mathbf {I}\right) ^ {- 1} \tag {6} +$$ + +which can be easily shown to be valid for any linear operator $\mathbf{B}$ using its singular value decomposition. + +# A.1. Proof of equivalence between Equation 1 and Equation 4 + +Assume for now that $t$ is the step at the end (i.e., $\mathsf{fb}(t) = t$ ) of batch $h$ . We will relax this assumption at the end of the section to discuss how this can be extended to intermediate steps. Using the feature-space representation of a GP (see e.g., (Rasmussen & Williams, 2006, Eq. (2.11))), and defining $\mathbf{V}_t \stackrel{\mathrm{def}}{=} \varphi(\mathbf{X}_t)^{\top} \varphi(\mathbf{X}_t) + \lambda \mathbf{I}$ , we can rewrite the posterior variance as + +$$ +\begin{array}{l} \sigma_ {t} ^ {2} (\mathbf {x} _ {i}) = \mathrm {k} (\mathbf {x} _ {i}, \mathbf {x} _ {i}) - \mathrm {k} (\mathbf {x} _ {i}, \mathbf {X} _ {t}) (\mathbf {K} _ {t} + \lambda \mathbf {I}) ^ {- 1} \mathrm {k} (\mathbf {X} _ {t}, \mathbf {x} _ {i}) \\ \stackrel {a} {=} \varphi (\mathbf {x} _ {i}) ^ {\top} \varphi (\mathbf {x} _ {i}) - \varphi (\mathbf {x} _ {i}) ^ {\top} \varphi (\mathbf {X} _ {t}) ^ {\top} (\varphi (\mathbf {X} _ {t}) \varphi (\mathbf {X} _ {t}) ^ {\top} + \lambda \mathbf {I}) ^ {- 1} \varphi (\mathbf {X} _ {t}) \varphi (\mathbf {x} _ {i}) \\ \stackrel {b} {=} \varphi (\mathbf {x} _ {i}) ^ {\intercal} \varphi (\mathbf {x} _ {i}) - \varphi (\mathbf {x} _ {i}) ^ {\intercal} \varphi (\mathbf {X} _ {t}) ^ {\intercal} \varphi (\mathbf {X} _ {t}) (\varphi (\mathbf {X} _ {t}) ^ {\intercal} \varphi (\mathbf {X} _ {t}) + \lambda \mathbf {I}) ^ {- 1} \varphi (\mathbf {x} _ {i}) \\ \stackrel {{c}} {{=}} \varphi (\mathbf {x} _ {i}) ^ {\intercal} \varphi (\mathbf {x} _ {i}) - \varphi (\mathbf {x} _ {i}) ^ {\intercal} (\underbrace {\varphi (\mathbf {X} _ {t}) ^ {\intercal} \varphi (\mathbf {X} _ {t}) + \lambda \mathbf {I}} _ {\mathbf {V} _ {t}} - \lambda \mathbf {I}) \underbrace {(\varphi (\mathbf {X} _ {t}) ^ {\intercal} \varphi (\mathbf {X} _ {t}) + \lambda \mathbf {I}) ^ {- 1}} _ {\mathbf {V} _ {t} ^ {- 1}} \varphi (\mathbf {x} _ {i}) \\ \stackrel {d} {=} \varphi (\mathbf {x} _ {i}) ^ {\intercal} \varphi (\mathbf {x} _ {i}) - \varphi (\mathbf {x} _ {i}) ^ {\intercal} (\mathbf {I} - \lambda \mathbf {V} _ {t} ^ {- 1}) \varphi (\mathbf {x} _ {i}) = \lambda \varphi (\mathbf {x} _ {i}) ^ {\intercal} \mathbf {V} _ {t} ^ {- 1} \varphi (\mathbf {x} _ {i}) = \varphi (\mathbf {x} _ {i}) ^ {\intercal} \mathbf {A} _ {t} ^ {- 1} \varphi (\mathbf {x} _ {i}), \\ \end{array} +$$ + +where in each passage + +$a$ ) we simply apply the definition of $\mathrm{k}$ and $\varphi$ +$b$ ) we apply Equation 6 with $\varphi (\mathbf{X})$ as $\mathbf{B}$ +$c)$ we add and subtract $\lambda \mathbf{I}$ to highlight the presence of $\mathbf{V}_t$ in the reformulation; +$d$ ) we collect $\lambda$ to replace $\mathbf{V}_t$ with $\mathbf{A}_t\stackrel {\mathrm{def}}{=}\varphi (\mathbf{X})^\top \varphi (\mathbf{X}) / \lambda +\mathbf{I}$ as in (Rasmussen & Williams, 2006, Eq. (2.11)). + +Exploiting the fact that all candidate in a batch are identical (i.e., $\mathbf{x}_{\mathrm{fb}(s) + 1} = \mathbf{x}_s$ ), and denoting with $\{\mathbf{x}_j\}_{j=1}^h$ the candidate in each batch we can rewrite $\mathbf{A}_t$ as + +$$ +\begin{array}{l} \mathbf {A} _ {t} = \mathbf {I} + \lambda^ {- 1} \varphi (\mathbf {X}) ^ {\intercal} \varphi (\mathbf {X}) = \mathbf {I} + \lambda^ {- 1} \sum_ {s = 1} ^ {t} \varphi (\mathbf {x} _ {s}) \varphi (\mathbf {x} _ {s}) ^ {\intercal} \\ = \mathbf {I} + \lambda^ {- 1} \sum_ {s = 1} ^ {t} \varphi (\mathbf {x} _ {\mathrm {f b} (s) + 1}) \varphi (\mathbf {x} _ {\mathrm {f b} (s) + 1}) ^ {\intercal} = \mathbf {I} + \lambda^ {- 1} \sum_ {j = 1} ^ {h} B _ {j} \varphi (\mathbf {x} _ {j}) \varphi (\mathbf {x} _ {j}) ^ {\intercal} \\ = \mathbf {I} + \lambda^ {- 1} \sum_ {j = 1} ^ {h} [ \mathbf {W} _ {h} ] _ {j, j} \varphi (\mathbf {x} _ {j}) \varphi (\mathbf {x} _ {j}) ^ {\intercal} = \mathbf {I} + \lambda^ {- 1} \varphi (\mathbf {X} _ {h}) ^ {\intercal} \mathbf {W} _ {h} \varphi (\mathbf {X} _ {h}), \\ \end{array} +$$ + +where $\mathbf{W}_h$ is defined as described in Equation 4. Applying now steps $a - d$ in reverse, with the only difference being the application of Equation 6 to $\mathbf{W}_h^{1/2}\varphi(\mathbf{X}_h)$ rather than $\varphi(\mathbf{X}_t)$ in step $b$ , we obtain + +$$ +\begin{array}{l} \sigma_ {t} ^ {2} (\mathbf {x} _ {i}) = \varphi (\mathbf {x} _ {i}) ^ {\intercal} \mathbf {A} _ {t} ^ {- 1} \varphi (\mathbf {x} _ {i}) = \varphi (\mathbf {x} _ {i}) ^ {\intercal} (\varphi (\mathbf {X} _ {h}) ^ {\intercal} \mathbf {W} _ {h} \varphi (\mathbf {X} _ {h}) / \lambda + \mathbf {I}) ^ {- 1} \varphi (\mathbf {x} _ {i}) \\ \stackrel {d, c} {=} \varphi (\mathbf {x} _ {i}) ^ {\intercal} \varphi (\mathbf {x} _ {i}) - \varphi (\mathbf {x} _ {i}) ^ {\intercal} \varphi (\mathbf {X} _ {t}) ^ {\intercal} \mathbf {W} _ {h} ^ {1 / 2} \mathbf {W} _ {h} ^ {1 / 2} \varphi (\mathbf {X} _ {t}) (\varphi (\mathbf {X} _ {t}) ^ {\intercal} \mathbf {W} _ {h} ^ {1 / 2} \mathbf {W} _ {h} ^ {1 / 2} \varphi (\mathbf {X} _ {t}) + \lambda \mathbf {I}) ^ {- 1} \varphi (\mathbf {x} _ {i}) \\ \stackrel {b} {=} \varphi (\mathbf {x} _ {i}) ^ {\intercal} \varphi (\mathbf {x} _ {i}) - \varphi (\mathbf {x} _ {i}) ^ {\intercal} \varphi (\mathbf {X} _ {t}) ^ {\intercal} \mathbf {W} _ {h} ^ {1 / 2} (\mathbf {W} _ {h} ^ {1 / 2} \varphi (\mathbf {X} _ {t}) \varphi (\mathbf {X} _ {t}) ^ {\intercal} \mathbf {W} _ {h} ^ {1 / 2} + \lambda \mathbf {I}) ^ {- 1} \mathbf {W} _ {h} ^ {1 / 2} \varphi (\mathbf {X} _ {t}) \varphi (\mathbf {x} _ {i}) \\ \stackrel {a} {=} \mathrm {k} (\mathbf {x} _ {i}, \mathbf {x} _ {i}) - \mathrm {k} (\mathbf {x} _ {i}, \mathbf {X} _ {t}) \mathbf {W} _ {h} ^ {1 / 2} \left(\mathbf {W} _ {h} ^ {1 / 2} \mathbf {K} _ {t} \mathbf {W} _ {h} ^ {1 / 2} + \lambda \mathbf {I}\right) ^ {- 1} \mathbf {W} _ {h} ^ {1 / 2} \mathrm {k} (\mathbf {X} _ {t}, \mathbf {x} _ {i}) \\ = \mathrm {k} (\mathbf {x} _ {i}, \mathbf {x} _ {i}) - \mathrm {k} (\mathbf {x} _ {i}, \mathbf {X} _ {t}) (\mathbf {K} _ {t} + \lambda \mathbf {W} _ {h} ^ {- 1}) ^ {- 1} \mathrm {k} (\mathbf {X} _ {t}, \mathbf {x} _ {i}), \\ \end{array} +$$ + +where in the last equality we simply collected $\mathbf{W}_h$ to obtain the formulation of Equation 4. The reasoning for the mean is identical, with one minor difference. After rewriting $\mu_t$ in its feature-space view, and applying the fundamental equality + +$$ +\begin{array}{l} \mu_ {t} (\mathbf {x} _ {i}) = \mathrm {k} (\mathbf {x} _ {i}, \mathbf {X} _ {t}) (\mathbf {K} _ {t} + \lambda \mathbf {I}) ^ {- 1} \mathbf {K} _ {t} \mathbf {y} _ {t} \\ = \varphi (\mathbf {x} _ {i}) ^ {\top} \varphi (\mathbf {X} _ {t}) ^ {\top} (\varphi (\mathbf {X} _ {t}) \varphi (\mathbf {X} _ {t}) ^ {\top} + \lambda \mathbf {I}) ^ {- 1} \varphi (\mathbf {X} _ {t}) \varphi (\mathbf {X} _ {t}) ^ {\top} \mathbf {y} _ {t} \\ \stackrel {{a}} {=} \varphi (\mathbf {x} _ {i}) ^ {\top} \varphi (\mathbf {X} _ {t}) ^ {\top} \varphi (\mathbf {X} _ {t}) (\varphi (\mathbf {X} _ {t}) ^ {\top} \varphi (\mathbf {X} _ {t}) + \lambda \mathbf {I}) ^ {- 1} \varphi (\mathbf {X} _ {t}) ^ {\top} \mathbf {y} _ {t} \\ \stackrel {b} {=} \varphi (\mathbf {x} _ {i}) ^ {\intercal} \varphi (\mathbf {X} _ {h}) ^ {\intercal} \mathbf {W} _ {h} \varphi (\mathbf {X} _ {h}) (\varphi (\mathbf {X} _ {h}) ^ {\intercal} \mathbf {W} _ {h} \varphi (\mathbf {X} _ {h}) + \lambda \mathbf {I}) ^ {- 1} \varphi (\mathbf {X} _ {t}) ^ {\intercal} \mathbf {y} _ {t}, \\ \end{array} +$$ + +where equality $a$ is once again due to Equation 6, and $b$ is due to the already proven equality $\varphi (\mathbf{X}_t)^\top \varphi (\mathbf{X}_t) = \varphi (\mathbf{X}_h)^\top \mathbf{W}_h\varphi (\mathbf{X}_h)$ . To handle the last remaining term $\varphi (\mathbf{X}_t)^\top \mathbf{y}_t$ we can rewrite + +$$ +\begin{array}{l} \varphi (\mathbf {X} _ {t}) ^ {\top} \mathbf {y} _ {t} = \sum_ {s = 1} ^ {t} \varphi (\mathbf {x} _ {s}) y _ {s} = \sum_ {s = 1} ^ {t} \varphi (\mathbf {x} _ {\mathrm {f b} (s) + 1}) y _ {s} \\ = \sum_ {j = 1} ^ {h} \varphi (\mathbf {x} _ {j}) \sum_ {s = t _ {j} + 1} ^ {t _ {j} + B _ {h}} y _ {s} = \sum_ {j = 1} ^ {h} \varphi (\mathbf {x} _ {j}) [ \mathbf {y} _ {h} ] _ {j} = \varphi (\mathbf {X} _ {h}) ^ {\top} \mathbf {y} _ {h}, \\ \end{array} +$$ + +where once again $t_j$ is the step before the beginning of the $j$ -th epoch, that is $\mathsf{fb}(t) = t_j$ for all steps in the $j$ -th epoch and the candidate $\mathbf{x}_{t_j + 1}$ is the one evaluated multiple times in the $j$ -th epoch. Putting it all together, and re-applying Equation 6 we obtain + +$$ +\begin{array}{l} \mu_ {t} (\mathbf {x} _ {i}) = \varphi (\mathbf {x} _ {i}) ^ {\top} \varphi (\mathbf {X} _ {h}) ^ {\top} \mathbf {W} _ {h} \varphi (\mathbf {X} _ {h}) \left(\varphi (\mathbf {X} _ {h}) ^ {\top} \mathbf {W} _ {h} \varphi (\mathbf {X} _ {h}) + \lambda \mathbf {I}\right) ^ {- 1} \varphi (\mathbf {X} _ {h}) ^ {\top} \mathbf {y} _ {h} \\ = \varphi (\mathbf {x} _ {i}) ^ {\intercal} \varphi (\mathbf {X} _ {h}) ^ {\intercal} \mathbf {W} _ {h} ^ {1 / 2} (\mathbf {W} _ {h} ^ {1 / 2} \varphi (\mathbf {X} _ {h}) \varphi (\mathbf {X} _ {h}) ^ {\intercal} \mathbf {W} _ {h} ^ {1 / 2} + \lambda \mathbf {I}) ^ {- 1} \mathbf {W} _ {h} ^ {1 / 2} \varphi (\mathbf {X} _ {h}) \varphi (\mathbf {X} _ {h}) ^ {\intercal} \mathbf {y} _ {h} \\ = \mathrm {k} (\mathbf {x} _ {i}, \mathbf {X} _ {h}) (\mathbf {K} _ {h} + \lambda \mathbf {W} _ {h} ^ {- 1}) ^ {- 1} \mathbf {K} _ {h} \mathbf {y} _ {h}, \\ \end{array} +$$ + +which concludes the proof of the equivalence between Equation 1 and Equation 4. + +In this analysis we made two simplifications: that the step $t$ was at the end of a batch, and that no two candidates were the same in different batches. To relax the first we can just consider extending $\mathbf{W}_h$ to contain not only all past $B_{j}$ , but also a partial count of the current batch. Similarly $\mathbf{y}_h$ has to be extended to include the partial feedback received during the epoch. Similarly, if the same candidate was selected in two batches $j$ and $j'$ , we simply have to merge their contributions in the sum $\sum_{j=1}^{h} B_j \varphi(\mathbf{x}_j) \varphi(\mathbf{x}_j)^\top$ e.g., by removing the $j$ -th term and account the $j'$ -th term with $B_j + B_{j'}$ multiplicity. + +# A.2. Proof of Lemma 4.3 + +We begin with the following result from (Calandriello et al., 2020). + +Proposition A.1 ((Calandriello et al., 2020, Lem. 4)). For any kernel $k$ , set of points $\mathbf{X}_t$ , $\mathbf{x} \in \mathcal{A}$ and $t < t'$ + +$$ +1 \leq \frac {\sigma_ {t} ^ {2} (\mathbf {x})}{\sigma_ {t ^ {\prime}} ^ {2} (\mathbf {x})} \leq 1 + \sum_ {s = t + 1} ^ {t ^ {\prime}} \sigma_ {t} ^ {2} (\mathbf {x} _ {s}). +$$ + +Using Proposition A.1 it is also very easy to show the following known property of the one-step ratio between posteriors (i.e., $t' = t + 1$ ) + +$$ +1 \leq \frac {\sigma_ {t} ^ {2} (\mathbf {x})}{\sigma_ {t + 1} ^ {2} (\mathbf {x})} \leq 1 + \sigma_ {t} ^ {2} (\mathbf {x} _ {t + 1}) \leq 1 + \sigma_ {0} ^ {2} (\mathbf {x} _ {t + 1}) = 1 + k (\mathbf {x} _ {t + 1}, \mathbf {x} _ {t + 1}) / \lambda \leq 1 + \kappa / \lambda , \tag {7} +$$ + +where the first inequality is due to Proposition A.1, the second due to the monotonicity of the posterior in $t$ , and the third due to our assumption $\mathrm{k}(\mathbf{x},\mathbf{x})\leq \kappa^2$ + +Applying Proposition A.1 to our setting, where $\mathbf{x}_s$ does not change for the whole batch, and our epoch termination rule from Algorithm 2 we obtain the following corollary + +Corollary A.2. During epoch $h$ , let $t_h$ be the step before the beginning of the batch, and let $\mathbf{x}_{t_h + 1}$ be the candidate selected for the whole batch at step $t_h + 1$ . Then for any kernel $k$ , set of points $\mathbf{X}_{t_h}$ , $\mathbf{x} \in \mathcal{A}$ , and $t_h + 1 = \mathrm{fb}(t) + 1 \leq t \leq \mathrm{fb}(t) + B_h$ we have + +$$ +1 \leq \frac {\sigma_ {\mathrm {f b} (t)} ^ {2} (\mathbf {x})}{\sigma_ {t} ^ {2} (\mathbf {x})} \leq 1 + B _ {h} \sigma_ {\mathrm {f b} (t)} ^ {2} (\mathbf {x} _ {\mathrm {f b} (t) + 1}). +$$ + +Moreover, selecting $B_{h} = \left\lfloor (C^{2} - 1) / \sigma_{t_{h}}^{2}(\mathbf{x}_{t_{h} + 1})\right\rfloor$ we have $\frac{\sigma_{\mathrm{fb}(t)}(\mathbf{x})}{\sigma_t(\mathbf{x})}\leq C.$ + +To bound the number of epochs and prove Lemma 4.3 we follow a blueprint from (Calandriello et al., 2020). + +Proof of Lemma 4.3. To bound the number of epoch we start from the fundamental inequality based on the choice of $B_h$ and the properties of the floor function. Consider an arbitrary $B_j$ , + +$$ +\begin{array}{l} B _ {j} \geq \frac {C ^ {2} - 1}{\sigma_ {t _ {j}} ^ {2} (\mathbf {x} _ {t _ {j} + 1})} - 1 \\ \Rightarrow \sigma_ {t _ {j}} ^ {2} (\mathbf {x} _ {t _ {j} + 1}) (B _ {j} + 1) \geq C ^ {2} - 1 \\ \Rightarrow 2 \sigma_ {t _ {j}} ^ {2} (\mathbf {x} _ {t _ {j} + 1}) B _ {j} \geq C ^ {2} - 1. \\ \end{array} +$$ + +Note that due to the construction of the batch $\sigma_{t_j}^2 (\mathbf{x}_{t_j + 1}) = \sigma_{t_j}^2 (\mathbf{x}_{t_j + 2}) = \dots = \sigma_{t_j}^2 (\mathbf{x}_{t_j + B_j})$ , and therefore $\sigma_{t_j}^2 (\mathbf{x}_{t_j + 1})B_j = \sum_{s = t_j + 1}^{t_j + B_j}\sigma_{t_j}^2 (\mathbf{x}_s)$ . Summing across batches up to batch $h$ we have + +$$ +\begin{array}{l} h \left(C ^ {2} - 1\right) \leq 2 \sum_ {j = 1} ^ {h} \sigma_ {t _ {j}} ^ {2} \left(\mathbf {x} _ {t _ {j} + 1}\right) B _ {j} = 2 \sum_ {j = 1} ^ {h} \sum_ {s = t _ {j} + 1} ^ {t _ {j} + B _ {j}} \sigma_ {t _ {j}} ^ {2} \left(\mathbf {x} _ {s}\right) \\ = 2 \sum_ {j = 1} ^ {h} \sum_ {s = t _ {j} + 1} ^ {t _ {j} + B _ {j}} \frac {\sigma_ {t _ {j}} ^ {2} (\mathbf {x} _ {s})}{\sigma_ {s - 1} ^ {2} (\mathbf {x} _ {s})} \sigma_ {s - 1} ^ {2} (\mathbf {x} _ {s}) \stackrel {\text {C o r o l l a r y A . 2}} {\leq} 2 \sum_ {j = 1} ^ {h} \sum_ {s = t _ {j} + 1} ^ {t _ {j} + B _ {j}} C ^ {2} \sigma_ {s - 1} ^ {2} (\mathbf {x} _ {s}) \\ = 2 C ^ {2} \sum_ {s = 1} ^ {T} \sigma_ {s - 1} ^ {2} (\mathbf {x} _ {s}). \\ \end{array} +$$ + +Now that we obtain the sum of posterior variances we need to connect this quantity to $\gamma_{T}$ . In order to do this we will use a standard bound (see e.g., (Hazan et al., 2006)) on the summation + +$$ +\sum_ {s = 1} ^ {T} \sigma_ {s} ^ {2} (\mathbf {x} _ {s}) \leq \log \det (\mathbf {I} + \mathrm {k} (\mathbf {X} _ {t}, \mathbf {X} _ {t}) / \lambda) = 2 \gamma (\mathbf {X} _ {t}, \mathbf {y} _ {t}) \leq 2 \gamma_ {T}. +$$ + +All that is left is to use Equation 7 to bound $\sigma_{s - 1}^2 (\mathbf{x}_s)$ in terms of $\sigma_s^2 (\mathbf{x}_s)$ and rearrange appropriately all the derived results to obtain + +$$ +h \leq \frac {2 C ^ {2}}{C ^ {2} - 1} \sum_ {s = 1} ^ {T} \sigma_ {s - 1} ^ {2} (\mathbf {x} _ {s}) \leq \frac {2 C ^ {2}}{C ^ {2} - 1} (1 + \kappa^ {2} / \lambda) \sum_ {s = 1} ^ {T} \sigma_ {s} ^ {2} (\mathbf {x} _ {s}) \leq \frac {4 C ^ {2}}{C ^ {2} - 1} (1 + \kappa^ {2} / \lambda) \gamma_ {T} \leq \mathcal {O} \left(\frac {C ^ {2}}{C ^ {2} - 1} \gamma_ {T}\right) +$$ + +![](images/0baf84e55f2213ffe63a88c52c0ef2236736563ae1281c22be57325c8186436c.jpg) + +# A.3. Proof of Lemma 4.2 + +The proof of this result follows directly from the sketch of proof in Section 4.1, combined with Corollary A.2 here in the appendix. + +# A.4. Proofs of Section 4.3 + +We indicate here how each original regret proofs can be modified to obtain Theorems 4.4 to 4.6. All proof will depend on a standard blueprint (Srinivas et al., 2010; Abbasi-Yadtori et al., 2011; Chowdhury & Gopalan, 2017; Calandriello et al., 2020) that we present first. For simplicity we also assume again that step $T$ is exactly at the end of batch $h$ . This is without loss of generality as we can always artificially truncate the current batch at step $T$ for the sake of the analysis without increasing the regret. (i.e., Corollary A.2 and all other results will still hold). + +First we leverage results from the original analyses to show that the instantaneous regret $r_{t_j + 1}$ at the beginning of batch $j$ is bounded (i.e., Equation 5) as + +$$ +r _ {t _ {j} + 1} \leq G _ {t _ {j}} \sigma_ {t _ {j}} (\mathbf {x} _ {t _ {j} + 1}). +$$ + +Moreover, the same candidate is selected at all steps in the batch, so it holds as well that for all $t' \in [t_j + 1, t_j + B_j]$ we have + +$$ +r _ {t ^ {\prime}} = r _ {t _ {j} + 1} \leq G _ {t _ {j}} \sigma_ {t _ {j}} (\mathbf {x} _ {t _ {j} + 1}) = G _ {t _ {j}} \sigma_ {t _ {j}} (\mathbf {x} _ {t ^ {\prime}}) +$$ + +Then, leveraging again Corollary A.2 to bound the posterior ratios we obtain + +$$ +\sum_ {s = t _ {j} + 1} ^ {t _ {j} + B _ {j}} r _ {s} \leq G _ {t _ {j}} \sum_ {s = t _ {j} + 1} ^ {t _ {j} + B _ {j}} \sigma_ {t _ {j}} (\mathbf {x} _ {s}) \overset {\text {C o r o l l a r y A . 2}} {\leq} G _ {t _ {j}} C \sum_ {s = t _ {j} + 1} ^ {t _ {j} + B _ {j}} \sigma_ {s - 1} (\mathbf {x} _ {s}). +$$ + +Finally, using the fact that $G_{t}$ is non-decreasing, and summing across batches + +$$ +\begin{array}{l} R _ {T} = \sum_ {t = 1} ^ {T} r _ {t} = \sum_ {j = 1} ^ {h} \sum_ {s = t _ {j} + 1} ^ {t _ {j} + B _ {j}} r _ {s} \\ \leq \sum_ {j = 1} ^ {h} G _ {t _ {j}} \sum_ {s = t _ {j} + 1} ^ {t _ {j} + B _ {j}} \sigma_ {t _ {j}} (\mathbf {x} _ {s}) \leq \sum_ {j = 1} ^ {h} G _ {t _ {j}} C \sum_ {s = t _ {j} + 1} ^ {t _ {j} + B _ {j}} \sigma_ {s - 1} (\mathbf {x} _ {s}) \\ \leq G _ {T} C \sum_ {j = 1} ^ {h} \sum_ {s = t _ {j} + 1} ^ {t _ {j} + B _ {j}} \sigma_ {s - 1} (\mathbf {x} _ {s}) \leq G _ {T} C \sum_ {s = 1} ^ {T} \sigma_ {s - 1} (\mathbf {x} _ {s}). \\ \end{array} +$$ + +Putting it all together and expressing everything in terms of $\gamma_T$ we derive + +$$ +\begin{array}{l} R _ {T} \leq G _ {T} C \sum_ {s = 1} ^ {T} \sigma_ {s - 1} (\mathbf {x} _ {s}) \\ \leq G _ {T} C \sqrt {T} \sqrt {\sum_ {s = 1} ^ {T} \sigma_ {s - 1} ^ {2} (\mathbf {x} _ {s})} \\ \leq G _ {T} C \sqrt {T} \sqrt {\left(1 + \frac {\kappa^ {2}}{\lambda}\right) \sum_ {s = 1} ^ {T} \sigma_ {s} ^ {2} \left(\mathbf {x} _ {s}\right)} \\ \stackrel {c} {\leq} G _ {T} C \sqrt {T} \sqrt {\left(1 + \frac {\kappa^ {2}}{\lambda}\right) \gamma_ {T}}, \\ \end{array} +$$ + +where $a$ is due to Cauchy-Schwarz inequality, $b$ due to Equation 7, and $c$ due to the usual bounding of posterior variances with the log det and information gain (Hazan et al., 2006). Now that we have this blueprint, all that is left is to look at results in the literature on how $G_{t}$ can be bounded under different assumptions and acquisition functions. + +
MINI-GP-UCBσ = 455.56, C = 1.1
MINI-GP-EIσ = 455.56, C = 1.1
BBKBσ = 277.78, C = 1.1
BKBσ = 455.56
GP-UCBσ = 500.00
GP-BUCBσ = 455.56, C = 1.1
ε-GREEDYa = 1, b = 0.5
+ +Table 1: Optimal hyper-parameters found for the NAS-bench experiment. + +Proof of Theorem 4.4. For this theorem we leverage the assumptions $\| f\| \leq F$ with $u_{t}^{\mathrm{MINI - GP - UCB}}$ as acquisition function. Already Theorem 1 from (Chowdhury & Gopalan, 2017) showed that if $\lambda = \xi^2$ and $\beta_{t}$ is tuned as $\beta_{t} = \Theta (\sqrt{\log\det(\mathbf{K}_{t} / \xi^{2} + \mathbf{I}) + \log(1 / \delta)} +F)$ we obtain that $G_{t}\leq \beta_{t}$ suffices to guarantee Equation 5. Note however that in our case we can efficiently compute $\log \operatorname *{det}(\mathbf{K}_t / \xi^2 +\mathbf{I})$ leveraging the few unique candidates. In particular, since we only need to compute $\beta_{t_h}$ at the beginning of a batch, we can rewrite + +$$ +\begin{array}{l} \log \det (\mathbf {K} _ {t} / \boldsymbol {\xi} ^ {2} + \mathbf {I}) = \log \det (\varphi (\mathbf {X} _ {t}) \varphi (\mathbf {X} _ {t}) ^ {\intercal} / \boldsymbol {\xi} ^ {2} + \mathbf {I}) \\ \stackrel {a} {=} \log \det (\varphi (\mathbf {X} _ {t}) ^ {\intercal} \varphi (\mathbf {X} _ {t}) / \xi^ {2} + \mathbf {I}) \\ \stackrel {b} {=} \log \det (\varphi (\mathbf {X} _ {h}) ^ {\top} \mathbf {W} _ {h} \varphi (\mathbf {X} _ {h}) / \xi^ {2} + \mathbf {I}) \\ \stackrel {c} {=} \log \det (\mathbf {W} _ {h} ^ {1 / 2} \varphi (\mathbf {X} _ {h}) ^ {\top} \varphi (\mathbf {X} _ {h}) \mathbf {W} _ {h} ^ {1 / 2} / \xi^ {2} + \mathbf {I}) \\ = \log \det (\mathbf {W} _ {h} ^ {1 / 2} \mathbf {K} _ {h} \mathbf {W} _ {h} ^ {1 / 2} / \xi^ {2} + \mathbf {I}), \\ \end{array} +$$ + +where $a$ is due to Sylvester's determinant identity, $b$ is our usual re-writing, and $c$ is Sylvester's determinant identity again. Not that since this a strict equality, we still have that at the last batch $h$ + +$$ +\log \det (\mathbf {W} _ {h} ^ {1 / 2} \mathbf {K} _ {h} \mathbf {W} _ {h} ^ {1 / 2} / \xi^ {2} + \mathbf {I}) = \log \det (\mathbf {K} _ {T} / \xi^ {2} + \mathbf {I}) \leq \gamma_ {T}, +$$ + +which gives the second half of the theorem. + +Proof of Theorem 4.5. This is a direct consequence of Theorem 1 from (Srinivas et al., 2010). In particular, they once again show that $G_{t} \leq \beta_{t}$ suffices to guarantee Equation 5. + +Proof of Theorem 4.6. For this combination our starting point is Equation (38) in (Wang & de Freitas, 2014), which states that for + +$$ +\nu_ {t} = \sqrt {\log \det (\mathbf {K} _ {t} / \lambda + \mathbf {I}) + \sqrt {\log \det (\mathbf {K} _ {t} / \lambda + \mathbf {I}) \log (t / \delta)} + \log (t / \delta)}, \quad \lambda = \xi^ {2}, +$$ + +running a standard GP-Opt loop (i.e., Algorithm 1) with $u_{t} = u_{t}^{\mathrm{GP - EI}}$ guarantees + +$$ +r _ {t} \leq \widetilde {\mathcal {O}} \left(\left(\sqrt {F ^ {2} + \gamma_ {t}} + \nu_ {t}\right) \sigma_ {t - 1} (\mathbf {x} _ {t})\right), +$$ + +where we greatly simplified their notation by ignoring constant and logarithmic terms. Noticing now that at each batch $j$ the values of $\beta_{j}$ and $\nu_{t_j}$ are equal thanks again to the equivalence $\log \det (\mathbf{K}_t / \lambda +\mathbf{I}) = \log \det (\mathbf{W}_h^{1 / 2}\mathbf{K}_h\mathbf{W}_h^{1 / 2} / \lambda +\mathbf{I})$ , we can obtain a bound on $G_{t}$ that satisfies Equation 5 as + +$$ +G _ {t} \leq \widetilde {\mathcal {O}} \left(\left(\sqrt {F ^ {2} + \gamma_ {t}} + \beta_ {t}\right)\right) \leq \widetilde {\mathcal {O}} \left(\left(\sqrt {F ^ {2} + \gamma_ {t}} + \sqrt {\gamma_ {t}}\right)\right) \leq \widetilde {\mathcal {O}} \left((F + \sqrt {\gamma_ {t}})\right). +$$ + +Putting this together with the usual blueprint to bound the error incurred by batching and the bound on the sum of posterior variances with $\gamma_T$ we obtain our result. + +# B. Extended experimental results + +We report here additional details on the NAS-bench experiments, as well as an evaluation on synthetic functions. + +![](images/f9a901e015faecefa983ae2f0ca7be94c78fa722f74d50f0ee81d1ac5c389584.jpg) + +![](images/ce3eab896a73f57e351382abfc57660e138bdaab63a4f8935a990c4b7c6dd8e1.jpg) +(a) Ellipsoid + +![](images/b0ae7855a77e451fd746f7f3550fa544b33e9ca92314681ef8ff2eb1714c3d24.jpg) + +![](images/cfdcbdcf24492a1b95d671647e0ed941efa193f75b96103174e6af61fae0c3bf.jpg) +(c) Rosenbrock +Figure 3: $R_{t} / t$ against step $t$ + +![](images/74564c7d7e744dda69945055dad6f81d87c657e77cf16227871259b76e421629.jpg) +(b) Rastigrin +(d) Schaffer + +# B.1. Additional details on NAS-bench experiments + +All the implementations are based on the code released by (Calandriello et al., 2020) for BBKB and BKB, available at https://github.com/luigicarratino/batch-bkb. For each algorithm we run the experiment 40 times with different seeds, and select the hyper-parameters that achieves the lowest average regret. Hyper-parameters for all algorithms based on GPs are searched among + +$$ +\sigma^ {2} = \{1 0 0. 0 0, 1 4 4. 4 5, 1 8 8. 8 9, 2 3 3. 3 3, 2 7 7. 7 8, 3 2 2. 2 2, 3 6 6. 6 7, 4 1 1. 1 1, 4 5 5. 5 6, 5 0 0. 0 0 \} +$$ + +$$ +C = \{1. 1, 1. 2 \} +$$ + +where $C$ is the threshold used for batching, and $\sigma$ is the bandwidth of the Gaussian kernel. For $\varepsilon$ -GREEDY the exploration rate is is optimized as $\varepsilon = a / t^b$ over $a \in \{0.1, 1, 10\}$ and $b \in \{1/3, 1/2, 1, 2\}$ . The empirically optimal values are reported in Table 1. + +# B.2. Evaluation on synthetic functions + +We also evaluate our method on common benchmark functions from the noisy BBOB benchmark suite (Hansen et al., 2010). In particular we focus on the Rosenbrock $(f_{104})$ , ellipsoid $(f_{116})$ , and Schaffer $(f_{122})$ functions, all with moderate Gaussian noise. We also include an extra function, the separable Rastigrin function, to add another more complex separable function with the ellipsoid. + +All functions are defined on $\mathbb{R}^3$ , with each coordinate split into 21 sections with the same length by 22 evenly spaced points placed between $[-5, 5]$ . The resulting discrete grid of points represent our candidate set and contains $|\mathcal{A}| = 22^3 = 10648$ + +unique candidates. Similarly to the NAS-bench experiments, $\sigma$ of the Gaussian kernel, $C$ and the $\varepsilon$ -GREEDY parameters are selected optimally over a grid search. + +The results on regret against steps are reported in Figures 3a to 3d and on regret against time in Figures 4a to 4d. As we can see, our approach achieves comparable runtime and regret to other state of the art GP-Opt methods. However, on more complex problems like the Rosenbreck function, even the flexibility of a GP is not capable of capturing the underlying shape of the optimization problem, and all GP-Opt methods, including ours, only perform roughly as well as a tuned $\varepsilon$ -GREEDY exploration. + +![](images/b11a828d74e3e9d9b10d35a9820aade7b141889f860e57522bfd480bdf3574b4.jpg) + +![](images/c907922b1faf572870d31ae37af56582bde9fcf72bb9d466f7a844b041e44db0.jpg) +(a) Ellipsoid + +![](images/79a53e1cbc97ed6dfdb024a10a1a48e22455cb418e2ce7277a2c18a4c81554fc.jpg) + +![](images/1ca1beed7db0bfd3d01cd1b900aad33fd6486c649de060a44d382ed133fb8d1a.jpg) +(c) Rosenbrock +Figure 4: $R_{t} / t$ against time (in seconds) + +![](images/6570f4a6090daba56adc78cd212824e91d93a1180dc3cc1eabfe9f817acb7e3e.jpg) +(b) Rastigrin +(d) Schaffer + +# References + +Elad Hazan, Adam Kalai, Satyen Kale, and Amit Agarwal. Logarithmic regret algorithms for online convex optimization. In Conference on Learning Theory. Springer, 2006. +Hansen, Nikolaus and Auger, Anne and Finck, Steffen and Ros, Raymond. Real-parameter black-box optimization benchmarking 2010: Experimental setup. INRIA, 2010. \ No newline at end of file diff --git a/scalinggaussianprocessoptimizationbyevaluatingafewuniquecandidatesmultipletimes/images.zip b/scalinggaussianprocessoptimizationbyevaluatingafewuniquecandidatesmultipletimes/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..6afb92bc1fcae332b1f86967fd9bc757f3da9847 --- /dev/null +++ b/scalinggaussianprocessoptimizationbyevaluatingafewuniquecandidatesmultipletimes/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ea1b83954bd2abca6fa0a3dc96fc4d197f0b11fd95ee3696374a9ba2999a3cdf +size 764101 diff --git a/scalinggaussianprocessoptimizationbyevaluatingafewuniquecandidatesmultipletimes/layout.json b/scalinggaussianprocessoptimizationbyevaluatingafewuniquecandidatesmultipletimes/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..f78d5d0a58cd8e926417157c9f7dc13d7d04bacf --- /dev/null +++ b/scalinggaussianprocessoptimizationbyevaluatingafewuniquecandidatesmultipletimes/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a9aa3c5214bcac9a10313f62018d8270574d96ec36388aa9e24220e4764fde45 +size 866558 diff --git a/scalingoutofdistributiondetectionforrealworldsettings/84e9d134-20f8-483b-b07e-e2271983e142_content_list.json b/scalingoutofdistributiondetectionforrealworldsettings/84e9d134-20f8-483b-b07e-e2271983e142_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..256cbbb0f826095bbb8bddd805e25b0a91acaea1 --- /dev/null +++ b/scalingoutofdistributiondetectionforrealworldsettings/84e9d134-20f8-483b-b07e-e2271983e142_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ac0ead48447723cacce7af0074babd46028a9df8c7aeae6d723fa37b8a3e8b2a +size 92908 diff --git a/scalingoutofdistributiondetectionforrealworldsettings/84e9d134-20f8-483b-b07e-e2271983e142_model.json b/scalingoutofdistributiondetectionforrealworldsettings/84e9d134-20f8-483b-b07e-e2271983e142_model.json new file mode 100644 index 0000000000000000000000000000000000000000..3f118da4a10a597c453721cc3cf08b0ece4d9e77 --- /dev/null +++ b/scalingoutofdistributiondetectionforrealworldsettings/84e9d134-20f8-483b-b07e-e2271983e142_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5709870639a55c2fe4b6d7191c1186b870cd1c9720a34af59b3dc0f2ab2c6d7b +size 111300 diff --git a/scalingoutofdistributiondetectionforrealworldsettings/84e9d134-20f8-483b-b07e-e2271983e142_origin.pdf b/scalingoutofdistributiondetectionforrealworldsettings/84e9d134-20f8-483b-b07e-e2271983e142_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c176fd6db1a217095239542171c907ef92591790 --- /dev/null +++ b/scalingoutofdistributiondetectionforrealworldsettings/84e9d134-20f8-483b-b07e-e2271983e142_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1ff8c17c557f2c6a18f2088a569c0d8057bcd5914f37587148e1cb0f143980cc +size 12147194 diff --git a/scalingoutofdistributiondetectionforrealworldsettings/full.md b/scalingoutofdistributiondetectionforrealworldsettings/full.md new file mode 100644 index 0000000000000000000000000000000000000000..ead290fcb10e1b2be8127774fb6249b02eafeefb --- /dev/null +++ b/scalingoutofdistributiondetectionforrealworldsettings/full.md @@ -0,0 +1,326 @@ +# Scaling Out-of-Distribution Detection for Real-World Settings + +Dan Hendrycks $^{*1}$ Steven Basart $^{*2}$ Mantas Mazeika $^{3}$ Andy Zou $^{1}$ Joe Kwon $^{4}$ Mohammadreza Mostajabi $^{5}$ Jacob Steinhardt $^{1}$ Dawn Song $^{1}$ + +# Abstract + +Detecting out-of-distribution examples is important for safety-critical machine learning applications such as detecting novel biological phenomena and self-driving cars. However, existing research mainly focuses on simple small-scale settings. To set the stage for more realistic out-of-distribution detection, we depart from small-scale settings and explore large-scale multiclass and multi-label settings with high-resolution images and thousands of classes. To make future work in real-world settings possible, we create new benchmarks for three large-scale settings. To test ImageNet multiclass anomaly detectors, we introduce the Species dataset containing over 700,000 images and over a thousand anomalous species. We leverage ImageNet-21K to evaluate PASCAL VOC and COCO multilabel anomaly detectors. Third, we introduce a new benchmark for anomaly segmentation by introducing a segmentation benchmark with road anomalies. We conduct extensive experiments in these more realistic settings for out-of-distribution detection and find that a surprisingly simple detector based on the maximum logit outperforms prior methods in all the large-scale multi-class, multi-label, and segmentation tasks, establishing a simple new baseline for future work. + +# 1. Introduction + +Out-of-distribution (OOD) detection is a valuable tool for developing safe and reliable machine learning (ML) systems. Detecting anomalous inputs allows systems to initiate a conservative fallback policy or defer to human judgment. As an important component of ML Safety (Hendrycks et al., 2021), OOD detection is important for safety-critical applications + +*Equal contribution ¹UC Berkeley ²UChicago ³UIUC ⁴Yale University ⁵TTIC. Correspondence to: Dan Hendrycks . + +Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s). + +such as self-driving cars and detecting novel microorganisms. Accordingly, research on out-of-distribution detection has a rich history spanning several decades (Scholkopf et al., 1999; Breunig et al., 2000; Emmott et al., 2015). Recent work leverages deep neural representations for out-of-distribution detection in complex domains, such as image data (Hendrycks & Gimpel, 2017; Lee et al., 2018a; Mohseni et al., 2020; Hendrycks et al., 2019b). However, these works still primarily use small-scale datasets with low-resolution images and few classes. As the community moves towards more realistic, large-scale settings, strong baselines and high-quality benchmarks are imperative for future progress. + +Large-scale datasets such as ImageNet (Deng et al., 2009) and Places365 (Zhou et al., 2017) present unique challenges not seen in small-scale settings, such as a plethora of fine-grained object classes. We demonstrate that the maximum softmax probability (MSP) detector, a state-of-the-art method for small-scale problems, does not scale well to these challenging conditions. Through extensive experiments, we identify a detector based on the maximum logit (MaxLogit) that greatly outperforms the MSP and other strong baselines in large-scale multi-class anomaly segmentation. To facilitate further research in this setting, we also collect a new out-of-distribution test dataset suitable for models trained on highly diverse datasets. Shown in Figure 2, our Species dataset contains diverse, anomalous species that do not overlap ImageNet-21K which has approximately twenty two thousand classes. Species avoids data leakage and enables a stricter evaluation methodology for ImageNet-21K models. Using Species to conduct more controlled experiments without train-test overlap, we find that contrary to prior claims (Fort et al., 2021; Koner et al., 2021), Vision Transformers (Dosovitskiy et al., 2021a) pre-trained on ImageNet-21K are not substantially better at out-of-distribution detection. + +Moreover, in the common real-world case of multi-label data, the MSP detector cannot naturally be applied in the first place, as it requires softmax probabilities. To enable research into the multi-label setting for anomaly detection, we contribute a multi-label experimental setup and explore various methods on large-scale multi-label datasets. We find that the MaxLogit detector from our investigation into the + +![](images/20c96006463ffc7be6acf0833004954b1f1d36780120c07b8324334ca84b7753.jpg) +Large Scale Multiclass + +![](images/74286ac2166c2050de910d14034f04cfcc8dc335f9b4af88bee5943082e5c0d5.jpg) +Large Scale Segmentation + +![](images/5573753cb2058bb3734bd0deccf9a7bb7005e3dbd12fe041d41f31ff40f91c1f.jpg) +Figure 1: We scale up out-of-distribution detection to large-scale multi-class datasets with thousands of classes, multi-label datasets with complex scenes, and anomaly segmentation in driving environments. We introduce new benchmarks for all three settings. In all of these settings, we find that an OOD detector based on the maximum logit outperforms previous methods, establishing a strong and versatile baseline for future work on large-scale OOD detection. The bottom-right shows a scene from our new anomaly segmentation benchmark and the predicted anomaly using a state-of-the-art detector. + +![](images/202fa670e07513d4fb9bc9f5adc25839d936a72b733d4c0da93402eba173effe.jpg) + +large-scale multi-class setting generalizes well to multi-label data and again outperforms all other baselines. + +In addition to focusing on small-scale datasets, most existing benchmarks for anomaly detection treat entire images as anomalies. In practice, an image could be anomalous in localized regions while being in-distribution elsewhere. Knowing which regions of an image are anomalous could allow for safer handling of unfamiliar objects in the case of self-driving cars. Creating a benchmark for this task is difficult, though, as simply cutting and pasting anomalous objects into images introduces various unnatural giveaway cues such as edge effects, mismatched orientation, and lighting, all of which trivialize the task of anomaly segmentation (Blum et al., 2019). + +To overcome these issues, we utilize a simulated driving environment to create the novel StreetHazards dataset for anomaly segmentation. Using the Unreal Engine and the open-source CARLA simulation environment (Dosovitskiy et al., 2017), we insert a diverse array of foreign objects into driving scenes and re-render the scenes with these novel objects. This enables integration of the foreign objects into their surrounding context with correct lighting and orientation, sidestepping giveaway cues. + +To complement the StreetHazards dataset, we convert the BDD100K semantic segmentation dataset (Yu et al., 2018) into an anomaly segmentation dataset, which we call BDD-Anomaly. By leveraging the large scale of BDD100K, we + +reserve infrequent object classes to be anomalies. We combine this dataset with StreetHazards to form the Combined Anomalous Object Segmentation (CAOS) benchmark. The CAOS benchmark improves over previous evaluations for anomaly segmentation in driving scenes by evaluating detectors on realistic and diverse anomalies. We evaluate several baselines on the CAOS benchmark and discuss problems with porting existing approaches from earlier formulations of out-of-distribution detection. + +Despite its simplicity, we find that the MaxLogit detector outperforms all baselines on Species, our multi-class benchmark, and CAOS. In each of these three settings, we discuss why MaxLogit provides superior performance, and we show that these gains are hidden if one looks at small-scale problems alone. The code for our experiments and the Species and CAOS datasets are available at github.com/hendrycks/anomaly-seg. Our new baseline combined with Species and CAOS benchmarks pave the way for future research on large-scale out-of-distribution detection. + +# 2. Related Work + +Multi-Class Out-of-Distribution Detection. A recent line of work leverages deep neural representations from multi-class classifiers to perform out-of-distribution (OOD) detection on high-dimensional data, including images, text, and speech data. Hendrycks & Gimpel (2017) formulate + +# Anomalous Species Dataset + +![](images/4540ae475ff7293a98d91b965828c6c02f7a2c0670a4be71bd79a1eac830df85.jpg) +Figure 2: The Species out-of-distribution dataset is designed for large-scale anomaly detectors pretrained on datasets as diverse as ImageNet-21K. When models are pretrained on ImageNet-21K, many previous OOD detection datasets may overlap with the pretraining set, resulting in erroneous evaluations. To rectify this, Species is comprised of hundreds of anomalous species that are disjoint from ImageNet-21K classes and enables the evaluation of cutting-edge models. + +the task and propose the simple baseline of using the maximum softmax probability of the classifier on an input to gauge whether the input is out-of-distribution. In particular, they formulate the task as distinguishing between examples from an in-distribution dataset and various OOD datasets. Importantly, entire images are treated as out-of-distribution. + +Continuing this line of work, Lee et al. (2018a) use generative adversarial networks to produce near-distribution examples and induce uniform posteriors on these synthetic OOD examples. Hendrycks et al. (2019b) observe that outliers are often easy to obtain in large quantities and that OOD detectors trained on these outliers generalize to unseen classes of anomalies. Other work investigates improving the anomaly detectors themselves given a fixed classifier (DeVries & Taylor, 2018; Liang et al., 2018). However, as Hendrycks et al. (2019b) observe, many of these works tune hyperparameters on a particular type of anomaly that is also seen at test time, so their evaluation setting is more lenient. In this paper, all anomalies seen at test time come from entirely unseen categories and are not tuned on in any way. Hence, we do not compare to techniques such as ODIN (Liang et al., 2018). Additionally, in a point of departure from most prior work, we focus primarily on large-scale images and datasets with many classes (Hendrycks & Dietterich, 2019; Roady et al., 2019). + +Recent work has suggested that stronger representations from Vision Transformers pre-trained on ImageNet-21K can make out-of-distribution detection trivial (Fort et al., 2021; + +Koner et al., 2021). They evaluate models on detecting CIFAR-10 when fine-tuned on CIFAR-100 or vice versa, using models pretrained on ImageNet-21K. However, over 1,000 classes in ImageNet-21K overlap with CIFAR-10, so it is still unclear how Vision Transformers perform at detecting entirely unseen OOD categories. We create a new OOD test dataset of anomalous species to investigate how well Vision Transformers perform in controlled OOD detection settings without data leakage and overlap. We find that Vision Transformers pre-trained on ImageNet-21K are far from solving OOD detection in large-scale settings. + +Anomaly Segmentation. Several prior works explore segmenting anomalous image regions. One line of work uses the WildDash dataset (Zendel et al., 2018), which contains numerous annotated driving scenes in conditions such as snow, fog, and rain. The WildDash test set contains fifteen "negative images" from different domains for which the goal is to mark the entire image as out-of-distribution. Thus, while the task is segmentation, the anomalies do not exist as objects within an otherwise in-distribution scene. This setting is similar to that explored by Hendrycks & Gimpel (2017), in which whole images from other datasets serve as out-of-distribution examples. + +To approach anomaly segmentation on WildDash, Krešo et al. (2018) train on multiple semantic segmentation domains and treat regions of images from the WildDash driving dataset as out-of-distribution if they are segmented as regions from different domains, i.e. indoor classes. Be- + +Scaling Out-of-Distribution Detection for Real-World Settings + +
DinFPR95 ↓AUROC ↑AUPR ↑
MSPDeVriesMaxLogitMSPDeVriesMaxLogitMSPDeVriesMaxLogit
ImageNet44.246.035.884.676.987.238.230.545.8
Places36552.685.836.676.031.185.88.22.019.2
+ +Table 1: Multi-class out-of-distribution detection results using the maximum softmax probability (MSP) baseline (Hendrycks & Gimpel, 2017), the confidence branch detector of DeVries & Taylor (2018), and our maximum logit baseline. All values are percentages and average across five out-of-distribution test datasets; full results are in the Appendix. + +vandić et al. (2018) use ILSVRC 2012 images and train their network to segment the entirety of these images as out-of-distribution. + +![](images/388a328f7eabc5134d89e8a522f7e06460369d69f14dc57efe92b9815b999642.jpg) + +![](images/46c8f8aa0d793df686659032079cd0f3e64cc244708bc8d870022a3c5fb31366.jpg) +Figure 3: Small-scale datasets such as CIFAR-10 have disjoint classes, but larger-scale datasets including ImageNet-1K have classes with high visual similarity. Thus, large-scale classifiers may disperse probability mass among several classes. If prediction confidence is used for OOD detection, then in-distribution images from fine-grained classes will often wrongly be deemed out-of-distribution. This motivates our MaxLogit out-of-distribution detector. + +In medical anomaly segmentation and product fault detec + +tion, anomalies are regions of images. Baur et al. (2019) segment anomalous regions in brain MRIs using pixel-wise reconstruction loss. Similarly, Haselmann et al. (2018) perform product fault detection using pixel-wise reconstruction loss and introduce an expansive dataset for segmentation of product faults. In these relatively simple domains, reconstruction-based approaches work well. In contrast to medical anomaly segmentation and fault detection, we consider complex images from street scenes. These images have high variability in scene layout and lighting, and hence are less amenable to reconstruction-based techniques. + +The two works closest to our own are the Lost and Found (Pinggera et al., 2016) and Fishyscapes (Blum et al., 2019) datasets. The Lost and Found dataset consists of real images in a driving environment with small road hazards. The images were collected to mirror the Cityscapes dataset (Cordts et al., 2016) but are only collected from one city and so have less diversity. The dataset contains 35 unique anomalous objects, and methods are allowed to train on many of these. For Lost and Found, only nine unique objects are truly unseen at test time. Crucially, this is a different evaluation setting from our own, where anomalous objects are not revealed at training time, so their dataset is not directly comparable. Nevertheless, the BDD-Anomaly dataset fills several gaps in Lost and Found. First, the images are more diverse, because they are sourced from a more recent and comprehensive semantic segmentation dataset. Second, the anomalies are not restricted to small, sparse road hazards. Concretely, anomalous regions in Lost and Found take up $0.11\%$ of the image on average, whereas anomalous regions in the BDD-Anomaly dataset are larger and fill $0.83\%$ of the image on average. Finally, although the BDD-Anomaly dataset treats three categories as anomalous, compared to Lost and Found it has far more unique anomalous objects. + +The Fishyscapes benchmark for anomaly segmentation consists of cut-and-paste anomalies from out-of-distribution domains. This is problematic, as the anomalies appear unnatural in context. For instance, the orientation and lighting of cut-and-paste patches does not blend in, providing an unnatural cue to anomaly detectors that would not exist for real anomalies. Figure 6 shows an example of these inconsistencies. Techniques for detecting image manipulation (Zhou et al., 2018; Johnson & Farid, 2005) are competent at detecting artificial image elements of this kind. Our Street- + +Scaling Out-of-Distribution Detection for Real-World Settings + +
DinTestDoutResNetViTMLP Mixer
MSPMaxLogitMSPMaxLogitMSPMaxLogit
ImageNet-21K-PAmphibians40.148.341.349.042.750.1
Arachnids45.654.644.855.047.157.2
Fish40.655.541.253.641.853.4
Fungi66.076.863.976.163.776.4
Insects46.854.947.652.847.852.1
Mammals45.050.047.647.548.146.3
Microorganisms76.382.469.381.072.784.9
Mollusks44.551.943.449.844.851.6
Plants68.475.865.772.967.273.9
Protozoa72.981.671.881.871.279.1
Mean54.663.253.761.954.762.5
+ +Table 2: Results on Species. Models and the processed version of ImageNet-21K (ImageNet-21K-P) are from (Ridnik et al., 2021a). All values are percent AUROC. Species enables evaluating anomaly detectors trained on ImageNet-21K and evades class overlap issues present in prior work. Using Species to conduct more controlled experiments without class overlap issues, we find that contrary to recent claims (Fort et al., 2021), simply scaling up Vision Transformers does not make OOD detection trivial. + +Hazards dataset overcomes these issues by leveraging a simulated driving environment to naturally insert anomalous 3D models into a scene rather than overlaying 2D images. These anomalies are integrated into the scene with proper lighting and orientation, mimicking real-world anomalies and making them significantly more difficult to detect. + +# 3. Multi-Class Prediction for OOD Detection + +Problem with existing baselines. Existing baselines for anomaly detection can work well in small-scale settings. However, in more realistic settings image classification networks are often tasked with distinguishing hundreds or thousands of classes, possibly with subtle differences. This is problematic for the maximum softmax probability (MSP) baseline (Hendrycks & Gimpel, 2017), which uses the negative maximum softmax probability as the anomaly score, or $-\max_k \exp f(x)_k / \sum_i \exp f(x)_i = -\max_k \hat{p}(y = k \mid x)$ , where $f(x)$ is the unnormalized logits of classifier $f$ on input $x$ . Classifiers tend to have higher confidence on in-distribution examples than out-of-distribution examples, enabling OOD detection. The MSP attains strong anomaly detection performance in small-scale settings. However, we show that the MSP is problematic for realistic in-distribution datasets with many classes, such as ImageNet and Places365 (Zhou et al., 2017). Probability mass can be dispersed among visually similar classes, as shown in Figure 3. Consequently, a classifier may produce a low confidence prediction for an in-distribution image, not because the image is unfamiliar, but because the object's exact class is difficult to determine. To circumvent this problem, we propose using the negative of the maximum unnormalized logit for an anomaly score $-\max_k f(x)_k$ , which we call MaxLogit. Since the logits are unnormalized, they are not affected by + +the number of classes and can serve as a better baseline for large-scale out-of-distribution detection. + +The Species Out-Of-Distribution Dataset. To enable controlled experiments and high-quality evaluations of anomaly detectors in large-scale settings, we create the Species dataset, a new out-of-distribution test dataset that has no overlapping classes with ImageNet-21K. Table 7 shows an overview of the Species dataset which is comprised of over 700,000 images scraped from the iNaturalist website and contains over a thousand anomalous species grouped into ten high-level categories: Amphibians, Arachnids, Fish, Fungi, Insects, Mammals, Microorganisms, Mollusks, Plants, and Protozoa. Example images from the Species dataset are in Figure 2. Despite its massive size, iNaturalist does not have images for over half of known species, so even models pretrained on the whole of iNaturalist will encounter anomalous species. + +Setup. To evaluate the MSP baseline out-of-distribution detector and the MaxLogit detector, we use ImageNet-21K as the in-distribution dataset $\mathcal{D}_{\mathrm{in}}$ . To obtain representations for anomaly detection, we use models trained on ImageNet-21K-P, a cleaned version of ImageNet-21K with a train/val split (Ridnik et al., 2021a). We evaluate a TResNet-M, ViT-B-16, and Mixer-B-16 (Ridnik et al., 2021b; Dosovitskiy et al., 2021b; Tolstikhin et al., 2021), and the validation split is used for obtaining in-distribution scores. For out-of-distribution test datasets $\mathcal{D}_{\mathrm{out}}$ , we use categories from the Species dataset, all of which are unseen during training. Results for these experiments are in Table 2. We also use ImageNet-1K and Places365 as in-distribution datasets $\mathcal{D}_{\mathrm{in}}$ for which we use pretrained ResNet-50 models and use several out-of-distribution test datasets $\mathcal{D}_{\mathrm{out}}$ . Full results with ImageNet and Places365 are in the Appendix. + +Scaling Out-of-Distribution Detection for Real-World Settings + +
iForestLOFDropoutLogitAvgMSPMaxLogit
PASCAL VOCFPR95 ↓98.684.097.298.282.335.6
AUROC ↑46.368.449.247.974.290.9
AUPR ↑37.158.445.341.365.581.2
COCOFPR95 ↓95.678.493.394.581.840.4
AUROC ↑41.470.258.055.570.790.3
AUPR ↑63.782.076.374.082.994.0
+ +Table 3: Multi-label out-of-distribution detection comparison of the Isolation Forest (iForest), Local Outlier Factor (LOF), Dropout, logit average, maximum softmax probability, and maximum logit anomaly detectors on PASCAL VOC and MS-COCO. The same network architecture is used for all three detectors. All results shown are percentages. + +Metrics. To evaluate out-of-distribution detectors in large-scale settings, we use three standard metrics of detection performance: area under the ROC curve (AUROC), false positive rate at $95\%$ recall (FPR95), and area under the precision-recall curve (AUPR). The AUROC and AUPR are important metrics, because they give a holistic measure of performance when the cutoff for detecting anomalies is not a priori obvious or when we want to represent the performance of a detection method across several different cutoffs. + +The AUROC can be thought of as the probability that an anomalous example is given a higher score than an ordinary example. Thus, a higher score is better, and an uninformative detector has a AUROC of $50\%$ . AUPR provides a metric more attuned to class imbalances, which is relevant in anomaly and failure detection, when the number of anomalies or failures may be relatively small. Last, the FPR95 metric consists of measuring the false positive rate at $95\%$ . Since these measures are correlated, we occasionally solely present the AUROC for brevity and to preserve space. + +Results. Results on Species are shown in Table 2. Results with ImageNet-1K and Places365 as in-distribution datasets are in Table 1. The proposed MaxLogit method outperforms the maximum softmax probability baseline on all out-of-distribution test datasets $\mathcal{D}_{\mathrm{out}}$ . This holds true for all three models trained on ImageNet-21K. The MSP baseline is not much better than random and is has similar performance for all three model classes. This suggests that contrary to recent claims (Fort et al., 2021), simply scaling up Vision Transformers does not make OOD detection trivial. + +# 4. Multi-Label Prediction for OOD Detection + +Current work on out-of-distribution detection primarily considers multi-class or unsupervised settings. Yet as classifiers become more useful in realistic settings, the multi-label formulation becomes increasingly natural. To investigate out-of-distribution detection in multi-label settings, we provide a baseline and evaluation setup. + +Setup. We use PASCAL VOC (Everingham et al., 2009) and MS-COCO (Lin et al., 2014) as in-distribution data. To + +evaluate anomaly detectors, we use 20 out-of-distribution classes from ImageNet-21K. These classes have no overlap with ImageNet-1K, PASCAL VOC, or MS-COCO. The 20 classes are chosen not to overlap with ImageNet-1K since the multi-label classifiers are pre-trained on ImageNet-1K. We list the class WordNet IDs in the Appendix. + +Methods. We use a ResNet-101 backbone architecture pre-trained on ImageNet-1K. We replace the final layer with 2 fully connected layers and apply the logistic sigmoid function for multi-label prediction. During training we freeze the batch normalization parameters due to an insufficient number of images for proper mean and variance estimation. We train each model for 50 epochs using the Adam optimizer (Kingma & Ba, 2014) with hyperparameter values $10^{-4}$ and $10^{-5}$ for $\beta_{1}$ and $\beta_{2}$ respectively. For data augmentation we use standard resizing, random crops, and random flips to obtain images of size $256 \times 256 \times 3$ . As a result of this training procedure, the mAP of the ResNet-101 on PASCAL VOC is $89.11\%$ and $72.0\%$ for MS-COCO. + +As there has been little work on out-of-distribution detection in multilabel settings, we include comparisons to classic anomaly detectors for general settings. Isolation Forest, denoted by iForest, works by randomly partitioning the space into half spaces to form a decision tree. The score is determined by how close a point is to the root of the tree. The local outlier factor (LOF) (Breunig et al., 2000) computes a local density ratio between every element and its neighbors. We set the number of neighbors as 20. iForest and LOF are both computed on features from the penultimate layer of the networks. MSP denotes an unnatural application of the maximum softmax probability detector in the multi-label setting, obtained by naively computing the softmax of the logits. Alternatively, one can average the logit values, denoted by LogitAvg. These serve as our baseline detectors for multi-label OOD detection. We compare these baselines to the MaxLogit detector that we introduce in Section 3. Note that in the multi-label setting, the MaxLogit detector is equivalent to taking the maximum over all sigmoids, although not in the multiclass setting. As in the multi-class case, the MaxLogit anomaly score for multi-label classification is $-\max_{i}f(x)_{i}$ . + +Results. Results are shown in Table 3. We find that MaxLogit obtains the highest performance in all cases. MaxLogit bears similarity to the MSP baseline (Hendrycks & Gimpel, 2017) but is a natural fit for multi-label problems assuming at least one class is present in in-distribution images. While this may not hold for all multi-label distributions, it often holds in practice, motivating our application of MaxLogit. Our results establish the MaxLogit as an effective baseline for large-scale multi-label problems. Further, the evaluation setup enables future work in out-of-distribution detection with multi-label datasets. + +# 5. The CAOS Benchmark + +The Combined Anomalous Object Segmentation (CAOS) benchmark is comprised of two complementary datasets for evaluating anomaly segmentation systems on diverse, realistic anomalies. First is the StreetHazards dataset, which leverages simulation to provide a large variety of anomalous objects realistically inserted into driving scenes. Second is the BDD-Anomaly dataset, which contains real images from the BDD100K dataset (Yu et al., 2018). StreetHazards contains a highly diverse array of anomalies; BDD-Anomaly contains anomalies in real-world images. Together, these datasets allow researchers to judge techniques on their ability to segment diverse anomalies as well as anomalies in real images. All images have $720 \times 1280$ resolution. + +The StreetHazards Dataset. StreetHazards is an anomaly segmentation dataset that leverages simulation to provide diverse, realistically-inserted anomalous objects. To create the StreetHazards dataset, we use the Unreal Engine along with the CARLA simulation environment (Dosovitskiy et al., 2017). From several months of development and testing including customization of the Unreal Engine and CARLA, we can insert foreign entities into a scene while having them be properly integrated. Unlike previous work, this avoids the issues of inconsistent chromatic aberration, inconsistent lighting, edge effects, and other simple cues that an object is anomalous. Additionally, using a simulated environment allows us to dynamically insert diverse anomalous objects in any location and have them render properly with changes to lighting and weather including time of day, cloudy skies, and rain. + +We use 3 towns from CARLA for training, from which we collect RGB images and their respective semantic segmentation maps to serve as training data for semantic segmentation models. We generate a validation set from the fourth town. Finally, we reserve the fifth and sixth town as our test set. We insert anomalies taken from the Digimation Model Bank Library and semantic ShapeNet (ShapeNet-Sem) (Savva et al., 2015) into the test set in order to evaluate methods for out-of-distribution detection. In total, we use 250 unique anomaly models of diverse types. There are 12 + +![](images/5c415cc613e44b9cbd14ad5d58af52151c34ed5f9ac5947bfb3f4e90761541a5.jpg) +Figure 4: Anomalous scenes from StreetHazards with predicted anomaly scores thresholded to the top $10\%$ of values for visualization. GT is ground truth, the autoencoder model is based on the spatial autoencoder used in Baur et al. (2019), MSP is the prediction confidence, and MaxLogit is the method we propose as a new baseline for large-scale settings. The MaxLogit detector places lower scores on indistribution image regions, including object outlines, while also doing a better job of highlighting anomalies. + +classes used for training: background, road, street lines, traffic signs, sidewalk, pedestrian, vehicle, building, wall, pole, fence, and vegetation. The thirteenth class is the anomaly class that is only used at test time. We collect 5,125 image and semantic segmentation ground truth pairs for training, 1,031 pairs without anomalies for validation, and 1,500 test pairs with anomalies. + +The BDD-Anomaly Dataset. BDD-Anomaly is an anomaly segmentation dataset with real images in diverse conditions. We source BDD-Anomaly from BDD100K (Yu et al., 2018), a large-scale semantic segmentation dataset with diverse driving conditions. The original data consists in 7,000 images for training and 1,000 for validation. There are 18 original classes. We choose motorcycle, train, and bicycle as the anomalous object classes and remove all images with these objects from the training and validation sets. This yields 6,280 training pairs, 910 validation pairs without anomalies, and 810 testing pairs with anomalous objects. + +Scaling Out-of-Distribution Detection for Real-World Settings + +
MSPBranchBackgroundDropoutAEMaxLogit
StreetHazardsFPR95 ↓33.768.469.079.491.726.5
AUROC ↑87.765.758.669.966.189.3
AUPR ↑6.61.54.57.52.210.6
BDD-AnomalyFPR95 ↓24.525.640.116.674.114.0
AUROC ↑87.785.669.790.864.092.6
AUPR ↑3.73.91.14.30.75.4
+ +Table 4: Results on the CAOS benchmark. AUPR is low across the board due to the large class imbalance, but all methods perform substantially better than chance. MaxLogit obtains the best performance. All results are percentages. + +# 5.1. Experiments + +Evaluation. In anomaly segmentation experiments, each pixel is treated as a prediction, resulting in many predictions to evaluate. To fit these in memory, we compute the metrics on each image and average over the images to obtain final values. + +Methods. Our first baseline is pixel-wise Maximum Softmax Probability (MSP). Introduced by Hendrycks & Gimpel (2017) for multi-class out-of-distribution detection, we directly port this baseline to anomaly segmentation. Alternatively, the background class might serve as an anomaly detector, because it contains everything not in the other classes. To test this hypothesis, "Background" uses the posterior probability of the background class as the anomaly score. The Dropout method leverages MC Dropout (Gal & Ghahramani, 2016) to obtain an epistemic uncertainty estimate. Following Kendall et al. (2015), we compute the pixel-wise posterior variance over multiple dropout masks and average across all classes, which serves as the anomaly score. We also experiment with an autoencoder baseline similar to Baur et al. (2019); Haselmann et al. (2018) where pixel-wise reconstruction loss is used as the anomaly score. This method is called AE. The "Branch" method is a direct port of the confidence branch detector from DeVries & Taylor (2018) to pixel-wise prediction. Finally, we use the MaxLogit method described in earlier sections independently on each pixel. + +For all of the baselines except the autoencoder, we train a PSPNet (Zhao et al., 2017) decoder with a ResNet-101 encoder (He et al., 2015) for 20 epochs. We train both the encoder and decoder using SGD with momentum of 0.9, a learning rate of $2 \times 10^{-2}$ , and learning rate decay of $10^{-4}$ . For AE, we use a 4-layer U-Net (Ronneberger et al., 2015) with a spatial latent code as in Baur et al. (2019). The U-Net also uses batch norm and is trained for 10 epochs. Results are in Table 4. + +Results and Analysis. Of the baselines we tested, MaxLogit performs best. The intuitive baseline of using the posterior for the background class to detect anomalies performs poorly, which suggests that the background class may not align with rare visual features. Even though reconstruction-based scores succeed in product fault seg + +mentation, we find that the AE method performs poorly on the CAOS benchmark, which may be due to the more complex domain. AUPR for all methods is low, indicating that the large class imbalance presents a serious challenge. However, the substantial improvements with the MaxLogit method suggest that progress on this task is possible and there is much room for improvement. A comparison with other datasets is in Table 6 (Pinggera et al., 2016; Blum et al., 2019; Jung et al., 2021). + +In Figure 4, we see that both MaxLogit and MSP have many false positives, as they assign high anomaly scores to semantic boundaries, a problem also observed in the recent works of (Blum et al., 2019; Angus, 2019). However, the problem is less severe with MaxLogit. A potential explanation for this is that even when the prediction confidence dips at semantic boundaries, the maximum logit can remain the same in a 'hand-off' procedure between the classes. Thus, MaxLogit provides a natural mechanism to combat semantic boundary artifacts that could be explored in future work. + +# 6. Conclusion + +We scaled out-of-distribution detection to settings with thousands of classes and high-resolution images. We identified an issue faced by the MSP baseline and proposed the maximum logit detector as a natural solution. We introduced the Species dataset to enable more controlled experiments without class overlap and also investigated using multi-label classifiers for OOD detection, establishing an experimental setup for this previously unexplored setting. Finally, we introduced the CAOS benchmark for anomaly segmentation, consisting of diverse, naturally-integrated anomalous objects in driving scenes. Baseline methods on the CAOS benchmark substantially improve on random guessing but are still lacking, indicating potential for future work. Interestingly, the MaxLogit detector also provides consistent and significant gains in the multi-label and anomaly segmentation settings, thereby establishing it as a new baseline in place of the maximum softmax probability baseline on large-scale OOD detection problems. In all, we hope that our contributions will enable further research on out-of-distribution detection for real-world safety-critical environments. + +# References + +Angus, M. Towards pixel-level ood detection for semantic segmentation, 2019. +Baur, C., Wiestler, B., Albarqouni, S., and Navab, N. Deep autoencoding models for unsupervised anomaly segmentation in brain mr images. Lecture Notes in Computer Science, pp. 161-169, 2019. ISSN 1611-3349. doi: 10.1007/978-3-030-11723-8_16. +Bevandić, P., Krešo, I., Oršić, M., and Šegvic, S. Discriminative out-of-distribution detection for semantic segmentation, 2018. +Blum, H., Sarlin, P.-E., Nieto, J., Siegwart, R., and Cadena, C. The fishyscapes benchmark: Measuring blind spots in semantic segmentation, 2019. +Breunig, M. M., Kriegel, H.-P., Ng, R. T., and Sander, J. Lof: identifying density-based local outliers. In ACM sigmoid record, volume 29, pp. 93-104. ACM, 2000. +Cimpoi, M., Maji, S., Kokkinos, I., Mohamed, S., and Vedaldi, A. Describing textures in the wild. In Computer Vision and Pattern Recognition, 2014. +Cordts, M., Omran, M., Ramos, S., Rehfeld, T., Enzweiler, M., Benenson, R., Franke, U., Roth, S., and Schiele, B. The cityscapes dataset for semantic urban scene understanding. In Proc. of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016. +Deng, J., Dong, W., Socher, R., Li, L.-J., Li, K., and Fei-Fei, L. ImageNet: A Large-Scale Hierarchical Image Database. In CVPR09, 2009. +DeVries, T. and Taylor, G. W. Learning confidence for out-of-distribution detection in neural networks. arXiv preprint arXiv:1802.04865, 2018. +Dosovitskiy, A., Ros, G., Codevilla, F., Lopez, A., and Koltun, V. CARLA: An open urban driving simulator. In Proceedings of the 1st Annual Conference on Robot Learning, pp. 1-16, 2017. +Dosovitskiy, A., Beyer, L., Kolesnikov, A., Weissenborn, D., Zhai, X., Unterthiner, T., Dehghani, M., Minderer, M., Heigold, G., Gelly, S., Uszkoreit, J., and Houlsby, N. An image is worth 16x16 words: Transformers for image recognition at scale. ArXiv, abs/2010.11929, 2021a. +Dosovitskiy, A., Beyer, L., Kolesnikov, A., Weissenborn, D., Zhai, X., Unterthiner, T., Dehghani, M., Minderer, M., Heigold, G., Gelly, S., Uszkoreit, J., and Houlsby, N. An image is worth 16x16 words: Transformers for image recognition at scale. In International Conference on Learning Representations, 2021b. + +Emmott, A., Das, S., Dietterich, T., Fern, A., and Wong, W.-K. A meta-analysis of the anomaly detection problem, 2015. +Everingham, M., Gool, L. V., Williams, C. K. I., Winn, J. M., and Zisserman, A. The Pascal visual object classes (voc) challenge. International Journal of Computer Vision, 88: 303-338, 2009. +Fort, S., Ren, J., and Lakshminarayanan, B. Exploring the limits of out-of-distribution detection. NeurIPS, 2021. +Gal, Y. and Ghahramani, Z. Dropout as a bayesian approximation: Representing model uncertainty in deep learning. International Conference on Machine Learning, 2016. +Haselmann, M., Gruber, D. P., and Tabatabai, P. Anomaly detection using deep learning based image completion. In 2018 17th IEEE International Conference on Machine Learning and Applications (ICMLA), pp. 1237-1242. IEEE, 2018. +He, K., Zhang, X., Ren, S., and Sun, J. Deep residual learning for image recognition. CVPR, 2015. +He, T., Zhang, Z., Zhang, H., Zhang, Z., Xie, J., and Li, M. Bag of tricks for image classification with convolutional neural networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 558-567, 2019. +Hendrycks, D. and Dietterich, T. Benchmarking neural network robustness to common corruptions and perturbations. In International Conference on Learning Representations, 2019. +Hendrycks, D. and Gimpel, K. A baseline for detecting misclassified and out-of-distribution examples in neural networks. *ICLR*, 2017. +Hendrycks, D., Mazeika, M., and Dietterich, T. Deep anomaly detection with outlier exposure. Proceedings of the International Conference on Learning Representations, 2019a. +Hendrycks, D., Mazeika, M., and Dietterich, T. Deep anomaly detection with outlier exposure. In International Conference on Learning Representations, 2019b. +Hendrycks, D., Mazeika, M., Kadavath, S., and Song, D. Using self-supervised learning can improve model robustness and uncertainty. In NeurIPS, 2019c. +Hendrycks, D., Carlini, N., Schulman, J., and Steinhardt, J. Unsolved problems in ml safety. *ArXiv*, abs/2109.13916, 2021. + +Johnson, M. K. and Farid, H. Exposing digital forgeries by detecting inconsistencies in lighting. In Proceedings of the 7th workshop on Multimedia and security, pp. 1-10, 2005. +Jung, S., Lee, J., Gwak, D., Choi, S., and Choo, J. Standardized max logits: A simple yet effective approach for identifying unexpected road obstacles in urban-scene segmentation. *ArXiv*, abs/2107.11264, 2021. +Kendall, A., Badrinarayanan, V., and Cipolla, R. Bayesian segnet: Model uncertainty in deep convolutional encoder-decoder architectures for scene understanding. ArXiv, abs/1511.02680, 2015. +Kingma, D. P. and Ba, J. Adam: A method for stochastic optimization. *ICLR*, 2014. +Koner, R., Sinhamahapatra, P., Roscher, K., Gunnemann, S., and Tresp, V. Oodformer: Out-of-distribution detection transformer. ArXiv, 2021. +Krešo, I., Oršić, M., Bevandić, P., and Šegvic, S. Robust semantic segmentation with ladder-densenet models, 2018. +Lee, K., Lee, H., Lee, K., and Shin, J. Training confidence-calibrated classifiers for detecting out-of-distribution samples. International Conference on Learning Representations, 2018a. +Lee, K., Lee, K., Lee, H., and Shin, J. A simple unified framework for detecting out-of-distribution samples and adversarial attacks. ArXiv, abs/1807.03888, 2018b. +Lee, K., Lee, K., Lee, H., and Shin, J. A simple unified framework for detecting out-of-distribution samples and adversarial attacks. Advances in neural information processing systems, 31, 2018c. +Liang, S., Li, Y., and Srikant, R. Enhancing the reliability of out-of-distribution image detection in neural networks. International Conference on Learning Representations, 2018. +Lin, T.-Y., Maire, M., Belongie, S., Bourdev, L., Girshick, R., Hays, J., Perona, P., Ramanan, D., Zitnick, C. L., and Dollar, P. Microsoft COCO: Common objects in context. ECCV, 2014. +Liu, W., Wang, X., Owens, J., and Li, Y. Energy-based out-of-distribution detection. Advances in Neural Information Processing Systems, 33:21464-21475, 2020. +Mohseni, S., Pitale, M., Yadawa, J., and Wang, Z. Self-supervised learning for generalizable out-of-distribution detection. In AAAI, 2020. + +Pinggera, P., Ramos, S., Gehrig, S. K., Franke, U., Rother, C., and Mester, R. Lost and found: Detecting small road hazards for self-driving vehicles. 2016 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), pp. 1099-1106, 2016. +Ridnik, T., Ben-Baruch, E., Noy, A., and Zelnik-Manor, L. Imagenet-21k pretraining for the masses. *ArXiv*, abs/2104.10972, 2021a. +Ridnik, T., Lawen, H., Noy, A., Ben Baruch, E., Sharir, G., and Friedman, I. Tresnet: High performance gpudedicated architecture. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pp. 1400-1409, 2021b. +Roady, R., Hayes, T. L., Kemker, R., Gonzales, A., and Kanan, C. Are out-of-distribution detection methods effective on large-scale datasets? ArXiv, abs/1910.14034, 2019. +Ronneberger, O., Fischer, P., and Brox, T. U-net: Convolutional networks for biomedical image segmentation. Medical Image Computing and Computer-Assisted Intervention - MICCAI 2015, pp. 234-241, 2015. ISSN 1611-3349. doi: 10.1007/978-3-319-24574-4_28. +Savva, M., Chang, A. X., and Hanrahan, P. Semantically-Enriched 3D Models for Common-sense Knowledge. CVPR 2015 Workshop on Functionality, Physics, Intentionality and Causality, 2015. +Schölkopf, B., Williamson, R., Smola, A., Shawe-Taylor, J., and Platt, J. Support vector method for novelty detection. In Proceedings of the 12th International Conference on Neural Information Processing Systems, NIPS'99, pp. 582-588, Cambridge, MA, USA, 1999. MIT Press. +Tolstikhin, I., Houlsby, N., Kolesnikov, A., Beyer, L., Zhai, X., Unterthiner, T., Yung, J., Keysers, D., Uszkoreit, J., Lucic, M., et al. Mlp-mixer: An all-mlx architecture for vision. arXiv preprint arXiv:2105.01601, 2021. +Yu, F., Zhang, Y., Song, S., Seff, A., and Xiao, J. LSUN: construction of a large-scale image dataset using deep learning with humans in the loop. CoRR, 2015. +Yu, F., Xian, W., Chen, Y., Liu, F., Liao, M., Madhavan, V., and Darrell, T. BDD100K: A diverse driving video database with scalable annotation tooling. CoRR, abs/1805.04687, 2018. +Zendel, O., Honauer, K., Murschitz, M., Steininger, D., and Fernandez Dominguez, G. Wilddash-creating hazard-aware benchmarks. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 402-416, 2018. + +Zhao, H., Shi, J., Qi, X., Wang, X., and Jia, J. Pyramid scene parsing network. 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 6230-6239, 2017. +Zhou, B., Lapedriza, A., Khosla, A., Oliva, A., and Torralba, A. Places: A 10 million image database for scene recognition. PAMI, 2017. +Zhou, P., Han, X., Morariu, V. I., and Davis, L. S. Learning rich features for image manipulation detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1053-1061, 2018. + +# A. Full Multiclass OOD Detection Results + +Datasets. To evaluate the MSP baseline out-of-distribution detector and the MaxLogit detector, we use the ImageNet-1K object recognition dataset and Places365 scene recognition dataset as in-distribution datasets $\mathcal{D}_{\mathrm{in}}$ . We use several out-of-distribution test datasets $\mathcal{D}_{\mathrm{out}}$ , all of which are unseen during training. The first out-of-distribution dataset is Gaussian noise, where each example's pixels are i.i.d. sampled from $\mathcal{N}(0,0.5)$ and clipped to be contained within $[-1,1]$ . Another type of test-time noise is Rademacher noise, in which each pixel is i.i.d. sampled from $2 \cdot$ Bernoulli $(0.5) - 1$ , i.e. each pixel is 1 or $-1$ with equal probability. Blob examples are more structured than noise; they are algorithmically generated blob images. Meanwhile, Textures is a dataset consisting in images of describable textures (Cimpoi et al., 2014). When evaluating the ImageNet-1K detector, we use LSUN images, a scene recognition dataset (Yu et al., 2015). Our final $\mathcal{D}_{\mathrm{out}}$ is Places69, a scene classification dataset that does not share classes with Places365. In all, we evaluate against out-of-distribution examples spanning synthetic and realistic images. + +KL Matching Method. To verify our intuitions that led us to develop the MaxLogit detector, we developed a less convenient but similarly powerful technique applicable for the multiclass setting. Recall that some classes tend to be predicted with low confidence and others high confidence. The shape of predicted posterior distributions is often class dependent. + +We capture the typical shape of each class's posterior distribution and form posterior distribution templates for each class. During test time, the network's softmax posterior distribution is compared to these templates and an anomaly score is generated. More concretely, we compute $k$ different distributions $d_{k}$ , one for each class. We write $d_{k} = \mathbb{E}_{x^{\prime}}\sim \mathcal{X}_{\mathrm{val}}[p(y|x^{\prime})]$ where $k = \operatorname{argmax}_k p(y = k \mid x')$ . Then for a new test input $x$ , we calculate the anomaly score $\min_k \mathrm{KL}[p(y \mid x) \| d_k]$ rather than the MSP baseline $-\max_k p(y = k \mid x)$ . Note that we utilize the validation dataset, but our KL matching method does not require the validation dataset's labels. That said, our KL matching method is less convenient than our MaxLogit technique, and the two perform similarly. Since this technique requires more data than MaxLogit, we opt to simply use the MaxLogit in the main paper. + +Results. Observe that the proposed MaxLogit method outperforms the maximum softmax probability baseline for all three metrics on both ImageNet and Places365. These results were computed using a ResNet-50 trained on either ImageNet-1K or Places365. In the case of Places365, the AUROC improvement is over $10\%$ . We note that the + +Scaling Out-of-Distribution Detection for Real-World Settings + +
DinDtestoutFPR95 ↓AUROC ↑AUPR ↑
BMDKBMDKBMDK
ImageNetGaussian2054100100979893985579
Rademacher2144158998989329706254
Blobs2632728807937992517793
Textures685674598087768525361648
LSUN666359607577767921221938
Places365645963727983797927322446
Places365Mean41.335.84636.185.287.276.988.73745.830.559.7
Gaussian1067112939635931624216
Rademacher20109118993101001115.91.688
Blobs596882772981593541231
Textures8672877465794379411112
Places6988899291616452655636
Mean5336.685.840.97685.831.185.8819.2230.5
+ +Table 5: B is for the maximum softmax probability baseline, M is for maximum logit, D is for the method in (DeVries & Taylor, 2018), and K is our own KL method described below. Both M and K are ours. Results are on ImageNet and Places365. All values are percentages and are rounded so that 99.95 rounds to 100. + +utility of the maximum logit could not be appreciated as easily in previous work's small-scale settings. For example, using the small-scale CIFAR-10 setup of Hendrycks et al. (Hendrycks et al., 2019a), the MSP attains an average AUROC of $90.08\%$ while the maximum logit attains $90.22\%$ , a minor $0.14\%$ difference. However, in a large-scale setting, the difference can be over $10\%$ on individual $\mathcal{D}_{\mathrm{out}}$ datasets. We are not claiming that utilizing the maximum logit is a mathematically innovative formulation, only that it serves as a consistently powerful baseline for large-scale settings that went unappreciated in small-scale settings. In consequence, we suggest using the maximum logit as a new baseline for large-scale multi-class out-of-distribution detection. + +Overview of Other Detection Methods. There are other techniques in out-of-distribution detection which require other assumptions such as more training data. For instance, (Hendrycks et al., 2019a; Mohseni et al., 2020) use additional training data labeled as out-of-distribution, and the MaxLogit technique can be naturally extended should such data be available. (Hendrycks et al., 2019c) use rotation prediction and self-supervised learning, but we found that scaling this to the ImageNet multiclass setting did not produce strong results. The MSP baseline trained with auxiliary rotation prediction has an AUROC of $59.1\%$ , and with MaxLogit it attains a $73.6\%$ AUROC, over a $10\%$ absolute improvement with MaxLogit. Nonetheless this technique did not straightforwardly scale, as the network is better without auxiliary rotation prediction. Likewise, (Lee et al., 2018b) propose to use Mahalanobis distances, but in scaling this to 1000 classes, we consistently encountered NaN errors due to high condition numbers. This shows the importance of ensuring that out-of-distribution techniques can scale. + +ODIN (Liang et al., 2018) assumes that, for each OOD example source, we can tune hyperparameters for detection. For this reason we do not evaluate with ODIN in the rest of the paper. However, for thoroughness, we evaluate it here. ODIN uses temperature scaling and adds an epsilon perturbation to the input in order to separate the softmax posteriors between in- and out-of-distribution images; we set these hyperparameters following (DeVries & Taylor, 2018). Then, MaxLogit combined with ODIN results in an FPR95 of 33.6, an AUROC of 88.8 and an AUPR of 51.3 on ImageNet. On Places365, the FPR95 is 35.3, the AUROC is 86.5, and the AUPR is 24.2. Consequently, techniques built with different assumptions can integrate well with MaxLogit. We do not train ImageNet-21K models from scratch with these methods due to limited compute. + +For multi-label classification experiments, we choose the following classes from ImageNet-21K to serve as out-of-distribution data: dolphin (n02069412), deer (n02431122), bat (n02139199), rhino (n02392434), raccoon (n02508213), octopus (n01970164), giant clam (n01959492), leech (n01937909), Venus flytrap (n12782915), cherry tree (n12641413), Japanese cherry blossoms (n12649317), red wood (n12285512), sunflower (n11978713), croissant (n07691650), stick cinnamon (n07814390), cotton (n12176953), rice (n12126084), sugar cane (n12132956), bamboo (n12147226), and tumeric (n12356395). These classes were hand-chosen so that they are distinct from VOC and COCO classes. + +Additional Results on Species. In addition to the results on Species in Table 2, we also evaluate additional baselines: energy-based OOD detection (Liu et al., 2020) and Mahalanobis distance (Lee et al., 2018c). The AUROC scores for + +![](images/643be207c847e4b22afb194a6e01cacab92d6d851a8fb3fe37a98cb57a8d5c47.jpg) +Figure 5: Additional anomalous scenes from StreetHazards with predicted anomaly scores. Anomaly scores are thresholded to the top $10\%$ of values for visualization. GT is ground truth, the autoencoder model is based on the spatial autoencoder used in (Baur et al., 2019), MSP is the maximum softmax probability baseline (Hendrycks & Gimpel, 2017), and MaxLogit is the method we propose as a new baseline for large-scale settings. The MaxLogit detector places lower scores on in-distribution image regions, including object outlines, while also doing a better job of highlighting anomalous objects. + +
MSPMaxLogit
FS Lost and FoundFPR95 ↓45.618.8
AUROC ↑87.092.0
AUPR ↑6.038.1
Road AnomalyFPR95 ↓68.464.9
AUROC ↑73.878.0
AUPR ↑20.624.4
+ +Table 6: Auxiliary analysis of the MSP and the MaxLogit using prior less comprehensive anomaly segmentation datasets. All values are percentages. Our MaxLogit detector outperforms the MSP baseline detector on all metrics. + +MaxLogit, Energy, and Mahalanobis detectors on Species with a ResNet-50d (He et al., 2019) trained on ImageNet-1K are $71.8\%$ $68.0\%$ , and $67.6\%$ respectively. + +# B. OOD Segmentation + +We cover methods used in the paper in more depth and the modifications necessary to make the methods work with OOD detection in semantic segmentation. We use $f$ to denote the function typically a neural network, $x$ is the input + +image, and $y_{i,j}$ is the prediction for pixel $i,j$ . We will denote the output probability distribution per pixel as $P$ and locations $i,j$ as the location of the respective pixel in the output. $f(x)_{i,j}$ denotes the $i$ th row and $j$ th column of the output. + +Confidence Estimation. The method proposed in (DeVries & Taylor, 2018) works by training a confidence branch added at the end of the neural network. We denote the network predictions as both $P$ and $\hat{c}$ whereby every pixel is assigned a confidence value. + +$$ +b \sim B (0. 5) +$$ + +$$ +c := \hat {c} \cdot b + (1 - b) +$$ + +$$ +P := P \cdot c + (1 - c) y +$$ + +The confidence estimation denoted by $c$ is given "hints" during training to guide what it is learning. The $B$ is a beta distribution and acts as a regularizer similar to dropout so that the network $f$ does not exclusively rely on the true labels being present. The final loss is modified to include the extra term below: + +![](images/041a502ff166e4c75a60e04e8b83458e0c098fc674f2c6cb655211ac92b879be.jpg) +Figure 6: A comparison of lighting consistency in the Fishyscapes anomaly segmentation benchmark and our new StreetHazards dataset. The arrows point in the manually estimated direction of light on parts of the scene. In Fishyscapes, inconsistent lighting allows forensics techniques to detect the anomaly (Johnson & Farid, 2005). Unlike cut-and-paste anomalies, the anomalies in our StreetHazards dataset are naturally integrated into their environment with proper lighting and orientation, making them more difficult to detect. + +$$ +\mathcal {L} _ {p} = \frac {1}{| P |} \sum_ {i} - \log (p _ {i}) y _ {i} +$$ + +$$ +\mathcal {L} _ {c} = \frac {1}{| P |} \sum_ {i} - \log (\hat {c} _ {i}) +$$ + +$$ +\mathcal {L} = \mathcal {L} _ {p} + \lambda \mathcal {L} _ {c} +$$ + +The reasoning for $\mathcal{L}_c$ is to encourage the network to output confident predictions. Finally $\lambda$ is initialized to 0.1 and is updated by a "budget" parameter which is set to the default of 0.3. The update equation: + +$$ +\left\{ \begin{array}{l l} \lambda / 0. 9 9 & \sum \hat {c} _ {i} \leq \text {b u d g e t} \\ \lambda / 1. 0 1 & \sum \hat {c} _ {i} > \text {b u d g e t} \end{array} \right. +$$ + +This adaptively adjusts the weighting between the two losses and experimentally the update is not sensitive to the budget parameter. + +BDD100K Label Noise. BDD-Anomaly is sourced from BDD100K and uses the motorcycle, train, and bicycle classes as anomalous object classes. Due to the large size of BDD100K, some label noise exists, which may influence BDD-Anomaly results. By manually checking the training and validation examples in BDD100K, we estimate that $3.9\%$ of the images in the BDD-Anomaly validation set are affected by label noise. Hence, the label noise in BDD100K has a small impact on BDD-Anomaly and does not add significant variance to the results. + +Semantic Segmentation BDD Anomalies Dataset List. The BDD100K dataset contains 180 instances of the train class, 4296 instances of the motorcycle class, and 10229 instances of the bicycle class. + +StreetHazards 3D Models Dataset List. For semantic segmentation experiments, we choose to use the following classes 3D models from Model Bank Library to serve as out-of-distribution data: Meta-categories: Animals, Vehicles, Weapons, Appliances, Household items (furniture, and kitchen items), Electronics, Instruments, and miscellaneous. The specific animals used are kangaroos, whales, dolphins, cows, lions, frogs, bats, insects, mongooses, scorpions, fish, camels, flamingos, apes, horses, mice, spider, dinosaurs, elephants, moose, shrimps, bats, butterflies, turtles, hippopotamuses, dogs, cats, sheep, seahorse, snail and zebra. The specific vehicles used are military trucks, motorcycles, naval ships, pirate ships, submarines, sailing ships, trolleys, trains, airplanes, helicopters, jets, zeppelin, radar tower, construction vehicles (loaders, dump trucks, bulldozer), farming vehicles (harvester, gantry crane, tractor), fire truck, tank, combat vehicles, and trailers. The specific weapons used + +are guns, missiles, rocket launchers, and grenades. The appliances used are refrigerators, stoves, washing machines, and ovens. The household items used are cabinets, armoire, grandfather clocks, bathtubs, bureaus, night stand, table, bed, bookcase, office desk, glasses (drinking), throne chair, kitchen utensils (knives, forks, spoons), sofa, clothing iron, plates, sewing machine, and dressing mirror. The electronics used are computer monitor, computer mouse, hair dryer, The instruments category includes bassoon, clarinet, drums, guitar, violin, harp, and keyboard. The miscellaneous category includes rocket, space capsule, space shuttle, lunar module, glasses (wearable), weight machine, balance beam, bench press, bowling ball and pins, and pens. Several categories and instances were excluded from Model Bank Library due to their occurrence in the simulation environment such as playground equipment and various types of foliage and trees. The sizes of instances used in the dataset might not reflect the actual scale that would otherwise naturally occur. Similarly the location of instances in the dataset are not necessarily reflective of where they are likely to occur in nature. + +# C. Species + +Cleaning. We performed a two-step cleaning procedure on the images scraped from the iNaturalist website. First, we ran a blind image quality assessment to score all the images and discarded any image below a cutoff score. Then, using Amazon Mechanical Turk (MTurk), we asked the workers to manually flag low-quality or irrelevant images for removal. + +Usage. We provide two versions of the dataset that carve up the dataset differently: one is for off-the-shelf ImageNet classifiers, and one is for researchers simulating OOD detection for ecological applications. In the first case, users collect anomaly scores using the ImageNet dataset as the source of in-distribution examples, and users collect anomaly scores for Species examples and treat these as OOD. In the other case, we divide images into individual species classes. Then users can fine-tune their models to classify individual species. During test time, they encounter test species that are in-distribution and test examples that are out-of-distribution and do not belong to any of the test species. This is to simulate a fine-grained ecological species classification and anomaly detection task. + +
Supercategory# Classes# Images
Amphibians7931,411
Arachnids4811,575
Fish208111,377
Fungi202163,049
Insects189116,635
Mammals9624,244
Microorganisms611,462
Mollusks211119,465
Plants176120,089
Protozoa4615,072
Total1,316714,379
+ +Table 7: Overview of the Species dataset. \ No newline at end of file diff --git a/scalingoutofdistributiondetectionforrealworldsettings/images.zip b/scalingoutofdistributiondetectionforrealworldsettings/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..40c6e8b098168d4d361fc8f97bf7e159d220c131 --- /dev/null +++ b/scalingoutofdistributiondetectionforrealworldsettings/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d7b963891ee65a40c38e89990b71b74cf15462b2bc218544b6522fe52cfaed22 +size 865406 diff --git a/scalingoutofdistributiondetectionforrealworldsettings/layout.json b/scalingoutofdistributiondetectionforrealworldsettings/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..51f3f5d01a95a15cdde6062f55b66fe5bc750916 --- /dev/null +++ b/scalingoutofdistributiondetectionforrealworldsettings/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dc7882ee66b31ae187ffd30dcfd8f57d8f83d5dab0c7e0566fec425f46054b4a +size 389881 diff --git a/scalingstructuredinferencewithrandomization/5b20c086-adaf-4b1f-ba5d-0b35a8a12698_content_list.json b/scalingstructuredinferencewithrandomization/5b20c086-adaf-4b1f-ba5d-0b35a8a12698_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..0f5960555f690e08c19695a49d7fe40f945c96f6 --- /dev/null +++ b/scalingstructuredinferencewithrandomization/5b20c086-adaf-4b1f-ba5d-0b35a8a12698_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c8ec55f8443ba134c1014e92e28e6af6d1da1f1ecf377af5db865f249dd97967 +size 138320 diff --git a/scalingstructuredinferencewithrandomization/5b20c086-adaf-4b1f-ba5d-0b35a8a12698_model.json b/scalingstructuredinferencewithrandomization/5b20c086-adaf-4b1f-ba5d-0b35a8a12698_model.json new file mode 100644 index 0000000000000000000000000000000000000000..14136f9100a058afe01713ec6c0710d41c80bae4 --- /dev/null +++ b/scalingstructuredinferencewithrandomization/5b20c086-adaf-4b1f-ba5d-0b35a8a12698_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c1c69d61d4a93bfea0e648d4223985ba5088fbb2e5f06ef3271f93d404a06a9e +size 161047 diff --git a/scalingstructuredinferencewithrandomization/5b20c086-adaf-4b1f-ba5d-0b35a8a12698_origin.pdf b/scalingstructuredinferencewithrandomization/5b20c086-adaf-4b1f-ba5d-0b35a8a12698_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..79eae828b4dbdc2d69ef8f8b6040d0bc071e4305 --- /dev/null +++ b/scalingstructuredinferencewithrandomization/5b20c086-adaf-4b1f-ba5d-0b35a8a12698_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ccb645c29281e20ab0960b1e5ef49d854fdb3850c997f71b483502ab49246889 +size 1409140 diff --git a/scalingstructuredinferencewithrandomization/full.md b/scalingstructuredinferencewithrandomization/full.md new file mode 100644 index 0000000000000000000000000000000000000000..420291851aaf1971111eebf00abf991ed60da225 --- /dev/null +++ b/scalingstructuredinferencewithrandomization/full.md @@ -0,0 +1,738 @@ +# Yao Fu1 John P. Cunningham2,3 Mirella Lapata1 + +# Abstract + +Deep discrete structured models have seen considerable progress recently, but traditional inference using dynamic programming (DP) typically works with a small number of states (less than hundreds), which severely limits model capacity. At the same time, across machine learning, there is a recent trend of using randomized truncation techniques to accelerate computations involving large sums. Here, we propose a family of randomized dynamic programming (RDP) algorithms for scaling structured models to tens of thousands of latent states. Our method is widely applicable to classical DP-based inference (partition function, marginal, reparameterization, entropy) and different graph structures (chains, trees, and more general hypergraphs). It is also compatible with automatic differentiation: it can be integrated with neural networks seamlessly and learned with gradient-based optimizers. Our core technique approximates the sum-product by restricting and reweighting DP on a small subset of nodes, which reduces computation by orders of magnitude. We further achieve low bias and variance via Rao-Blackwellization and importance sampling. Experiments over different graphs demonstrate the accuracy and efficiency of our approach. RDP can also be used to learn a structured variational autoencoder with a scaled inference network which outperforms baselines in terms of test likelihood and successfully prevents collapse. + +# 1. Introduction + +Deep discrete structured models (Martins et al., 2019; Rush, 2020) have enjoyed great progress recently, improving per + +$^{1}$ School of Informatics, University of Edinburgh $^{2}$ Statistics Department, Columbia University $^{3}$ Zuckerman Institute, Columbia University. Correspondence to: Yao Fu , John P. Cunningham , Mirella Lapata . + +Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s). + +formance and interpretability in a range of tasks including sequence tagging (Ma & Hovy, 2016), parsing (Zhang et al., 2020; Yang et al., 2021), and text generation (Wiseman et al., 2018). However, their capacity is limited by issues of scaling (Sun et al., 2019; Chiu & Rush, 2020; Yang et al., 2021; Chiu et al., 2021). Traditional dynamic programming based inference for exponential families has limited scalability with large combinatorial spaces. When integrating exponential families with neural networks (e.g., a VAE with a CRF inference network, detailed later), the small latent combinatorial space severely restricts model capacity. Existing work has already observed improved performance by scaling certain types of structures (Yang et al., 2021; Li et al., 2020; Chiu & Rush, 2020), and researchers are eager to know if there are general techniques for scaling classical structured models. + +Challenges in scaling structured models primarily come from memory complexity. For example, consider linear-chain CRFs (Sutton & McCallum, 2006), the classical sequence model that uses the Forward algorithm, a dynamic programming algorithm, for computing the partition function exactly. This algorithm requires $O(TN^2)$ computation where $N$ is the number of latent states and $T$ is the length of the sequence. It is precisely the $N^2$ term that is problematic in terms of memory and computation. This limitation is more severe under automatic differentiation (AD) frameworks as all intermediate DP computations are stored for gradient construction. Generally, DP-based inference algorithms are not optimized for modern computational hardware like GPUs and typically work under small-data regimes, with $N$ in the range [10, 100] (Ma & Hovy, 2016; Wiseman et al., 2018). With larger $N$ , inference becomes intractable since the computation graph does not easily fit into GPU memory (Sun et al., 2019). + +Aligning with a recent trend of exploiting randomization techniques for machine learning problems (Oktay et al., 2020; Potapczynski et al., 2021; Beatson & Adams, 2019), this work proposes a randomization framework for scaling structured models, which encompasses a family of randomized dynamic programming algorithms with a wide coverage of different structures and inference (Table 1). Within our randomization framework, instead of summing over all possible combinations of latent states, we only sum over paths with the most probable states and sample a subset of less + +Table 1. Dynamic programming algorithms for different inference over different graphs. Our randomization technique covers a spectrum of classical DP algorithms on different graphs. Scaled algorithms shown in red are randomized in this work. + +
GraphModelPartition & MarginalEntropySampling & Reparameterization
ChainsHMM, CRF, Semi-MarkovForward-BackwardBackward EntropyGumbel Sampling (Fu et al., 2020)
HypertreesPCFG, Dependency CRFInside-OutsideOutside EntropyStochastic Softmax (Paulus et al., 2020)
General graphGeneral Exponential FamilySum-ProductBethe EntropyStochastic Softmax (Paulus et al., 2020)
+ +likely paths to correct the bias according to a reasonable proposal. Since we only calculate the chosen paths, memory consumption can be reduced to a reasonably small budget. We thus recast the computation challenge into a tradeoff between memory budget, proposal accuracy, and estimation error. In practice, we show RDP scales existing models by two orders of magnitude with memory complexity as small as one percent. + +In addition to the significantly increased scale, we highlight the following advantages of RDP: (1) applicability to different structures (chains, trees, and hypergraphs) and inference operations (partition function, marginal, reparameterization, and entropy); (2) compatibility with automatic differentiation and existing efficient libraries (like Torch-Struct in Rush, 2020); and (3) statistically principled controllability of bias and variance. As a concrete application, we show that RDP can be used for learning a structured VAE with a scaled inference network. In experiments, we first demonstrate that RDP algorithms estimate partition function and entropy for chains and hypertrees with lower mean square errors than baselines. Then, we show their joint effectiveness for learning the scaled VAE. RDP outperforms baselines in terms of test likelihood and successfully prevents posterior collapse. Our implementation is at https://github.com/FranxYao/RDP. + +# 2. Background and Preliminaries + +Problem Statement We start with a widely-used structured VAE framework. Let $\mathbf{y}$ be an observed variable. Let $\mathbf{X}$ be any latent structure (sequences of latent tags, parse trees, or general latent graphs, see Table 1) that generates $\mathbf{y}$ . Let $p_{\psi}$ denote the generative model, and $q_{\theta}$ the inference model. We optimize: + +$$ +\mathcal {L} = \mathbb {E} _ {q _ {\theta} (\boldsymbol {X} | \boldsymbol {y})} [ \log p _ {\psi} (\boldsymbol {X}, \boldsymbol {y}) - \log q _ {\theta} (\boldsymbol {X} | \boldsymbol {y}) ] \tag {1} +$$ + +where the inference model $q_{\theta}$ takes the form of a discrete undirected exponential family (e.g., linear-chain CRFs in Fu et al., 2020). Successful applications of this framework include sequence tagging (Mensch & Blondel, 2018), text generation (Li & Rush, 2020), constituency parsing (Kim et al., 2019), dependency parsing (Corro & Titov, 2018), latent tree induction (Paulus et al., 2020), and so on. Our + +goal is to learn this model with a scaled latent space (e.g., a CRF encoder with tens of thousands of latent states). + +Sum-Product Recap Learning models in Eq. 1 usually requires classical sum-product inference (and its variants) of $q_{\theta}$ , which we now review. Suppose $q_{\theta}$ is in standard overparameterization of a discrete exponential family (Wainwright & Jordan, 2008): + +$$ +q _ {\theta} (\boldsymbol {X}) \propto \exp \left\{\sum_ {s \in V} \phi_ {s} \left(x _ {s}\right) + \sum_ {(s, t) \in E} \phi_ {s t} \left(x _ {s}, x _ {t}\right) \right\} \tag {2} +$$ + +where $\mathbf{X} = [X_{1},\dots,X_{M}]$ is a random vector of nodes in a graphical model with each node taking discrete values $X_{i}\in \{1,2,\ldots ,N\}$ , $N$ is the number of states, $\phi_{st}$ is the edge potential, and $\phi_s$ is the node potential. Here, we use a general notation of nodes $V$ and edges $E$ . We discuss specific structures later. Suppose we want to compute its marginals and log partition function. The solution is the sum-product algorithm that recursively updates the message at each edge: + +$$ +\mu_ {t s} \left(x _ {s}\right) \propto \sum_ {x _ {t} ^ {\prime} = 1} ^ {N} \left\{\phi_ {s t} \left(x _ {s}, x _ {t} ^ {\prime}\right) \phi_ {t} \left(x _ {t} ^ {\prime}\right) \prod_ {u \in V _ {t} ^ {s}} \mu_ {u t} \left(x _ {t} ^ {\prime}\right) \right\} \tag {3} +$$ + +where $\mu_{ts}(x_s)$ denotes the message from node $t$ to node $s$ evaluated at $X_s = x_s$ , $V_t^s$ denotes the set of neighbor nodes of $t$ except $s$ . Upon convergence, it gives us the Bethe approximation (if the graph is loopy) of the marginal, partition function, and entropy (as functions of the edge marginals $\mu_{ts}$ ). These quantities are then used in gradient based updates of the potentials $\phi$ (detailed in Sec. 4). When the underlying graph is a tree, this approach becomes exact and convergence is linear in the number of edges. + +Challenges in Scaling The challenge is how to scale the sum-product computation for $q_{\theta}$ . Specifically, gradient-based learning requires three types of inference: (a) partition estimation (for maximizing likelihood); (b) reparameterized sampling (for gradient estimation); and (c) entropy estimation (for regularization). Existing sum-product variants (Table 1) provide exact solutions, but only for a small latent space (e.g., a linear-chain CRF with state number smaller than 100). Since the complexity of DP-based inference is usually at least quadratic to the size of the latent + +states, it would induce memory overflow if we wanted to scale it to tens of thousands. + +Restrictions from Automatic Differentiation At first sight, one may think the memory requirement for some algorithms is not so large. For example, the memory complexity of a batched forward sum-product (on chains) is $O(BTN^2)$ . Consider batch size $B = 10$ , sequence length $T = 100$ , number of states $N = 1000$ , then the complexity is $O(10^9)$ , which seems acceptable, especially given multiple implementation tricks (e.g., dropping the intermediate variables). However, this is not the case under automatic differentiation, primarily because AD requires storing all intermediate computations1 for building the adjacent gradient graph. This not only invalidates tricks like dropping intermediate variables (because they should be stored) but also multiplies memory complexity when building the adjacent gradient graph (Eisner, 2016). This problem is more severe if we want to compute higher-order gradients, or if the underlying DP has higher-order complexity (e.g., the Inside algorithm of cubic complexity $O(T^2N^3)$ ). Since gradient-based optimization requires AD-compatibility, scaling techniques are under similar restrictions, namely storing all computations to construct the adjacent gradient graph. + +Previous Efforts Certainly there exist several excellent scaling techniques for structured models, though most come with some intrinsic limitations that we hope to alleviate. In addition to AD-compatibility restrictions, many existing techniques either require additional assumptions (e.g., sparsity in Lavergne et al., 2010; Sokolovska et al., 2010; Correia et al., 2020, pre-clustering in Chiu & Rush, 2020, or low-rank in Chiu et al., 2021), rely on handcrafted heuristics for bias correction (Jeong et al., 2009), or cannot be easily adapted to modern GPUs with tensorization and parallelization (Klein & Manning, 2003). As a result, existing methods apply to a limited range of models: Chiu & Rush (2020) only consider chains and Yang et al. (2021) only consider probabilistic context-free grammars (PCFGs). + +One notably promising direction comes from Sun et al. (2019), where they consider topK computation and drop all low probability states. Pillutla et al. (2018) also considered topK inference in a smoothed setting (where they have more theoretical analytics but are less about memory efficiency) and their topK inference also points to efficiency improvements. While intuitively sensible (indeed we build on this idea here), their deterministic truncation induces severe bias (later shown in our experiments). As we will discuss, this bias can be effectively mitigated by randomization. + +1More recently, there are works improving the memory-efficiency of AD like Rajbhandari et al. (2020) by off-loading intermediate variables to CPUs. Yet their application on sum-product inference requires modification of the AD library, which raises significant engineering challenges. + +Randomization of Sums in Machine Learning Randomization is a long-standing technique in machine learning (Mahoney, 2011; Halko et al., 2011) and has been applied to dynamic programs before the advent of deep learning (Bouchard-côté et al., 2009; Blunsom & Cohn, 2010). Notably, works like Koller et al. (1999); Ihler & McAllester (2009) also consider sampling techniques for sum-product inference. However, since these methods are proposed before deep learning, their differentiability remain untested. More recently, randomization has been used in the context of deep learning, including density estimation (Rhodes et al., 2020), Gaussian processes (Potapczynski et al., 2021), automatic differentiation (Oktay et al., 2020), gradient estimation (Correia et al., 2020), and optimization (Beatson & Adams, 2019). The foundation of our randomized DP also lies in speeding up summation by randomization. To see the simplest case, consider the sum of a sorted list $\mathbf{a}$ of positive numbers: $S = \sum_{i=1}^{N} a_i$ . This requires $N - 1$ additions, which could be expensive when $N$ is large. Suppose one would like to reduce the number of summands to $K$ , Liu et al. (2019) discusses the following sum-and-sample estimator for gradient estimation: + +$$ +\hat {S} = \sum_ {i = 1} ^ {K _ {1}} a _ {i} + \frac {1}{K _ {2}} \sum_ {j = 1} ^ {K _ {2}} \frac {a _ {\delta_ {j}}}{q _ {\delta_ {j}}} \tag {4} +$$ + +where $K_{1} + K_{2} = K$ and $\delta_j\sim \pmb {q} = [q_{K_1 + 1},\dots,q_N]$ $\pmb{q}$ is a proposal distribution upon the tail summands $[a_{K_1 + 1},\dots,a_N]$ . This estimator is visualized in Fig. 1A. One can show that it is unbiased: $\mathbb{E}_q[\hat{S}] = S$ , irrespective of how we choose the proposal $\pmb{q}$ . The oracle proposal $\pmb{q}^{\star}$ is the normalized tail summands: $q_{i}^{\star} = a_{i} / \sum_{j = K_{1} + 1}^{N}a_{j}$ , under which the estimate becomes exact: $\hat{S}\equiv S$ . Note that the bias is corrected by dividing the proposal probability. + +# 3. Scaling Inference with Randomization + +In this section, we introduce our randomized dynamic programming algorithms. We first introduce a generic randomized sum-product framework for approximating the partition function of any graph structure. Then we instantiate this framework on two classical structures, chains and hypertrees, respectively. When running the randomized sum-product in a left-to-right (or bottom-up) order, we get a randomized version of the classical Forward (or Inside) algorithm for estimating the partition function for chains like HMMs and Linear-chain CRFs (or hypertrees like PCFGs and Dependency CRFs in Kim et al., 2019). We call these two algorithms first-order RDPs because they run the computation graph in one pass. Next, we generalize RDP to two more inference operations (beyond partition estimation): entropy estimation (for the purposes of regularized training) and reparameterization (for gradient-based optimization). We collectively use the term second-order RDPs to refer to + +![](images/0a8075e21639a0a64a3995fc4910238ff78f0681eabac7f6f33ec2736ac5714a.jpg) +Figure 1. Scaling inference by randomization. (A): randomized summation (Eq.4). (B): Randomized Forward (Alg. 1) recursively applies randomized summation at each DP step. Memory reduction is achieved by restricting computation on edges linking the sampled nodes. Second-order randomized DPs (Entropy and Reparameterization, Alg. 3 and 4) reuse this graph and share the same path as the gradients. (C): Randomized Inside (Alg. 2) applies randomized summation twice at each DP step. All algorithms in our randomized DP family are compatible to automatic differentiation, the direction of the gradient is shown by red dashed arrows. + +entropy and reparameterization algorithms because they call first-order RDPs as a subroutine and run a second pass of computation upon the first-order graphs. We will compose these algorithms into a structured VAE in Sec. 4. + +# 3.1. Framework: Randomized Sum-Product + +Our key technique for scaling the sum-product is a randomized message estimator. Specifically, for each node $X_{t}$ given a pre-constructed proposal $\pmb{q}_{t} = [q_{t}(1),\dots,q_{t}(N)]$ (we discuss how to construct a correlated proposal later because it depends on the specific neural parameterization), we retrieve the top $K_{1}$ index $\{\sigma_{t,i}\}_{i = 1}^{K_1}$ from $\pmb{q}_{t}$ , and get a $K_{2}$ -sized sample $\{\delta_{t,i}\}_{i = 1}^{K_2}$ from the rest of $\pmb{q}_{t}$ : + +$$ +\left[ \sigma_ {t, 1}, \dots , \sigma_ {t, K _ {1}}, \dots , \sigma_ {t, N} \right] = \arg \operatorname {s o r t} \left\{q _ {t} (i) \right\} _ {i = 1} ^ {N} \tag {5} +$$ + +$$ +\delta_ {t, j} \stackrel {\text {i . i . d .}} {\sim} \text {C a t e g o r i c a l} \left\{q _ {t} \left(\sigma_ {t, K _ {1} + 1}\right),..., q _ {t} \left(\sigma_ {t, N}\right) \right\} \tag {6} +$$ + +$$ +\Omega_ {t} ^ {K _ {1}} = \left\{\sigma_ {t, i} \right\} _ {i = 1} ^ {K _ {1}} \quad \Omega_ {t} ^ {K _ {2}} = \left\{\delta_ {t, j} \right\} _ {j = 1} ^ {K _ {2}} \tag {7} +$$ + +Then, we substitute the full index $\{1,\dots,N\}$ with the top $\Omega_t^{K_1}$ and the sampled index $\Omega_t^{K_2}$ : + +$$ +\begin{array}{l} \hat {\mu} _ {t s} \left(x _ {s}\right) \propto \sum_ {\sigma_ {t} \in \Omega_ {t} ^ {K _ {1}}} \left\{\phi_ {s t} \left(x _ {s}, \sigma_ {t}\right) \phi_ {t} \left(\sigma_ {t}\right) \prod_ {u \in V _ {t} ^ {s}} \hat {\mu} _ {u t} \left(\sigma_ {t}\right) \right\} + \\ \sum_ {\delta_ {t} \in \Omega_ {t} ^ {K _ {2}}} \left\{\frac {1}{K _ {2} q _ {t} (\delta_ {t})} \phi_ {s t} \left(x _ {s}, \delta_ {t}\right) \phi_ {t} (\delta_ {t}) \prod_ {u \in V _ {t} ^ {s}} \hat {\mu} _ {u t} (\delta_ {t}) \right\} \tag {8} \\ \end{array} +$$ + +where the oracle proposal is proportional to the actual summands (Eq. 3). Here indices are pre-computed outside DP. This means the computation of Eq. 5-7 can be moved outside the AD engine (e.g., in Pytorch, under the no-grad statement) to further save GPU memory usage. + +We now show that estimator Eq. 8 can be interpreted as a combination of Rao-Blackwellization (RB) and importance sampling (IS). Firstly, RB says that a function + +$J(X,Y)$ depending on two random variables $X,Y$ has larger variance than its conditional expectation $\hat{J} (X) = \mathbb{E}[J(X,Y)|X]$ (Ranganath et al., 2014): + +$$ +\begin{array}{l} \mathbb {V} [ \hat {J} (X) ] = \mathbb {V} [ J (X, Y) ] - \mathbb {E} [ (J (X, Y) - \hat {J} (X)) ^ {2} ] (9) \\ \leq \mathbb {V} [ J (X, Y) ] (10) \\ \end{array} +$$ + +This is because $Y$ has been integrated out and the source of randomness is reduced to $X$ . Now let $\delta_1, \delta_2$ be uniform random indices taking values from $\Omega_t^{K_1}$ and $\Omega_t^{K_2}$ , respectively. Consider a simple unbiased estimate $S$ for the message $\mu_{st}$ : + +$$ +m _ {s t} (i) = \phi_ {s t} \left(x _ {s}, i\right) \phi_ {t} (i) \prod_ {u \in V _ {t} ^ {s}} \mu_ {u t} (i) \tag {11} +$$ + +$$ +S \left(\delta_ {1}, \delta_ {2}\right) = K _ {1} m _ {s t} \left(\delta_ {1}\right) + \left(N - K _ {1}\right) m _ {s t} \left(\delta_ {2}\right) \tag {12} +$$ + +The conditional expectation $\hat{S} (\delta_2) = \mathbb{E}[S(\delta_1,\delta_2)|\delta_2]$ is: + +$$ +\hat {S} \left(\delta_ {2}\right) = \sum_ {\sigma_ {t} \in \Omega_ {t} ^ {K _ {1}}} m _ {s t} \left(\sigma_ {t}\right) + (N - K _ {1}) m _ {s t} \left(\delta_ {2}\right) \tag {13} +$$ + +Plugging $S(\delta_1, \delta_2), \hat{S}(\delta_2)$ in Eq. 10, we get variance reduction: $\mathbb{V}[\hat{S}(\delta_2)] \leq \mathbb{V}[S(\delta_1, \delta_2)]$ . Note that the variance will become smaller as $K_1$ becomes larger. Now change $\delta_2$ in Eq. 13 to from the proposal in Eq. 6 then take expectation: + +$$ +\begin{array}{l} \mathbb {E} _ {\delta_ {2} \sim \operatorname {U n i f o r m} \left(\Omega_ {t} ^ {K _ {2}}\right)} \left[ \left(N - K _ {1}\right) m _ {s t} \left(\delta_ {2}\right) \right] (14) \\ = \mathbb {E} _ {\delta_ {2} \sim q _ {t}} \left[ \frac {1}{q _ {t} \left(\delta_ {2}\right) (N - K _ {1})} \left(N - K _ {1}\right) m _ {s t} \left(\delta_ {2}\right) \right] (15) \\ = \mathbb {E} _ {\delta_ {2} \sim \boldsymbol {q} _ {t}} \left[ \frac {1}{q _ {t} (\delta_ {2})} m _ {s t} (\delta_ {2}) \right] (16) \\ \end{array} +$$ + +This is an instance of importance sampling where the importance weight is $\frac{1}{q_t(\delta_2)(N - K_1)}$ . Variance can be reduced if $q_{t}$ is correlated with the summands (Eq. 11). Finally, combining Eq. 16 and 13 and increasing the number of sampled + +# Algorithm 1 Randomized Forward + +Input: potentials $\phi (x_{t - 1},x_t,y_t)$ ,top $K_{1}$ index set $\Omega_t^{K_1}$ ,sampled $K_{2}$ index set $\Omega_t^{K_2}$ + +Initialize $\alpha_{1}(i) = \phi (x_{0} = \emptyset ,x_{1} = i,y_{t})$ + +For $t = 2$ to $T$ , compute recursion: + +$$ +\begin{array}{l} \hat{\alpha}_{t}(i) = \sum_{\sigma \in \Omega^{K_{1}}_{t - 1}}\hat{\alpha}_{t - 1}(\sigma)\phi (\sigma ,i,y_{t}) + \\ \sum_ {\delta \in \Omega_ {t - 1} ^ {K _ {2}}} \frac {1}{K _ {2} q _ {t} (\delta)} \hat {\alpha} _ {t - 1} (\delta) \phi (\delta , i, y _ {t}) \tag {17} \\ \end{array} +$$ + +Return $\hat{Z} = \sum_{\sigma \in \Omega_T^{K_1}}\hat{\alpha}_T(\sigma) + \sum_{\delta \in \Omega_T^{K_2}}\frac{1}{K_2q_T(\delta)}\hat{\alpha}_T(\delta)$ and $\{\hat{\alpha}_t\}_{t=1}^T$ + +index $\delta_{2}$ to $K_{2}$ will recover our full message estimator in Eq. 8. + +# 3.2. First-Order Randomized DP + +Now we instantiate this general randomized message passing principle for chains (on which sum-product becomes the Forward algorithm) and tree-structured hypergraphs (on which sum-product becomes the Inside algorithm). When the number of states $N$ is large, exact sum-product requires large GPU memory when implemented with AD libraries like Pytorch. This is where randomization comes to rescue. + +# 3.2.1. RANDOMIZED FORWARD + +Algorithm 1 shows our randomized Forward algorithm for approximating the partition function of chain-structured graphs. The core recursion in Eq. 17 estimates the alpha variable $\hat{\alpha}_t(i)$ as the sum of all possible sequences up to step $t$ at state $i$ . It corresponds to the Eq. 8 applied to chains (Fig. 1B). Note how the term $K_2q_t(\delta)$ is divided in Eq. 17 to correct the estimation bias. Also note that all computation in Alg. 1 are differentiable w.r.t. the factors $\phi$ . We can recover the classical Forward algorithm by changing the chozen index set $\Omega_t^K$ to the full index $[1,..,N]$ . In Appendix A, we prove the unbiasedness by induction. + +As discussed in the above section, we reduce the variance of the randomized Forward by (1) Rao-Blackwellization (increasing $K_{1}$ to reduce randomness); and (2) importance sampling (to construct a proposal correlated to the actual summands). The variance comes from the gap between the proposal and the oracle (only accessible with a full DP), as shown in the green bars in Fig 1B. Variance is also closely related to how long-tailed the underlying distribution is: the longer the tail, the more effective Rao-Blackwellization will be. More detailed variance analysis is presented in Appendix B. In practice, we implement the algorithm in log + +# Algorithm 2 Randomized Inside + +Input: potentials $\phi (i,j,k)$ ,top $K_{1}$ index set $\Omega_{i,j}^{K_1}$ ,sampled $K_{2}$ index set $\Omega_{i,j}^{K_2}$ + +Initialize $\alpha (i,i,k) = \phi (i,i,k)$ + +For $l = 1$ to $T - 1$ , let $j = i + l$ , compute recursion: + +$$ +\begin{array}{l} \hat {\alpha} (i, j, k) = \phi (i, j, k) \sum_ {m = i} ^ {j - 1} \left\{ \begin{array}{l} \end{array} \right. \\ \sum_{\substack{\sigma_{1}\in \Omega^{K_{1}}_{i,m},\sigma_{2}\in \Omega^{K_{1}}_{m + 1,j}}}\hat{\alpha} (i,m,\sigma_{1})\cdot \hat{\alpha} (m + 1,j,\sigma_{2})+ \\ \sum_{\substack{\delta_{1}\in \Omega_{i,m}^{K_{2}},\delta_{2}\in \Omega_{m + 1,j}^{K_{2}}}}\frac{1}{K_{2}q_{i,m}(\delta_{1})}\hat{\alpha} (i,m,\delta_{1})\cdot \\ \left. \frac {1}{K _ {2} q _ {m + 1 , j} (\delta_ {2})} \hat {\alpha} (m + 1, j, \delta_ {2}) \right\} \tag {18} \\ \end{array} +$$ + +Return $\hat{Z} = \sum_{\sigma \in \Omega_{1,T}^{K_1}}\hat{\alpha} (1,T,\sigma) +$ + +$$ +\sum_ {\delta \in \Omega_ {1, T} ^ {K _ {2}}} \frac {1}{K _ {2} q _ {T} (\delta)} \hat {\alpha} (1, T, \delta) +$$ + +and $\{\hat{\alpha}_{i,j}\} ,i,j\in \{1,\dots,T\}$ + +space (for numerical stability) $^2$ . which has two implications: (a). the estimate becomes a lower bound due to Jensen's inequality; (b). the variance is exponentially reduced by the $\log (\cdot)$ function (in a rather trivial way). + +Essentially, the Sampled Forward restricts the DP computation from the full graph to a subgraph with chosen nodes $(\Omega_t^{K_1}$ and $\Omega_t^{K_2}$ for all $t$ ), quadratically reducing memory complexity from $O(TN^2)$ to $O(TK^2)$ . Since all computations in Alg. 1 are differentiable, one could directly compute gradients of the estimated partition function with any AD library, thus enabling gradient-based optimization. Backpropagation shares the same DP graph as the Randomized Forward, but reverses its direction (Fig. 1B). + +# 3.2.2. RANDOMIZED INSIDE + +We now turn to our Randomized Inside algorithm for approximating the partition function of tree-structured hypergraphs (Alg. 2). It recursively estimates the inside variables $\hat{\alpha}(i,j,k)$ which sum over all possible tree branchings (index $m$ in Eq. 18) and chosen state combinations (index $\sigma_1, \sigma_2, \delta_1, \delta_2$ , Fig 1C). Index $i,j$ denotes a subtree spanning from location $i$ to $j$ in a given sequence, and $k$ denotes the state. Different from the Forward case, this algorithm computes the product of two randomized sums that represent two subtrees, i.e., $(i,m)$ and $(m+1,j)$ . The proposal is constructed for each subtree. i.e., $q_{i,m}$ and $q_{m+1,j}$ , and are both divided in Eq. 18 for correcting the estimation bias. + +# Algorithm 3 Randomized Entropy DP + +Input: potentials $\phi (x_{t - 1},x_t,y_t)$ ,top $K_{1}$ index set $\Omega_t^{K_1}$ ,sampled $K_{2}$ index set $\Omega_t^{K_2}$ + +Initialize $H_{1}(i) = 0$ ; call Randomized Forward to get $\hat{Z}, \hat{\alpha}$ + +For $t = 1$ to $T - 1$ , compute recursion: + +$$ +\hat {p} _ {t} (i, j) = \phi (i, j, x _ {t}) \hat {\alpha} _ {t} (i) / \hat {\alpha} _ {t + 1} (j) \tag {19} +$$ + +$$ +\hat {H} _ {t + 1} (j) = \sum_ {\sigma \in \Omega_ {t} ^ {K _ {1}}} \hat {p} _ {t} (\sigma , j) [ \hat {H} _ {t} (\sigma) - \log \hat {p} _ {t} (\sigma , j) ] + +$$ + +$$ +\sum_ {\delta \in \Omega_ {t} ^ {K _ {2}}} \frac {1}{K _ {2} q _ {t} (\delta)} \hat {p} _ {t} (\delta , j) [ \hat {H} _ {t} (\delta) - \log \hat {p} _ {t} (\delta , j) ] \tag {20} +$$ + +Return $\hat{H}$ where: + +$$ +\hat {p} _ {T} (i) = \hat {\alpha} _ {T} (i) / \hat {Z} \tag {21} +$$ + +$$ +\hat {H} = \sum_ {\sigma \in \Omega_ {T} ^ {K _ {1}}} \hat {p} _ {T} (\sigma) [ \hat {H} _ {T} (\sigma) - \log \hat {p} _ {T} (\sigma) ] + +$$ + +$$ +\sum_ {\delta \in \Omega_ {T} ^ {K _ {2}}} \frac {1}{K _ {2} q _ {T} (\delta)} \hat {p} _ {T} (\delta) [ \hat {H} _ {T} (\delta) - \log \hat {p} _ {T} (\delta) ] \tag {22} +$$ + +The Randomized Inside restricts computation to the sampled states of subtrees, reducing the complexity from $O(T^{2}N^{3})$ to $O(T^{2}K^{3})$ . The output partition function is again differentiable and the gradients reverse the computation graph. Similar to the Forward case, unbiasedness can be proved by induction. The variance can be decreased by increasing $K_{1}$ to reduce randomness and constructing a correlated proposal. In Fig. 1C, green bars represent gaps to the oracle proposal, which is a major source of estimation error. + +# 3.3. Second-Order Randomized DP + +We now generalize RDP from partition function estimation to two more inference operations: entropy and reparameterized sampling. When composing graphical models with neural networks, entropy is usually required for regularization, and reparameterized sampling is required for Monte-Carlo gradient estimation (Mohamed et al., 2020). Again, we call our methods second-order because they reuse the computational graph and intermediate outputs of first-order RDPs. We focus on chain structures (HMMs and linear-chain CRFs) for simplicity. + +# 3.3.1. RANDOMIZED ENTROPY DP + +Algorithm 3 shows the randomized entropy $\mathrm{DP}^3$ . It reuses the chosen index $\Omega_t^K$ (thus the computation graph) and the intermediate variables $\hat{\alpha}_t$ of the randomized Forward, and recursively estimates the conditional entropy $\hat{H}_t(j)$ which + +# Algorithm 4 Randomized Gumbel Backward Sampling + +Input: potentials $\phi (x_{t - 1},x_t,y_t)$ ,top $K_{1}$ index set $\Omega_t^{K_1}$ ,sampled $K_{2}$ index set $\Omega_t^{K_2}$ , gumble noise $g_{t}(i)\sim$ Gumbel(0,1) + +Initialize: call Randomized Forward to get $\hat{Z},\hat{\alpha}$ ,then: + +$$ +\hat {p} _ {T} (i) = \hat {\alpha} _ {T} (i) / \hat {Z}, \quad i \in \Omega_ {T} ^ {K _ {1}} \cup \Omega_ {T} ^ {K _ {2}} \tag {23} +$$ + +$$ +\tilde {\boldsymbol {x}} _ {T} = \operatorname {s o f t m a x} _ {i} \left(\log \hat {p} _ {T} (i) + g _ {T} (i)\right) \tag {24} +$$ + +$$ +\hat {x} _ {T} = \operatorname {a r g m a x} _ {i} \tilde {\boldsymbol {x}} _ {T} (i) \tag {25} +$$ + +For $t = T - 1$ to 1, compute recursion: + +$$ +\begin{array}{l} \hat {p} _ {t} (i, j) = \phi (i, j, y _ {t}) \hat {\alpha} _ {t} (i) / \hat {\alpha} _ {t + 1} (j) \\ i \in \Omega_ {t} ^ {K _ {1}} \cup \Omega_ {t} ^ {K _ {2}}, j \in \Omega_ {t + 1} ^ {K _ {1}} \cup \Omega_ {t + 1} ^ {K _ {2}} \tag {26} \\ \end{array} +$$ + +$$ +\tilde {\boldsymbol {x}} _ {t} = \operatorname {s o f t m a x} _ {i} \left(\log \hat {p} _ {t} (i, \hat {x} _ {t + 1}) + g _ {t} (i)\right) \tag {27} +$$ + +$$ +\hat {x} _ {t} = \operatorname {a r g m a x} _ {i} \tilde {\boldsymbol {x}} _ {t} (i) \tag {28} +$$ + +Return relaxed sample $\{\tilde{x}_t\}_{t = 1}^T$ , hard sample $\{\hat{x}_t\}_{t = 1}^T$ + +represents the entropy of the chain ending at step $t$ , state $j$ . Unbiasedness can be similarly proved by induction. Note that here the estimate is biased because of the $\log(\cdot)$ in Eq. 20 (yet in the experiments we show its bias is significantly less than the baselines). Also note that the proposal probability $q_{t}(\delta)$ should be divided for bias correction (Eq. 20). Again, all computation is differentiable, which means that the output entropy can be directly differentiated by AD engines. + +# 3.3.2. RANDOMIZED GUMBEL BACKWARD SAMPLING + +When training VAEs with a structured inference network, one usually requires differentiable samples from the inference network. Randomized Gumbel backward sampling (Alg. 4) provides differentiable relaxed samples from HMMs and Linear-chain CRFs. Our algorithm is based on the recently proposed Gumbel Forward-Filtering Backward-Sampling (FFBS) algorithm for reparameterized gradient estimation of CRFs (see more details in Fu et al., 2020), and scales it to CRFs with tens of thousands of states. It reuses DP paths of the randomized Forward and recursively computes hard sample $\hat{x}_t$ and soft sample $\tilde{\boldsymbol{x}}_t$ (a relaxed one-hot vector) based on the chosen index $\Omega_t^K$ . When differentiating these soft samples for training structured VAEs, they induce biased but low-variance reparameterized gradients. + +# 4. Scaling Structured VAE with RDP + +We study a concrete structured VAE example that uses our RDP algorithms for scaling. We focus on the language domain, however our method generalizes to other types of sequences and structures. We will use the randomized Gumbel backward sampling algorithm for gradient estimation and the randomized Entropy DP for regularization. + +Table 2. Mean square error comparison between RDP algorithms v.s. TopK approximation. $\mathrm{D} =$ Dense, $\mathrm{I} =$ intermediate, $\mathrm{L} =$ Long-tailed distributions. $\log Z$ denotes log partition function. Our method outperforms the baseline on all unit cases with significantly less memory. + +
N=2000Linear-chain log ZHypertree log ZLinear-chain Entropy
DILDILDIL
TopK 20%N3.8741.0150.16236.12727.43521.78443.784.358.011
TopK 50%N0.9900.2510.0312.8422.4042.047131.822.1001.816
RDP 1%N (ours)0.1460.0660.07626.33137.66948.8635.9251.9890.691
RDP 10%N (ours)0.0670.0330.0551.1931.5301.3842.1161.2980.316
RDP 20%N (ours)0.0460.0200.0260.4450.5440.5991.3260.7300.207
N=10000DILDILDIL
TopK 20%N6.3956.9956.38178.63263.76243.556227.36171.97141.91
TopK 50%N2.1342.0131.64735.92926.67717.09985.06359.87746.853
RDP 1%N (ours)0.0780.6160.7343.3765.0127.2566.4506.3794.150
RDP 10%N (ours)0.0240.0310.0240.2990.4470.5760.5131.5390.275
RDP 20%N (ours)0.0040.0030.0030.1480.2460.2940.1440.0800.068
+ +Table 3. Bias-Variance decomposition of Randomized Forward. + +
DenseLong-tail
BiasVar.BiasVar.
TOPK 20%N-1.9680-0.4030
TOPK 50%N-0.9950-0.1770
RDP 1%N (ours)-0.0660.141-0.0500.074
RDP 10%N (ours)-0.0300.066-0.0270.054
RDP 20%N (ours)-0.0130.046-0.0030.026
+ +Generative Model Let $\pmb{x} = [x_{1},\dots,x_{T}]$ be a sequence of discrete latent states, and $\pmb{y} = [y_{1},\dots,y_{T}]$ a sequence of observed words (a word is an observed categorical variable). We consider an autoregressive generative model parameterized by an LSTM decoder: + +$$ +p _ {\psi} (\boldsymbol {x}, \boldsymbol {y}) = \prod_ {t} p _ {\psi} \left(x _ {t} \mid x _ {< t}, y _ {< t}\right) \cdot p _ {\psi} \left(y _ {t} \mid x _ {t}, x _ {< t}, y _ {< t}\right) +$$ + +$$ +p _ {\psi} \left(x _ {t} \mid x _ {< t}, y _ {< t}\right) = \operatorname {s o f t m a x} (\operatorname {M L P} (\operatorname {L S T M} (x _ {< t}, y _ {< t}))) +$$ + +$$ +p _ {\psi} \left(y _ {t} \mid x _ {t}, x _ {< t}, y _ {< t}\right) = \operatorname {s o f t m a x} (\mathrm {M L P} (\mathrm {L S T M} \left(x _ {1: t}, y _ {< t}\right))) +$$ + +Inference Model Since the posterior is intractable, we use a structured inference model parameterized by a CRF with a neural encoder: + +$$ +q _ {\theta} (\boldsymbol {x} | \boldsymbol {y}) = \prod_ {t} \Phi \left(x _ {t - 1}, x _ {t}\right) \phi \left(x _ {t}, y _ {t}\right) / Z \tag {29} +$$ + +where $\Phi$ is the $N\times N$ transition potential matrix and $\phi$ is the emission potential. This formulation has been previously used in sequence tagging and sentence generation (Ammar et al., 2014; Li & Rush, 2020) for a small $N$ . With large $N$ , parametrization and inference require careful treatment. Specifically, we firstly use a neural encoder to map $\mathbf{y}$ to a set of contextualized representations: + +$$ +[ \boldsymbol {r} _ {1}, \dots , \boldsymbol {r} _ {T} ] = \operatorname {E n c} (y _ {1}, \dots , y _ {t}) \tag {30} +$$ + +Table 4. Proposal effect on Randomized Forward. + +
DenseInterm.Long-tail
UNIFORM0.65511.050.160
LOCAL2.9089.1710.481
GLOBAL0.4530.0960.100
LOCAL + GLOBAL0.0280.0170.022
+ +As direct parametrization of an $N \times N$ transition matrix would be memory expensive when $N$ is large (e.g., when $N = 10^5$ ), we decompose it by associating each state $i$ with a state embedding $e_i$ . Then, the potentials are: + +$$ +\Phi \left(x _ {t - 1}, x _ {t}\right) = e _ {x _ {t - 1}} ^ {\mathbf {T}} e _ {x _ {t}} \quad \phi \left(x _ {t}, y _ {t}\right) = e _ {x _ {t}} ^ {\mathbf {T}} r _ {t} \tag {31} +$$ + +Training uses the following format of ELBO: + +$$ +\mathcal {L} = \mathbb {E} _ {q _ {\theta} (\boldsymbol {x} | \boldsymbol {y})} [ \log p _ {\psi} (\boldsymbol {x}, \boldsymbol {y}) ] + H (q _ {\theta} (\boldsymbol {x} | \boldsymbol {y})) \tag {32} +$$ + +where the entropy (and its gradients) is estimated by Alg. 3. Stochastic gradients of the first term is obtained by differentiating samples from randomized gumbel sampling: + +$$ +\nabla_ {\theta} \mathbb {E} _ {q _ {\theta}} [ \log p _ {\psi} (\boldsymbol {x}, \boldsymbol {y}) ] \approx \nabla_ {\theta} \log p _ {\psi} (\tilde {\boldsymbol {x}} (\theta), \boldsymbol {y}), \tilde {\boldsymbol {x}} (\theta) \sim \operatorname {A l g}. 4 \tag {33} +$$ + +note that the reparameterized sample $\tilde{\pmb{x}} (\theta)$ is a function of $\theta$ Equation 33 gives low-variance gradients of the inference network, which is ready for gradient-based optimization. + +Proposal Construction we consider the following: + +$$ +q _ {t} (i) = \frac {\phi (i , y _ {t})}{2 \sum_ {j = 1} ^ {N} \phi (j , y _ {t})} + \frac {\left\| \boldsymbol {e} _ {i} \right\| _ {1}}{2 \sum_ {j = 1} ^ {N} \left\| \boldsymbol {e} _ {j} \right\| _ {1}} \tag {34} +$$ + +which consists of: (a). local weights (the first term is the normalized local emissions) where the intuitions is that states with larger local weights are more likely to be observed and (b). a global prior (the second term) where the intuition + +![](images/41e6627d64c4fa790d222071b3940bb9de8ec511b0b98d9e47f374f74cebc085.jpg) +Figure 2. Modulating the posterior by controlling $K_{1} / K_{2}$ . The topK only approach leads to a collapsed posterior, which is overcome by $K_{2}$ randomization. Increasing $K_{2}$ encourages exploring less certain states, and consequently leads to an increasingly heavier tail. + +is that larger norms are usually associated with large dot products, and thus larger potentials. Note that there is no single fixed recipe of proposal construction since it is usually related to specific parameterization. For general structured models, we recommend considering utilizing any information that is potentially correlated with the actual summands, like the local and global weights we consider here. + +Exploration-Exploitation Tradeoff It is important to note that gradients only pass through the top $K_{1}$ indices $\Omega_{t}^{K_{1}}$ and tail samples $\Omega_{t}^{K_{2}}$ during training. This means that increasing $K_{1}$ leads to exploiting states that are already confident enough while increasing $K_{2}$ leads to exploring less confident states. So the ratio $K_{1} / K_{2}$ also represents an exploration-exploitation tradeoff when searching for meaningful posterior structures. We will further see its effect in the experiments. + +# 5. Experiments + +We first evaluate the estimation error of individual RDP algorithms for three unit cases, namely when the underlying distributions are long-tail, intermediate level, or dense. Then we evaluate RDP for training the structured VAE. + +# 5.1. Evaluation of RDP Algorithms + +Experimental Setting We evaluate the mean square error (MSE) for the estimation of linear-chain log partition (Alg. 1), hypertree log partition (Alg. 2), and linear-chain entropy (Alg. 3) on the three types of distributions. We simulate the distributions by controlling their entropy: the smaller the entropy, the more long-tailed the underlying distribution is. We set $N$ , the number of states, to be 2,000 and 10,000, which is orders of magnitudes larger than previous work (Wiseman et al., 2018; Yang et al., 2021). We run RDPs 100 times and calculate their MSE against the exact results from the full DP. For all estimators, we set $K_{2} = 1$ and $K_{1} = K - 1$ , and control $K$ to be [1, 10, 20] percent of $N$ . Also note that $K$ is independent of $N$ and we recommend adjusting it according to the computation budget. For linear-chains, we use the proposal discussed in Eq. 34. For hypertrees, we use a uniform proposal. + +Comparison Models Since there is only a handful of methods that apply to this range of structures and inference, + +Table 5. Negative Log Likelihood comparison. + +
Dev NLLTest NLL
FULL-10039.64 ± 0.0639.71 ± 0.07
TOPK-10039.71 ± 0.1339.76 ± 0.11
RDP-100 (ours)39.59 ± 0.1039.59 ± 0.08
TOPK-2000 (ours)39.81 ± 0.3039.84 ± 0.31
RDP-2000 (ours)39.47 ± 0.1139.48 ± 0.14
+ +we choose topK summation (Sun et al., 2019) as our baseline. This method was originally developed for linear-chain partition function approximation, and can be viewed as setting $K_{2} = 0$ in our case (topK summation only, no sample). This method is also used in Correia et al. (2020), however, they only consider sparse underlying distributions. It is important to differentiate between long-tailed and sparse distributions. While in both cases head elements consume a large portion of the probability mass, sparse means that tail elements have no probability while long-tailed means that tail elements have non-negligible probability. This entails that the topK approach (Sun et al., 2019; Correia et al., 2020) may significantly underestimate the partition function and entropy. + +Results Table 2 shows the MSE results. Our method outperforms the topK baseline on all distributions with significantly less memory budgets. We highlight two important observations: (1) since TopK summation requires sparsity, it consistently underestimates the partition and entropy, particularly on dense distributions, while RDP does not have this limitation; and (2) by choosing only 1 percent of the full index, we are able to outperform TopK summation in many cases and obtain decent estimates. + +Table 3 further shows how the computation budget of the randomized Forward algorithm can be used to control the bias-variance tradeoff. As can be seen, By increasing the computation budget $K$ (which is still smaller than full size), we are able to simultaneously reduce bias and variance. Table 4 shows different proposals influence the randomized Forward algorithm. We observe that a correlated proposal (as introduced in Eq. 34) indeed improves estimates of the randomized Forward. In general, scaled models typically require certain types of decomposition (see examples in Chiu et al. (2021) and Yang et al. (2021)) and proposals + +are closely related to a specific parametrization. For general structures, one can follow the local-global principle to construct proposals, or retreat to a uniform proposal. + +# 5.2. Evaluation of the Structured VAE + +We now use RDP to scale the latent space of the structured VAE. This experiment primarily tests the performance of the randomized Gumbel backward sampling algorithm (Alg. 4), which is used as a reparameterized gradient estimator for training the VAE. + +Experimental Setting We use an LSTM with 256 dimensional hidden states for the generative model. For the inference model, we use a pretrained GPT2 (base size) to show our method's compatibility with pretrained language models. We follow Fu et al. (2020) and use the MSCOCO dataset and reuse their processed data for simplicity. Our setting scales the original Gumbel-CRF paper (Fu et al., 2020). Specifically, we set $N = [100, 2, 000]$ . With $N = 100$ we can perform full DP which still gives biased gradients due to the continuous relaxation. With $N = 2,000$ , full DP gives memory overflow on a 16G GPU, so we only compare to the TopK approach. We use $K_{1} = K_{2} = 10\% N$ . We follow standard practice and report negative log likelihood estimated by importance sampling (Kim et al., 2019). + +Results Table 5 shows the performance of Latent Variable Model training with varying $N$ size. We observe that RDP outperforms the baselines for both $N = 100$ and $N = 2,000$ , which demonstrates its effectiveness for training VAEs. Furthermore, the overall NLL decreases as $N$ increases from 100 to 2,000, which underscores the advantage of scaling. We further show that the ratio of $K_{1} / K_{2}$ can be used for modulating the posterior and prevent posterior collapse. Specifically, we draw the frequency of states of the aggregated posterior. Recall that the aggregated posterior is obtained by sampling the latent states from the inference network for all training instances, then calculating the overall frequency (Mathieu et al., 2019). Figure 2 shows that topK summation leads to the posterior collapse as there exist multiple inactive states (frequency $= 0$ ). Here it is important to note that gradients only pass through the top $K_{1}$ indices $\Omega_t^{K_1}$ and tail samples $\Omega_t^{K_2}$ during training. This means that increasing $K_{1}$ leads to exploiting states that are already confident enough during training, while increasing $K_{2}$ leads to exploring less confident states, which consequently leads to increased tail frequency of the aggregated posterior (after convergence). + +# 6. Conclusion + +This work proposes the randomized sum-product algorithms for scaling structured models to tens of thousands of latent states. Our method is widely applicable to classical DP- + +based inference and different graph structures. Our methods reduce computation complexity by orders of magnitude compared to existing alternatives and is compatible with automatic differentiation and modern neural networks. We hope this method will open new possibilities of large-scale deep structured prediction models. + +# Acknowledgements + +We thank Hao Tang and Ivan Titov for insightful comments on the practical issues of automatic differentiation. ML is supported by European Research Council (ERC CoG TransModal 681760) and EPSRC (grant no EP/W002876/1). JPC is supported by the Simons Foundation, McKnight Foundation, Grossman Center for the Statistics of Mind, and Gatsby Charitable Trust. + +# References + +Ammar, W., Dyer, C., and Smith, N. A. Conditional random field autoencoders for unsupervised structured prediction. In Advances in Neural Information Processing Systems, pp. 3311-3319, 2014. +Beatson, A. and Adams, R. P. Efficient optimization of loops and limits with randomized telescoping sums. In Chaudhuri, K. and Salakhutdinov, R. (eds.), Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pp. 534-543. PMLR, 09-15 Jun 2019. URL https://proceedings.mlr.press/v97/beatson19a.html. +Blunsom, P. and Cohn, T. Inducing synchronous grammars with slice sampling. In Human Language Technologies: The 2010 Annual Conference of the North American Chapter of the Association for Computational Linguistics, pp. 238-241, Los Angeles, California, June 2010. Association for Computational Linguistics. URL https://aclanthology.org/N10-1028. +Bouchard-côté, A., Petrov, S., and Klein, D. Randomized pruning: Efficiently calculating expectations in large dynamic programs. In Bengio, Y., Schuurmans, D., Lafferty, J., Williams, C., and Culotta, A. (eds.), Advances in Neural Information Processing Systems, volume 22. Curran Associates, Inc., 2009. URL https://proceedings.neurips.cc/paper/2009/file/e515df0d202ae52fcebb14295743063b-Paper.pdf. +Chiu, J. and Rush, A. M. Scaling hidden markov language models. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 1341-1349, 2020. + +Chiu, J. T., Deng, Y., and Rush, A. M. Low-rank constraints for fast inference in structured models. In Thirty-Fifth Conference on Neural Information Processing Systems, 2021. URL https://openreview.net/forum?id=Mcldz4OJ6QB. +Correia, G., Niculae, V., Aziz, W., and Martins, A. Efficient marginalization of discrete and structured latent variables via sparsity. Advances in Neural Information Processing Systems, 33, 2020. +Corro, C. and Titov, I. Differentiable perturb-and-parse: Semi-supervised parsing with a structured variational autoencoder. arXiv preprint arXiv:1807.09875, 2018. +Eisner, J. Inside-outside and forward-backward algorithms are just backprop (tutorial paper). In Proceedings of the Workshop on Structured Prediction for NLP, pp. 1-17, Austin, TX, November 2016. Association for Computational Linguistics. doi: 10.18653/v1/W16-5901. URL https://aclanthology.org/W16-5901. +Fu, Y., Tan, C., Bi, B., Chen, M., Feng, Y., and Rush, A. M. Latent template induction with gumbel-crf. In NeurIPS, 2020. +Halko, N., Martinsson, P. G., and Tropp, J. A. Finding structure with randomness: Probabilistic algorithms for constructing approximate matrix decompositions. SIAM Review, 53(2):217-288, 2011. doi: 10.1137/090771806. URL https://doi.org/10.1137/090771806. +Ihler, A. and McAllester, D. Particle belief propagation. In van Dyk, D. and Welling, M. (eds.), Proceedings of the Twelfth International Conference on Artificial Intelligence and Statistics, volume 5 of Proceedings of Machine Learning Research, pp. 256-263, Hilton Clearwater Beach Resort, Clearwater Beach, Florida USA, 16-18 Apr 2009. PMLR. URL https://proceedings.mlr.press/v5/ihler09a.html. +Jeong, M., Lin, C.-Y., and Lee, G. G. Efficient inference of crfs for large-scale natural language data. In Proceedings of the ACL-IJCNLP 2009 Conference Short Papers, pp. 281-284, 2009. +Kim, Y., Rush, A. M., Yu, L., Kuncoro, A., Dyer, C., and Melis, G. Unsupervised recurrent neural network grammars. 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. 1105-1117, 2019. +Klein, D. and Manning, C. D. A* parsing: Fast exact viterbi parse selection. In Proceedings of the 2003 Human Language Technology Conference of the North American Chapter of the Association for Computational Linguistics, pp. 119-126, 2003. + +Koller, D., Lerner, U., and Angelov, D. A general algorithm for approximate inference and its application to hybrid bayes nets. In Proceedings of the Fifteenth conference on Uncertainty in artificial intelligence, pp. 324-333, 1999. +Lavernge, T., Cappé, O., and Yvon, F. Practical very large scale crfs. In Proceedings of the 48th Annual Meeting of the Association for Computational Linguistics, pp. 504-513, 2010. +Li, C., Gao, X., Li, Y., Peng, B., Li, X., Zhang, Y., and Gao, J. Optimus: Organizing sentences via pre-trained modeling of a latent space. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 4678-4699, 2020. +Li, X. L. and Rush, A. Posterior control of blackbox generation. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pp. 2731-2743, Online, July 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.acl-main.243. URL https://aclanthology.org/2020.acl-main.243. +Li, Z. and Eisner, J. First- and second-order expectation semirings with applications to minimum-risk training on translation forests. In Proceedings of the 2009 Conference on Empirical Methods in Natural Language Processing, pp. 40-51, Singapore, August 2009. Association for Computational Linguistics. URL https://aclanthology.org/D09-1005. +Liu, R., Regier, J., Tripuraneni, N., Jordan, M., and McAuliffe, J. Rao-blackwellized stochastic gradients for discrete distributions. In International Conference on Machine Learning, pp. 4023-4031. PMLR, 2019. +Ma, X. and Hovy, E. End-to-end sequence labeling via bi-directional LSTM-CNNs-CRF. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 1064-1074, Berlin, Germany, August 2016. Association for Computational Linguistics. doi: 10.18653/v1/P16-1101. URL https://aclanthology.org/P16-1101. +Mahoney, M. W. Randomized algorithms for matrices and data. Found. Trends Mach. Learn., 3(2):123-224, feb 2011. ISSN 1935-8237. doi: 10.1561/220000035. URL https://doi.org/10.1561/220000035. +Mann, G. and McCallum, A. Efficient computation of entropy gradient for semi-supervised conditional random fields. In Human Language Technologies 2007: The Conference of the North American Chapter of the Association for Computational Linguistics; Companion Volume, Short Papers, pp. 109-112, Rochester, New York, April 2007. Association for Computational Linguistics. URL https://aclanthology.org/N07-2028. + +Martins, A. F. T., Mihaylova, T., Nangia, N., and Niculae, V. Latent structure models for natural language processing. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics: Tutorial Abstracts, pp. 1-5, Florence, Italy, July 2019. Association for Computational Linguistics. doi: 10.18653/v1/P19-4001. URL https://aclanthology.org/P19-4001. +Mathieu, E., Rainforth, T., Siddharth, N., and Teh, Y. W. Disentangling disentanglement in variational autoencoders. In International Conference on Machine Learning, pp. 4402-4412. PMLR, 2019. +Mensch, A. and Blondel, M. Differentiable dynamic programming for structured prediction and attention. In International Conference on Machine Learning, pp. 3462-3471. PMLR, 2018. +Mohamed, S., Rosca, M., Figurnov, M., and Mnih, A. Monte carlo gradient estimation in machine learning. J. Mach. Learn. Res., 21(132):1-62, 2020. +Oktay, D., McGreivy, N., Aduol, J., Beatson, A., and Adams, R. P. Randomized automatic differentiation. In International Conference on Learning Representations, 2020. +Paulus, M. B., Choi, D., Tarlow, D., Krause, A., and Maddison, C. J. Gradient estimation with stochastic softmax tricks. arXiv preprint arXiv:2006.08063, 2020. +Pillutla, V. K., Roulet, V., Kakade, S. M., and Harchaoui, Z. A smoother way to train structured prediction models. In Bengio, S., Wallach, H., Larochelle, H., Grauman, K., Cesa-Bianchi, N., and Garnett, R. (eds.), Advances in Neural Information Processing Systems, volume 31. Curran Associates, Inc., 2018. URL https://proceedings.neurips.cc/paper/2018/file/6211080fa89981f66b1a0c9d55c61d0f-Paper.pdf. +Potapczynski, A., Wu, L., Biderman, D., Pleiss, G., and Cunningham, J. P. Bias-free scalable gaussian processes via randomized truncations. In Meila, M. and Zhang, T. (eds.), Proceedings of the 38th International Conference on Machine Learning, volume 139 of Proceedings of Machine Learning Research, pp. 8609-8619. PMLR, 18-24 Jul 2021. URL https://proceedings.mlr.press/v139/potapczynski21a.html. +Rajbhandari, S., Rasley, J., Ruwase, O., and He, Y. Zero: Memory optimizations toward training trillion parameter models. In Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis, SC '20. IEEE Press, 2020. ISBN 9781728199986. + +Ranganath, R., Gerrish, S., and Blei, D. Black Box Variational Inference. In Kaski, S. and Corander, J. (eds.), Proceedings of the Seventeenth International Conference on Artificial Intelligence and Statistics, volume 33 of Proceedings of Machine Learning Research, pp. 814-822, Reykjavik, Iceland, 22-25 Apr 2014. PMLR. URL https://proceedings.mlr.press/v33/ranganath14.html. +Rhodes, B., Xu, K., and Gutmann, M. U. Telescoping density-ratio estimation. In Larochelle, H., Ranzato, M., Hadsell, R., Balcan, M. F., and Lin, H. (eds.), Advances in Neural Information Processing Systems, volume 33, pp. 4905-4916. Curran Associates, Inc., 2020. URL https://proceedings.neurips.cc/paper/2020/file/33d3b157ddc0896addfb22fa2a519097-Paper.pdf. +Rush, A. M. Torch-struct: Deep structured prediction library. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics: System Demonstrations, pp. 335-342, 2020. +Sokolovska, N., Lavergne, T., Cappé, O., and Yvon, F. Efficient learning of sparse conditional random fields for supervised sequence labeling. IEEE Journal of Selected Topics in Signal Processing, 4:953-964, 2010. +Sun, Z., Li, Z., Wang, H., He, D., Lin, Z., and Deng, Z. Fast structured decoding for sequence models. Advances in Neural Information Processing Systems, 32:3016-3026, 2019. +Sutton, C. and McCallum, A. An introduction to conditional random fields for relational learning. Introduction to statistical relational learning, 2:93-128, 2006. +Wainwright, M. J. and Jordan, M. I. Graphical models, exponential families, and variational inference. Now Publishers Inc, 2008. +Wiseman, S., Shieber, S., and Rush, A. Learning neural templates for text generation. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pp. 3174-3187, Brussels, Belgium, October-November 2018. Association for Computational Linguistics. doi: 10.18653/v1/D18-1356. URL https://aclanthology.org/D18-1356. +Yang, S., Zhao, Y., and Tu, K. Pcfgs can do better: Inducing probabilistic context-free grammars with many symbols. arXiv preprint arXiv:2104.13727, 2021. +Zhang, Y., Li, Z., and Zhang, M. Efficient second-order treecrf for neural dependency parsing. arXiv preprint arXiv:2005.00975, 2020. + +# A. Biasedness Analysis of Randomized Forward + +In this section, we discuss the unbiasedness and variance of the Randomized Forward algorithm. We first show that Randomized Forward gives an unbiased estimator of the partition function. + +Theorem A.1 (Unbiasedness). For all $t \in [1,2,\dots,T]$ , the sampled sum $\hat{\alpha}_t$ (Eq. 17) is an unbiased estimator of the forward variable $\alpha_t$ . The final sampled sum $\hat{Z}$ is an unbiased estimator of the partition function $Z$ . + +Proof. By the Second Principle of Mathematical Induction. Assume initialization $\alpha_{1}(i) = \phi (x_{1},i)$ . Firstly at $t = 2$ , for all $i$ , we have: + +$$ +\mathbb {E} _ {q _ {1}} \left[ \hat {\alpha} _ {2} (i) \right] = \sum_ {j = 1} ^ {K _ {1}} \alpha_ {1} \left(\sigma_ {1, j}\right) \Phi \left(\sigma_ {1, j}, i\right) \phi \left(x _ {2}, i\right) + \frac {1}{K _ {2}} \underbrace {\sum_ {j = 1} ^ {K _ {2}} \mathbb {E} _ {q _ {1}} \left[ \frac {\tilde {Z} _ {1}}{\tilde {q} _ {1} \left(\delta_ {1 , j}\right)} \alpha_ {1} \left(\delta_ {1 , j}\right) \Phi \left(\delta_ {1 , j}\right) \phi \left(x _ {2} , i\right) \right]} _ {= A} \tag {35} +$$ + +where the second term can be expanded as a masked summation with the index rearranged from $\sigma_{2,K_1 + 1}$ to $\sigma_{2,N}$ : + +$$ +\begin{array}{l} A = \sum_ {j = 1} ^ {K _ {2}} \mathbb {E} _ {q _ {1}} \left[ \frac {\tilde {Z} _ {1}}{\tilde {q} _ {1} (\delta_ {1 , j})} \alpha_ {1} \left(\delta_ {1, j}\right) \Phi \left(\delta_ {1, j}\right) \phi \left(x _ {2}, i\right) \right] (36) \\ = \sum_ {k = 1} ^ {K _ {2}} \sum_ {j = K _ {1} + 1} ^ {N} \mathbb {E} _ {q _ {1}} \left[ \frac {1}{q _ {1} (\delta_ {1 , k})} \mathbb {1} \left(\delta_ {1, k} = j\right) \alpha_ {1} \left(\sigma_ {1, j}\right) \Phi \left(\sigma_ {1, j}\right) \phi \left(x _ {2}, i\right) \right] (37) \\ = \sum_ {k = 1} ^ {K _ {2}} \sum_ {j = K _ {1} + 1} ^ {N} \underbrace {\mathbb {E} _ {q _ {1}} \left[ \frac {1}{q _ {1} (\delta_ {1 , k})} \mathbb {1} \left(\delta_ {1 , k} = j\right) \right]} _ {= 1} \alpha_ {1} \left(\sigma_ {1, j}\right) \Phi \left(\sigma_ {1, j}\right) \phi \left(x _ {2}, i\right) (38) \\ = K _ {2} \sum_ {j = K _ {1} + 1} ^ {N} \alpha_ {1} \left(\sigma_ {1, j}\right) \Phi \left(\sigma_ {1, j}\right) \phi \left(x _ {2}, i\right) (39) \\ \end{array} +$$ + +Notice how we re-index the sum. Now put it back to Eq. 35 to get: + +$$ +\begin{array}{l} \mathbb {E} _ {q _ {1}} [ \hat {\alpha} _ {2} (i) ] = \sum_ {j = 1} ^ {K _ {1}} \alpha_ {1} \left(\sigma_ {1, j}\right) \Phi \left(\sigma_ {1, j}, i\right) \phi \left(x _ {2}, i\right) + \frac {1}{K _ {2}} \cdot K _ {2} \sum_ {j = K _ {1} + 1} ^ {N} \alpha_ {1} \left(\sigma_ {1, j}\right) \Phi \left(\sigma_ {1, j}\right) \phi \left(x _ {2}, i\right) (40) \\ = \sum_ {j = 1} ^ {N} \alpha_ {1} \left(\sigma_ {1, j}\right) \Phi \left(\sigma , j, i\right) \phi \left(x _ {2}, i\right) (41) \\ = \sum_ {j = 1} ^ {N} \alpha_ {1} (j) \Phi (j, i) \phi \left(x _ {2}, i\right) (42) \\ = \alpha_ {2} (i) (43) \\ \end{array} +$$ + +This verifies the induction foundation that $\mathbb{E}_{q_1}[\hat{\alpha}_2(i)] = \alpha_2(i)$ for all $i$ . + +Now assume for all time index up to $t$ we have: + +$$ +\forall i, \mathbb {E} _ {q _ {1: t - 1}} [ \hat {\alpha} _ {t} (i) ] = \alpha_ {t} (i) \tag {44} +$$ + +Consider $t + 1$ , we have: + +$$ +\begin{array}{l} \mathbb {E} _ {1: q _ {t}} \left[ \hat {\alpha} _ {t + 1} (i) \right] = \sum_ {j = 1} ^ {K _ {1}} \mathbb {E} _ {q _ {1: t - 1}} \left[ \hat {\alpha} _ {t} \left(\sigma_ {t, j}\right) \right] \Phi \left(\sigma_ {t, j}, i\right) \phi \left(x _ {t + 1}, i\right) (45) \\ + \frac {1}{K _ {2}} \sum_ {j = 1} ^ {K _ {2}} \mathbb {E} _ {q _ {1: t - 1}} \left[ \hat {\alpha} _ {t} \left(\delta_ {t, j}\right) \right] \cdot \mathbb {E} _ {q _ {t}} \left[ \frac {\tilde {Z} _ {t}}{\tilde {q} _ {t} \left(\delta_ {t , j}\right)} \Phi \left(\delta_ {t, j}\right) \phi \left(x _ {t + 1}, i\right) \right] (46) \\ = \sum_ {j = 1} ^ {K _ {1}} \alpha_ {t} \left(\sigma_ {t, j}\right) \Phi \left(\sigma_ {t, j}, i\right) \phi \left(x _ {t + 1}, i\right) (47) \\ + \frac {1}{K _ {2}} \underbrace {\sum_ {j = 1} ^ {K _ {2}} \alpha_ {t} \left(\sigma_ {t , j}\right) \cdot \mathbb {E} _ {q _ {t}} \left[ \frac {\tilde {Z} _ {t}}{\tilde {q} _ {t} \left(\delta_ {t , j}\right)} \Phi \left(\delta_ {t , j}\right) \phi \left(x _ {t + 1} , i\right) \right]} _ {= A ^ {\prime}} (48) \\ \end{array} +$$ + +Note how we decompose the expectation by using the independence: $q_{1:t} = q_{1:t - 1} \cdot q_t$ . With a similar masked summation trick as $A$ , we have: + +$$ +A ^ {\prime} = K _ {2} \sum_ {j = K _ {1} + 1} ^ {N} \alpha_ {t} \left(\sigma_ {t, j}\right) \Phi \left(\sigma_ {t, j}, i\right) \phi \left(x _ {t + 1}, i\right) \tag {49} +$$ + +This gives us: + +$$ +\begin{array}{l} \mathbb {E} _ {1: q _ {t}} \left[ \hat {\alpha} _ {t + 1} (i) \right] = \sum_ {j = 1} ^ {K _ {1}} \alpha_ {t} \left(\sigma_ {t, j}\right) \Phi \left(\sigma_ {t, j}, i\right) \phi \left(x _ {t + 1}, i\right) + \frac {1}{K _ {2}} \cdot K _ {2} \sum_ {j = K _ {1} + 1} ^ {N} \alpha_ {t} \left(\sigma_ {t, j}\right) \Phi \left(\sigma_ {t, j}, i\right) \phi \left(x _ {t + 1}, i\right) (50) \\ = \sum_ {j = 1} ^ {N} \alpha_ {t} \left(\sigma_ {t, j}\right) \Phi \left(\sigma_ {t, j}, i\right) \phi \left(x _ {t + 1}, i\right) (51) \\ = \sum_ {j = 1} ^ {N} \alpha_ {t} (j) \Phi (j, i) \phi \left(x _ {t + 1}, i\right) (52) \\ = \alpha_ {t + 1} (i) (53) \\ \end{array} +$$ + +Thus showing $\hat{\alpha}_{t + 1}$ is also an unbiased estimator for $\alpha_{t + 1}$ at each step $t + 1$ . Setting $t = T$ , the last step, gives us $\mathbb{E}[\hat{Z}] = Z$ (details similar to the above). + +Corollary A.2. When we change the (sum, product) semiring to the (log-sum-exp, sum) semiring, the expectation of the estimator will become a lower bound of $\log \alpha_{t}$ and $\log Z$ . + +Proof. Denote $l_{t}(i) = \log \alpha_{t}(i)$ and $\Omega$ the set of sampled indices where $|\Omega| = K_{2}$ . For simplicity, we omit the top $K_{1}$ summation and only show the summation of the sample. Cases where $t > 2$ can be derived similarly as following: + +$$ +\hat {l} _ {2} (i) = \log \sum_ {j \in \Omega} \exp \left(l _ {1} (j) + \log \Phi (j, i) + \log \phi \left(x _ {t}, i\right)\right) - \log K _ {2} \tag {54} +$$ + +$$ +\begin{array}{l} \mathbb {E} \left[ \hat {l} _ {2} (i) \right] = \mathbb {E} \left[ \log \sum_ {j \in \Omega} \exp \left(l _ {1} (j) + \log \Phi (j, i) + \log \phi \left(x _ {t}, i\right)\right) \right] - \log K _ {2} (55) \\ \leq \log \mathbb {E} \left[ \sum_ {j \in \Omega} \exp \left(l _ {1} (j) + \log \Phi (j, i) + \log \phi \left(x _ {t}, i\right)\right) \right] - \log K _ {2} (56) \\ = \log K _ {2} - \log K _ {2} + \log \sum_ {j \in \Omega} \exp (l _ {1} (j) + \log \Phi (j, i) + \log \phi (x _ {t}, i)) (57) \\ = l _ {2} (i) (58) \\ \end{array} +$$ + +where Eq. 56 comes from Jensen's inequality. Then by induction one can show at everystep, we have $\mathbb{E}[\hat{l}_t(i)]\leq l_t(i)$ + +Although implementation in the log space makes the estimate biased, it reduces the variance exponentially in a rather trivial way. It also provides numerical stability. So, in practice we use it for training. + +# B. Variance Analysis of Randomized Forward + +Now we analyze variance. We start with the estimator $a_{\delta} / q_{\delta}$ , $\delta \sim \mathrm{Categorical}\{q_{K_1 + 1},\dots q_{K_N}\}$ in Eq. 4. Firstly, this is an unbiased estimator of the tail sum: + +$$ +\mathbb {E} \left[ a _ {\delta} / q _ {\delta} \right] = \sum_ {i = K _ {1} + 1} ^ {N} a _ {i} \tag {59} +$$ + +We have the folling variance arguments: + +Theorem B.1 (Variance of the tail estimator). + +$$ +\begin{array}{l} \mathbb {V} \left[ a _ {\delta} / q _ {\delta} \right] = \sum_ {i = K _ {1} + 1} ^ {N} a _ {i} ^ {2} / q _ {i} - \left(\sum_ {i = K _ {1} + 1} ^ {N} a _ {i}\right) ^ {2} (60) \\ = S _ {K _ {1}} ^ {2} \left(\sum_ {i = K _ {1} + 1} ^ {N} \epsilon_ {i} ^ {2} / q _ {i} + 2 \epsilon_ {i}\right) (61) \\ \end{array} +$$ + +where + +$$ +S _ {K _ {1}} = \sum_ {i = K _ {1} + 1} ^ {N} a _ {i} \quad \epsilon_ {i} = a _ {i} / S _ {K _ {1}} - q _ {i} \tag {62} +$$ + +which says the variance is: + +- quadratic to the tail sum $S_{K_1}$ , which will be reduced by increasing $K_1$ as the effect of Rao-Blackwellization. +- approximately quadratic to the gap $\epsilon_{i}$ , as the differences between the proposal $q_{i}$ and the oracle $a_{i} / S_{K_{1}}$ , which can be reduced by choosing a correlated proposal as the effect of importance sampling. + +Optimal zero variance is achieved on + +$$ +q _ {i} ^ {*} = a _ {i} / S _ {K _ {1}} \tag {63} +$$ + +Proof. The variance is then: + +$$ +\mathbb {V} \left[ a _ {\delta} / q _ {\delta} \right] = \mathbb {E} \left[ \left(a _ {\delta} / q _ {\delta}\right) ^ {2} \right] - \mathbb {E} \left[ a _ {\delta} / q _ {\delta} \right] ^ {2} \tag {64} +$$ + +where the first term is the second moment: + +$$ +\begin{array}{l} \left(a _ {\delta} / q _ {\delta}\right) ^ {2} = \left(\sum_ {i = K _ {1} + 1} ^ {N} a _ {i} \mathbb {1} [ \delta = i ] / q _ {i}\right) ^ {2} (65) \\ = \sum_ {i = K _ {1} + 1} ^ {N} a _ {i} ^ {2} \mathbb {1} [ \delta = i ] / q _ {i} ^ {2} + \underbrace {2 \sum_ {i = K _ {1} + 1} ^ {N} \sum_ {j = K _ {1} + 1} ^ {N} \frac {a _ {i} a _ {j} \mathbb {1} [ \delta = i ] \mathbb {1} [ \delta = j ]}{q _ {i} q _ {j}}} _ {= 0} (66) \\ = \sum_ {i = K _ {1} + 1} ^ {N} a _ {i} ^ {2} \mathbb {1} [ \delta = i ] / q _ {i} ^ {2} (67) \\ \end{array} +$$ + +taking the expectation of it we get: + +$$ +\begin{array}{l} \mathbb {E} \left[ \left(a _ {\delta} / q _ {\delta}\right) ^ {2} \right] = \mathbb {E} \left[ \sum_ {i = K _ {1} + 1} ^ {N} a _ {i} ^ {2} \mathbb {1} [ \delta = i ] / q _ {i} ^ {2} \right] (68) \\ = \sum_ {i = K _ {1} + 1} ^ {N} a _ {i} ^ {2} / q _ {i} (69) \\ \end{array} +$$ + +Plug this back, variance is: + +$$ +\mathbb {V} \left[ a _ {\delta} / q _ {\delta} \right] = \sum_ {i = K _ {1} + 1} ^ {N} a _ {i} ^ {2} / q _ {i} - \left(\sum_ {i = K _ {1} + 1} ^ {N} a _ {i}\right) ^ {2} \tag {70} +$$ + +To get the optimal proposal, we solve the constrained optimization problem: + +$$ +\min _ {q _ {i}} \sum_ {i = K _ {1} + 1} ^ {N} a _ {i} ^ {2} / q _ {i} - \left(\sum_ {i = K _ {1} + 1} ^ {N} a _ {i}\right) ^ {2} \tag {71} +$$ + +$$ +s. t. \sum_ {i = K _ {1} + 1} ^ {N} q _ {i} = 1 \tag {72} +$$ + +By solving the corresponding Lagrangian equation system (omitted here), we get the optimal value achieved at: + +$$ +q _ {i} ^ {*} = \frac {a _ {i}}{\sum_ {i = K _ {1} + 1} ^ {N} a _ {i}} \quad \sum_ {i = K _ {1} + 1} ^ {N} a _ {i} ^ {2} / q _ {i} ^ {*} - \left(\sum_ {i = K _ {1} + 1} ^ {N} a _ {i}\right) ^ {2} = 0 \tag {73} +$$ + +This says zero variance is achieved by a proposal equal to the normalized summands. + +Then define the gap between the proposal and the normalized summands as: + +$$ +\epsilon_ {i} = \frac {a _ {i}}{S _ {K _ {1}}} - q _ {i} \tag {74} +$$ + +Plug this to the variance expression we get: + +$$ +\mathbb {V} \left[ a _ {\delta} / q _ {\delta} \right] = S _ {K _ {1}} ^ {2} \left(\sum_ {i = K _ {1} + 1} ^ {N} \epsilon_ {i} ^ {2} / q _ {i} + 2 \epsilon_ {i}\right) \tag {75} +$$ + +Corollary B.2. When increasing the sample size to $K_{2}$ , the variance will reduce to + +$$ +\mathbb {V} \left[ \frac {1}{K _ {2}} \sum_ {j = 1} ^ {N} \frac {a _ {\delta_ {j}}}{q _ {\delta_ {j}}} \right] = \frac {1}{K _ {2}} S _ {K _ {1}} ^ {2} \left(\sum_ {i = K _ {1} + 1} ^ {N} \epsilon_ {i} ^ {2} / q _ {i} + 2 \epsilon_ {i}\right) \tag {76} +$$ + +Now we consider the variance of the Sampled Forward algorithm. An exact computation would give complicated results. For simplification, we give an asymptotic argument with regard to Rao-Blackwellization and importance sampling: + +Theorem B.3 (Single Step Asymptotic Variance of Sampled Forward). At each step, the alpha variable estimator has the following asymptotic variance: + +$$ +\mathbb {V} \left[ \hat {\alpha} _ {t} (i) \right] = O \left(\frac {1}{K _ {2}} \alpha_ {t, K _ {1}} ^ {2} (i) \cdot \epsilon_ {t} ^ {2} (i)\right) \tag {77} +$$ + +where: + +- $\alpha_{t+1,K_1}(i) = \sum_{j=K_1+1}^{N} \tilde{\alpha}_t(j,i) = \sum_{j=K_1+1}^{N} \sqrt{\mathbb{E}_{q_{1:t-1}}[\hat{\alpha}_t^2(j)]} \Phi(j,i) \phi(x_t,i)$ is a tail sum after the top $K_1$ summands. This term will reduce if we increase $K_1$ , as an instance of Rao-Blackwellization. +- $\epsilon_t^2 (i) = \sum_{j = K_1 + 1}^N\epsilon_{t - 1}^2 (j,i) / q_{t - 1}(j)$ and $\epsilon_{t - 1}(j,i)$ is the difference between the proposal $q_{t - 1}(j)$ and the oracle proposal. This term will reduce if the proposal is more correlated to the oracle, as an instance of Importance Sampling. + +Proof. We start with a simple setting where $K_{2} = 1$ . At step $t + 1$ we have the following variance recursion: + +$$ +\mathbb {E} _ {q _ {1: t}} \left[ \hat {\alpha} _ {t + 1} ^ {2} (i) \right] = \sum_ {j = K _ {1} + 1} ^ {N} \frac {\Phi^ {2} (j , i) \phi^ {2} \left(x _ {t + 1} , i\right)}{q _ {t} (j)} \cdot \mathbb {E} _ {q _ {1: t - 1}} \left[ \hat {\alpha} _ {t} ^ {2} (j) \right] \tag {78} +$$ + +This is derived by plugging estimator 17 to the variance Eq. 60 we have just derived. Denote: + +$$ +\alpha_ {t + 1, K _ {1}} (i) = \sum_ {j = K _ {1} + 1} ^ {N} \tilde {\alpha} _ {t} (j, i) = \sum_ {j = K _ {1} + 1} ^ {N} \sqrt {\mathbb {E} _ {q _ {1 : t - 1}} [ \hat {\alpha} _ {t} ^ {2} (j) ]} \Phi (j, i) \phi \left(x _ {t + 1}, i\right) \tag {79} +$$ + +Then we have + +$$ +\mathbb {V} _ {q _ {1: t}} [ \hat {\alpha} _ {t + 1} (i) ] = \alpha_ {t + 1, K _ {1}} ^ {2} (i) \left(\sum_ {j = K _ {1} + 1} ^ {N} \frac {\epsilon_ {t} ^ {2} (j , i)}{q _ {t} (i)} + 2 \epsilon_ {t} (j, i)\right) \tag {80} +$$ + +where $\epsilon_t(j,i)$ is the differences between the proposal and the normalized exact summands at step $t$ state $i$ : + +$$ +\epsilon_ {t} (j, i) = \frac {\tilde {\alpha} _ {t} (j , i)}{\sum_ {j = K _ {1} = 1} ^ {N} \tilde {\alpha} _ {t} (j , i)} - q _ {t} (j) \tag {81} +$$ + +Dropping out the first order errors and increasing the number of sample to $K_{2}$ , we have the asymptotics: + +$$ +\mathbb {V} [ \hat {\alpha} _ {t} (i) ] = O \left(\frac {1}{K _ {2}} \alpha_ {t, K _ {1}} ^ {2} (i) \cdot \epsilon_ {t} ^ {2} (i)\right) \tag {82} +$$ + +Theorem B.4 (Asymptotic Variance of Sampled Forward Partition Estimation). The alpha variable estimators has the following asymptotic variance recursion: + +$$ +\mathbb {V} \left[ \hat {\alpha} _ {t + 1} (i) \right] = O \left(\frac {1}{K _ {2}} \cdot \phi_ {t, K _ {1}} ^ {2} \cdot \epsilon_ {t, K _ {1}} ^ {2} \cdot \mathbb {V} [ \hat {\alpha} _ {t} ]\right) \tag {83} +$$ + +Compared with Eq. 77, this expression: + +- Uses the product of the factors $\phi_{t,K_1}$ (a function of the sum-prod of the factor at step $t$ ) and the previous step variance $\mathbb{V}[\hat{\alpha}_t]$ to substitute the $\alpha_{t,K_1}$ in equation 77. Again, this term will decrease with a larger $K_1$ (Rao-Blackwellization). +- $\epsilon_{t,K_1}^2 (i) = \sum_{j = K_1 + 1}^{N}\epsilon_{t - 1}^2 (j,i) / q_{t - 1}(j)$ and $\epsilon_{t - 1}(j,i)$ is the difference between the proposal $q_{t - 1}(j)$ and the oracle proposal. This term will reduce if the proposal is more correlated to the oracle, as an instance of Importance Sampling (same as Eq. 77). + +Consequently, the partition function has the following asymptotic variance: + +$$ +\mathbb {V} [ \hat {Z} ] = O \left(\prod_ {t = 1} ^ {T} \frac {1}{K _ {2}} \cdot \phi_ {t, K _ {1}} ^ {2} \cdot \epsilon_ {t, K _ {1}} ^ {2}\right) \tag {84} +$$ + +When implemented in the log space, the variance is trivially reduced exponentially: + +$$ +\mathbb {V} [ \log \hat {Z} ] = O \left(\sum_ {t = 1} ^ {T} \log \frac {1}{K _ {2}} + 2 \log \phi_ {t, K _ {1}} + 2 \log \epsilon_ {t, K _ {1}}\right) \tag {85} +$$ + +Proof. Firstly for simplicity we assume $K_{1} = 0$ and $K_{2} = 1$ . The estimator variance is: + +$$ +\begin{array}{l} \mathbb {V} \left[ \hat {\alpha} _ {t + 1} (i) \right] = \mathbb {E} _ {q _ {1: t}} \left[ \hat {\alpha} _ {t + 1} ^ {2} (i) \right] - \alpha_ {t + 1} ^ {2} (i) (86) \\ = \mathbb {E} _ {q _ {1: t - 1}} \left[ \sum_ {j = 1} ^ {N} \frac {\hat {\alpha} _ {t} ^ {2} (j) \Phi^ {2} (j , i) \phi^ {2} \left(x _ {t} , i\right)}{q _ {t} (j)} \cdot \frac {\alpha_ {t} ^ {2} (j)}{\alpha_ {t} ^ {2} (j)} \right] - \alpha_ {t + 1} ^ {2} (i) (87) \\ \end{array} +$$ + +Recall: + +$$ +\alpha_ {t + 1} (i) = \sum_ {j = 1} ^ {N} \alpha_ {t} (j) \phi (j, i) \phi \left(x _ {t}, i\right) \tag {88} +$$ + +Let: + +$$ +\epsilon_ {t} (j, i) = \underbrace {\frac {\alpha_ {t} (j) \phi (j , i) \phi \left(x _ {t} , i\right)}{\alpha_ {t + 1} (i)}} _ {= q \left(z _ {t} = j \mid z _ {t + 1} = i\right)} - q _ {t} (j) \tag {89} +$$ + +Then: + +$$ +\begin{array}{l} \mathbb {V} [ \hat {\alpha} _ {t + 1} (i) ] = \mathbb {E} _ {q _ {1: t - 1}} \left[ \sum_ {j = 1} ^ {N} \alpha_ {t + 1} ^ {2} (i) \left(\frac {\epsilon_ {t} ^ {2} (j , i)}{q _ {t} (j)} + 2 \epsilon_ {t} (j, i) + q _ {t} (j)\right) \frac {\hat {\alpha} _ {t} ^ {2} (j)}{\alpha_ {t} ^ {2} (j)} \right] - \alpha_ {t + 1} ^ {2} (i) (90) \\ = \alpha_ {t + 1} ^ {2} (i) \left(\sum_ {j = 1} ^ {N} \left(\frac {\mathbb {E} _ {q _ {1 : t - 1}} [ \hat {\alpha} _ {t} ^ {2} (j) ]}{\alpha_ {t} ^ {2} (j)} q _ {t} (j)\right) + \sum_ {j = 1} ^ {N} \left(\frac {\epsilon_ {t} ^ {2} (j , i)}{q _ {t} (j)} + 2 \epsilon_ {t} (j, i)\right) \frac {\mathbb {E} _ {q _ {1 : t - 1}} [ \hat {\alpha} _ {t} ^ {2} (j) ]}{\alpha_ {t} ^ {2} (j)}\right) (91) \\ - \alpha_ {t + 1} ^ {2} (i) (92) \\ \end{array} +$$ + +Note that there exist $J_{t}$ such that: + +$$ +\frac {\mathbb {E} _ {q _ {1 : t - 1}} \left[ \hat {\alpha} _ {t} ^ {2} (j) \right]}{\alpha_ {t} ^ {2} (j)} < = J _ {t} \tag {93} +$$ + +This is because of the bounded gap of the Jensen's inequality. Also recall: + +$$ +\sum_ {j = 1} ^ {N} q _ {t} (j) = 1 \tag {94} +$$ + +So we get: + +$$ +\begin{array}{l} \mathbb {V} [ \hat {\alpha} _ {t + 1} (i) ] < = \alpha_ {t + 1} ^ {2} (i) \left(J _ {t} - 1 + \sum_ {j = 1} ^ {N} \left(\frac {\epsilon_ {t} ^ {2} (j , i)}{q _ {t} (j)} + 2 \epsilon_ {t} (j, i)\right) \cdot \left(\frac {\mathbb {V} [ \hat {\alpha} _ {t} (j) ]}{\alpha_ {t} ^ {2} (j)} - 1\right)\right) (95) \\ = \alpha_ {t + 1} ^ {2} (i) \left(J _ {t} - 1 - \sum_ {j = 1} ^ {N} \left(\frac {\epsilon_ {t} ^ {2} (j , i)}{q _ {t} (j)} + 2 \epsilon_ {t} (j, i)\right)\right) (96) \\ + \alpha_ {t + 1} ^ {2} (i) \left(\sum_ {j = 1} ^ {N} \left(\frac {\epsilon_ {t} ^ {2} (j , i)}{q _ {t} (j)} + 2 \epsilon_ {t} (j, i)\right) \cdot \left(\frac {\mathbb {V} [ \hat {\alpha} _ {t} (j) ]}{\alpha_ {t} ^ {2} (j)}\right)\right) (97) \\ \end{array} +$$ + +empirically $J_{t}$ is not the dominate source of variance (but could be in the worst case, depending on the tightness of Jensen's inequality). We focus on the second term: + +$$ +\begin{array}{l} \mathbb {V} [ \hat {\alpha} _ {t + 1} (i) ] = O \left(\alpha_ {t + 1} ^ {2} (i) \left(\sum_ {j = 1} ^ {N} \left(\frac {\epsilon_ {t} ^ {2} (j , i)}{q _ {t} (j)} + 2 \epsilon_ {t} (j, i)\right) \cdot \left(\frac {\mathbb {V} [ \hat {\alpha} _ {t} (j) ]}{\alpha_ {t} ^ {2} (j)}\right)\right) \right. (98) \\ = O \left(\left(\sum_ {j = 1} ^ {N} \alpha_ {t} (j) \underbrace {\Phi (j , i) \phi \left(x _ {t} , j\right)} _ {O \left(\phi_ {t} ^ {2}\right)}\right) ^ {2} \cdot \left(\underbrace {\sum_ {j = 1} ^ {N} \left(\frac {\epsilon_ {t} ^ {2} (j , i)}{q _ {t} (j)} + 2 \epsilon_ {t} (j , i)\right)} _ {O \left(\epsilon_ {t} ^ {2}\right)} \cdot \frac {1}{\alpha_ {t} ^ {2} (j)} \cdot \underbrace {\mathbb {V} \left[ \hat {\alpha} _ {t} (j) \right]} _ {O (\mathbb {V} [ \alpha_ {t} ])}\right)\right) (99) \\ = O \left(\phi_ {t} ^ {2} \cdot \epsilon_ {t} ^ {2} \cdot \mathbb {V} [ \alpha_ {t} ]\right) (100) \\ \end{array} +$$ + +Note that a lot of higher-order sum-products are simplified here. Adding top $K_{1}$ summation and increasing the sample size to $K_{2}$ leads to variance reduction as: + +$$ +\mathbb {V} [ \hat {\alpha} _ {t + 1} (i) ] = O \left(\frac {1}{K _ {2}} \cdot \phi_ {t, K _ {1}} ^ {2} \cdot \epsilon_ {t, K _ {1}} ^ {2} \cdot \mathbb {V} [ \alpha_ {t} ]\right) \tag {101} +$$ + +Recursively expand this equation we get: + +$$ +\mathbb {V} [ \hat {Z} ] = O \left(\prod_ {t = 1} ^ {T} \frac {1}{K _ {2}} \cdot \phi_ {t, K _ {1}} ^ {2} \cdot \epsilon_ {t, K _ {1}} ^ {2}\right) \tag {102} +$$ + +Chaning the implementation to the log space we reduce the variance exponentially: + +$$ +\mathbb {V} [ \log \hat {Z} ] = O \left(\sum_ {t = 1} ^ {T} \log \frac {1}{K _ {2}} + 2 \log \phi_ {t, K _ {1}} + 2 \log \epsilon_ {t, K _ {1}}\right) \tag {103} +$$ + +![](images/67f7d18eb4c3128f7487ba477776d1e0c5c2ed381d6258b5b55060cdfa305a1f.jpg) \ No newline at end of file diff --git a/scalingstructuredinferencewithrandomization/images.zip b/scalingstructuredinferencewithrandomization/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..b16d9f4109f8035522c562394e469c306bcd8516 --- /dev/null +++ b/scalingstructuredinferencewithrandomization/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1fa28337c5ca3806e3927ddcf7dc7435cd97a402d98a20932e45876f0373b158 +size 1027188 diff --git a/scalingstructuredinferencewithrandomization/layout.json b/scalingstructuredinferencewithrandomization/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..5db810d020d185767dde5fc30fffdd9b65a117bd --- /dev/null +++ b/scalingstructuredinferencewithrandomization/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a48eb8221f4329d21cf480bde7797abf68937d8c577833bd020a63fcc6b62d47 +size 739825 diff --git a/scalingupdiverseorthogonalconvolutionalnetworksbyaparaunitaryframework/0046e3ab-8bf6-4fb4-9ed4-08c5c3c3aa30_content_list.json b/scalingupdiverseorthogonalconvolutionalnetworksbyaparaunitaryframework/0046e3ab-8bf6-4fb4-9ed4-08c5c3c3aa30_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..dc6590640a732918dd7e4943f873827532407e41 --- /dev/null +++ b/scalingupdiverseorthogonalconvolutionalnetworksbyaparaunitaryframework/0046e3ab-8bf6-4fb4-9ed4-08c5c3c3aa30_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:87259f6d815aad9010f5ea8b744a23e1b832620a01b3e51298a66d26866cd399 +size 251649 diff --git a/scalingupdiverseorthogonalconvolutionalnetworksbyaparaunitaryframework/0046e3ab-8bf6-4fb4-9ed4-08c5c3c3aa30_model.json b/scalingupdiverseorthogonalconvolutionalnetworksbyaparaunitaryframework/0046e3ab-8bf6-4fb4-9ed4-08c5c3c3aa30_model.json new file mode 100644 index 0000000000000000000000000000000000000000..37a97d212e4dc24716b232f9e522e59869cc6a10 --- /dev/null +++ b/scalingupdiverseorthogonalconvolutionalnetworksbyaparaunitaryframework/0046e3ab-8bf6-4fb4-9ed4-08c5c3c3aa30_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cd849c27276a8e651d46f7162def4c9ac42f7010b77040f737e2dea3daed9328 +size 291400 diff --git a/scalingupdiverseorthogonalconvolutionalnetworksbyaparaunitaryframework/0046e3ab-8bf6-4fb4-9ed4-08c5c3c3aa30_origin.pdf b/scalingupdiverseorthogonalconvolutionalnetworksbyaparaunitaryframework/0046e3ab-8bf6-4fb4-9ed4-08c5c3c3aa30_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..5705b55223ddc823e413a546adb0997412906dfd --- /dev/null +++ b/scalingupdiverseorthogonalconvolutionalnetworksbyaparaunitaryframework/0046e3ab-8bf6-4fb4-9ed4-08c5c3c3aa30_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7916b258e434af1aaf805ec77af5620843abdab13a12fa4b4e7a36bd1e91588e +size 1091408 diff --git a/scalingupdiverseorthogonalconvolutionalnetworksbyaparaunitaryframework/full.md b/scalingupdiverseorthogonalconvolutionalnetworksbyaparaunitaryframework/full.md new file mode 100644 index 0000000000000000000000000000000000000000..6d016dc7b3f443a6d177b13608ec81e6ef6f7c67 --- /dev/null +++ b/scalingupdiverseorthogonalconvolutionalnetworksbyaparaunitaryframework/full.md @@ -0,0 +1,1145 @@ +# Scaling-up Diverse Orthogonal Convolutional Networks by a Paraunitary Framework + +Jiahao Su $^{1}$ Wonmin Byeon $^{2}$ Furong Huang + +# Abstract + +Enforcing orthogonality in convolutional neural networks is a remedy for gradient vanishing/exploding problems and sensitivity to perturbation. Many previous approaches for orthogonal convolutions enforce orthogonality on its flattened kernel, which, however, do not lead to the orthogonality of the operation. Some recent approaches consider orthogonality for standard convolutional layers and propose specific classes of their realizations. In this work, we propose a theoretical framework that establishes the equivalence between diverse orthogonal convolutional layers in the spatial domain and the paraunitary systems in the spectral domain. Since 1D paraunitary systems admit a complete factorization, we can parameterize any separable orthogonal convolution as a composition of spatial filters. As a result, our framework endows high expressive power to various convolutional layers while maintaining their exact orthogonality. Furthermore, our layers are memory and computationally efficient for deep networks compared to previous designs. Our versatile framework, for the first time, enables the study of architectural designs for deep orthogonal networks, such as choices of skip connection, initialization, stride, and dilation. Consequently, we scale up orthogonal networks to deep architectures, including ResNet and ShuffleNet, substantially outperforming their shallower counterparts. Finally, we show how to construct residual flows, a flow-based generative model that requires strict Lipschitzness, using our orthogonal networks. Our code will be publicly available at https://github.com/umd-huang-lab/ortho-conv. + +*1 University of Maryland, College Park, MD USA 2NVIDIA Research, NVIDIA Corporation, Santa Clara, CA USA. Correspondence to: Jiahao Su , Furong Huang . + +Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s). + +# 1. Introduction + +Convolutional neural networks, whose deployment has witnessed extensive empirical success, still exhibit limitations that are not thoroughly studied. Firstly, deep convolutional networks are in general difficult to learn, and their high performance heavily relies on techniques that are not fully understood, such as skip-connections (He et al., 2016a), batch normalization (Ioffe & Szegedy, 2015), specialized initialization (Glorot & Bengio, 2010). Secondly, they are sensitive to imperceptible perturbations, including adversarial attacks (Goodfellow et al., 2014) and geometric transformations (Azulay & Weiss, 2019). Finally, a precise characterization of their generalizability is still under active investigation (Neyshabur et al., 2018; Jia et al., 2019). + +Orthogonal networks, which have a "flat" spectrum with all singular values of each linear layer being 1 (thus the output norm $\| \pmb{y} \|$ equals the input norm $\| \pmb{x} \|, \forall \pmb{x}$ ), alleviate all problems above. As shown in recent works, by enforcing orthogonality in neural networks, we obtain (1) easier optimization (Zhang et al., 2018a; Qi et al., 2020): since each orthogonal layer preserves the gradient norm during backpropagation, an orthogonal network is free from gradient vanishing/ exploding problems; (2) robustness against adversarial perturbation (Anil et al., 2019; Li et al., 2019b; Trockman & Kolter, 2021): since each orthogonal layer is 1-Lipschitz, an orthogonal network can not amplify any perturbation to the input to flip the output prediction; (3) better generalizability (Jia et al., 2019): a network's generalization error is positively related to the standard deviation of each linear layer's singular values, thus encouraging orthogonality in the network lowers its generalization error. + +Despite the benefits, enforcing orthogonality in convolutional networks is challenging. To avoid strict constraint, orthogonal initialization (dynamical isometry) (Pennington et al., 2017; 2018; Xiao et al., 2018) and orthogonal regularization (Wang et al., 2019; Qi et al., 2020) are opted for the gradient vanishing/exploding problems. However, as they do not enforce strict orthogonality (and Lipschitzness), these methods are unsuitable for applications that require strict Lipschitzness, such as adversarial robustness (Anil et al., 2019) and residual flows (Chen et al., 2019). + +Our goal is to enforce exact orthogonality in state-of-the-art deep convolutional networks without expensive overhead. We identify three main challenges. Challenge I: Achieving exact orthogonality throughout training. Prior works such as orthogonal regularization (Wang et al., 2019) and reshaped kernel orthogonality (Jia et al., 2017; Cisse et al., 2017), while enjoying algorithmic simplicity, fail to meet the requirement of exact orthogonality. Also, note that enforcing the constraint during training is necessary since a post-training orthogonalization can substantially alter the weight values and jeopardize the performance. Challenge II: Avoiding expensive computations. An efficient algorithm is crucial for scalability to large networks. Existing work based on projected gradient descent (Sedghi et al., 2019), however, requires expensive projection after each update. For instance, the projection step in Sedghi et al. (2019) computes an SVD and flattens the spectrum to enforce orthogonality, which costs $O(\text{size feature}) \cdot \text{channels}^3$ for a convolutional layer. Challenge III: Scaling-up to state-of-the-art deep convolutional networks. There are many variants to the standard convolutional layer essential for state-of-the-art networks, including dilated, strided, group convolutions. However, none of the existing methods proposes mechanisms to orthogonalize these variants. The lack of techniques, as a result, limits the broad applications of orthogonal convolutional layers to state-of-the-art networks. + +We resolve challenges I, II & III by proposing a parameterization of orthogonal convolutions. First, using the convolution theorem (Oppenheim et al., 1996) (spatial convolution is equivalent to spectral product), we reduce the problem of designing orthogonal convolutions to constructing unitary matrices for all frequencies, i.e., paraunitary systems (Vaidyanathan, 1993). Further using a complete factorization theorem of paraunitary systems, we obtain a parameterization in the spatial domain for all orthogonal 1D-convolutions and separable 2D-convolutions (no work achieves a complete parameterization of all orthogonal 2D-convolutions), which attains high expressiveness, computational/memory efficiency, and exact orthogonality. Since no previous approach achieved exact orthogonality, we are the first to show how essential exact orthogonality is in different types of networks — we observe that exact orthogonality in deeper architectures (with $>10$ layers) is beneficial to obtain robust performance. (more discussion on exact orthogonality in Appendix E.3). + +Furthermore, we unify orthogonal convolution variants (dilated, strided, and group convolutions) as paraunitary systems, allowing us to orthogonalize these variants using the same parameterization for standard convolutions. (No previous work presents mechanisms for learning these variants' orthogonal versions.) Since these variants are crucial in advanced architectures, our work makes it possible to generate the orthogonal counterparts of these architectures, allowing + +us to investigate their performance, which was not possible before. Combined with our study in skip-connection and initialization, we scale orthogonal networks to deep architectures, including ResNet and ShuffleNet, substantially outperforming their shallower counterparts (Section 6). Finally, we show how to deploy our orthogonal networks in Residual Flow (Chen et al., 2019), a flow-based generative model that requires strict Lipschitzness (Appendix F). + +# Summary of Contributions: + +(1) We establish the equivalence between orthogonal convolutions in the spatial domain and paraunitary systems in the spectral domain. Thus, we can interpret all existing approaches as implicit designs of paraunitary systems. +(2) Based on a factorization theorem of paraunitary systems, we propose a complete parameterization of orthogonal 1D-convolutions and separable 2D-convolutions, which attains high expressiveness, exact orthogonality (machine-epsilon), and computational/memory efficiency ( $< 50\%$ memory of previous methods). These features are crucial in learning deep orthogonal networks with state-of-the-art performance. +(3) We prove that orthogonality for various convolutional layers (strided, dilated, group) are also entirely characterized by paraunitary systems. Consequently, our parameterization easily extends to these variants, ensuring their exact orthogonality, completeness, and efficiency. +(4) We study the design considerations (choices of skip connection, initialization, depth, width, kernel size) for orthogonal networks, and show that orthogonal networks can scale to deep architectures (e.g., ResNet, ShuffleNet). + +# 2. Designing Orthogonal Convolutions via Paraunitary Systems + +Designing an orthogonal convolutional layer $\{\pmb{h}_{t,s}:\pmb{y}_t = \pmb{h}_{t,s}*\pmb{x}_s\}_{t=1,s=1}^{T,S}$ ( $s,t$ index input and output channels) in the spatial domain is challenging. Given length- $N$ inputs, the weight matrix of a convolutional layer is block-circulant, with its $(t,s)^{\mathrm{th}}$ block $\operatorname{Cir}(\pmb{h}_{t,s})\in \mathbb{R}^{N\times N}$ as: + +$$ +\operatorname {C i r} \left(\boldsymbol {h} _ {t, s}\right) = \left[ \begin{array}{c c c c} h _ {t, s} [ 1 ] & h _ {t, s} [ N ] & \dots & h _ {t, s} [ 2 ] \\ h _ {t, s} [ 2 ] & h _ {t, s} [ 1 ] & h _ {t, s} [ N ] & \dots \\ \vdots & \ddots & \ddots & \vdots \\ h _ {t, s} [ N ] & \dots & h _ {t, s} [ 2 ] & h _ {t, s} [ 1 ] \end{array} \right]. \tag {2.1} +$$ + +Therefore, a convolutional layer is orthogonal if the block-circulant matrix $[\operatorname{Cir}(\boldsymbol{h}_{t,s})]_{t=1,s=1}^{T,S}$ is orthogonal for any input length $N$ . However, it is not obvious how to enforce orthogonality in block-circulant matrices. + +# 2.1. Achieving Orthogonal Convolutions by Paraunitary Systems + +We propose a novel design of orthogonal convolutions from a spectral perspective, motivated by the convolution theorem (Theorem 2.1). For simplicity, we group the entries at the + +![](images/0d9f843a1a4326d84c9cee89b35c750bda77b0bda427196e299c080ebde5a622.jpg) +Figure 1. Complete design of 1D orthogonal convolution as a cascade of convolutions. The filter coefficients are depicted in each block, where $\mathbf{Q}$ is orthogonal and $U^{(\ell)}$ 's are column-orthogonal. + +same locations a vector/matrix, e.g., we denote $\{x_s[n]\}_{s=1}^S$ as $\pmb{x}[n] \in \mathbb{R}^S$ and $\{h_{t,s}[n]\}_{t=1,s=1}^{T,S}$ as $\pmb{h}[n] \in \mathbb{R}^{T \times S}$ . + +Theorem 2.1 (Convolution theorem (Oppenheim et al., 1996)). A convolutional layer $\pmb{h} \colon \pmb{y}[i] = \sum_{n} \pmb{h}[n] \pmb{x}[i - n]$ in the spatial domain is equivalent to matrix-vector products in the spectral domain, i.e., $\pmb{Y}(z) = \pmb{H}(z) \pmb{X}(z), \forall z \in \mathbb{C}$ . Here, $\pmb{X}(z) = \sum_{n=0}^{N-1} \pmb{x}[n] z^{-n}$ , $\pmb{Y}(z) = \sum_{n=0}^{N-1} \pmb{y}[n] z^{-n}$ , $\pmb{H}(z) = \sum_{n=-\underline{L}}^{\overline{L}} \pmb{h}[n] z^{-n}$ denote the $z$ -transforms of input, output, kernel respectively, where $N$ is the length of $\pmb{x}, \pmb{y}$ and $[-\underline{L}, \overline{L}]$ is the span of the filter $\pmb{h}$ . + +The convolution theorem states that a convolution layer is a matrix-vector product in the spectral domain. If the transfer matrix $\mathbf{H}(z)$ is unitary at $z = e^{\mathrm{j}\omega}$ for all frequencies $\forall \omega \in [0,2\pi)$ (j is the imaginary unit), the layer $\pmb{h}$ is orthogonal. + +As our major novelty, we design orthogonal convolutions via construction of unitary matrix $H(e^{\mathrm{j}\omega})$ at all frequencies $\omega \in [0,2\pi)$ , known as a paraunitary system (Vaidyanathan, 1993). Theorem B.6 shows that a convolutional layer is orthogonal in the spatial domain if and only if it is paraunitary in the spectral domain. + +Theorem 2.2 (Paraunitary theorem (Vaidyanathan, 1993)). A convolutional layer $\mathbf{Y}(z) = \mathbf{H}(z)\mathbf{X}(z)$ is orthogonal if and only if its transfer matrix $\mathbf{H}(z)$ is paraunitary, i.e., $\mathbf{H}(z)^{\dagger}\mathbf{H}(z) = \mathbf{I}$ , $\forall |z| = 1$ , or equivalently $\mathbf{H}(e^{\mathrm{j}\omega})^{\dagger}\mathbf{H}(e^{\mathrm{j}\omega}) = \mathbf{I}$ , $\forall \omega \in \mathbb{R}$ . In other words, the transfer matrix $\mathbf{H}(e^{\mathrm{j}\omega})$ is unitary for all frequencies $\omega \in \mathbb{R}$ . + +Benefits through paraunitary systems. (1) The spectral representation simplifies the designs of orthogonal convolutions without analyzing block-circulant matrices. (2) Since paraunitary systems are necessary and sufficient for orthogonal convolutions, it is impossible to find an orthogonal convolution whose transfer matrix is not paraunitary. (3) There exists a complete factorization of paraunitary systems: any paraunitary $H(z)$ is a product of multiple factors in the spectral domain (Equation (2.2a)). (4) Since spectral multipliesions correspond to spatial convolutions, any orthogonal convolution can be realized as cascaded convolutions, each parameterized by an orthogonal matrix (Equation (2.2b)). (5) There are mature methods that parameterize orthogonal matrices via unconstrained parameters. Consequently, we can learn orthogonal convolutions using standard optimizers on a model parameterized via our design. + +Interpretation of existing methods. Since paraunitary system is a necessary and sufficient for orthogonal convolution, all existing approaches, including singular value clipping and masking (SVCM) (Sedghi et al., 2019), block convolution orthogonal parameterization (BCOP) (Li et al., 2019b), Cayley Convolution (CayleyConv) (Trockman & Kolter, 2021), skew orthogonal convolution (SOC) design paraunitary systems implicitly. We discuss these approaches from the angle of paraunitary systems in Appendix C.3.3 + +# 2.2. Parameterization of Paraunitary Systems + +After reducing the problem of orthogonal convolutions to paraunitary systems, we are left with how to realize paraunitary systems. To address this, we use a complete factorization to realize any paraunitary system — Using Theorem C.7, any paraunitary system $H(z)$ can be written as + +$$ +\boldsymbol {H} (z) = \boldsymbol {V} (z; \boldsymbol {U} ^ {(- \underline {{L}})}) \dots \boldsymbol {V} (z; \boldsymbol {U} ^ {(- 1)}) \tag {2.2a} +$$ + +$$ +\mathbf {Q} \boldsymbol {V} (z ^ {- 1}; \boldsymbol {U} ^ {(1)}) \dots \boldsymbol {V} (z ^ {- 1}; \boldsymbol {U} ^ {(\overline {{L}})}), \text {w h e r e} +$$ + +$$ +\boldsymbol {V} (z; \boldsymbol {U} ^ {(\ell)}) = \boldsymbol {I} - \boldsymbol {U} ^ {(\ell)} \boldsymbol {U} ^ {(\ell) ^ {\top}} + \boldsymbol {U} ^ {(\ell)} \boldsymbol {U} ^ {(\ell) ^ {\top}} z, \tag {2.2b} +$$ + +$$ +\forall \ell \in \{- \underline {{L}}, \dots , - 1 \} \cup \{1, \dots , \bar {L} \}. +$$ + +Here $Q$ is an orthogonal matrix and each $U^{(\ell)}$ is a column-orthogonal matrix whose number of columns is sampled uniformly from $\{1,\dots ,T\}$ . As spectral multiplications are equivalent to spatial convolutions, the complete spectral factorization of paraunitary systems in Equation (2.2a) allows us to parameterize any orthogonal convolution in the spatial domain as cascaded convolutions of $V(z;U^{(\ell)})$ ’s spatial counterparts and the orthogonal matrix $Q$ . + +Model design in the spatial domain. Following Equation (2.2), we obtain a complete design of orthogonal 1D convolutions: using learnable (column)-orthogonal matrices $\left(\{\pmb{U}^{(\ell)}\}_{\ell = -\underline{L}}, \pmb{Q}, \{\pmb{U}^{(\ell)}\}_{\ell = 1}\right)$ , we parameterize a size $(\underline{L} + \overline{L} + 1)$ convolution as cascaded convolutions of the following filters in the spatial domain + +$$ +\left. \left\{\left[ \boldsymbol {I} - \boldsymbol {U} ^ {(\ell)} \boldsymbol {U} ^ {(\ell) ^ {\top}}, \boldsymbol {U} ^ {(\ell)} \boldsymbol {U} ^ {(\ell) ^ {\top}} \right] \right\} _ {\ell = - \frac {L}{-}} ^ {- 1}, \right. \tag {2.3} +$$ + +$$ +\boldsymbol {Q}, \left. \left\{\left[ \boldsymbol {U} ^ {(\ell)} \boldsymbol {U} ^ {(\ell) ^ {\top}}, \boldsymbol {I} - \boldsymbol {U} ^ {(\ell)} \boldsymbol {U} ^ {(\ell) ^ {\top}} \right] \right\} _ {\ell = 1} ^ {\overline {{L}}} \right.. +$$ + +Figure 1 visualizes our design of orthogonal convolution layers; each block denotes a convolution and the filter coefficients are displayed in each block. In practice, we compose + +![](images/9a76705d688e13142b5979d176961b21ade4cbac81f03208af143f95734fa9a3.jpg) +Figure 2. SC-Fac: A pipeline for designing orthogonal convolutional layer. (1) An orthogonal convolution $h[n]$ is equivalent a paraunitary system $H(z)$ in the spectral domain (Theorem 2.1). (2) The paraunitary system $H(z)$ is multiplications of factors characterized by (column-)orthogonal matrices $\left(\{U^{(\ell)}\}_{\ell = -\underline{L}}, Q, \{U^{(\ell)}\}_{\ell = 1}^{\overline{L}}\right)$ (Equation (2.2), Theorem B.6). (3) These orthogonal matrices are parameterized by skew-symmetric matrices using exponential map. + +all $(\underline{L} + \overline{L} + 1)$ filters into one for orthogonal convolution, which not only increases the computational parallelism but also avoids storing intermediate outputs between filters. With a complete factorization of paraunitary systems, we reduce the problem of designing orthogonal convolutions to the one for orthogonal matrices. + +Parameterization for orthogonal matrices. We perform a comparative study on different parameterizations of orthogonal matrices in Appendix C.4, including the Björck orthogonalization (Anil et al., 2019; Li et al., 2019b), the Cayley transform (Helfrich et al., 2018; Maduranga et al., 2019), and the exponential map (Lezcano-Casado & Martínez-Rubio, 2019). We follow the GeoTorch implementation (https://github.com/Lezcano/geotorch), which adopts a modified version of exponential map due to its efficiency, exactness, and completeness. The exponential map is a surjective mapping from a skew-symmetry matrix $\mathbf{A}$ to a special orthogonal matrix $\mathbf{U}$ (i.e., $\det(U) = 1$ ) with $\mathbf{U} = \exp(\mathbf{A}) = \mathbf{I} + \mathbf{A} + \mathbf{A}^2 / 2 + \dots$ , which is computed up to machine-precision (Higham, 2009). To parameterize all orthogonal matrices, GeoTorch introduces an orthogonal matrix $\mathbf{V}$ in $\mathbf{U} = \mathbf{V} \exp(\mathbf{A})$ , where $\mathbf{V}$ is (randomly) generated at initialization and fixed during training. + +Finally, observe that the upper-triangle entries uniquely determine a skew-symmetric matrix. Therefore, we have now an end-to-end pipeline as shown in Figure 2, which parameterize orthogonal convolutions by unconstrained upper-triangle entries in skew-symmetric matrices. + +# 2.3. Separable Orthogonal 2D-Convolutions + +As 2D-convolutions are widely used in convolutional networks, we extend our orthogonal 1D-convolution to the 2D version. Analog to the 1D case, a 2D-convolutional layer is orthogonal if and only if its transfer matrix $\pmb{H}(z_1,z_2)$ is paraunitary ( $H(z_1,z_2)$ is unitary $\forall |z_1| = 1, |z_2| = 1$ ). + +Construction of orthogonal 2D-convolutions. Using two orthogonal 1D-convolutions, we can readily obtain a complete design of separable orthogonal 2D-convolutions, where $\pmb{H}(z_1,z_2) = \pmb{H}_1(z_1)\pmb{H}_2(z_2)$ is a product of two 1D-paraunitary systems $\pmb{H}_1(z_1)$ and $\pmb{H}_2(z_2)$ . As a result, we can parameterize a separable orthogonal 2D-convolution with filter size $(\overline{L}_1 + \underline{L}_1 + 1) \times (\overline{L}_2 + \underline{L}_2 + 1)$ as a convolution of two orthogonal 1D-convolutions with learnable (column- + +orthogonal matrices $\left(\left\{\boldsymbol{U}_1^{(\ell)}\right\}_{\ell = -\underline{L}_1}, \boldsymbol{Q}_1, \left\{\boldsymbol{U}_1^{(\ell)}\right\}_{\ell = 1}^{\overline{L}_1}\right)$ and $\left(\left\{\boldsymbol{U}_2^{(\ell)}\right\}_{\ell = -\underline{L}_2}, \boldsymbol{Q}_2, \left\{\boldsymbol{U}_2^{(\ell)}\right\}_{\ell = 1}^{\overline{L}_2}\right)$ . Since our method relies on separability and complete factorization for 1D paraunitary systems, we call it Separable Complete Factorization (SC-Fac). (See Algorithm 1 in Appendix E for pseudo code). + +Benefits compared to other methods. (1) Easier analysis. While BCOP (Li et al., 2019a) and our SC-Fac are complete in 1D case, none of them is complete in 2D case. However, since separability reduces the design to the 1D case, it makes the analysis of various types of convolutional layers easier, as we will see in Section 3. (2) Efficient inference. Note that CayleyConv (Trockman & Kolter, 2021) and SOC (Singla & Feizi, 2021) define the convolution implicitly (as an infinite-length filter), the coefficients for $H(z_{1},z_{2})$ can not be saved for repeated inference. In contrast, SC-Fac has the same inference expense as a normal convolutional layer after a one-time computation of the coefficients. (3) Efficient training. As analyzed in Table 5 (Appendix C.3.3), SC-Fac also has the lowest computational complexity among all approaches. (4) Exact orthogonality. Lastly, as shown in Table 2 (Section 6.1), SC-Fac achieves exact orthogonality (up to machine-precision), while previous approaches are approximate to a varying degree. + +# 3. Unifying Orthogonal Convolutions Variants as Paraunitary Systems + +Various convolutional layers (strided, dilated, and group convolution) are widely used in neural networks. However, it is not apparent how to enforce their orthogonality, as the convolution theorem (Theorem 2.1) only holds for standard convolutions. Previous approaches only deal with standard convolutions (Sedghi et al., 2019; Li et al., 2019b; Trockman & Kolter, 2021), thus orthogonality for state-of-the-art architectures has never been studied before. + +We address this limitation by modifying convolution theorem for each variant of convolution layer, which allows us to design these variants using paraunitary systems. + +Theorem 3.1 (Convolution and paraunitary theorems for various convolutions). Strided, dilated, and group convolutions can be unified in the spectral domain as $\underline{Y}(z) = \underline{H}(z)\underline{X}(z)$ , where $\underline{Y}(z)$ , $\underline{H}(z)$ , $\underline{X}(z)$ are modified Z-transforms of $\pmb{y}$ , $\pmb{h}$ , $\pmb{x}$ . We instantiate the equation for strided convolutions in Proposition C.4, dilated convolu + +Table 1. Various types of convolutions. In the following table, we present the modified $Z$ -transforms, $\underline{Y}(z)$ , $\underline{H}(z)$ , and $\underline{X}(z)$ for each type of convolution such that $\underline{Y}(z) = \underline{H}(z)\underline{X}(z)$ holds. For dilated and strided convolutions, $X^{r|R}(z)$ is the $(r,R)$ -polyphase component of $X(z)$ , with which we define $X^{[R]}(z) \triangleq [X^{0|R}(z)^{\top},\dots,X^{R-1|R}(z)^{\top}]^{\top}$ and $\widetilde{X}^{[R]}(z) = [X^{-0|R}(z),\dots,X^{-(R-1|R}(z)]$ . For group convolution, $h^g$ is the filter for the $g^{\text{th}}$ group with $H^g(z)$ being its $Z$ -transform. We stack matrices from different groups into block-diagonal matrices: $h^{\{G\}}[n] = \text{blkdiag}(\{h^g[z]\})$ , $H^{\{G\}}(z) = \text{blkdiag}(\{h^g[z]\})$ . + +
TypeSpatial RepresentationSpectral Representation
\u(Y(z)\u(H(z)\u(X(z)
Standard\(\mathbf{y}[i]=\sum_{n\in\mathbb{Z}}\mathbf{h}[n]\mathbf{x}[i-n]\)Y(Z)H(Z)X(Z)
R-Dilated\(\mathbf{y}[i]=\sum_{n\in\mathbb{Z}}\mathbf{h}^{\uparrow R}[n]\mathbf{x}[i-n]\)Y(Z)H(z^R)X(Z)
↓R-Strided\(\mathbf{y}[i]=\sum_{n\in\mathbb{Z}}\mathbf{h}[n]\mathbf{x}[Ri-n]\)Y(Z)\(\widetilde{\mathbf{H}}^{[R]}(z)\)X[R](z)
↑R-Strided\(\mathbf{y}[i]=\sum_{n\in\mathbb{Z}}\mathbf{h}[n]\mathbf{x}^{\uparrow R}[i-n]\)Y[R](z)H[R](z)X(z)
G-Group\(\mathbf{y}[i]=\sum_{n\in\mathbb{Z}}\mathbf{h}^{\{G\}}[n]\mathbf{x}[i-n]\)Y(Z)H\(^{\{G\}}\)(z)X(z)
+ +tion in Proposition C.5, and group convolution in Proposition C.6. Furthermore, a convolution is orthogonal if and only if $\underline{\mathbf{H}}(z)$ is paraunitary. + +In Table 1, we formulate strided, dilated, and group convolutions in the spatial domain, interpreting them as upsampled or down-sampled variants of a standard convolution. Now, we introduce the concept of up-sampling and down-sampling precisely below. + +![](images/92e70ed6b003dc0da19470197113e6b54d6a22fb907470578ba577d618fe661d.jpg) +(a) Up-sample + +![](images/b1b6177d9892c2b24d7ca72c271f34b547a44813bd3739afd0f0b069c1ef81b3.jpg) +(b) Down-sample +Figure 3. Up and down sampling. In (a), the sequence $\pmb{x}[n]$ is upsampled into $\pmb{x}^{\uparrow 2}[n]$ . In (b), $\pmb{x}[n]$ is down-sampled into $\pmb{x}^{0|2}[n]$ with even entries (red) and $\pmb{x}^{1|2}[n]$ with odd entries (blue). + +Given a sequence $\mathbf{x}$ , we introduce its up-sampled sequence $\mathbf{x}^{\uparrow R}$ with sampling rate $R$ as $\mathbf{x}^{\uparrow R}[n] \triangleq \mathbf{x}[n / R]$ for $n \equiv 0 \pmod{R}$ . On the other hand, its $(r,R)$ -polyphase component $\mathbf{x}^{r|R}$ indicates the $r$ -th down-sampled sequence with sampling rate $R$ , defined as $\mathbf{x}^{r|R}[n] \triangleq \mathbf{x}[nR + r]$ . We illustrated an example of $\mathbf{x}^{\uparrow R}$ and $\mathbf{x}^{r|R}$ in Figure 3 when sampling rate $R = 2$ . The Z-transforms of $\mathbf{x}^{\uparrow R}$ , $\mathbf{x}^{r|R}$ are denoted as $X^{\uparrow R}(z)$ , $X^{r|R}(z)$ respectively. Their relations to $X(z)$ are studied in Appendix C.1. + +Now we are ready to interpret convolution variants. (1) Strided convolution is used to adjust the feature resolution: a strided convolution $(\downarrow R$ -strided) decreases the resolution by down-sampling after a standard convolution, while + +a transposed strided convolutional layer $(\uparrow R$ -strided) increases the resolution by up-sampling before a standard convolution. (2) Dilated convolution increases the receptive field of a convolution without extra parameters: an $R$ -dilated convolution up-samples its filters before convolution with the input. (3) Group convolution reduces the parameters and computations, thus widely used by efficient architectures: a $G$ -group convolution divides the input/output channels into $G$ groups and restricts the connections within each group. In Appendix C.2, we prove that a convolution is orthogonal if and only if its modified $Z$ -transform $\underline{H}(z)$ is paraunitary. + +# 4. Scaling-up Lipschitz Orthogonal Networks + +In this section, we switch our focus from layer design to network design. In particular, we aim to study how to scale-up deep orthogonal networks with Lipschitz bounds. + +Lipschitz networks (Anil et al., 2019; Li et al., 2019b; Trockman & Kolter, 2021), whose Lipschitz bounds are imposed by their architectures, are proposed as competitive candidates to guarantee robustness in deep learning. A Lipschitz network consists of orthogonal layers and GroupSort activations — both are 1-Lipschitz and gradient norm preserving (See Appendix D for more discussions on properties of GroupSort and Lipschitz networks). Given a Lipschitz constant $L$ , a Lipschitz network $f$ can compute a certified radius for each input from its output margin. Formally, denote the output margin of an input $x$ with label $c$ as + +$$ +\mathcal {M} _ {f} (x) \triangleq \max (0, f (\boldsymbol {x}) _ {c} - \max _ {i \neq c} f (\boldsymbol {x}) _ {i}), \tag {4.1} +$$ + +i.e., the difference between the correct logit and the second largest logit. Then the output is robust to perturbation such that $f(\pmb{x} + \pmb{\epsilon}) = f(\pmb{x}) = c, \forall \pmb{\epsilon}: \| \pmb{\epsilon} \| < \mathcal{M}_f(\pmb{x}) / \sqrt{2} L$ . + +Despite the benefit, existing architectures for Lipschitz networks remain simple and shallow, and a Lipschitz network is typically an interleaving cascade of orthogonal layers and GroupSort activations (Li et al., 2019b). More advanced architectures, such as ResNet and ShuffleNet, are still out of reach. While orthogonal layers supposedly substitute the role of batch normalization (Pennington et al., 2017; Xiao et al., 2018; Qi et al., 2020), other critical factors, including skip-connections (He et al., 2016a;b) and proper initialization (Glorot & Bengio, 2010) are lacking. In this section, we explore skip-connections and initialization methods toward addressing this problem. + +Skip-connections. Two classes of skip-connections are widely used in deep networks, one based on addition and another on concatenation. The addition-based one is proposed in ResNet (He et al., 2016a), and adopted in SE-Net (Hu et al., 2018) and EfficientNet (Tan & Le, 2019), while the concatenation-based one is proposed in flow-based generative models (Dinh et al., 2014; 2016; Kingma & Dhariwal, + +2018), and adopted in DenseNet (Huang et al., 2017) and ShuffleNet (Zhang et al., 2018b; Ma et al., 2018). In what follows, we propose Lipschitz skip-connections with these two mechanisms, illustrated in Figure 6 (in Appendix D). + +Proposition 4.1 (Lipschitzness of residual blocks). Suppose $f^1$ , $f^2$ are $L$ -Lipschitz and $\alpha \in [0,1]$ is a learnable scalar, then an additive residual block $f: f(\pmb{x}) \triangleq \alpha f^1(\pmb{x}) + (1 - \alpha) f^2(\pmb{x})$ is $L$ -Lipschitz. Alternatively, suppose $g^1$ , $g^2$ are $L$ -Lipschitz and $P$ is a permutation, then a concatenative residual block $g: g(\pmb{x}) \triangleq P[g^1(\pmb{x}^1); g^2(\pmb{x}^2)]$ is $L$ -Lipschitz, where $[\cdot; \cdot]$ denotes channel concatenation, and $\pmb{x}$ is split into $\pmb{x}_1$ and $\pmb{x}_2$ , i.e., $\pmb{x} = [\pmb{x}_1, \pmb{x}_2]$ . + +Initialization. Proper initialization is crucial in training deep networks (Glorot & Bengio, 2010; He et al., 2016a). Various methods are proposed to initialize orthogonal matrices, including the uniform and torus initialization, for orthogonal RNNs (Henaff et al., 2016; Helfrich et al., 2018; Lezcano-Casado & Martínez-Rubio, 2019). However, initialization of orthogonal convolutions was not systematically studied, and all previous approaches inherit the initialization from the underlying parameterization (Li et al., 2019b; Trockman & Kolter, 2021). In Proposition D.1, we study the condition when a paraunitary system (in the form of Equation (2.2)) reduces to an orthogonal matrix. This reduction allows us to apply the initialization methods for orthogonal matrices (e.g., uniform, torus) to orthogonal convolutions. + +In the experiments, we will evaluate the impact of different choices of skip-connections and initialization methods to the performance of deep Lipschitz networks. + +# 5. Related Work + +Dynamical isometry (Pennington et al., 2017; Xiao et al., 2018; Chen et al., 2018; Pennington et al., 2018) aims to address the gradient vanishing/exploding problems in deep vanilla networks with orthogonal initialization. These works focus on understanding the interplay between initialization methods and various nonlinear activations. However, these approaches do not guarantee orthogonality (and Lipschitzness) after training, thus are unsuitable for applications that require strict Lipschitz bounds, such as adversarial robustness (Anil et al., 2019; Li et al., 2019b) and residual flows (Behrmann et al., 2019; Chen et al., 2019). + +Learning orthogonality has three typical families of methods: regularization, parameterization (i.e., mapping unconstrained parameters to the feasible set with a surjective function), projected gradient descent (PGD) / Riemannian gradient descent (RGD). While the regularization approach is approximate, the latter two learn exact orthogonality. Furthermore, PGD/RGD requires modification of the optimizer, whereas the other two are compatible with standard optimizers for unconstrained optimization. + +(1) For orthogonal matrices, various regularizations are proposed in Xie et al. (2017) and Bansal et al. (2018). Alternatively, numerous parameterizations exist, including Householder reflections (Mhammedi et al., 2017), Given rotations (Dorobantu et al., 2016), Cayley transform (Helfrich et al., 2018), matrix exponential (Lezcano-Casado & Martinez-Rubio, 2019), and algorithmic unrolling (Anil et al., 2019; Huang et al., 2020). Lastly, Jia et al. (2017) propose PGD via singular value clipping, and Vorontsov et al. (2017); Li et al. (2019a) consider RGD. + +(2) For orthogonal convolutions, some existing works learn orthogonality for the flattened matrix (Jia et al., 2017; Cisse et al., 2017; Bansal et al., 2018) or each output channel (Liu et al., 2021). However, these methods do not lead to orthogonality (norm preserving) of the operation. Sedghi et al. (2019) propose to use PGD via singular value clipping and masking — however, singular value decomposition is expensive, and masking can lead to approximate orthogonality. To the best of our knowledge, there is no accurate PGD or RGD for orthogonal convolutions. Alternatively, recent works adopt parameterizations, using block convolutions (Li et al., 2019b), Cayley transform (Trockman & Kolter, 2021), or convolution exponential (Singla & Feizi, 2021). + +Note that network deconvolution (Ye et al., 2020) aims to whiten the activations (i.e., make the distribution close to isometric Gaussian), but the added whitening operations are not orthogonal (norm-preserving) in general. + +Paraunitary systems are extensively studied in filter banks and wavelets (Vaidyanathan, 1993; Strang & Nguyen, 1996; Lin & Vaidyanathan, 1996). Classic theory shows that 1D-paraunitary systems are completely characterized by a spectral factorization (see Chapter 14 of Vaidyanathan (1993) or Chapter 5 of Strang & Nguyen (1996)), but not all multidimensional (MD) paraunitary systems admit a factorized form (see Chapter 8 of Lin & Vaidyanathan (1996)). While the complete characterization of MD-paraunitary systems is known in theory (which requires solving a system of nonlinear equations) (Venkataraman & Levy, 1995; Zhou, 2005), most practical constructions use separable paraunitary systems (Lin & Vaidyanathan, 1996) and special classes of non-separable paraunitary systems (Hurley & Hurley, 2012). The equivalence between orthogonal convolutions and paraunitary systems thus opens the opportunities to apply these classic theories in designing orthogonal convolutions. + +# 6. Experiments + +In the experiments, we achieve the following goals. (1) We demonstrate in Section 6.1 that our separable complete factorization (SC-Fac) achieves precise orthogonality (up to machine-precision), resulting in more accurate orthogonal designs than previous ones (Sedghi et al., 2019; Li et al., + +2019b; Trockman & Kolter, 2021). (2) Despite the differences in preciseness, we show in Section 6.2 that different realizations of paraunitary systems only have a minor impact on the adversarial robustness of Lipschitz networks. (3) Due to the versatility of our convolutional layers and architectures, in Section 6.3, we explore the best strategy to scale Lipschitz networks to wider/deeper architectures. (4) In Appendix F, we further demonstrate in a successful application of orthogonal convolutions in residual flows (Chen et al., 2019). Training details are provided in Appendix E.1. + +# 6.1. Exact Orthogonality + +Table 2. (Left) Orthogonality evaluation of different designs for standard convolution. The number $\|\operatorname{Conv}(\boldsymbol{x})\|/\|\boldsymbol{x}\| - 1$ indicates the difference between the output and input norms of a layer. A layer is more precisely orthogonal if the number is closer to 0. As shown, our SC-Fac achieves orders of magnitude more orthogonal on standard convolution. (Right) Orthogonality evaluation of our SC-Fac design for various convolutions. The numbers $\|\operatorname{Conv}(\boldsymbol{x})\|/\|\boldsymbol{x}\| - 1$ displayed are in the magnitude of $10^{-8}$ . As shown, our SC-Fac layers achieve machine epsilon orthogonality on variants of convolution. + +
Conv.||Conv(x)||/||x||-1
SC-Fac(+3.14 ± 7.38) × 10-8
CayleyConv(+2.88 ± 1.90) × 10-4
BCOP(+2.59 ± 6.14) × 10-3
SVCM-0.429 ± 3.31 × 10-3
RKO-0.666 ± 1.74 × 10-3
OSSN-0.422 ± 3.44 × 10-3
+ +
Groups Type1416
R-Dilated1+3.14 ± 7.38+1.94 ± 6.87+1.44 ± 6.29
2+3.65 ± 7.87+1.41 ± 6.77+1.02 ± 6.46
4+3.18 ± 7.46+1.79 ± 6.87+1.54 ± 6.21
↓R-Strided2-4.69 ± 5.10+4.38 ± 6.30+1.79 ± 5.78
4+10.39 ± 5.15+6.35 ± 6.04+3.05 ± 5.79
↑R-Strided2+3.67 ± 7.96+1.38 ± 6.70+1.43 ± 6.23
4+3.86 ± 7.09+1.12 ± 6.81N/A
+ +We evaluate the orthogonality of our SC-Fac layer verse previous approaches, including CayleyConv (Trockman & Kolter, 2021), BCOP (Li et al., 2019b), SVCM (Sedghi et al., 2019), RKO (Cisse et al., 2017), OSSN (Miyato et al., 2018). Our experiments are based on a convolutional layer with 64 input channels and $16 \times 16$ input size. We orthogonalize the layer using each approach, and evaluate it with Gaussian inputs. For our SC-Fac layer, We initialize all orthogonal matrices uniformly, while we use built-in initialization for others. We evaluate the difference between 1 and the ratio of the output norm to the input norm — a layer is exactly orthogonal if the number is close to 0. + +(1) Standard convolution. We show in Table 2 (Left) that our SC-Fac is orders of magnitude more precise than all other approaches. The SC-Fac layer is in fact exactly orthogonal up to machine epsilon, which is $2^{-24} \approx 5.96 \times 10^{-8}$ for 32-bits floats. While RKO and OSSN are known not to be orthogonal, we surprisingly find that SVCM is far from orthogonal due to its masking step. +(2) Convolutions variants. In Section 3, we construct various orthogonal convolutions using paraunitary systems. We verify our theory in Table 2 (Right): SC-Fac layers are exactly orthogonal (up to machine precision) for all types. + +# 6.2. Adversarial Robustness + +In this part, we evaluate the adversarial robustness of Lipschitz networks. Following the setup in Trockman & Kolter (2021), we adopt KW-Large, ResNet9, WideResNet10-10 as the backbone architectures, and evaluate their robust accuracy on CIFAR-10 with different designs of orthogonal convolutions. We extensively perform a hyper-parameter search and choose the best hyper-parameters for each approach based on the robust accuracy. The details of the hyperparameter search is in Appendix E. We run each model with 5 different seeds and report the best accuracy. + +(1) Certified robustness. Following Li et al. (2019b), we use the raw images (without normalization) for network input to achieve the best certified accuracy. As shown in Table 3 (Top), different realizations of paraunitary systems, SC-Fac, CayleyConv and BCOP have comparable performance — CayleyConv is $< 1\%$ better in clean accuracy, but the difference in robust accuracy are negligible. +(2) Practical robustness. Trockman & Kolter (2021) shows that the certified accuracy is too conservative, and it is possible to increase the practical robustness (against PGD attacks) with a standard input normalization. Notice that the normalization increases the Lipschitz bound, thus lower the certified accuracy. Our experiments in Table 3 (Bottom) are based on ResNet9, WideResNet10-10 (Trockman & Kolter, 2021) and a deeper WideResNet22. For the shallow architectures (ResNet9, WideResNet10-10), our SC-Fac, CayleyConv, and BCOP again achieve comparable performance — CayleyConv is slightly ahead in robust accuracy. For the deeper architecture, our SC-Fac has a clear advantage in both clean and robustness accuracy, and the clean accuracy to only $5\%$ lower than a traditional ResNet 32 trained with batch normalization. Surprisingly, we find that RKO also performs well in robust accuracy while not exactly orthogonal. In summary, our experiments show that various paraunitary realizations provide different impacts on certified and practical robustness. While exact orthogonality provides tight Lipschitz bound, there is a trade-off between the exact orthogonality and the practical robustness (especially with the shallow architectures). + +# 6.3. Scaling-up Lipschitz Orthogonal Networks + +All previous Lipschitz networks (Li et al., 2019b; Trockman & Kolter, 2021) only consider shallow architectures ( $\leq 10$ layers). In this part, we investigate various factors to scale Lipschitz networks to deeper architectures: skip-connection, depth/width, receptive field, and down-sampling. + +(1) Types of skip-connections. Conventional wisdom suggests that skip-connections mainly address gradient vanishing/exploding problems; thus, they are not needed for orthogonal networks. To understand their role, we perform + +Table 3. (Left) Certified robustness for plain convolutional networks (without input normalization). We use KW-Large introduced by Wong et al. (2018). The results for RKO, OSSN, and SVCM are produced by Trockman & Kolter (2021). (Right) Practical robustness for residual networks (with input normalization). For 22 layers, the width of SC-Fac is multiplied with 10, CayleyConv with 6, and BCOP and RKO with 8. We are unable to scale CayleyConv, BCOP, and RKO due to memory constraint. As shown, deeper architectures perform better than shallow ones for all orthogonal convolution types, and our SC-Fac has a clear advantage. + +
εTest Acc.KW-Large
SC-FacCayleyBCOPRKOOSSNSVCM
0Clean74.6975.5774.8174.4771.6972.43
36/255Certified58.6859.0358.8357.5055.7152.11
PGD67.7267.7867.4768.3265.1366.43
+ +
εTest Acc.ResNet9WideResNet10-10WideResNet22-max
SC-FacCayleyBCOPRKOSC-FacCayleyBCOPRKOSC-FacCayleyBCOPRKO
0Clean82.1984.2683.2084.0784.0982.9984.2984.5187.8285.8584.5084.55
36/255PGD71.2173.4773.0575.0374.2976.0274.6077.1476.4674.8175.0076.41
+ +an experiment that trains deep Lipschitz networks without skip-connection and with additive/concatenative skip-connections (see Section 4). As shown in Table 4 (left), the network with additive skip-connection substantially outperforms the other two, and the one without skip-connections performs the worst. Thus, we empirically show that additive skip-connection is crucial in deep Lipschitz networks. + +Table 4. (Left) Comparisons of various skip connection types on WideResNet22-10 (kernel size equals 5). (Right) Comparisons of various receptive field and down-sampling types on WideResNet10-10. The symbols $\checkmark$ , $\times$ indicate whether average pooling or strided convolution is used for down-sampling. For "slim" in strided convolution, we set kernel_size = stride; and for "wide", kernel_size = stride * kernel_size' (where kernel_size' is the kernel size for the main branch. + +
Skip typeTest Acc.
CleanPGD
ConvNet (w/o skip)69.5959.22
ShuffleNet (concat)75.2166.00
ResNet (add)87.8276.46
+ +
Receptive FieldDown-SamplingTest Acc.
KernelDilationPoolStrideCleanPGD
31×slim80.7068.81
31×wide82.3670.36
31✓×84.5471.71
32✓×81.5370.07
51✓×84.0974.29
52✓×81.2870.58
+ +(2) Depth and width. Exact orthogonality is criticized for harming the expressive power of neural networks. We show that the decrease of expressive power can be alleviated by increasing the network depth/width. In Table 3 (Bottom) and Table 7 (Appendix E), we observe that deeper/wider architectures increase both the clean and robust accuracy. +(3) Initialization methods. We try different initialization methods, including identical, permutation, uniform, and torus (Henaff et al., 2016; Helfrich et al., 2018). We find that identical initialization works the best for deep Lipschitz networks ( $>10$ layers), while all methods perform similarly in shallow networks as shown in Table 6 (Appendix E). +(4) Receptive field and down-sampling. Previous works (Li et al., 2019b; Trockman & Kolter, 2021) use larger kernel size and no stride for Lipschitz networks. In Table 4 (Right), we perform a study on the effects of kernel/dilation size and down-sampling types for the orthogonal convolutions. We + +find that an average pooling as down-sampling consistently outperforms strided convolutions. Furthermore, a larger kernel size helps to boost the performance. + +(5) Run-time and memory comparison. We find that previous orthogonal convolutions such as CayleyConv, BCOP, and RKO require more GPU memory and computation time than SC-Fac. Therefore, we could not to scale them due to memory constraints (for 22 and 32 layers using Tesla V100 32G). To scale up Lipschitz networks, economical implementation of orthogonal convolution is crucial. As shown in Figure 4, for deep and wide architectures, our SC-Fac is the most computationally and memory efficient method and the only method that scales to a width increase of 10 on WideResNet22. Missing numbers in Figure 4 and Table 7 (Appendix E) are due to the large memory requirement. + +![](images/397659d7a14ed988172a789bbcb66a36b51022d8aef165cf9ff5c7e2f087b0e4.jpg) +Figure 4. Run-time and memory comparison using WideResNet22 on Tesla V100 32G. x-axis indicates the width factor (channels = base_channels × factor). Our SC-Fac is the most computationally and memory-efficient for wide architectures and is the only method that scales to width factor to 10 on WideResNet22. We also compare with an ordinary network with regular convolutions and ReLU activations. Note that SC-Fac has the same inference speed as a regular convolution — the overhead is from the GroupSort activations. + +In summary, additive skip-connections are still essential for learning deep orthogonal networks. Due to the orthogonal constraints, it is helpful to increase the depth/width of the network. However, this significantly increases the memory requirement; thus, a cheap implementation (like SC-Fac) is desirable. Finally, we find that a larger kernel size and down-sampling based on average pooling is helpful, unlike standard practices in deep networks. + +# 7. Conclusion + +In this paper, we present a paraunitary framework for orthogonal convolutions. Specifically, we establish the equivalence between orthogonal convolutions in the spatial domain and paraunitary systems in the spectral domain. Therefore, any design for orthogonal convolutions is implicitly constructing paraunitary systems. We further show that the orthogonality for variants of convolution (strided, dilated, and group convolutions) is also fully characterized by paraunitary systems. In summary, paraunitary systems are all we need to ensure orthogonality for diverse types of convolutions. + +Based on the complete factorization of 1D paraunitary systems, we develop the first exact and complete design of separable orthogonal 2D-convolutions. Our versatile design allows us to study the design principles for orthogonal convolutional networks. Consequently, we scale orthogonal networks to deeper architectures, substantially outperforming their shallower counterparts. In our experiments, we observe that exact orthogonality plays a crucial role in learning deep Lipschitz networks. In the future, we plan to investigate other use cases that exact orthogonality is essential. + +# References + +Anil, C., Lucas, J., and Grosse, R. Sorting out lipschitz function approximation. In International Conference on Machine Learning, pp. 291-301, 2019. +Azulay, A. and Weiss, Y. Why do deep convolutional networks generalize so poorly to small image transformations? Journal of Machine Learning Research, 20(184): 1-25, 2019. +Bansal, N., Chen, X., and Wang, Z. Can we gain more from orthogonality regularizations in training deep cnns? In Proceedings of the 32nd International Conference on Neural Information Processing Systems, pp. 4266-4276. Curran Associates Inc., 2018. +Behrmann, J., Grathwohl, W., Chen, R. T., Duvenaud, D., and Jacobsen, J.-H. Invertible residual networks. In International Conference on Machine Learning, pp. 573-582. PMLR, 2019. +Björck, Å. and Bowie, C. An iterative algorithm for computing the best estimate of an orthogonal matrix. SIAM Journal on Numerical Analysis, 8(2):358-364, 1971. +Chen, M., Pennington, J., and Schoenholz, S. Dynamical isometry and a mean field theory of rnns: Gating enables signal propagation in recurrent neural networks. In International Conference on Machine Learning, pp. 873-882. PMLR, 2018. +Chen, R. T., Behrmann, J., Duvenaud, D. K., and Jacobsen, J.-H. Residual flows for invertible generative modeling. + +Advances in Neural Information Processing Systems, 32, 2019. +Chernodub, A. and Nowicki, D. Norm-preserving orthogonal permutation linear unit activation functions (oplu). arXiv preprint arXiv:1604.02313, 2016. +Cisse, M., Bojanowski, P., Grave, E., Dauphin, Y., and Usunier, N. Parseval networks: Improving robustness to adversarial examples. In International Conference on Machine Learning, pp. 854-863. PMLR, 2017. +Dinh, L., Krueger, D., and Bengio, Y. Nice: Non-linear independent components estimation. arXiv preprint arXiv:1410.8516, 2014. +Dinh, L., Sohl-Dickstein, J., and Bengio, S. Density estimation using real nvp. arXiv preprint arXiv:1605.08803, 2016. +Dorobantu, V., Stromhaug, P. A., and Renteria, J. Dizziness: Reparameterizing recurrent neural networks for norm-preserving backpropagation. arXiv preprint arXiv:1612.04035, 2016. +Glorot, X. and Bengio, Y. Understanding the difficulty of training deep feedforward neural networks. In Proceedings of the thirteenth international conference on artificial intelligence and statistics, pp. 249-256. JMLR Workshop and Conference Proceedings, 2010. +Goodfellow, I. J., Shlens, J., and Szegedy, C. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014. +Grathwohl, W., Chen, R. T., Bettencourt, J., Sutskever, I., and Duvenaud, D. Ffjord: Free-form continuous dynamics for scalable reversible generative models. arXiv preprint arXiv:1810.01367, 2018. +He, K., Zhang, X., Ren, S., and Sun, J. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770-778, 2016a. +He, K., Zhang, X., Ren, S., and Sun, J. Identity mappings in deep residual networks. In European Conference on Computer Vision, pp. 630-645. Springer, 2016b. +Helfrich, K., Willmott, D., and Ye, Q. Orthogonal recurrent neural networks with scaled cayley transform. In International Conference on Machine Learning, pp. 1969-1978. PMLR, 2018. +Henaff, M., Szlam, A., and LeCun, Y. Recurrent orthogonal networks and long-memory tasks. In International Conference on Machine Learning, pp. 2034-2042, 2016. + +Higham, N. J. The scaling and squaring method for the matrix exponential revisited. SIAM review, 51(4):747-764, 2009. +Hu, J., Shen, L., and Sun, G. Squeeze-and-excitation networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 7132-7141, 2018. +Huang, G., Liu, Z., Van Der Maaten, L., and Weinberger, K. Q. Densely connected convolutional networks. In CVPR, volume 1, pp. 3, 2017. +Huang, L., Liu, L., Zhu, F., Wan, D., Yuan, Z., Li, B., and Shao, L. Controllable orthogonalization in training dnns. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 6429-6438, 2020. +Hurley, B. and Hurley, T. Paraunitary matrices. arXiv preprint arXiv:1205.0703, 2012. +Ioffe, S. and Szegedy, C. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In International conference on machine learning, pp. 448-456. PMLR, 2015. +Jia, K., Tao, D., Gao, S., and Xu, X. Improving training of deep neural networks via singular value bounding. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4344-4352, 2017. +Jia, K., Li, S., Wen, Y., Liu, T., and Tao, D. Orthogonal deep neural networks. IEEE transactions on pattern analysis and machine intelligence, 2019. +Jing, L., Shen, Y., Dubcek, T., Peurifoy, J., Skirlo, S., LeCun, Y., Tegmark, M., and Soljačić, M. Tunable efficient unitary neural networks (eunn) and their application to rnns. In International Conference on Machine Learning, pp. 1733-1741. PMLR, 2017. +Kautsky, J. and Turcajova, R. A matrix approach to discrete wavelets. In Wavelet Analysis and Its Applications, volume 5, pp. 117-135. Elsevier, 1994. +Kingma, D. P. and Dhariwal, P. Glow: Generative flow with invertible 1x1 convolutions. In Advances in neural information processing systems, pp. 10215-10224, 2018. +Kobyzev, I., Prince, S., and Brubaker, M. Normalizing flows: An introduction and review of current methods. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2020. +Lezcano Casado, M. Trivializations for gradient-based optimization on manifolds. Advances in Neural Information Processing Systems, 32:9157-9168, 2019. + +Lezcano-Casado, M. and Martínez-Rubio, D. Cheap orthogonal constraints in neural networks: A simple parametrization of the orthogonal and unitary group. In International Conference on Machine Learning, pp. 3794-3803, 2019. +Li, J., Li, F., and Todorovic, S. Efficient riemannian optimization on the stiefel manifold via the Cayley transform. In International Conference on Learning Representations, 2019a. +Li, Q., Haque, S., Anil, C., Lucas, J., Grosse, R. B., and Jacobsen, J.-H. Preventing gradient attenuation in lipschitz constrained convolutional networks. In Advances in neural information processing systems, pp. 15390-15402, 2019b. +Lin, Y.-P. and Vaidyanathan, P. Theory and design of two-dimensional filter banks: A review. Multidimensional Systems and Signal Processing, 7(3-4):263-330, 1996. +Liu, S., Li, X., Zhai, Y., You, C., Zhu, Z., Fernandez-Granda, C., and Qu, Q. Convolutional normalization: Improving deep convolutional network robustness and training. Advances in Neural Information Processing Systems, 34, 2021. +Ma, N., Zhang, X., Zheng, H.-T., and Sun, J. Shufflenet v2: Practical guidelines for efficient cnn architecture design. In Proceedings of the European conference on computer vision (ECCV), pp. 116-131, 2018. +Maduranga, K. D., Helfrich, K. E., and Ye, Q. Complex unitary recurrent neural networks using scaled cayley transform. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pp. 4528-4535, 2019. +Mathiasen, A., Hvilshøj, F., Jørgensen, J. R., Nasery, A., and Mottin, D. What if neural networks had svds? arXiv preprint arXiv:2009.13977, 2020. +Mhammedi, Z., Hellicar, A., Rahman, A., and Bailey, J. Efficient orthogonal parametrisation of recurrent neural networks using householder reflections. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 2401-2409, 2017. +Miyato, T., Kataoka, T., Koyama, M., and Yoshida, Y. Spectral normalization for generative adversarial networks. In International Conference on Learning Representations, 2018. +Neyshabur, B., Bhojanapalli, S., and Srebro, N. A pac-bayesian approach to spectrally-normalized margin bounds for neural networks. In International Conference on Learning Representations, 2018. + +Oppenheim, A. V., Willsky, A. S., and Nawab, S. H. Signals & Systems (2nd Ed.). Prentice-Hall, Inc., 1996. +Papamakarios, G., Nalisnick, E., Rezende, D. J., Mohamed, S., and Lakshminarayanan, B. Normalizing flows for probabilistic modeling and inference. arXiv preprint arXiv:1912.02762, 2019. +Pennington, J., Schoenholz, S. S., and Ganguli, S. Resurrecting the sigmoid in deep learning through dynamical isometry: theory and practice. In Proceedings of the 31st International Conference on Neural Information Processing Systems, pp. 4788-4798, 2017. +Pennington, J., Schoenholz, S., and Ganguli, S. The emergence of spectral universality in deep networks. In International Conference on Artificial Intelligence and Statistics, pp. 1924-1932. PMLR, 2018. +Qi, H., You, C., Wang, X., Ma, Y., and Malik, J. Deep isometric learning for visual recognition. In International Conference on Machine Learning, pp. 7824-7835. PMLR, 2020. +Sedghi, H., Gupta, V., and Long, P. M. The singular values of convolutional layers. In International Conference on Learning Representations, 2019. +Singla, S. and Feizi, S. Skew orthogonal convolutions. arXiv preprint arXiv:2105.11417, 2021. +Strang, G. and Nguyen, T. Wavelets and filter banks. SIAM, 1996. +Tan, M. and Le, Q. Efficientnet: Rethinking model scaling for convolutional neural networks. In International Conference on Machine Learning, pp. 6105-6114. PMLR, 2019. +Trockman, A. and Kolter, J. Z. Orthogonalizing convolutional layers with the Cayley transform. In International Conference on Learning Representations, 2021. +Vaidyanathan, P. Multirate systems and filter banks. Prentice-Hall, Inc., 1993. +Van Den Berg, R., Hasenclever, L., Tomczak, J. M., and Welling, M. Sylvester normalizing flows for variational inference. In 34th Conference on Uncertainty in Artificial Intelligence 2018, UAI 2018, pp. 393-402. Association For Uncertainty in Artificial Intelligence (AUAI), 2018. +Venkataraman, S. and Levy, B. C. A comparison of design methods for 2-d fir orthogonal perfect reconstruction filter banks. IEEE Transactions on Circuits and Systems II: Analog and Digital Signal Processing, 42(8):525-536, 1995. + +Vorontsov, E., Trabelsi, C., Kadoury, S., and Pal, C. On orthogonality and learning recurrent networks with long term dependencies. In International Conference on Machine Learning, pp. 3570-3578, 2017. +Wang, J., Chen, Y., Chakraborty, R., and Yu, S. X. Orthogonal convolutional neural networks. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019. +Wong, E., Schmidt, F. R., Metzen, J. H., and Kolter, J. Z. Scaling provable adversarial defenses. In Proceedings of the 32nd International Conference on Neural Information Processing Systems, pp. 8410-8419, 2018. +Wong, E., Rice, L., and Kolter, J. Z. Fast is better than free: Revisiting adversarial training. In International Conference on Learning Representations, 2020. +Xiao, L., Bahri, Y., Sohl-Dickstein, J., Schoenholz, S., and Pennington, J. Dynamical isometry and a mean field theory of cnns: How to train 10,000-layer vanilla convolutional neural networks. In International Conference on Machine Learning, pp. 5393-5402. PMLR, 2018. +Xie, D., Xiong, J., and Pu, S. All you need is beyond a good init: Exploring better solution for training extremely deep convolutional neural networks with orthonormality and modulation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 6176-6185, 2017. +Ye, C., Evanusa, M., He, H., Mitrokhin, A., Goldstein, T., Yorke, J. A., Fermuller, C., and Aloimonos, Y. Network deconvolution. In International Conference on Learning Representations, 2020. +Zhang, J., Lei, Q., and Dhillon, I. Stabilizing gradients for deep neural networks via efficient svd parameterization. In International Conference on Machine Learning, pp. 5806-5814, 2018a. +Zhang, X., Zhou, X., Lin, M., and Sun, J. Shufflenet: An extremely efficient convolutional neural network for mobile devices. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 6848-6856, 2018b. +Zhou, J. Multidimensional Multirate Systems: Characterization, Design, and Applications. CiteSeer, 2005. + +# Appendices: Scaling-up Diverse Orthogonal Convolutional Networks by a Paraunitary Framework + +Notations. We use non- bold letters for scalar (e.g., $x$ ) and bold ones for vectors or matrices (e.g., $\pmb{x}$ ). We denote sequences in the spatial domain using lower-case letters (e.g., $x[n]$ , $\pmb {x}[n]$ ) and their spectral representations using upper-case letters (e.g., $X(z)$ , $X(z))$ . For a positive integer, say $R\in Z^{+}$ , we abbreviate the set $\{0,1,\dots ,R - 1\}$ as $[R]$ , and whenever possible, we use its lower-case letter, say $r\in [R]$ , as the corresponding iterator. + +Assumptions. For simplicity, we assume all sequences are $\mathcal{L}^2$ with range $\mathbb{Z} = \{0, \pm 1, \pm 2, \dots\}$ (a sequence $\pmb{x} = \{\pmb{x}[n], n \in \mathbb{Z}\}$ is $\mathcal{L}^2$ if $\sum_{n \in \mathbb{Z}} \| \pmb{x}[n] \|^2 < \infty$ ). Such assumption is common in the literature, which avoids boundary conditions in signal analysis. To deal with periodic sequences (finite sequences with circular padding), one can either adopt the Dirac function in the spectral domain or use discrete Fourier transform to compute the spectral representations. In our implementation, we address the boundary condition case by case for each convolution type, with which we achieve exact orthogonality in the experiments (Section 6.1). + +# A. Pseudo Code for Our SC-Fac Algorithm + +We include the pseudo-code for separable complete factorization (Section 2) in Algorithm 1 and diverse orthogonal convolutions (Section 3) in Algorithm 2. The pseudo-code in Algorithm 1 consists of three parts: (1) First, we obtain orthogonal matrices from skew-symmetric matrices using matrix exponential. We use GeoTorch library (Lezcano Casado, 2019) for the function matrix_exp in our implementation; (2) Subsequently, we construct two 1D paraunitary systems using these orthogonal matrices; (3) Lastly, we compose two 1D paraunitary systems to obtain one 2D paraunitary systems. The pseudo-code in Algorithm 2 consists of two parts: (1) First, we reshape each paraunitary system into an orthogonal convolution depending on the stride; and (5) second, we concatenate the orthogonal kernels for different groups and return the output. + +# B. Orthogonal Convolutions via Paraunitary Systems + +In this section, we prove the convolution theorem and Parseval's theorem for standard convolutional layers. Then, we prove the paraunitary theorem which establishes the equivalence between orthogonal convolutional layers and paraunitary systems. + +# B.1. Spectral Analysis of Standard Convolution Layers + +Standard convolutional layers are the default building blocks for convolutional neural networks. One such layer consists of a filter bank with $T \times S$ filters $\pmb{h} = \{h_{ts}[n], n \in \mathbb{Z}\}_{t \in [T], s \in [S]}$ , where $S, T$ are the number of input and output channels respectively. The layer maps an $S$ -channel input $\pmb{x} = \{x_s[i], i \in \mathbb{Z}\}_{s \in [S]}$ to a $T$ -channel output $\pmb{y} = \{y_t[i], i \in \mathbb{Z}\}_{t \in [T]}$ according to + +$$ +y _ {t} [ i ] = \sum_ {s \in [ S ]} \sum_ {n \in \mathbb {Z}} h _ {t s} [ n ] x _ {s} [ i - n ], \tag {B.1} +$$ + +where $i$ indexes the output location to be computed, and $n$ indexes the filter coefficients. Alternatively, we can rewrite Equation (B.1) in matrix-vector form as + +$$ +\boldsymbol {y} [ i ] = \sum_ {n \in \mathbb {Z}} \boldsymbol {h} [ n ] \boldsymbol {x} [ i - n ], \tag {B.2} +$$ + +where each $\pmb{h}[n] \in \mathbb{R}^{T \times S}$ is a matrix, and each $\pmb{x}[i - n] \in \mathbb{R}^S$ or $\pmb{y}[i] \in \mathbb{R}^T$ is a vector. + +Notice that in Equation (B.2), we group entries from all channels into a vector or matrix (e.g., from $\{x_0[n]\}_{s\in [S]}$ to $\pmb{x}[n]$ ), different from a common notation that groups entries from all locations into a vector or matrix (e.g., from $\{x_{s}[n],n\in \mathbb{Z}\}$ into $x_{s}$ ). In the matrix-vector form, a standard convolutional layer computes a vector sequence $\pmb {y} = \{\pmb {y}[i]\in \mathbb{R}^T,i\in \mathbb{Z}\}$ with a convolution between a matrix sequence $\pmb {h} = \{\pmb {h}[n]\in \mathbb{R}^{T\times S},n\in \mathbb{Z}\}$ and a vector sequence $\pmb {x} = \{\pmb {x}[i]\in \mathbb{R}^S,i\in \mathbb{Z}\}$ . + +Let us first define the $\mathbf{Z}$ -transform and various types of Fourier transform in Definition B.1 before proving the convolution theorem (Theorem 2.1). + +Definition B.1 (Z-transform and Fourier transforms). For a sequence (of scalars, vectors, or matrices) $\pmb{x} = \{\pmb{x}[n], n \in \mathbb{Z}\}$ , + +Algorithm 1: Separable Complete Factorization (SC-Fac) +Input: Number of channels $C$ , kernel size $K = 2L + 1$ , and Skew-symmetric matrices $\{A_d^{(\ell)}\}$ with $A_{d}^{(\ell)}\in \mathbb{R}^{C\times C},\forall \ell \in [-L,L],d\in \{1,2\}$ Output: A paraunitary system $\mathcal{H}\in \mathbb{R}^{C\times C\times K\times K}$ Initialization: Sample $N_{d}^{(\ell)}$ from $\{1,\dots ,C\}$ uniformly $\forall \ell \in [-L,L],d\in \{1,2\}$ / Iterate for vertical/horizontal dimensions \*/ +for $d = 1$ to 2 do +/\* 1) Compute orthogonal matrices from skew-symmetric matrices \*/ /\* Iterate for filter locations \*/ +for $\ell = -L$ to $L$ do if $\ell = 0$ then $Q_{d}\gets$ matrix_exp(A(0))// use matrix_exp() in GeoTorch (Lezcano Casado, 2019) else $U_{d}^{(\ell)}\gets$ selectmatrix_exp(A),cols $= N_{d}^{(\ell)}$ // selects the first cols columns of the matrix end if +end for +/\* 2)Compose 1D paraunitary systems from orthogonal matrices \*/ + $\mathcal{H}_d\gets Q_d$ +for $\ell = 1$ to $L$ do $\mathcal{H}_d\gets \mathrm{conv1d}(\mathcal{H}_d,[U_d^{(\ell)}U_d^{(\ell)^{\top}},I - U_d^{(\ell)}U_d^{(\ell)^{\top}}])$ $\mathcal{H}_d\gets \mathrm{conv1d}([I - U_d^{(-\ell)}U_d^{(-\ell)^{\top}},U_d^{(-\ell)}U_d^{(-\ell)^{\top}}],\mathcal{H}_d)$ +end for +end for +/\* 3)Compose a 2D paraunitary systems from two 1D paraunitary \*/ + $\mathcal{H}\gets \mathrm{Compose}(\mathcal{H}_1,\mathcal{H}_2) / /$ i.e., $\mathcal{H}_{:,i,j} = (\mathcal{H}_2);;j(\mathcal{H}_1);;i$ where the 1D paraunitary systems + $\mathcal{H}_1$ and $\mathcal{H}_2$ are of size $C\times C\times K$ +return H + +Algorithm 2: Construct Diverse Orthogonal Convolutions from Paraunitary Systems +Input: Number of base channels $C$ , kernel size $K = R(2L + 1)$ stride $R$ , dilation $D$ , number of groups $G$ +Output: An orthogonal kernel $\mathcal{W}\in \mathbb{R}^{T\times S\times K\times K}$ +Set $K^{\prime}\gets K / R$ , number of input channels $S\gets GC / R^2$ and output channels $T\gets GC$ +for $g = 0$ to $G - 1$ do /\* 1) Construct orthogonal convolutions from paraunitary systems \*/ Initialize skew-symmetric matrices $\{\{A_d^{(\ell ,g)}\}_{\ell = -L}^L\}_{d = 1}^2$ for the current $g$ $\mathcal{H}^g\gets$ Algorithm 1: SC-Fac(C,K',,{Ad(l,g)}L]d=1) $\mathcal{H}^g\gets$ reshape $(\mathcal{H}^g,(C,C,K',K')\to (C / R^2,C,K,K))$ +end for /\* 2) Concatenate orthogonal convolutions from different groups \*/ $\mathcal{W}\gets$ concatenate $(\{\mathcal{H}^g\}_{g = 0}^{G - 1},\dim = 0)$ +return W (where the filter for input channel s and output channel t is $\mathcal{W}_{t,s,:,:}\in \mathbb{R}^{K\times K})$ + +its $Z$ -transform $\pmb{X}(z)$ is defined as + +$$ +\boldsymbol {X} (z) = \sum_ {n \in \mathbb {Z}} \boldsymbol {x} [ n ] z ^ {- n}, \tag {B.3} +$$ + +where $z \in \mathbb{C}$ is a complex number such that the infinite sum is convergent. If $z$ is restricted to the unit circle $z = e^{\mathrm{j}\omega}$ (i.e., + +$|z| = 1)$ , the $z$ -transform $\mathbf{X}(z)$ reduces to a discrete-time Fourier transform (DTFT) $\mathbf{X}(e^{\mathrm{j}\omega})$ . If $\omega$ is further restricted to a finite set $\omega \in \{2\pi k / N, k \in [N]\}$ , the DTFT $\mathbf{X}(e^{\mathrm{j}\omega})$ reduces to an $N$ -points discrete Fourier transform (DFT) $\mathbf{X}(e^{\mathrm{j}2\pi k / N})$ . + +Theorem B.2 (Convolution theorem (Oppenheim et al., 1996)). A standard convolution layer in the spatial domain (Equation (B.2)) is equivalent to matrix-vector products in the spectral domain, i.e., + +$$ +\boldsymbol {Y} (z) = \boldsymbol {H} (z) \boldsymbol {X} (z), \forall z \in \mathbb {C}. \tag {B.4} +$$ + +Proof of Theorem B.2. The proof follows directly from the definitions of standard convolution (Equation (B.2)) and Z-transform (Equation (B.3)). + +$$ +\begin{array}{l} \boldsymbol {Y} (z) = \sum_ {i \in \mathbb {Z}} \boldsymbol {y} [ i ] z ^ {- i} (B.5) \\ = \sum_ {i \in \mathbb {Z}} \left(\sum_ {n \in \mathbb {Z}} \mathbf {h} [ n ] \mathbf {x} [ i - n ]\right) z ^ {- i} (B.6) \\ = \sum_ {n \in \mathbb {Z}} \boldsymbol {h} [ n ] z ^ {- n} \left(\sum_ {i \in \mathbb {Z}} \boldsymbol {x} [ i - n ] z ^ {- (i - n)}\right) (B.7) \\ = \left(\sum_ {n \in \mathbb {Z}} \boldsymbol {h} [ n ] z ^ {- n}\right) \left(\sum_ {k \in \mathbb {Z}} \boldsymbol {x} [ k ] z ^ {- k}\right) (B.8) \\ = \boldsymbol {H} (z) \boldsymbol {X} (z), (B.9) \\ \end{array} +$$ + +where Equations (B.5) and (B.9) use the definition of Z-transform, Equation (B.6) uses the definition of convolution, and Equation (B.8) makes a change of variable $k = i - n$ . + +Next, we introduce the concepts of inner product and Frobenius norm for sequences. We then prove Parseval's theorem, which allows us to compute the sequence norm in the spectral domain. + +Definition B.3 (Inner product and norm for sequences). Given two sequences $\pmb{x} = \{\pmb{x}[n], n \in \mathbb{Z}\}$ and $\pmb{y} = \{\pmb{y}[n], n \in \mathbb{Z}\}$ with $\pmb{x}[n], \pmb{y}[n]$ having the same dimension for all $n$ , the inner product of these two sequences is defined as + +$$ +\langle \boldsymbol {x}, \boldsymbol {y} \rangle \triangleq \sum_ {n \in \mathbb {Z}} \left\langle \boldsymbol {x} [ n ], \boldsymbol {y} [ n ] \right\rangle \tag {B.10} +$$ + +where $\langle \pmb{x}[n],\pmb{y}[n]\rangle$ denotes the Frobenius inner product between $\pmb{x}[n]$ and $\pmb{y}[n]$ . Subsequently, we can define the Frobenius norm of a sequence using inner product as + +$$ +\| \boldsymbol {x} \| \triangleq \sqrt {\langle \boldsymbol {x} , \boldsymbol {x} \rangle} \tag {B.11} +$$ + +Theorem B.4 (Parsavel's theorem). Given a sequence $\mathbf{x} = \{ \mathbf{x}[n], n \in \mathbb{Z} \}$ , its sequence norm $\| \mathbf{x} \|$ can be computed by $X(e^{\mathrm{j}\omega})$ in the spectral domain as + +$$ +\left\| \boldsymbol {x} \right\| ^ {2} = \sum_ {n \in \mathbb {Z}} \left\| \boldsymbol {x} [ n ] \right\| ^ {2} = \frac {1}{2 \pi} \int_ {- \pi} ^ {\pi} \left\| \boldsymbol {X} \left(e ^ {j \omega}\right) \right\| ^ {2} d \omega , \tag {B.12} +$$ + +where $\| X(e^{j\omega})\|^2 = X(e^{j\omega})^\dagger X(e^{j\omega})$ is an inner product between two complex arrays. + +Proof of Theorem B.4. The theorem follows from the definitions of convolution and discrete-time Fourier transform (DTFT). + +$$ +\begin{array}{l} \frac {1}{2 \pi} \int_ {- \pi} ^ {\pi} \| \boldsymbol {X} \left(e ^ {j \omega}\right) \| ^ {2} d \omega = \frac {1}{2 \pi} \int_ {- \pi} ^ {\pi} \left\langle \boldsymbol {X} \left(e ^ {j \omega}\right), \boldsymbol {X} \left(e ^ {j \omega}\right) \right\rangle d \omega (B.13) \\ = \frac {1}{2 \pi} \int_ {- \pi} ^ {\pi} \left\langle \sum_ {n \in \mathbb {Z}} \boldsymbol {x} [ n ] e ^ {- j \omega n}, \sum_ {m \in \mathbb {Z}} \boldsymbol {x} [ m ] e ^ {- j \omega m} \right\rangle d \omega (B.14) \\ = \sum_ {n \in \mathbb {Z}} \sum_ {m \in \mathbb {Z}} \left\langle \boldsymbol {x} [ n ], \boldsymbol {x} [ m ] \right\rangle \frac {1}{2 \pi} \int_ {- \pi} ^ {\pi} e ^ {- j \omega (m - n)} d \omega (B.15) \\ = \sum_ {n \in \mathbb {Z}} \sum_ {m \in \mathbb {Z}} \left\langle \boldsymbol {x} [ n ], \boldsymbol {x} [ m ] \right\rangle \mathbb {1} _ {m = n} (B.16) \\ = \sum_ {n \in \mathbb {Z}} \left\langle \boldsymbol {x} [ n ], \boldsymbol {x} [ n ] \right\rangle = \sum_ {n \in \mathbb {Z}} \| \boldsymbol {x} [ n ] \| ^ {2}, (B.17) \\ \end{array} +$$ + +where Equation (B.15) is due to the bi-linearity of inner products, and Equation (B.16) makes uses of the fact that $\int_{-\pi}^{\pi}e^{-\mathrm{j}\omega k}d\omega = 0$ for $k\neq 0$ and $\int_{-\pi}^{\pi}e^{-\mathrm{j}\omega k}d\omega = \int_{-\pi}^{\pi}d\omega = 2\pi$ for $k = 0$ + +# B.2. Equivalence between Orthogonal Convolutions and Paraunitary Systems + +With the sequence norm introduced earlier, we formally define orthogonality for convolutional layers. + +Definition B.5 (Orthogonal convolutional layer). A convolution layer is orthogonal if the input norm $\| \pmb{x}\|$ is equal to the output norm $\| \pmb{y}\|$ for arbitrary input $\pmb{x}$ , that is + +$$ +\| \boldsymbol {y} \| \triangleq \sqrt {\sum_ {n \in \mathbb {Z}} \| \boldsymbol {y} [ n ] \| ^ {2}} = \sqrt {\sum_ {n \in \mathbb {Z}} \| \boldsymbol {x} [ n ] \| ^ {2}} \triangleq \| \boldsymbol {x} \|, \tag {B.18} +$$ + +where $\| \pmb{x}\|$ (or $\| \pmb{y}\|$ ) is defined as the squared root of $\sum_{n\in \mathbb{Z}}\| \pmb{x}[n]\|^2$ (or $\sum_{n\in \mathbb{Z}}\| \pmb{y}[n]\|^2$ ). + +This definition of orthogonality not only applies to standard convolutions in Equation (B.2) but also variants of convolutions in Appendix C.3. In this section, however, we first establish the equivalence between orthogonality for standard convolutions and paraunitary systems. + +Theorem B.6 (Paraunitary theorem). A standard convolutional layer (in Equation (B.2)) is orthogonal (by Definition B.5) if and only if its transfer matrix $\mathbf{H}(z)$ is paraunitary, i.e., + +$$ +\boldsymbol {H} (z) ^ {\dagger} \boldsymbol {H} (z) = \boldsymbol {I}, \forall | z | = 1 \Longleftrightarrow \boldsymbol {H} \left(e ^ {\mathrm {j} \omega}\right) ^ {\dagger} \boldsymbol {H} \left(e ^ {\mathrm {j} \omega}\right) = \boldsymbol {I}, \forall \omega \in \mathbb {R}. \tag {B.19} +$$ + +In other words, the transfer matrix $\mathbf{H}(e^{\mathrm{j}\omega})$ is unitary for all frequencies $\omega \in \mathbb{R}$ . + +Proof of Theorem B.6. We first prove that a convolutional layer is orthogonal if its transfer matrix $H(z)$ is paraunitary (i.e., $H(e^{\mathrm{i}\omega})$ is unitary for any frequency $\omega \in \mathbb{R}$ ). + +$$ +\begin{array}{l} \left\| \boldsymbol {y} \right\| ^ {2} = \frac {1}{2 \pi} \int_ {- \pi} ^ {\pi} \left\| \boldsymbol {Y} \left(e ^ {j \omega}\right) \right\| ^ {2} d \omega (B.20) \\ = \frac {1}{2 \pi} \int_ {- \pi} ^ {\pi} \left\| \boldsymbol {H} \left(e ^ {j \omega}\right) \boldsymbol {X} \left(e ^ {j \omega}\right) \right\| ^ {2} d \omega (B.21) \\ = \frac {1}{2 \pi} \int_ {- \pi} ^ {\pi} \left\| \boldsymbol {X} \left(e ^ {j \omega}\right) \right\| ^ {2} d \omega (B.22) \\ = \| \boldsymbol {x} \| ^ {2} (B.23) \\ \end{array} +$$ + +where Equations (B.20) and (B.23) are due to Parseval's theorem (Theorem B.4), Equations (B.20) and (B.21) follows from the convolution theorem (Theorem 2.1), and Equation (B.22) utilizes that $H(e^{j\omega})$ is unitary for any frequency $\omega \in \mathbb{R}$ (thus $\| H(e^{j\omega})X(e^{j\omega})\| = \| X(e^{j\omega})\|$ for any $X(e^{j\omega})$ ). + +The 'only if' part also holds in practice. We here prove by contradiction using periodic inputs (e.g., finite inputs with circular padding). Suppose there exists a frequency $\omega$ and $H(e^{\mathrm{j}\omega})$ is not unitary. Since $H(e^{\mathrm{j}\omega})$ is continuous (due to $h\in \mathcal{L}^2$ and dominated convergence theorem), there exist integers $N,k$ , such that $\omega \approx 2k\pi /N$ and $H(e^{\mathrm{j}2\pi k / N})$ is also not unitary. As a result, there exists a complex vector $\pmb{u}$ such that $\pmb {v} = \pmb {H}(e^{\mathrm{j}2\pi k / N})\pmb{u}$ while $\| \pmb {v}\| \neq \| \pmb {u}\|$ . Therefore, we can construct two periodic sequences $\pmb {x} = \{\pmb {x}[n],n\in [N]\}$ and $\pmb {y} = \{\pmb {y}[n],n\in [N]\}$ such that + +$$ +\boldsymbol {x} [ n ] = \boldsymbol {u} e ^ {\mathrm {j} 2 \pi n k / N} \Longrightarrow \boldsymbol {y} [ n ] = \boldsymbol {v} e ^ {\mathrm {j} 2 \pi n k / N}. \tag {B.24} +$$ + +Now the input norm $\| \pmb{x}\| = \sqrt{\sum_{n\in[N]}\|\pmb{x}[n]\|^2} = \sqrt{N}\|\pmb{u}\|$ is not equal to the output norm $\| \pmb{y}\| = \sqrt{\sum_{n\in[N]}\|\pmb{y}[n]\|^2} = \sqrt{N}\|\pmb{v}\|$ , i.e., the layer is not orthogonal, which leads to a contradiction. + +# C. A Paraunitary Framework for Orthogonal Convolutions + +![](images/518df74152132a9ccd249d498c290f76029fbc7f68bec886a966cdb75518418f.jpg) +Figure 5. A framework for designing orthogonal convolutional layers. In Appendix C.2, we unify variants of orthogonal convolutions in the spectral domain and show that their designs reduce to constructing paraunitary systems. In Appendix C.3, we show that a paraunitary system can be constructed with different approaches: our approach and BCOP (Li et al., 2019b) represent the paraunitary using orthogonal matrices, while CayleyConv (Trockman & Kolter, 2021) and SOC (Singla & Feizi, 2021) directly parameterizes it using unconstrained parameters. In Appendix C.4, we investigate various parameterizations for orthogonal matrices, such as matrix exponential, Cayley transform, and Björck orthogonalization. + +# C.1. Multi-resolution Analysis + +Multi-resolution operations are essential in various convolutional layers, in particular stripped and dilated convolutions. In order to define and analyze these convolutions rigorously, we first review the concepts of up-sampling, down-sampling, and polyphase components. + +(1) Up-sampling. Given a sequence (of scalars, vectors, matrices) $\pmb{x} = \{x[n], n \in \mathbb{Z}\}$ , its up-sampled sequence $\pmb{x}^{\uparrow R} = \{x^{\uparrow R}[n], n \in \mathbb{Z}\}$ is defined as + +$$ +\boldsymbol {x} ^ {\uparrow R} [ n ] \triangleq \left\{ \begin{array}{l l} \boldsymbol {x} [ n / R ] & n \equiv 0 (\mathrm {m o d} R) \\ 0 & \text {o t h e r w i s e} \end{array} , \right. \tag {C.1} +$$ + +where $R \in \mathbb{Z}^+$ is the up-sampling rate. Accordingly, we denote the $\mathbf{Z}$ -transform of $\pmb{x}^{\uparrow R}$ as + +$$ +\boldsymbol {X} ^ {\uparrow R} (z) = \sum_ {n \in \mathbb {Z}} \boldsymbol {x} ^ {\uparrow R} [ n ] z ^ {- n}. \tag {C.2} +$$ + +The following proposition shows that $X^{\uparrow R}(z)$ is easily computed from $X(z)$ . + +Proposition C.1 (Z-transform of up-sampled sequence). Given a sequence $\pmb{x}$ and its up-sampled sequence $\pmb{x}^{\uparrow R}$ , their Z-transforms $\pmb{X}(z)$ and $\pmb{X}^{\uparrow R}(z)$ are related by + +$$ +\boldsymbol {X} ^ {\uparrow R} (z) = \boldsymbol {X} \left(z ^ {R}\right). \tag {C.3} +$$ + +Proof of Proposition C.1. The proof makes use of the definition of Z-transform (Equation (B.3)). + +$$ +\begin{array}{l} \boldsymbol {X} ^ {\uparrow R} (z) = \sum_ {n \in \mathbb {Z}} \boldsymbol {x} ^ {\uparrow R} [ n ] z ^ {- n} (C.4) \\ = \sum_ {m \in \mathbb {Z}} \boldsymbol {x} ^ {\uparrow R} [ m R ] z ^ {- m R} (C.5) \\ = \sum_ {m \in \mathbb {Z}} \boldsymbol {x} [ m ] \left(z ^ {R}\right) ^ {- m} = \boldsymbol {X} \left(z ^ {R}\right), (C.6) \\ \end{array} +$$ + +where Equation (C.5) makes a change of variables $m = n / R$ since $\pmb{x}^{\uparrow R}[n] = 0, \forall n \neq mR$ . + +(2) Down-sampling and polyphase components. Different from the up-sampled sequence, there exist multiple down-sampled sequences, depending on the phase of down-sampling. These sequences are known as the polyphase components. Specifically, given a sequence (of scalars, vectors, or matrices) $\pmb{x} = \{x[n], n \in \mathbb{Z}\}$ , its $r^{\text{th}}$ polyphase component $\pmb{x}^{r|R} = \{x^{r|R}[n], n \in \mathbb{Z}\}$ is defined as + +$$ +\boldsymbol {x} ^ {r | R} [ n ] \triangleq \boldsymbol {x} [ n R + r ], \tag {C.7} +$$ + +where $R\in \mathbb{Z}^+$ is the down-sampling rate. We further denote the Z-transform of $\pmb{x}^{r|R}$ as + +$$ +\boldsymbol {X} ^ {r | R} (z) = \sum_ {n \in \mathbb {Z}} \boldsymbol {x} ^ {r | R} [ n ] z ^ {- n}, \tag {C.8} +$$ + +Note that $r \in \mathbb{Z}$ is an arbitrary integer, which does not necessarily take values from $[R]$ . In fact, we have $\pmb{x}^{(r + kR)|R}[n] = \pmb{x}^{r|R}[n + k]$ and $\pmb{X}^{r + kR|R}(z) = z^k\pmb{X}^{r|R}(z)$ . In Proposition C.2, we establish the relation between $H(z)$ and $\{\pmb{H}^{r|R}(z)\}_{r \in [R]}$ , i.e., to represent $H(z)$ in terms of $\{\pmb{H}^{r|R}(z)\}_{r \in [R]}$ . + +Proposition C.2 (Polyphase decomposition). Given a sequence $\mathbf{x}$ and its polyphase components $\mathbf{x}^{r|R}$ 's, the Z-transform $\mathbf{X}(z)$ can be represented by $\{ \mathbf{X}^{r|R}(z) \}_{r \in [R]}$ as + +$$ +\boldsymbol {X} (z) = \sum_ {r \in [ R ]} \boldsymbol {X} ^ {r | R} \left(z ^ {R}\right) z ^ {- r}. \tag {C.9} +$$ + +Proof of Proposition C.2. We start with $\mathbf{X}(z)$ , and try to decompose it into its polyphase components $\mathbf{X}^{0|R}(z), \dots, \mathbf{X}^{R-1|R}(z)$ . + +$$ +\begin{array}{l} \boldsymbol {X} (z) = \sum_ {n \in \mathbb {Z}} \boldsymbol {x} [ n ] z ^ {- n} (C.10) \\ = \sum_ {r \in [ R ]} \sum_ {m \in \mathbb {Z}} \boldsymbol {x} [ m R + r ] z ^ {- (m R + r)} (C.11) \\ = \sum_ {r \in [ R ]} \left(\sum_ {m \in \mathbb {Z}} \boldsymbol {x} [ m R + r ] z ^ {- m R}\right) z ^ {- r} (C.12) \\ = \sum_ {r \in [ R ]} \left(\sum_ {m \in \mathbb {Z}} \boldsymbol {x} ^ {r | R} [ m ] \left(z ^ {R}\right) ^ {- m}\right) z ^ {- r} (C.13) \\ = \sum_ {r \in [ R ]} \boldsymbol {X} ^ {r | R} \left(z ^ {R}\right) z ^ {- r}, (C.14) \\ \end{array} +$$ + +where Equation (C.11) makes a change of variables $n = mR + r$ , and Equation (C.13) is the definition of polyphase components $\pmb{x}^{r|R}[m] = \pmb{x}[mR + r]$ . + +For simplicity, we stack $R$ consecutive polyphase components into polyphase matrices as + +$$ +\boldsymbol {X} ^ {[ R ]} (z) = \left[ \begin{array}{c} \boldsymbol {X} ^ {0 | R} (z) \\ \vdots \\ \boldsymbol {X} ^ {R - 1 | R} (z) \end{array} \right], \quad \widetilde {\boldsymbol {X}} ^ {[ R ]} (z) = \left[ \boldsymbol {X} ^ {- 0 | R} (z); \dots ; \boldsymbol {X} ^ {- (R - 1) | R} (z) \right]. \tag {C.15} +$$ + +The following proposition extends the Parseval's theorem in Theorem B.4 and shows that the sequence norm $\| \pmb{x}\|$ can also be computed in terms of the polyphase matrix $X^{[R]}(z)$ (or $\widetilde{X}^{[R]}(z)$ ). + +Proposition C.3 (Parseval's theorem for polyphase matrices). Given a sequence $\mathbf{x}$ , its sequence norm $\| \mathbf{x} \|$ can be computed by $X^{[R]}(e^{\mathrm{j}\omega})$ (or $\widetilde{X}^{[R]}(e^{\mathrm{j}\omega})$ ) in the spectral domain as + +$$ +\left\| \boldsymbol {x} \right\| ^ {2} = \frac {1}{2 \pi} \int_ {- \pi} ^ {\pi} \left\| \boldsymbol {X} ^ {[ R ]} \left(e ^ {\mathrm {j} \omega}\right) \right\| ^ {2} d \omega = \frac {1}{2 \pi} \int_ {- \pi} ^ {\pi} \left\| \widetilde {\boldsymbol {X}} ^ {[ R ]} \left(e ^ {\mathrm {j} \omega}\right) \right\| ^ {2} d \omega . \tag {C.16} +$$ + +Proof of Proposition C.3. The proof follows the standard Parseval's theorem in Theorem B.4. We only prove the first part of the proposition (using $\mathbf{X}^{[R]}(e^{\mathrm{j}\omega})$ ) as follows. + +$$ +\begin{array}{l} \left\| \boldsymbol {x} \right\| ^ {2} = \sum_ {n \in \mathbb {Z}} \left\| \boldsymbol {x} [ n ] \right\| ^ {2} (C.17) \\ = \sum_ {r \in [ R ]} \sum_ {m \in \mathbb {Z}} \| \boldsymbol {x} [ m R + r ] \| ^ {2} (C.18) \\ = \sum_ {r \in [ R ]} \sum_ {m \in \mathbb {Z}} \left\| \boldsymbol {x} ^ {r | R} [ m ] \right\| ^ {2} (C.19) \\ = \frac {1}{2 \pi} \sum_ {r \in [ R ]} \int_ {- \pi} ^ {\pi} \left\| \boldsymbol {X} ^ {r | R} \left(e ^ {\mathrm {j} \omega}\right) \right\| ^ {2} d \omega (C.20) \\ = \frac {1}{2 \pi} \int_ {- \pi} ^ {\pi} \left\| \boldsymbol {X} ^ {[ R ]} \left(e ^ {\mathrm {j} \omega}\right) \right\| ^ {2} d \omega , (C.21) \\ \end{array} +$$ + +where Equation (C.17) follows the definition of sequence norm, Equation (C.18) changes variables as $n = mR + r$ , Equation (C.19) is the definition of polyphase components, and Equation (C.20) applies Parseval's theorem to $x^{r|R}$ 's. The second part (using $\widetilde{X}^{[R]}(e^{\mathrm{j}\omega})$ ) can be proved similarly. + +# C.2. Unifying Various Convolutional Layers in the Spectral Domain + +In Appendix B, the convolution theorem states that a standard convolutional layer is a matrix-vector product $\mathbf{Y}(z) = \mathbf{H}(z)\mathbf{X}(z)$ in the spectral domain, and the layer is orthogonal if and only if $\mathbf{H}(z)$ is paraunitary (Theorem B.6). However, the canonical convolution theorem does not hold for variants of convolutions, thus enforcing a paraunitary $\mathbf{H}(z)$ may not lead to orthogonal convolution. In this subsection, we address this limitation by showing that various convolutions can be uniformly written as $\underline{\mathbf{Y}}(z) = \underline{\mathbf{H}}(z)\underline{\mathbf{X}}(z)$ , where $\underline{\mathbf{Y}}(z), \underline{\mathbf{H}}(z), \underline{\mathbf{X}}(z)$ are some spectral representations of $\mathbf{y}, \mathbf{h}, \mathbf{x}$ . Subsequently, we prove that any of these layers is orthogonal if and only if its $\underline{\mathbf{H}}(z)$ is paraunitary. + +(1) Strided convolutional layers are widely used in neural networks to adjust the feature resolution: a strided convolution layer decreases the resolution by down-sampling after a standard convolution, while a transposed convolution increases the resolution by up-sampling before a standard convolution. + +Formally, a strided convolutional layer with stride $R$ (abbrev. as $\downarrow R$ -strided convolution) computes its output following + +$$ +\boldsymbol {y} [ i ] = \sum_ {n \in \mathbb {Z}} \boldsymbol {h} [ n ] \boldsymbol {x} [ R i - n ]. \tag {C.22} +$$ + +In contrast, a transposed strided convolutional layer with stride $R$ (abbrev. as $\uparrow R$ -strided convolution) computes its output according to + +$$ +\boldsymbol {y} [ i ] = \sum_ {n \in \mathbb {Z}} \boldsymbol {h} [ n ] \boldsymbol {x} ^ {\uparrow R} [ i - n ]. \tag {C.23} +$$ + +Proposition C.4 (Orthogonality of strided convolutional layers). For $a \downarrow R$ -strided convolution, the spatial convolution in Equation (C.22) leads to the following spectral representation: + +$$ +\boldsymbol {Y} (z) = \widetilde {\boldsymbol {H}} ^ {[ R ]} (z) \boldsymbol {X} ^ {[ R ]} (z) \tag {C.24} +$$ + +And for an $\uparrow R$ -strided convolution, the spatial convolution is represented in spectral domain as: + +$$ +\boldsymbol {Y} ^ {[ R ]} (z) = \boldsymbol {H} ^ {[ R ]} (z) \boldsymbol {X} (z) \tag {C.25} +$$ + +Furthermore, $a \downarrow R$ -strided convolution is orthogonal if and only if $\widetilde{\pmb{H}}^{[R]}(z)$ is paraunitary, and an $\uparrow R$ -strided convolution is orthogonal if and only if $\pmb{H}^{[R]}[z]$ is paraunitary. + +Proof of Proposition C.4. (1a) $\downarrow R$ -strided convolutions. We first prove the spectral representation of $\downarrow R$ -strided convolution in Equation (C.24). + +$$ +\begin{array}{l} \boldsymbol {Y} (z) = \sum_ {i \in \mathbb {Z}} \boldsymbol {y} [ i ] z ^ {- i} = \sum_ {i \in \mathbb {Z}} \left(\sum_ {n \in \mathbb {Z}} \boldsymbol {h} [ n ] \boldsymbol {x} [ R i - n ]\right) z ^ {- i} (C.26) \\ = \sum_ {i \in \mathbb {Z}} \left(\sum_ {r \in [ R ]} \sum_ {m \in \mathbb {Z}} \boldsymbol {h} [ m R - r ] \boldsymbol {x} [ (i - m) R + r ]\right) z ^ {- i} (C.27) \\ = \sum_ {r \in [ R ]} \left(\sum_ {m \in \mathbb {Z}} h [ m R - r ] z ^ {- m} \left(\sum_ {i} x [ (i - m) R + r ] z ^ {- (i - m)}\right)\right) (C.28) \\ = \sum_ {r \in [ R ]} \left(\sum_ {m \in \mathbb {Z}} h [ m R - r ] z ^ {- m}\right) \left(\sum_ {i ^ {\prime} \in \mathbb {Z}} \boldsymbol {x} \left[ i ^ {\prime} R + r \right] z ^ {- i ^ {\prime}}\right) (C.29) \\ = \sum_ {r \in [ R ]} \boldsymbol {H} ^ {- r | R} (z) \boldsymbol {X} ^ {r | R} (z), (C.30) \\ \end{array} +$$ + +where Equation (C.26) follows from the definitions of the $\downarrow R$ -strided convolution (Equation (C.22)) and the Z-transform (Equation (B.3)), Equation (C.27) makes a change of variables $n = mR - r$ , Equation (C.29) further changes $i' = i - m$ , and Equation (C.30) is due to the definition of polyphase components (Equation (C.7)). Now We rewrite the last equation concisely as + +$$ +\boldsymbol {Y} (z) = \underbrace {\left[ \boldsymbol {H} ^ {- 0 | R} (z) ; \cdots ; \boldsymbol {H} ^ {- (R - 1)} (z) \right]} _ {\widetilde {\boldsymbol {H}} ^ {[ R ]} (z)} \underbrace {\left[ \begin{array}{c} \boldsymbol {X} ^ {0 | R} (z) \\ \vdots \\ \boldsymbol {X} ^ {R - 1 | R} (z) \end{array} \right]} _ {\boldsymbol {X} ^ {[ R ]} (z)}, \tag {C.31} +$$ + +which is the spectral representation of $\downarrow R$ -strided convolutions in Equation (C.24). + +Now we prove the orthogonality condition for $\downarrow R$ -strided convolutions. + +$$ +\begin{array}{l} \left\| \boldsymbol {y} \right\| ^ {2} = \frac {1}{2 \pi} \int_ {- \pi} ^ {\pi} \left\| \boldsymbol {Y} \left(e ^ {\mathrm {j} \omega}\right) \right\| ^ {2} d \omega (C.32) \\ = \frac {1}{2 \pi} \int_ {- \pi} ^ {\pi} \left\| \widetilde {\boldsymbol {H}} ^ {[ R ]} \left(e ^ {\mathrm {j} \omega}\right) \boldsymbol {X} ^ {[ R ]} \left(e ^ {\mathrm {j} \omega}\right) \right\| ^ {2} d \omega (C.33) \\ = \frac {1}{2 \pi} \int_ {- \pi} ^ {\pi} \left\| \boldsymbol {X} ^ {[ R ]} \left(e ^ {\mathrm {j} \omega}\right) \right\| ^ {2} d \omega (C.34) \\ = \left\| \boldsymbol {x} \right\| ^ {2}, (C.35) \\ \end{array} +$$ + +where Equations (C.32) and (C.35) are due to Parseval's theorems (Theorem B.4 and Proposition C.3), Equation (C.33) follows from the spectral representation of the $\downarrow R$ -strided convolution (Equation (C.24)), and Equation (C.34) utilizes that the transfer matrix is unitary at each frequency. The "only if" part can be proved by contradiction similar to Theorem B.6. + +(1b) $\uparrow R$ -strided convolutions. According to Proposition C.1, the Z-transform of $x^{\uparrow R}$ is $X(z^{R})$ . Therefore, an application of the convolution theorem (Theorem 2.1) on Equation (C.23) leads us to + +$$ +\boldsymbol {Y} (z) = \boldsymbol {H} (z) \boldsymbol {X} \left(z ^ {R}\right) \tag {C.36} +$$ + +Expanding $\mathbf{Y}(z)$ and $H(z)$ using polyphase decomposition (Proposition C.2), we have + +$$ +\sum_ {r \in [ R ]} \boldsymbol {Y} ^ {r | R} \left(z ^ {R}\right) z ^ {- r} = \left(\sum_ {r \in [ R ]} \boldsymbol {H} ^ {r | R} \left(z ^ {R}\right) z ^ {- r}\right) \boldsymbol {X} \left(z ^ {R}\right) \tag {C.37} +$$ + +$$ +\sum_ {r \in [ R ]} \mathbf {Y} ^ {r | R} \left(z ^ {R}\right) z ^ {- r} = \sum_ {r \in [ R ]} \left(\mathbf {H} ^ {r | R} \left(z ^ {R}\right) \mathbf {X} \left(z ^ {R}\right)\right) z ^ {- r} \tag {C.38} +$$ + +$$ +\boldsymbol {Y} ^ {r | R} \left(z ^ {R}\right) = \boldsymbol {H} ^ {r | R} \left(z ^ {R}\right) \boldsymbol {X} \left(z ^ {R}\right), \forall r \in [ R ] \tag {C.39} +$$ + +$$ +\boldsymbol {Y} ^ {r | R} (z) = \boldsymbol {H} ^ {r | R} (z) \boldsymbol {X} (z), \forall r \in [ R ], \tag {C.40} +$$ + +where Equation (C.39) is due to the uniqueness of $Z$ -transform, and Equation (C.40) changes the variables from $z^R$ to $z$ . Again, we can rewrite the last equation in concisely as + +$$ +\underbrace {\left[ \begin{array}{c} \boldsymbol {Y} ^ {0 | R} (z) \\ \boldsymbol {Y} ^ {1 | R} (z) \\ \vdots \\ \boldsymbol {Y} ^ {R - 1 | R} (z) \end{array} \right]} _ {\boldsymbol {Y} ^ {[ R ]} (z)} = \underbrace {\left[ \begin{array}{c} \boldsymbol {H} ^ {0 | R} (z) \\ \boldsymbol {H} ^ {1 | R} (z) \\ \vdots \\ \boldsymbol {H} ^ {R - 1 | R} (z) \end{array} \right]} _ {\boldsymbol {H} ^ {[ R ]} (z)} \boldsymbol {X} (z), \tag {C.41} +$$ + +which is the spectral representation of $\uparrow R$ -strided convolutions in Equation (C.25). + +Lastly, we prove the orthogonality condition for $\uparrow R$ -strided convolutions. + +$$ +\begin{array}{l} \left\| \boldsymbol {y} \right\| ^ {2} = \frac {1}{2 \pi} \int_ {- \pi} ^ {\pi} \left\| \boldsymbol {Y} ^ {[ R ]} \left(e ^ {\mathrm {j} \omega}\right) \right\| ^ {2} d \omega (C.42) \\ = \frac {1}{2 \pi} \int_ {- \pi} ^ {\pi} \left\| \boldsymbol {H} ^ {[ R ]} \left(e ^ {j \omega}\right) \boldsymbol {X} \left(e ^ {j \omega}\right) \right\| ^ {2} d \omega (C.43) \\ = \frac {1}{2 \pi} \int_ {- \pi} ^ {\pi} \left\| \boldsymbol {X} \left(e ^ {\mathrm {j} \omega}\right) \right\| ^ {2} d \omega (C.44) \\ = \left\| \boldsymbol {x} \right\| ^ {2}, (C.45) \\ \end{array} +$$ + +where Equations (C.42) and (C.45) are due to Parseval's theorems (Theorem B.4 and Proposition C.3), Equation (C.43) follows from the spectral representation of the $\uparrow R$ -strided convolution (Equation (C.25)), and Equation (C.44) uses the fact that the transfer matrix is unitary for each frequency. The "only if" part can be proved by contradiction similar to Theorem B.6. + +(2) Dilated convolutional layer is proposed to increase the receptive field of a convolutional layer without extra parameters and computation. The layer up-samples its filter bank before convolution with the input. $R$ -dilated convolutional layer) computes its output with the following equation: + +$$ +\boldsymbol {y} [ i ] = \sum_ {n \in \mathbb {Z}} \boldsymbol {h} ^ {\uparrow R} [ n ] \boldsymbol {x} [ i - n ] \tag {C.46} +$$ + +Proposition C.5 (Orthogonality of dilated convolutional layer). For an $R$ -dilated convolution, the spatial convolution in Equation (C.46) leads to a spectral representation as + +$$ +\boldsymbol {Y} (z) = \boldsymbol {H} \left(z ^ {R}\right) \boldsymbol {X} (z), \tag {C.47} +$$ + +Furthermore, an $R$ -dilated convolutional layer is orthogonal if and only if $\pmb{H}(z^R)$ is paraunitary. + +Proof of Proposition C.5. According to Proposition C.1, the $Z$ -transform of $h^{\uparrow R}$ is $\pmb{H}(z^{R})$ . Therefore, the "if" part follows directly from the convolution theorem. The "only if" part can be proved by constructing a counterexample similar to Theorem B.6. + +Notice that $H(z^{R})$ is a paraunitary if and only if $H(e^{\mathrm{j}\omega})$ is unitary for all frequency $\omega \in \mathbb{R}$ , which is the same as $XHz$ being a paraunitary. In other words, any filter bank that is orthogonal for a standard convolution is also orthogonal for a dilated convolution and vice versa. + +(3) Group convolutional layer is proposed to reduce the parameters and computations and used in many efficient architectures, including MobileNet, ShuffleNet. The layer divides both input/output channels into multiple groups and restricts the connections within each group. + +Formally, a group convolutional layer with $G$ groups (abbrev. as $G$ -group convolutions) is parameterized by $G$ filter banks $\{h^g\}_{g \in [G]}$ , each consists of $(T / G) \times (S / G)$ filters. The layer maps an $S$ channels input $x$ to a $T$ channels output $y$ according to + +$$ +\boldsymbol {y} [ i ] = \sum_ {n \in \mathbb {Z}} \operatorname {b l k d i a g} \left(\left\{\boldsymbol {h} ^ {g} [ n ] \right\} _ {g \in [ G ]}\right) \boldsymbol {x} [ i - n ], \tag {C.48} +$$ + +where $\mathrm{blkdiag}(\{\cdot\})$ computes a block diagonal matrix from a set of matrices. + +Proposition C.6 (Orthogonality of group convolutional layer). For a $G$ -group convolution, the spatial convolution in Equation (C.48) leads to a spectral representation as, their $z$ -transforms satisfy + +$$ +\boldsymbol {Y} (z) = \operatorname {b l k d i a g} \left(\left\{\boldsymbol {H} ^ {g} (z) \right\} _ {g \in [ G ]}\right) \boldsymbol {X} (z), \tag {C.49} +$$ + +Furthermore, a $G$ -group convolutional layer is orthogonal if and only if the block diagonal matrix is paraunitary, i.e., each $h^g(z)$ is paraunitary. + +Proof of Proposition C.6. Due to the convolution theorem, it suffices to prove that the $Z$ -transform of a sequence of block diagonal matrices is also block diagonal in the spectral domain. + +$$ +\begin{array}{l} \underbrace {\left[ \begin{array}{c c c} \mathbf {h} ^ {0} [ n ] & & \\ & \ddots & \\ & & \mathbf {h} ^ {G - 1} [ n ] \end{array} \right]} _ {\text {b l k d i a g} (\{\mathbf {h} ^ {g} [ n ] \} _ {g \in [ G ]})} z ^ {- n} = \left[ \begin{array}{c c c} \sum_ {n \in \mathbb {Z}} \mathbf {h} ^ {0} [ n ] z ^ {- n} & & \\ & \ddots & \\ & & \sum_ {n \in \mathbb {Z}} \mathbf {h} ^ {G - 1} [ n ] z ^ {- n} \end{array} \right] (C.50) \\ = \underbrace {\left[ \begin{array}{c c c} \boldsymbol {H} ^ {0} (z) & & \\ & \ddots & \\ & & \boldsymbol {H} ^ {G - 1} (z) \end{array} \right]} _ {\text {b l k d i a g} \left(\left\{\boldsymbol {H} ^ {g} (z) \right\} _ {g \in [ G ]}\right)}. (C.51) \\ \end{array} +$$ + +As a result, we can write the orthogonality condition as + +$$ +\begin{array}{l} \left[ \begin{array}{c c c} {\pmb {H} ^ {0} (z)} & & \\ & \ddots & \\ & & {\pmb {h} ^ {G - 1} (z)} \end{array} \right] ^ {\dagger} \left[ \begin{array}{c c c} {\pmb {H} ^ {0} (z)} & & \\ & \ddots & \\ & & {\pmb {H} ^ {G - 1} (z)} \end{array} \right] \\ = \left[ \begin{array}{c c c} \boldsymbol {H} ^ {0} (z) ^ {\dagger} \boldsymbol {H} ^ {0} (z) & & \\ & \ddots & \\ & & \boldsymbol {H} ^ {G - 1} (z) ^ {\dagger} \boldsymbol {H} ^ {G - 1} (z) \end{array} \right] = \boldsymbol {I}, \forall | z | = 1. \tag {C.52} \\ \end{array} +$$ + +The equation implies $H^{g}(z)^{\dagger}H^{g}(z) = I, \forall |z| = 1, \forall g \in [G]$ , i.e., each $H^{g}(z)$ is a unitary. + +# C.3. Realizations of Paraunitary Systems + +In this subsection, we first prove that all finite-length 1D-paraunitary systems can be represented in a factorized form. Next, we show how we can construct MD-paraunitary systems using 1D systems. Lastly, we study the relationship of existing approaches to paraunitary systems. + +# C.3.1. COMPLETE FACTORIZATION OF 1D-PARAUNITARY SYSTEMS + +The classic theorem for spectral factorization of paraunitary systems is traditionally developed for causal systems (Vaidyanathan, 1993; Kautsky & Turcajova, 1994). Given a causal paraunitary system of length $L$ (i.e., polynomial in $z^{-1}$ ), there always exists a factorization such that + +$$ +\boldsymbol {H} (\boldsymbol {z}) = \mathbf {Q} \boldsymbol {V} \left(z ^ {- 1}; \boldsymbol {U} ^ {(1)}\right) \dots \boldsymbol {V} \left(z ^ {- 1}; \boldsymbol {U} ^ {(L - 1)}\right), \tag {C.53} +$$ + +where $Q$ is an orthogonal matrix, $U^{(\ell)}$ is a column-orthogonal matrix, and $V(z;U)$ is defined as + +$$ +\boldsymbol {V} (z; \boldsymbol {U}) = (\boldsymbol {I} - \boldsymbol {U} \boldsymbol {U} ^ {\top}) + \boldsymbol {U} \boldsymbol {U} ^ {\top} z. \tag {C.54} +$$ + +In Theorem C.7, we extends this theorem from causal systems to finite-length (but non-causal) ones. + +Theorem C.7 (Complete factorization for 1D-paraunitary systems). Suppose that a paraunitary system $H(z)$ is finite-length, i.e., it can be written as $\sum_{n} h[n]z^{-n}$ for some sequence $\{h[n], n \in [-\underline{L}, \overline{L}]\}$ , then it can be factorized in the following form: + +$$ +\boldsymbol {H} (\boldsymbol {z}) = \boldsymbol {V} (z; \boldsymbol {U} ^ {(- \underline {{L}})}) \dots \boldsymbol {V} (z; \boldsymbol {U} ^ {(- 1)}) \mathbf {Q} \boldsymbol {V} (z ^ {- 1}; \boldsymbol {U} ^ {(1)}) \dots \boldsymbol {V} (z ^ {- 1}; \boldsymbol {U} ^ {(\bar {L})}), \tag {C.55} +$$ + +where $Q$ is an orthogonal matrix, $U^{(\ell)}$ is a column-orthogonal matrix, and $V(z;U)$ is defined in Equation (C.54). Consequently, the paraunitary system $\pmb{H}(z)$ is parameterized by $\underline{L} +\overline{L} +1$ (column-)orthogonal matrices $\pmb{Q}$ and $\pmb{U}^{(\ell)}$ 's. + +Proof for Theorem C.7. Given a non-causal paraunitary system $H(z)$ , we can always find a causal counterpart $\hat{H}(z)$ such that $H(z) = z^{\underline{L}}\hat{H}(z)$ (This can be done by shifting the causal system backward by $\underline{L}$ steps, which is equivalent to multiplying $z^{\underline{L}}$ in the spectral domain). Since the causal system $\hat{H}(z)$ admits a factorization in Equation (C.55), we can write the non-causal system $H(z)$ as + +$$ +\boldsymbol {H} (z) = z ^ {\underline {{L}}} \boldsymbol {Q} \boldsymbol {V} \left(z ^ {- 1}; \hat {\boldsymbol {U}} ^ {(1)}\right) \dots \boldsymbol {V} \left(z ^ {- 1}; \hat {\boldsymbol {U}} ^ {(\underline {{L}} + \bar {L})}\right). \tag {C.56} +$$ + +Therefore, it suffices to show that for an orthogonal matrix $Q$ and any column-orthogonal matrix $\hat{U}$ , we can always find another column-orthogonal matrix $U$ such that + +$$ +z \boldsymbol {Q} \boldsymbol {V} \left(z ^ {- 1}; \hat {\boldsymbol {U}}\right) = \boldsymbol {V} \left(z; \boldsymbol {U}\right) \boldsymbol {Q}. \tag {C.57} +$$ + +If the equation above is true, we can set $\pmb{U}^{(\ell)} = \hat{\pmb{U}}^{(\ell -1 - \underline{L})}$ for $\ell < 0$ and $\pmb{U}^{(\ell)} = \hat{\pmb{U}}^{(\ell -\underline{L})}$ for $\ell >0$ , which will convert Equation (C.56) into Equation (C.55). + +Now we start to prove Equation (C.57). Note that any column-orthogonal $\hat{U}$ has a complement $\bar{U}$ such that $[\hat{U},\bar{U} ]$ is orthogonal and $I = \hat{U}\hat{U}^{\top} + \bar{U}\bar{U}^{\top}$ . We then rewrite Equation (C.57) as + +$$ +\begin{array}{l} z Q \boldsymbol {V} \left(z ^ {- 1}; \hat {\boldsymbol {U}}\right) = z Q \left(\boldsymbol {I} - \hat {\boldsymbol {U}} \hat {\boldsymbol {U}} ^ {\top} + \hat {\boldsymbol {U}} \hat {\boldsymbol {U}} ^ {\top} z ^ {- 1}\right) (C.58) \\ = \boldsymbol {Q} (\boldsymbol {I} - \bar {\boldsymbol {U}} \bar {\boldsymbol {U}} ^ {\top} + \bar {\boldsymbol {U}} \bar {\boldsymbol {U}} ^ {\top} z) (C.59) \\ = (\boldsymbol {I} - \boldsymbol {Q} \bar {\boldsymbol {U}} \bar {\boldsymbol {U}} ^ {\top} \boldsymbol {Q} ^ {\top} + \boldsymbol {Q} \bar {\boldsymbol {U}} \bar {\boldsymbol {U}} ^ {\top} \boldsymbol {Q} ^ {\top} z) \boldsymbol {Q} (C.60) \\ = (\boldsymbol {I} - \boldsymbol {U} \boldsymbol {U} ^ {\top} + \boldsymbol {U} \boldsymbol {U} ^ {\top} z) \boldsymbol {Q} (C.61) \\ = \boldsymbol {V} (z; \boldsymbol {U}) \boldsymbol {Q}, (C.62) \\ \end{array} +$$ + +where in Equation (C.61) we set $\pmb{U} = \pmb{Q}\bar{\pmb{U}}$ . This completes the proof. + +# C.3.2. MULTI-DIMENSIONAL (MD) PARAUNITARY SYSTEMS + +If the data are multi-dimensional (MD), we will need MD-convolutional layers in neural networks. Analogously, we can prove the equivalence between orthogonal MD-convolutions in the spatial domain and MD-paraunitary systems in the spectral domain, i.e., + +$$ +\boldsymbol {H} (\boldsymbol {z}) ^ {\dagger} \boldsymbol {H} (\boldsymbol {z}) = \boldsymbol {I}, \boldsymbol {z} = (z _ {1}, \dots , z _ {D}), | z _ {d} | = 1, \forall d \in [ D ], \tag {C.63} +$$ + +where $D$ is the data dimension. In this work, we adopt a parameterization based on separable systems. + +Definition C.8 (Separable MD-paraunitary system). A MD-paraunitary system $\pmb{H}(\pmb{z})$ is separable if there exists $D$ 1D-paraunitary systems $H_{1}(z_{1}),\dots ,H_{D}(z_{D})$ such that + +$$ +\boldsymbol {H} (\boldsymbol {z}) = \boldsymbol {H} (z _ {1}, \dots , z _ {D}) \triangleq \boldsymbol {H} _ {\mathbf {1}} (z _ {1}) \dots \boldsymbol {H} _ {\mathbf {D}} (z _ {D}). \tag {C.64} +$$ + +Therefore, we can construct an MD-paraunitary system with $D$ number of 1D-paraunitary systems, each of which is represented in Equation (C.55). Notice that not all MD-paraunitary systems are separable, thus the parameterization in Equation (C.64) is not complete (see Section 5 for a discussion). However, we can guarantee that our parameterization realizes all separable MD-paraunitary systems — each separable paraunitary system admits a factorization in Equation (C.64), where each 1D-system admits a factorization in Equation (C.55). + +# C.3.3. INTERPRETATIONS OF PREVIOUS APPROACHES + +In Theorem B.6, we have shown that a paraunitary transfer matrix is both necessary and sufficient for a convolution to be orthogonal. Therefore, we can interpret all approaches for orthogonal convolutions as implicit constructions of paraunitary systems, including singular value clipping and masking (SVCM) (Sedghi et al., 2019), block convolution orthogonal parameterization (BCOP) (Li et al., 2019b), Cayley convolution (CayleyConv) (Trockman & Kolter, 2021), skew orthogonal convolution (SOC) (Singla & Feizi, 2021). Furthermore, we prove how orthogonal regularization (Wang et al., 2019; Qi et al., 2020) encourages the transfer matrix to be unitary for all frequencies. + +(1) Singular value clipping and masking (SVCM) (Sedghi et al., 2019) clips all singular values of $H(e^{\mathrm{j}\omega})$ to ones for each frequency $\omega$ after gradient update. Since the clipping step can arbitrarily enlarge the filter length, SVCM subsequently masks out the coefficients outside the filter length. However, the masking step breaks the orthogonality, as we have seen in the experiments (Section 6.1). +(2) Block convolution orthogonal parameterization (BCOP) (Li et al., 2019b) tries to generalize the spectral factorization of 1D-paraunitary systems in Equation (C.55) to 2D-paraunitary systems. + +$$ +\boldsymbol {H} \left(z _ {1}, z _ {2}\right) = z _ {1} ^ {\frac {K - 1}{2}} z _ {2} ^ {\frac {K - 1}{2}} \boldsymbol {Q V} \left(z _ {1}, z _ {2}; \boldsymbol {U} _ {1} ^ {(1)}, \boldsymbol {U} _ {2} ^ {(1)}\right) \dots \boldsymbol {V} \left(z _ {1}, z _ {2}; \boldsymbol {U} _ {1} ^ {(K - 1)}, \boldsymbol {U} _ {2} ^ {(K - 1)}\right), \tag {C.65} +$$ + +where $V(z_{1},z_{2};U_{1}^{(\ell)},U_{2}^{(\ell)}) = V(z_{1};U_{1}^{(\ell)})V(z_{2};U_{2}^{(\ell)})$ . In other words, this approach makes each $V$ -block, instead of the whole paraunitary system, separable. This factorization in BCOP is incomplete for 2D-paraunitary system — unlike 1D-paraunitary systems, not every 2D-paraunitary system admits a factorized form (Lin & Vaidyanathan, 1996). + +(2) Calyey convolution (CayleyConv) (Trockman & Kolter, 2021) aims to generalize the Cayley transform for orthogonal matrices in Equation (C.88) to 2D-paraunitary systems $H(z_{1},z_{2})$ : + +$$ +\boldsymbol {H} \left(z _ {1}, z _ {2}\right) = \left(\boldsymbol {I} - \boldsymbol {A} \left(z _ {1}, z _ {2}\right)\right) \left(\boldsymbol {I} + \boldsymbol {A} \left(z _ {1}, z _ {2}\right)\right) ^ {- 1}, \tag {C.66} +$$ + +where $A(z_{1},z_{2})$ is a skew-Hermitian matrix for $|z_1| = 1, |z_2| = 1$ (i.e., $A(e^{\mathrm{j}\omega_1},e^{\mathrm{j}\omega_2})^\dagger = A(e^{\mathrm{j}\omega_1},e^{\mathrm{j}\omega_2})$ for any $\omega_{1},\omega_{2}$ ). Since Cayley transform cannot parameterize a matrix with singular value -1 for any frequency, the CayleyConv is not a complete parameterization. + +(4) Skew orthogonal convolution (SOC) (Singla & Feizi, 2021) aims to generalize the matrix exponential for orthogonal matrices (Equation (C.90)) to convolution exponential for 2D-paraunitary systems $H(z_{1},z_{2})$ : + +$$ +\boldsymbol {H} \left(z _ {1}, z _ {2}\right) = \exp \left(\boldsymbol {A} \left(z _ {1}, z _ {2}\right)\right) \triangleq \sum_ {k = 0} ^ {\infty} \frac {\boldsymbol {A} \left(z _ {1} , z _ {2}\right)}{k !} = \boldsymbol {I} + \boldsymbol {A} \left(z _ {1}, z _ {2}\right) + \frac {\boldsymbol {A} \left(z _ {1} , z _ {2}\right) ^ {2}}{2} + \dots , \tag {C.67} +$$ + +where $A(z_{1},z_{2})$ is skew-Hermitian matrix for any matrix for $|z_1| = 1, |z_2| = 1$ (in other words, $A(e^{\mathrm{j}\omega_1},e^{\mathrm{j}\omega_2})^\dagger = A(e^{\mathrm{j}\omega_1},e^{\mathrm{j}\omega_2})$ for any $\omega_{1},\omega_{2}$ ). It is not resolved whether all 2D-paraunitary systems can be represented in terms of convolution exponential. + +(5) Orthogonal regularization (Ortho-Reg) (Wang et al., 2019; Qi et al., 2020) is developed to encourage orthogonality in convolutional layers. We show that such orthogonal regularization is equivalent to a unitary regularization of the + +paraunitary system with uniform weights on all frequencies. + +$$ +\sum_ {i \in \mathbb {Z}} \left\| \sum_ {n \in \mathbb {Z}} \boldsymbol {h} [ n ] \boldsymbol {h} [ n - R i ] ^ {\top} - \boldsymbol {\delta} [ i ] \right\| ^ {2} = \frac {1}{2 \pi} \int_ {- \pi} ^ {\pi} \left\| \boldsymbol {H} ^ {[ R ]} \left(e ^ {\mathrm {j} \omega}\right) ^ {\dagger} \boldsymbol {H} ^ {[ R ]} \left(e ^ {\mathrm {j} \omega}\right) - \boldsymbol {I} \right\| ^ {2} d \omega , \tag {C.68} +$$ + +where $\delta[0] = I$ is an identity matrix, $\delta[n] = 0$ is a zero matrix for $n \neq 0$ . We prove the equivalence more generally in Proposition C.9. However, this approach cannot enforce exact orthogonality and in practice requires hyperparameter search for a proper regularizer coefficient. + +Proposition C.9 (Parseval's theorem for ridge regularization). Given a sequence of matrices $\pmb{h} = \{\pmb{h}[n], n \in \mathbb{Z}\}$ , the following four expressions are equivalent: + +$$ +\frac {1}{2 \pi} \int_ {- \pi} ^ {\pi} \left\| \boldsymbol {H} ^ {[ R ]} \left(e ^ {\mathrm {j} \omega}\right) ^ {\dagger} \boldsymbol {H} ^ {[ R ]} \left(e ^ {\mathrm {j} \omega}\right) - \boldsymbol {I} \right\| ^ {2} d \omega , \tag {C.69a} +$$ + +$$ +\sum_ {i \in \mathbb {Z}} \left\| \sum_ {n \in \mathbb {Z}} \boldsymbol {h} [ n ] ^ {\top} \boldsymbol {h} [ n - R i ] - \boldsymbol {\delta} [ i ] \right\| ^ {2}, \tag {C.69b} +$$ + +$$ +\frac {1}{2 \pi} \int_ {- \pi} ^ {\pi} \left\| \boldsymbol {H} ^ {[ R ]} \left(e ^ {\mathrm {j} \omega}\right) \boldsymbol {H} ^ {[ R ]} \left(e ^ {\mathrm {j} \omega}\right) ^ {\dagger} - \boldsymbol {I} \right\| ^ {2} d \omega , \tag {C.69c} +$$ + +$$ +\sum_ {i \in \mathbb {Z}} \left\| \sum_ {n \in \mathbb {Z}} \boldsymbol {h} [ n ] \boldsymbol {h} [ n - R i ] ^ {\top} - \boldsymbol {\delta} [ i ] \right\| ^ {2}, \tag {C.69d} +$$ + +where $\| \cdot \|$ denotes the Frobenius norm of a matrix. + +Proof of Proposition C.9. We first prove the equivalence between Equations (C.69a) and (C.69c). + +$$ +\begin{array}{l} \left\| \boldsymbol {H} ^ {[ R ]} (e ^ {\mathrm {j} \omega}) ^ {\dagger} \boldsymbol {H} ^ {[ R ]} (e ^ {\mathrm {j} \omega}) - \boldsymbol {I} \right\| ^ {2} \\ = \operatorname {t r} \left(\left(\boldsymbol {H} ^ {[ R ]} \left(e ^ {\mathrm {j} \omega}\right) ^ {\dagger} \boldsymbol {H} ^ {[ R ]} \left(e ^ {\mathrm {j} \omega}\right) - \boldsymbol {I}\right) ^ {\dagger} \left(\boldsymbol {H} ^ {[ R ]} \left(e ^ {\mathrm {j} \omega}\right) ^ {\dagger} \boldsymbol {H} ^ {[ R ]} \left(e ^ {\mathrm {j} \omega}\right) - \boldsymbol {I}\right)\right) (C.70) \\ = \operatorname {t r} \left(\boldsymbol {H} ^ {[ R ]} \left(e ^ {\mathrm {j} \omega}\right) ^ {\dagger} \boldsymbol {H} ^ {[ R ]} \left(e ^ {\mathrm {j} \omega}\right) \boldsymbol {H} ^ {[ R ]} \left(e ^ {\mathrm {j} \omega}\right) ^ {\dagger} \boldsymbol {H} ^ {[ R ]} \left(e ^ {\mathrm {j} \omega}\right)\right) - 2 \operatorname {t r} \left(\boldsymbol {H} ^ {[ R ]} \left(e ^ {\mathrm {j} \omega}\right) ^ {\dagger} \boldsymbol {H} ^ {[ R ]} \left(e ^ {\mathrm {j} \omega}\right)\right) + \boldsymbol {I} (C.71) \\ = \operatorname {t r} \left(\boldsymbol {H} ^ {[ R ]} \left(e ^ {\mathrm {j} \omega}\right) \boldsymbol {H} ^ {[ R ]} \left(e ^ {\mathrm {j} \omega}\right) ^ {\dagger} \boldsymbol {H} ^ {[ R ]} \left(e ^ {\mathrm {j} \omega}\right) \boldsymbol {H} ^ {[ R ]} \left(e ^ {\mathrm {j} \omega}\right) ^ {\dagger}\right) - 2 \operatorname {t r} \left(\boldsymbol {H} ^ {[ R ]} \left(e ^ {\mathrm {j} \omega}\right) \boldsymbol {H} ^ {[ R ]} \left(e ^ {\mathrm {j} \omega}\right) ^ {\dagger}\right) + \boldsymbol {I} (C.72) \\ = \operatorname {t r} \left(\left(\boldsymbol {H} ^ {[ R ]} \left(e ^ {\mathrm {j} \omega}\right) \boldsymbol {H} ^ {[ R ]} \left(e ^ {\mathrm {j} \omega}\right) ^ {\dagger} - \boldsymbol {I}\right) ^ {\dagger} \left(\boldsymbol {H} ^ {[ R ]} \left(e ^ {\mathrm {j} \omega}\right) \boldsymbol {H} ^ {[ R ]} \left(e ^ {\mathrm {j} \omega}\right) ^ {\dagger} - \boldsymbol {I}\right)\right) (C.73) \\ = \left\| \boldsymbol {H} ^ {[ R ]} \left(e ^ {\mathrm {j} \omega}\right) \boldsymbol {H} ^ {[ R ]} \left(e ^ {\mathrm {j} \omega}\right) ^ {\dagger} - \boldsymbol {I} \right\| ^ {2}, (C.74) \\ \end{array} +$$ + +where Equations (C.70) and (C.74) make use of $\| \boldsymbol{A} \|^{2} = \operatorname{tr}(\boldsymbol{A}^{\dagger} \boldsymbol{A})$ , Equations (C.71) and (C.73) are due to the linearity of $\operatorname{tr}(\cdot)$ , and Equation (C.72) utilizes $\operatorname{tr}(\boldsymbol{AB}) = \operatorname{tr}(\boldsymbol{BA})$ . + +Next, we prove the equivalence between Equations (C.69a) and (C.69b). + +$$ +\begin{array}{l} \boldsymbol {H} ^ {[ R ]} \left(e ^ {\mathrm {j} \omega}\right) ^ {\dagger} \boldsymbol {H} ^ {[ R ]} \left(e ^ {\mathrm {j} \omega}\right) - \boldsymbol {I} = \sum_ {r \in [ R ]} \boldsymbol {H} ^ {r | R} \left(e ^ {\mathrm {j} \omega}\right) ^ {\dagger} \boldsymbol {H} ^ {r | R} \left(e ^ {\mathrm {j} \omega}\right) - \boldsymbol {I} (C.75) \\ = \sum_ {r \in [ R ]} \sum_ {i \in \mathbb {Z}} \left(\sum_ {m \in \mathbb {Z}} \boldsymbol {h} ^ {r | R} [ m ] ^ {\top} \boldsymbol {h} ^ {r | R} [ m - i ] - \boldsymbol {\delta} [ i ]\right) e ^ {- j \omega i} (C.76) \\ = \sum_ {r \in [ R ]} \sum_ {i \in \mathbb {Z}} \left(\sum_ {m \in \mathbb {Z}} \boldsymbol {h} [ R m + r ] ^ {\top} \boldsymbol {h} [ R (m - i) + r ] - \boldsymbol {\delta} [ i ]\right) e ^ {- j \omega i} (C.77) \\ = \sum_ {i \in \mathbb {Z}} \left(\sum_ {r \in [ R ]} \sum_ {m \in \mathbb {Z}} \boldsymbol {h} [ R m + r ] ^ {\top} \boldsymbol {h} [ R m + r - R i ] - \boldsymbol {\delta} [ i ]\right) e ^ {- j \omega i} (C.78) \\ = \sum_ {i \in \mathbb {Z}} \left(\sum_ {n \in \mathbb {Z}} \boldsymbol {h} [ n ] ^ {\top} \boldsymbol {h} [ n - R i ] - \boldsymbol {\delta} [ i ]\right) e ^ {- j \omega i}, (C.79) \\ \end{array} +$$ + +where Equation (C.75) follows from the definition of polyphase matrix in Equation (C.15). Equation (C.76) uses a number of properties of Fourier transform: a Hermitian in the spectral domain is a transposed reflection in the spatial domain, a frequency-wise multiplication in the spectral domain is a convolution in the spatial domain, and an identical mapping in the spectral domain is an impulse sequence in the spatial domain. Equation (C.77) follows from the definition of polyphase components in Equation (C.7), and Equation (C.79) makes a change of variables $n = Rm + r$ . In summary, we show that the LHS (denoted $D(e^{\mathrm{j}\omega})$ ) is a Fourier transform of the RHS (denoted as $d[i]$ ): + +$$ +\underbrace {\boldsymbol {H} ^ {[ R ]} \left(e ^ {\mathrm {j} \omega}\right) ^ {\dagger} \boldsymbol {H} ^ {[ R ]} \left(e ^ {\mathrm {j} \omega}\right) - \boldsymbol {I}} _ {\boldsymbol {D} \left(e ^ {\mathrm {j} \omega}\right)} = \sum_ {i \in \mathbb {Z}} \underbrace {\left(\sum_ {n \in \mathbb {Z}} \boldsymbol {h} [ n ] ^ {\top} \boldsymbol {h} [ n - R i ] - \boldsymbol {\delta} [ n ]\right)} _ {\boldsymbol {d} [ i ]} e ^ {- \mathrm {j} \omega i}. \tag {C.80} +$$ + +Applying Parseval's theorem (Theorem B.4) to the sequence $\pmb{d} = \{\pmb{d}[i], i \in \mathbb{Z}\}$ , we have + +$$ +\frac {1}{2 \pi} \int_ {- \pi} ^ {\pi} \left\| \boldsymbol {H} ^ {[ R ]} \left(e ^ {\mathrm {j} \omega}\right) ^ {\dagger} \boldsymbol {H} ^ {[ R ]} \left(e ^ {\mathrm {j} \omega}\right) - \boldsymbol {I} \right\| ^ {2} d \omega = \sum_ {i \in \mathbb {Z}} \left\| \sum_ {n \in \mathbb {Z}} \boldsymbol {h} [ n ] ^ {\top} \boldsymbol {h} [ n - R i ] - \boldsymbol {\delta} [ i ] \right\| ^ {2}, \tag {C.81} +$$ + +which proves the equivalence between Equations (C.69a) and (C.69b). With almost identical arguments, we can prove the equivalence between Equations (C.69c) and (C.69d), that is + +$$ +\frac {1}{2 \pi} \int_ {- \pi} ^ {\pi} \left\| \boldsymbol {H} ^ {[ R ]} \left(e ^ {\mathrm {j} \omega}\right) \boldsymbol {H} ^ {[ R ]} \left(e ^ {\mathrm {j} \omega}\right) ^ {\dagger} - \boldsymbol {I} \right\| ^ {2} d \omega = \sum_ {i \in \mathbb {Z}} \left\| \sum_ {n \in \mathbb {Z}} \boldsymbol {h} [ n ] \boldsymbol {h} [ n - R i ] ^ {\top} - \boldsymbol {\delta} [ i ] \right\| ^ {2}, \tag {C.82} +$$ + +which completes the proof. + +In Table 5, we compare the computational complexities (forward pass) of orthogonal convolutions against normal convolution. For simplicity, we assume the feature maps have size $N \times N$ , the convolution filters have size $L \times L$ , and the maximum of input/output channels is $C$ . We use $K$ to denote the number of iterations for Björck's algorithm in BCOP, or Taylor's series order in SOC. + +- For SC-Fac, BCOP, SVCM, or Ortho-Reg, the first term $O(L^2 N^2 C^2)$ is the base cost of a normal convolution, and the second term is the overhead for reconstruction, projection, or regularization. Note that the overhead in SC-Fac is comparable to Ortho-Reg, which is lower than SVCM or BCOP. If $C < N^2$ , the overhead in SC-Fac is negligible compared to the base cost. +- For CayleyConv, the first term $O(N^2 \log (N)C^2)$ is the cost for fast Fourier transform (FFT), and the second term $O(N^2 C^3)$ is the cost for matrix inversion for all frequencies. The cost of SOC is exactly $K$ times as a normal convolution. The computational complexities of CayleyConv and SOC are significantly higher than the one of normal convolution. + +Table 5. Computational complexities of different approaches for orthogonal convolutions. + +
ApproachComputational Complexity
NormalO(L2N2C2)
SVCMO(L2N2C2+N2C3)
Ortho-RegO(L2N2C2+L4C2)
CayleyConvO(N2log(N)C2+N2C3)
SOCO(KL2N2C2)
BCOPO(L2N2C2+KL2C3)
SC-FacO(L2N2C2+L2C3)
+ +- For those approaches whose filters can be explicitly obtained (SC-Fac, BCOP, SVCM, and Ortho-Reg), the inference time of an orthogonal convolution is no different from a normal convolution, i.e., $O(L^2 N^2 C^2)$ . On the other hand, for those approaches whose filters are implicitly defined (CayleyConv and SOC), the inference time is the same as the forward pass in training. + +# C.4. Constrained Optimization over Orthogonal Matrices + +In Theorem C.7, we have shown how orthogonal matrices characterize paraunitary systems. Our remaining goal, therefore, is to parameterize orthogonal matrices using unconstrained parameters. In this part, we review popular parameterization methods: Householder reflections (Mhammedi et al., 2017; Mathiasen et al., 2020), Givens rotations (Dorobantu et al., 2016; Jing et al., 2017), Björck orthogonalization (Anil et al., 2019), Cayley transform (Helfrich et al., 2018; Maduranga et al., 2019), and exponential map (Lezcano-Casado & Martínez-Rubio, 2019; Lezcano Casado, 2019). + +(1) Householder reflections (Mhammedi et al., 2017; Mathiasen et al., 2020). The parameterization represents an orthogonal matrix using a product of Householder matrices. Given $N \in \mathbb{N}$ and $n \in \{1, \dots, N\}$ , we define $\pmb{H}^{(n)}$ as a mapping from a vector $\pmb{v} \in \mathbb{R}^n$ (a scalar $v \in \mathbb{R}$ for $n = 1$ ) to a block-diagonal matrix $\pmb{H}^{(n)}(\pmb{v}) \in \mathbb{R}^{N \times N}$ : + +$$ +\boldsymbol {H} ^ {(n)} (\boldsymbol {v}) = \left[ \begin{array}{l l} \boldsymbol {I} _ {N - n} & \\ & \boldsymbol {I} _ {n} - 2 \frac {\boldsymbol {v} \boldsymbol {v} ^ {\top}}{\| \boldsymbol {v} \| ^ {2}} \end{array} \right], \quad \boldsymbol {H} ^ {(1)} (v) = \left[ \begin{array}{l l} \boldsymbol {I} _ {N - 1} & \\ & v \end{array} \right], \tag {C.83} +$$ + +where $\mathbf{I}_n \in \mathbb{R}^{n \times n}$ denotes an identity matrix. For $n \geq 2$ , $H^{(n)}(\mathbf{v})$ is the Householder matrix that represents the reflection with respect to the hyperplane orthogonal to $\text{concat}(\mathbf{0}_{N - n}, \mathbf{v}) \in \mathbb{R}^N$ and passing through the origin. For $n = 1$ , the scalar $v$ takes values $\{-1, +1\}$ , which makes $H^{(1)}(v)$ either an identity matrix (for $v = 1$ ) or a Householder matrix (for $v = -1$ ). This method parameterizes an orthogonal matrix as a product of $H^{(n)}$ 's: + +$$ +\boldsymbol {U} = \boldsymbol {H} ^ {(n)} (\boldsymbol {v} ^ {(n)}) \dots \boldsymbol {H} ^ {(2)} (\boldsymbol {v} ^ {(2)}) \boldsymbol {H} ^ {(1)} (v ^ {(1)}), \tag {C.84} +$$ + +where each $\pmb{v}^{(n)} \in \mathbb{R}^n$ is a learnable vector for $n \geq 2$ , and $v^{(1)}$ is a fixed constant that is generated at initialization and fixed afterward. Observing that Equation (C.84) is serial (unfriendly to parallel computing), Mathiasen et al. (2020) proposes to increase its parallelism using WY transform. + +(2) Givens rotations (Dorobantu et al., 2016; Jing et al., 2017). The parameterization represents a special orthogonal matrix using a product of Given rotations matrices. Given $N \in \mathbb{N}$ and $i, j \in \{1, \dots, N\}$ with $i \neq j$ , we define $\pmb{G}^{(i,j)}$ as a mapping from an angle $\theta \in \mathbb{R}$ to the corresponding rotation matrix $\pmb{G}^{(i,j)} \in \mathbb{R}^{N \times N}$ : + +$$ +\boldsymbol {G} ^ {(i, j)} (\theta) = \left[ \begin{array}{c c c c c c c} 1 & \dots & 0 & \dots & 0 & \dots & 0 \\ \vdots & \ddots & \vdots & & \vdots & & \vdots \\ 0 & \dots & \cos \theta & \dots & - \sin \theta & \dots & 0 \\ \vdots & & \vdots & \ddots & \vdots & & \vdots \\ 0 & \dots & \sin \theta & \dots & \cos \theta & \dots & 0 \\ \vdots & & \vdots & & \vdots & \ddots & \vdots \\ 0 & \dots & 0 & \dots & 0 & \dots & 1 \end{array} \right]. \tag {C.85} +$$ + +This method parameterizes a special orthogonal matrix $\mathbf{U}$ as a product of $G^{(i,j)}$ 's: + +$$ +\boldsymbol {U} = \boldsymbol {G} ^ {(0, 1)} \left(\theta^ {(0, 1)}\right) \boldsymbol {G} ^ {(0, 2)} \left(\theta^ {(0, 2)}\right) \boldsymbol {G} ^ {(1, 2)} \left(\theta^ {(1, 2)}\right) \dots \boldsymbol {G} ^ {(N - 2, N - 1)} \left(\theta^ {(N - 2, N - 1)}\right), \tag {C.86} +$$ + +where $\theta^{(i,j)}$ ’s are $N(N - 1)$ unconstrained parameters. Since the determinant of each rotation matrix is $+1$ , their product $\pmb{U}$ also has $+1$ determinant, thus is a special orthogonal matrix. Again, Equation (C.86) is highly serial, thus both Dorobantu et al. (2016) and Jing et al. (2017) propose to group $N / 2$ Given rotations into a packed rotation to increase the parallelism. + +(2) Björck orthogonalization (Anil et al., 2019). The algorithm was first introduced in Björck & Bowie (1971) to compute the closest orthogonal matrix of a given matrix. Given an initial matrix $U_{0}$ , this algorithm iteratively approaches its closest orthogonal matrix as: + +$$ +\boldsymbol {U} _ {k + 1} = \boldsymbol {U} _ {k} \left(\boldsymbol {I} + \frac {1}{2} \boldsymbol {P} _ {k} + \dots + (- 1) ^ {p} \binom {- \frac {1}{2}} {p} \boldsymbol {P} _ {k} ^ {p}\right), \forall k \in [ K ], \tag {C.87} +$$ + +where $K$ is the iterative steps, $\pmb{P_k} = \pmb{I} - \pmb{U_k}^\top \pmb{U_k}$ , and $p$ controls the trade-off between efficiency and accuracy at each step. When the algorithm is used for parameterization, it maps an unconstrained matrix $\pmb{U_0}$ to an approximately orthogonal matrix $\pmb{U_K}$ in $K$ steps. Although Björck parameterization is complete (since any orthogonal matrix $\pmb{Q}$ can be represented by $\pmb{U_0} = \pmb{Q}$ ), it is inexact due to the iterative approximation. + +(3) Cayley transform (Helfrich et al., 2018; Maduranga et al., 2019). The transform provides a bijective parameterization of orthogonal matrices without $-1$ eigenvalue with skew-symmetric matrices (i.e., $A^{\top} = -A$ ) + +$$ +\boldsymbol {U} = (\boldsymbol {I} - \boldsymbol {A}) (\boldsymbol {I} + \boldsymbol {A}) ^ {- 1}, \tag {C.88} +$$ + +where the skew-symmetric matrix $\mathbf{A}$ is represented by its upper-triangle entries. Since orthogonal matrices with $-1$ eigenvalue are out of consideration, the parameterization is incomplete. Helfrich et al. (2018); Maduranga et al. (2019) overcome this difficulty by a scaled Cayley transform: + +$$ +\boldsymbol {U} = \boldsymbol {D} (\boldsymbol {I} - \boldsymbol {A}) (\boldsymbol {I} + \boldsymbol {A}) ^ {- 1}, \tag {C.89} +$$ + +where $D$ is a diagonal matrix with $\pm 1$ non-zero entries, which is (randomly) generated at initialization and fixed during training. + +(4) Exponential map (Lezcano-Casado & Martínez-Rubio, 2019; Lezcano Casado, 2019). The mapping provides a surjective parameterization of all special orthogonal matrices (with $+1$ determinant) with using skew-symmetry matrices (i.e., $\mathbf{A}^{\top} = -\mathbf{A}$ ). + +$$ +\boldsymbol {U} = \exp (\boldsymbol {A}) \triangleq \sum_ {k = 0} ^ {\infty} \frac {\boldsymbol {A} ^ {k}}{k !} = \boldsymbol {I} + \boldsymbol {A} + \frac {1}{2} \boldsymbol {A} ^ {2} + \dots , \tag {C.90} +$$ + +where the infinite sum can be computed exactly up to machine-precision (Higham, 2009). Lezcano-Casado & Martínez-Rubio (2019) derives an efficient backpropagation algorithm for the mapping, making it an exact and efficient parameterization in neural networks. To support a complete parameterization for all orthogonal matrices, Lezcano Casado (2019) extends the mapping as: + +$$ +\boldsymbol {U} = \boldsymbol {Q} \exp (\boldsymbol {A}), \tag {C.91} +$$ + +where $Q$ is an orthogonal matrix, which is generated at initialization and fixed during training. + +In principle, we can use any of these approaches to parameterize the orthogonal matrices. In this work, we choose exponential map due to its exactness, efficiency, and completeness. + +# D. Learning Deep Orthogonal Networks with Lipschitz Bounds + +In this section, we first discuss the properties of GroupSort and Lipschitz networks. Subsequently, we prove Proposition 4.1, which exhibits two approaches to construct Lipschitz residual blocks. Lastly, we prove in Proposition D.1 when a paraunitary system (represented by a complete factorization as in Theorem C.7) reduces to an orthogonal matrix. The reduction allows us to apply the initialization methods for orthogonal matrices to paraunitary systems. + +GroupSort and orthogonality. The GroupSort activation separates inputs into groups and sorts each group into ascending order (Anil et al., 2019). It guarantees two properties: (1) The activation is norm preserving in the forward pass — a + +sorting function does not change the norm of any input vector. (2) The activation is gradient norm preserving in the backward pass — a sorting function acts as a permutation, which is orthogonal. GroupSort with the group size of two is a spacial case that we use in the paper followed by (Chernodub & Nowicki, 2016; Anil et al., 2019). + +A Lipschitz network with orthogonal layers and GroupSort activations is locally orthogonal. Given any input $\mathbf{x}$ to the network, there exists a neighborhood $N(x,r)$ with radius $r$ such that the sorting order in each activation does not change. In this neighborhood $N(x,r)$ , each GroupSort layer operates as a constant permutation (thus orthogonal); consequently, the whole network is locally orthogonal. + +Lipschitz residual blocks. In Proposition 4.1, we prove the Lipschitzness of two types of residual blocks, one based on additive skip-connection and another based on concatenative one (See Figure 6). + +Proof for Proposition 4.1. We first prove the Lipschitzness for the additive residual block $f: f(\pmb{x}) \triangleq \alpha f^{1}(\pmb{x}) + (1 - \alpha)f^{2}(\pmb{x})$ . Let $\pmb{x}, \pmb{x}'$ be two inputs to $f$ and $f(\pmb{x}), f(\pmb{x}')$ be their outputs, we have + +$$ +\begin{array}{l} \left\| f \left(\boldsymbol {x} ^ {\prime}\right) - f (\boldsymbol {x}) \right\| = \left\| \left(\alpha f ^ {1} \left(\boldsymbol {x} ^ {\prime}\right) + (1 - \alpha) f ^ {2} \left(\boldsymbol {x} ^ {\prime}\right)\right) - \left(\alpha f ^ {1} (\boldsymbol {x}) + (1 - \alpha) f ^ {2} (\boldsymbol {x})\right) \right\| (D.1) \\ = \left\| \alpha \left(f ^ {1} \left(\boldsymbol {x} ^ {\prime}\right) - f ^ {1} (\boldsymbol {x})\right) + (1 - \alpha) \left(f ^ {2} \left(\boldsymbol {x} ^ {\prime}\right) - f ^ {2} (\boldsymbol {x})\right) \right\| (D.2) \\ \leq \alpha \left\| f ^ {1} \left(\boldsymbol {x} ^ {\prime}\right) - f ^ {1} (\boldsymbol {x}) \right\| + (1 - \alpha) \left\| f ^ {2} \left(\boldsymbol {x} ^ {\prime}\right) - f ^ {2} (\boldsymbol {x}) \right\| (D.3) \\ \leq \alpha L \| \boldsymbol {x} ^ {\prime} - \boldsymbol {x} \| + (1 - \alpha) L \| \boldsymbol {x} ^ {\prime} - \boldsymbol {x} \| (D.4) \\ = L \left\| \boldsymbol {x} ^ {\prime} - \boldsymbol {x} \right\|, (D.5) \\ \end{array} +$$ + +where Equation (D.3) makes uses of the triangle inequality, and Equation (D.4) is due to the $L$ -Lipschitzness of both $f^1$ , $f^2$ . Therefore, we have shown that $\| f(\pmb{x}^{\prime}) - f(\pmb{x})\| \leq L\| \pmb{x}^{\prime} - \pmb{x}\|$ . + +Similarly, we prove the Lipschitzness for the concatenative residual block $g: g(\pmb{x}) \triangleq \pmb{P}\left[g^{1}(\pmb{x}^{1}); g^{2}(\pmb{x}^{2})\right]$ . Let $\pmb{x}, \pmb{x}'$ be two inputs to $g$ and $g(\pmb{x}), g(\pmb{x}')$ be their outputs, we have + +$$ +\begin{array}{l} \left\| g \left(\boldsymbol {x} ^ {\prime}\right) - g (\boldsymbol {x}) \right\| ^ {2} = \left\| \boldsymbol {P} \left(\left[ g ^ {1} \left(\boldsymbol {x} ^ {1 ^ {\prime}}\right); g ^ {2} \left(\boldsymbol {x} ^ {2 ^ {\prime}}\right) \right] - \left[ g ^ {1} \left(\boldsymbol {x} ^ {1}\right); g ^ {2} \left(\boldsymbol {x} ^ {2}\right) \right]\right) \right\| (D.6) \\ = \left\| \left[ g ^ {1} \left(\boldsymbol {x} ^ {\prime}\right); g ^ {2} \left(\boldsymbol {x} ^ {\prime}\right) \right] - \left[ g ^ {1} (\boldsymbol {x}); g ^ {2} (\boldsymbol {x}) \right] \right\| ^ {2} (D.7) \\ = \left\| g ^ {1} \left(\boldsymbol {x} ^ {1 ^ {\prime}}\right) - g ^ {1} (\boldsymbol {x}) \right\| ^ {2} + \left\| g ^ {2} \left(\boldsymbol {x} ^ {2 ^ {\prime}}\right) - g ^ {2} \left(\boldsymbol {x} ^ {2}\right) \right\| ^ {2} (D.8) \\ \leq L ^ {2} \left\| \boldsymbol {x} ^ {1 ^ {\prime}} - \boldsymbol {x} ^ {1} \right\| ^ {2} + L ^ {2} \left\| \boldsymbol {x} ^ {2 ^ {\prime}} - \boldsymbol {x} ^ {2} \right\| ^ {2} (D.9) \\ = L ^ {2} \left\| \left[ \boldsymbol {x} ^ {1 ^ {\prime}}; \boldsymbol {x} ^ {2 ^ {\prime}} \right] - \left[ \boldsymbol {x} ^ {1}; \boldsymbol {x} ^ {2} \right] \right\| ^ {2} (D.10) \\ = L ^ {2} \left\| \boldsymbol {x} ^ {\prime} - \boldsymbol {x} \right\| ^ {2}, (D.11) \\ \end{array} +$$ + +where Equation (D.7) utilizes $\| \boldsymbol{P}\boldsymbol{x}\| = \| \boldsymbol{x}\|$ , $\forall \boldsymbol{x}$ , and Equation (D.9) is due to the $L$ -Lipschitzness of $g^{1}$ , $g^{2}$ . The equations above imply that $\| g(\boldsymbol{x}^{\prime}) - g(\boldsymbol{x})\| \leq L\| \boldsymbol{x}^{\prime} - \boldsymbol{x}\|$ . + +Reduction of a paraunitary system to an orthogonal matrix. In Proposition D.1, we prove a special case when a paraunitary system reduces to an orthogonal matrix. The reduction allows us to apply the initialization methods for orthogonal matrices to paraunitary systems. + +Proposition D.1 (Reduction of a paraunitary matrix to an orthogonal matrix). Suppose a paraunitary system $\mathbf{H}(z)$ takes the complete factorization in Equation (C.55), and assume $\underline{L} = \overline{L}$ with $U^{(-\ell)} = QU^{(\ell)}$ for all $\ell$ , then the paraunitary matrix $\mathbf{H}(z)$ reduces to an orthogonal matrix $\mathbf{Q}$ , + +$$ +\boldsymbol {H} (z) = \boldsymbol {V} (z; \boldsymbol {U} ^ {(- \underline {{L}})}) \dots \boldsymbol {V} (z; \boldsymbol {U} ^ {(- 1)}) \boldsymbol {Q} \boldsymbol {V} (z ^ {- 1}; \boldsymbol {U} ^ {(1)}) \dots \boldsymbol {V} (z ^ {- 1}; \boldsymbol {U} ^ {(\overline {{L}})}) = \boldsymbol {Q}. \tag {D.12} +$$ + +Proof for Proposition D.1. In order to prove Equation (D.12), it suffices to show that + +$$ +\boldsymbol {V} (z; \boldsymbol {U} ^ {(- \ell)}) \boldsymbol {Q} \boldsymbol {V} (z ^ {- 1}; \boldsymbol {U} ^ {(\ell)}) = \boldsymbol {Q}, \tag {D.13} +$$ + +![](images/817604f84f42daf40504f85c7a993b3301f3fa03fc028fa35597c56c435addd4.jpg) +(a) Basic additive block. + +![](images/23b9aaa2df036bd2dc8beb7fa6eed937716f549aafd1f0ddd1a00fdab6233b23.jpg) +(b) Strided additive block. + +![](images/e2a0b01462270196c0517acb3dab2b694ded35f7bd986f3f1078fe29ddd5222e.jpg) +(c) Basic shuffling block. + +![](images/a0079e5bedd6ce075e62b3a08efab8aa20f4fe16a0dab8d4daba89cd0da01285.jpg) +(d) Strided shuffling block. +Figure 6. Variants of residual blocks. In our experiments, we combine (a) & (b) to construct an orthogonal ResNet, and (c) & (d) to construct an orthogonal ShuffleNet. In Proposition 4.1, we prove the Lipschitzness of these building blocks. Since composition of Lipschitz functions is still Lipschitz, it implies that a network constructed by these building blocks is also Lipschitz. + +and Equation (D.12) will reduce recursively to the orthogonal matrix $\mathbf{Q}$ . For simplicity, we rewrite $\mathbf{U}^{(-\ell)}$ as $\mathbf{L}$ and $\mathbf{U}^{(\ell)}$ as $\mathbf{R}$ , by which we have $\mathbf{L} = \mathbf{Q}\mathbf{R}$ (or $\mathbf{R} = \mathbf{Q}^{\top}\mathbf{L}$ ) and we aim to prove $\mathbf{V}(z; \mathbf{L})\mathbf{Q}\mathbf{V}(z^{-1}; \mathbf{R}) = \mathbf{Q}$ . By the definition of $\mathbf{V}(z; \cdot)$ in Equation (C.54), we expand it as + +$$ +\boldsymbol {V} (z; \boldsymbol {L}) \boldsymbol {Q} \boldsymbol {V} (z ^ {- 1}; \boldsymbol {R}) = \left[ \left(\boldsymbol {I} - \boldsymbol {L L} ^ {\top}\right) + \boldsymbol {L L} ^ {\top} z \right] \boldsymbol {Q} \left[ \left(\boldsymbol {I} - \boldsymbol {R R} ^ {\top}\right) + \boldsymbol {R R} ^ {\top} z ^ {- 1} \right] = +$$ + +$$ +\underbrace {L L ^ {\top} Q (I - R R ^ {\top})} _ {c [ - 1 ]} z + \underbrace {(I - L L ^ {\top}) Q (I - R R ^ {\top}) + L L ^ {\top} Q R R ^ {\top}} _ {c [ 0 ]} + \underbrace {(I - L L ^ {\top}) Q R R ^ {\top}} _ {c [ 1 ]} z ^ {- 1} \tag {D.14} +$$ + +Therefore, we will need to show that $c[-1] = 0$ , $c[1] = 0$ and $c[0] = Q$ . + +We first show that both $c[-1]$ for $z$ and $c[1]$ for $z^{-1}$ are zero matrices. + +$$ +\begin{array}{l} \boldsymbol {c} [ - 1 ] = \boldsymbol {L} \boldsymbol {L} ^ {\top} \boldsymbol {Q} (\boldsymbol {I} - \boldsymbol {R} \boldsymbol {R} ^ {\top}) (D.15) \\ = \boldsymbol {L} \boldsymbol {L} ^ {\top} \boldsymbol {Q} - \boldsymbol {L} \boldsymbol {L} ^ {\top} \boldsymbol {Q} \boldsymbol {R} \boldsymbol {R} ^ {\top} (D.16) \\ = L \left(Q ^ {\top} L\right) ^ {\top} - L \left(Q ^ {\top} L\right) ^ {\top} R R ^ {\top} (D.17) \\ = \boldsymbol {L} \boldsymbol {R} ^ {\top} - \boldsymbol {L} (\boldsymbol {R} ^ {\top} \boldsymbol {R}) \boldsymbol {R} ^ {\top} (D.18) \\ = \boldsymbol {L} \boldsymbol {R} ^ {\top} - \boldsymbol {L} \boldsymbol {R} ^ {\top} = \mathbf {0}, (D.19) \\ \end{array} +$$ + +$$ +\begin{array}{l} \boldsymbol {c} [ 1 ] = \left(\boldsymbol {I} - \boldsymbol {L L} ^ {\top}\right) \boldsymbol {Q R R} ^ {\top} (D.20) \\ = \boldsymbol {Q} \boldsymbol {R} \boldsymbol {R} ^ {\top} - \boldsymbol {L} \boldsymbol {L} ^ {\top} \boldsymbol {Q} \boldsymbol {R} \boldsymbol {R} ^ {\top} (D.21) \\ = (\boldsymbol {Q} \boldsymbol {R}) \boldsymbol {R} ^ {\top} - \boldsymbol {L} \boldsymbol {L} ^ {\top} (\boldsymbol {Q} \boldsymbol {R}) \boldsymbol {R} ^ {\top} (D.22) \\ = \boldsymbol {L} \boldsymbol {R} ^ {\top} - \boldsymbol {L} (\boldsymbol {L} ^ {\top} \boldsymbol {L}) \boldsymbol {R} ^ {\top} (D.23) \\ = \boldsymbol {L} \boldsymbol {R} ^ {\top} - \boldsymbol {L} \boldsymbol {R} ^ {\top} = \mathbf {0}. (D.24) \\ \end{array} +$$ + +![](images/dbba7568ded30ca214b5b451b67916f3731e01c972cd2cf7259a84bec8ee7518.jpg) +Figure 7. Effect of the Lipschitz margin $\epsilon_0$ for WideResNet22-10. It shows a trade-off between clean and robust accuracy with different margins for multi-class hinge loss. As shown, the training and test accuracy become higher with larger margin, but the robust accuracy decreases after $\epsilon_0 = 0.1$ . + +Lastly, we show that the constant coefficient $c[0]$ is equal to $Q$ . + +$$ +\begin{array}{l} \boldsymbol {c} [ 0 ] = \left(\boldsymbol {I} - \boldsymbol {L L} ^ {\top}\right) \boldsymbol {Q} \left(\boldsymbol {I} - \boldsymbol {R R} ^ {\top}\right) + \boldsymbol {L L} ^ {\top} \boldsymbol {Q R R} ^ {\top} (D.25) \\ = Q - L L ^ {\top} Q - Q R R ^ {\top} + 2 L L ^ {\top} Q R R ^ {\top} (D.26) \\ = \boldsymbol {Q} - \boldsymbol {L} \boldsymbol {R} ^ {\top} - \boldsymbol {L} \boldsymbol {R} ^ {\top} + 2 \boldsymbol {L} \boldsymbol {R} ^ {\top} = \boldsymbol {Q} (D.27) \\ \end{array} +$$ + +which completes the proof. + +![](images/13e4c2801c27e5fdf527e455cbdf8562506df2026d119d0cb641fb6c00eed69e.jpg) + +# E. Supplementary Materials for Experiments + +# E.1. Experimental Setup + +Network architectures. For fair comparisons, we follow the architectures by Trockman & Kolter (2021) for KW-Large, ResNet9, WideResNet10-10 (i.e., shallow networks). We set the group size for GroupSort activations as 2 in all experiments. For networks deeper than 10 layers, we implement their architectures modifying from the Pytorch official implementation of ResNet. It is crucial to replace the global pooling before fully-connected layers with an average pooling with a window size of 4. For the average pooling, we multiply the output with the window size to maintain its 1-Lipschitzness. Other architectures, including ShuffleNet and plain convolutional network (ConvNet), are further modified from the ResNet, where only the skip-connections are changed or removed. We use the widen factor to indicate the channel number: we set the number of channels at each layer as base channels multiplied by the widen factor. The base channels are 16, 32, 64 for three groups of residual blocks. More details of the ResNet architecture can be found in the official Pytorch implementation. $^{1}$ + +Learning strategies. We use the CIFAR-10 dataset for all our experiments. We normalize all input images to $[0, 1]$ followed by standard augmentation, including random cropping and horizontal flipping. We use the Adam optimizer with a maximum learning rate of $10^{-2}$ coupled with a piece-wise triangular learning rate scheduler. We initialize all our SC-Fac layers as permutation matrices: (1) we select the number of columns for each pair $U^{(\ell)}, U^{(-\ell)}$ uniformly from $\{1, \dots, T\}$ at initialization (the number is fixed during training); (2) for $\ell > 0$ , we sample the entries in $U^{(\ell)}$ uniformly with respect to the Haar measure; (3) for $\ell < 0$ , we set $U^{(-\ell)} = QU^{(\ell)}$ according to Proposition D.1. + +# E.2. Additional Empirical Results on Hyper-parameters Selection + +Multi-class hinge loss. Following previous works on Lipschitz networks (Anil et al., 2019; Li et al., 2019b; Trockman & Kolter, 2021), we adopt the multi-class hinge loss in training. For each model, we perform a grid search on different margins $\epsilon_0 \in \{1 \times 10^{-3}, 2 \times 10^{-3}, 5 \times 10^{-3}, 1 \times 10^{-2}, 2 \times 10^{-2}, 5 \times 10^{-2}, 0.1, 0.2, 0.5\}$ and report the best performance in terms of robust accuracy. Notice that the margin $\epsilon_0$ controls the trade-off between clean and robust accuracy, as shown in Figure 7. + +Initialization methods. In Proposition D.1, we have shown how to initialize our orthogonal convolutional layers as + +Table 6. Comparisons of various initialization methods on WideResNet (kernel size 5). + +
InitializationWideResNet10-10WideResNet22-10
Clean (%)PGD (%)Clean (%)PGD (%)
uniform83.5873.2087.5575.71
torus82.4072.5088.1275.43
permutation83.1873.1687.8276.46
identical83.2973.4987.8275.49
+ +orthogonal matrices. In Table 6, we perform a study on different initialization methods, including identical, permutation, uniform, and torus (Henaff et al., 2016; Helfrich et al., 2018). We find that permutation works the best for WideResNet22-10, while all methods are similar in shallower WideResNet10-10. Therefore, we use permutation initialization for all other experiments. + +Network depth and width. Exact orthogonality is criticized for harming the expressive power of neural networks, and we find that increasing network depth/width can partially compensate for such loss. In Table 7, we perform a study on the impact of network depth/width on the predictive performance. As shown, deeper/wider architectures consistently improve both the clean and robust accuracy for our implementation. However, the best robust accuracy is achieved by a 22-layer network since we can afford a wide architecture for 34-layer architecture. + +Comparison against normal convolutional networks. In Table 8, We perform a comparison between our orthogonal networks and normal convolutional networks. Their architecture are identical except for the activation function (GroupSort for ours and ReLU for normal convolutional networks). Since batch normalization is common in normal convolutional networks but not in Lipschitz networks, we provide both results for normal convolutional networks with or without batch normalization. In the table, we report the clean/robust accuracy, train time for epoch, and inference time for the test set. + +Robustness against $\ell_{\infty}$ attacks using adversarial training. Since orthogonality only guarantees $\ell_{2}$ Lipschitzness, Lipschitz networks with orthogonal layers are not naturally robust to $\ell_{\infty}$ perturbations. To further guard Lipschitz networks against $\ell_{\infty}$ attacks, we follow the approach of adversarial training in Wong et al. (2020). For training, we use a FGSM variant with step size 10/255; for evaluation, we use 50 PGD iterations with step size 2/255 and 10 random restarts. We report the experimental results in Table 9. We observe that different orthogonal convolution methods achieve similar $\ell_{\infty}$ robustness on WideResNet-22. Furthermore, the Lipschitz networks with WideResNet22 architecture is consistently better than ResNet-18, which is previously used in Singla & Feizi (2021). + +# E.3. On the Necessity of Exact Orthogonality + +Due to the benefits like generalizability and robustness, achieving exact orthogonality in convolutions is the primary goal of a current research line (Sedghi et al., 2019; Li et al., 2019b; Trockman & Kolter, 2021; Singla & Feizi, 2021). However, until our work, no previous approach achieves orthogonality up to machine precision. Therefore, our proposed method serves as an extreme case in gaining insight into the trade-off between orthogonality and expressiveness. + +In Section 6, we have seen that exact orthogonality is not critical in shallow Lipschitz networks for robustness, and various orthogonal convolutions (with different precision) achieve comparable results. However, our method is more favorable in deeper networks (with more than 10 layers) — we show the results in Table 7. It indicates that exact orthogonality is crucial in learning deep Lipschitz networks. However, without our implementation of exact orthogonality (which does not exist before), it is unclear whether exact orthogonality up to machine precision is needed in Lipschitz networks. + +Moreover, exact orthogonality is essential for other important and timely applications. For example, reversible networks/normalizing flows (Kingma & Dhariwal, 2018; Van Den Berg et al., 2018) require exact orthogonality to compute inverse transform and determinants accurately. + +Table 7. Comparison of different depth and width on WideResNet (kernel size 5). Some numbers are missing due to the large memory requirement (on Tesla V100 32G). The notation width factor indicates (channels = base channels × factor). + +
10 layers
Width136810136810
Clean (%)PGD with ε = 36/255 (%)
Ours79.9684.1784.9684.6184.0965.9269.7072.1872.5174.29
Cayley77.8882.1482.5685.5385.0166.6573.0674.3375.6676.13
RKO81.3783.5584.6785.1884.6270.5574.4476.4176.6577.02
22 layers
Width136810136810
Clean (%)PGD with ε = 36/255 (%)
Ours79.9082.2287.2188.1087.8267.9570.8874.3075.1276.46
Cayley79.1184.8285.85--69.7965.6174.81--
RKO82.7184.1984.3384.55-72.4074.3675.6676.41-
34 layers
Width136810136810
Clean (%)PGD with ε = 36/255 (%)
Ours81.2488.1788.92--69.2171.8575.09--
Cayley82.4684.29---71.2774.73---
RKO81.5183.2483.92--71.3873.8475.03--
+ +Table 8. Comparison of orthogonal convolutions and normal convolutions on WideResNet (kernel size 5). The notation width factor indicates (channels = base channels × factor). + +
22 layers
Width136810136810
Clean (%)PGD with ε = 36/255 (%)
Ortho. (SC-Fac)79.9082.2287.2188.1087.8267.9570.8874.3075.1276.46
Normal (w/o BN)88.8190.7191.5991.6491.5754.3366.3669.3569.9474.10
Normal (with BN)88.5291.7491.2092.2992.4051.5366.9073.1873.8973.02
Training (s)Inference (s)
Ortho. (SC-Fac)145.3173.4250.1323.1434.01.474.359.7212.6517.56
Normal (w/o BN)13.7730.7169.3599.94153.51.013.036.779.1213.03
Normal (with BN)16.5634.1687.49106.9167.41.143.347.339.6913.39
+ +Table 9. Practical robustness against $\ell_{\infty}$ adversarial examples (WideResNet kernel size 5, $\ell_{\infty}$ perturbation radius of $\epsilon = 8/255$ ). BCOP+ and SOC (Singla & Feizi, 2021) results with ResNet-18 are reported by Singla & Feizi (2021). + +
ModelMethodClean (%)PGD (%)
Resnet-18BCOP+79.2634.85
SOC82.2443.73
WideResNet22-maxBCOP77.5746.35
Cayley78.2745.21
Ours76.2846.27
+ +# F. Orthogonal Convolutions for Residual Flows + +In this section, we first review the class of flow-based generative models (Papamakarios et al., 2019; Kobyzev et al., 2020). We focus on invertible residual network (Behrmann et al., 2019), a flow-based model that relies on Lipschitz residual block, and its extended version Residual Flow (Chen et al., 2019). We then show how to construct improved Residual Flow using our orthogonal convolutions. + +Flow-based models. Given an observable vector $\pmb{x} \in \mathbb{R}^D$ and a latent vector $\pmb{z} \in \mathbb{R}^D$ , we define a bijective mapping $f: \mathbb{R}^D \to \mathbb{R}^D$ from the latent vector $\pmb{z}$ to an observation $\pmb{x} = f(\pmb{z})$ . We further define the inverse of $f$ as $F = f^{-1}$ , with which we represent the likelihood of $\pmb{x}$ by the one of $\pmb{z}$ as: + +$$ +\ln p _ {X} (\boldsymbol {x}) = \ln p _ {Z} (\boldsymbol {z}) + \ln | \det \boldsymbol {J} _ {F} (\boldsymbol {x}) |, \tag {F.1} +$$ + +where $p_{X}$ is the data distribution, $p_{Z}$ is the base distribution (usually a normal distribution), and $J_{F}(x)$ is the Jacobian of $F$ at $x$ . In practice, the bijective mapping $f$ is composed by a sequence of $K$ bijective mapping such that $f = f_{K} \circ \dots \circ f_{1}$ , where each $f_{k}$ is named as a flow. Since the inverse mapping $F = F_{1} \circ \dots F_{K}$ transforms the data distribution $p_{X}$ into a normal distribution $p_{Z}$ , flow-based models are also known as normalizing flows. Accordingly, we rewrite Equation (F.1) as: + +$$ +\ln p _ {X} (\boldsymbol {x}) = \ln p _ {Z} (\boldsymbol {z}) + \sum_ {k = 1} ^ {K} \ln | \det J _ {F _ {k}} (\boldsymbol {x}) |, \tag {F.2} +$$ + +In a practical flow-based model, we require efficient computations of (a) each bijective mapping $f_{k}$ , (b) its inverse mapping $F_{k} = f_{k}^{-1}$ , and (c) the corresponding log-determinant $\ln |\operatorname{det} J_{F}(\cdot)|$ . + +Invertible residual networks (i-ResNets). Behrmann et al. (2019) proposes a flow-based model based on residual network (ResNet). Note that a block in ResNet is defined as $F(\boldsymbol{x}) = \boldsymbol{x} + g(\boldsymbol{x})$ , where $g$ is a convolutional network. In (Behrmann et al., 2019), the authors prove that $F$ is a bijective mapping if $g$ is 1-Lipschitz, and its inverse mapping can be computed by fixed-point iterations: + +$$ +\boldsymbol {x} _ {k + 1} = \boldsymbol {y} - g (\boldsymbol {x} _ {k}), \tag {F.3} +$$ + +where $\pmb{y} = g(\pmb{x})$ is the output of $F$ and the initialization of the iterative algorithm is $\pmb{x}_0 \coloneqq \pmb{y}$ . From the Banach fixed-point theorem, we have + +$$ +\left\| \boldsymbol {x} - \boldsymbol {x} _ {k} \right\| _ {2} = \frac {\operatorname {L i p} (g) ^ {k}}{1 - \operatorname {L i p} (g)} \left\| \boldsymbol {x} _ {1} - \boldsymbol {x} _ {0} \right\|, \tag {F.4} +$$ + +i.e., the convergence rate is exponential in the number of iterations and smaller Lipschitz constant will yield faster convergence. Furthermore, the log-determinant can be computed as: + +$$ +\begin{array}{l} \ln p _ {X} (\boldsymbol {x}) = \ln p _ {Z} (\boldsymbol {z}) + \operatorname {t r} \left(\ln \left(\boldsymbol {I} + \boldsymbol {J} _ {g} (\boldsymbol {x})\right)\right) (F.5) \\ = \ln p _ {Z} (\boldsymbol {z}) + \operatorname {t r} \left(\sum_ {k = 1} ^ {\infty} \frac {(- 1) ^ {k + 1}}{k} [ \boldsymbol {J} _ {g} (\boldsymbol {x}) ] ^ {k}\right), (F.6) \\ \end{array} +$$ + +where the infinite sum is approximated by truncation and the trace is efficiently estimated using the Hutchinson trace estimator $\operatorname{tr}(\mathbf{A}) = \mathbb{E}_{\mathbf{v} \sim \mathcal{N}(0, I)}[\mathbf{v}^\top \mathbf{A}\mathbf{v}]$ . + +Table 10. Comparisons of various flow-based models on the MNIST dataset. We report the performance in bits per dimension (bpm), where a smaller number indicates a better performance. + +
ModelMNIST
Glow (Kingma & Dhariwal, 2018)1.05
FFJORD (Grathwohl et al., 2018)0.99
i-ResNet (Behrmann et al., 2019)1.05
Residual Flow (Chen et al., 2019)0.97
SC-Fac Residual Flow (Ours)0.896
+ +To constrain the Lipschitz constant, i-ResNet uses spectral normalization on each linear layer in the block. Moreover, to improve optimization stability, i-ResNet changes the activation function from ReLU to ELU, ensuring nonlinear activations have continuous derivatives. + +As summarized in the conclusion of Behrmann et al. (2019), there are two remaining problems in this model: (1) The estimator of the log-determinant is biased and inefficient; (2) Designing and learning networks with a Lipschitz constraint are challenging — one needs to constrain each linear layer in the block instead of being able to control the Lipschitz constant of a block. + +Residual Flow. Chen et al. (2019) address problem $\{(1)$ by proposing an unbiased Russian roulette estimator for Equation (F.6): + +$$ +\operatorname {t r} \left(\ln \left(\boldsymbol {I} + \boldsymbol {J} _ {g} (\boldsymbol {x})\right)\right) = \mathbb {E} _ {n, \boldsymbol {v}} \left[ \sum_ {k = 1} ^ {n} \frac {(- 1) ^ {k}}{k} \frac {\boldsymbol {v} [ \boldsymbol {J} g (\boldsymbol {x}) ^ {k} ] \boldsymbol {v}}{\mathbb {P} (N \geq k)} \right], \tag {F.7} +$$ + +where $n \sim p(N)$ and $\pmb{v} \sim \mathcal{N}(\mathbf{0}, \mathbf{I})$ . Residual Flow further changes the activation function from ELU to LipSwish. The LipSwish activation avoids derivative saturation, which occurs when the second derivative is zero in a large region. However, problem (2) remains unresolved. + +Residual flows with orthogonal convolutions. We propose to address problem (2) by replacing the spectral normalized layers by our orthogonal convolutional layers (SC-Fac). Note that orthogonal convolutions directly control the Lipschitz constant of a ResNet block. We keep all other components unchanged — in particular, we use LipSwish activation instead of GroupSort, as GroupSort suffers from derivative saturation. We experiment our model on MNIST dataset. As shown in Table 10, our model substantially improve the performance over the original Residual Flow. We display some images generated by our model in Figure 8. + +![](images/3861c92a1e54dd103b10b0716103aea0ae9b4916725a346453aaec7af6a6491e.jpg) +Figure 8. Random samples from SC-Fac Residual Flow trained on MNIST. \ No newline at end of file diff --git a/scalingupdiverseorthogonalconvolutionalnetworksbyaparaunitaryframework/images.zip b/scalingupdiverseorthogonalconvolutionalnetworksbyaparaunitaryframework/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..e75426202afa5e9b495108baddf2efd4695ceffa --- /dev/null +++ b/scalingupdiverseorthogonalconvolutionalnetworksbyaparaunitaryframework/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:26324cf155cc8da764de29e0d6d5c2d4e7e30bdccaa3b1534e3f4f06f4938cc4 +size 1656341 diff --git a/scalingupdiverseorthogonalconvolutionalnetworksbyaparaunitaryframework/layout.json b/scalingupdiverseorthogonalconvolutionalnetworksbyaparaunitaryframework/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..c39841f97c2b07849e64bdaebe21c725a82fda1e --- /dev/null +++ b/scalingupdiverseorthogonalconvolutionalnetworksbyaparaunitaryframework/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1a03ecf6a87418bdcc87632661acbe64d5ce26103c944f9472f61c2554258412 +size 1424109 diff --git a/scorebasedgenerativemodelingofgraphsviathesystemofstochasticdifferentialequations/6dd4d21b-c743-449c-976d-5bfc5602bbc0_content_list.json b/scorebasedgenerativemodelingofgraphsviathesystemofstochasticdifferentialequations/6dd4d21b-c743-449c-976d-5bfc5602bbc0_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..935eaf3bbff9ccc713fce5fc279a82a55b6eda3b --- /dev/null +++ b/scorebasedgenerativemodelingofgraphsviathesystemofstochasticdifferentialequations/6dd4d21b-c743-449c-976d-5bfc5602bbc0_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9bad1d86432460aa01bd68429006e24bf3fba4ced12b23ee9bfbb5fd9b25b09a +size 170133 diff --git a/scorebasedgenerativemodelingofgraphsviathesystemofstochasticdifferentialequations/6dd4d21b-c743-449c-976d-5bfc5602bbc0_model.json b/scorebasedgenerativemodelingofgraphsviathesystemofstochasticdifferentialequations/6dd4d21b-c743-449c-976d-5bfc5602bbc0_model.json new file mode 100644 index 0000000000000000000000000000000000000000..a1f15844022fbcb7929b19591524acd34022d850 --- /dev/null +++ b/scorebasedgenerativemodelingofgraphsviathesystemofstochasticdifferentialequations/6dd4d21b-c743-449c-976d-5bfc5602bbc0_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4490268bf7062b42323cc77951f4c84851b379e3723f243b91fa57537701097b +size 200715 diff --git a/scorebasedgenerativemodelingofgraphsviathesystemofstochasticdifferentialequations/6dd4d21b-c743-449c-976d-5bfc5602bbc0_origin.pdf b/scorebasedgenerativemodelingofgraphsviathesystemofstochasticdifferentialequations/6dd4d21b-c743-449c-976d-5bfc5602bbc0_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..6ab0d746811006ec82eb43aa2c0a415b2879b909 --- /dev/null +++ b/scorebasedgenerativemodelingofgraphsviathesystemofstochasticdifferentialequations/6dd4d21b-c743-449c-976d-5bfc5602bbc0_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2236aadf570e507750f7740218f367fcf432e85ae64aabd06ce21fc22e68e5e5 +size 6344485 diff --git a/scorebasedgenerativemodelingofgraphsviathesystemofstochasticdifferentialequations/full.md b/scorebasedgenerativemodelingofgraphsviathesystemofstochasticdifferentialequations/full.md new file mode 100644 index 0000000000000000000000000000000000000000..7957c8dd55be215cc54e891491288f165b6420cd --- /dev/null +++ b/scorebasedgenerativemodelingofgraphsviathesystemofstochasticdifferentialequations/full.md @@ -0,0 +1,666 @@ +# Score-based Generative Modeling of Graphs via the System of Stochastic Differential Equations + +Jaehyeong Jo $^{1*}$ Seul Lee $^{1*}$ Sung Ju Hwang $^{1,2}$ + +# Abstract + +Generating graph-structured data requires learning the underlying distribution of graphs. Yet, this is a challenging problem, and the previous graph generative methods either fail to capture the permutation-invariance property of graphs or cannot sufficiently model the complex dependency between nodes and edges, which is crucial for generating real-world graphs such as molecules. To overcome such limitations, we propose a novel score-based generative model for graphs with a continuous-time framework. Specifically, we propose a new graph diffusion process that models the joint distribution of the nodes and edges through a system of stochastic differential equations (SDEs). Then, we derive novel score matching objectives tailored for the proposed diffusion process to estimate the gradient of the joint log-density with respect to each component, and introduce a new solver for the system of SDEs to efficiently sample from the reverse diffusion process. We validate our graph generation method on diverse datasets, on which it either achieves significantly superior or competitive performance to the baselines. Further analysis shows that our method is able to generate molecules that lie close to the training distribution yet do not violate the chemical valency rule, demonstrating the effectiveness of the system of SDEs in modeling the node-edge relationships. Our code is available at https://github.com/harryjo97/GDSS. + +# 1. Introduction + +Learning the underlying distribution of graph-structured data is an important yet challenging problem that has wide applications, such as understanding the social networks (Grover et al., 2019; Wang et al., 2018), drug design (Simonovsky & Komodakis, 2018; Li et al., 2018c), neural architecture search (NAS) (Xie et al., 2019; Lee et al., 2021), and even program synthesis (Brockschmidt et al., 2019). Recently, deep generative models have shown success in graph generation by modeling complicated structural properties of graphs, exploiting the expressivity of neural networks. Among them, autoregressive models (You et al., 2018b; Liao et al., 2019) construct a graph via sequential decisions, while one-shot generative models (De Cao & Kipf, 2018; Liu et al., 2019) generate components of a graph at once. Although these models have achieved a certain degree of success, they also possess clear limitations. Autoregressive models are computationally costly and cannot capture the permutation-invariant nature of graphs, while one-shot generative models based on the likelihood fail to model structural information due to the restriction on the architectures to ensure tractable likelihood computation. + +Apart from the likelihood-based methods, Niu et al. (2020) introduced a score-based generative model for graphs, namely, edge-wise dense prediction graph neural network (EDP-GNN). However, since EDP-GNN utilizes the discrete-step perturbation of heuristically chosen noise scales to estimate the score function, both its flexibility and its efficiency are limited. Moreover, EDP-GNN only generates adjacency matrices of graphs, thus is unable to fully capture the node-edge dependency which is crucial for the generation of real-world graphs such as molecules. + +To overcome the limitations of previous graph generative models, we propose a novel score-based graph generation framework on a continuous-time domain that can generate both the node features and the adjacency matrix. Specifically, we propose a novel Graph Diffusion via the System of Stochastic differential equations (GDSS), which describes the perturbation of both node features and adjacency through a system of SDEs, and show that the previous work of Niu et al. (2020) is a special instance of GDSS. Diffusion via the system of SDEs can be interpreted as the decomposition of + +the full diffusion into simpler diffusion processes of respective components while modeling the dependency. Further, we derive novel training objectives for the proposed diffusion, which enable us to estimate the gradient of the joint log-density with respect to each component, and introduce a new integrator for solving the proposed system of SDEs. + +We experimentally validate our method on generic graph generation tasks by evaluating the generation quality on synthetic and real-world graphs, on which ours outperforms existing one-shot generative models while achieving competitive performance to autoregressive models. We further validate our method on molecule generation tasks, where ours outperforms the state-of-the-art baselines including the autoregressive methods, demonstrating that the proposed diffusion process through the system of SDEs is able to capture the complex dependency between nodes and edges. We summarize our main contributions as follows: + +- We propose a novel score-based generative model for graphs that overcomes the limitation of previous generative methods, by introducing a diffusion process for graphs that can generate node features and adjacency matrices simultaneously via the system of SDEs. +- We derive novel training objectives to estimate the gradient of the joint log-density for the proposed diffusion process and further introduce an efficient integrator to solve the proposed system of SDEs. +- We validate our method on both synthetic and real-world graph generation tasks, on which ours outperforms existing graph generative models. + +# 2. Related Work + +Score-based Generative Models Score-based generative models generate samples from noise by first perturbing the data with gradually increasing noise, then learning to reverse the perturbation via estimating the score function, which is the gradient of the log-density function with respect to the data. Two representative classes of score-based generative models have been proposed by Song & Ermon (2019) and Ho et al. (2020), respectively. Score matching with Langevin dynamics (SMLD) (Song & Ermon, 2019) estimates the score function at multiple noise scales, then generates samples using annealed Langevin dynamics to slowly decrease the scales. On the other hand, denoising diffusion probabilistic modeling (DDPM) (Ho et al., 2020) backtracks each step of the noise perturbation by considering the diffusion process as a parameterized Markov chain and learning the transition of the chain. Recently, Song et al. (2021b) showed that these approaches can be unified into a single framework, describing the noise perturbation as the forward diffusion process modeled by the stochastic differential equation (SDE). Although score-based generative models have shown successful results for the generation of + +images (Ho et al., 2020; Song et al., 2021b;a; Dhariwal & Nichol, 2021), audio (Chen et al., 2021; Kong et al., 2021; Jeong et al., 2021; Mittal et al., 2021), and point clouds (Cai et al., 2020; Luo & Hu, 2021), the graph generation task remains to be underexplored due to the discreteness of the data structure and the complex dependency between nodes and edges. We are the first to propose a diffusion process for graphs and further model the dependency through a system of SDEs. It is notable that recent developments of score-based generative methods, such as latent score-based generative model (LSGM) (Vahdat et al., 2021) and critically-damped Langevin diffusion (CLD) (Dockhorn et al., 2021), are complementary to our method as we can apply these methods to improve each component-wise diffusion process. + +Graph Generative Models The common goal of graph generative models is to learn the underlying distribution of graphs. Graph generative models can be classified into two categories based on the type of the generation process: autoregressive and one-shot. Autoregressive graph generative models include generative adversarial network (GAN) models (You et al., 2018a), recurrent neural network (RNN) models (You et al., 2018b; Popova et al., 2019), variational autoencoder (VAE) models (Jin et al., 2018; 2020), and normalizing flow models (Shi et al., 2020; Luo et al., 2021). Works that specifically focus on the scalability of the generation comprise another branch of autoregressive models (Liao et al., 2019; Dai et al., 2020). Although autoregressive models show state-of-the-art performance, they are computationally expensive and cannot model the permutation-invariant nature of the true data distribution. On the other hand, one-shot graph generative models aim to directly model the distribution of all the components of a graph as a whole, thereby considering the structural dependency as well as the permutation-invariance. One-shot graph generative models can be categorized into GAN models (De Cao & Kipf, 2018), VAE models (Ma et al., 2018), and normalizing flow models (Madhawa et al., 2019; Zang & Wang, 2020). There are also recent approaches that utilize energy-based models (EBMs) and score-based models, respectively (Liu et al., 2021b; Niu et al., 2020). Existing one-shot generative models perform poorly due to the restricted model architectures for building a normalized probability, which is insufficient to learn the complex dependency of nodes and edges. To overcome these limitations, we introduce a novel permutation-invariant one-shot generative method based on the score-based model that imposes fewer constraints on the model architecture, compared to previous one-shot methods. + +Score-based Graph Generation To the best of our knowledge, Niu et al. (2020) is the only work that approaches graph generation with the score-based generative model, which aims to generate graphs by estimating the score of the adjacency matrices at a finite number of noise scales, and using Langevin dynamics to sample from a series of + +![](images/f2064a429f6cd38301834786df09656355ea4b2630b300a6fc0aec5b2c82bdc7.jpg) +Figure 1: (Left) Visualization of graph generation through the reverse-time diffusion process. The colored trajectories denote different types of diffusion processes in the joint probability space of node features $\mathbf{X}$ and adjacency $\mathbf{A}$ . We compare three types of diffusion: GDSS (green) can successfully generate samples from the data distribution by modeling the dependency between the components, whereas GDSS-seq (red) or the independent diffusion of each component (orange) fails. (Right) Illustration of the proposed score-based graph generation framework. GDSS generates $\mathbf{X}$ and $\mathbf{A}$ simultaneously by modeling the dependency through time, whereas GDSS-seq generates them sequentially. EDP-GNN generates only $\mathbf{A}$ with $\mathbf{X}$ sampled from the training data. Note that GDSS and GDSS-seq are based on a continuous-time diffusion process, while EDP-GNN is based on a discrete-step perturbation procedure. + +![](images/c2c41d3d01f6b066bf443f67538bbb6ffdba565403fef1fc3d3114335cdd1d8c.jpg) + +![](images/86863a7d76e64964dd2b5c37b5333d8acbb6925af6b7d97573ee04e632450137.jpg) + +decreasing noise scales. However, Langevin dynamics requires numerous sampling steps for each noise scale, thereby taking a long time for the generation and having difficulty in generating large-scale graphs. Furthermore, Niu et al. (2020) focuses on the generation of adjacency without the generation of node features, resulting in suboptimal learning of the distributions of node-attributed graphs such as molecular graphs. A naive extension of the work of Niu et al. (2020) that generates the node features and the adjacency either simultaneously or alternately will still be suboptimal, since it cannot capture the complex dependency between the nodes and edges. Therefore, we propose a novel score-based generative framework for graphs that can interdependently generate the nodes and edges. Specifically, we propose a novel diffusion process for graphs through a system of SDEs that smoothly transforms the data distribution to known prior and vice versa, which overcomes the limitation of the previous discrete-step perturbation procedure. + +# 3. Graph Diffusion via the System of SDEs + +In this section, we introduce our novel continuous-time score-based generative framework for modeling graphs using the system of SDEs. We first explain our proposed graph diffusion process via a system of SDEs in Section 3.1, then derive new objectives for estimating the gradients of the joint log-density with respect to each component in Section 3.2. Finally, we present an effective method for solving the system of reverse-time SDEs in Section 3.3. + +# 3.1. Graph Diffusion Process + +The goal of graph generation is to synthesize graphs that closely follow the distribution of the observed set of graphs. To bypass the difficulty of directly representing the distribution, we introduce a continuous-time score-based generative framework for the graph generation. Specifically, we propose a novel graph diffusion process via the system of SDEs + +that transforms the graphs to noise and vice versa, while modeling the dependency between nodes and edges. We begin by explaining the proposed diffusion process for graphs. + +A graph $G$ with $N$ nodes is defined by its node features $\mathbf{X} \in \mathbb{R}^{N \times F}$ and the weighted adjacency matrix $\mathbf{A} \in \mathbb{R}^{N \times N}$ as $G = (\mathbf{X}, \mathbf{A}) \in \mathbb{R}^{N \times F} \times \mathbb{R}^{N \times N} \coloneqq \mathcal{G}$ , where $F$ is the dimension of the node features. To model the dependency between $\mathbf{X}$ and $\mathbf{A}$ , we propose a forward diffusion process of graphs that transforms both the node features and the adjacency matrices to a simple noise distribution. Formally, the diffusion process can be represented as the trajectory of random variables $\{\mathbf{G}_t = (\mathbf{X}_t, \mathbf{A}_t)\}_{t \in [0,T]}$ in a fixed time horizon $[0,T]$ , where $\mathbf{G}_0$ is a graph from the data distribution $p_{data}$ . The diffusion process can be modeled by the following Itô SDE: + +$$ +\mathrm {d} \boldsymbol {G} _ {t} = \mathbf {f} _ {t} (\boldsymbol {G} _ {t}) \mathrm {d} t + \mathbf {g} _ {t} (\boldsymbol {G} _ {t}) \mathrm {d} \mathbf {w}, \quad \boldsymbol {G} _ {0} \sim p _ {\text {d a t a}}, \tag {1} +$$ + +where $\mathbf{f}_t(\cdot): \mathcal{G} \to \mathcal{G}^1$ is the linear drift coefficient, $\mathbf{g}_t(\cdot): \mathcal{G} \to \mathcal{G} \times \mathcal{G}$ is the diffusion coefficient, and $\mathbf{w}$ is the standard Wiener process. Intuitively, the forward diffusion process of Eq. (1) smoothly transforms both $X_0$ and $A_0$ by adding infinitesimal noise $\mathrm{d}\mathbf{w}$ at each infinitesimal time step $\mathrm{d}t$ . The coefficients of the SDE, $\mathbf{f}_t$ and $\mathbf{g}_t$ , are chosen such that at the terminal time horizon $T$ , the diffused sample $\mathbf{G}_T$ approximately follows a prior distribution that has a tractable form to efficiently generate the samples, for example Gaussian distribution. For ease of the presentation, we choose $\mathbf{g}_t(\mathbf{G}_t)$ to be a scalar function $g_t$ . Note that ours is the first work that proposes a diffusion process for generating a whole graph consisting of nodes and edges with attributes, in that the work of Niu et al. (2020) (1) utilizes the finite-step perturbation of multiple noise scales, and (2) only focuses on the perturbation of the adjacency matrices while using the fixed node features sampled from the training data. + +In order to generate graphs that follow the data distribution, we start from samples of the prior distribution and + +traverse the diffusion process of Eq. (1) backward in time. Notably, the reverse of the diffusion process in time is also a diffusion process described by the following reverse-time SDE (Anderson, 1982; Song et al., 2021b): + +$$ +\mathrm {d} \boldsymbol {G} _ {t} = \left[ \mathbf {f} _ {t} (\boldsymbol {G} _ {t}) - g _ {t} ^ {2} \nabla_ {\boldsymbol {G} _ {t}} \log p _ {t} (\boldsymbol {G} _ {t}) \right] \mathrm {d} \bar {t} + g _ {t} \mathrm {d} \bar {\mathbf {w}}, \tag {2} +$$ + +where $p_t$ denotes the marginal distribution under the forward diffusion process at time $t$ , $\bar{\mathbf{w}}$ is a reverse-time standard Wiener process, and $\mathrm{d}\bar{t}$ is an infinitesimal negative time step. However, solving Eq. (2) directly requires the estimation of high-dimensional score $\nabla_{\pmb{G}_t}\log p_t(\pmb{G}_t)\in \mathbb{R}^{N\times F}\times \mathbb{R}^{N\times N}$ , which is expensive to compute. To bypass this computation, we propose a novel reverse-time diffusion process equivalent to Eq. (2), modeled by the following system of SDEs: + +$$ +\left\{ \begin{array}{l} \mathrm {d} \boldsymbol {X} _ {t} = \left[ \mathbf {f} _ {1, t} \left(\boldsymbol {X} _ {t}\right) - g _ {1, t} ^ {2} \nabla_ {\boldsymbol {X} _ {t}} \log p _ {t} \left(\boldsymbol {X} _ {t}, \boldsymbol {A} _ {t}\right) \right] \mathrm {d} \bar {t} + g _ {1, t} \mathrm {d} \bar {\mathbf {w}} _ {1} \\ \mathrm {d} \boldsymbol {A} _ {t} = \left[ \mathbf {f} _ {2, t} \left(\boldsymbol {A} _ {t}\right) - g _ {2, t} ^ {2} \nabla_ {\boldsymbol {A} _ {t}} \log p _ {t} \left(\boldsymbol {X} _ {t}, \boldsymbol {A} _ {t}\right) \right] \mathrm {d} \bar {t} + g _ {2, t} \mathrm {d} \bar {\mathbf {w}} _ {2} \end{array} \right. \tag {3} +$$ + +where $\mathbf{f}_{1,t}$ and $\mathbf{f}_{2,t}$ are linear drift coefficients satisfying $\mathbf{f}_t(\mathbf{X},\mathbf{A}) = (\mathbf{f}_{1,t}(\mathbf{X}),\mathbf{f}_{2,t}(\mathbf{A}))$ , $g_{1,t}$ and $g_{2,t}$ are scalar diffusion coefficients, and $\bar{\mathbf{w}}_1$ , $\bar{\mathbf{w}}_2$ are reverse-time standard Wiener processes. We refer to these forward and reverse diffusion processes of graphs as Graph Diffusion via the System of SDEs (GDSS). Notably, each SDE in Eq. (3) describes the diffusion process of each component, $\mathbf{X}$ and $\mathbf{A}$ , respectively, which presents a new perspective of interpreting the diffusion of a graph as the diffusion of each component that are interrelated through time. In practice, we can choose different types of SDEs for each component-wise diffusion that best suit the generation process. + +The key property of GDSS is that the diffusion processes in the system are dependent on each other, related by the gradients of the joint log-density $\nabla_{\boldsymbol{X}_t}\log p_t(\boldsymbol{X}_t,\boldsymbol{A}_t)$ and $\nabla_{\boldsymbol{A}_t}\log p_t(\boldsymbol{X}_t,\boldsymbol{A}_t)$ , which we refer to as the partial score functions. By leveraging the partial scores to model the dependency between the components through time, GDSS is able to represent the diffusion process of a whole graph, consisting of nodes and edges. To demonstrate the importance of modeling the dependency, we present two variants of our proposed GDSS and compare their generative performance. + +The first variant is the continuous-time version of EDP-GNN (Niu et al., 2020). By ignoring the diffusion process of $\mathbf{X}$ in Eq. (3) with $f_{1,t} = g_{1,t} = 0$ and choosing the prior distribution of $\mathbf{X}$ as the data distribution, we obtain a diffusion process of $\mathbf{A}$ that generalizes the discrete-step noise perturbation procedure of EDP-GNN. Therefore, EDP-GNN can be considered as a special example of GDSS without the diffusion process of the node features, which further replaces the diffusion by the discrete-step perturbation with a finite number of noise scales. We present another variant of GDSS that generates $\mathbf{X}$ and $\mathbf{A}$ sequentially instead of generating them simultaneously. By neglecting some part of the dependency through + +the assumptions $\nabla_{\pmb{A}_t}\log p_t(\pmb {X}_t,\pmb {A}_t)\approx \nabla_{\pmb {X}_t}\log p_t(\pmb {X}_t)$ and $\nabla_{\pmb{A}_{t}}\log p_{t}(\pmb {X}_{t},\pmb{A}_{t})\approx \nabla_{\pmb{A}_{t}}\log p_{t}(\pmb {X}_{0},\pmb{A}_{t})$ , we can derive the following SDEs for the diffusion process of the variant: + +$$ +\mathrm {d} \boldsymbol {X} _ {t} = \left[ \mathbf {f} _ {1, t} \left(\boldsymbol {X} _ {t}\right) - g _ {1, t} ^ {2} \nabla_ {\boldsymbol {X} _ {t}} \log p _ {t} \left(\boldsymbol {X} _ {t}\right) \right] \mathrm {d} \bar {t} + g _ {1, t} \mathrm {d} \bar {\mathbf {w}} _ {1}, \tag {4} +$$ + +$$ +\mathrm {d} \boldsymbol {A} _ {t} = \left[ \mathbf {f} _ {2, t} (\boldsymbol {A} _ {t}) - g _ {2, t} ^ {2} \nabla_ {\boldsymbol {A} _ {t}} \log p _ {t} (\boldsymbol {X} _ {0}, \boldsymbol {A} _ {t}) \right] \mathrm {d} \bar {t} + g _ {2, t} \mathrm {d} \bar {\mathbf {w}} _ {2}, +$$ + +which are sequential in the sense that the reverse diffusion process of $\mathbf{A}$ is determined by $X_0$ , the result of the reverse diffusion of $\mathbf{X}$ . Thus simulating Eq. (4) can be interpreted as generating the node features $\mathbf{X}$ first, then generating the adjacency $\mathbf{A}$ sequentially, which we refer to as GDSS-seq. + +The reverse diffusion process of these two variants, EDP-GNN and GDSS-seq, are visualized in Figure 1 as the red trajectory in the joint $(X,A)$ -space, where the trajectory is constrained to the hyperplane defined by $X_{t} = X_{0}$ , therefore do not fully reflect the dependency. On the other hand, GDSS represented as the green trajectory is able to diffuse freely from the noise to the data distribution by modeling the joint distribution through the system of SDEs, thereby successfully generating samples from the data distribution. + +![](images/c2830b4f6b85bd7682b3bb3b999dacb0b8f8822c30223717e4c2e281a7115bb7.jpg) +Figure 2: A toy experiment on modeling the dependency. GDSS successfully models the correlation, whereas others fail. See Appendix C.1 for more details of the experiment. + +To empirically verify this observation, we conduct a simple experiment where the data distribution is a bivariate Gaussian mixture. The generated samples of each process are shown in Figure 2. While GDSS successfully represents the correlation of the two variables, GDSS-seq fails to capture their covariance and generates samples that deviate from the data distribution. We observe that EDP-GNN shows a similar result. We further extensively validate the effectiveness of our GDSS in modeling the dependency in Section 4. + +Note that once the partial scores in Eq. (3) are known for all $t$ , the system of reverse-time SDEs can be used as a generative model by simulating the system backward in time, which we further explain in Section 3.3. In order to estimate the partial scores with neural networks, we introduce novel training objectives for GDSS in the following subsection. + +# 3.2. Estimating the Partial Score Functions + +Training Objectives The partial score functions can be estimated by training the time-dependent score-based models $s_{\theta, t}$ and $s_{\phi, t}$ , so that $s_{\theta, t}(G_t) \approx \nabla_{\mathbf{X}_t} \log p_t(G_t)$ and $s_{\phi, t}(G_t) \approx \nabla_{\mathbf{A}_t} \log p_t(G_t)$ . However, the objectives introduced in the previous works for estimating the score function are not directly applicable, since the partial score functions are defined as the gradient of each component, not + +the gradient of the data as in the score function. Thus we derive new objectives for estimating the partial scores. + +Intuitively, the score-based models should be trained to minimize the distance to the corresponding ground-truth partial scores. In order to minimize the Euclidean distance, we introduce new objectives that generalize the score matching (Hyvärinen, 2005; Song et al., 2021b) to the estimation of the partial scores for the given graph dataset, as follows: + +$$ +\begin{array}{l} \min _ {\theta} \mathbb {E} _ {t} \left\{\lambda_ {1} (t) \mathbb {E} _ {\boldsymbol {G} _ {0}} \mathbb {E} _ {\boldsymbol {G} _ {t} | \boldsymbol {G} _ {0}} \| \boldsymbol {s} _ {\theta , t} (\boldsymbol {G} _ {t}) - \nabla_ {\boldsymbol {X} _ {t}} \log p _ {t} (\boldsymbol {G} _ {t}) \| _ {2} ^ {2} \right\} \\ \min _ {\phi} \mathbb {E} _ {t} \left\{\lambda_ {2} (t) \mathbb {E} _ {\boldsymbol {G} _ {0}} \mathbb {E} _ {\boldsymbol {G} _ {t} | \boldsymbol {G} _ {0}} \| \boldsymbol {s} _ {\phi , t} (\boldsymbol {G} _ {t}) - \nabla_ {\boldsymbol {A} _ {t}} \log p _ {t} (\boldsymbol {G} _ {t}) \| _ {2} ^ {2} \right\}, \tag {5} \\ \end{array} +$$ + +where $\lambda_1(t)$ and $\lambda_2(t)$ are positive weighting functions and $t$ is uniformly sampled from $[0, T]$ . The expectations are taken over the samples $\pmb{G}_0 \sim p_{data}$ and $\pmb{G}_t \sim p_{0t}(\pmb{G}_t | \pmb{G}_0)$ , where $p_{0t}(\pmb{G}_t | \pmb{G}_0)$ denotes the transition distribution from $p_0$ to $p_t$ induced by the forward diffusion process. + +Unfortunately, we cannot train directly with Eq. (5) since the ground-truth partial scores are not analytically accessible in general. Therefore we derive tractable objectives equivalent to Eq. (5), by leveraging the idea of denoising score matching (Vincent, 2011; Song et al., 2021b) to the partial scores, as follows (see Appendix A.1 for the derivation): + +$$ +\begin{array}{l} \min _ {\theta} \mathbb {E} _ {t} \left\{\lambda_ {1} (t) \mathbb {E} _ {\boldsymbol {G} _ {0}} \mathbb {E} _ {\boldsymbol {G} _ {t} | \boldsymbol {G} _ {0}} \left\| \boldsymbol {s} _ {\theta , t} (\boldsymbol {G} _ {t}) - \nabla_ {\boldsymbol {X} _ {t}} \log p _ {0 t} (\boldsymbol {G} _ {t} | \boldsymbol {G} _ {0}) \right\| _ {2} ^ {2} \right\} \\ \min _ {\phi} \mathbb {E} _ {t} \left\{\lambda_ {2} (t) \mathbb {E} _ {\boldsymbol {G} _ {0}} \mathbb {E} _ {\boldsymbol {G} _ {t} | \boldsymbol {G} _ {0}} \left\| \boldsymbol {s} _ {\phi , t} (\boldsymbol {G} _ {t}) - \nabla_ {\boldsymbol {A} _ {t}} \log p _ {0 t} (\boldsymbol {G} _ {t} | \boldsymbol {G} _ {0}) \right\| _ {2} ^ {2} \right\}. \\ \end{array} +$$ + +Since the drift coefficient of the forward diffusion process in Eq. (1) is linear, the transition distribution $p_{0t}(G_t | G_0)$ can be separated in terms of $X_t$ and $A_t$ as follows: + +$$ +p _ {0 t} \left(\boldsymbol {G} _ {t} \mid \boldsymbol {G} _ {0}\right) = p _ {0 t} \left(\boldsymbol {X} _ {t} \mid \boldsymbol {X} _ {0}\right) p _ {0 t} \left(\boldsymbol {A} _ {t} \mid \boldsymbol {A} _ {0}\right). \tag {6} +$$ + +Notably, we can easily sample from the transition distributions of each components, $p_{0t}(\mathbf{X}_t|\mathbf{X}_0)$ and $p_{0t}(\mathbf{A}_t|\mathbf{A}_0)$ , as they are Gaussian distributions where the mean and variance are tractably determined by the coefficients of the forward diffusion process (Särkkä & Solin, 2019). From Eq. (6), we propose new training objectives which are equivalent to Eq. (5) (see Appendix A.2 for the detailed derivation): + +$$ +\begin{array}{l} \min _ {\theta} \mathbb {E} _ {t} \left\{\lambda_ {1} (t) \mathbb {E} _ {\boldsymbol {G} _ {0}} \mathbb {E} _ {\boldsymbol {G} _ {t} | \boldsymbol {G} _ {0}} \| \boldsymbol {s} _ {\theta , t} (\boldsymbol {G} _ {t}) - \nabla_ {\boldsymbol {X} _ {t}} \log p _ {0 t} (\boldsymbol {X} _ {t} | \boldsymbol {X} _ {0}) \| _ {2} ^ {2} \right\} \tag {7} \\ \min _ {\phi} \mathbb {E} _ {t} \left\{\lambda_ {2} (t) \mathbb {E} _ {\boldsymbol {G} _ {0}} \mathbb {E} _ {\boldsymbol {G} _ {t} | \boldsymbol {G} _ {0}} \| \boldsymbol {s} _ {\phi , t} (\boldsymbol {G} _ {t}) - \nabla_ {\boldsymbol {A} _ {t}} \log p _ {0 t} (\boldsymbol {A} _ {t} | \boldsymbol {A} _ {0}) \| _ {2} ^ {2} \right\} \\ \end{array} +$$ + +The expectations in Eq. (7) can be efficiently computed using the Monte Carlo estimate with the samples $(t, G_0, G_t)$ . Note that estimating the partial scores is not equivalent to estimating $\nabla_{\mathbf{X}_t} \log p_t(\mathbf{X}_t)$ or $\nabla_{\mathbf{A}_t} \log p_t(\mathbf{A}_t)$ , the main objective of previous score-based generative models, since estimating the partial scores requires capturing the dependency between $\mathbf{X}_t$ and $\mathbf{A}_t$ determined by the joint probability through time. As we can effectively estimate the partial + +scores by training the time-dependent score-based models with the objectives of Eq. (7), what remains is to find the models that can learn the partial scores of the underlying distribution of graphs. Thus we propose new architectures for the score-based models in the next paragraph. + +Permutation-equivariant Score-based Model Now we propose new architectures for the time-dependent score-based models that can capture the dependencies of $X_{t}$ and $\pmb{A}_{t}$ through time, based on graph neural networks (GNNs). First, we present the score-based model $s_{\phi ,t}$ to estimate $\nabla_{\pmb{A}_{t}}\log p_{t}(\pmb{X}_{t},\pmb{A}_{t})$ which has the same dimensionality as $\pmb{A}_{t}$ . We utilize the graph multi-head attention (Baek et al., 2021) to distinguish important relations between nodes, and further leverage the higher-order adjacency matrices to represent the long-range dependencies as follows: + +$$ +\boldsymbol {s} _ {\phi , t} \left(\boldsymbol {G} _ {t}\right) = \operatorname {M L P} \left(\left[ \left\{\operatorname {G M H} \left(\boldsymbol {H} _ {i}, \boldsymbol {A} _ {t} ^ {p}\right) \right\} _ {i = 0, p = 1} ^ {K, P} \right]\right), \tag {8} +$$ + +where $\mathbf{A}_t^p$ are the higher-order adjacency matrices, $H_{i+1} = \mathrm{GNN}(H_i, A_t)$ with $H_0 = X_t$ given, $[\cdot]$ denotes the concatenation operation, GMH denotes the graph multi-head attention block, and $K$ denotes the number of GMH layers. We also present the score-based model $s_{\theta,t}$ to estimate $\nabla_{X_t} \log p_t(X_t, A_t)$ which has the same dimensionality as $X_t$ , where we use multiple layers of GNNs to learn the partial scores from the node representations as follows: + +$$ +\boldsymbol {s} _ {\theta , t} (\boldsymbol {G} _ {t}) = \operatorname {M L P} \left(\left[ \left\{\boldsymbol {H} _ {i} \right\} _ {i = 0} ^ {L} \right]\right), \tag {9} +$$ + +where $H_{i + 1} = \mathrm{GNN}(H_i,A_t)$ with $H_0 = X_t$ given and $L$ denotes the number of GNN layers. Here GMH layers can be used instead of simple GNN layers with additional computation costs, which we analyze further in Section 4.3. The architectures of the score-based models are illustrated in Figure 5 of Appendix. Moreover, following Song & Ermon (2020), we incorporate the time information to the score-based models by scaling the output of the models with the standard deviation of the transition distribution at time $t$ . + +Note that since the message-passing operations of GNNs and the attention function used in GMH are permutation-equivariant (Keriven & Peyré, 2019), the proposed score-based models are also equivariant, and thereby from the result of Niu et al. (2020), the log-likelihood implicitly defined by the models is guaranteed to be permutation-invariant. + +# 3.3. Solving the System of Reverse-time SDEs + +In order to use the reverse-time diffusion process as a generative model, it requires simulating the system of reverse-time SDEs in Eq. (3), which can be approximated using the trained score-based models $s_{\theta ,t}$ and $s_{\phi ,t}$ as follows: + +$$ +\left\{ \begin{array}{l} \mathrm {d} \boldsymbol {X} _ {t} = \mathbf {f} _ {1, t} (\boldsymbol {X} _ {t}) \mathrm {d} \bar {t} + g _ {1, t} \mathrm {d} \bar {\mathbf {w}} _ {1} \\ \mathrm {d} \boldsymbol {A} _ {t} = \underbrace {\mathbf {f} _ {2 , t} (\boldsymbol {A} _ {t}) \mathrm {d} \bar {t} + g _ {2 , t} \mathrm {d} \bar {\mathbf {w}} _ {2}} _ {F} \underbrace {- g _ {1 , t} ^ {2} \boldsymbol {s} _ {\theta , t} (\boldsymbol {X} _ {t} , \boldsymbol {A} _ {t}) \mathrm {d} \bar {t}} _ {S} \end{array} \right. \tag {10} +$$ + +However, solving the system of two diffusion processes that are interdependently tied by the partial scores brings about another difficulty. Thus we propose a novel integrator, Symmetric Splitting for System of SDEs (S4) to simulate the system of reverse-time SDEs, that is efficient yet accurate, inspired by the Symmetric Splitting CLD Sampler (SSCS) (Dockhorn et al., 2021) and the Predictor-Corrector Sampler (PC sampler) (Song et al., 2021b). + +Specifically, at each discretized time step $t$ , S4 solver consists of three steps: the score computation, the correction, and the prediction. First, S4 computes the estimation of the partial scores with respect to the predicted $G_{t}$ , using the score-based models $s_{\theta ,t}$ and $s_{\phi ,t}$ , where the computed partial scores are later used for both the correction and the prediction steps. After the score computation, we perform the correction step by leveraging a score-based MCMC method, for example Langevin MCMC (Parisi, 1981), in order to obtain calibrated sample $G_{t}^{\prime}$ from $G_{t}$ . Here we exploit the precomputed partial scores for the score-based MCMC approach. Then what remains is to predict the solution for the next time step $t - \delta t$ , going backward in time. + +The prediction of the state at time $t^{\prime}$ follows the marginal distribution $p_{t^{\prime}}$ described by the Fokker-Planck equation induced by Eq. (10), where the Fokker-Planck operators $\hat{\mathcal{L}}_F^*$ and $\hat{\mathcal{L}}_S^*$ correspond to the $F$ -term and $S$ -term, respectively2. Inspired by Dockhorn et al. (2021), we formalize an intractable solution to Eq. (10) with the classical propagator $e^{t(\hat{\mathcal{L}}_F^* +\hat{\mathcal{L}}_S^*)}$ which gives light to finding efficient prediction method. From the result of the symmetric Trotter theorem (Trotter, 1959; Strang, 1968), the propagation of the calibrated state $\pmb{G}_t^\prime$ from time $t$ to $t - \delta t$ following the dynamics of Eq. (10) can be approximated by applying $e^{\frac{\delta t}{2}\hat{\mathcal{L}}_F^*}e^{\delta t\hat{\mathcal{L}}_S^*}e^{\frac{\delta t}{2}\hat{\mathcal{L}}_F^*}$ to $\pmb{G}_t^\prime$ . Observing the operators individually, the action of first $e^{\frac{\delta t}{2}\hat{\mathcal{L}}_F^*}$ describes the dynamics of the $F$ -term in Eq. (10) from time $t$ to $t - \delta t / 2$ , which is equal to sampling from the transition distribution of the forward diffusion in Eq. (1) as follows (see Appendix A.4 and A.5 for the derivation of the action and the transition distribution.) + +$$ +e ^ {\frac {\delta t}{2} \hat {\mathcal {L}} _ {F} ^ {*}} \boldsymbol {G} = \tilde {\boldsymbol {G}} \sim p _ {t, t - \delta t / 2} (\tilde {\boldsymbol {G}} | \boldsymbol {G}). \tag {11} +$$ + +On the other hand, the action of $e^{\delta t\hat{\mathcal{L}}_S^*}$ is not analytically accessible, so we approximate the action with a simple Euler method (EM) that solves the ODE corresponding to the $S$ -term in Eq. (10). Here we use the precomputed partial scores again, which is justified due to the action of the first $e^{\frac{\delta t}{2}\hat{\mathcal{L}}_F^*}$ on a sufficiently small half-step $\delta t / 2$ . Lastly, the action of remaining $e^{\frac{\delta t}{2}\hat{\mathcal{L}}_F^*}$ corresponds to sampling from the transition distribution from time $t - \delta t / 2$ to $t - \delta t$ , which results in the approximated solution $G_{t - \delta t}$ . We provide the pseudo-code for the S4 solver in Algorithm 1 of Appendix. + +To obtain more accurate solution with additional cost of computation, one might consider using a higher-order integrator such as Runge-Kutta method to approximate the action of the operator $e^{\delta t\hat{\mathcal{L}}_S^*}$ , and further leverage HMC (Neal, 2012) for the correction step instead of Langevin MCMC. + +Note that although S4 and PC sampler both carry out the prediction and correction steps, S4 solver is far more efficient in terms of computation since compared to the PC sampler, S4 requires half the number of forward passes to the score-based models which dominates the computational cost of solving the SDEs. Moreover, the proposed S4 solver can be used to solve a general system of SDEs, including the system with mixed types of SDEs such as those of Variance Exploding (VE) SDE and Variance Preserving (VP) SDE (Song et al., 2021b), whereas SSCS is limited to solving a specific type of SDE, namely CLD. + +# 4. Experiments + +We experimentally validate the performance of our method in generation of generic graphs as well as molecular graphs. + +# 4.1. Generic Graph Generation + +To verify that GDSS is able to generate graphs that follow the underlying data distribution, we evaluate our method on generic graph generation tasks with various datasets. + +Experimental Setup We first validate GDSS by evaluating the quality of the generated samples on four generic graph datasets, including synthetic and real-world graphs with varying sizes: (1) Ego-small, 200 small ego graphs drawn from larger Citeseer network dataset (Sen et al., 2008), (2) Community-small, 100 randomly generated community graphs, (3) Enzymes, 587 protein graphs which represent the protein tertiary structures of the enzymes from the BRENDA database (Schomburg et al., 2004), and (4) Grid, 100 standard 2D grid graphs. For a fair comparison, we follow the experimental and evaluation setting of You et al. (2018b) with the same train/test split. We use the maximum mean discrepancy (MMD) to compare the distributions of graph statistics between the same number of generated and test graphs. Following You et al. (2018b), we measure the distributions of degree, clustering coefficient, and the number of occurrences of orbits with 4 nodes. Note that we use the Gaussian Earth Mover's Distance (EMD) kernel to compute the MMDs instead of the total variation (TV) distance used in Liao et al. (2019), since the TV distance leads to an indefinite kernel and an undefined behavior (O'Bray et al., 2021). Please see Appendix C.2 for more details. + +Implementation Details and Baselines We compare our proposed method against the following deep generative models. GraphVAE (Simonovsky & Komodakis, 2018) is a one + +Table 1: Generation results on the generic graph datasets. We report the MMD distances between the test datasets and generated graphs. Best results are highlighted in bold (smaller the better). The results of the baselines for Ego-small and Community-small dataset are taken from Niu et al. (2020) and Luo et al. (2021). Hyphen (-) denotes out-of-resources that take more than 10 days or not applicable due to the memory issue. * denotes our own implementation and † indicates unreproducible results. Due to the space limitation, we provide the standard deviations in Appendix D.1. + +
Ego-smallCommunity-smallEnzymesGrid
Real, 4 ≤ |V| ≤ 18Synthetic, 12 ≤ |V| ≤ 20Real, 10 ≤ |V| ≤ 125Synthetic, 100 ≤ |V| ≤ 400
Deg.Clus.OrbitAvg.Deg.Clus.OrbitAvg.Deg.Clus.OrbitAvg.Deg.Clus.OrbitAvg.
Autoreg.DeepGMG0.0400.1000.0200.0530.2200.9500.4000.523--------
GraphRNN0.0900.2200.0030.1040.0800.1200.0400.0800.0170.0620.0460.0420.0640.0430.0210.043
GraphAF*0.030.110.0010.0470.180.200.020.1331.6691.2830.2661.073----
GraphDF*0.040.130.010.0600.060.120.030.0701.5031.0610.2020.922----
One-shotGraphVAE*0.1300.1700.0500.1170.3500.9800.5400.6231.3690.6290.1910.7301.6190.00.9190.846
GNF†0.0300.1000.0010.0440.2000.2000.1100.170--------
EDP-GNN0.0520.0930.0070.0510.0530.1440.0260.0740.0230.2680.0820.1240.4550.2380.3280.340
GDSS-seq (Ours)0.0320.0270.0110.0230.0900.1230.0070.0730.0990.2250.0100.1110.1710.0110.2230.135
GDSS (Ours)0.0210.0240.0070.0170.0450.0860.0070.0460.0260.0610.0090.0320.1110.0050.0700.062
+ +![](images/8e1b2280b93ed4f413768d607ed414862a66c6afee074612df50c52b375b7646.jpg) +Figure 3: (Left) Complexity of the score-based models measured by the Frobenius norm of the Jacobian of the model. We compare GDSS (green) against GDSS-seq (red), where the solid and dotted lines denote the models estimating the partial scores with respect to $\mathbf{X}$ and $\mathbf{A}$ , respectively. (Right) Comparison between fixed step size SDE solvers. We measure the time for the generation of 128 graphs. + +
SolverCommunity-smallEnzymes
Deg.Clus.OrbitAvg.Time (s)Deg.Clus.OrbitAvg.Time (s)
EM0.0550.1330.0170.06829.640.0600.5810.1200.254153.58
Reverse0.0580.1250.0160.06629.750.0570.5500.1120.240155.06
EM + Langevin0.0450.0860.0070.04659.930.0280.0620.0100.033308.42
Rev. + Langevin0.0450.0860.0070.04659.400.0280.0640.0090.034310.35
S4 (Ours)0.0420.1010.0070.05030.930.0260.0610.0090.032157.57
+ +shot VAE-based model. DeepGMG (Li et al., 2018a) and GraphRNN (You et al., 2018b) are autoregressive RNN-based models. GNF (Liu et al., 2019) is a one-shot flow-based model. GraphAF (Shi et al., 2020) is an autoregressive flow-based model. EDP-GNN (Niu et al., 2020) is a one-shot score-based model. GraphDF (Luo et al., 2021) is an autoregressive flow-based model that utilizes discrete latent variables. For GDSS, we consider three types of SDEs introduced by Song et al. (2021b), namely VESDE, VPSDE, and sub-VP SDE, for the diffusion processes of each component, and either use the PC sampler or the S4 solver to solve the system of SDEs. We provide further implementation details of the baselines and our GDSS in Appendix C.2. + +Results Table 1 shows that the proposed GDSS significantly outperforms all the baseline one-shot generative models including EDP-GNN, and also outperforms the autoregressive baselines on most of the datasets, except Grid. Moreover, GDSS shows competitive performance to the state-of-the-art autoregressive model GraphRNN on generating large graphs, i.e. Grid dataset, for which GDSS is the only method that achieves similar performance. We observe that EDP-GNN, a previous score-based generation model for graphs, completely fails in generating large graphs. The MMD results demonstrate that GDSS can effectively capture the local characteristics of the graphs, which is possible due to modeling the dependency between nodes and edges. We visualize the generated graphs of GDSS in Appendix E.1. + +Complexity of Learning Partial Scores Learning the partial score $\nabla_{\pmb{A}_t}\log p_t(\pmb {X}_t,\pmb {A}_t)$ regarding both $X_{t}$ and $A_{t}$ may seem difficult, compared to learning $\nabla_{\pmb{A}_{t}}\log p_{t}(\pmb {X}_{0},\pmb{A}_{t})$ that concerns only $A_{t}$ . We empirically demonstrate this is not the case, by measuring the complexity of the score-based models that estimate the partial scores. The complexity of the models can be measured via the squared Frobenius norm of their Jacobians $\mathcal{J}_F(t)$ , and we compare the models of GDSS and GDSS-seq trained with the Ego-small dataset. As shown in Figure 3, the complexity of GDSS estimating $\nabla_{\pmb{A}_{t}}\log p_{t}(\pmb {X}_{t},\pmb{A}_{t})$ is significantly smaller compared to the complexity of GDSS-seq estimating $\nabla_{\pmb{A}_{t}}\log p_{t}(\pmb {X}_{0},\pmb{A}_{t})$ and similarly for $X_{t}$ . The result stresses the importance of modeling the node-edge dependency, since whether to model the dependency is the only difference between GDSS and GDSS-seq. Moreover, the generation result of GDSS compared to GDSS-seq in Table 1 verifies that the reduced complexity enables the effective generation of larger graphs. + +# 4.2. Molecule Generation + +To show that GDSS is able to capture the complex dependency between nodes and edges, we further evaluate our method for molecule generation tasks. + +Experimental Setup We use two molecular datasets, QM9 (Ramakrishnan et al., 2014) and ZINC250k (Irwin et al., 2012), where we provide the statistics in Table 6 in + +Table 2: Generation results on the QM9 and ZINC250k dataset. Results are the means of 3 different runs, and the best results are highlighted in bold. Values denoted by * are taken from the respective original papers. Other results are obtained by running open-source codes. Val. w/o corr. denotes the Validity w/o correction metric, and values that do not exceed ${50}\%$ are underlined. Due to the space limitation, we provide the results of validity, uniqueness, and novelty as well as the standard deviations in Appendix D.2. + +
MethodQM9ZINC250k
Val. w/o corr. (%)↑NSPDK↓FCD↓Time (s)↓Val. w/o corr. (%)↑NSPDK↓FCD↓Time (s)↓
Autoreg.GraphAF (Shi et al., 2020)67*0.0205.2682.52e368*0.04416.2895.80e3
GraphAF+FC74.430.0215.6252.55e368.470.04416.0236.02e3
GraphDF (Luo et al., 2021)82.67*0.06310.8165.35e489.03*0.17634.2026.03e4
GraphDF+FC93.880.06410.9284.91e490.610.17733.5465.54e4
One-shotMoFlow (Zang & Wang, 2020)91.360.0174.4674.6063.110.04620.9312.45e1
EDP-GNN (Niu et al., 2020)47.520.0052.6804.40e382.970.04916.7379.09e3
GraphEBM (Liu et al., 2021b)8.220.0306.1433.71e15.290.21235.4715.46e1
GDSS-seq (Ours)94.470.0104.0041.13e292.390.03016.8472.02e3
GDSS (Ours)95.720.0032.9001.14e297.010.01914.6562.02e3
+ +![](images/6928e3dc8f29355120c0bc8a73f08aa3abb663cc0b36f50708027b277881fb56.jpg) +Figure 4: Visualization of the generated molecules with maximum Tanimoto similarity to the molecule from the dataset. The top row shows QM9 molecules while the bottom row shows ZINC250k molecules. For each generated molecule, we display the similarity value at the bottom. The pairwise Tanimoto similarity is calculated based on the standard Morgan fingerprints with radius 2 and 1024 bits. + +Appendix. Following previous works (Shi et al., 2020; Luo et al., 2021), the molecules are kekulized by the RDKit library (Landrum et al., 2016) with hydrogen atoms removed. We evaluate the quality of the 10,000 generated molecules with the following metrics. Fréchet ChemNet Distance (FCD) (Preuer et al., 2018) evaluates the distance between the training and generated sets using the activations of the penultimate layer of the ChemNet. Neighborhood subgraph pairwise distance kernel (NSPDK) MMD (Costa & De Grave, 2010) is the MMD between the generated molecules and test molecules which takes into account both the node and edge features for evaluation. Note that FCD and NSPDK MMD are salient metrics that assess the ability to learn the distribution of the training molecules, measuring how close the generated molecules lie to the distribution. Specifically, FCD measures the ability in the view of molecules in chemical space, while NSPDK MMD measures the ability in the view of the graph structure. Validity w/o correction is the fraction of valid molecules without valency correction or edge resampling, which is different from the metric used in Shi et al. (2020) and Luo et al. (2021), since we allow atoms to have formal charge when checking their valency following Zang & Wang (2020), which is more reasonable due to the existence of formal charge in the training molecules. Time measures the time for generating 10,000 molecules in the form of RDKit molecules. We provide further details about the experimental settings, including the hyperparameter search in Appendix C.3. + +Baselines We compare our GDSS against the following baselines. GraphAF (Shi et al., 2020) is an autoregressive flow-based model. MoFlow (Zang & Wang, 2020) is a one-shot flow-based model. GraphDF (Luo et al., 2021) is an autoregressive flow-based model using discrete latent variables. GraphEBM (Liu et al., 2021b) is a one-shot energy-based model that generates molecules by minimizing energies with Langevin dynamics. We also construct modified versions of GraphAF and GraphDF that consider formal charge (GraphAF+FC and GraphDF+FC) for a fair comparison with the baselines and ours. For GDSS, the choice of the diffusion process and the solver is identical to that of the generic graph generation tasks. We provide further details of the baselines and GDSS in Appendix C.3. + +Results As shown in Table 2, GDSS achieves the highest validity when the post-hoc valency correction is disabled, demonstrating that GDSS is able to proficiently learn the chemical valency rule that requires capturing the node-edge relationship. Moreover, GDSS significantly outperforms all the baselines in NSPDK MMD and most of the baselines in FCD, showing that the generated molecules of GDSS lie close to the data distribution both in the space of graphs and the chemical space. The superior performance of GDSS on molecule generation tasks verifies the effectiveness of our method for learning the underlying distribution of graphs with multiple node and edge types. We further visualize the generated molecules in Figure 4 and Figure 10 of Ap- + +Table 3: Generation results of EDP-GNN using GMH. + +
MethodCommunity-smallEnzymes
Deg.Clus.OrbitDeg.Clus.Orbit
EDP-GNN0.0530.1440.0260.0230.2680.082
EDP-GNN w/ GMH0.0330.1300.0350.0470.3280.051
GDSS (Ours)0.0450.0860.0070.0260.0610.009
+ +pendix E.2, which demonstrate that GDSS is capable of generating molecules that share a large substructure with the molecules in the training set, whereas the generated molecules of the baselines share a smaller structural portion or even completely differ from the training molecules. + +Time Efficiency To validate the practicality of GDSS, we compare the inference time for generating molecules with the baselines. As shown in Table 2, GDSS not only outperforms the autoregressive models in terms of the generation quality, but also in terms of time efficiency showing $450 \times$ speed up on QM9 datasets compared to GraphDF. Moreover, GDSS and GDSS-seq require significantly smaller generation time compared to EDP-GNN, showing that modeling the transformation of graphs to noise and vice-versa as a continuous-time diffusion process is far more efficient than the discrete-step noise perturbation used in EDP-GNN. + +# 4.3. Ablation Studies + +We provide an extensive analysis of the proposed GDSS framework from three different perspectives: (1) The necessity of modeling the dependency between $\mathbf{X}$ and $\mathbf{A}$ , (2) effectiveness of S4 compared to other solvers, and (3) further comparison with the variants of EDP-GNN and GDSS. + +Necessity of Dependency Modeling To validate that modeling the node-edge dependency is crucial for graph generation, we compare our proposed methods GDSS and GDSS-seq, since the only difference is that the latter only models the dependency of $A$ on $X$ (Eq. (3) and Eq. (4)). From the results in Table 1 and Table 2, we observe that GDSS constantly outperforms GDSS-seq in all metrics, which proves that accurately learning the distributions of graphs requires modeling the dependency. Moreover, for molecule generation, the node-edge dependency can be directly measured in terms of validity, and the results verify the effectiveness of GDSS modeling the dependency via the system of SDEs. + +Significance of S4 Solver To validate the effectiveness of the proposed S4 solver, we compare its performance against the non-adaptive stepsize solvers, namely EM and Reverse sampler which are predictor-only methods, and the PC samplers using Langevin MCMC. As shown in the table of Figure 3, S4 significantly outperforms the predictor-only methods, and further outperforms the PC samplers with half the computation time, due to fewer evaluations of the score-based models. We provide more results in Appendix D.3. + +Table 4: Generation results of the variants of GDSS. + +
MethodZINC250k
Val. w/o corr. (%)NSPDKFCDTime (s)
GDSS-discrete53.210.04522.9256.07e3
GDSS w/ GMH in stθ,t94.390.01512.3882.44e3
GDSS97.010.01914.6562.02e3
+ +Variants of EDP-GNN and GDSS First, to comprehensively compare EDP-GNN with GDSS, we evaluate the performance of EDP-GNN with GMH layers instead of simple GNN layers. Table 3 shows that using GMH does not necessarily increase the generation quality, and is still significantly outperformed by our GDSS. Moreover, to verify that the continuous-time diffusion process of GDSS is essential, we compare the performance of the GDSS variants. Table 4 shows that GDSS-discrete, which is our GDSS using discrete-step perturbation as in EDP-GNN instead of the diffusion process, performs poorly on molecule generation tasks with an increased generation time, which reaffirms the significance of the proposed diffusion process for graphs. Furthermore, using GMH instead of GNN for the score-based model $s_{\theta,t}$ shows comparable results with GDSS. + +# 5. Conclusion + +We presented a novel score-based generative framework for learning the underlying distribution of the graphs, which overcomes the limitations of previous graph generative methods. Specifically, we proposed a novel graph diffusion process via the system of SDEs (GDSS) that transforms both the node features and adjacency to noise and vice-versa, modeling the dependency between them. Further, we derived new training objectives to estimate the gradients of the joint log-density with respect to each component, and presented a novel integrator to efficiently solve the system of SDEs describing the reverse diffusion process. We validated GDSS on the generation of diverse synthetic and real-world graphs including molecules, on which ours outperforms existing generative methods. We pointed out that modeling the dependency between nodes and edges is crucial for learning the distribution of graphs and shed new light on the effectiveness of score-based generative methods for graphs. + +Acknowledgements This work was supported by Institute of Information & communications Technology Planning & Evaluation (IITP) grant funded by the Korea government(MSIT) (No. 2021-0-02068, Artificial Intelligence Innovation Hub and No.2019-0-00075, Artificial Intelligence Graduate School Program(KAIST)), and the Engineering Research Center Program through the National Research Foundation of Korea (NRF) funded by the Korean Government MSIT (NRF-2018R1A5A1059921). We thank Geon Park for providing the visualization of diffusion in Figure 1, and Jincheon Baek for the suggestions for the experiments. + +# References + +Anderson, B. D. Reverse-time diffusion equation models. Stochastic Processes and their Applications, 12(3):313-326, 1982. +Baek, J., Kang, M., and Hwang, S. J. Accurate learning of graph representations with graph multiset pooling. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021. +Brockschmidt, M., Allamanis, M., Gaunt, A. L., and Polozov, O. Generative code modeling with graphs. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019, 2019. +Cai, R., Yang, G., Averbuch-Elor, H., Hao, Z., Belongie, S. J., Snavely, N., and Hariharan, B. Learning gradient fields for shape generation. In ECCV, 2020. +Chen, N., Zhang, Y., Zen, H., Weiss, R. J., Norouzi, M., and Chan, W. Wavegrad: Estimating gradients for waveform generation. In ICLR, 2021. +Costa, F. and De Grave, K. Fast neighborhood subgraph pairwise distance kernel. In Proceedings of the 26th International Conference on Machine Learning, pp. 255-262. Omnipress; Madison, WI, USA, 2010. +Dai, H., Nazi, A., Li, Y., Dai, B., and Schuurmans, D. Scalable deep generative modeling for sparse graphs. In International Conference on Machine Learning, pp. 2302-2312. PMLR, 2020. +De Cao, N. and Kipf, T. Molgan: An implicit generative model for small molecular graphs. ICML 2018 workshop on Theoretical Foundations and Applications of Deep Generative Models, 2018. +Dhariwal, P. and Nichol, A. Diffusion models beat gans on image synthesis. arXiv:2105.05233, 2021. +Dockhorn, T., Vahdat, A., and Kreis, K. Score-based generative modeling with critically-damped Langevin diffusion. arXiv:2112.07068, 2021. +Grover, A., Zweig, A., and Ermon, S. Graphite: Iterative generative modeling of graphs. In Proceedings of the 36th International Conference on Machine Learning, ICML 2019, 9-15 June 2019, Long Beach, California, USA, volume 97 of Proceedings of Machine Learning Research, pp. 2434-2444. PMLR, 2019. +Ho, J., Jain, A., and Abbeel, P. Denoising diffusion probabilistic models. In NeurIPS, 2020. +Hyvarinen, A. Estimation of non-normalized statistical models by score matching. J. Mach. Learn. Res., 6:695-709, 2005. + +Irwin, J. J., Sterling, T., Mysinger, M. M., Bolstad, E. S., and Coleman, R. G. Zinc: a free tool to discover chemistry for biology. Journal of chemical information and modeling, 52(7):1757-1768, 2012. +Jeong, M., Kim, H., Cheon, S. J., Choi, B. J., and Kim, N. S. Diff-tts: A denoising diffusion model for text-to-speech. arXiv:2104.01409, 2021. +Jin, W., Barzilay, R., and Jaakkola, T. Junction tree variational autoencoder for molecular graph generation. In International Conference on Machine Learning, pp. 2323-2332. PMLR, 2018. +Jin, W., Barzilay, R., and Jaakkola, T. Hierarchical generation of molecular graphs using structural motifs. In International Conference on Machine Learning, pp. 4839-4848. PMLR, 2020. +Keriven, N. and Peyre, G. Universal invariant and equivariant graph neural 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. 7090-7099, 2019. +Kong, Z., Ping, W., Huang, J., Zhao, K., and Catanzaro, B. Diffwave: A versatile diffusion model for audio synthesis. In ICLR, 2021. +Landrum, G. et al. Rdkit: Open-source cheminformatics software, 2016. URL http://www.rdkit.org/, https://github.com/rdkit/rdkit, 2016. +Lee, H., Hyung, E., and Hwang, S. J. Rapid neural architecture search by learning to generate graphs from datasets. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, 2021. +Li, Y., Vinyals, O., Dyer, C., Pascanu, R., and Battaglia, P. W. Learning deep generative models of graphs. arXiv:1803.03324, 2018a. +Li, Y., Zhang, L., and Liu, Z. Multi-objective de novo drug design with conditional graph generative model. J. Cheminformatics, 10(1):33:1-33:24, 2018b. +Li, Y., Zhang, L., and Liu, Z. Multi-objective de novo drug design with conditional graph generative model. J. Cheminformatics, 10(1):33:1-33:24, 2018c. +Liao, R., Li, Y., Song, Y., Wang, S., Hamilton, W., Duvenaud, D. K., Urtasun, R., and Zemel, R. Efficient graph generation with graph recurrent attention networks. Advances in Neural Information Processing Systems, 32: 4255-4265, 2019. +Liu, J., Kumar, A., Ba, J., Kiros, J., and Swersky, K. Graph normalizing flows. In NeurIPS, 2019. + +Liu, M., Luo, Y., Wang, L., Xie, Y., Yuan, H., Gui, S., Yu, H., Xu, Z., Zhang, J., Liu, Y., Yan, K., Liu, H., Fu, C., Oztekin, B. M., Zhang, X., and Ji, S. DIG: A turnkey library for diving into graph deep learning research. Journal of Machine Learning Research, 22(240):1-9, 2021a. +Liu, M., Yan, K., Oztekin, B., and Ji, S. Graphebm: Molecular graph generation with energy-based models. In Energy Based Models Workshop-ICLR 2021, 2021b. +Luo, S. and Hu, W. Diffusion probabilistic models for 3d point cloud generation. In CVPR, 2021. +Luo, Y., Yan, K., and Ji, S. Graphdf: A discrete flow model for molecular graph generation. International Conference on Machine Learning, 2021. +Ma, T., Chen, J., and Xiao, C. Constrained generation of semantically valid graphs via regularizing variational autoencoders. Advances in Neural Information Processing Systems, 31:7113-7124, 2018. +Madhawa, K., Ishiguro, K., Nakago, K., and Abe, M. Graph-nvp: An invertible flow model for generating molecular graphs. arXiv preprint arXiv:1905.11600, 2019. +Mittal, G., Engel, J. H., Hawthorne, C., and Simon, I. Symbolic music generation with diffusion models. In ISMIR, 2021. +Neal, R. Mcmc using hamiltonian dynamics. Handbook of Markov Chain Monte Carlo, 06 2012. +Niu, C., Song, Y., Song, J., Zhao, S., Grover, A., and Ermon, S. Permutation invariant graph generation via score-based generative modeling. In AISTATS, 2020. +O'Bray, L., Horn, M., Rieck, B., and Borgwardt, K. M. Evaluation metrics for graph generative models: Problems, pitfalls, and practical solutions. arXiv:2106.01098, 2021. +Parisi, G. Correlation functions and computer simulations. *Nuclear Physics B*, 180(3):378-384, 1981. +Paszke, A., Gross, S., Massa, F., Lerer, A., Bradbury, J., Chanan, G., Killeen, T., Lin, Z., Gimelshein, N., Antiga, L., Desmaison, A., Kopf, A., Yang, E., DeVito, Z., Raison, M., Tejani, A., Chilamkurthy, S., Steiner, B., Fang, L., Bai, J., and Chintala, S. Pytorch: An imperative style, high-performance deep learning library. In Advances in Neural Information Processing Systems 32, pp. 8024-8035. Curran Associates, Inc., 2019. +Popova, M., Shvets, M., Oliva, J., and Isayev, O. Molecular-rnn: Generating realistic molecular graphs with optimized properties. arXiv preprint arXiv:1905.13372, 2019. + +Preuer, K., Renz, P., Unterthiner, T., Hochreiter, S., and Klambauer, G. Fréchet chemnet distance: a metric for generative models for molecules in drug discovery. Journal of chemical information and modeling, 58(9):1736-1741, 2018. +Ramakrishnan, R., Dral, P. O., Rupp, M., and Von Lilienfeld, O. A. Quantum chemistry structures and properties of 134 kilo molecules. Scientific data, 1(1):1-7, 2014. +Schomburg, I., Chang, A., Ebeling, C., Gremse, M., Heldt, C., Huhn, G., and Schomburg, D. Brenda, the enzyme database: updates and major new developments. *Nucleic Acids Res.*, 32(Database-Issue):431-433, 2004. +Sen, P., Namata, G. M., Bilgic, M., Getoor, L., Gallagher, B., and Eliassi-Rad, T. Collective classification in network data. AI Magazine, 29(3):93-106, 2008. +Shi, C., Xu, M., Zhu, Z., Zhang, W., Zhang, M., and Tang, J. Graphaf: a flow-based autoregressive model for molecular graph generation. In International Conference on Learning Representations, 2020. +Simonovsky, M. and Komodakis, N. Graphvae: Towards generation of small graphs using variational autoencoders. In ICANN, 2018. +Song, J., Meng, C., and Ermon, S. Denoising diffusion implicit models. In ICLR, 2021a. +Song, Y. and Ermon, S. Generative modeling by estimating gradients of the data distribution. In NeurIPS, 2019. +Song, Y. and Ermon, S. Improved techniques for training score-based generative models. In NeurIPS, 2020. +Song, Y., Sohl-Dickstein, J., Kingma, D. P., Kumar, A., Ermon, S., and Poole, B. Score-based generative modeling through stochastic differential equations. In ICLR, 2021b. +Strang, G. On the construction and comparison of difference schemes. SIAM Journal on Numerical Analysis, 5:506-517, 1968. +Särkkä, S. and Solin, A. Applied Stochastic Differential Equations. Institute of Mathematical Statistics Textbooks. Cambridge University Press, 2019. +Trotter, H. F. On the product of semi-groups of operators. In Proceedings of the American Mathematical Society, 1959. +Vahdat, A., Kreis, K., and Kautz, J. Score-based generative modeling in latent space. arXiv:2106.05931, 2021. +Vincent, P. A Connection Between Score Matching and Denoising Autoencoders. Neural Computation, 23(7): 1661-1674, 07 2011. + +Wang, H., Wang, J., Wang, J., Zhao, M., Zhang, W., Zhang, F., Xie, X., and Guo, M. Graphgan: Graph representation learning with generative adversarial nets. In AAAI, 2018. +Xie, S., Kirillov, A., Girshick, R. B., and He, K. Exploring randomly wired neural networks for image recognition. In 2019 IEEE/CVF International Conference on Computer Vision, ICCV 2019, Seoul, Korea (South), October 27 - November 2, 2019, pp. 1284-1293. IEEE, 2019. +You, J., Liu, B., Ying, R., Pande, V., and Leskovec, J. Graph convolutional policy network for goal-directed molecular graph generation. In Proceedings of the 32nd International Conference on Neural Information Processing Systems, pp. 6412-6422, 2018a. +You, J., Ying, R., Ren, X., Hamilton, W., and Leskovec, J. Graphnn: Generating realistic graphs with deep autoregressive models. In International conference on machine learning, pp. 5708-5717. PMLR, 2018b. +Zang, C. and Wang, F. Moflow: an invertible flow model for generating molecular graphs. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 617-626, 2020. + +# Appendix + +Organization The appendix is organized as follows: We first present the derivations excluded from the main paper due to space limitation in Section A, and explain the details of the proposed score-based graph generation framework in Section B. Then we provide the experimental details including the hyperparameters of the toy experiment, the generic graph generation, and the molecule generation in Section C. Finally, we present additional experimental results and the visualizations of the generated graphs in Section D. + +# A. Derivations + +In this section, we present the detailed derivations of the proposed training objectives described in Section 3.2 and the derivations of our novel S4 solver explained in Section 3.3. + +# A.1. Deriving the Denoising Score Matching Objectives + +The original score matching objective can be written as follows: + +$$ +\left. \mathbb {E} _ {\boldsymbol {G} _ {t}} \left\| \boldsymbol {s} _ {\theta} (\boldsymbol {G} _ {t}, t) - \nabla_ {\boldsymbol {X} _ {t}} \log p _ {t} (\boldsymbol {G} _ {t}) \right\| _ {2} ^ {2} = \mathbb {E} _ {\boldsymbol {G} _ {t}} \left\| \boldsymbol {s} _ {\theta} (\boldsymbol {G} _ {t}, t) \right\| _ {2} ^ {2} - 2 \mathbb {E} _ {\boldsymbol {G} _ {t}} \left\langle \boldsymbol {s} _ {\theta}, \nabla_ {\boldsymbol {X} _ {t}} \log p _ {t} (\boldsymbol {G} _ {t}) \right\rangle + C _ {1}, \right. \tag {12} +$$ + +where $C_1$ is a constant that does not depend on $\theta$ . Further, the denoising score matching objective can be written as follows: + +$$ +\begin{array}{l} \left. \mathbb {E} _ {\boldsymbol {G} _ {0}} \mathbb {E} _ {\boldsymbol {G} _ {t} | \boldsymbol {G} _ {0}} \left\| \boldsymbol {s} _ {\theta} (\boldsymbol {G} _ {t}, t) - \nabla_ {\boldsymbol {X} _ {t}} \log p _ {t} (\boldsymbol {G} _ {t} | \boldsymbol {G} _ {0}) \right\| _ {2} ^ {2} = \mathbb {E} _ {\boldsymbol {G} _ {0}} \mathbb {E} _ {\boldsymbol {G} _ {t} | \boldsymbol {G} _ {0}} \left\| \boldsymbol {s} _ {\theta} (\boldsymbol {G} _ {t}, t) \right\| _ {2} ^ {2} \right. \tag {13} \\ - 2 \mathbb {E} _ {\boldsymbol {G} _ {0}} \mathbb {E} _ {\boldsymbol {G} _ {t} | \boldsymbol {G} _ {0}} \left\langle \boldsymbol {s} _ {\theta}, \nabla_ {\boldsymbol {X} _ {t}} \log p _ {t} (\boldsymbol {G} _ {t} | \boldsymbol {G} _ {0}) \right\rangle + C _ {2}, \\ \end{array} +$$ + +where $C_2$ is also a constant that does not depend on $\theta$ . From the following equivalence, + +$$ +\begin{array}{l} \mathbb {E} _ {\boldsymbol {G} _ {t}} \left\langle \boldsymbol {s} _ {\theta}, \nabla_ {\boldsymbol {X} _ {t}} \log p _ {t} (\boldsymbol {G} _ {t}) \right\rangle = \int_ {\boldsymbol {G} _ {t}} p (\boldsymbol {G} _ {t}) \left\langle \boldsymbol {s} _ {\theta}, \nabla_ {\boldsymbol {X} _ {t}} \log p _ {t} (\boldsymbol {G} _ {t}) \right\rangle \mathrm {d} \boldsymbol {G} _ {t} \\ = \int_ {\boldsymbol {G} _ {t}} \left\langle \boldsymbol {s} _ {\theta}, \nabla_ {\boldsymbol {X} _ {t}} p _ {t} (\boldsymbol {G} _ {t}) \right\rangle \mathrm {d} \boldsymbol {G} _ {t} \\ = \int_ {\boldsymbol {G} _ {t}} \left\langle \boldsymbol {s} _ {\theta}, \nabla_ {\boldsymbol {X} _ {t}} \int_ {\boldsymbol {G} _ {0}} p (\boldsymbol {G} _ {0}) p _ {t} (\boldsymbol {G} _ {t} | \boldsymbol {G} _ {0}) \mathrm {d} \boldsymbol {G} _ {0} \right\rangle \mathrm {d} \boldsymbol {G} _ {t} \\ = \int_ {\boldsymbol {G} _ {t}} \left\langle \boldsymbol {s} _ {\theta}, \nabla_ {\boldsymbol {X} _ {t}} \int_ {\boldsymbol {G} _ {0}} p (\boldsymbol {G} _ {0}) p _ {t} (\boldsymbol {G} _ {t} | \boldsymbol {G} _ {0}) \mathrm {d} \boldsymbol {G} _ {0} \right\rangle \mathrm {d} \boldsymbol {G} _ {t} \\ = \int_ {\boldsymbol {G} _ {t}} \left\langle \boldsymbol {s} _ {\theta}, \int_ {\boldsymbol {G} _ {0}} p (\boldsymbol {G} _ {0}) \nabla_ {\boldsymbol {X} _ {t}} p _ {t} (\boldsymbol {G} _ {t} | \boldsymbol {G} _ {0}) \mathrm {d} \boldsymbol {G} _ {0} \right\rangle \mathrm {d} \boldsymbol {G} _ {t} \\ = \int_ {\boldsymbol {G} _ {t}} \int_ {\boldsymbol {G} _ {0}} p (\boldsymbol {G} _ {0}) p (\boldsymbol {G} _ {t} | \boldsymbol {G} _ {0}) \left\langle \boldsymbol {s} _ {\theta}, \nabla_ {\boldsymbol {X} _ {t}} \log p _ {t} (\boldsymbol {G} _ {t} | \boldsymbol {G} _ {0}) \right\rangle \mathrm {d} \boldsymbol {G} _ {0} \mathrm {d} \boldsymbol {G} _ {t} \\ = \mathbb {E} _ {\boldsymbol {G} _ {0}} \mathbb {E} _ {\boldsymbol {G} _ {t} | \boldsymbol {G} _ {0}} \left\langle \boldsymbol {s} _ {\theta}, \nabla_ {\boldsymbol {X} _ {t}} \log p _ {t} (\boldsymbol {G} _ {t} | \boldsymbol {G} _ {0}) \right\rangle , \\ \end{array} +$$ + +we can conclude that the two objectives are equivalent with respect to $\theta$ : + +$$ +\mathbb {E} _ {\boldsymbol {G} _ {0}} \mathbb {E} _ {\boldsymbol {G} _ {t} | \boldsymbol {G} _ {0}} \left\| \boldsymbol {s} _ {\theta} (\boldsymbol {G} _ {t}, t) - \nabla_ {\boldsymbol {X} _ {t}} \log p _ {t} (\boldsymbol {G} _ {t} | \boldsymbol {G} _ {0}) \right\| _ {2} ^ {2} = \mathbb {E} _ {\boldsymbol {G} _ {t}} \left\| \boldsymbol {s} _ {\theta} (\boldsymbol {G} _ {t}, t) - \nabla_ {\boldsymbol {X} _ {t}} \log p _ {t} (\boldsymbol {G} _ {t}) \right\| _ {2} ^ {2} + C _ {2} - C _ {1}. \tag {14} +$$ + +Similarly, computing the gradient with respect to $\mathbf{A}_t$ , we can show that the following two objectives are also equivalent with respect to $\phi$ : + +$$ +\left. \mathbb {E} _ {\boldsymbol {G} _ {0}} \mathbb {E} _ {\boldsymbol {G} _ {t} \mid \boldsymbol {G} _ {0}} \left\| \boldsymbol {s} _ {\phi} (\boldsymbol {G} _ {t}, t) - \nabla_ {\boldsymbol {A} _ {t}} \log p _ {t} (\boldsymbol {G} _ {t} \mid \boldsymbol {G} _ {0}) \right\| _ {2} ^ {2} = \mathbb {E} _ {\boldsymbol {G} _ {t}} \left\| \boldsymbol {s} _ {\phi} (\boldsymbol {G} _ {t}, t) - \nabla_ {\boldsymbol {A} _ {t}} \log p _ {t} (\boldsymbol {G} _ {t}) \right\| _ {2} ^ {2} + C _ {4} - C _ {3}, \right. \tag {15} +$$ + +where $C_3$ and $C_4$ are constants that does not depend on $\phi$ . + +# A.2. Deriving New Objectives for GDSS + +It is enough to show that $\nabla_{\mathbf{X}_t}\log p_{0t}(\mathbf{G}_t|\mathbf{G}_0)$ is equal to $\nabla_{\mathbf{X}_t}\log p_{0t}(\mathbf{X}_t|\mathbf{X}_0)$ . Using the chain rule, we can derive that $\nabla_{\mathbf{X}_t}\log p_{0t}(\mathbf{A}_t|\mathbf{A}_0) = 0$ : + +$$ +\frac {\partial \log p _ {0 t} (\boldsymbol {A} _ {t} | \boldsymbol {A} _ {0})}{\partial (\boldsymbol {X} _ {t}) _ {i j}} = \operatorname {T r} \left[ \nabla_ {\boldsymbol {A} _ {t}} \log p _ {0 t} (\boldsymbol {A} _ {t} | \boldsymbol {A} _ {0}) \underbrace {\frac {\partial \boldsymbol {A} _ {t}}{\partial (\boldsymbol {X} _ {t}) _ {i j}}} _ {= 0} \right] = 0, \tag {16} +$$ + +Therefore, we can conclude that $\nabla_{\pmb{X}_t}\log p_{0t}(\pmb {G}_t|\pmb {G}_0)$ is equal to $\nabla_{\pmb{X}_t}\log p_{0t}(\pmb {X}_t|\pmb {X}_0)$ + +$$ +\nabla_ {\boldsymbol {X} _ {t}} \log p _ {0 t} (\boldsymbol {G} _ {t} | \boldsymbol {G} _ {0}) = \nabla_ {\boldsymbol {X} _ {t}} \log p _ {0 t} (\boldsymbol {X} _ {t} | \boldsymbol {X} _ {0}) + \underbrace {\nabla_ {\boldsymbol {X} _ {t}} \log p _ {0 t} (\boldsymbol {A} _ {t} | \boldsymbol {A} _ {0})} _ {= 0} = \nabla_ {\boldsymbol {X} _ {t}} \log p _ {0 t} (\boldsymbol {X} _ {t} | \boldsymbol {X} _ {0}). \tag {17} +$$ + +Similarly, computing the gradient with respect to $\mathbf{A}_t$ , we can also show that $\nabla_{\mathbf{A}_t} \log p_{0t}(\mathbf{G}_t | \mathbf{G}_0)$ is equal to $\nabla_{\mathbf{A}_t} \log p_{0t}(\mathbf{A}_t | \mathbf{A}_0)$ . + +# A.3. The Action of the Fokker-Planck Operators and the Classical Propagator + +Fokker-Planck Operators Recall the system of reverse-time SDEs of Eq. (10): + +$$ +\left\{ \begin{array}{l} \mathrm {d} \boldsymbol {X} _ {t} = \mathbf {f} _ {1, t} \left(\boldsymbol {X} _ {t}\right) \mathrm {d} \bar {t} + g _ {1, t} \mathrm {d} \bar {\mathbf {w}} _ {1} \\ \mathrm {d} \boldsymbol {A} _ {t} = \underbrace {\mathbf {f} _ {2 , t} \left(\boldsymbol {A} _ {t}\right) \mathrm {d} \bar {t} + g _ {2 , t} \mathrm {d} \bar {\mathbf {w}} _ {2}} _ {F} \underbrace {- g _ {2 , t} ^ {2} \mathbf {s} _ {\theta , t} \left(\boldsymbol {X} _ {t} , \boldsymbol {A} _ {t}\right) \mathrm {d} \bar {t}} _ {S}, \end{array} \right. \tag {18} +$$ + +Denoting the marginal joint distribution of Eq. (18) at time $t$ as $\tilde{p}_t(\mathbf{G}_t)$ , the evolution of $\tilde{p}_t$ through time $t$ can be described by a partial differential equation, namely Fokker-Planck equation, as follows: + +$$ +\frac {\partial \tilde {p} _ {t} (\boldsymbol {G} _ {t})}{\partial t} = - \nabla_ {\boldsymbol {G} _ {t}} \cdot \left(\mathbf {f} _ {t} (\boldsymbol {G} _ {t}) \tilde {p} _ {t} (\boldsymbol {G} _ {t}) - \frac {1}{2} g _ {t} ^ {2} \tilde {p} _ {t} (\boldsymbol {G} _ {t}) \nabla_ {\boldsymbol {G} _ {t}} \log \tilde {p} _ {t} (\boldsymbol {G} _ {t}) - g _ {t} ^ {2} \boldsymbol {s} _ {t} (\boldsymbol {G} _ {t}) \tilde {p} _ {t} (\boldsymbol {G} _ {t})\right), \tag {19} +$$ + +where $s_t(\pmb{G}_t) = (s_{\theta t}(\pmb{G}_t), s_{\phi, t}(\pmb{G}_t))$ . Then, the Fokker-Planck equation can be represented using the Fokker-Planck operators as follows: + +$$ +\frac {\partial \tilde {p} _ {t} (\boldsymbol {G} _ {t})}{\partial t} = \left(\hat {\mathcal {L}} _ {F} ^ {*} + \hat {\mathcal {L}} _ {S} ^ {*}\right) \tilde {p} _ {t} (\boldsymbol {G} _ {t}), \tag {20} +$$ + +where the action of the Fokker-Planck operators on the function $A(G_{t})$ is defined as: + +$$ +\hat {\mathcal {L}} _ {F} ^ {*} \boldsymbol {A} (\boldsymbol {G} _ {t}) := - \nabla_ {\boldsymbol {G} _ {t}} \cdot \left(\mathbf {f} _ {t} (\boldsymbol {G} _ {t}) \boldsymbol {A} (\boldsymbol {G} _ {t}) - \frac {1}{2} g _ {t} ^ {2} \boldsymbol {A} (\boldsymbol {G} _ {t}) \nabla_ {\boldsymbol {G} _ {t}} \log \boldsymbol {A} (\boldsymbol {G} _ {t})\right) \tag {21} +$$ + +$$ +\hat {\mathcal {L}} _ {S} ^ {*} \boldsymbol {A} (\boldsymbol {G} _ {t}) := - \nabla_ {\boldsymbol {G} _ {t}} \cdot \left(- g _ {t} ^ {2} \boldsymbol {s} _ {t} (\boldsymbol {G} _ {t}) \boldsymbol {A} (\boldsymbol {G} _ {t})\right). \tag {22} +$$ + +Classical Propagator From the Fokker-Planck equation of Eq. (20), we can derive an intractable solution $\bar{G}_t\coloneqq G_{T - t}$ to the system of reverse-time SDEs in Eq. (18) as follows: + +$$ +\bar {\boldsymbol {G}} _ {t} = e ^ {t \left(\hat {\mathcal {L}} _ {F} ^ {*} + \hat {\mathcal {L}} _ {S} ^ {*}\right)} \bar {\boldsymbol {G}} _ {0}, \tag {23} +$$ + +which is called the classical propagator. The action of the operator $e^{t(\hat{\mathcal{L}}_F^* +\hat{\mathcal{L}}_S^*)}$ propagates the initial states $\bar{G}_0$ to time $t$ following the dynamics determined by the action of Fokker-Planck operators $\hat{\mathcal{L}}_F^*$ and $\hat{\mathcal{L}}_S^*$ , described in Eq. (22). + +# A.4. Symmetric Splitting for the System of SDEs + +Let us take a look on each operator one by one. First, the action of the operator $\hat{\mathcal{L}}_F^*$ on the marginal distribution $\tilde{p}_t(G_t)$ corresponds to the diffusion process described by the $F$ -term in Eq. (18) as follows: + +$$ +\left\{ \begin{array}{l} \mathrm {d} \boldsymbol {X} _ {t} = \mathbf {f} _ {1, t} \left(\boldsymbol {X} _ {t}\right) \mathrm {d} \bar {t} + g _ {1, t} \mathrm {d} \bar {\mathbf {w}} _ {\mathbf {1}} \\ \mathrm {d} \boldsymbol {A} _ {t} = \mathbf {f} _ {2, t} \left(\boldsymbol {A} _ {t}\right) \mathrm {d} \bar {t} + g _ {2, t} \mathrm {d} \bar {\mathbf {w}} _ {\mathbf {2}} \end{array} , \right. \tag {24} +$$ + +# Algorithm 1 Symmetric Splitting for the System of SDEs (S4) + +Input: Score-based models $s_{\theta, t}$ and $s_{\phi, t}$ , number of sampling steps $M$ , step size $\delta t$ , transition distributions $p_{st}(\cdot|\cdot)$ of the forward diffusion in Eq. (1), Lagevin MCMC step size $\alpha$ , scaling coefficient $\epsilon_s$ + +# Output: $X_0$ , $A_0$ : the solution to Eq. (10) + +1: $t = T$ +2: Sample from the prior distribution $\mathbf{X}_M, \mathbf{A}_M \sim p_T$ +3: for $m = M - 1$ to 0 do +4: $S_{X}\gets s_{\theta ,t}(X_{m + 1},A_{m + 1})$ . $S_{A}\gets s_{\phi ,t}(X_{m + 1},A_{m + 1})$ ▷ score computation step +5: $X_{m + 1}\gets X_{m + 1} + \frac{\alpha}{2} S_X + \epsilon_s\sqrt{\alpha} z_X;\quad z_X\sim \mathcal{N}(\mathbf{0},I_X)$ +6: $A_{m + 1}\gets A_{m + 1} + \frac{\alpha}{2} S_A + \epsilon_s\sqrt{\alpha} z_A;\quad z_A\sim \mathcal{N}(\mathbf{0},I_A)$ +7: $t^{\prime}\gets t - \delta t / 2$ +8: $\tilde{\pmb{X}}_m\sim p_{t,t'}(\tilde{\pmb{X}}_m|\pmb{X}_{m + 1});\quad \tilde{\pmb{A}}_m\sim p_{t,t'}(\tilde{\pmb{A}}_m|\pmb{A}_{m + 1})$ +9: $\tilde{\pmb{X}}_m\gets \tilde{\pmb{X}}_m + g_{1,t}^2\pmb {S}_X\delta t;\quad \tilde{\pmb{A}}_m\gets \tilde{\pmb{A}}_m + g_{2,t}^2\pmb {S}_A\delta t$ $\triangleright$ prediction step: action of $e^{\delta t\hat{L}_S^*}$ +0: $t\gets t - \delta t$ +1: $X_{m}\sim p_{t^{\prime},t}(X_{m}|\tilde{X}_{m})$ . $\pmb {A}_m\sim p_{t',t}(\pmb {A}_m|\tilde{\pmb{A}}_m)$ +12: end for +13: Return: $X_0, A_0$ + +Notice that the diffusion process described by Eq. (24) is similar to the forward diffusion process of Eq. (1), with a slight difference that Eq. (24) is a system of reverse-time SDEs. Therefore, the action of the operator $e^{\frac{\delta t}{2}\hat{L}_F^*}$ can be represented by the transition distribution of the forward diffusion process $p_{st}(\cdot |\cdot)$ as follows: + +$$ +e ^ {\frac {\delta t}{2} \hat {\mathcal {L}} _ {F} ^ {*}} \boldsymbol {G} = \tilde {\boldsymbol {G}} \sim p _ {t, t - \delta t / 2} (\tilde {\boldsymbol {G}} | \boldsymbol {G}). \tag {25} +$$ + +We provide the explicit form of the transition distribution in Section A.5 of the Appendix. Furthermore, the operator $\hat{\mathcal{L}}_S^*$ corresponds to the evolution of $X_{t}$ and $A_{t}$ described by the $S$ -term in Eq. (18), which is a system of reverse-time ODEs: + +$$ +\left\{ \begin{array}{l} \boldsymbol {X} _ {t} = - g _ {1, t} ^ {2} \boldsymbol {s} _ {\theta , t} \left(\boldsymbol {X} _ {t}, \boldsymbol {A} _ {t}\right) \mathrm {d} \bar {t} \\ \boldsymbol {A} _ {t} = - g _ {2, t} ^ {2} \boldsymbol {s} _ {\phi , t} \left(\boldsymbol {X} _ {t}, \boldsymbol {A} _ {t}\right) \mathrm {d} \bar {t} \end{array} , \right. \tag {26} +$$ + +Hence, the action of the operator $e^{\delta t\mathcal{L}_S^*}$ can be approximated with the simple Euler method for a positive time step $\delta t$ : + +$$ +e ^ {\delta t \hat {\mathcal {L}} _ {S} ^ {*}} \boldsymbol {X} _ {t} \approx \boldsymbol {X} _ {t} + g _ {1, t} ^ {2} \boldsymbol {s} _ {\theta , t} (\boldsymbol {X} _ {t}, \boldsymbol {A} _ {t}) \delta t \tag {27} +$$ + +$$ +e ^ {\delta t \hat {\mathcal {L}} _ {S} ^ {*}} \boldsymbol {A} _ {t} \approx \boldsymbol {A} _ {t} + g _ {2, t} ^ {2} \boldsymbol {s} _ {\phi , t} (\boldsymbol {X} _ {t}, \boldsymbol {A} _ {t}) \delta t, +$$ + +which we refer to this approximated action as $e^{\delta t\mathcal{L}_S^{Euler}}$ . Using the symmetric Trotter theorem (Trotter, 1959), we can approximate the intractable solution $e^{t(\hat{\mathcal{L}}_F^* +\hat{\mathcal{L}}_S^*)}$ as follows (Dockhorn et al., 2021): + +$$ +\begin{array}{l} e ^ {t (\hat {\mathcal {L}} _ {F} ^ {*} + \hat {\mathcal {L}} _ {S} ^ {*})} \approx \left[ e ^ {\frac {\delta t}{2} \hat {\mathcal {L}} _ {F} ^ {*}} e ^ {\delta t \hat {\mathcal {L}} _ {S} ^ {*}} e ^ {\frac {\delta t}{2} \hat {\mathcal {L}} _ {F} ^ {*}} \right] ^ {M} + O (M \delta t ^ {3}) \\ = \left[ e ^ {\frac {\delta t}{2} \hat {\mathcal {L}} _ {F} ^ {*}} e ^ {\delta t \mathcal {L} _ {S} ^ {E u l e r}} e ^ {\frac {\delta t}{2} \hat {\mathcal {L}} _ {F} ^ {*}} \right] ^ {M} + M O (\delta t ^ {2}) (28) \\ = \left[ e ^ {\frac {\delta t}{2} \hat {\mathcal {L}} _ {F} ^ {*}} e ^ {\delta t \mathcal {L} _ {S} ^ {E u l e r}} e ^ {\frac {\delta t}{2} \hat {\mathcal {L}} _ {F} ^ {*}} \right] ^ {M} + O (\delta t), (29) \\ \end{array} +$$ + +for a sufficiently large number of steps $M$ and a time step $\delta t = t / M$ . Note that from Eq. (28) and Eq. (29), we can see that the prediction step of S4 has local error $\mathcal{O}(\delta t^2)$ and global error $\mathcal{O}(\delta t)$ . From the action of the Fokker-Planck operators and the result of Eq. (29), we can derive the prediction step of the S4 solver described in Section 3.3. We further provide the pseudo-code for the proposed S4 solver in Algorithm 1. + +# A.5. Derivation of the transition distribution + +We provide an explicit form of the transition distribution for two types of SDE, namely VPSDE and VESDE (Song et al., 2021b). We consider the transition distribution from time $t$ to $t - \delta t$ for sufficiently small time step $\delta t$ with $x_{t}$ given, and considering the input as discrete state corresponding to normal distribution with 0 variance. + +![](images/c86ee9ff491df188ddbd391cff8b4e2e37b19059ae5c29b5b74d475ceb140a3f.jpg) + +![](images/d38f5b82c0f7ed5a635b5557f70dacf91b671ea330358106eda9457a348c0222.jpg) +Figure 5: The architecture of the score-based models of GDSS. (Left) The score-based model $s_{\phi}$ estimating $\nabla_{A_t} \log p_t(\pmb{X}_t, \pmb{A}_t)$ is composed of GMH blocks and MLP layers. (Right) The score-based model $s_{\theta}$ estimating $\nabla_{\mathbf{X}_t} \log p_t(\pmb{X}_t, \pmb{A}_t)$ is composed of GCN layers and MLP layers. Both models take $\pmb{X}_t$ and $\pmb{A}_t$ as input and estimate the partial scores with respect to $\pmb{A}_t$ and $\pmb{X}_t$ , respectively. + +VPSDE The process of the VPSDE is given by the following SDE: + +$$ +\mathrm {d} \boldsymbol {x} = - \frac {1}{2} \beta_ {t} \boldsymbol {x} \mathrm {d} t + \sqrt {\beta_ {t}} \mathrm {d} \mathbf {w}, \tag {30} +$$ + +where $\beta_{t} = \beta_{min} + t(\beta_{max} - \beta_{min})$ for the hyperparameters $\beta_{min}$ and $\beta_{max}$ , and $t\in [0,1]$ . Since Eq. (30) has a linear drift coefficient, the transition distribution of the process is Gaussian, and the mean and covariance can be derived using the result of Eq.(5.50) and (5.51) of Särkkä & Solin (2019) as follows: + +$$ +p _ {t, t - \delta t} \left(\boldsymbol {x} _ {t - \delta t} \mid \boldsymbol {x} _ {t}\right) = \mathcal {N} \left(\boldsymbol {x} _ {t - \delta t} \mid \mu_ {t} \boldsymbol {x} _ {t}, \boldsymbol {\Sigma} _ {t}\right), \tag {31} +$$ + +where $\mu_t = e^{C_t}$ and $\pmb{\Sigma}_t = \pmb{I} - \pmb{I}e^{-2C_t}$ for + +$$ +C _ {t} = \frac {1}{2} \int_ {t - \delta t} ^ {t} \beta_ {s} \mathrm {d} s = \frac {\delta t}{4} \left(2 \beta_ {\min } + (2 t + \delta t) \left(\beta_ {\max } - \beta_ {\min }\right)\right). \tag {32} +$$ + +VESDE The process of the VESDE is given by the following SDE: + +$$ +\mathrm {d} \boldsymbol {x} = \sigma_ {\min } \left(\frac {\sigma_ {\max }}{\sigma_ {\min }}\right) ^ {t} \sqrt {2 \log \frac {\sigma_ {\max }}{\sigma_ {\min }}} \mathrm {d} \mathbf {w}, \tag {33} +$$ + +for the hyperparameters $\sigma_{min}$ and $\sigma_{max}$ , and $t\in (0,1]$ . Since Eq. (33) has a linear drift coefficient, the transition distribution of the process is Gaussian, and the mean and covariance can be derived using the result of Eq.(5.50) and (5.51) of Särkkä & Solin (2019) as follows: + +$$ +p _ {t, t - \delta t} \left(\boldsymbol {x} _ {t - \delta t} \mid \boldsymbol {x} _ {t}\right) = \mathcal {N} \left(\boldsymbol {x} _ {t - \delta t} \mid \boldsymbol {x} _ {t}, \boldsymbol {\Sigma} _ {\boldsymbol {t}}\right), \tag {34} +$$ + +where $\Sigma_{t} = \Sigma_{t}\pmb{I}$ is given as: + +$$ +\Sigma_ {t} = \sigma_ {m i n} ^ {2} \left(\frac {\sigma_ {m a x}}{\sigma_ {m i n}}\right) ^ {2 t} - \sigma_ {m i n} ^ {2} \left(\frac {\sigma_ {m a x}}{\sigma_ {m i n}}\right) ^ {2 t - 2 \delta t}. \tag {35} +$$ + +# B. Details for Score-based Graph Generation + +In this section, we describe the architectures of our proposed score-based models, and further provide the details of the graph generation procedure through the reverse-time diffusion process. + +# B.1. Score-based Model Architecture + +We illustrate the architecture of the proposed score models $s_{\theta, t}$ and $s_{\phi, t}$ in Figure 5, which are described in Section 3.2. + +Table 5: Hyperparameters of GDSS used in the generic graph generation tasks and the molecule generation tasks. We provide the hyperparameters of the score-based models ( $s_{\theta}$ and $s_{\phi}$ ), the diffusion processes (SDE for $X$ and $A$ ), the SDE solver, and the training. + +
HyperparameterEgo-smallCommunity-smallEnzymesGridQM9ZINC250k
sθNumber of GCN layers235522
Hidden dimension323232321616
sφNumber of attention heads444444
Number of initial channels222222
Number of hidden channels888888
Number of final channels444444
Number of GCN layers557736
Hidden dimension323232321616
SDE for XTypeVPVPVPVPVEVP
Number of sampling steps100010001000100010001000
βmin0.10.10.10.10.10.1
βmax1.01.01.01.01.01.0
SDE for ATypeVPVPVEVPVEVE
Number of sampling steps100010001000100010001000
βmin0.10.10.20.20.10.2
βmax1.01.01.00.81.01.0
SolverTypeEMEM + LangevinS4Rev. + LangevinRev. + LangevinRev. + Langevin
SNR-0.050.150.10.20.2
Scale coefficient-0.70.70.70.70.9
TrainOptimizerAdamAdamAdamAdamAdamAdam
Learning rate1 × 10-21 × 10-21 × 10-21 × 10-25 × 10-35 × 10-3
Weight decay1 × 10-41 × 10-41 × 10-41 × 10-41 × 10-41 × 10-4
Batch size12812864810241024
Number of epochs5000500050005000300500
EMA--0.9990.999--
+ +# B.2. Generating Samples from the Reverse Diffusion Process + +We first sample $N$ , the number of nodes to be generated from the empirical distribution of the number of nodes in the training dataset as done in Li et al. (2018b) and Niu et al. (2020). Then we sample the noise of batch size $B$ from the prior distribution, where $\mathbf{X}_T$ is of dimension $N\times F\times B$ and $\mathbf{A}_T$ is of dimension $N\times N\times B$ , and simulate the reverse-time system of SDEs in Eq. (10) to obtain the solution $\mathbf{X}_0$ and $\mathbf{A}_0$ . Lastly, we quantize $\mathbf{X}_0$ and $\mathbf{A}_0$ with the operation depending on the generation tasks. We provide further details of the generation procedure in Section C, including the hyperparameters. + +# C. Experimental Details + +In this section, we explain the details of the experiments including the toy experiments shown in Figure 2, the generic graph generation tasks, and the molecule generation tasks. We describe the implementation details of GDSS and the baselines, and further provide the hyperparameters used in the experiments in Table 5. + +# C.1. Toy Experiment + +Here, we provide the details for the toy experiment presented in Section 3.1. We construct the distribution of the data with bivariate Gaussian mixture with the mean and the covariance as follows: + +$$ +p _ {d a t a} (\mathbf {x}) = \mathcal {N} \left(\mathbf {x} \mid \mu_ {1}, \Sigma_ {1}\right) + \mathcal {N} \left(\mathbf {x} \mid \mu_ {2}, \Sigma_ {2}\right), \tag {36} +$$ + +$$ +\mu_ {1} = \left( \begin{array}{c} 0. 5 \\ 0. 5 \end{array} \right) , \mu_ {2} = \left( \begin{array}{c} - 0. 5 \\ - 0. 5 \end{array} \right) , \Sigma_ {1} = \Sigma_ {2} = 0. 1 ^ {2} \left( \begin{array}{c c} 1. 0 & 0. 9 \\ 0. 9 & 1. 0 \end{array} \right). +$$ + +For each diffusion method, namely GDSS, GDSS-seq, and independent diffusion, we train two models, where each model estimates the partial score or score with respect to the variable. We fix the number of linear layers in the model to 20 with the residual paths, and set the hidden dimension as 512. We use VPSDE for the diffusion process of each variable with $\beta_{min} = 0.01$ and $\beta_{max} = 0.05$ . We train the models for 5000 epochs with batch size 2048 sampled from the data distribution. We generate $2^{13}$ samples for each diffusion method, shown in Figure 2. + +Table 6: Statistics of QM9 and ZINC25ok datasets used in the molecule generation tasks. + +
DatasetNumber of graphsNumber of nodesNumber of node typesNumber of edge types
QM9133,8851 ≤ |V| ≤ 943
ZINC250k249,4556 ≤ |V| ≤ 3893
+ +# C.2. Generic Graph Generation + +The information and the statistics of the graph datasets, namely Ego-small, Community-small, Enzymes and Grid, are shown in Section 4.1 and Table 1. We carefully selected the datasets to have varying sizes and characteristics, for example synthetic graphs, real-world graphs, social graphs or biochemical graphs. + +Implementation Details For a fair evaluation of the generic graph generation task, we follow the standard setting of existing works (You et al., 2018b; Liu et al., 2019; Niu et al., 2020) from the node features to the data splitting. Especially, for Ego-small and Community-small datasets, we report the means of 15 runs, 3 different runs for 5 independently trained models. For Enzymes and Grid dataset, since the baselines including GraphVAE and EDP-GNN take more than 3 days for a single training, we report the means of 3 different runs. For the baselines, we use the hyperparameters given by the original work, and further search for the best performance if none exists. For GDSS, we initialize the node features as the one-hot encoding of the degrees. We perform the grid search to choose the best signal-to-noise ratio (SNR) in $\{0.05, 0.1, 0.15, 0.2\}$ and the scale coefficient in the $\{0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0\}$ . We select the best MMD with the lowest average of three graph statistics, degree, clustering coefficient, and orbit. Further, we observed that applying the exponential moving average (EMA) Song & Ermon (2020) for larger graph datasets, namely Enzymes and Grid, improves the performance and lowers the variance. After generating the samples by simulating the reverse diffusion process, we quantize the entries of the adjacency matrices with the operator $1_{x > 0.5}$ to obtain the 0-1 adjacency matrix. We empirically found that the entries of the resulting samples after the simulation of the diffusion process do not deviate much from the integer values 0 and 1. We report the hyperparameters used in the experiment in Table 5. + +# C.3. Molecule Generation + +The statistics of the molecular datasets, namely, QM9 and ZINC250k datasets, are summarized in Table 6. + +Implementation Details of GDSS and GDSS-seq Each molecule is preprocessed into a graph with the node features $X \in \{0,1\}^{N \times F}$ and the adjacency matrix $A \in \{0,1,2,3\}^{N \times N}$ , where $N$ is the maximum number of atoms in a molecule of the dataset, and $F$ is the number of possible atom types. The entries of $A$ indicate the bond types, i.e. single, double, or triple bonds. Following the standard procedure (Shi et al., 2020; Luo et al., 2021), the molecules are kekulized by the RDKit library (Landrum et al., 2016) and hydrogen atoms are removed. As explained in Section 4.2, we make use of the valency correction proposed by Zang & Wang (2020). We perform the grid search to choose the best signal-to-noise ratio (SNR) in $\{0.1,0.2\}$ and the scale coefficient in $\{0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0\}$ . Since the low novelty value leads to low FCD and NSPDK MMD values even though it is undesirable and meaningless, we choose the hyperparameters that exhibit the best FCD value among those which show the novelty that exceeds $85\%$ . After generating the samples by simulating the reverse diffusion process, we quantize the entries of the adjacency matrices to $\{0,1,2,3\}$ by clipping the values as: $(- \infty, 0.5)$ to 0, the values of $[0.5,1.5)$ to 1, the values of $[1.5,2.5)$ to 2, and the values of $[2.5, + \infty)$ to 3. We empirically observed that the entries of the resulting samples after the simulation of the diffusion process do not deviate much from the integer values 0, 1, 2, and 3. We report the hyperparameters used in the experiment in Table 5. + +Implementation Details of Baselines We utilize the DIG (Liu et al., 2021a) library to generate molecules with GraphDF and GraphEBM. To conduct the experiments with GraphAF, we use the DIG library for the QM9 dataset, and use the official code3 for the ZINC250k dataset. We use the official code4 for MoFlow. We follow the experimental settings reported in the respective original papers and the codes for these models. For EDP-GNN, we use the same preprocessing and postprocessing procedures as in GDSS and GDSS-seq, except that we divide the adjacency matrices by 3 to ensure the entries are in the range of [0, 1] before feeding them into the model. We conduct the grid search to choose the best size of the Langevin step in {0.01, 0.005, 0.001} and noise scale in {0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0}, and apply the same tuning criterion as in GDSS and GDSS-seq. + +Table 7: Generation results of GDSS on the Ego-small and the Community-small datasets. We report the MMD distance between the test datasets and generated graphs with the standard deviation. + +
Ego-smallCommunity-small
Real, 4 ≤ |V| ≤ 18Synthetic, 12 ≤ |V| ≤ 20
Deg.Clus.OrbitDeg.Clus.Orbit
GDSS-seq (Ours)0.032 ± 0.0060.027 ± 0.0050.011 ± 0.0070.090 ± 0.0210.123 ± 0.2000.007 ± 0.003
GDSS (Ours)0.021 ± 0.0080.024 ± 0.0070.007 ± 0.0050.045 ± 0.0280.086 ± 0.0220.007 ± 0.004
+ +Table 8: Generation results on the Enzymes and the Grid datasets. We report the MMD distance between the test datasets and generated graphs with the standard deviation. Best results are highlighted in bold (smaller the better). Hyphen (-) denotes out-of-resources that take more than 10 days or not applicable due to memory issue. * denotes our own implementation. + +
EnzymesGrid
Real, 10 ≤ |V| ≤ 125Synthetic, 100 ≤ |V| ≤ 400
Deg.Clus.OrbitDeg.Clus.Orbit
GraphRNN0.017 ± 0.0070.062 ± 0.0200.046 ± 0.0310.064 ± 0.0170.043 ± 0.0220.021 ± 0.007
GraphAF*1.669 ± 0.0241.283 ± 0.0190.266 ± 0.007---
GraphDF*1.503 ± 0.0111.061 ± 0.0110.202 ± 0.002---
GraphVAE*1.369 ± 0.0200.629 ± 0.0050.191 ± 0.0201.619 ± 0.0070.0 ± 0.0000.919 ± 0.002
EDP-GNN0.023 ± 0.0120.268 ± 0.1640.082 ± 0.0780.455 ± 0.3190.238 ± 0.3800.328 ± 0.278
GDSS-seq (Ours)0.099 ± 0.0830.225 ± 0.0510.010 ± 0.0070.171 ± 0.1340.011 ± 0.0010.223 ± 0.070
GDSS (Ours)0.026 ± 0.0080.061 ± 0.0100.009 ± 0.0050.111 ± 0.0120.005 ± 0.0000.070 ± 0.044
+ +# C.4. Computing Resources + +For all the experiments, we utilize PyTorch (Paszke et al., 2019) to implement GDSS and train the score models on TITAN XP, TITAN RTX, GeForce RTX 2080 Ti, and GeForce RTX 3090 GPU. For the generic graph generation tasks, the time comparison between the SDE solvers in Figure 3 was measured on 1 GeForce RTX 2080 Ti GPU and 40 CPU cores. For the molecule generation tasks, the inference time of each model is measured on 1 TITAN RTX GPU and 20 CPU cores. + +# D. Additional Experimental Results + +In this section, we provide additional experimental results. + +# D.1. Generic Graph Generation + +We report the standard deviation of the generation results of Table 1 in Table 7 and Table 8. + +For a fair evaluation of the generative methods, following You et al. (2018b), we have measured MMD between the test datasets and the set of generated graphs that have the same number of graphs as the test datasets. To further compare extensively with the baselines, following Liu et al. (2019); Niu et al. (2020), we provide the results of MMD measured between the test + +Table 9: Generation results of MMD using a larger number (1024) of samples. + +
Ego-smallCommunity-smallAvg.
Deg.Clus.OrbitDeg.Clus.Orbit
GraphRNN0.0400.0500.0600.0300.0100.0100.033
GNF0.0100.0300.0010.1200.1500.0200.055
EDP-GNN0.0100.0250.0030.0060.1270.0180.031
GDSS (Ours)0.0230.0200.0050.0290.0680.0040.030
+ +datasets and the set of 1024 generated graphs in Table 9. We can observe that GDSS still outperforms the baselines using a larger number of samples (1024) to measure the MMD, and significantly outperforms EDP-GNN. + +# D.2. Molecule Generation + +We additionally report the validity, uniqueness, and novelty of the generated molecules as well as the standard deviation of the results in Table 10 and Table 11. Validity is the fraction of the generated molecules that do not violate the chemical valency rule. Uniqueness is the fraction of the valid molecules that are unique. Novelty is the fraction of the valid molecules that are not included in the training set. + +Table 10: Generation results on the QM9 dataset. Results are the means and the standard deviations of 3 runs. Values denoted by * are taken from the respective original papers. Other results are obtained by running open-source codes. Best results are highlighted in bold. + +
MethodValidity w/o correction (%)↑NSPDK MMD↓FCD ↓Validity (%) ↑Uniqueness (%) ↑Novelty (%) ↑
Autoreg.GraphAF (Shi et al., 2020)67*0.020±0.0035.268±0.403100.00*94.51*88.83*
GraphAF+FC74.43±2.550.021±0.0035.625±0.259100.00±0.0088.64±2.3786.59±1.95
GraphDF (Luo et al., 2021)82.67*0.063±0.00110.816±0.020100.00*97.62*98.10*
GraphDF+FC93.88±4.760.064±0.00010.928±0.038100.00±0.0098.58±0.2598.54±0.48
One-shotMoFlow (Zang & Wang, 2020)91.36±1.230.017±0.0034.467±0.595100.00±0.0098.65±0.5794.72±0.77
EDP-GNN (Niu et al., 2020)47.52±3.600.005±0.0012.680±0.221100.00±0.0099.25±0.0586.58±1.85
GraphEBM (Liu et al., 2021b)8.22±2.240.030±0.0046.143±0.411100.00±0.00*97.90±0.14*97.01±0.17*
GDSS-seq (Ours)94.47±1.030.010±0.0014.004±0.166100.00±0.0094.62±1.4085.48±1.01
GDSS (Ours)95.72±1.940.003±0.0002.900±0.282100.00±0.0098.46±0.6186.27±2.29
+ +Table 11: Generation results on the ZINC250k dataset. Results are the means and the standard deviations of 3 runs. Values denoted by * are taken from the respective original papers. Other results are obtained by running open-source codes. Best results are marked as bold. + +
MethodValidity w/o correction (%)↑NSPDK MMD↓FCD ↓Validity (%) ↑Uniqueness (%) ↑Novelty (%) ↑
Autoreg.GraphAF (Shi et al., 2020)68*0.044±0.00616.289±0.482100.00*99.10*100.00*
GraphAF+FC68.47±0.990.044±0.00516.023±0.451100.00±0.0098.64±0.6999.99±0.01
GraphDF (Luo et al., 2021)89.03*0.176±0.00134.202±0.160100.00*99.16*100.00*
GraphDF+FC90.61±4.300.177±0.00133.546±0.150100.00±0.0099.63±0.01100.00±0.00
One-shotMoFlow (Zang & Wang, 2020)63.11±5.170.046±0.00220.931±0.184100.00±0.0099.99±0.01100.00±0.00
EDP-GNN (Niu et al., 2020)82.97±2.730.049±0.00616.737±1.300100.00±0.0099.79±0.08100.00±0.00
GraphEBM (Liu et al., 2021b)5.29±3.830.212±0.07535.471±5.33199.96±0.02*98.79±0.15*100.00±0.00*
GDSS-seq (Ours)92.39±2.720.030±0.00316.847±0.097100.00±0.0099.94±0.02100.00±0.00
GDSS (Ours)97.01±0.770.019±0.00114.656±0.680100.00±0.0099.64±0.13100.00±0.00
+ +Table 12: Comparison between fixed step size SDE solvers. We additionally provide the results of the proposed S4 solver on other datasets not included in the table of Figure 3. Best results are highlighted in bold (smaller the better). + +
SolverEgo-smallGridQM9ZINC250k
Deg.Clus.OrbitTime (s)Deg.Clus.OrbitTime (s)Val. w/o corr. (%)NSPDKFCDTime (s)Val. w/o corr. (%)NSPDKFCDTime (s)
EM0.0210.0240.00740.310.2780.0080.089235.3667.440.0164.80963.8715.920.08626.0491019.89
Reverse0.0320.0460.01041.550.2780.0080.089249.8669.320.0164.82365.2346.020.05221.4861021.09
EM + Langevin0.0320.0400.00978.170.1110.0050.070483.4793.980.0083.889111.4994.470.02515.2922020.87
Rev. + Langevin0.0320.0460.02177.820.1110.0050.070500.0195.720.0032.900114.5797.010.01914.6562020.06
S4 (Ours)0.0320.0440.00941.250.1250.0080.076256.2495.130.0032.77763.7895.520.02114.5371021.21
+ +# D.3. Ablation Studies + +In Table 12, we provide the full results of the table in Figure 3, which shows the comparison between the fixed step size SDE solvers on other datasets. As shown in Table 12, S4 significantly outperforms the predictor-only methods, and further shows competitive results compared to the PC samplers with half the computation time. + +# E. Visualization + +In this section, we additionally provide the visualizations of the generated graphs for the generic graph generation tasks and molecule generation tasks. + +# E.1. Generic Graph Generation + +We visualize the graphs from the training datasets and the generated graphs of GDSS for each datasets in Figure 6-9. The visualized graphs are the randomly selected samples from the training datasets and the generated graph set. We additionally provide the information of the number of edges $e$ and the number of nodes $n$ of each graph. + +# Ego small + +![](images/f349485a8981459a1d963b812d68e1ffbd5ffe47aa12137c2df12a6325b50765.jpg) +(a) Training Data + +![](images/00a866d48d4aafb7faefd027ca443e635ea1605ceba47db2c3a80e88f8c4c5b1.jpg) +(b) GDSS (Ours) +Figure 6: Visualization of the graphs from the Ego small dataset and the generated graphs of GDSS. + +# Community small + +![](images/99d59d92a64dfb2fd8ce4556349bf73e1ba8354880119657f21d9ca90d3e02c4.jpg) +(a) Training Data + +![](images/4749fe7a194ddb12c2b2006a2af59302db7128fca87c3deb651df40cde61bd3c.jpg) +(b) GDSS (Ours) +Figure 7: Visualization of the graphs from the Community small dataset and the generated graphs of GDSS. + +# ENZYMES + +![](images/400dbd7f869fff3a9d239be2cb5b5b9bed9dc0c95b454a6921b91fba4cd8744e.jpg) +(a) Training Data +Figure 8: Visualization of the graphs from the ENZYMES dataset and the generated graphs of GDSS. + +![](images/c0c62aa245cd414f66152bb946268d722122209074fa11634b8a14e83b684c1a.jpg) +(b) GDSS (Ours) + +![](images/2e8c6b3ca9c832940e22abc1a92c0eb89bd936c5611130f225f40f9ac60a2963.jpg) +Grid +(a) Training Data + +![](images/9ee1ee25426f2272bf32722385074697329da0ea02e39420a748d528f31aff18.jpg) +(b) GDSS (Ours) +Figure 9: Visualization of the graphs from the Grid dataset and the generated graphs of GDSS. + +# E.2. Molecule Generation + +We visualize the generated molecules that are maximally similar to certain training molecules in Figure 10. The similarity measure is the Tanimoto similarity based on the Morgan fingerprints, which are obtained by the RDKit (Landrum et al., 2016) library with radius 2 and 1024 bits. As shown in the figure, GDSS is able to generate molecules that are structurally close to the training molecules while other baselines generate molecules that deviate from the training distribution. + +![](images/c3dffb5bd567c852d42fd67e2036197d328c1f25bb203b84c7bc2d3b81989d49.jpg) +Figure 10: Visualization of generated molecules with maximum Tanimoto similarity with the molecule from the dataset. For each generated molecule, we display the similarity value at the bottom. \ No newline at end of file diff --git a/scorebasedgenerativemodelingofgraphsviathesystemofstochasticdifferentialequations/images.zip b/scorebasedgenerativemodelingofgraphsviathesystemofstochasticdifferentialequations/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..cfa8010a1d40a572641f7309c3efbeaaf1655ed8 --- /dev/null +++ b/scorebasedgenerativemodelingofgraphsviathesystemofstochasticdifferentialequations/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b27a9cdd8699cb2eef1e36976c38b06ca94ee2e2ae8a8a656b81b6eb855e3793 +size 1662483 diff --git a/scorebasedgenerativemodelingofgraphsviathesystemofstochasticdifferentialequations/layout.json b/scorebasedgenerativemodelingofgraphsviathesystemofstochasticdifferentialequations/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..39bb2eedee1878682f0749ee4dc54f40b926f7c3 --- /dev/null +++ b/scorebasedgenerativemodelingofgraphsviathesystemofstochasticdifferentialequations/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:222d7a477c6779f70f321a762f0430c8062ce529352f2d48e67b98d58ee3eeec +size 843719 diff --git a/scoreguidedintermediateleveloptimizationfastlangevinmixingforinverseproblems/a85ed27b-3268-4172-bf69-4277fcd8d19c_content_list.json b/scoreguidedintermediateleveloptimizationfastlangevinmixingforinverseproblems/a85ed27b-3268-4172-bf69-4277fcd8d19c_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..493da3166a1da38d51d659eb611bdbe7934b38f2 --- /dev/null +++ b/scoreguidedintermediateleveloptimizationfastlangevinmixingforinverseproblems/a85ed27b-3268-4172-bf69-4277fcd8d19c_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4625151a9443581691c42c6f45dd8851e8f253da1e53713891abbfff4e70402b +size 250830 diff --git a/scoreguidedintermediateleveloptimizationfastlangevinmixingforinverseproblems/a85ed27b-3268-4172-bf69-4277fcd8d19c_model.json b/scoreguidedintermediateleveloptimizationfastlangevinmixingforinverseproblems/a85ed27b-3268-4172-bf69-4277fcd8d19c_model.json new file mode 100644 index 0000000000000000000000000000000000000000..d9d37d0f5a82df14b59c8e2105283759a7415e51 --- /dev/null +++ b/scoreguidedintermediateleveloptimizationfastlangevinmixingforinverseproblems/a85ed27b-3268-4172-bf69-4277fcd8d19c_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f346dcffd36d57882bb85db7ae81d03af04822e3290a7c3a826c39b3d85b7edd +size 296905 diff --git a/scoreguidedintermediateleveloptimizationfastlangevinmixingforinverseproblems/a85ed27b-3268-4172-bf69-4277fcd8d19c_origin.pdf b/scoreguidedintermediateleveloptimizationfastlangevinmixingforinverseproblems/a85ed27b-3268-4172-bf69-4277fcd8d19c_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..1e92cd9a2eac422e55ea7493760d6fa6a314addb --- /dev/null +++ b/scoreguidedintermediateleveloptimizationfastlangevinmixingforinverseproblems/a85ed27b-3268-4172-bf69-4277fcd8d19c_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1cea0d35b9708717dbdd92b8c47b12f147aec118184d3651c7682a043e079a44 +size 13811618 diff --git a/scoreguidedintermediateleveloptimizationfastlangevinmixingforinverseproblems/full.md b/scoreguidedintermediateleveloptimizationfastlangevinmixingforinverseproblems/full.md new file mode 100644 index 0000000000000000000000000000000000000000..8217516e1eb6de0c09556926b7cd3b323334536d --- /dev/null +++ b/scoreguidedintermediateleveloptimizationfastlangevinmixingforinverseproblems/full.md @@ -0,0 +1,1462 @@ +# Score-Guided Intermediate Layer Optimization: Fast Langevin Mixing for Inverse Problems + +Giannis Daras $^{*1}$ Yuval Dagan $^{*2}$ Alexandros G. Dimakis $^{3}$ Constantinos Daskalakis $^{2}$ + +# Abstract + +We prove fast mixing and characterize the stationary distribution of the Langevin Algorithm for inverting random weighted DNN generators. This result extends the work of Hand and Voroninski from efficient inversion to efficient posterior sampling. In practice, to allow for increased expressivity, we propose to do posterior sampling in the latent space of a pre-trained generative model. To achieve that, we train a score-based model in the latent space of a StyleGAN-2 and we use it to solve inverse problems. Our framework, Score-Guided Intermediate Layer Optimization (SGILO), extends prior work by replacing the sparsity regularization with a generative prior in the intermediate layer. Experimentally, we obtain significant improvements over the previous state-of-the-art, especially in the low measurement regime. + +# 1. Introduction + +We are interested in solving inverse problems with generative priors, a family of unsupervised imaging algorithms initiated by Compressed Sensing with Generative Models (CSGM) (Bora et al., 2017). This framework has been successfully applied to numerous inverse problems including non-linear phase retrieval (Hand et al., 2018), improved MR imaging (Kelkar & Anastasio, 2021; Darestani et al., 2021) and 3-D geometry reconstruction from a single image (Chan et al., 2021; Lin et al., 2022; Daras et al., 2021a), etc. CSGM methods can leverage any generative model including GANs and VAEs as originally proposed (Bora et al., 2017), but also invertible flows (Asim et al., 2019) or + +*Equal contribution $^{1}$ Department of Computer Science University of Texas at Austin $^{2}$ MIT CSAIL $^{3}$ Department of Electrical and Computer Engineering +University of Texas at Austin. Correspondence to: Giannis Daras , Yuval Dagan , Alexandros G. Dimakis , Constantinos Daskalakis . + +Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s). + +even untrained generators (Heckel & Hand, 2018). + +One limitation of GAN priors when used for solving inverse problems is that the low-dimensionality of their latent space impedes the reconstruction of signals that lie outside their generation manifold. To mitigate this issue, sparse deviations were initially proposed in the pixel space (Dhar et al., 2018) and subsequently generalized to intermediate layers with Intermediate Layer Optimization (ILO) (Daras et al., 2021b). ILO extends the set of signals that can be reconstructed by allowing sparse deviations from the range of an intermediate layer of the generator. Regularizing intermediate layers is crucial when solving inverse problems to avoid overfitting to the measurements. In this work, we show that the sparsity prior is insufficient to prevent artifacts in challenging settings (e.g. inpainting with very few measurements, see Figure 1). + +Recently, two new classes of probabilistic generative models, Score-Based networks (Song & Ermon, 2019) and Denoising Diffusion Probabilistic Models (DDPM) (Ho et al., 2020) have also been successfully used to solve inverse problems (Nichol et al., 2021; Jalal et al., 2021a; Song et al., 2021a; Meng et al., 2021; Whang et al., 2021). Score-Based networks and DDPMs both gradually corrupt training data with noise and then learn to reverse that process, i.e. they learn to create data from noise. A unified framework has been proposed in the recent Song et al. (2021b) paper and the broader family of such models is widely known as Diffusion Models. Diffusion models have shown excellent performance for conditional and unconditional image generation (Ho et al., 2020; Dhariwal & Nichol, 2021; Song et al., 2021b; Karras et al., 2022; Ramesh et al., 2022; Saharia et al., 2022), many times outperforming GANs in image synthesis (Karras et al., 2019; 2020; Brock et al., 2019; Daras et al., 2020). + +Unlike MAP methods, such as CSGM and ILO, solving inverse problems with Score-Based networks and DDPMs corresponds (assuming mixing) to sampling from the posterior. Recent work showed that posterior sampling has several advantages including diversity, optimal measurement scaling (Jalal et al., 2020; Nguyen et al., 2021) and reducing bias (Jalal et al., 2021c). The main weakness of this approach is that, in principle, mixing to the posterior + +distribution can take exponentially many steps in the dimension $n$ . In practice, Score-Based models usually require thousands of steps for a single reconstruction (Jolicoeur-Martineau et al., 2021; Xiao et al., 2021; Watson et al., 2021). + +We show that (under the random weights assumption), CSGM with Stochastic Gradient Langevin Dynamics has polynomial (in the dimension) mixing to the stationary distribution. This result extends the seminal work of Hand & Voroninski (2018b); Huang et al. (2018) from MAP to posterior sampling. Specifically, Hand & Voroninski (2018b); Huang et al. (2018) established polynomial-time point convergence of Gradient Descent (with sign flips) for CSGM optimization for random weight ReLU Generators. We prove that, even without the sign flips, Langevin Dynamics will mix fast. Our result is important since prior work assumed mixing of the Markov Chain sampler to establish theoretical guarantees (e.g. see Jalal et al. (2020)). + +Finally, we show how to solve inverse problems with posterior sampling in the latent space of a pretrained generator. Effectively, we combine ILO and Score-Based models into a single framework for inverse problems. We call our new method Score-Guided Intermediate Layer Optimization (SGILO). The central idea is to create generative models that come endowed with a score-based model as a prior for one internal intermediate layer in their architecture. This replaces the sparsity prior used by ILO with a learned intermediate layer regularizer. + +We start with a StyleGAN2 (Karras et al., 2019; 2020) and train a score-based model to learn the distribution of the outputs of an intermediate layer. To solve an inverse problem, we optimize over an intermediate layer as in ILO (Daras et al., 2021b), but instead of constraining the solutions to sparse deviations near the range, we use the learned score as a regularization. Specifically, we are using Stochastic Gradient Langevin Dynamics (SGLD) to sample from the posterior distribution of the latents where the gradient of the log-density is provided by our score-based model. + +# Our Contributions: + +1. We propose a novel framework, Score-Guided Intermediate Layer Optimization (SGILO), for solving general inverse problems. Our method replaces the sparsity prior of ILO (Daras et al., 2021b) with a learned score-based prior. +2. To learn this prior we train a score-based model on an intermediate latent space of StyleGAN using inversions of real images from FFHQ (Karras et al., 2019) obtained with ILO (Daras et al., 2021b). Our score-based models use a Vision Transformer (ViT) (Dosovitskiy et al., 2020) variant as the backbone architecture, + +demonstrating design flexibility when training score models for intermediate representations. + +3. Given some measurements (e.g. inpainted image), we use the learned prior and the Langevin algorithm to do posterior sampling. Experimentally we show that our approach yields significant improvements over ILO (Daras et al., 2021b) and other prior work. Further, we show that our Langevin algorithm is much faster to train and to sample from, compared to standard score-based generators, since we work in the much lower dimension of the intermediate layer. +4. Theoretically we prove that the Langevin algorithm converges to stationarity in polynomial time. Our result extends prior work (Hand & Voroninski, 2018b; Huang et al., 2018) which analyzed MAP optimization to Langevin dynamics. Like prior work, our theory requires that the generator has random independent weights and an expansive architecture. +5. We open-source all our code and pre-trained models to facilitate further research on this area. + +# 2. Score Guided Intermediate Layer Optimization + +Setting Let $x^{*} \in \mathbb{R}^{n}$ be an unknown vector that is assumed to lie in the range of a pre-trained generator $G(z): \mathbb{R}^{k} \to \mathbb{R}^{n}$ , i.e. we assume that there is a $z^{*} \in \mathbb{R}^{k}$ such that: $x^{*} = G(z^{*})$ . We observe some noisy measurements of $x^{*}$ , i.e. the vector $y = \mathcal{A}(x^{*}) + \xi \in \mathbb{R}^{m}$ , where $A: \mathbb{R}^{n} \to \mathbb{R}^{m}$ is a known, differentiable forward operator and $\xi \sim \mathcal{N}(0, \sigma^2 I)$ . + +Posterior Sampling in the Latent Space We first want to characterize the posterior density $p(z|y)$ . Applying Bayes rule, we get that: $p(z|y) = \frac{p(z,y)}{p(y)} \propto p(y|z)p(z)$ . The noise is assumed Gaussian, so $p(y|z) = \mathcal{N}(y; \mu = \mathcal{A}(G(z)), \Sigma = \sigma^2 I)$ . Hence, + +$$ +\log p (z | y) \propto \underbrace {\frac {1}{2 \sigma^ {2}} | | \mathcal {A} (G (z)) - y | | _ {2} ^ {2} - \log p (z)} _ {L (z)}. \quad (1) +$$ + +To derive this posterior, we assumed that $x^{*}$ is in the range of the generator $G$ . This assumption is somewhat unrealistic for the Gaussian latent space of state-of-the-art GANs, such as StyleGAN (Karras et al., 2019; 2020) which motivates optimization over an intermediate space, as done in ILO (Daras et al., 2021b). + +ILO has two weaknesses: i) it is a MAP method while there is increasing research showing the benefits of posterior + +
AlgorithmExpressiveSamplingFastProvable Convergence
Gradient Descent in Rk(CSGM (Bora et al., 2017))XX✓✓
Projected Gradient Descent in Rp(ILO (Daras et al., 2021b))✓X✓✓
Langevin Dynamics in Rn(Jalal et al., 2021b)✓✓XX
Langevin Dynamics in Rp(SGILO)✓✓✓✓ (under assumptions)
+ +Table 1: Summary of different reconstruction algorithms for solving inverse problems with deep generative priors. For the GAN based methods (Rows 1, 2), we think of a generator as a composition over two transformations $G_{1}:\mathbb{R}^{k}\to \mathbb{R}^{p}$ and $G_{2}:\mathbb{R}^{p}\rightarrow \mathbb{R}^{n}$ , where $k < p < n$ . Gradient Descent in the intermediate space, as in the ILO paper, can be expressive (increased expressivity due to ILO) and fast (GAN-based methods) but does not offer diverse sampling. On the other hand, Stochastic Gradient Langevin Dynamics in the pixel space is slow as it is usually done with high-dimensional score-based models. SGILO (Row 4) combines the best of the two worlds. + +![](images/e4a92e8f81bf4d88717a6037ebd9d9446e9f994a0dc4123c581b2552962aeaeb.jpg) +Reference + +![](images/a0f661ad53db2b42cb43a7eb63941ea8daf850cceeab8cfcb5f91e04f7b572ee.jpg) +Input + +![](images/587e20659a33d17f9338c1d7b0a3207c4fbf09c205427b556ed2c249d4414dc1.jpg) +SGILO (Ours) + +![](images/c66c7e801c1f527b5c99dea9620b573093fce6a955bd26d52f3ec51504d7337f.jpg) +ILO +Figure 1: Results on randomized inpainting in the very challenging regime of only $0.75\%$ observed pixels (with random sampling). The input seems completely black unless zoomed in. The proposed SGILO benefits from the intermediate layer score-based model to remove artifacts and unnatural colors that appear in ILO (Daras et al., 2021b). CSGM (Bora et al., 2017) is constrained to be on the range of StyleGAN2 and hence produces high quality images that, however, do not resemble much the (unobserved) reference. We emphasize that these are real reference images that have not been used in training, for any of the models. + +![](images/7e187f92866a85741205b895ac84ea2e9885545836fba92cb4b4c7978afeac52.jpg) +CSGM + +sampling (Jalal et al., 2020; 2021c; Nguyen et al., 2021), ii) it is assuming a handcrafted prior which is uniform in an $l_{1}$ dilation of the range of the previous layers and 0 elsewhere. + +Instead, we propose a new framework, Score-Guided Intermediate Layer Optimization (SGILO), that trains a score-based model in the latent space of some intermediate layer and then uses it with Stochastic Gradient Langevin Dynamics to sample from $e^{-bL(z)}$ for some temperature parameter. + +Figure 2 illustrates the central idea of SGILO. As shown, ILO optimizes in the intermediate layer $\mathbb{R}^p$ assuming a uniform prior over the expanded manifold (that is colored green). In this paper, we learn a distribution in the inter + +mediate layer using a score based model. This learned distribution is shown by orange geodesics and can expand outside the $\ell_1$ -ball dilated manifold. + +Table 1 summarizes the strengths and weaknesses of the following reconstruction algorithms: i) Gradient Descent (GD) in the latent space of the first layer of a pre-trained generator as in the CSGM (Bora et al., 2017) framework, ii) (Projected) GD in the latent space of an intermediate layer, as in ILO (Daras et al., 2021b), iii) Stochastic Gradient Langevin Dynamics (SGLD) in the pixel space, as done by Jalal et al. (2020); Song et al. (2021a) and others with Score-Based Networks and iv) SGLD in the intermediate space + +of some generator, as we propose in this work. Notation wise, for the GAN based methods (Rows 1, 2), we think of a generator as a composition over two transformations $G_{1}:\mathbb{R}^{k}\to \mathbb{R}^{p}$ and $G_{2}:\mathbb{R}^{p}\to \mathbb{R}^{n}$ , where $k < p < n$ . + +Gradient Descent in the intermediate space, as in the ILO paper, can be expressive (increased expressivity due to ILO) and fast (GAN-based methods) but does not offer diverse sampling. On the other hand, Stochastic Gradient Langevin Dynamics in the pixel space is slow as it is usually done with high-dimensional score-based models. SGILO (Row 4) combines the best of the worlds of GAN-based inversion and posterior sampling with Score-Based Networks. Specifically, it is expressive (optimization over an intermediate layer), it offers diverse sampling (posterior sampling method) and it is fast (dimensionality $p < n$ ). Experimental evidence that supports these claims is given in Section 4. + +The last column of Table 1 characterizes the different algorithms with respect to what we know about their convergence. A recent line of work (Hand & Voroninski, 2018b; Huang et al., 2018; Daskalakis et al., 2020a) has been able to prove that despite the non-convexity, for neural networks with random Gaussian weights, a signal in the range of the network can be approximately recovered using Gradient Descent (with sign flips) in polynomial time under an expansion assumption in the dimension of the layers of the generator. This motivates the question of whether we can prove under the same setting, that a Langevin Sampling algorithm would converge fast to a stationary measure. The next section, answers affirmatively this question while even removing the need for sign flipping. The theoretical results hold for the CSGM setting, but can apply to the optimization in an intermediate layer with a uniform prior over the latents. Unfortunately, assuming uniformity in the intermediate layer is not a realistic assumption. Proving distributional convergence of SGILO under more realistic assumptions is left for future work. + +# 3. Theoretical Results + +We are now ready to state the main Theorem of our paper. + +Theorem 3.1 (Informal). Consider the Markov Chain defined by the following Langevin Dynamics: + +$$ +z _ {t + 1} = z _ {t} - \eta \nabla f (z _ {t}) + \sqrt {2 \eta \beta^ {- 1}} u \tag {2} +$$ + +where $u$ is a zero-mean, unit variance Gaussian vector, i.e. $u_{ij} \sim \mathcal{N}(0, \sigma^2 = 1)$ , $G(z)$ is a fully-connected $d$ -layer ReLU neural network, + +$$ +G (z) = \operatorname {R e L U} \left(W ^ {(d)} \left(\dots \operatorname {R e L U} \left(W ^ {(1)} z\right) \dots\right)\right) +$$ + +and $f(z)$ is the loss function: + +$$ +f (z) = \beta \| A G (z) - y \| _ {2} ^ {2} +$$ + +where $A\in \mathbb{R}^{m\times k}$ , and $y = AG(z^{*})$ , for some unknown vector $z^{*}\in \mathbb{R}^{n}$ + +Define $\mu (z)\propto e^{-f(z)}$ and $z_{t}\sim Z_{t}$ , then for any $\epsilon >0$ and for $t\geq \Omega (\log (1 / \epsilon) / \epsilon^2)$ + +$$ +\begin{array}{l} \mathcal{W}(Z_{t},\mu):= \inf_{Q\in \{couplings~of~Z_{t},\mu \}}\mathbb{E}_{(z_{t},z)\sim Q}\| z_{t} - z\| \\ \leq (\epsilon + e ^ {- \Omega (n)}) \| z ^ {*} \|, \\ \end{array} +$$ + +provided that $\eta = \Theta(\epsilon^2)$ , that $\beta = Cn$ (for some sufficiently large constant $C$ ), that $\|z_0\| \leq O(\|z^*\|)$ , that $W^{(i)}$ and $A$ satisfy conditions WDC and RRIC (Hand & Voroninski, 2018b) and $d \geq 2$ can be any constant. + +We note that $\beta = \Theta (n)$ is the right choice of parameters since a smaller $\beta$ produces approximately random noise and a larger $\beta$ produces a nearly deterministic output. + +Sketch of the proof: We analyze the landscape of the loss function $f$ . It was already noted by Hand & Voroninski (2018a) that it has three points where the gradient vanishes: at the optimum $\vec{x}^*$ , at a point $-\rho \vec{x}^*$ for some $\rho \in (0,1)$ and at 0, a local maxima. In order to escape the stationary point $-\rho \vec{x}^*$ , Hand & Voroninski (2018a) proposed to flip the sign of $\vec{x}$ whenever such flipping reduces the loss. We write $f$ in a more compact fashion, obtaining that $-\rho \vec{x}^*$ is a saddle point. We show that the noise added by the Langevin dynamics can help escaping this point, and converging to some ball around $\vec{x}^*$ . This is proven via a potential function argument: we construct a potential $V$ and show that it decreases in expectation after each iteration, as long as the current iteration is far from $\vec{x}^*$ . We note that the expected change in $V$ is measured in the continuous dynamics by a Laplace operator $\mathcal{L}V$ . In this paper, we use this to show that the potential decreases in the continuous dynamics, and compare the continuous to the discrete dynamics. + +Finally, our goal is to couple the discrete dynamics to the continuous dynamics that sample from $\mu$ . Once we establish that the continuous and discrete dynamics arrive close to $\vec{x}^*$ , we use the fact that $f$ is strongly convex in this region to couple them in such a way that they get closer in each iteration, until they are $\epsilon$ -close, and this concludes the proof. The full proof and the detailed formal statement of the theorem can be found in the Appendix. + +# 4. Experimental Results + +We use StyleGAN-2 (Karras et al., 2019; 2020) as our pretrained GAN generator. Score-based models are trained as priors for internal StyleGAN-2 layers. We use a variant of the Vision Transformer (Dosovitskiy et al., 2020) as the backbone architecture for our score-based models. To incorporate time information, we add Gaussian random features (Tancik et al., 2020) to the input sequence, as done + +![](images/ba9b57012d4e7c733c5ff523a249091f7990606d414f867cb6c7dd0af629c2c7.jpg) +Figure 2: An illustration of SGILO. In previous work (ILO (Daras et al., 2021b)) a generator is considered as the composition of two transformations $G_{1}$ from the latent space to an intermediate space $\mathbb{R}^p$ and a second transformation $G_{2}$ from the intermediate layer to the image space. The range of the generator $G_{1}$ is a $k$ dimensional manifold in $\mathbb{R}^p$ shown with a blue line in the figure. ILO expands this by taking the Minkowski sum of the manifold with the $\ell_1$ ball. ILO optimizes in the intermediate layer $\mathbb{R}^p$ assuming a uniform prior over the expanded manifold, shown as the green set. In this paper we learn a distribution in the intermediate layer using a score based model. This learned distribution is shown by orange geodesics and can expand outside the $\ell_1$ -ball dilated manifold. + +in Song & Ermon (2019) for the U-net (Ronneberger et al., 2015) architecture. The score-based models are trained with the Variance Preserving (VP) SDE, defined in Song et al. (2021b). + +Transformers are not typically used for score-based modeling. This is probably due to the quadratic complexity of transformers with respect to the length of the input sequence, e.g. for training a $1024 \times 1024 \times 3$ score-based model, the Transformer would require memory proportional to $1024^2 \times 1024^2 \times 3^2$ . Since our score-based models learn the distribution of intermediate StyleGAN-2 layers, we work with much lower dimensional objects. For the score-based model, we use a ViT Transformer with 8 layers, 1 attention head and dimension 1024. For the VP-SDE we use the parameters in Song et al. (2021b). For more information on implementation and hyperparameters, please refer to our open-sourced code. + +Dataset and training. The score-based model is trained by creating a dataset of intermediate StyleGAN inputs (latents and intermediate outputs). We inverted all images in FFHQ (Karras et al., 2019) with ILO, and used the intermediate outputs as training data for our score-based model. + +We train score-based models to learn the distribution of: i) the latents that correspond to the inverted FFHQ and ii) the intermediate distributions of layers $\{1,2,3,4\}$ of the generator. Consistently, we observed that the score-based models for the deeper priors were more powerful in terms of solving inverse problems. This is expected but comes with the cost of more expensive training, which is why we stopped at layer 4, which is already powerful enough to give us excellent reconstructions. + +Unconditional Image Generation. The first experiment we run aims to demonstrate that the score-based models that + +we trained on the intermediate distributions are indeed capable of modeling accurately the gradient of the log-density. To this end, we use Annealed Langevin Dynamics, as in Song & Ermon (2019), to sample from the intermediate distribution of the fourth layer and the distribution of the inverted latents. The results are summarized in Figure 4. In the first two rows, we show results when sampling from the intermediate distribution (keeping the noises and the latent vectors fixed). In the last row, we show results when sampling from the distribution of the inverted latents (keeping the noises fixed). As shown, the combination of the score-models and the powerful StyleGAN generators leads to diverse, high-quality generations. + +Quantitative Results on Inverse Problems. We want to evaluate if our method qualitatively improves upon ILO (Daras et al., 2021b) which is the previous state-of-the-art method for solving inverse problems with pre-trained generators. We also compare with vanilla CSGM (Bora et al., 2017) which performs much worse. For a fair comparison, we choose 8 real images from FFHQ to tune the hyperparameters for each method at each measurement level, and then measure performance with respect to the ground truth on 30 FFHQ test set images (never seen by the score-based model). For ILO, we also tried the default parameters (300, 300, 300, 100 steps) reported in Daras et al. (2021b). Finally, to make sure that the benefit of our method comes indeed from the prior and not from optimizing without the ILO sparsity constraints, we also test ILO without any constraint on the optimization space. In the Figures, for the ILO we report the minimum of ILO with tuned parameters, ILO with default parameters (from the paper) and ILO without any regularization. For the denoising experiments, we tried ILO with and without dynamic addition of noise (Stochastic Noise Addition) and we plotted the best score. + +Figure 3 shows MSE and Perceptual distance between the + +![](images/2feee62214371e8241ba78accdd1404d9b53c049f6b3d7664f96d646a811e433.jpg) +Compressed Sensing MSE + +![](images/4b26d865a23eb0f0795825c4865caf27790dabd8b583b9a03bca7293e097c383.jpg) +Compressed Sensing LPIPS + +![](images/ff1b7cd4f11f49fd9e2b5dbf0606f777c86dc343feb27dc8a9a4cc12bc3eb6b7.jpg) +Denoising MSE + +![](images/75fe5bbc6ac3717927429918c0fd881ebb5b59dc081151dba176f5b40c6c9979.jpg) +Denoising LPIPS + +![](images/1a01dd575bafdd289cfc8e32328d1605fdd11435b303787963d325445de83fd9.jpg) +Inpainting MSE + +![](images/33804e00056cc7fb68345379fdc5b33f76f5069b33510d44884f0ae991511514.jpg) +Inpainting LPIPS +Figure 3: Quantitative results on the task of compressed sensing, denoising and inpainting. Our method, SGILO, significantly outperforms the state-of-the-art unsupervised method ILO when the measurements are scarce or the level of the noise is high. In this challenging regime, the prior from the score-based model is a much better regularizer than the sparse deviations constraint of ILO, yielding significant performance boosts. + +ground truth image and the reconstructions of ILO, CSGM and SGILO (ours) as we vary the difficulty of the task (horizontal axis). The plots show results for denoising, compressed sensing and inpainting. As shown, in more challenging regimes, our method outperforms ILO and CSGM. When the task is not very challenging, e.g. denoising when the standard deviation of the noise is $\sigma = 0.1$ , the prior becomes less important and SGILO performs on par with ILO. As expected, the contribution of the prior is significant when less information is available. + +Out of distribution projections. This experiment demonstrates that following the learned vector field of the log-likelihood in the latent space leads to more natural images. Specifically, we start with an out-of-distribution image and we invert it with ILO. For the purposes of this experiment, we intentionally stop ILO early, to arrive at a solution that has visual artifacts. We now use solely the score-based prior to see if we can correct these artifacts. We obtain the early stopped ILO solution $z_0^* \in \mathbb{R}^p$ (where $p$ is the dimension of the intermediate layer, optimizing over the third layer of StyleGAN-2), and use the Forward SDE to sample from + +![](images/6224b44cb91ab59608137d23190f5dd506fe0445d048a12c5a658cf62b3d1388.jpg) +Figure 4: Images generated by a pre-trained StyleGAN-2 (Karras et al., 2020) with inputs to intermediate layers sampled with our trained-score based models and the Annealed Langevin Dynamics algorithm (Song & Ermon, 2019). + +![](images/5874ad25394c46ebd64bb90d2ed4305bd0731ca0389a3b742353b720d2368fcd.jpg) +Figure 5: Results on colorization. ILO introduces artifacts, e.g. Row 1, column 3. Those artifacts are mostly corrected by SGILO, that displays more natural colors than prior work. + +$p(z_{t}|z_{0}^{*})$ . This corresponds to sampling from a Gaussian centered in $z_0^*$ with variance that grows with $t$ . Then, we use Annealed Langevin Dynamics with the learned Score-Based network to sample from $p(z_0|z_t)$ . The choice of $t$ is affecting how close will be the final sample to $z_0^*$ . Since we started with an unnatural latent, we expect that $t$ is controlling the trade-off between matching the measurements and increasing the naturalness of the image. Results are shown in Figure 6. + +Other Inverse Problems. SGILO is a general framework that can be applied to solve any inverse problem, as long as the forward operator $\mathcal{A}$ is known and differentiable. Figure 1 shows results for randomized inpainting in the extreme regime of $0.75\%$ observed measurements. + +Figure 5 shows results for the task of colorization. As shown, both ILO and CSGM introduce artifacts, e.g. see columns 3 and 4 of Row 1. Those artifacts are mostly corrected by our framework, SGILO, that displays more natural colors than prior work. + +A final experiment we performed is generating samples using a pre-trained classifier to deviate from the learned distribution. We use a classifier to bias our Langevin algorithm to produce samples that look like ImageNet classes. We use gradients from robust classifiers (Santurkar et al., 2019) to get samples from the class 'Bullfrog'. As shown in Figure 7, SGILO is flexible to produce samples outside its learned distribution and retains interesting visual features. + +Posterior Sampling Ablation As we argued in Sections 1, 2, SGILO is a posterior sampling method. Among others, posterior sampling offers i) diverse reconstructions, ii) reduced bias. We perform two experiments to examine how well SGILO performs with respect to i) and ii). Figure 8 shows different reconstructions we get for the measurements given in the first column. As shown, the generated images have variability with respect to age, ethnicity, eye color, etc. We also perform a preliminary experiment to examine whether SGILO has the potential to reduce dataset biases. To that end, we downsample 64 images of men and women (each) by $\times 256$ and then reconstruct them using ILO and SGILO. For each of the reconstructed images, we + +![](images/a20a5d29b2f9983f79afc8c4b8d8c2edadaf6dde610fbe62b3a4eab8af6d521b.jpg) +Input + +![](images/a9df888f21b1cd8dff3a4cd4275ef2e17786d2b53647aeeb4e2b68727e94cfec.jpg) +CSGM + +![](images/3d8ef8be20e6ab5279dab11853569963e64bb930fa019c25b4a1d3313841cac6.jpg) +ILO + +![](images/40c789ce5d8d44dc7374f3b8fb4cedd3373c3ce9920cdf49f7ad829e37fe749c.jpg) +SGILO + +![](images/4a8282a5ec82f5dd04bca73a61e48ed22b08f738998a2605390d717b9de45935.jpg) +Figure 6: Out of distribution projections. The initial painting image is our of the StyleGAN2 distribution. Using CSGM frequently fails especially when features are not perfectly aligned with the learned manifold. ILO produces a better image that is still not very realistic. Our method (SGILO) uses the Score-prior to improve on ILO and produce a more realistic image. Note that the goal is not to reconstruct the input image, but to demonstrate that by exclusively following the learned score in the latent space makes the generated image more natural. + +![](images/d7334d05dcbd5e104b21290c4840b084a0b3e7a495bab59329ca4b8d8574cd07.jpg) +Figure 7: Samples of the posterior using a Bullfrog classifier as a differentiable forward operator. SGILO is flexible and able to extend outside its learned distribution as it produces interesting blendings of human and frog characteristics. + +![](images/a3462f9e53f9a729ed148aed201e855d743a06788cf9fbd6d63f7bc250918a71.jpg) + +![](images/f0949a1809072ce112fffe974688846b0d43aa40b6253aaa5a61b32b5b21c1db.jpg) +Figure 8: Diverse reconstructions with posterior sampling. + +use CLIP (Radford et al., 2021) to predict the gender. ILO predicts correctly the gender in $78/128$ , while SGILO succeeds in $89/128$ . This experiment aligns with the findings of Jalal et al. (2021c) that shows that reconstruction methods based on posterior sampling usually lead to increased fairness. + +Speed Ablation One advantage of SGILO over other sampling frameworks with conventional Score-Based networks is the speed. The reasons SGILO is fast are twofold: i) the model is working on a low-dimensional space and ii) one might not need to reverse the whole diffusion, since any step of SGLD can serve as a hot-start for the reverse diffu + +sion. For most of our experiments, instead of using directly the gradient of $\log p(z_0)$ , we sample for some small $t$ one $p(z_{t}|z_{0})$ according to the SDE and then we run the reverse SDE for the interval $[t, 0]$ . This can give more flexibility to the score-based model to guide the solutions of the Intermediate Layer Optimization and is still pretty fast as long as $t$ is small. This is similar in spirit to the SDEdit (Meng et al., 2021) paper. The only time we revert the whole diffusion is when we treat the score-based model as a generator (instead of regularizer for ILO), as we do for ablation purposes in Figure 4. Specifically, each inverse problem takes $1 - 2$ minutes to get solved on a single V100 GPU. Figure 9 of the Appendix shows how MSE changes as time goes. SGILO typically requires 300 function evaluations which corresponds to $1 - 2$ minutes. Most score-based models, like NCSNv3, require thousands of steps. For image generation, SGILO needs $\sim 40$ seconds for a single sample on a single GPU, which is $10\times$ faster than score models in the pixel space. We note that recently many other methods for accelerating diffusion models have been proposed (Karas et al., 2022; Salimans & Ho, 2022; Nichol & Dhariwal, 2021; Song et al., 2020; Jolicoeur-Martineau et al., 2021) that are orthogonal to (and hence, can be combined with) our approach. + +# 5. Related Work + +The CSGM paper (Bora et al., 2017) introduced the unsupervised framework for inverse problems and this has been shown to be optimal under natural assumptions (Liu & Scarlett, 2020; Kamath et al., 2019). Recent works have investigated methods of expanding the range of the generator. Optimizing an intermediate layer was first proposed in the context of inversion as a way to identify data distribution modes dropped by GANs (Bau et al., 2019). The same technique has been rediscovered in the GAN surgery paper (Park et al., 2020), in which the authors demonstrated (among other things) that the expansion of the range is useful for out-of-distribution generation. Intermediate Layer Optimization (Daras et al., 2021b) improved prior work by i) using the powerful StyleGAN generator (as was first pioneered in PULSE (Menon et al., 2020) for the special case of super-resolution), ii) gradually transitioning to higher layers with sequential optimization, iii) regularizing the solutions of CSGM (Bora et al., 2017) by only allowing sparse deviations from the range of some intermediate layer. Dhar et al. (2018) previously proposed extending the range by sparse deviations from the output space, but ILO generalized this by allowing deviations from the range of any layer. + +Score-based modeling was proposed by Song & Ermon (2019) using Score Matching (Hyvärinen, 2005) and further work (Song et al., 2021b; Dhariwal & Nichol, 2021; Song & Ermon, 2020) significantly improved score-based performance. Our work is not the first one to train score-based model in the latent space. Vahdat et al. (2021) also trains score-based models in the latent space of a VAE to improve generation quality and sampling time. Our work is related but we are training score-based networks on already pretrained generators and we are focusing on solving inverse problems (instead of generation) by formulating the SGILO algorithm. Algorithms for solving inverse problems with score-based models in pixel-space have been developed in the interesting works of Kawar et al. (2021; 2022); Jalal et al. (2021a). We do not compare directly with these methods since they use different generators as priors for solving inverse problems. + +On the theoretical side, our work extends the seminal work of Hand & Voroninski (2018b); Huang et al. (2018). Prior work showed that a variant of Gradient Descent converges polynomially for MAP estimation using random weight ReLU Generators. Our result is that Langevin Dynamics gives polynomial convergence to the posterior distribution under the same setting. Prior work has also analyzed convergence of Langevin Dynamics for non-convex optimization under different set of assumptions, e.g. see Raginsky et al. (2017); Block et al. (2020); Xu et al. (2017). For theoretical guarantees for sampling with generative models with latent diffusions, we also refer the interested reader to the relevant + +work of Tzen & Raginsky (2019). + +Finally, it is useful to underline that in the presence of enough training data, end-to-end supervised methods usually outperform unsupervised methods, e.g. see Tian et al. (2020); Sun et al. (2020); Tripathi et al. (2018) for denoising, Sun & Chen (2020); Yang et al. (2019) for super-resolution and Yu et al. (2019); Liu et al. (2019) for inpainting. The main disadvantages of solving inverse problems with end-to-end supervised methods are that: i) separate training is required for each problem, ii) there is significant fragility to forward operator changes (robustness issues) (Darestani et al., 2021; Ongie et al., 2020). + +# 6. Conclusions + +This paper introduced Score-Guided Intermediate Layer Optimization (SGILO), a framework for posterior sampling in the latent space of a pre-trained generator. Our work extends the sparsity prior that appeared in prior work, with a powerful generative prior that is used to solve inverse problems. On the theoretical side, we proved fast convergence of the Langevin Algorithm for random weights generators, for the simplified case of uniform prior over the latents. + +# 7. Acknowledgments + +This research has been supported by NSF Grants CCF 1763702, 1934932, AF 1901281, 2008710, 2019844 the NSF IFML 2019844 award as well as research gifts by Western Digital, WNCG and MLL, computing resources from TACC and the Archie Straiton Fellowship. This work is also supported by NSF Awards CCF-1901292, DMS-2022448 and DMS2134108, a Simons Investigator Award, the Simons Collaboration on the Theory of Algorithmic Fairness, a DSTA grant, the DOE PhilLMs project (DE-AC05-76RL01830). + +# References + +Asim, M., Ahmed, A., and Hand, P. Invertible generative models for inverse problems: mitigating representation error and dataset bias. arXiv preprint arXiv:1905.11672, 2019. +Bau, D., Zhu, J.-Y., Wulff, J., Peebles, W., Strobelt, H., Zhou, B., and Torralba, A. Seeing what a gan cannot generate, 2019. +Block, A., Mroueh, Y., Rakhlin, A., and Ross, J. Fast mixing of multi-scale Langevin dynamics under the manifold hypothesis, 2020. +Bora, A., Jalal, A., Price, E., and Dimakis, A. G. Compressed sensing using generative models. In International + +Conference on Machine Learning, pp. 537-546. PMLR, 2017. +Brock, A., Donahue, J., and Simonyan, K. Large scale gan training for high fidelity natural image synthesis, 2019. +Chan, E. R., Monteiro, M., Kellnhofer, P., Wu, J., and Wetzstein, G. pi-gan: Periodic implicit generative adversarial networks for 3d-aware image synthesis. 2021 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Jun 2021. doi: 10.1109/cvpr46437.2021.00574. URL http://dx.doi.org/10.1109/CVPR46437.2021.00574. +Daras, G., Odena, A., Zhang, H., and Dimakis, A. G. Your local gan: Designing two dimensional local attention mechanisms for generative models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2020. +Daras, G., Chu, W.-S., Kumar, A., Lagun, D., and Dimakis, A. G. Solving inverse problems with nerfgans. arXiv preprint arXiv:2112.09061, 2021a. +Daras, G., Dean, J., Jalal, A., and Dimakis, A. G. Intermediate layer optimization for inverse problems using deep generative models. In ICML 2021, 2021b. +Darestani, M. Z., Chaudhari, A., and Heckel, R. Measuring robustness in deep learning based compressive sensing. arXiv preprint arXiv:2102.06103, 2021. +Daskalakis, C., Rohatgi, D., and Zampetakis, E. Constant-expansion suffices for compressed sensing with generative priors. In Larochelle, H., Ranzato, M., Hadsell, R., Balcan, M. F., and Lin, H. (eds.), Advances in Neural Information Processing Systems, volume 33, pp. 13917-13926. Curran Associates, Inc., 2020a. URL https://proceedings.neurips.cc/paper/2020/file/9fa83fec3cf3810e5680ed45f7124dce-Paper.pdf. +Daskalakis, C., Rohatgi, D., and Zampetakis, M. Constant-expansion suffices for compressed sensing with generative priors. in the. In 34th Annual Conference on Neural Information Processing Systems (NeurIPS), NeurIPS 2020, 2020b. +Dhar, M., Grover, A., and Ermon, S. Modeling sparse deviations for compressed sensing using generative models. In International Conference on Machine Learning, pp. 1214-1223. PMLR, 2018. +Dhariwal, P. and Nichol, A. Diffusion models beat gans on image synthesis, 2021. + +Dosovitskiy, A., Beyer, L., Kolesnikov, A., Weissenborn, D., Zhai, X., Unterthiner, T., Dehghani, M., Minderer, M., Heigold, G., Gelly, S., Uszkoreit, J., and Houlsby, N. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020. +Hand, P. and Voroninski, V. Global guarantees for enforcing deep generative priors by empirical risk. In Conference On Learning Theory, pp. 970-978. PMLR, 2018a. +Hand, P. and Voroninski, V. Global guarantees for enforcing deep generative priors by empirical risk. In Bubeck, S., Perchet, V., and Rigollet, P. (eds.), Proceedings of the 31st Conference On Learning Theory, volume 75 of Proceedings of Machine Learning Research, pp. 970-978. PMLR, 06-09 Jul 2018b. URL http://proceedings.mlrpress/v75/hand18a.html. +Hand, P., Leong, O., and Voroninski, V. Phase retrieval under a generative prior. In Advances in Neural Information Processing Systems, pp. 9136-9146, 2018. +Heckel, R. and Hand, P. Deep decoder: Concise image representations from untrained non-convolutional networks. arXiv preprint arXiv:1810.03982, 2018. +Ho, J., Jain, A., and Abbeel, P. Denoising diffusion probabilistic models. arXiv preprint arxiv:2006.11239, 2020. +Huang, W., Hand, P., Heckel, R., and Voroninski, V. A provably convergent scheme for compressive sensing under random generative priors, 12 2018. +Huang, W., Hand, P., Heckel, R., and Voroninski, V. A provably convergent scheme for compressive sensing under random generative priors. Journal of Fourier Analysis and Applications, 27(2):1-34, 2021. +Hyvärinen, A. Estimation of non-normalized statistical models by score matching. Journal of Machine Learning Research, 6(24):695-709, 2005. URL http://jmlr.org/papers/v6/hyvarinen05a.html. +Jalal, A., Karmalkar, S., Dimakis, A., and Price, E. Compressed sensing with approximate priors via conditional resampling. In NeurIPS 2020 Workshop on Deep Learning and Inverse Problems, 2020. URL https://openreview.net/forum?id=8ozSD4Oymw. +Jalal, A., Arvinte, M., Daras, G., Price, E., Dimakis, A. G., and Tamir, J. I. Robust compressed sensing mri with deep generative priors, 2021a. +Jalal, A., Karmalkar, S., Dimakis, A. G., and Price, E. Instance-optimal compressed sensing via posterior sampling, 2021b. + +Jalal, A., Karmalkar, S., Hoffmann, J., Dimakis, A., and Price, E. Fairness for image generation with uncertain sensitive attributes. In International Conference on Machine Learning, pp. 4721-4732. PMLR, 2021c. +Jolicoeur-Martineau, A., Li, K., Piché-Taillefer, R., Kachman, T., and Mitliagkas, I. Gotta go fast when generating data with score-based models, 2021. +Kamath, A., Karmalkar, S., and Price, E. Lower bounds for compressed sensing with generative models. arXiv preprint arXiv:1912.02938, 2019. +Karras, T., Laine, S., and Aila, T. A style-based generator architecture for generative adversarial networks. 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Jun 2019. doi: 10.1109/cvpr.2019.00453. URL http://dx.doi.org/10.1109/CVPR.2019.00453. +Karras, T., Laine, S., Aittala, M., Hellsten, J., Lehtinen, J., and Aila, T. Analyzing and improving the image quality of stylegan. 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Jun 2020. doi: 10.1109/cvpr42600.2020.00813. URL http://dx.doi.org/10.1109/cvpr42600.2020.00813. +Karras, T., Aittala, M., Aila, T., and Laine, S. Elucidating the design space of diffusion-based generative models, 2022. +Kawar, B., Vaksman, G., and Elad, M. Snips: Solving noisy inverse problems stochastically. Advances in Neural Information Processing Systems, 34:21757-21769, 2021. +Kawar, B., Elad, M., Ermon, S., and Song, J. Denoising diffusion restoration models, 2022. +Kelkar, V. A. and Anastasio, M. A. Prior image-constrained reconstruction using style-based generative models. arXiv preprint arXiv:2102.12525, 2021. +Lin, C. Z., Lindell, D. B., Chan, E. R., and Wetzstein, G. 3d gan inversion for controllable portrait image animation, 2022. +Liu, H., Jiang, B., Xiao, Y., and Yang, C. Coherent semantic attention for image inpainting. 2019 IEEE/CVF International Conference on Computer Vision (ICCV), Oct 2019. doi: 10.1109/iccv.2019.00427. URL http://dx.doi.org/10.1109/ICCV.2019.00427. +Liu, Z. and Scarlett, J. Information-theoretic lower bounds for compressive sensing with generative models. IEEE Journal on Selected Areas in Information Theory, 1(1): 292-303, May 2020. ISSN 2641-8770. doi: 10.1109/ jsait.2020.2980676. URL http://dx.doi.org/10. 1109/JSAIT.2020.2980676. + +Meng, C., He, Y., Song, Y., Song, J., Wu, J., Zhu, J.-Y., and Ermon, S. Sdedit: Guided image synthesis and editing with stochastic differential equations, 2021. +Menon, S., Damian, A., Hu, S., Ravi, N., and Rudin, C. Pulse: Self-supervised photo upsampling via latent space exploration of generative models. 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2020. doi: 10.1109/cvpr42600.2020.00251. URL http://dx.doi.org/10.1109/cvpr42600.2020.00251. +Nguyen, T. V., Jagatap, G., and Hegde, C. Provable compressed sensing with generative priors via Langevin dynamics, 2021. +Nichol, A. and Dhariwal, P. Improved denoising diffusion probabilistic models, 2021. +Nichol, A., Dhariwal, P., Ramesh, A., Shyam, P., Mishkin, P., McGrew, B., Sutskever, I., and Chen, M. Glide: Towards photorealistic image generation and editing with text-guided diffusion models, 2021. +Ongie, G., Jalal, A., Metzler, C. A., Baraniuk, R. G., Dimakis, A. G., and Willett, R. Deep learning techniques for inverse problems in imaging. IEEE Journal on Selected Areas in Information Theory, 1(1):39-56, 2020. +Park, J. Y., Smedemark-Margulies, N., Daniels, M., Yu, R., van de Meent, J.-W., and HAnd, P. Generator surgery for compressed sensing. In NeurIPS 2020 Workshop on Deep Learning and Inverse Problems, 2020. URL https://openreview.net/forum?id=s2EucjZ6d2s. +Radford, A., Kim, J. W., Hallacy, C., Ramesh, A., Goh, G., Agarwal, S., Sastry, G., Askell, A., Mishkin, P., Clark, J., Krueger, G., and Sutskever, I. Learning transferable visual models from natural language supervision, 2021. +Raginsky, M., Rakhlin, A., and Telgarsky, M. Non-convex learning via stochastic gradient Langevin dynamics: a nonasymptotic analysis. In Conference on Learning Theory, pp. 1674–1703. PMLR, 2017. +Ramesh, A., Dhariwal, P., Nichol, A., Chu, C., and Chen, M. Hierarchical text-conditional image generation with clip latents. arXiv preprint arXiv:2204.06125, 2022. +Ronneberger, O., Fischer, P., and Brox, T. U-net: Convolutional networks for biomedical image segmentation. In Navab, N., Hornegger, J., Wells, W. M., and Frangi, A. F. (eds.), Medical Image Computing and Computer-Assisted Intervention - MICCAI 2015, pp. 234-241, Cham, 2015. Springer International Publishing. ISBN 978-3-319-24574-4. + +Saharia, C., Chan, W., Saxena, S., Li, L., Whang, J., Denton, E., Ghasemipour, S. K. S., Ayan, B. K., Mahdavi, S. S., Lopes, R. G., Salimans, T., Ho, J., Fleet, D. J., and Norouzi, M. Photorealistic text-to-image diffusion models with deep language understanding, 2022. +Salimans, T. and Ho, J. Progressive distillation for fast sampling of diffusion models. arXiv preprint arXiv:2202.00512, 2022. +Santurkar, S., Tsipras, D., Tran, B., Ilyas, A., Engstrom, L., and Madry, A. Image synthesis with a single (robust) classifier, 2019. +Song, J., Meng, C., and Ermon, S. Denoising diffusion implicit models, 2020. +Song, Y. and Ermon, S. Generative modeling by estimating gradients of the data distribution. In Wallach, H., Larochelle, H., Beygelzimer, A., d'Alché-Buc, F., Fox, E., and Garnett, R. (eds.), Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc., 2019. URL https://proceedings.neurips.cc/paper/2019/file/3001ef257407d5a371a96dcd947c7d93-Paper.pdf. +Song, Y. and Ermon, S. Improved techniques for training score-based generative models, 2020. +Song, Y., Shen, L., Xing, L., and Ermon, S. Solving inverse problems in medical imaging with score-based generative models, 2021a. +Song, Y., Sohl-Dickstein, J., Kingma, D. P., Kumar, A., Ermon, S., and Poole, B. Score-based generative modeling through stochastic differential equations. In International Conference on Learning Representations, 2021b. URL https://openreview.net/forum?id=PxTIG12RRHS. +Sun, W. and Chen, Z. Learned image downscaling for upscaling using content adaptive resampler. IEEE Transactions on Image Processing, 29:4027-4040, 2020. ISSN 1941-0042. doi: 10.1109/tip.2020.2970248. URL http://dx.doi.org/10.1109/TIP.2020.2970248. +Sun, Y., Liu, J., and Kamilov, U. S. Block coordinate regularization by denoising. IEEE Transactions on Computational Imaging, 6:908-921, 2020. ISSN 2573-0436. doi: 10.1109/pci.2020.2996385. URL http://dx.doi.org/10.1109/pci.2020.2996385. +Tancik, M., Srinivasan, P. P., Mildenhall, B., Fridovich-Keil, S., Raghavan, N., Singhal, U., Ramamoorthi, R., Barron, J. T., and Ng, R. Fourier features let networks learn high frequency functions in low dimensional domains, 2020. + +Tian, C., Fei, L., Zheng, W., Xu, Y., Zuo, W., and Lin, C.-W. Deep learning on image denoising: An overview. Neural Networks, 131:251-275, Nov 2020. ISSN 0893-6080. doi: 10.1016/j.neunet.2020.07.025. URL http://dx.doi.org/10.1016/j.neunet.2020.07.025. +Tripathi, S., Lipton, Z. C., and Nguyen, T. Q. Correction by projection: Denoising images with generative adversarial networks. arXiv preprint arXiv:1803.04477, 2018. +Tzen, B. and Raginsky, M. Theoretical guarantees for sampling and inference in generative models with latent diffusions. In Conference on Learning Theory, pp. 3084-3114. PMLR, 2019. +Vahdat, A., Kreis, K., and Kautz, J. Score-based generative modeling in latent space. arXiv preprint arXiv:2106.05931, 2021. +Vershynin, R. High-dimensional probability: An introduction with applications in data science, volume 47. Cambridge university press, 2018. +Watson, D., Ho, J., Norouzi, M., and Chan, W. Learning to efficiently sample from diffusion probabilistic models, 2021. +Whang, J., Delbracio, M., Talebi, H., Saharia, C., Dimakis, A. G., and Milanfar, P. Deblurring via stochastic refinement, 2021. +Xiao, Z., Kreis, K., and Vahdat, A. Tackling the generative learning trilemma with denoising diffusion gans, 2021. +Xu, P., Chen, J., Zou, D., and Gu, Q. Global convergence of Langevin dynamics based algorithms for nonconvex optimization, 2017. +Yang, W., Zhang, X., Tian, Y., Wang, W., Xue, J.-H., and Liao, Q. Deep learning for single image super-resolution: A brief review. IEEE Transactions on Multimedia, 21 (12):3106-3121, 2019. +Yu, J., Lin, Z., Yang, J., Shen, X., Lu, X., and Huang, T. Free-form image inpainting with gated convolution. 2019 IEEE/CVF International Conference on Computer Vision (ICCV), Oct 2019. doi: 10.1109/ iccv.2019.00457. URL http://dx.doi.org/10. 1109/ICCV.2019.00457. + +# Notation + +$\mathbb{P}_X^{x,t}$ Probability Density of a continuous Markov Chain that started from point $x$ on the space of all continuous paths on $[0,t]$ . + +$g^{(d)}$ Synthesis of scalar function $g$ with itself, $d$ times. + +$v\mathbb{P}_X^t$ Probability Density of a Markov Chain at time $t$ + +$\| x\|$ $l_{2}$ norm of vector $x$ + +# A. Formal statement + +In the theorem, we make use of a $d$ -layer ReLU network $G$ + +$$ +G (z) = \operatorname {R e L U} \left(W ^ {(d)} \left(\dots \operatorname {R e L U} \left(W ^ {(1)} z\right) \dots\right)\right) +$$ + +where each $w_{i}\in \mathbb{R}^{n_{i}\times n_{i - 1}}$ . Further, we make use of a matrix $A$ of dimension $n_d\times k$ . We use the same assumptions on $G$ and $A$ as in Hand & Voroninski (2018b). Our setting has a minor difference compared to Hand & Voroninski (2018b): to remove unnecessary scalings, we scale the distribution of the weights by a factor of 2 at every layer. + +Definition A.1. We say that the matrix $W \in \mathbb{R}^{n \times k}$ satisfies the Weight Distribution Condition with constant $\epsilon$ if for all nonzero $x, y \in \mathbb{R}^k$ , + +$$ +\left\| \sum_ {i = 1} ^ {n} 1 _ {w _ {i} \cdot x > 0} 1 _ {w _ {i} \cdot y > 0} \cdot w _ {i} w _ {i} ^ {t} - Q _ {x, y} \right\| \leq \epsilon , \text {w i t h} Q _ {x, y} = \frac {\pi - \theta_ {0}}{2 \pi} I _ {k} + \frac {\sin \theta_ {0}}{2 \pi} M _ {\hat {x} \leftrightarrow \hat {y}}, \tag {3} +$$ + +where $w_{i}\in \mathbb{R}^{k}$ is the $i$ th row of $W$ ; $M_{\hat{x}\leftrightarrow \hat{y}}\in \mathbb{R}^{k\times k}$ is the matrix such that $\hat{x}\mapsto \hat{y}$ , $\hat{y}\mapsto \hat{x}$ , and $z\mapsto 0$ for all $z\in \operatorname {span}(\{x,y\})^{\perp}$ ; $\hat{x} = x / \| x\| _2$ and $\hat{y} = y / \| y\| _2$ ; $\theta_0 = \angle (x,y)$ ; and $1_{S}$ is the indicator function on $S$ . + +Definition A.2. We say that the compression matrix $A \in \mathbb{R}^{m \times n}$ satisfies the Range Restricted Isometry Condition (RRIC) with respect to $G$ with constant $\epsilon$ if for all $x_1, x_2, x_3, x_4 \in \mathbb{R}^k$ , + +$$ +\begin{array}{l} \left| \left\langle A (G (x _ {1}) - G (x _ {2})), A (G (x _ {3}) - G (x _ {4})) \right\rangle - \left\langle G (x _ {1}) - G (x _ {2}), G (x _ {3}) - G (x _ {4}) \right\rangle \right| \\ \leq \epsilon \| G (x _ {1}) - G (x _ {2}) \| _ {2} \| G (x _ {3}) - G (x _ {4}) \| _ {2}. \tag {4} \\ \end{array} +$$ + +We assume that each matrix $W^{(i)}$ in the network $G$ satisfies WDC and that the matrix $A$ satisfies RRIC. Such assumptions hold for random matrices: + +Theorem A.3. Let $\epsilon > 0$ . Suppose that each entry of each weight matrix $W^{(i)} \in \mathbb{R}^{n_i \times n_{i-1}}$ is drawn i.i.d. $N(0,1)$ , and suppose that each entry of $A \in \mathbb{R}^{m \times k}$ is drawn i.i.d. Further, suppose that for all $i = 1, \dots, d$ , $n_i / n_{i-1} \geq C\epsilon^{-2}\log(1 / \epsilon)$ and suppose that $m \geq C\epsilon^{-1}\log(1 / \epsilon)dn\log(\prod_{i=1}^d n_i)$ , where $n = n_0$ and $C > 0$ is a universal constant. Then, with probability $1 - e^{-cn}$ , WDC is satisfied for all matrices $W^{(i)}$ and RRIC is satisfied for $A$ . + +We prove the following theorem, which assumes that WDC and RRIC are satisfied: + +Theorem A.4. Consider the Markov Chain defined by the following Langevin Dynamics: + +$$ +z _ {t + 1} = z _ {t} - \eta \nabla f (z _ {t}) + \sqrt {2 \eta \beta^ {- 1}} u \tag {5} +$$ + +where $u \sim N(0, I_n)$ is a zero-mean, unit variance Gaussian vector; $G(z)$ is a fully-connected $d$ -layer ReLU neural network, + +$$ +G (z) = \operatorname {R e L U} \left(W ^ {(d)} \left(\dots \operatorname {R e L U} \left(W ^ {(1)} z\right) \dots\right)\right) +$$ + +and $f(z)$ is the loss function: + +$$ +f (z) = \beta \| A G (z) - y \| _ {2} ^ {2} +$$ + +where $A\in \mathbb{R}^{n_d\times k}$ , and $y = AG(z^{*})$ , for some unknown vector $z^{*}\in \mathbb{R}^{n}$ . + +Define $\mu (z)\propto e^{-f(z)}$ and denote by $Z_{t}$ the distribution over $z_{t}$ , i.e. the t'th step of the dynamics. Then, there exist constants $C_1,C_2,C_3,C_4$ that depend only on $d$ such that the following holds: For any $\epsilon >0$ and for $t\geq C_1\log (1 / \epsilon) / \epsilon^2$ + +$$ +\begin{array}{l} \mathcal{W}(Z_{t},\mu):= \inf_{Q\in \{couplings~of~Z_{t},\mu \}}\mathbb{E}_{(z_{t},z)\sim Q}\| z_{t} - z\| \\ \leq (\epsilon + e ^ {- C _ {2} n}) \| z ^ {*} \|, \\ \end{array} +$$ + +provided that $C_3\epsilon^2 \leq \eta \leq 1000C_3\epsilon^2$ , that $\beta = C_4n$ , that $\| z_0 \| \leq 1000 \| z^* \|$ , that $W^{(i)}$ and $A$ satisfy conditions WDC and RRIC with constant $\mathrm{poly}(\epsilon)$ and that $d \geq 2$ . (above, 1000 can be replaced by any other constant) + +# B. Proof + +# B.1. Overview + +We start by some preliminaries and definitions in Sections B.2, B.3 and B.4. Then, we analyze the loss function in Section B.5. Next, we show that with high probability, the norm of the iterates will neither be very small nor very large, in Section B.6 and Section B.7. Afterwards, we define a modified loss function, that is changed around the origin, in Section B.8. This change is necessary because the original loss function is not smooth next to the origin, and it is significantly simpler to analyze smooth losses. Since the norm of the iterate is not small with high probability, this change will not be apparent in the dynamics. Later, we would like to argue that the iterates will converge to some region around the optimum. In Section B.9 we argue that in order to show that the iterates converge to some region, it is sufficient to construct a potential function whose Laplacian is negative outside this region. Then, in Section B.10 we define such potential, concluding that the iterates converge to some region around the optimum. In that region, the function is convex. In Section B.11 we show that if the function is convex, then we can couple the continuous and discrete iterations such that they get closer and closer. In order to apply this argument, we have to guarantee that the iterates do not leave the convexity region. Indeed, in Section B.12 we show that if the iterates are already in a convexity region, they will stay there, enabling them to get closer, until they are $\epsilon$ -apart. + +# B.2. Preliminaries on polar coordinates + +We start with some preliminaries. Denote by $\vec{\cdot}$ any vector from $\mathbb{R}^n$ . Denote $e_1 = (1,0,\dots,0)$ . Given any $\vec{x}$ , denote by $r = r(\vec{x}) = \| \vec{x} \|_2$ , and denote by + +$$ +\theta = \theta (\vec {x}) = \operatorname {a r c c o s} \left(\frac {\langle x , e _ {1} \rangle}{\| \vec {x} \| \| e _ {1} \|}\right) = \operatorname {a r c c o s} \left(\frac {\langle \vec {x} , e _ {1} \rangle}{\| x \|}\right) +$$ + +the angle $\theta \in [0,\pi ]$ between $\vec{x}$ and $e_1$ . Denote + +$$ +\vec {r} = \vec {r} (\vec {x}) = \nabla_ {\vec {x}} r (\vec {x}) = \frac {\vec {x}}{\| \vec {x} \|} +$$ + +and + +$$ +\vec {\theta} = \vec {\theta} (\vec {x}) = \frac {\nabla_ {\vec {x}} \theta (\vec {x})}{\| \nabla_ {\vec {x}} \theta (\vec {x}) \|} = \frac {\cos (\theta (\vec {x}))}{\sin (\theta (\vec {x}))} \frac {\vec {x}}{\| \vec {x} \|} - \frac {e _ {1}}{\sin (\theta (\vec {x}))}. +$$ + +We will use $\theta, r, \vec{\theta}, \vec{r}$ without writing $\vec{x}$ when $\vec{x}$ is clear from context. We have the following properties: + +Lemma B.1. Let $\vec{x} \in \mathbb{R}^n$ , denote by $V^\perp$ the vector space that is the orthogonal complement to $\operatorname{span}(\vec{\theta}(\vec{x}), \vec{r}(\vec{x}))$ as a subspace of $\mathbb{R}^n$ and let $\vec{\psi}_1, \ldots, \vec{\psi}_{n-2}$ denote an orthonormal basis of $V^\perp$ . Then: + +1. The set $\{\vec{r}(\vec{x}), \vec{\theta}(\vec{x}), \vec{\psi}_1, \dots, \vec{\psi}_{n-2}\}$ forms an orthonormal basis to $\mathbb{R}^n$ . In particular, $\|\vec{r}(\vec{x})\| = \|\vec{\theta}(\vec{x})\| = 1$ and $\langle \vec{r}(\vec{x}), \vec{\theta}(\vec{x}) \rangle = 0$ . + +2. Let $f\colon [0,\infty) \times [0,\pi] \to \mathbb{R}$ be a $C^2$ function. Denote + +$$ +f _ {r} = \frac {\partial f}{\partial r}, \quad f _ {\theta} = \frac {\partial f}{\partial \theta}, \quad f _ {r r} = \frac {\partial^ {2} f}{\partial r ^ {2}}, \quad f _ {\theta \theta} = \frac {\partial^ {2} f}{\partial \theta^ {2}}, \quad f _ {r \theta} = f _ {\theta r} = \frac {\partial^ {2} f}{\partial r \partial \theta}. +$$ + +Denote $r = r(\vec{x})$ , $\theta = \theta (\vec{x})$ , $\vec{r} = \vec{r} (\vec{x})$ , $\vec{\theta} = \vec{\theta} (\vec{x})$ , $f_{r} = f_{r}(r,\theta)$ , $f_{\theta}(r,\theta)$ etc. Then, + +$$ +\nabla_ {\vec {x}} f (r (\vec {x}), \theta (\vec {x})) = f _ {r} \vec {r} + \frac {f _ {\theta}}{r} \vec {\theta}. +$$ + +Further, the Hessian of $f(r(\vec{x}), \theta(\vec{x}))$ with respect to $\vec{x}$ equals + +$$ +\nabla_ {\vec {x}} ^ {2} f (r (\vec {x}), \theta (\vec {x})) = f _ {r r} \vec {r} \vec {r} ^ {\top} + \left(\frac {f _ {r}}{r} + \frac {f _ {\theta \theta}}{r ^ {2}}\right) \vec {\theta} \vec {\theta} ^ {\top} + \left(\frac {f _ {r \theta}}{r} - \frac {f _ {\theta}}{r ^ {2}}\right) \left(\vec {r} \vec {\theta} ^ {\top} + \vec {\theta} \vec {r} ^ {\top}\right) + \left(\frac {f _ {r}}{r} + \frac {f _ {\theta}}{r ^ {2} \tan (\theta)}\right) \left(\sum_ {i = 1} ^ {n - 2} \vec {\psi} _ {i} \vec {\psi} _ {i} ^ {\top}\right). +$$ + +# 3. It holds that + +$$ +\triangle f = \sum_ {i = 1} ^ {n} \frac {d ^ {2} f}{d x _ {i} ^ {2}} = f _ {r r} + \left(\frac {f _ {r}}{r} + \frac {f _ {\theta \theta}}{r ^ {2}}\right) + (n - 2) \left(\frac {f _ {r}}{r} + \frac {f _ {\theta}}{r ^ {2} \tan (\theta)}\right) = f _ {r r} + (n - 1) \frac {f _ {r}}{r} + \frac {f _ {\theta \theta}}{r ^ {2}} + (n - 2) \frac {f _ {\theta}}{r ^ {2} \tan \theta}. +$$ + +4. Assume that for all $\vec{x}$ + +$$ +\max \left(\left| f _ {r r} \right|, \left| \frac {f _ {r}}{r} + \frac {f _ {\theta \theta}}{r ^ {2}} \right|, \left| \frac {f _ {r \theta}}{r} - \frac {f _ {\theta}}{r ^ {2}} \right|, \left| \frac {f _ {r}}{r} + \frac {f _ {\theta}}{r ^ {2} \tan (\theta)} \right|\right) \leq s / 2. +$$ + +Then, $f$ is $s$ -smooth. + +Proof. The first two items are folklore, and follow from a simple application of the chain rule. The third item follows from the fact that for any orthonormal basis $B = \{\vec{u}_1,\dots \vec{u}_n\}$ of $\mathbb{R}^n$ , $\triangle f$ equals the trace of the Hessian of $f$ , computed with respect to the basis $B$ . In particular, the entries of the Hessian with respect to the basis $\{\vec{r},\vec{\theta},\vec{\psi}_1,\ldots ,\vec{\psi}_{n - 2}\}$ are computed in item 2 and the trace equals the formula in item 3, as required. For the forth item, it holds that $f$ is $s$ -smooth if the spectral norm of $\nabla^2 f$ is bounded by $s$ , while the Hessian $\nabla^2 f$ can be computed with respect to any orthonormal basis. We will write the Hessian with respect to the basis defined in item 1, and the Hessian's coefficients are computed in item 2. Since the Hessian is symmetric, its spectral norm is bounded by the $\infty$ -norm, which is the maximum over the rows of the sum of absolute values, namely, $\| A\|_{\infty} = \max_i\sum_j|A_{ij}|$ . The infinity norm of the Hessian is bounded by $s$ , using the formula computed in item 2 and using the assumption of item 4. + +# B.3. Definitions of Langevin dynamics + +Assuming some potential function $H\colon \mathbb{R}^n\to \mathbb{R}$ and parameters $\eta ,\beta$ . The Langevin dynamics can be defined by + +$$ +\vec {x} _ {t} = \vec {x} _ {t - 1} - \eta \nabla H (\vec {x}) + \vec {z} _ {t} +$$ + +where $\vec{z}_t \sim N(\vec{0}, \sigma^2 I_n)$ , $\sigma^2 \coloneqq 2\eta/\beta$ . It is known that in the limit where $\eta \to 0$ (and under some regularity assumptions) the distribution of $\vec{x}_t$ as $t \to \infty$ converges to + +$$ +\mu_ {\beta H} (\vec {x}) := \frac {e ^ {- \beta H (\vec {x})}}{\int_ {\mathbb {R} ^ {n}} e ^ {- \beta H (\vec {y})} d \vec {y}}. +$$ + +Denote the distribution of $\vec{x}_t$ by $\mu_{\beta H,t}$ . + +# B.4. Setting + +We will use the same network as suggested by Huang et al. (2021) (multiplying the weights by 2 for convenience): given an input $\vec{x}$ , the network is given by + +$$ +G (\vec {x}) = \operatorname {R e L U} (2 W ^ {d} (\dots (\operatorname {R e L U} (2 W ^ {1} (\vec {x}))) \cdot \cdot \cdot)). +$$ + +A compressive map $A$ is applied on the outcome, for obtaining an output of $AG(\vec{x})$ . The goal is to recover some unknown $G(\vec{x}^*)$ , given the measurement $AG(\vec{x}^*)$ . We assume that each $W^i$ satisfies the Weight Distribution Condition and that $A$ satisfies Range Restricted Isometry Condition (Huang et al., 2021), both with parameter $\delta$ . As shown by (Huang et al., 2021), this implies that + +$$ +\forall \vec {x}, \vec {y}: | \angle (\operatorname {R e L U} (2 W ^ {i} (\vec {x})), \operatorname {R e L U} (2 W ^ {i} (\vec {y}))) - g (\angle (\vec {x}, \vec {y})) | \leq f (\delta), +$$ + +where $f(\delta)\to 0$ as $\delta \rightarrow 0$ , $\angle (\vec{x},\vec{y})\in [0,\pi ]$ is the angle between $\vec{x}$ and $\vec{y}$ and + +$$ +g (\theta) = \arccos \left(\frac {(\pi - \theta) \cos \theta + \sin \theta}{\pi}\right). +$$ + +Further, + +$$ +\left| \left\| \operatorname {R e L U} \left(2 W ^ {i} (\vec {x})\right) \right\| - \left\| \vec {x} \right\| \right| \leq f (\delta) \| \vec {x} \| +$$ + +and + +$$ +\forall \vec {x}: | | A \vec {x} | | - \| \vec {x} \| | \leq f (\delta) \| \vec {x} \|. +$$ + +The loss function is + +$$ +\tilde {L} (\vec {x}) = \left\| A G (\vec {x}) - A G \left(\vec {x} ^ {*}\right) \right\| ^ {2} / 2. +$$ + +Let us compute the loss function assuming that $\delta = 0$ . There, $f(\delta) = 0$ and further + +$$ +\left\| A G (\vec {x}) - A G \left(\vec {x} ^ {*}\right) \right\| ^ {2} / 2 = \left\| G (\vec {x}) - G \left(\vec {x} ^ {*}\right) \right\| ^ {2} / 2. +$$ + +Additionally, $\delta = 0$ implies that $\| G\vec{x}^{*}\| = \| \vec{x}^{*}\|$ , $\| G\vec{x}\| = \| \vec{x}\|$ for all $\vec{x}$ and $\theta_d(\vec{x})\coloneqq \angle (G(\vec{x}),G(\vec{x}^*)) = g^{\circ d}(\angle (\vec{x},\vec{x}^*))$ where $g^{\circ d}$ is a composition of $g$ for $d$ iterations. Assuming that $\vec{x}^{*} = (1,0,\dots ,0)$ , and denoting by $\theta (\vec{x}) = \angle (\vec{x},\vec{x}^{*})$ we have that + +$$ +\left\| G (\vec {x}) - G \left(\vec {x} ^ {*}\right) \right\| ^ {2} = \left(\left\| \vec {x} \right\| \cos \theta_ {d} (\vec {x}) - 1\right) ^ {2} + \left(\left\| \vec {x} \right\| \sin \theta_ {d} (\vec {x})\right) ^ {2} = \left\| \vec {x} \right\| ^ {2} - 2 \| x \| \cos \theta_ {d} (\vec {x}) + 1. +$$ + +Denote by $L(\vec{x})$ the value of the loss function $\tilde{L} (\vec{x})$ when $\delta = 0$ . As computed above, + +$$ +L (\vec {x}) = \| \vec {x} \| ^ {2} / 2 - \| x \| \cos \theta_ {d} (\vec {x}) + 1 / 2. +$$ + +Huang et al. (2021) have shown that the gradients of $L$ are close to the gradients of $\tilde{L}$ , under the above assumptions on the weights, in the following sense: + +$$ +\forall \vec {x}: \| \nabla L (\vec {x}) - \nabla \tilde {L} (\vec {x}) \| \leq (\| \vec {x} \| + 1) f (\delta , d), \tag {6} +$$ + +for some $f(\delta, d)$ that decays to zero as $\delta \to 0$ while keeping $d$ fixed. + +It is sufficient to assume that $\vec{x}^* = e_1$ , since Langevin dynamics is indifferent to scaling and rotations. Yet, once we consider $\vec{x}^*$ such that $\| \vec{x}^* \| \neq 1$ , the error has to be multiplied by $\| \vec{x}^* \|$ . + +Notation. When using $O(\cdot)$ -notation, we will ignore constants that depend on the depth $d$ of the network. Given some parameter, e.g. $l > 0$ , we denote by $C(l)$ a constant that may depend only on $l$ (and perhaps also on the depth $d$ ), but not on the other parameters, in particular, not on $n$ . We will use $C, c$ to denote positive constants that depend only on $d$ (and perhaps on other parameters that are explicitly defined as constants). + +# B.5. Properties of the loss function + +Define by $\theta_d' = \frac{dg^{\circ d}(\theta)}{d\theta}$ . And similarly define $\theta_d''$ as the second derivative. The loss function $L(\vec{x})$ can be computed as a function of $r = r(\vec{x})$ and $\theta = \theta(\vec{x})$ , by the formula + +$$ +L (r, \theta) = r ^ {2} / 2 - r \cos \left(g ^ {\circ d} (\theta)\right) + 1 / 2 = r ^ {2} / 2 - r \cos \theta_ {d} + 1 / 2, +$$ + +and the corresponding derivatives of $L$ as a function of $r$ and $\theta$ equal: + +$L_{r} = r - \cos \theta_{d}$ +$L_{\theta} = r\sin \theta_{d}\theta_{d}^{\prime}$ +$L_{rr} = 1$ +$L_{\theta \theta} = r\cos \theta_d(\theta_d^{\prime})^2 +r\sin \theta_d\theta_d^{\prime \prime}$ +$L_{r\theta} = \sin \theta_d\theta_d^{\prime}$ + +Consequently, we have by Lemma B.1: + +$$ +\nabla L (\vec {x}) = (r - \cos \theta_ {d}) \vec {r} + \sin \theta_ {d} \theta_ {d} ^ {\prime} \vec {\theta}, +$$ + +and + +$$ +\nabla^ {2} L = \vec {r} \vec {r} ^ {\top} + \frac {r - \cos \theta_ {d} + \cos \theta_ {d} \left(\theta_ {d} ^ {\prime}\right) ^ {2} + \sin \theta_ {d} \theta_ {d} ^ {\prime \prime}}{r} \vec {\theta} \vec {\theta} ^ {\top} + \sum_ {i = 1} ^ {n - 2} \frac {(r - \cos \theta_ {d}) \sin \theta + \sin \theta_ {d} \theta_ {d} ^ {\prime} \cos \theta}{r \sin \theta} \vec {\psi_ {i}} \vec {\psi_ {i}} ^ {\top}. \tag {7} +$$ + +Before proceeding, let us analyze the function $g$ and consequently, $\theta_d^{\prime}$ and $\theta_d^{\prime \prime}$ : + +Lemma B.2. Let $g'$ and $g''$ denote the first and second derivatives of $g$ . Then, $g$ is decreasing, $g'(\theta) \in [0,1]$ and $g''(\theta) \leq 0$ . Consequently, $\theta_d' \in [0,1]$ while $\theta_d'' \leq 0$ . + +Proof. The properties of $g$ follow directly by computing the derivatives of $g$ and they were analyzed by Huang et al. (2021). The derivative of $\theta_d$ can be computed using the composition rule: + +$$ +\theta_ {d} ^ {\prime} = \frac {d g ^ {\circ d} (\theta)}{d \theta} = \prod_ {i = 0} ^ {d - 1} g ^ {\prime} \left(g ^ {\circ i} (\theta)\right) \in [ 0, 1 ]. \tag {8} +$$ + +Notice that $\theta_d^{\prime \prime}$ is the derivative of (8) and it is non-positive as $g''(\theta)\leq 0$ + +We have the following: + +Lemma B.3. Let $0 < r < R$ . Then the loss $L$ is $C(r, R)$ -Lipschitz in $K = \{\| x\| : r \leq \| \vec{x}\| \leq R\}$ and $C(r)$ -smooth in $K' = \{\| x\| : r \leq \| \vec{x}\| \}$ . + +Proof. First of all, we prove that the function is Lipschitz and smooth in $K$ , and then we extend the smoothness to $K'$ . It is sufficient to use Lemma B.1, and argue that the coefficients in the expansion of $\nabla L$ and $\nabla^2 L$ are bounded in absolute value in $K$ . First, it is easy to verify that the two derivatives of $g$ are finite, which implies that $\theta_d', \theta_d''$ are bounded. Further, $r$ is bounded from below by assumption, hence, the only coefficient that could possibly go to infinity is + +$$ +\frac {(r - \cos \theta_ {d}) \sin \theta + \sin \theta_ {d} \theta_ {d} ^ {\prime} \cos \theta}{r \sin \theta} = \frac {(r - \cos \theta_ {d})}{r} + \frac {\sin \theta_ {d} \theta_ {d} ^ {\prime} \cos \theta}{r \sin \theta}. +$$ + +In fact, the quantity that can possibly go to infinity in $K$ is + +$$ +\frac {\sin \theta_ {d} \theta_ {d} ^ {\prime} \cos \theta}{r \sin \theta}. \tag {9} +$$ + +since it has $\sin \theta$ in its denominator and $\sin \theta$ can be zero. Yet we would like to argue that when the denominator goes to zero, the numerator goes to 0 as well and the ratio does not go to infinity. Notice that the numerator contains the term $\theta_d = g^{\circ d}(\theta)$ . Since $g(\theta) \leq \theta$ (Huang et al., 2021) we derive that $\theta_d = g^{\circ d}(\theta) \leq \theta$ . If $\theta \leq \pi/2$ then we have $0 \leq \sin \theta_d \leq \sin \theta$ which implies that the ratio in (9) is bounded. Otherwise, $\theta \geq \pi/2$ and the denominator can go to 0 only when $\theta \to \pi$ . We would like to argue that the numerator also goes to 0 in this case. Indeed, + +$$ +\theta_ {d} ^ {\prime} = \frac {d g ^ {\circ d} (\theta)}{d \theta} = \prod_ {i = 0} ^ {d - 1} g ^ {\prime} (g ^ {\circ i} (\theta)) \leq g ^ {\prime} (\theta), +$$ + +since $0 \leq g' \leq 1$ (Huang et al., 2021), where $g'(\theta) = dg(\theta) / d\theta$ . Further, $g'(\theta) \to 0$ as $\theta \to \pi$ . Hence, by L'Hopital's rule, + +$$ +\limsup_{\theta \to \pi}\frac{\theta^{\prime}_{d}}{\sin\theta} = \limsup_{\theta \to \pi}\frac{\theta^{\prime\prime}_{d}}{\cos\theta} < \infty , +$$ + +using the fact that $\theta_d''$ as argued above. By continuity, $\theta_d'/\sin \theta$ is uniformly bounded in $[0, \pi]$ , which implies that (9) is uniformly bounded, as required. + +Notice that the smoothness holds also over all of $K'$ , since, from the form of the second derivative and the arguments above, it is clear that these do not go to $\infty$ as $r \to \infty$ . + +Further, we use the following lemma from Huang et al. (2021): + +Lemma B.4. There exist only three points where the gradient of $L$ possibly equals 0: at the optimum $\vec{x}^*$ , at $\vec{x} = -\vec{x}^* \cos g^{\circ d}(\pi)$ , and at 0. + +We note the at 0 there is a local max, at $\vec{x}^*$ a local min and at $-\vec{x}^*\cos g^{\circ d}(\pi)$ a saddle point, that is a minimum with respect to $r$ and a maximum with respect to $\theta$ . + +We add the following lemma: + +Lemma B.5. Let $l > 0$ . There exists a constant $C(l) > 0$ (independent of $n$ ) such that if $\vec{x}$ is at least $l$ -far apart from any point where the gradient vanishes (in $l_2$ -norm), then $\| \nabla L(\vec{x}) \| \geq C(l)$ . + +Proof. Notice first that as $\| \vec{x} \| \to \infty$ then the gradient-norm goes to infinity. Hence, it is sufficient to assume that $\| \vec{x} \| \leq M$ for some sufficiently large $M$ . Secondly, notice that both the distance of $\vec{x}$ from any stationary point, and the norm of its gradient, are only functions of $r(\vec{x}) = \| \vec{x} \|$ and $\theta(\vec{x})$ . Let $K$ be the set of pairs $(r, \theta)$ such that (1) $r \leq M$ and (2) $(r, \theta)$ signify a point of distance at least $l$ from any stationary point. This set is compact, hence the continuous function $(r, \theta) \to \| \nabla L(r, \theta) \|$ has a minimum in $K$ , which is non-zero since we assumed that $K$ does not contain any stationary point. + +Further, we have the following lemma: + +Lemma B.6. There exists some constant $l > 0$ such that the function is 0.9-strongly convex in a ball of radius $\ell$ around $\vec{x}^*$ . + +Proof. First of all, we will prove that the Hessian is PSD at $\vec{x}^*$ . For this purpose, it is sufficient to prove that all the coefficients in (7) are positive at $\vec{x}^*$ , since the basis $\vec{r},\vec{\theta},\vec{\psi}_1,\dots ,\vec{\psi}_{n - 1}$ is orthonormal, as stated in Lemma B.1. The coefficient that multiplies $\vec{r}\vec{r}^{\top}$ is $1 > 0$ . The second coefficient is + +$$ +\frac {r - \cos \theta_ {d} + \cos \theta_ {d} (\theta_ {d} ^ {\prime}) ^ {2} + \sin \theta_ {d} \theta_ {d} ^ {\prime \prime}}{r}. +$$ + +We have that $r(\vec{x}^{*}) = 1$ , $\theta (\vec{x}^{*}) = 0$ , and $\theta_{d}(\vec{x}^{*}) = g^{\circ d}(\theta (\vec{x}^{*})) = g^{\circ d}(0) = 0$ since $g(0) = 0$ . Further, $\theta_d^\prime (\vec{x}^*) = 1$ as $\frac{dg(\theta)}{d\theta}\big|_{\theta = 0} = 1$ . Hence, + +$$ +\frac {r - \cos \theta_ {d} + \cos \theta_ {d} (\theta_ {d} ^ {\prime}) ^ {2} + \sin \theta_ {d} \theta_ {d} ^ {\prime \prime}}{r} = \frac {1 - 1 + 1 + 0}{1} = 1. +$$ + +For the last coefficient in (7), we have + +$$ +\frac {\left(r - \cos \theta_ {d}\right) \sin \theta + \sin \theta_ {d} \theta_ {d} ^ {\prime} \cos \theta}{r \sin \theta} = \frac {\left(r - \cos \theta_ {d}\right)}{r} + \frac {\sin \theta_ {d} \theta_ {d} ^ {\prime} \cos \theta}{r \sin \theta}. \tag {10} +$$ + +The first term is 0, while the second term is undefined, yet, can be computed using the limit $\theta \to 0$ . In particular, using the calculations above and L-Hopital's rule, + +$$ +\lim _ {\theta \to 0} \frac {\sin \theta_ {d}}{\sin \theta} = \lim _ {\theta \to 0} \frac {\cos \theta_ {d} \theta_ {d} ^ {\prime}}{\cos \theta} = 1. +$$ + +In particular, the second term in (10) equals 1, hence $\nabla^2 L(\vec{x}^*) = I_n$ . The minimal eigenvalue of the Hessian at $\vec{x}$ , which is the minimal of the three coefficients in (7), is a function only of $r(\vec{x})$ and $\theta (\vec{x})$ . By continuity, there exists a neighborhood $U\subseteq [0,\infty)\times [0,2\pi ]$ or pairs $(r,\theta)$ , that contains the point $(r,\theta) = (1,0)$ , such that $\nabla^2 (\vec{x})\succeq 0.9I_n$ , for any $\vec{x}$ such that $(r(\vec{x}),\theta (\vec{x}))\in U$ . This proves the result. + +Lastly, let us analyze $\triangle L(\vec{x})$ . This will be useful later in the proof. + +# Lemma B.7. + +$$ +\triangle L \leq \left\{ \begin{array}{l l} 2 + (n - 2) (r - \cos \theta_ {d}) / r & \theta \geq \pi / 2 \\ n & \theta \leq \pi / 2 \end{array} \right. +$$ + +Proof. Using Lemma B.1, we have that, + +$$ +\triangle L = 1 + \frac {r - \cos \theta_ {d} + \cos \theta_ {d} \left(\theta_ {d} ^ {\prime}\right) ^ {2} + \sin \theta_ {d} \theta_ {d} ^ {\prime \prime}}{r} + (n - 2) \frac {(r - \cos \theta_ {d}) \sin \theta + \sin \theta_ {d} \theta_ {d} ^ {\prime} \cos \theta}{r \sin \theta}. \tag {11} +$$ + +First, + +$$ +\frac {r - \cos \theta_ {d} + \cos \theta_ {d} \left(\theta_ {d} ^ {\prime}\right) ^ {2} + \sin \theta_ {d} \theta_ {d} ^ {\prime \prime}}{r} \leq 1, \tag {12} +$$ + +since $-\cos \theta_d + \cos \theta_d(\theta_d')^2 \leq 0$ , and $\sin \theta_d\theta_d'' \leq 0$ (as follows from the fact that $g'(\theta) \in [0,1]$ hence $\theta_d' = \frac{dg^{\circ d}(\theta)}{d\theta} \in [0,1]$ , and $g''(\theta) \leq 0$ hence $\theta_d'' \leq 0$ ). To bound the last term in (11), first assume that $\theta \geq \pi/2$ . Then, + +$$ +\frac {(r - \cos \theta_ {d}) \sin \theta + \sin \theta_ {d} \theta_ {d} ^ {\prime} \cos \theta}{r \sin \theta} \leq \frac {r - \cos \theta_ {d}}{r} +$$ + +since $\sin \theta_d \geq 0$ , $\theta_d' \geq 0$ and $\cos \theta \leq 0$ . We conclude that + +$$ +\Delta L \leq 2 + (n - 2) \frac {r - \cos \theta_ {d}}{r}. +$$ + +Next, for $\theta \leq \pi /2$ , we have that + +$$ +\frac {(r - \cos \theta_ {d}) \sin \theta + \sin \theta_ {d} \theta_ {d} ^ {\prime} \cos \theta}{r \sin \theta} \leq \frac {r - \cos \theta_ {d} + \cos \theta}{r} \leq 1, +$$ + +using $0 \leq \sin \theta_d \leq \sin \theta$ , $\theta_d' \in [0,1]$ and $0 \leq \cos \theta \leq \cos \theta_d$ . This concludes the proof, in combination with (11) and (12). + +# B.6. Escaping from the origin + +Since the loss function is not well behaved around the origin, we want to show that the dynamics do not approach the origin with high probability, as stated below: + +Lemma B.8. Fix $t \geq 3 / \eta$ , define $A = \cos g^{\mathrm{od}}(\pi)$ , and assume that we run the Langevin dynamics according to $\tilde{L}$ . Define $\beta = 2\eta / \sigma^2$ , as in Section B.3. Then, for any $a > 0$ + +$$ +\operatorname * {P r} \left[ \| \vec {x} _ {t} \| < 0. 9 A - a \right] \leq e ^ {- \beta a ^ {2} / 4}. +$$ + +The remainder of this subsection is devoted for the proof of this Lemma. Let us write the update rule: + +$$ +\begin{array}{l} \vec {x} _ {t + 1} = \vec {x} _ {t} - \eta \nabla \tilde {L} (\vec {x}) + \vec {z} _ {t + 1} = \vec {x} _ {t} - \eta \nabla L (\vec {x}) - \eta (\nabla \tilde {L} (\vec {x}) - \nabla L (\vec {x})) + \vec {z} _ {t + 1} \\ = \vec {x} _ {t} - \eta (r - \cos \theta_ {d}) \vec {r} - \eta \sin \theta_ {d} \theta_ {d} ^ {\prime} \vec {\theta} + \vec {z} _ {t + 1} - \eta (\nabla \tilde {L} (\vec {x}) - \nabla L (\vec {x})) \\ \end{array} +$$ + +where $r, \vec{r}, \vec{\theta}$ etc. refer to $\vec{x}_t$ (as defined in Section B.2). We will define the following intermediate random variables, that help us transferring from $\vec{x}_t$ to $\vec{x}_{t+1}$ : + +$$ +\begin{array}{l} \vec {x} _ {t} ^ {\prime} = \vec {x} _ {t} - \eta (r - \cos \theta_ {d}) \vec {r} = r \vec {r} - \eta (r - \cos \theta_ {d}) \vec {r} = (r - \eta r + \eta \cos \theta_ {d}) \vec {r}, \\ \vec {x} _ {t} ^ {\prime \prime} = \vec {x} _ {t} ^ {\prime} - \eta \sin \theta_ {d} \theta_ {d} ^ {\prime} \vec {\theta}, \\ \vec {x} _ {t} ^ {\prime \prime \prime} = \vec {x} _ {t} ^ {\prime \prime} + \langle \vec {z} _ {t + 1}, \vec {r} (\vec {x} _ {t} ^ {\prime \prime}) \rangle \vec {r} (\vec {x} _ {t} ^ {\prime \prime}), \\ \end{array} +$$ + +$$ +\vec {x} _ {t} ^ {(4)} = \vec {x} _ {t} ^ {\prime \prime \prime} + \vec {z} _ {t + 1} - \langle \vec {z} _ {t + 1}, \vec {r} (\vec {x} _ {t} ^ {\prime \prime}) \rangle \vec {r} (\vec {x} _ {t} ^ {\prime \prime}) +$$ + +and notice that + +$$ +\vec {x} _ {t + 1} = \vec {x} _ {t} ^ {(4)} - \eta (\nabla \tilde {L} (\vec {x}) - \nabla L (\vec {x})). +$$ + +We will lower bound $\| \vec{x}_{t + 1} \|$ as a function of $x_{t}$ and of $\vec{z}_{t + 1}$ . First, we will lower bound the norms of these intermediate variables. Notice that + +$$ +\| \vec {x} _ {t} ^ {\prime} \| = | r - \eta r + \eta \cos \theta_ {d} | = (1 - \eta) \| \vec {x} _ {t} \| + \eta \cos \theta_ {d} \geq (1 - \eta) \| \vec {x} _ {t} \| + \eta A, +$$ + +where we use the fact by monotonicity of $g(\theta)$ (Lemma B.2), + +$$ +\theta_ {d} = g ^ {\circ d} (\theta) \leq g ^ {\circ d} (\pi) \Rightarrow \cos \theta_ {d} \geq \cos g ^ {\circ d} (\pi) := A. +$$ + +Further, notice that $\vec{x}_t^{\prime}$ is a multiple of $\vec{r}$ , and that $\vec{r}$ and $\vec{\theta}$ are orthogonal unit vectors by Lemma B.1, hence, + +$$ +\| \vec {x} _ {t} ^ {\prime \prime} \| = \sqrt {\| \vec {x} _ {t} ^ {\prime} \| ^ {2} + \| \eta \sin \theta_ {d} \theta_ {d} ^ {\prime} \| ^ {2}} \geq \| \vec {x} _ {t} ^ {\prime} \|. +$$ + +Define $z_{t + 1} = \langle \vec{z}_{t + 1},\vec{r} (\vec{x}_t^{\prime \prime})\rangle$ . Notice that + +$$ +\| \vec {x} _ {t} ^ {\prime \prime \prime} \| = \| \vec {x} _ {t} ^ {\prime \prime} + z _ {t + 1} \vec {r} (\vec {x} _ {t} ^ {\prime \prime}) \| = \| \vec {r} (\vec {x} _ {t} ^ {\prime \prime}) (\| \vec {x} _ {t} ^ {\prime \prime} \| + z _ {t + 1}) \| = | \| \vec {x} _ {t} ^ {\prime \prime} \| + z _ {t + 1} | \geq \| \vec {x} _ {t} ^ {\prime \prime} \| + z _ {t + 1}, +$$ + +using the fact that by Lemma B.1, $\| \vec{r}(\vec{x}_t^{\prime \prime}) \| = 1$ . Recall that + +$$ +\vec {x} _ {t} ^ {(4)} = \vec {x} _ {t} ^ {\prime \prime \prime} + \vec {z} _ {t + 1} - \langle \vec {z} _ {t + 1}, \vec {r} (\vec {x} _ {t} ^ {\prime \prime}) \rangle \vec {r} (\vec {x} _ {t} ^ {\prime \prime}), +$$ + +and notice that $\vec{x}_t^{\prime \prime}$ is a multiple of $\vec{r} (\vec{x}_t^{\prime \prime})$ while $\vec{z}_{t + 1} - \langle \vec{z}_{t + 1},\vec{r} (\vec{x}_t^{\prime \prime})\rangle \vec{r} (\vec{x}_t^{\prime \prime})$ is perpendicular to $\vec{r} (\vec{x}_t^{\prime \prime})$ (namely, their inner product is 0). Hence, + +$$ +\| \vec {x} _ {t} ^ {(4)} \| = \sqrt {\| \vec {x} _ {t} ^ {\prime \prime \prime} \| ^ {2} + \| \vec {z} _ {t + 1} - \langle \vec {z} _ {t + 1} , \vec {r} (\vec {x} _ {t} ^ {\prime \prime}) \rangle \vec {r} (\vec {x} _ {t} ^ {\prime \prime}) \| ^ {2}} \geq \| \vec {x} _ {t} ^ {\prime \prime \prime} \|. +$$ + +Lastly, by the triangle inequality, + +$$ +\| \vec {x} _ {t + 1} \| = \| \vec {x} _ {t} ^ {(4)} - \eta (\nabla \tilde {L} (\vec {x}) - \nabla L (\vec {x})) \| \geq \| \vec {x} _ {t} ^ {(4)} \| - \eta \| \nabla \tilde {L} (\vec {x}) - \nabla L (\vec {x}) \| \geq \| \vec {x} _ {t} ^ {(4)} \| - \eta (\| \vec {x} _ {t} \| + 1) f (\delta , d), +$$ + +where the last inequality follows from (6) and $f(\delta, d) \to 0$ as $\delta \to 0$ . In particular, + +$$ +\left\| \vec {x} _ {t + 1} \right\| \geq \left\| \vec {x} _ {t} ^ {(4)} \right\| - \eta c (\left\| \vec {x} _ {t} \right\| + 1), +$$ + +where $c > 0$ can be chosen arbitrarily small, since $\delta$ can be chosen arbitrarily small (as assumed in this lemma). Combining all the above, we have + +$$ +\begin{array}{l} \| \vec {x} _ {t + 1} \| \geq \| \vec {x} _ {t} ^ {(4)} \| - \eta c (\| \vec {x} _ {t} \| + 1) \geq \| \vec {x} _ {t} ^ {\prime \prime \prime} \| - \eta c (\| \vec {x} _ {t} \| + 1) \geq \| \vec {x} _ {t} ^ {\prime \prime} \| + z _ {t + 1} - \eta c (\| \vec {x} _ {t} \| + 1) \\ \geq \left\| \vec {x} _ {t} ^ {\prime} \right\| + z _ {t + 1} - \eta c (\| \vec {x} _ {t} \| + 1) \geq (1 - \eta) \| \vec {x} _ {t} \| + \eta A + z _ {t + 1} - \eta c (\| \vec {x} _ {t} \| + 1) \\ = (1 - \eta - \eta c) \| \vec {x} _ {t} \| + \eta (A - c) + z _ {t + 1}, \tag {13} \\ \end{array} +$$ + +where $z_{t + 1} = \langle \vec{z}_{t + 1},\vec{r} (\vec{x}_t^{\prime \prime})\rangle$ . Since $\vec{z}_{t + 1}\sim N(\vec{0},\sigma^2 I)$ and since $\| \vec{r} (\vec{x}_t^{\prime \prime})\| = 1$ (see Section B.2), it holds that $z_{t}\sim N(0,\sigma^{2})$ . Further, since $\vec{z}_1,\vec{z}_2,\ldots$ are i.i.d., then $z_{1},z_{2},\ldots$ are i.i.d. By expanding the recursive inequality in Section 13, we derive that + +$$ +\left\| \vec {x} _ {t} \right\| \geq (1 - \eta - \eta c) ^ {t} \left\| \vec {x} _ {0} \right\| + \sum_ {i = 0} ^ {t - 1} (1 - \eta - \eta c) ^ {i} \eta (A - c) + \sum_ {i = 0} ^ {t - 1} (1 - \eta - \eta c) ^ {i} z _ {i}. \tag {14} +$$ + +Let us lower bound the three terms above. The first term will be bounded by 0. The second term equals + +$$ +\begin{array}{l} \sum_ {i = 0} ^ {t - 1} (1 - \eta - \eta c) ^ {i} \eta (A - c) = \frac {1 - (1 - \eta - \eta c) ^ {t}}{1 - (1 - \eta - \eta c)} \eta (A - c) \\ \geq (1 - (1 - \eta - \eta c) ^ {t}) (A - c) \geq (1 - (1 - \eta) ^ {t}) (A - c) \geq (1 - e ^ {- \eta t}) (A - c) \geq 0. 9 5 (A - c) \geq 0. 9 A. \\ \end{array} +$$ + +Here, we used that $(1 - \eta)^{t} \leq e^{-\eta t} \leq e^{-3} \leq 0.05$ , since $1 - x \leq e^{-x}$ for all $x \in \mathbb{R}$ and due to the assumption that $t \geq 3 / \eta$ , and further, we used the fact that $c > 0$ can be chosen arbitrarily small to bound $0.95(A - c) \geq 0.9A$ . It remains to bound the third term in the expansion of (14), which is a Gaussian random variable, with zero mean and its variance can be computed as: + +$$ +\begin{array}{l} \operatorname {V a r} \left(\sum_ {i = 0} ^ {t - 1} (1 - \eta - \eta c) ^ {i} z _ {t}\right) = \sum_ {i = 0} ^ {t - 1} \operatorname {V a r} ((1 - \eta - \eta c) ^ {i} z _ {t}) = \sum_ {i = 0} ^ {t - 1} (1 - \eta - \eta c) ^ {2 i} \sigma^ {2} \\ \leq \sum_ {i = 0} ^ {t - 1} (1 - \eta) ^ {2 i} \sigma^ {2} \leq \sum_ {i = 0} ^ {\infty} (1 - \eta) ^ {2 i} \sigma^ {2} = \frac {\sigma^ {2}}{1 - (1 - \eta) ^ {2}} = \frac {\sigma^ {2}}{2 \eta - \eta^ {2}} \leq \frac {\sigma^ {2}}{\eta} = \frac {2}{\beta}, \\ \end{array} +$$ + +recalling that we defined $\beta = 2\eta /\sigma^2$ . Denote by $z$ the random variable corresponding to the third term of (14), then we have just shown that $\operatorname {Var}(z)\leq 2 / \beta$ and that $\| \vec{x}_t\| \geq 0.9A - z$ . In order to conclude the proof, it is sufficient to bound $\operatorname *{Pr}[z > a]$ for any $a > 0$ . From standard concentration inequalities for Gaussians, we know that for any $a$ , + +$$ +\Pr [ z > a ] \leq e ^ {- a ^ {2} / 2 \operatorname {V a r} (z)} \leq e ^ {- a ^ {2} \beta / 4}, +$$ + +as required. + +# B.7. The norm is bounded from above + +Here we prove the following proposition: + +Proposition B.9. For any $t \geq 0$ , + +$$ +\operatorname * {P r} [ \| \vec {x} _ {t} \| \geq (1 - \eta / 2) ^ {t} \| \vec {x} _ {0} \| + C + C \sqrt {n / \beta} ] \leq e ^ {- n / C} +$$ + +for some universal $C > 0$ + +We write the gradient of the loss as + +$$ +\nabla \tilde {L} (\vec {x}) = \nabla L (\vec {x}) + \left(\nabla \tilde {L} (x) - \nabla L (\vec {x})\right) = \left(\| \vec {x} \| - \cos \theta_ {d} (\vec {x})\right) \vec {r} (\vec {x}) + \sin \theta_ {d} (\vec {x}) \theta_ {d} ^ {\prime} (\vec {x}) \vec {\theta} (\vec {x}) + \left(\nabla \tilde {L} (x) - \nabla L (\vec {x})\right) +$$ + +and the Langevin step is + +$$ +\vec {x} _ {t} = \vec {x} _ {t - 1} - \eta \nabla \tilde {L} (\vec {x}) + \vec {z} _ {t} +$$ + +where $\vec{z}_t\sim N(\vec{0},\sigma^2 I_n)$ .We have + +$$ +\vec {x} _ {t} = (1 - \eta) \vec {x} _ {t - 1} + \eta \vec {A} _ {t} + \eta \vec {B} _ {t} + \vec {z} _ {t}, +$$ + +where + +$$ +\vec {A} _ {t} := \cos \theta_ {d} \vec {r} + \sin \theta_ {d} \theta_ {d} ^ {\prime} \vec {\theta}, \quad \vec {B} _ {t} = \nabla \tilde {L} (x) - \nabla L (\vec {x}). +$$ + +Notice that + +$$ +\left\| \vec {A _ {t}} \right\| ^ {2} \leq \cos^ {2} \theta_ {d} + \sin^ {2} \theta_ {d} \left(\theta_ {d} ^ {\prime}\right) ^ {2} \leq \cos^ {2} \theta_ {d} + \sin^ {2} \theta_ {d} \leq 1 +$$ + +where we used that $\theta_d^\prime \leq 1$ (this follows from Lemma B.2). Further, by (6), + +$$ +\left\| \vec {B} _ {t} \right\| \leq \left(\left\| \vec {x} _ {t - 1} \right\| + 1\right) f (\delta , d), +$$ + +where $f(\delta, d) \to 0$ as $\delta \to 0$ . In particular, since we assume that $\delta$ can be chosen arbitrarily small, we can assume that $f(\delta, d) \leq c$ for some arbitrarily small constant $c > 0$ . + +Expanding on the definition of $\vec{x}_t$ , we have + +$$ +\vec {x} _ {t} = (1 - \eta) ^ {t} \vec {x} _ {0} + \sum_ {i = 1} ^ {t} (1 - \eta) ^ {t - i} \vec {z} _ {i} + \eta \sum_ {i = 1} ^ {t} (\vec {A} _ {i} + \vec {B} _ {i}) (1 - \eta) ^ {t - i}. +$$ + +Decompose $\vec{x}_t = \vec{y}_t + \vec{w}_t$ as follows: + +$$ +\vec {y} _ {t} = \sum_ {i = 1} ^ {t} (1 - \eta) ^ {t - i} \vec {z} _ {i}, \qquad \vec {w} _ {t} = (1 - \eta) ^ {t} \vec {x} _ {0} + \eta \sum_ {i = 1} ^ {t} (\vec {A} _ {i} + \vec {B} _ {i}) (1 - \eta) ^ {t - i}. +$$ + +Notice that + +$$ +\vec {w} _ {t} = (1 - \eta) \vec {w} _ {t - 1} + \eta (\vec {A} _ {t} + \vec {B} _ {t}). +$$ + +We have that + +$$ +\begin{array}{l} \| \vec {w} _ {t} \| \leq (1 - \eta) \| \vec {w} _ {t - 1} \| + \eta (\| \vec {A} _ {t} \| + \| \vec {B} _ {t} \|) \leq (1 - \eta) \| \vec {w} _ {t - 1} \| + \eta + \eta c (\| \vec {x} _ {t - 1} \| + 1) \\ \leq (1 - \eta) \| \vec {w} _ {t - 1} \| + \eta + \eta c (\| \vec {y} _ {t - 1} \| + \| \vec {w} _ {t - 1} \| + 1) \leq (1 - \eta + \eta c) \| \vec {w} _ {t - 1} \| + \eta c \| \vec {y} _ {t - 1} \| + \eta (1 + c), \\ \end{array} +$$ + +and $\| \vec{w}_0\| = \| \vec{x}_0\|$ . By expanding on this, we have that + +$$ +\| \vec {w} _ {t} \| \leq (1 - \eta + \eta c) ^ {t} \| \vec {x} _ {0} \| + \eta c \sum_ {i = 1} ^ {t - 1} (1 - \eta + \eta c) ^ {t - 1 - i} \| \vec {y} _ {i} \| + \eta (1 + c) \sum_ {i = 1} ^ {t} (1 - \eta + \eta c) ^ {t - i}. +$$ + +Hence, + +$$ +\| \vec {x} _ {t} \| \leq \| \vec {y} _ {t} \| + \| \vec {w} _ {t} \| \leq (1 - \eta + \eta c) ^ {t} \| \vec {x} _ {0} \| + \eta c \sum_ {i = 1} ^ {t} (1 - \eta + \eta c) ^ {t - i} \| \vec {y} _ {i} \| + \| \vec {y} _ {t} \| + \eta (1 + c) \sum_ {i = 1} ^ {t} (1 - \eta + \eta c) ^ {t - i}. +$$ + +Assuming that $c \leq 1/2$ , we have + +$$ +\eta (1 + c) \sum_ {i = 1} ^ {t} (1 - \eta + \eta c) ^ {t - i} \leq 1. 5 \eta \sum_ {i = 0} ^ {\infty} (1 - \eta / 2) ^ {i} = \frac {1 . 5 \eta}{1 - (1 - \eta / 2)} = 3. +$$ + +Assuming again that $c \leq 1/2$ , we have that + +$$ +\| \vec {x} _ {t} \| \leq (1 - \eta / 2) ^ {t} \| \vec {x} _ {0} \| + \sum_ {i = 1} ^ {t} (1 - \eta / 2) ^ {t - i} \| \vec {y} _ {i} \| + \| \vec {y} _ {t} \| + 3. +$$ + +Let us bound the term that corresponds to the $\vec{y}_i$ , and notice that these are isotropic Gaussians with variance bounded as follows: + +$$ +\begin{array}{l} \operatorname {V a r} \left(\vec {y} _ {t}\right) = \operatorname {V a r} \left(\sum_ {i = 1} ^ {t} (1 - \eta) ^ {t - i} \vec {z} _ {i}\right) = \sum_ {i = 1} ^ {t} \operatorname {V a r} \left((1 - \eta) ^ {t - i} \vec {z} _ {i}\right) = \sum_ {i = 1} ^ {t} (1 - \eta) ^ {2 t - 2 i} \sigma^ {2} I \preceq \sigma^ {2} \sum_ {i = 0} ^ {\infty} (1 - \eta) ^ {2 i} I \\ = \frac {\sigma^ {2}}{1 - (1 - \eta) ^ {2}} I = \frac {\sigma^ {2}}{2 \eta - \eta^ {2}} I \preceq \frac {\sigma^ {2} I}{\eta} = 2 \beta I, \\ \end{array} +$$ + +using the fact that $\eta \leq 1$ and recalling the definition of $\beta$ from Section B.3. We will use the following definition of a sub-Gaussian random variable: + +Definition B.10. A random variable $X$ is $L$ -subGaussian if $\mathbb{E}[\exp ((X - \mathbb{E}x) / (2L))]\leq 2$ . + +We have the following properties of a subGaussian random variable (Vershynin, 2018): + +Lemma B.11. Let $\vec{X} \sim N(\vec{0}, \sigma^2 I)$ . Then, $\|\vec{X}\|$ is an $L$ -subGaussian for some universal constant $L > 0$ . + +Lemma B.12. If $X$ is an $L$ -subGaussian random variable than for any $t > 0$ , + +$$ +\Pr [ X \geq t ] \leq \exp (- t ^ {2} / 2 C L) +$$ + +for some universal constant $C > 0$ + +Lemma B.13. If $X_{1},\ldots ,X_{n}$ are $L$ -subGaussian random variables, then $\sum_{i}\lambda_{i}X_{i}$ is $L\sqrt{\sum_{i}\lambda_{i}^{2}}$ -subGaussian, hence it is $L\sum_{i}|\lambda_{i}|$ -subGaussian. + +Since $\vec{y}_t$ is an isotropic random variable with variance bounded by $2\beta$ , we derive that $\| \vec{y}_t \|$ is $C\beta$ subGaussian for some $C > 0$ . Further, we derive that + +$$ +\eta \sum_ {i = 1} ^ {t} (1 - \eta / 2) ^ {t - i} \| \vec {y} _ {i} \| + \| \vec {y} _ {t} \| +$$ + +is a subGaussian with parameter bounded by + +$$ +C \beta \sum_ {i = 1} ^ {t} (1 - \eta / 2) ^ {t - i} + C \beta \leq C \beta \eta \sum_ {i = 1} ^ {\infty} (1 - \eta / 2) ^ {i} + C \beta = \frac {C \beta \eta}{\eta / 2} + C \beta = 3 C \beta . +$$ + +Further, let us compute: + +$$ +\begin{array}{l} \mathbb {E} \left[ \eta \sum_ {i = 1} ^ {t} (1 - \eta / 2) ^ {t - i} \| \vec {y _ {i}} \| + \| \vec {y _ {t}} \| \right] \leq \eta \sum_ {i = 1} ^ {t} (1 - \eta / 2) ^ {t - i} \sqrt {\mathbb {E} [ \| \vec {y _ {i}} \| ^ {2} ]} + \sqrt {\mathbb {E} [ \| \vec {y _ {t}} \| ^ {2} ]} \leq \eta \sum_ {i = 1} ^ {t} (1 - \eta / 2) ^ {t - i} \sqrt {2 \beta n} + \sqrt {2 \beta n} \\ \leq \frac {\eta}{\eta / 2} \sqrt {2 \beta n} + \sqrt {2 \beta n} \leq 3 \sqrt {2 \beta n}. \\ \end{array} +$$ + +From Lemma B.11 we derive that for any $h \geq 0$ + +$$ +\Pr \left[ \sum_ {i = 1} ^ {t} (1 - \eta / 2) ^ {t - i} \| \vec {y _ {i}} \| + \| \vec {y _ {t}} \| \geq 3 \sqrt {2 \beta n} + h \right] \leq \exp (- h ^ {2} / C ^ {\prime} \beta), +$$ + +for some universal constant $C' > 0$ . This implies that + +$$ +\operatorname * {P r} \left[ \| \vec {\vec {x}} _ {t} \| \geq 3 + (1 - \eta / 2) ^ {t} \| \vec {x} _ {0} \| + 3 \sqrt {2 \beta n} + h \right] \leq \exp (- h ^ {2} / (C ^ {\prime} \beta)). +$$ + +In particular, if we substitute $h = \sqrt{n / \beta}$ , we get that + +$$ +\Pr \left[ \| \vec {x} _ {t} \| \geq 3 + (1 - \eta / 2) ^ {t} \| \vec {x} _ {0} \| + 3 \sqrt {2 \beta n} \right] \leq \exp (- n / C ^ {\prime \prime}) +$$ + +for some universal constant $C'' > 0$ . + +# B.8. Defining a smooth loss function + +One problem that arises with $L$ is that it is not smooth around the origin. As we have shown, $\vec{x}$ does not approach the origin with high probability. Hence, it is sufficient to assume that the loss function is different around the origin. In particular, the dynamics will not reach a ball of radius $r_0 \coloneqq \cos(g^{\circ d}(\pi)) / 2$ around the origin, w.h.p. We define a modified loss, $\hat{L}$ , that is different in this ball. First, we define an auxiliary function, that is parameterized by $0 \leq a < b$ and is a function of $r \geq 0$ : + +$$ +h ^ {a, b} (r) = \left\{ \begin{array}{l l} 0 & r \leq a \\ 2 (r - a) ^ {2} / (b - a) ^ {2} & a \leq r \leq (a + b) / 2 \\ 1 - 2 (b - r) ^ {2} / (b - a) ^ {2} & (a + b) / 2 \leq r \leq b \\ 1 & r \geq b \end{array} \right.. +$$ + +Notice that this function transitions smoothly from 0 to 1 in the interval $[a, b]$ , it has a continuous first derivative and has a second derivative almost everywhere, with + +$$ +\frac {d h ^ {a b} (r)}{d r} = h _ {r} ^ {a, b} (r) = \left\{ \begin{array}{l l} 0 & r \leq a \\ 4 (r - a) / (b - a) ^ {2} & a \leq r \leq (a + b) / 2 \\ 4 (b - r) / (b - a) ^ {2} & (a + b) / 2 \leq r \leq b \\ 0 & r \geq b \end{array} \right. +$$ + +and + +$$ +\frac {d ^ {2} h ^ {a b} (r)}{d r ^ {2}} = h _ {r r} ^ {a, b} (r) = \left\{ \begin{array}{l l} 0 & r < a \\ 4 / (b - a) ^ {2} & a < r < (a + b) / 2 \\ - 4 / (b - a) ^ {2} & (a + b) / 2 < r < b \\ 0 & r > b \end{array} \right.. +$$ + +We will define the following smoothed loss function function: + +$$ +\hat {L} (r, \theta) = L (r, \theta) h ^ {r _ {0} / 3, 2 r _ {0} / 3} (r) + \xi (1 - h ^ {0, r _ {0}} (r)), +$$ + +for some parameter $\xi > 0$ to be determined. Denote $h^{r_0 / 3,2r_0 / 3} = h^1$ and $h^{0,r_0} = h^2$ for convenience. The derivatives of $\hat{L}$ can be computed as follows: + +- $\hat{L}_r = L_r h^1 + L h_r^1 - \xi h_r^2$ . +- $\hat{L}_{\theta} = L_{\theta}h^{1}$ +- $\hat{L}_{rr} = L_{rr}h^{1} + 2L_{r}h_{r}^{1} + h_{rr}^{1} - \xi h_{rr}^{2}$ +- $\hat{L}_{\theta \theta} = L_{\theta \theta}h^{1}$ +- $\hat{L}_{r\theta} = L_{r\theta}h^{1} + L_{\theta}h_{r}^{1}$ + +We conclude the following properties that the modified loss function satisfies everywhere, based on the properties computed above and the properties of $L$ : + +Lemma B.14. Assume that $\xi$ is a large enough universal constant. Then, the modified loss satisfies: + +- $\hat{L}$ is $O(1)$ smooth everywhere. Further, $\triangle \hat{L} \leq O(n)$ . +- The critical points of $\hat{L}$ (those with zero derivative) are $0, \vec{x}^*$ and $-\cos g^{\circ d}(\pi)\vec{x}^*$ . For any $l > 0$ there exists a constant $c(l) > 0$ such that any point whose distance from the critical points is at least $l$ satisfies $\|\nabla \hat{L}(\vec{x})\| \geq c(l)$ . +- At $\vec{x} \in \{\vec{x} : \| \vec{x} \| \leq r_0 / 3\}$ , $\trianglehat{L}(\vec{x}) \leq -\Omega(n)$ . + +Proof. The smoothness in the ball $\{\vec{x} : \| \vec{x} \| \geq 2r_0 / 3\}$ follows from Lemma B.3, which argues that $L$ is smooth in this region, due to the fact that $\hat{L} = L$ in this region. In the region $\{\vec{x} : \| \vec{x} \| \in \{r_0 / 3, 2r_0 / 3\}\}$ smoothness of $\hat{L}$ follows from the expression for the second derivative of $\hat{L}$ , from Lemma B.1 and from the fact $L, h^1, h^2$ are smooth with bounded derivatives in this region. For $\{\vec{x} : \| \vec{x} \| \in \{0, r_0 / 3\}\}$ smoothness of $\hat{L}$ follows from the smoothness of $h^2$ . Further, $|\triangle L| \leq O(n)$ since any function $f$ on $n$ variables that is $s$ -smooth satisfies $\triangle f \leq sn$ . + +Next, we argue about the critical points of $L$ . First, look at the region defined by $\| \vec{x} \| \geq r_0$ , where, $\hat{L} = L$ . In this region, the critical points of $L$ are $\vec{x}^*$ and $-\cos(g^{\circ d}(\pi))\vec{x}^*$ and these are also the critical points of $\hat{L}$ in this region. Next, we study the region $\| \vec{x} \| \in [r_0/3, r_0]$ . In this region, recall that + +$$ +\hat {L} _ {r} = L _ {r} h ^ {1} + L h _ {r} ^ {1} - \xi h _ {r} ^ {2}. +$$ + +Now, the first two terms are bounded by a constant, using the calculations of the derivatives of $L$ and of $h^1$ . And the last term (which is being subtracted from the first two terms) is lower bounded by a constant times $\xi$ . We can make the whole derivative negative by taking $\xi$ to be a sufficiently large constant. In particular, in this region, the derivative with respect to $r$ is nonzero, hence, by Lemma B.1, the gradient of $\hat{L}$ is nonzero. Lastly, for the region $r \in [0, r_0/3]$ : Here, $\hat{L} = \xi(1 - h^2)$ . By the derivative computation above, the only critical point is $\vec{0}$ . In particular, this concludes that the critical points of $\hat{L}$ are $\vec{x}^*$ , $-\cos(\theta^{\circ d}(\pi))\vec{x}^*$ and $\vec{0}$ . Now, from continuity, for any $l > 0$ there exists $c(l, n) > 0$ such that any point $\vec{x}$ whose distance from any critical point is at least $l$ , satisfies that its gradient norm is at least $c(l, n)$ . Yet, notice that this constant can be taken independent of $n$ . This is due to the fact that $\hat{L}(\vec{x})$ is only a function of $r(\vec{x})$ and $\theta(\vec{x})$ , hence $\|\nabla \hat{L}(\vec{x})\|$ is as well, and there is no dimension dependence. + +For the last item, notice that in the region $\| \vec{x} \| \leq r_0 / 3$ , $\hat{L}(\vec{x}) = \xi(1 - h^2(\vec{x}))$ . By the computation of the second derivative, and by Lemma B.1, it follows that $\triangle \hat{L}(\vec{x}) \leq -\Omega(\xi n) \leq -\Omega(n)$ as required. + +# B.9. Convergence assuming a potential function + +In this section, we want to argue that certain potential functions decrease as a consequence of applying a Langevin step. We will use this in the future to prove that the iterations converge to a certain region where this potential is small. + +Assume that there is a potential function $V\colon \mathbb{R}^d\to \mathbb{R}$ . Further assume the Laplacian is defined as + +$$ +\mathcal {L} V (\vec {x}) = \triangle V (\vec {x}) - \beta \langle \nabla H (\vec {x}), \nabla V (\vec {x}) \rangle , +$$ + +where $H(\vec{x})$ is the function that defines the Langevin dynamics as in Section B.3. We would like to show that if $\mathcal{L}V(\vec{x})$ is negative around $\vec{x}_{t-1}$ then $\mathbb{E}[V(\vec{x}_t) \mid \vec{x}_{t-1}] < V(\vec{x}_{t-1})$ . + +Lemma B.15. Assume that the functions $H, V$ are $O(1)$ smooth in $\mathbb{R}^n$ , and that $\sigma^2 = 2\eta/\beta \leq O(1/n)$ . Assume that $\|\nabla H(\vec{x}_{t-1})\|, \|\nabla V(\vec{x}_{t-1})\| \leq O(1)$ . Let $-\kappa$ denote the maximum of $\mathcal{L}V$ in the ball of radius $r := 2\sqrt{n}\sigma = 2\sqrt{2n\eta/\beta}$ around $\vec{x}_{t-1}$ , and assume that $\mathcal{L}(\vec{x})$ is bounded by $-\kappa + M$ in $\mathbb{R}^n$ . Then, + +$$ +\mathbb {E} \left[ V \left(\vec {x} _ {t}\right) - V \left(\vec {x} _ {t - 1}\right) \mid \vec {x} _ {t - 1} \right] \leq - \mu \kappa / \beta + e ^ {- c n} M / \beta + O (\eta \sqrt {\eta n / \beta}), +$$ + +where $c > 0$ is a universal constant. + +To prove the above, we use the following stochastic process: + +$$ +\vec {y} _ {0} = \vec {x} _ {t - 1}; \quad d \vec {y} _ {s} = - \eta \nabla H (\vec {y} _ {0}) d s + \sqrt {2 \eta / \beta} d \vec {B} _ {s}. +$$ + +Notice that $\vec{y}_1\sim \vec{x}_t$ conditioned on $\vec{x}_{t - 1}$ . Let us assume that $\vec{x}_{t - 1}$ is fixed for the calculations ahead. We would like to compute $\mathbb{E}V(\vec{y}_1)$ . To do this, we can use It's formula, to derive that + +$$ +\mathbb {E} \left[ V \left(\vec {y} _ {1}\right) - V \left(\vec {y} _ {0}\right) \right] = \int_ {0} ^ {1} \mathbb {E} \left[ - \eta \left\langle \nabla H \left(\vec {y} _ {0}\right), \nabla V \left(\vec {y} _ {s}\right) \right\rangle + \triangle V \left(\vec {y} _ {s}\right) \eta / \beta \right] d s. +$$ + +For a fixed $s$ , the term under expectation equals + +$$ +\frac {\eta}{\beta} \mathcal {L} V (\vec {y} _ {s}) + \eta \langle \nabla H (\vec {y} _ {0}) - \nabla H (\vec {y} _ {s}), \nabla V (\vec {y} _ {s}) \rangle . +$$ + +Let us bound both terms in expectation. For the first term, we use the fact that since $\vec{y}_s \sim N(\vec{y}_0, \sigma^2 s I_n)$ , $\operatorname*{Pr}[\| \vec{y}_s - \vec{y}_0 \| \geq 2\sqrt{\sigma sn}] \leq e^{-cn}$ . If the above does not hold, we Laplacian of $\vec{y}_s$ is at most $-\kappa$ , and otherwise it is at most $-\kappa + M$ , as assumed above. Hence, + +$$ +\mathbb {E} \left[ \mathcal {L} V \left(\vec {y} _ {s}\right) \right] \leq - \kappa \left(1 - e ^ {- c n}\right) + e ^ {- c n} (- \kappa + M) \leq - \kappa + M e ^ {- c n}. +$$ + +For the second term, we have, for some constant $C$ , + +$$ +\begin{array}{l} \mathbb {E} \langle \nabla H (\vec {y} _ {0}) - \nabla H (\vec {y} _ {s}), \nabla V (\vec {y} _ {s}) \rangle \leq \mathbb {E} \| \nabla H (\vec {y} _ {0}) - \nabla H (\vec {y} _ {s}) \| \| \nabla V (\vec {y} _ {s}) \| \\ \leq \mathbb {E} [ \| \nabla H (\vec {y} _ {0}) - \nabla H (\vec {y} _ {s}) \| (\| \nabla V (\vec {y} _ {s}) - \nabla V (\vec {y} _ {0}) \| + \| \nabla V (\vec {y} _ {0}) \|) ] \leq O (1) \mathbb {E} [ \| \vec {y} _ {0} - \vec {y} _ {s} \| (\| \vec {y} _ {s} - \vec {y} _ {0} \| + O (1)) ] \\ \leq O (1) \mathbb {E} \| \vec {y} _ {0} - \vec {y} _ {s} \| ^ {2} + O (1) \mathbb {E} \| \vec {y} _ {0} - \vec {y} _ {s} \| \leq O (\sqrt {\sigma^ {2} s n}) = O (\sqrt {\eta n / \beta}). \\ \end{array} +$$ + +This completes the proof of the lemma above. As a consequence, we bound the number of times that it takes for the function to get to a region with positive value of $\mathcal{L}V$ : + +Lemma B.16. Let $V \geq 0$ be an $O(1)$ -smooth potential function, assume that $H$ is $O(1)$ smooth, let $\kappa > 0$ , define + +$$ +K = \{\vec {x}: \exists \vec {y}, \| \vec {y} - \vec {x} \| \leq 2 \sqrt {n} \sigma , \mathcal {L} V (\vec {y}) > - \kappa \}. +$$ + +Let $C_1 > 0$ and define + +$$ +B = \{\vec {x}: \max (\| \nabla H (\vec {x}) \|, \| \nabla V (\vec {x}) \|) > C _ {1} \}. +$$ + +Assume that $\vec{x}_t$ is according to the Langevin dynamics with potential function $H$ (see Section B.3). Let $\tau > 0$ be the first $t$ such that $\vec{x}_t \in K \cup B$ . Let $M$ denote the maximum of $\mathcal{L}V$ over all $\mathbb{R}^n$ . If $e^{-cn}M / \beta + O(\eta \sqrt{\eta n / \beta}) < \mu \kappa / 2\beta$ , then, + +$$ +\mathbb {E} [ \tau \mid \vec {x} _ {0} ] \leq \frac {V (\vec {x} _ {0})}{\mu \kappa / \beta - (e ^ {- c n} M / \beta + O (\eta \sqrt {\eta n / \beta})} \leq \frac {2 V (\vec {x} _ {0})}{\mu \kappa / \beta}. +$$ + +Proof. Denote $\Delta = \mu \kappa / \beta - (e^{-cn}M / \beta + O(\eta \sqrt{\eta n / \beta})$ If $\vec{x}_t \notin K \cup B$ , we can apply Lemma B.15 to argue that $\mathbb{E}[V(\vec{x}_{t+1}) \mid \vec{x}_t] \leq V(\vec{x}_t) - \Delta$ . Since $V$ cannot decrease below 0, the expected number of iterations that this happens is at most $V(\vec{x}_0) / \Delta$ as required. + +# B.10. Defining a potential function + +We would like to apply Lemma B.16 for the dynamics defined by the loss function $\hat{L}$ . Notice that this function identifies with $L$ except for some ball around 0. Define the potential function + +$$ +V (\vec {x}) = \hat {L} (\vec {x}) - \lambda \cos (\theta) h ^ {r _ {0}, 3 r _ {0} / 2} (r) \mathbb {1} (\theta \geq \pi / 2). +$$ + +We prove the following: + +Lemma B.17. Assume that $n$ is at least a sufficiently large constant. There exists some $\lambda = \Theta(1)$ such that the following holds. Let $l > 0$ be a constant. Then, there exist constants $C, c > 0$ (depending possibly on $l$ ) such that for any $\beta \geq Cn$ and any $\vec{x}$ that satisfies $\| \vec{x} - \vec{x}^* \| \geq l$ , we have that $\mathcal{L}V(\vec{x}) \leq -cn$ . Further, $\mathcal{L}V \leq O(n)$ everywhere. + +Proof. For convenience, denote $h = h^{r_0,3r_0 / 2}$ . First of all, we explain how to set $\lambda$ . For that purpose, recall that the Laplacian involves an inner product between the gradient of $\hat{L}$ and that of $V$ , and we would like to make sure that this inner product is always non-positive (as it appears with a negative sign). Notice that + +$$ +\langle \nabla \hat {L} (\vec {x}), \nabla V (\vec {x}) \rangle = \| \nabla \hat {L} (\vec {x}) \| ^ {2} + \lambda \langle \nabla \hat {L} (\vec {x}), \nabla - \cos \theta (\vec {x}) h ^ {r _ {0}, 3 r _ {0} / 2} (r (\vec {x})) \mathbb {1} (\theta (\vec {x}) \geq \pi / 2) \rangle . +$$ + +While the first term is always non-negative, we would like to make sure that the second term is not very negative. For that purpose, let us compute the gradient of the second term of the loss function, and notice that it is nonzero only if $\theta \geq \pi /2$ and $r\ge 3r_0 / 2$ , and assume that we are in this region for convenience, and in particular, the indicator function $\mathbb{1}(\theta \geq \pi /2)$ can be replaced with 1. In order to compute the gradient, it is sufficient to compute the derivatives with respect to $r$ and $\theta$ , as follows from Lemma B.1. We have the derivative with respect to $r$ equals + +$$ +\left. (- \cos (\theta) h (r)) _ {r} = - \cos (\theta) h _ {r} (r), \right. +$$ + +and + +$$ +\left(- \cos (\theta) h (r)\right) _ {\theta} = \sin \theta h (r). +$$ + +Hence, the gradient equals + +$$ +\nabla (- \cos (\theta) h (r)) = - \cos (\theta) h _ {r} (r) \vec {r} + \frac {\sin \theta h (r)}{r} \vec {\theta}. +$$ + +The inner product with the gradient of $\hat{L}$ equals + +$$ +\langle (r - \cos \theta_ {d}) \vec {r} + \sin \theta_ {d} \theta_ {d} ^ {\prime} \vec {\theta}, - \cos (\theta) h _ {r} (r) \vec {r} + \frac {\sin \theta h (r)}{r} \vec {\theta} \rangle = (r - \cos \theta_ {d}) (- \cos (\theta) h _ {r} (r)) + (\sin \theta_ {d} \theta_ {d} ^ {\prime}) \frac {\sin \theta h (r)}{r}, +$$ + +which follows since $\vec{r},\vec{\theta}$ are orthonormal vectors, from Lemma B.1. The second term in the right hand side is nonnegative, since all the involved terms are positive, including $\theta_d^\prime$ which is the derivative of $g^{\circ d}(\theta)$ that is nonnegative since $g$ is increasing. Hence, we only have to take care of the first part. Notice that $h_r(r) = 0$ for any $r\geq 3r_0 / 2$ , hence, we have to care only for $r\in [r_0,3r_0 / 2]$ . In this region, the norm of the gradient of $\hat{L}$ is at least some constant, since $\hat{L} = L$ in this region and due to Lemma B.5. Further, $h_r$ is always bounded from above in an absolute value, as is $\cos \theta$ and $r$ is bounded in this region, hence, we can set $\lambda$ to be a constant such that for all $r\in [r_0,3r_0 / 2]$ + +$$ +\lambda \left\langle (r - \cos \theta_ {d}) \vec {r} + \sin \theta_ {d} \theta_ {d} ^ {\prime} \vec {\theta}, - \cos (\theta) h _ {r} (r) \vec {r} + \frac {\sin \theta h (r)}{r} \vec {\theta} \right\rangle \geq (r - \cos \theta) (- \cos \theta h _ {r} (r)) \geq - \| \nabla \hat {L} \| ^ {2} / 2. +$$ + +This concludes that + +$$ +\langle \nabla V (\vec {x}), \nabla \hat {L} (\vec {x}) \rangle \geq \| \nabla \hat {L} \| ^ {2} / 2, \tag {15} +$$ + +for all $\vec{x}$ , for a sufficiently small (but constant) $\lambda$ . + +Now, it is sufficient to prove that $\triangle V \leq -\Omega(n)$ in some balls of constant radius $l'$ around $\vec{0}$ and the saddle point $-\vec{x}^*\cos g^{\circ d}(\pi)$ . Indeed, assume that this is the case and let us conclude the proof. First of all, in the above two neighborhoods, we have that + +$$ +\mathcal {L} V \leq \triangle V - \frac {\beta}{2} \| \nabla \hat {L} \| \leq \triangle V \leq - \Omega (n) +$$ + +using (15). Next, we would analyze $\mathcal{L}V$ outside these regions and outside a ball of radius $l$ around $\vec{x}^*$ . Using Lemma B.14, $\| \nabla \hat{L}\| \geq \Omega(1)$ in these regions and $\triangle V = \triangle \hat{L} - \triangle \cos \theta h(r) \leq O(n)$ , using Lemma B.14 to bound $\triangle \hat{L}$ and using the fact that $\cos \theta$ and $h(r)$ has bounded first and second derivatives to bound $\triangle \cos \theta h(r)$ . In particular, using (15) we derive that + +$$ +\mathcal {L} V = \triangle V - \frac {\beta}{2} \| \nabla \hat {L} \| ^ {2} \leq O (n) - \Omega (\beta) \leq - \Omega (\beta) \leq - \Omega (n), +$$ + +if $\beta \geq \Omega(n)$ for a sufficiently large constant. It remains to show that $\triangle V \leq -\Omega(n)$ in two balls of radius $l' > 0$ around 0 and around the saddle point. First of all, around 0 we have that $V = \hat{L}$ , and using Lemma B.14 we have that $\triangle V \leq -\Omega(n)$ . Secondly, let us look at the region around $-\vec{x}^*\cos g^{\circ d}(\pi)$ . In that region $h = 1$ , hence, using Lemma B.1 we can compute that + +$$ +\triangle (- h (r) \cos (\theta)) = \triangle (- \cos \theta) = \frac {(n - 1) \cos \theta}{r ^ {2}} \leq - \Omega (n), +$$ + +around $-\vec{x}^{*}\cos g^{\circ d}(\pi)$ , since $\theta (-\vec{x}^{*}\cos g^{\circ d}(\pi)) = \theta (-\vec{x}^{*}) = \pi$ and $\cos \pi = -1$ . Next, from Lemma B.7, we have that around this point, + +$$ +\triangle \hat {L} = \triangle L \leq 2 + \frac {(n - 2) (r - \cos \theta_ {d})}{r}. +$$ + +At the saddle point this equals 0. Yet, this can be positive if $r \geq \cos \theta$ , however, it is bounded by $c(l') \cdot n$ in a ball of radius $l' > 0$ around the saddle point. By continuity, we can take $c(l')$ to zero as $l' \to 0$ . Hence, if $l'$ is taken as a sufficiently small constant, then $|\triangle \hat{L}| \leq |\triangle \lambda \cos \theta| / 2$ . In particular, we have that in a ball of radius $l'$ around the saddle point, + +$$ +\triangle V = \triangle L + \triangle \cos \theta \leq \frac {1}{2} \triangle \cos \theta \leq - \Omega (n), +$$ + +as required. + +Lastly, inside a ball of radius $l$ around $\vec{x}^*$ , we have that + +$$ +\mathcal {L} V \leq \triangle V = \triangle \hat {L} = \triangle L \leq O (n), +$$ + +where we used the computed bound on $\triangle L$ and the fact that $V$ identifies with $L$ around $\vec{x}^*$ . + +![](images/0dd3b6c823d44eeff1c32ec2fa86be95093c78fa1dba39f6c25c34d732d4e552.jpg) + +For conclusion, let us bound the time that it takes the algorithm to get into the convexity region: + +Lemma B.18. Let $l > 0$ and assume that $n$ is a sufficiently large constant. Assume that we run the dynamics according to the loss function $L$ and let $\tau$ denote the first iteration such that $\| \vec{x}_t - \vec{x}^* \| \leq l$ . Then, $\mathbb{E}\tau \leq O(1 / \eta)$ . Further, $\operatorname*{Pr}[\tau \geq \Omega (\log (1 / \epsilon) / \epsilon)] \leq \epsilon + e^{-cn}$ . + +Proof. First, we will argue that if we run the dynamics according to $L$ , the hitting hitting time is bounded by $O(1 / \eta)$ in expectation. In order to prove that, we use the potential function $V$ in combination with Lemma B.16. Recall that the set $K$ defined in Lemma B.16 corresponds to the set of all points $\vec{x}$ where $\mathcal{L}V$ is smaller than $-\kappa$ , in a neighborhood of radius $2\sqrt{n}\sigma$ around $\vec{x}$ . First of all, notice that $2\sqrt{n}\sigma = 2\sqrt{2n\eta / \beta} \leq 2\sqrt{2n / \beta}$ and we will choose $\beta$ sufficiently large such that this is smaller than $l / 2$ . Further, from Lemma B.17, we know that we can choose $\kappa = cn$ such that + +$$ +\{\vec {x}: \mathcal {L} V (\vec {x}) \geq - c n \} \subset \{\vec {x}: \| \vec {x} - \vec {x} ^ {*} \| \leq l / 2 \} +$$ + +$(c > 0$ is a universal constant). This implies that the set $K$ from Lemma B.16 is contained in a ball of radius $l$ around $\vec{x}^*$ . By the same lemma, the hitting time to $K \cup B$ , is bounded by + +$$ +\frac {V \left(\vec {x} _ {0}\right)}{\kappa \eta / \beta - \left(e ^ {- c n} M / \beta + O \left(\eta \sqrt {\eta n / \beta}\right)\right)}, \tag {16} +$$ + +where $M$ is a total bound on $\mathcal{L}V$ and it is $O(n)$ using Lemma B.17. Since $\beta = \Theta (n) = \Theta (\kappa)$ , we have that $\kappa \eta /\beta = \Theta (\eta)$ . Further, $e^{-cn}M / \beta = O(e^{-cn}n / \beta) = O(e^{-cn})$ , since $n = \Theta (\beta)$ . Lastly, $\eta \sqrt{\eta n / \beta} = \Theta (\eta^{3 / 2})$ and this can be smaller than $\kappa \eta /\beta = \Theta (\eta)$ if $\eta$ is sufficiently small. Hence, the denominator in (16) is $\Omega (\kappa \eta /\beta)\geq \Omega (1)$ . Finally, we want to bound the numerator. We have that if $\vec{x}_0$ is bounded, then $\| V(\vec{x}_0)\| \leq O(1)$ . This derives that the number of iterations required to hit either $K$ or $B$ is bounded by $O(1 / \eta)$ . Recall the definition of $B$ from Lemma B.16, and notice that it contains only points where wither $\nabla \hat{L}$ or $\nabla V$ are larger than some constant $C_1 > 0$ that we can select. Hence, $B$ only contains points of large + +norm. In particular, the probability to hit $B$ is very small, from Proposition B.9, hence, with high probability we first hit $K$ . In particular, the hitting time is $O(1 / \eta)$ with high probability. + +Recall that this assumed that we run the dynamics according to $L'$ , yet the lemma is about running it according to $L$ . Yet using Lemma B.8 we know that if we run the dynamics according to $L$ , then with high probability, at iterations $t = 3/\eta, \dots, 3/\eta + O(1/\eta)$ , the norm is at least $r_0 = \cos g^{\circ d}(\pi)/2$ . In this region, $L$ and $L'$ are the same and running the dynamics according to $L$ is the same as running according to $L'$ . In particular, the expected time to hit $K$ after iteration $3/\eta$ is $O(1/\eta)$ . + +Notice that the above argument can fail with some probability, if at some point the norm of $\vec{x}_t$ is either very small or very large. Yet, if this holds, then by Lemma B.8 and Proposition B.9, after a small number of iterations the norm will be of the right order and again, one has a large chance of hitting $K$ . Overall, a simple calculation shows that the expected number of iterations to hit $K$ is $O(1 / \eta)$ as required. + +Lastly, we prove the high probability bound on $\tau$ . By iterating: fix $C > 0$ some appropriate constant, then for any $t$ , + +$$ +\Pr [ \tau > C \log (1 / \epsilon) / \eta ] = \prod_ {i = 1} ^ {\log (1 / \epsilon)} \Pr [ \tau > C i / \eta \mid \tau > C (i - 1) / \eta ] \leq \prod_ {i = 1} ^ {\log (1 / \epsilon)} 0. 1 \leq \epsilon , +$$ + +where we use Markov's inequality to bound $\operatorname*{Pr}[\tau > C i / \eta \mid \tau > C (i - 1) / \eta]$ .3 + +# B.11. Continuous gets closer to discrete + +Assume that a function $H$ is $M$ -smooth and $\mu$ -strongly convex. We want to compare the Langevin iteration + +$$ +\vec {x} _ {t} = \vec {x} _ {t - 1} - \eta \nabla H (\vec {x} _ {t - 1}) + \vec {z} _ {t}, +$$ + +where $\vec{z} \sim N(\vec{0}, \sigma^2 I)$ , to the continuous iteration defined by + +$$ +d \vec {y} _ {t} = - \eta \nabla H (\vec {y} _ {t}) d t + \sigma d B _ {t}. +$$ + +Note that $\vec{x}_t$ runs in discrete times $t = 0,1,2,\ldots$ while the continuous runs continuous time $t\geq 0$ . We want to show the following: + +Lemma B.19. Assume that we run the discrete and continuous time dynamics, $\vec{x}_t$ and $\vec{y}_t$ , with respect to some function $H$ , that is $\Omega(1)$ smooth and $O(1)$ strongly convex, assume that for all $t$ , $\mathbb{E}\|\nabla H(\vec{x}_t)\| \leq O(1)$ and that $\|\vec{x}_0 - \vec{y}_0\| \leq O(1)$ . Then, for $T \geq \Omega(\log(1/\eta)/\eta)$ , one has a coupling between $\vec{x}_t$ and $\vec{y}_t$ such that + +$$ +\mathbb {E} \| \vec {x} _ {t} - \vec {y} _ {t} \| \leq O (\sqrt {\eta}). +$$ + +Proof. To prove the lemma, let us first present $\vec{x}_t$ as continuous dynamics over $t \geq 0$ : + +$$ +d \vec {x} _ {t} = - \eta \nabla H (\vec {x} _ {\lfloor t \rfloor}) d t + \sigma d B _ {t}, +$$ + +and note that the difference between $\vec{x}_t$ and $\vec{y}_t$ is that the gradient with respect to $\vec{x}_t$ is taken according to $\vec{x}_{\lfloor t\rfloor}$ and not to $\vec{x}_t$ . This produces exactly the same distribution over $\vec{x}_0,\vec{x}_1,\ldots$ as the discrete dynamics. Let us couple $\vec{x}_t$ with $\vec{y}_t$ , while using the same Gaussian noise $dB_{t}$ . Then, if we take $\vec{x}_t - \vec{y}_t$ the noise cancels, and we have + +$$ +d (\vec {x} _ {t} - \vec {y} _ {t}) = - \eta (\nabla H (\vec {x} _ {\lfloor t \rfloor}) - \nabla H (\vec {y} _ {t})) d t. +$$ + +Applying Ito's lemma, and assuming that the function is $c$ -strongly convex and $C$ -smooth, one has + +$$ +\begin{array}{l} d \| \vec {x} _ {t} - \vec {y} _ {t} \| ^ {2} / 2 = \left\langle \vec {x} _ {t} - \vec {y} _ {t}, d (\vec {x} _ {t} - \vec {y} _ {t}) \right\rangle = - \eta \left\langle \vec {x} _ {t} - \vec {y} _ {t}, \nabla H (\vec {x} _ {\lfloor t \rfloor}) - \nabla H (\vec {y} _ {t}) \right\rangle d t \\ = - \eta \left\langle \vec {x} _ {t} - \vec {y} _ {t}, \nabla H (\vec {x} _ {t}) - \nabla H (\vec {y} _ {t}) \right\rangle d t + \eta \left\langle \vec {x} _ {t} - \vec {y} _ {t}, \nabla H (\vec {x} _ {t}) - \nabla H (\vec {x} _ {\lfloor t \rfloor}) \right\rangle d t \\ \leq - \eta c (\| \vec {x} _ {t} - \vec {y} _ {t} \| ^ {2} + \eta \| \vec {x} _ {t} - \vec {y} _ {t} \| \| \nabla H (\vec {x} _ {t}) - \nabla H (\vec {x} _ {\lfloor t \rfloor}) \|) d t \\ \leq - \eta c (\| \vec {x} _ {t} - \vec {y} _ {t} \| ^ {2} + \eta C \| \vec {x} _ {t} - \vec {y} _ {t} \| \| \vec {x} _ {t} - \vec {x} _ {\lfloor t \rfloor} \|) d t. \\ \end{array} +$$ + +Using Ito's formula again, one has + +$$ +d \| \vec {x} _ {t} - \vec {y} _ {t} \| = d \sqrt {\| \vec {x} _ {t} - \vec {y} _ {t} \| ^ {2}} = \frac {d \| \vec {x} _ {t} - \vec {y} _ {t} \| ^ {2}}{2 \| \vec {x} _ {t} - \vec {y} _ {t} \|} \leq (\eta c \| \vec {x} _ {t} - \vec {y} _ {t} \| + \eta C \| \vec {x} _ {t} - \vec {x} _ {\lfloor t \rfloor} \|) d t. +$$ + +Integrating, one has + +$$ +\left\| \vec {x} _ {T} - \vec {y} _ {T} \right\| = e ^ {- \eta c T} \left\| \vec {x} _ {0} - \vec {y} _ {0} \right\| + \int_ {0} ^ {T} \eta C \left\| \vec {x} _ {t} - \vec {x} _ {\lfloor t \rfloor} \right\| e ^ {- \eta c (T - t)} d t. +$$ + +We would like to take an expectation, for that purpose, let us estimate $\| \vec{x}_t - \vec{x}_{\lfloor t\rfloor}\|$ . Denote $s = t - \lfloor t\rfloor$ . Then, $\vec{x}_t - \vec{x}_{\lfloor t\rfloor} \sim N(\nabla H(\vec{x}_{\lfloor t\rfloor})s\eta ,s\sigma^2 I_n)$ , in particular, + +$$ +\mathbb {E} [ \| \vec {x} _ {t} - \vec {x} _ {\lfloor t \rfloor} \| ^ {2} \mid \vec {x} _ {\lfloor t \rfloor} ] = \| \nabla H (\vec {x} _ {\lfloor t \rfloor}) s \eta \| ^ {2} + s n \sigma^ {2} +$$ + +which implies, by Jensen, that + +$$ +\mathbb {E} \left[ \| \vec {x} _ {t} - \vec {x} _ {\lfloor t \rfloor} \| \mid \vec {x} _ {\lfloor t \rfloor} \right] \leq \| \nabla H (\vec {x} _ {\lfloor t \rfloor}) s \eta \| + \sqrt {n s} \sigma \leq \eta \| \nabla H (\vec {x} _ {\lfloor t \rfloor}) \| + \sigma \sqrt {n}. +$$ + +Taking an outer expectation and using the bound on the gradient and that $\beta = \Theta (n)$ , one has that + +$$ +\mathbb {E} \left[ \| \vec {x} _ {t} - \vec {x} _ {\lfloor t \rfloor} \| \right] \leq O (\eta + \sqrt {\eta n / \beta}) \leq O (\sqrt {\eta}). +$$ + +Substituting this above, one has + +$$ +\mathbb {E} [ \| \vec {x} _ {T} - \vec {y} _ {T} \| ] \leq e ^ {- \eta c T} \| \vec {x} _ {0} - \vec {y} _ {0} \| + O (1) \int_ {0} ^ {T} \eta^ {3 / 2} e ^ {- \eta c (T - t)} d t \leq e ^ {- \eta c T} \| \vec {x} _ {0} - \vec {y} _ {0} \| + O (\sqrt {\eta}). +$$ + +The result follows by substituting $T \geq \Omega (\log (1 / \eta) / \eta)$ . + +# B.12. Staying in the convexity region + +We use the following known property for gradient descent: + +Lemma B.20. Let $f \colon K \to \mathbb{R}$ , where $K \subset \mathbb{R}^n$ is a convex set. Assume that $f$ is $s$ -smooth and $\mu$ -strongly convex, let $\eta \leq 2 / (s + \mu)$ . Let $\vec{x}, \vec{y} \in K$ then, + +$$ +\left\| \vec {x} - \eta \nabla f (\vec {x}) - (\vec {y} - \eta \nabla f (\vec {y})) \right\| \leq \left(1 - \frac {\eta s \mu}{s + \mu}\right) \| \vec {x} - \vec {y} \|. +$$ + +In particular, if $K$ is a ball around the minima $\vec{x}^*$ of $f$ , then + +$$ +\| \vec {x} - \eta \nabla f (\vec {x}) - \vec {x} ^ {*} \| \leq \left(1 - \frac {\eta s \mu}{s + \mu}\right) \| \vec {x} - \vec {x} ^ {*} \|. +$$ + +We would like to show that the Langevin rarely escapes some ball around $\vec{x}^*$ . We have the following proposition: + +Lemma B.21. Let $f$ be a function that has local minima at $\vec{x}^*$ and which is $\mu$ -strongly convex and $s$ -smooth in a ball of radius $R$ around $\vec{x}^*$ . Assume that we run Langevin dynamics, starting at $\vec{x}_0$ , following + +$$ +\vec {x} _ {t} = \vec {x} _ {t - 1} - \eta \nabla f (x) + \vec {z} _ {t}, +$$ + +where $\vec{z}_t\sim N(0,\sigma^2)$ , and + +$$ +\eta \leq \frac {2}{s + \mu}. +$$ + +Further, assume the $\sigma \sqrt{n} \leq R/4$ and that $\|\vec{x}_0 - \vec{x}^*\| \leq R/2$ . Then, for any $T > 0$ , + +$$ +\Pr [ \forall i = 1, \dots , T: \| \vec {x} _ {i} - \vec {x} ^ {*} \| \leq R ] \geq 1 - e ^ {- c n}, +$$ + +where $c > 0$ is a small universal constant. + +To prove this lemma, we would like to couple $\vec{x}_0,\dots ,\vec{x}_T$ with auxiliary variables $\vec{y}_0,\dots ,\vec{y}_T$ such that for all $t\leq T$ , if $\| \vec{y}_0\| ,\ldots ,\| \vec{y}_{t - 1}\| \leq R$ then $\| \vec{x}_t\| \leq \| \vec{y}_t\|$ . In particular, if $\| \vec{y}_0\| ,\dots ,\| \vec{y}_T\| \leq R$ then $\| \vec{x}_0\| ,\dots ,\| \vec{x}_T\| \leq R$ . It will be convenient to bound the $\vec{y}_t$ variables. + +Define $p = 1 - \frac{\eta s\mu}{s + \mu}$ , then we define + +$$ +\vec {y} _ {0} = \vec {x} _ {0}; \quad \vec {y} _ {t} = p \vec {y} _ {t - 1} + \vec {w} _ {t}, +$$ + +where $\vec{w}_t \sim N(0, \sigma^2)$ . Let us show how to couple $\vec{x}_t$ and $\vec{y}_t$ and show by induction the required property. For $t = 0$ this holds by definition. Assume that this holds for all $i < t$ and prove for $t$ . Let us assume that $\| \vec{y}_0 \|, \dots, \| \vec{y}_{t-1} \| \leq R$ otherwise the proof follows. By assumption we have that $\| \vec{x}_{t-1} \| \leq \| \vec{y}_t \| \leq R$ . Denote by $\vec{x}_{t-1}' = \vec{x}_{t-1} - \eta \nabla f(\vec{x}_{t-1})$ . By Lemma B.20, we have that + +$$ +\left\| \vec {x} _ {t - 1} ^ {\prime} \right\| \leq p \| \vec {x} _ {t - 1} \| \leq p \| \vec {y} _ {t - 1} \|. +$$ + +Let us now couple the noise $\vec{z}_t$ added to $\vec{x}_{t - 1}$ in the recursive formula, with the noise $\vec{w}_t$ added to $\vec{y}_{t - 1}$ . Denote $\tilde{\vec{x}}_{t - 1}^{\prime} = \frac{\vec{x}_{t - 1}^{\prime}}{\|\vec{x}_{t - 1}^{\prime}\|}$ and $\tilde{y}_{t - 1} = \frac{\vec{y}_{t - 1}}{\|\vec{y}_{t - 1}\|}, z_t = \langle \vec{z}_t, \tilde{\vec{x}}_{t - 1} \rangle$ , $w_t = \langle \vec{w}_t, \tilde{\vec{y}}_{t - 1} \rangle$ . Notice that $z_t, w_t \sim N(0, \sigma^2)$ and we have that: + +$$ +\| \vec {x} _ {t} \| ^ {2} = \| \vec {x} _ {t - 1} ^ {\prime} + \vec {z} _ {t} \| ^ {2} = \| \vec {x} _ {t + 1} ^ {\prime} + z _ {t} \tilde {\vec {x}} _ {t - 1} ^ {\prime} + (\vec {z} _ {t} - z _ {t} \tilde {\vec {x}} _ {t - 1} ^ {\prime}) \| ^ {2} = \| \vec {x} _ {t + 1} ^ {\prime} + z _ {t} \tilde {\vec {x}} _ {t - 1} ^ {\prime} \| ^ {2} + \| \vec {z} _ {t} - z _ {t} \tilde {\vec {x}} _ {t - 1} ^ {\prime}) \| ^ {2}, \tag {17} +$$ + +where the last equality is due to the fact that $\vec{x}_{t + 1}^{\prime} + z_{t}\tilde{\vec{x}}_{t - 1}$ is a multiple of $\| \vec{x}_{t - 1}^{\prime}\|$ while the second term is perpendicular to this vector. Similarly, we have that + +$$ +\left\| \vec {y} _ {t} \right\| ^ {2} = \left\| p \vec {y} _ {t - 1} + \vec {w} _ {t} \right\| ^ {2} = \left\| p \vec {y} _ {t - 1} + w _ {t} \tilde {\vec {y}} _ {t - 1} + \left(\vec {w} _ {t} - w _ {t} \tilde {\vec {y}} _ {t - 1}\right) \right\| ^ {2} = \left\| p \vec {y} _ {t - 1} + w _ {t} \tilde {\vec {y}} _ {t - 1} \right\| ^ {2} + \left\| \vec {w} _ {t} - w _ {t} \tilde {\vec {y}} _ {t - 1} \right\| ^ {2}. \tag {18} +$$ + +We would couple $\vec{z}_t$ and $\vec{w}_t$ such that the first term in (17) is bounded by the first term in (18) and similarly for the second term. For the second term, notice that both $\vec{z}_t - z_t\tilde{\vec{x}}_{t-1}^{\prime}$ and $\vec{w}_t - w_t\tilde{\vec{y}}_{t-1}$ are Gaussian variables with Isotropic covariance $\sigma^2 I_{n-1}$ over a subspace of dimension $n-1$ , so we can couple them such that their absolute value is identical. Now, we argue for the first terms. Analyzing the first term in (17), we have that, + +$$ +\vec {x} _ {t - 1} ^ {\prime} + z _ {t} \tilde {\vec {x}} _ {t - 1} ^ {\prime} = (\| \vec {x} _ {t - 1} ^ {\prime} \| + z _ {t}) \tilde {\vec {x}} _ {t - 1} ^ {\prime}, +$$ + +hence, the corresponding first term equals + +$$ +\| \vec {x} _ {t - 1} ^ {\prime} + z _ {t} \tilde {\vec {x}} _ {t - 1} ^ {\prime} \| ^ {2} = \big (\| \vec {x} _ {t - 1} ^ {\prime} \| + z _ {t} \big) ^ {2} \| \tilde {\vec {x}} _ {t - 1} ^ {\prime} \| ^ {2} = \big (\| \vec {x} _ {t - 1} ^ {\prime} \| + z _ {t} \big) ^ {2}. +$$ + +For the term corresponding (18), we have that + +$$ +p \vec {y} _ {t - 1} + w _ {t} \tilde {\vec {y}} _ {t - 1} = \left(\| p \vec {y} _ {t - 1} \| + w _ {t}\right) \tilde {\vec {y}} _ {y - 1}, +$$ + +hence, the corresponding first term equals + +$$ +\| p \vec {y} _ {t - 1} + w _ {t} \tilde {\vec {y}} y _ {t - 1} \| ^ {2} = (\| p \vec {y} _ {t - 1} \| + w _ {t}) ^ {2} \| \tilde {\vec {y}} y _ {t - 1} \| ^ {2} = (\| p \vec {y} _ {t - 1} \| + w _ {t}) ^ {2}. +$$ + +Hence, our goal is to couple $z_{t}$ with $w_{t}$ such that + +$$ +\left(\| \vec {x} _ {t - 1} ^ {\prime} \| + z _ {t}\right) ^ {2} \leq \left(\| p \vec {y} _ {t - 1} \| + w _ {t}\right) ^ {2}, +$$ + +or, equivalently, + +$$ +\left| \left| \left| \vec {x} _ {t - 1} ^ {\prime} \right| \right| + z _ {t} \right| \leq \left| \left| \left| p \vec {y} _ {t - 1} \right| \right| + w _ {t} \right|. +$$ + +We have already argued that $\| \vec{x}_{t - 1}^{\prime}\| \leq \| p\vec{y}_{t - 1}\|$ . Further, notice that $z_{t},w_{t}\sim N(0,\sigma^{2})$ . So, it is sufficiently to use the following lemma: + +Lemma B.22. Let $a \geq b \geq 0$ . Then, we can couple two random variables, $z, w \sim N(0, \sigma^2)$ such that $|a + z| \geq |b + w|$ . + +Proof. First of all, notice that two real-valued random variables, $X, Y$ , can be coupled such that $X \geq Y$ whenever $\operatorname{Pr}[X \leq t] \leq \operatorname{Pr}[Y \leq t]$ for any $t \in \mathbb{R}$ . This is a standard argument, and the proof is by first $b \in [0,1]$ and then setting $X = x, Y = y$ for the values $x, y$ such that $\operatorname{Pr}[X \leq x] = b$ and $\operatorname{Pr}[Y \leq y] = b$ . By the assumption that $\operatorname{Pr}[X \leq t] \leq \operatorname{Pr}[Y \leq t]$ it holds that $x \geq y$ as required. + +So, it suffices to show that $\operatorname*{Pr}[|a + z|\leq t]\leq \operatorname*{Pr}[|b + w|\leq t]$ , for any $t\geq 0$ . Indeed, if $\phi$ is the density of a random variable $N(0,\sigma^2)$ , we have that + +$$ +\begin{array}{l} \Pr [ | a + z | \leq t ] - \Pr [ | b + w | \leq t ] \\ = 1 - \Pr [ | a + z | > t ] - (1 - \Pr [ | b + w | > t ]) \\ = \Pr [ | b + w | > t ] - \Pr [ | a + z | > t ] \\ = \Pr [ b + w > t ] + \Pr [ b + w < - t ] - \Pr [ a + z > t ] - \Pr [ a + z < - t ] \\ = \Pr [ w > t - b ] + \Pr [ w < - t - b ] - \Pr [ z > t - a ] - \Pr [ z < - t - a ] \\ = \Pr [ w > t - b ] + \Pr [ w > t + b ] - \Pr [ z > t - a ] - \Pr [ z > t + a ] \\ = \int_ {t - b} ^ {\infty} \phi (u) d u + \int_ {t + b} ^ {\infty} \phi (u) d u - \int_ {t - a} ^ {\infty} \phi (u) d u - \int_ {t + a} ^ {\infty} \phi (u) d u \\ = \int_ {t + b} ^ {t + a} \phi (u) d u - \int_ {t - a} ^ {t - b} \phi (u) d u \\ = \int_ {b + t} ^ {a + t} \phi (u) d u - \int_ {b - t} ^ {a - t} \phi (u) d u \\ = \int_ {b} ^ {a} (\phi (u + t) - \phi (u - t)) d u \\ = \int_ {b} ^ {a} (\phi (| u + t |) - \phi (| u - t |)) d u \\ \end{array} +$$ + +using the fact that $\phi$ is symmetric around the origin. Recall that $a, b, t \geq 0$ , hence $|u + t| \geq |u - t|$ which implies that $\phi(|u + t|) \leq \phi(|u - t|)$ as $\phi$ is decreasing. We derive that the desired quantity is negative and this is what we wanted to prove. + +This concludes the inductive proof that if $\| \vec{y}_1\| ,\ldots ,\| \vec{y}_T\| \leq R$ then $\| \vec{x}_1\| ,\ldots ,\| \vec{x}_T\| \leq R$ . It suffices to bound the probability that $\| \vec{y}_1\| ,\ldots ,\| \vec{y}_T\| \leq R$ . Notice that + +$$ +\vec {y} _ {T} = p \vec {y} _ {T - 1} + \vec {w} _ {T} = p ^ {T} \vec {y} _ {0} + \sum_ {t = 1} ^ {T} p ^ {T - t} \vec {w} _ {t}. +$$ + +Notice that its mean is $p^T\vec{y}_0$ and its covariance is + +$$ +\sum_ {t = 1} ^ {T} C o v (p ^ {T - t} \vec {w} _ {t}) = \sum_ {t = 1} ^ {T} p ^ {2 (T - t)} \sigma^ {2} I _ {n} = \sigma^ {2} I _ {n} \sum_ {i = 0} ^ {T - 1} p ^ {2 i} \leq \sigma^ {2} I _ {n} \sum_ {i = 0} ^ {\infty} p ^ {2 i} = \frac {\sigma^ {2}}{1 - p ^ {2}} I _ {n}, +$$ + +where the inequality corresponds to the constant that multiplies the identity matrix. Using this inequality, we can derive that + +$$ +\begin{array}{l} \Pr [ \forall i, \| \vec {y} _ {i} \| \leq R ] \leq \sum_ {i = 1} ^ {T} \Pr [ \| \vec {y} _ {i} \| \leq R ] \leq \sum_ {i = 1} ^ {T} \Pr [ \| \vec {y} _ {i} - \mathbb {E} \vec {y} _ {i} \| \leq R - \| \mathbb {E} \vec {y} _ {i} \| ] \\ \leq \sum_ {i = 1} ^ {T} \Pr \left[ \| \vec {y} _ {i} - \mathbb {E} \vec {y} _ {i} \| \leq R - p ^ {t} \| \vec {y} _ {0} \| \right] \leq \sum_ {i = 1} ^ {T} \Pr \left[ \| \vec {y} _ {i} - \mathbb {E} \vec {y} _ {i} \| \leq R - \| \vec {y} _ {0} \| \right] \\ \leq \sum_ {i = 1} ^ {T} \Pr [ \| \vec {y} _ {i} - \mathbb {E} \vec {y} _ {i} \| \leq R / 2 ]. \\ \end{array} +$$ + +We can use the fact that for a random variable $\vec{X} \sim N(\vec{0}, \sigma^2 I_n)$ , it holds that $\operatorname*{Pr}[\| \vec{X} \| > 2\sigma \sqrt{n}] \leq e^{-cn}$ for some universal constant $c > 0$ . In particular, applying $\vec{X} = \vec{y}_i - \mathbb{E}\vec{y}_i$ , we derive that + +$$ +\Pr \left[ \forall i, \| \vec {y} _ {i} \| \leq R \right] \leq T e ^ {- c n}, +$$ + +using that $R / 2\geq 2\sigma \sqrt{n}$ . This concludes the proof. + +# B.13. Culminating the Proof + +We start by arguing about the dynamics according to $L$ and then we argue for $\tilde{L}$ . First, assume that $t = \Theta (\log (1 / \epsilon) / \epsilon^2)$ . This assumption will be removed later. Let $\tau$ be the minimal $t$ such that $\| \vec{x}_t - \vec{x}^*\| \leq l$ for some appropriately chosen constant $l > 0$ . First, notice that by Lemma B.18, with probability $1 - \epsilon$ we have $\tau \leq O(\log (1 / \epsilon) / \epsilon)$ . By Lemma B.6 there is some radius around $\vec{x}^*$ where the function is $\Omega (1)$ -strongly convex, and assume that this radius is $2l$ . By Lemma B.21, with high probability, the dynamics stay within the ball of radius $2l$ for additional $O(\log (1 / \epsilon) / \epsilon^2)$ iterations. + +In order to bound the Wasserstein distance between $\vec{x}_T$ and $\mu$ , we would like to couple the discrete dynamics $\vec{x}_t$ to the continuous dynamics, defined by + +$$ +d \vec {y} _ {t} = - \eta \nabla L (\vec {y} _ {t}) d t + \sqrt {2 \eta / \beta} d B _ {t}; \vec {y} _ {0} \sim \mu , \mu (\vec {y}) = \frac {e ^ {- \beta L (\vec {y})}}{\int e ^ {- \beta L (\vec {z})} d \vec {z}}; +$$ + +Notice that $\vec{y}_t\sim \mu$ for all $t$ . The coupling is done as follows: the chains are run independently until time $\tau$ . Since $\vec{y}_{\tau}\sim \mu$ independently of $\vec{x}_{\tau}$ , and since, assuming that $\beta \geq \Omega (n)$ , $\mu$ has mass $1 - e^{-cn}$ in the ball of radius $\ell$ around $\vec{x}^*$ (as can be computed using a simple integral), one has that with probability $1 - e^{-cn}$ , $\vec{x}_t$ and $\vec{y}_t$ are in this ball. From that point onward, using Lemma B.19 we can couple $\vec{x}_t$ and $\vec{y}_t$ such that after additional $O(\log (1 / \epsilon) / \eta)$ iterations, $\mathbb{E}\| \vec{x}_t - \vec{y}_t\| \leq O(\epsilon)$ . By taking into account the failure probability to stay and remain in the convexity region, we derive that after $T = O(\log (1 / \epsilon) / \eta) = O(\log (1 / \epsilon) / \epsilon^2)$ iterations, $\mathbb{E}\| \vec{x}_t - \vec{y}_t\| \leq O(\epsilon) + T2^{-cn}$ . We can assume that $\epsilon \geq e^{-cn / 10}$ without hurting the guarantee, hence $T\leq e^{cn / 2}$ , and the error is bounded by $e^{-cn / 2} + O(\epsilon)$ . + +Next, we want to argue about the dynamics according to $\tilde{L}$ rather than $L$ . Due to the added noise in each step, if the parameter $\delta$ in (6) is sufficiently small, then the KL divergence between the execution with $L$ vs. $\tilde{L}$ is small. + +Lastly, we argue about what happens when $T > \Omega (\log (1 / \epsilon) / \epsilon^2)$ : in this case, we disregard the initial iterations, and restart the above argument, replacing $t = 0$ with $t = T - \Theta (\log (1 / \epsilon) / \epsilon^2)$ and replacing $T$ with $\Theta (\log (1 / \epsilon) / \epsilon^2)$ . + +# C. Additional Experiments + +![](images/5059f3abc6bfbd36b53f1ab4623c8c0b1db36d546ab205ce8c32c849e252c522.jpg) +Figure 9: Speed plot that demonstrates how the loss is changing over time. Each inversion takes about $1 - 2$ minutes on single V100 GPU. \ No newline at end of file diff --git a/scoreguidedintermediateleveloptimizationfastlangevinmixingforinverseproblems/images.zip b/scoreguidedintermediateleveloptimizationfastlangevinmixingforinverseproblems/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..8df526c1260d46b8d4c158b1bb10e49d4da29e65 --- /dev/null +++ b/scoreguidedintermediateleveloptimizationfastlangevinmixingforinverseproblems/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e0f759835f77f568a099437abafaad52db1a1a438821c9a004608398fbe61aeb +size 1803405 diff --git a/scoreguidedintermediateleveloptimizationfastlangevinmixingforinverseproblems/layout.json b/scoreguidedintermediateleveloptimizationfastlangevinmixingforinverseproblems/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..548f385cab7d1d97ef622a376aec1c5e481c7658 --- /dev/null +++ b/scoreguidedintermediateleveloptimizationfastlangevinmixingforinverseproblems/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f6d873f6d34297cb5da08f9308eeedbbf5683bc5f5bf5180fea0da0448b915ff +size 1816744 diff --git a/scorematchingenablescausaldiscoveryofnonlinearadditivenoisemodels/cedd144a-a605-4564-95bc-8044881af827_content_list.json b/scorematchingenablescausaldiscoveryofnonlinearadditivenoisemodels/cedd144a-a605-4564-95bc-8044881af827_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..1a882eb55ffded7f309479a4b94de90457eefe61 --- /dev/null +++ b/scorematchingenablescausaldiscoveryofnonlinearadditivenoisemodels/cedd144a-a605-4564-95bc-8044881af827_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a9d84d4e0cb528ee559c365a78fb0dc64ea9fd6f52d65f9b9e2b23a6d3b03e7a +size 96416 diff --git a/scorematchingenablescausaldiscoveryofnonlinearadditivenoisemodels/cedd144a-a605-4564-95bc-8044881af827_model.json b/scorematchingenablescausaldiscoveryofnonlinearadditivenoisemodels/cedd144a-a605-4564-95bc-8044881af827_model.json new file mode 100644 index 0000000000000000000000000000000000000000..f5f99680f0e994f4764bc1f4e9eb66b3385e3731 --- /dev/null +++ b/scorematchingenablescausaldiscoveryofnonlinearadditivenoisemodels/cedd144a-a605-4564-95bc-8044881af827_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0e2c45dd9f17d655e5f6135ad2ad8ebdef66b528c673e59d2bf5ba095f802ae1 +size 115671 diff --git a/scorematchingenablescausaldiscoveryofnonlinearadditivenoisemodels/cedd144a-a605-4564-95bc-8044881af827_origin.pdf b/scorematchingenablescausaldiscoveryofnonlinearadditivenoisemodels/cedd144a-a605-4564-95bc-8044881af827_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..4531f6fc827eee922c9bfea6ead1624f02d37a4f --- /dev/null +++ b/scorematchingenablescausaldiscoveryofnonlinearadditivenoisemodels/cedd144a-a605-4564-95bc-8044881af827_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de837e0dff981986ebc729ead8384a1a40d9684b856d58d4b10cf1bc2ad0005c +size 343471 diff --git a/scorematchingenablescausaldiscoveryofnonlinearadditivenoisemodels/full.md b/scorematchingenablescausaldiscoveryofnonlinearadditivenoisemodels/full.md new file mode 100644 index 0000000000000000000000000000000000000000..301e7d74c716ff2370dd309d6ff68472c5801425 --- /dev/null +++ b/scorematchingenablescausaldiscoveryofnonlinearadditivenoisemodels/full.md @@ -0,0 +1,410 @@ +# Score Matching Enables Causal Discovery of Nonlinear Additive Noise Models + +Paul Rolland1 Volkan Cevher1 Matthias Kleindessner2 Chris Russel2 Bernhard Schölkopf2 Dominik Janzing2 Francesco Locatello2 + +# Abstract + +This paper demonstrates how to recover causal graphs from the score of the data distribution in non-linear additive (Gaussian) noise models. Using score matching algorithms as a building block, we show how to design a new generation of scalable causal discovery methods. To showcase our approach, we also propose a new efficient method for approximating the score's Jacobian, enabling to recover the causal graph. Empirically, we find that the new algorithm, called SCORE, is competitive with state-of-the-art causal discovery methods while being significantly faster. + +# 1. Introduction + +In this work, we focus on causal discovery from purely observational data, i.e., finding a causal Directed Acyclic Graph (DAG) underlying a given data set. This problem is at the core of causality, since knowledge of the causal graph support the prediction of the effect of interventions (Peters et al., 2017; Scholkopf et al., 2021). + +In general, the problem of causal discovery from observational data is ill-posed: there may be several generative models with various causal structures that can produce the same data distribution. Therefore, in order to make the problem well-posed, we need to rely on extra assumptions on the generative process. A popular solution is to assume that the noise injected during the generation of each variable is additive (see equation (1)). Under additional assumptions on the link functions, it has been shown that such model is identifiable from purely observational data (Peters et al., 2014). + +Many causal discovery algorithms maximize a suitable loss + +$^{1}$ École Polytechnique Fédéral de Lausanne, Lausanne, Switzerland $^{2}$ Amazon, Tuebingen, Germany. Correspondence to: Paul Rolland , Francesco Locatello . + +Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s). + +function over the set of (DAGs). Unfortunately, solving such problem using classical loss functions is known to be NP-hard (Chickering, 1996). Therefore, recent methods focused on heuristic approximations, e.g., by using a greedy approach (PC, FCI (Spirtes et al., 2000; Zhang, 2008), GES (Chickering, 2002), CAM (Buhlmann et al., 2014) and others (Teyssier & Koller, 2012; Larranaga et al., 1996; Singh & Valtorta, 1993; Cooper & Herskovits, 1992; Bouckaert, 1992)), by expressing the problem as a continuous non-convex optimization problem and applying first-order optimization methods (GraNDAG (Lachapelle et al., 2019), NOTEARS (Zheng et al., 2018)), or by using Reinforcement Learning methods (RL-BIC (Zhu et al., 2019), CORL (Wang et al., 2021)). + +There are two distinct aspects that make the search over DAGs difficult: the size of the set of DAGs, which grows super-exponentially with the number of nodes, and the acyclicity constraint. In order to reduce the impact of these two difficulties, approaches called order-based methods (Teyssier & Koller, 2012) tackle the problem in two phases. First, they find a certain topological ordering of the nodes, such that a node in the ordering can be a parent only of the nodes appearing after it in the same ordering. Second, the graph is constructed respecting the topological ordering and pruning spurious edges, e.g., using sparse regression (Buhlmann et al., 2014). While the first step still requires to solve a combinatorial problem, the set of permutations is much smaller than the set of DAGs. Moreover, once a topological order is fixed, the acyclicity constraint is naturally enforced, making the pruning step easier to solve. + +The method that we propose is an order-based one, where the topological order is estimated based on an approximation of the score of the data distribution. The score of a distribution with a differentiable probability density $p(x)$ is defined as the map $\nabla \log p(x)$ .1 We show that for a nonlinear additive Gaussian noise model, it is possible to identify leaves of the causal graph by analysing its entailed observational score. By sequentially identifying the leaves + +of the causal graph, and removing the identified leaf variables, one can obtain a complete topological order with a time complexity linear in the number of nodes. Classical pruning techniques can then be used in order to obtain the final graph. While the proposed algorithm is designed for additive Gaussian noise models, we show that the main required ingredient for our method to work is the additive structure of the model, rather than the noise type. Hence, we expect similar methods to also be applicable to other types of noise (i.e., non-Gaussian). Closest to our work is LISTEN (Ghoshal & Honorio, 2018) which can be derived as a special case of our framework in the linear setting as described in the related work section. + +In order to approximate the score of the data distribution from a sample, we exploit and extend recent work on score matching and density gradient estimation (Li & Turner, 2017). Score approximation methods from observational data have shown success in general machine learning tasks such as generative (Song & Ermon, 2019) and discriminative models (Zimmermann et al., 2021), leading to increased interest in developing scalable and efficient solutions. In particular, score-based generative models have shown state-of-the-art performance for image generation (Song & Ermon, 2019; Song et al., 2020b;a; Song & Ermon, 2020). As much of the prior work on causal discovery approaches has focused on leveraging machine/deep learning (Lachapelle et al., 2019; Zheng et al., 2018; Zhu et al., 2019; Wang et al., 2021) to provide a tractable approximation to an NP-hard problem, our work is especially relevant to bridge the gap between provably identifying the causal structure and leveraging advances in deep generative models to scale to large sample sizes and high dimensions. + +Hereafter, we summarize our contributions: + +- We start by showing that, in the case of non-linear additive Gaussian noise model, knowing the distribution's score function is sufficient to recover the full causal graph, and we provide a method for doing so. Our approach enjoys a linear complexity in the number of nodes to identify the topological order and introduces a new way of learning causal structure from observational data. To the best of our knowledge, the link between the score function and the causal graph structure established in Lemmata 1 and 2 is not only useful, but also novel. +- We propose a new method for estimating the score's Jacobian over a set of observations, exploiting and extending an existing method based on Stein's identity, which can be of independent interest. This method is then used to design a practical algorithm for estimating the causal topological order. +- We finally evaluate our proposed algorithm on both + +synthetic and real world data and show competitive results compared to state-of-the-art methods, while being significantly faster ( $10 \times$ faster than CAM (Buhlmann et al., 2014) on 20 nodes graphs and $5 \times$ faster than GraN-DAG (Lachapelle et al., 2019) on 50 nodes). We also show that our method is robust to noise misspecification and works well when the additive noise is non-Gaussian. + +# 2. Related Work + +Causal discovery for non-linear additive models Many algorithms have been proposed in the past few years for the specific problem studied in this work. GraN-DAG (Lachapelle et al., 2019) aims to maximise the likelihood of the observed data under this model, and uses a continuous constraint for the acyclicity of the causal graph, proposed in (Zheng et al., 2018), in order to use a continuous optimization method to find a first order stationary point of the problem. CAM (Buhlmann et al., 2014) further assumes that the link functions $f_{i}$ in (1) also have an additive structure. They first estimate a topological order by greedily maximizing the data likelihood, and then prune the DAG using sparse regression techniques. + +In the scope of linear additive models, (Ghoshal & Honorio, 2018) first proposed an approach to provably recover, under some hypothesis on the noise variances, the causal graph in polynomial time and sample complexity. Their approach can be seen as an order-based method, where the ordering is estimated by sequentially identifying leaves based on an estimation of the precision matrix. In spirit, their method is closely related to ours. For instance, if the link functions $f_{i}$ in (1) are all linear, then the score of the joint distribution of $X$ is given by $s(x) = -\Theta x$ , where $\Theta$ is the precision matrix. Hence, the score's Jacobian, which is used in our algorithm to identify the causal graph, can be seen as a non-linear generalization of the precision matrix, which has shown success for identifying causal relations in linear settings (Loh & Buhlmann, 2014). + +While our work focuses on the identifiable non-linear additive Gaussian noise model, other works target more general non-parametric model, but must then rely on different kinds of assumptions such as faithfulness, restricted faithfulness or sparsest Markov representation (Spirtes et al., 2000; Raskutti & Uhler, 2018; Solus et al., 2021). These works apply conditional independence tests, and learn a graph that matches the identified conditional independence relations (Spirtes et al., 2000; Zhang, 2008). + +Score estimation In the scope of generative modelling (Song & Ermon, 2019), the score function is learned by fitting a neural network minimizing the empirical Fisher divergence (Hyvarinen & Dayan, 2005). While performing + +well in practice, such method is quite computationally expensive and requires tuning of several training parameters. + +For our purpose, we chose to instead minimize the kernelized Stein discrepancy, since this approach provides a close form solution, allowing fast estimation at all observations. In practice, such method performs similarly as score matching while being much faster to compute. Asymptotic consistency of the Stein gradient estimator, and its relation to score matching were analyzed in (Barp et al., 2019). + +# 3. Preliminaries + +# 3.1. Causal discovery for non-linear additive Gaussian noise models + +Assume that a random variable $X\in \mathbb{R}^d$ is generated using the following model: + +$$ +X _ {i} = f _ {i} \left(\operatorname {p a} _ {i} (X)\right) + \epsilon_ {i}, \tag {1} +$$ + +$i = 1,\dots ,d$ where $\mathrm{pa}_i(X)$ selects the coordinates of $X$ which are parents of node $i$ in some DAG. The noise variables $\epsilon_{i}\sim \mathcal{N}(0,\sigma_{i}^{2})$ are jointly independent. The functions $f_{j}$ are assumed to be twice continuously differentiable and non-linear in every component. That is, if we denote the parents $\mathrm{pa}_j(X)$ of $X_{j}$ by $X_{k_1},X_{k_2},\ldots ,X_{k_l}$ , then, for all $a = 1,\dots ,l$ , the function $f_{j}(x_{k_{1}},\ldots ,x_{k_{a - 1}},\cdot ,x_{k_{a + 1}},\ldots ,x_{k_{l}})$ is assumed to be nonlinear for some $x_{k_1},\ldots ,x_{k_{a - 1}},x_{k_{a + 1}},\ldots ,x_{k_l}\in \mathbb{R}^{l - 1}$ + +This model is known to be identifiable from observational data (Peters et al., 2014), meaning that it is possible to recover the DAG underlying the generative model (1) from the knowledge of the joint probability distribution of $X$ . In the present work, we aim to identify the causal graph from the score function $\nabla \log p(x)$ , which has a one-to-one correspondence with $p(x)$ . Hence, any model identifiable from observational data will be identifiable from the knowledge of the data score function. + +# 3.2. Score matching + +The goal of score matching is to learn the score function $s(x) \equiv \nabla \log p(x)$ of a distribution with density $p(x)$ given an i.i.d. sample $\{x^k\}_{k=1,\dots,n}$ . In this section, we present a method developed in (Li & Turner, 2017) for estimating the score at the sample points, i.e., approximating $\mathbf{G} \equiv (\nabla \log p(x^1), \dots, \nabla \log p(x^n))^T \in \mathbb{R}^{n \times d}$ . + +This estimator is based on the well known Stein identity (Stein, 1972), which states that for any test function $\mathbf{h}:\mathbb{R}^d\to \mathbb{R}^{d'}$ such that $\lim_{\mathbf{x}\to \infty}\mathbf{h}(\mathbf{x})p(\mathbf{x}) = 0$ , we have + +$$ +\mathbb {E} _ {p} \left[ \mathbf {h} (\mathbf {x}) \nabla \log p (\mathbf {x}) ^ {T} + \nabla \mathbf {h} (\mathbf {x}) \right] = 0, \tag {2} +$$ + +where $\nabla \mathbf{h}(\mathbf{x})\equiv (\nabla h_1(\mathbf{x}),\dots ,\nabla h_{d'}(\mathbf{x}))^T\in \mathbb{R}^{d'\times d}$ + +By approximating the expectation in (2) using Monte Carlo, we obtain + +$$ +- \frac {1}{n} \sum_ {k = 1} ^ {n} \mathbf {h} \left(\mathbf {x} ^ {k}\right) \nabla \log p \left(\mathbf {x} ^ {k}\right) ^ {T} + \operatorname {e r r} = \frac {1}{n} \sum_ {k = 1} ^ {n} \nabla \mathbf {h} \left(\mathbf {x} ^ {k}\right), \tag {3} +$$ + +where err is a random error term with mean zero, and which vanishes as $n \to \infty$ almost surely. By denoting $\mathbf{H} = (\mathbf{h}(\mathbf{x}^1), \ldots, \mathbf{h}(\mathbf{x}^n)) \in \mathbb{R}^{d' \times n}$ and $\overline{\nabla \mathbf{h}} = \frac{1}{n} \sum_{k=1}^{n} \nabla \mathbf{h}(\mathbf{x}^k)$ , equation (3) reads $-\frac{1}{n} \mathbf{H} \mathbf{G} + \mathrm{err} = \overline{\nabla} \mathbf{h}$ . Hence, by using ridge regression, the Stein gradient estimator is defined as: + +$$ +\hat {\mathbf {G}} ^ {\text {S t e i n}} \equiv \underset {\hat {\mathbf {G}}} {\arg \min } \| \overline {{\nabla \mathbf {h}}} + \frac {1}{n} \mathbf {H} \hat {\mathbf {G}} \| _ {F} ^ {2} + \frac {\eta}{n ^ {2}} \| \hat {\mathbf {G}} \| _ {F} ^ {2} \tag {4} +$$ + +$$ += - \left(\mathbf {K} + \eta \mathbf {I}\right) ^ {- 1} \langle \nabla , \mathbf {K} \rangle , \tag {5} +$$ + +where $\mathbf{K} \equiv \mathbf{H}^T\mathbf{H}$ , $\mathbf{K}_{ij} = \kappa (\mathbf{x}^i,\mathbf{x}^j) \equiv \mathbf{h}(x^i)^T\mathbf{h}(\mathbf{x}^j)$ , $\langle \nabla ,\mathbf{K}\rangle = n\mathbf{H}^T\overline{\nabla}\mathbf{h}$ , $\langle \nabla ,\mathbf{K}\rangle_{ij} = \sum_{k = 1}^{n}\nabla_{x_j^k}\kappa (\mathbf{x}^i,\mathbf{x}^k)$ and $\eta \geq 0$ is a regularisation parameter. One can hence use the kernel trick, and use the estimator (5) using any kernel $\kappa$ satisfying Stein's identity, such as the RBF kernel as shown in (Liu et al., 2016). + +In the present work, we will exploit and extend this approach in order to obtain estimates of the score's Jacobian over the observations. + +# 4. Causal Discovery via Score Matching + +In this section, we will show how to recover the causal graph from the score function $\nabla \log p(x)$ for a non-linear additive model (1). We first design our proposed method in the case where the additive noise is Gaussian, and then discuss extensions to other types of noise. + +# 4.1. Deduce the causal graph from the score of the data distribution + +Suppose that we have access to enough observational data coming from an additive Gaussian noise model (1) so that we can accurately approximate the score function of the underlying data distribution. In order to extract information about the graph structure from the score function, let us write it in closed form for a model of the form (1). The associated probability distribution is given by + +$$ +p (x) = \prod_ {i = 1} ^ {d} p \left(x _ {i} \mid \mathrm {p a} _ {i} (x)\right) +$$ + +$$ +\begin{array}{l} \log p (x) = \sum_ {i = 1} ^ {d} \log p \left(x _ {i} \mid \mathrm {p a} _ {i} (x)\right) \\ = - \frac {1}{2} \sum_ {i = 1} ^ {d} \left(\frac {x _ {i} - f _ {i} (\mathsf {p a} _ {i} (x))}{\sigma_ {i}}\right) ^ {2} - \frac {1}{2} \sum_ {i = 1} ^ {d} \log (2 \pi \sigma_ {i} ^ {2}). \\ \end{array} +$$ + +Thus, the score function $s(\mathbf{x}) \equiv \nabla \log p(\mathbf{x})$ reads + +$$ +\begin{array}{l} s _ {j} (x) = - \frac {x _ {j} - f _ {j} \left(\mathrm {p a} _ {j} (x)\right)}{\sigma_ {j} ^ {2}} \\ + \sum_ {i \in \text {c h i l d r e n} (j)} \frac {\partial f _ {i}}{\partial x _ {j}} \left(\mathrm {p a} _ {i} (x)\right) \frac {x _ {i} - f _ {i} \left(\mathrm {p a} _ {i} (x)\right)}{\sigma_ {i} ^ {2}}. \end{array} \tag {6} +$$ + +An immediate observation from equation (6) is that, if $j$ is a leaf, then $s_j(x) = -\frac{x_j - f_j(\mathrm{pa}_j(x))}{\sigma_j^2}$ . Since $j \notin \mathrm{pa}_j(x)$ , we have that $\frac{\partial s_j(x)}{\partial x_j} = -\frac{1}{\sigma_j^2}$ , and hence, it holds that $\operatorname{Var}\left(\frac{\partial s_j(x)}{\partial x_j}\right) = 0$ . The following Lemma shows that this condition is also sufficient for $j$ to be a leaf, providing a way to provably identify a leaf of the graph from the knowledge of the Jacobian of the score function. + +Lemma 1. Let $p$ be the probability density function of a random variable $X$ defined via a non-linear additive Gaussian noise model (1), and let $s(x) = \nabla \log p(x)$ be the associated score function. Then, $\forall j \in \{1, \dots, d\}$ , we have: + +(i) $j$ is a leaf $\Leftrightarrow \forall x, \frac{\partial s_j(x)}{\partial x_j} = c$ , with $c \in \mathbb{R}$ independent of $x$ , i.e., $\operatorname{Var}_X\left[\frac{\partial s_j(X)}{\partial x_j}\right] = 0$ . +(ii) If $j$ is a leaf, $i$ is a parent of $j \Leftrightarrow s_j(x)$ depends on $x_i$ , i.e., $\operatorname{Var}_X\left[\frac{\partial s_j(X)}{\partial x_i}\right] \neq 0$ . + +Proof. (i) Equation (6) implies the “ $\Rightarrow$ ” direction as described above. + +We prove the other direction by contradiction. Suppose that $j$ is not a leaf and that $\frac{\partial s_j(x)}{\partial x_j} = c \forall x$ . We can thus write: + +$$ +s _ {j} (x) = c x _ {j} + g (x _ {- j}), +$$ + +where $g(x_{-j})$ can depend on any variable but $x_{j}$ . By plug- ing equation (6) in $s_j$ , we get + +$$ +\begin{array}{l} \frac {f _ {j} \left(\mathrm {p a} _ {j} (x)\right)}{\sigma_ {j} ^ {2}} + \sum_ {i \in \text {c h i l d r e n} (j)} \frac {\partial f _ {i}}{\partial x _ {j}} \left(\mathrm {p a} _ {i} (x)\right) \frac {x _ {i} - f _ {i} \left(\mathrm {p a} _ {i} (x)\right)}{\sigma_ {i} ^ {2}} \\ = \left(c + \frac {1}{\sigma_ {j} ^ {2}}\right) x _ {j} + g (x _ {- j}). \\ \end{array} +$$ + +Let $i_c$ be a child of node $j$ such that $\forall i \in \mathrm{children}(j)$ , $i_c \notin \mathrm{pa}_i$ . Such a node always exists since $j$ is not a leaf, and it suffices to pick a child of $j$ appearing at last in some + +topological order. We then have + +$$ +\begin{array}{l} \frac {\partial f _ {i _ {c}}}{\partial x _ {j}} \left(\mathbf {p a} _ {i _ {c}} (x)\right) \frac {x _ {i _ {c}} - f _ {i _ {c}} \left(\mathbf {p a} _ {i _ {c}} (x)\right)}{\sigma_ {i _ {c}} ^ {2}} - g (x _ {- j}) \\ = \left(c + \frac {1}{\sigma_ {j} ^ {2}}\right) x _ {j} - \frac {f _ {j} \left(\operatorname {p a} _ {j} (x)\right)}{\sigma_ {j} ^ {2}} \tag {7} \\ - \sum_ {i \in \text {c h i l d r e n} (j), i \neq i _ {c}} \frac {\partial f _ {i}}{\partial x _ {j}} (\mathrm {p a} _ {i} (x)) \frac {x _ {i} - f _ {i} (\mathrm {p a} _ {i} (x))}{\sigma_ {i} ^ {2}}. \\ \end{array} +$$ + +Now, due to the specific choice of $i_c$ , we have that the RHS of (7) does not depend on $x_{i_c}$ (note that we are here speaking about functional dependence on variables, not statistical dependence on a random variable). Hence, we have + +$$ +\begin{array}{l} \frac {\partial}{\partial x _ {i _ {c}}} \left(\frac {\partial f _ {i _ {c}}}{\partial x _ {j}} \left(\mathfrak {p a} _ {i _ {c}} (x)\right) \frac {x _ {i _ {c}} - f _ {i _ {c}} \left(\mathfrak {p a} _ {i _ {c}} (x)\right)}{\sigma_ {i _ {c}} ^ {2}} - g \left(x _ {- j}\right)\right) = 0 \\ \Rightarrow \frac {\partial f _ {i _ {c}}}{\partial x _ {j}} = \sigma_ {i _ {c}} ^ {2} \frac {\partial g (x _ {- j})}{\partial x _ {i _ {c}}}. \\ \end{array} +$$ + +Since $g$ does not depend on $x_{j}$ , this means that $\frac{\partial f_{i_c}}{\partial x_j}$ does not depend on $x_{j}$ neither, implying that $f_{i_c}$ is linear in $x_{j}$ , contradicting the non-linearity assumption. + +(ii) If $j$ is a leaf, then, by equation (6), we have: + +$$ +s _ {j} (x) = - \frac {x _ {j} - f _ {j} (\mathrm {p a} _ {j} (x))}{\sigma_ {j} ^ {2}} +$$ + +If $i$ is not a parent of $j$ , then $\frac{\partial s_j}{\partial x_i} \equiv 0$ , and hence we have $\operatorname{Var}_X\left[\frac{\partial s_j(x)}{\partial x_i}\right] = 0$ . On the other hand, if $i$ is a parent of $j$ , then we have $\frac{\partial s_j}{\partial x_i}(x) = \frac{1}{\sigma_j^2} \frac{\partial f_j}{\partial x_i} (\mathrm{pa}_j(x))$ . Moreover, since $f_j$ cannot be linear in $x_i$ , $\frac{\partial f_j}{\partial x_i} (\mathrm{pa}_j(x))$ cannot be a constant, and hence $\operatorname{Var}_X\left[\frac{\partial s_j(X)}{\partial x_i}\right] \neq 0$ . + +![](images/3a78bcfb6d38acd3cf20039e256870ee84632b39b076b30c0192bb994349743a.jpg) + +Discussion: Lemma 1 shows that, for non-linear additive Gaussian noise models, leaf nodes (and only leaf nodes) have the property that the associated diagonal element in the score's Jacobian is a constant. This hence provides a way to identify a leaf of the causal graph from the knowledge of the variance of the score's Jacobian diagonal elements. By repeating this method and always removing the identified leaves, we can estimate a full topological order. This procedure is summarized in Algorithm 1. In the following section, we present a new approach, exploiting Stein identities, to compute estimates of the score's Jacobian over a set of samples. + +Note that the use of empirical variance to identify identically 0 function $\frac{\partial s_j}{\partial x_j}$ is not necessary. However, we did + +not find any empirical benefit when using other deviation measures, such as the average distance to the median for example. + +DAG pruning. Once a topological order is estimated, the DAG becomes constrained to be a sub-graph of a certain fully connected DAG. However, it is necessary to prune this fully connected DAG to remove spurious edges. In theory, it would be possible to make use the learnt score for this purpose, by using property (ii) of Lemma 1. However, more classical methods such as CAM appears to perform better in practice. The idea behind CAM is to assume that the link functions $f_{i}$ in (1) have an additive structure. We then perform sparse regression on each component and use hypothesis testing for additive models (Marra & Wood, 2011) to decide upon existence of edges. For further details about this pruning technique, please refer to the original paper (Buhlmann et al., 2014). + +Algorithm 1 SCORE-matching causal order search +Input: Data matrix $X\in \mathbb{R}^{n\times d}$ +Initialize $\pi = []$ nodes $= \{1,\dots ,d\}$ +for $k = 1,\ldots ,d$ do Estimate the score function $s_{nodes} = \nabla \log p_{nodes}$ (for example using Algorithm 1). Estimate $V_{j} = \mathrm{Var}_{X_{nodes}}\left[\frac{\partial s_{j}(X)}{\partial x_{j}}\right]$ $l\gets$ nodes[arg min $j$ $V_{j}]$ $\pi \gets [l,\pi ]$ nodes $\gets$ nodes- $\{l\}$ Remove $l$ -th column of $X$ +end for +Get the final DAG by pruning the full DAG associated with the topological order $\pi$ + +# 4.2. Approximation of the score's Jacobian + +The Stein gradient estimator $\hat{\mathbf{G}}^{\mathrm{Stein}}$ enables us to estimate the score function point-wise at each of our sample points. However, according to the previous section, what we need for identifying the graph is an estimate of the Jacobian of the score at all samples, in order to estimate its variance. Since we do not have a functional approximation of the score, we cannot use tricks such as auto-differentiation in order to obtain higher order derivative approximations. In this section, we extend the ideas of Stein based estimator to obtain estimates for the score's Jacobian. + +For this purpose, we will use the second-order Stein identity (Diaconis et al., 2004; Zhu, 2021). Assuming that $p$ is twice differentiable, for any $q: \mathbb{R}^d \to \mathbb{R}$ such that $\lim_{\mathbf{x} \to \infty} q(\mathbf{x}) p(\mathbf{x}) = 0$ and such that $\mathbb{E}[\nabla^2 q(\mathbf{x})]$ exists, the second-order Stein identity states that + +$$ +\mathbb {E} [ q (\mathbf {x}) p (\mathbf {x}) ^ {- 1} \nabla^ {2} p (\mathbf {x}) ] = \mathbb {E} [ \nabla^ {2} q (\mathbf {x}) ], \tag {8} +$$ + +which can be rewritten as + +$$ +\begin{array}{l} \mathbb {E} [ q (\mathbf {x}) \nabla^ {2} \log p (\mathbf {x}) ] \\ = \mathbb {E} [ \nabla^ {2} q (\mathbf {x}) - q (\mathbf {x}) \nabla \log p (\mathbf {x}) \nabla \log p (\mathbf {x}) ^ {T} ]. \tag {9} \\ \end{array} +$$ + +Recall that, in order to identify a leaf of the causal graph, we are only interested in estimating the diagonal elements of the score's Jacobian at the sample points, i.e., $J \equiv (\mathrm{diag}(\nabla^2\log p(\mathbf{x}^1)),\dots ,\mathrm{diag}(\nabla^2\log p(\mathbf{x}^n)))^T \in \mathbb{R}^{n\times d}$ . Using the diagonal part of the matrix equation (9) for various test functions gathered in $\mathbf{h}:\mathbb{R}^d\to \mathbb{R}^{d'}$ , we can write + +$$ +\begin{array}{l} \mathbb {E} [ \mathbf {h} (\mathbf {x}) \operatorname {d i a g} (\nabla^ {2} \log p (\mathbf {x})) ^ {T} ] \\ = \mathbb {E} \left[ \nabla_ {\operatorname {d i a g}} ^ {2} \mathbf {h} (\mathbf {x}) - \mathbf {h} (\mathbf {x}) \operatorname {d i a g} \left(\left(\nabla \log p (\mathbf {x}) \nabla \log p (\mathbf {x}) ^ {T}\right)\right) \right], \tag {10} \\ \end{array} +$$ + +where $(\nabla_{\mathrm{diag}}^2\mathbf{h}(\mathbf{x}))_{ij} = \frac{\partial^2h_i(\mathbf{x})}{\partial x_j^2}$ . By approximating the expectations by an empirical average, we obtain, similarly as in (3), + +$$ +\begin{array}{l} \frac {1}{n} \sum_ {k = 1} ^ {n} \mathbf {h} \left(\mathbf {x} ^ {k}\right) \operatorname {d i a g} \left(\nabla^ {2} \log p \left(\mathbf {x} ^ {k}\right)\right) ^ {T} + \operatorname {e r r} \\ = \frac {1}{n} \sum_ {k = 1} ^ {n} \left(\nabla_ {\mathrm {d i a g}} ^ {2} \mathbf {h} \left(\mathbf {x} ^ {k}\right) \right. \\ \left. - \mathbf {h} \left(\mathbf {x} ^ {k}\right) \operatorname {d i a g} \left(\nabla \log p \left(\mathbf {x} ^ {k}\right) \nabla \log p \left(\mathbf {x} ^ {k}\right) ^ {T}\right)\right). \tag {11} \\ \end{array} +$$ + +By denoting $\mathbf{H} = (\mathbf{h}(\mathbf{x}^1),\dots ,\mathbf{h}(\mathbf{x}^n))\in \mathbb{R}^{d'\times n}$ and $\overline{\nabla_{\mathrm{diag}}^2\mathbf{h}}\equiv \frac{1}{n}\sum_{k = 1}^n\nabla_{\mathrm{diag}}^2\mathbf{h}(\mathbf{x}^k)$ , equation (11) reads $\frac{1}{n}\mathbf{H}\mathbf{J} +$ err $= \overline{\nabla_{\mathrm{diag}}^2\mathbf{h}} -\frac{1}{n}\mathbf{H}\mathrm{diag}(\mathbf{G}\mathbf{G}^T)$ . Hence, by using the Stein gradient estimator for $\mathbf{G}$ , we define the Stein Hessian estimator as the ridge regression solution of the previous equation, i.e., + +$$ +\mathbf {J} ^ {\text {S t e i n}} \equiv \tag {12} +$$ + +$$ +\begin{array}{l} \underset {\mathbf {\hat {J}}} {\arg \min } \left\| \frac {1}{n} \mathbf {H} \mathbf {\hat {J}} + \frac {1}{n} \mathbf {H} \operatorname {d i a g} \left(\hat {\mathbf {G}} ^ {\text {S t e i n}} \left(\hat {\mathbf {G}} ^ {\text {S t e i n}}\right) ^ {T}\right) - \overline {{\nabla_ {\operatorname {d i a g}} ^ {2} \mathbf {h}}} \right\| _ {F} ^ {2} \\ + \frac {\eta}{n ^ {2}} \| \hat {\mathbf {J}} \| _ {F} ^ {2} \\ = - \operatorname {d i a g} \left(\hat {\mathbf {G}} ^ {\text {S t e i n}} \left(\hat {\mathbf {G}} ^ {\text {S t e i n}}\right) ^ {T}\right) + (\mathbf {K} + \eta \mathbf {I}) ^ {- 1} \left\langle \nabla_ {\text {d i a g}} ^ {2}, \mathbf {K} \right\rangle , \tag {13} \\ \end{array} +$$ + +where $\mathbf{K}_{ij} = \kappa (\mathbf{x}^i,\mathbf{x}^j)\equiv \mathbf{h}(\mathbf{x}^i)^T\mathbf{h}(\mathbf{x}^j),\langle \nabla_{\mathrm{diag}}^2,\mathbf{K}\rangle = n\mathbf{H}^T\overline{\nabla_{\mathrm{diag}}^2\mathbf{h}},\langle \nabla_{\mathrm{diag}}^2,\mathbf{K}\rangle_{ij} = \sum_{i = 1}^n\frac{\partial^2\kappa(\mathbf{x}^i,\mathbf{x}^k)}{\partial\mathbf{x}_j^{k2}}$ and $\mathbf{G}^{\mathrm{Stein}}$ is + +defined in (5). The regularisation parameter $\eta$ lifts the eigenvalues of the same matrix $\mathbf{K}$ as in the Stein gradient estimator $\hat{\mathbf{G}}^{\mathrm{Stein}}$ . We hence decide to use the same parameter for both ridge regression problems. + +Choice of kernel Estimating the score's Jacobian with the method above requires a choice of kernel $\kappa$ . A widely used kernel is the RBF kernel $\kappa_{s}(x,y) = e^{-\frac{\|x - y\|_2^2}{2s^2}}$ , which has one parameter $s$ called the bandwidth. This parameter can be estimated from the data to be fitted, using the commonly used median heuristic, i.e., choosing $s$ to be the median of the pairwise distances between vectors in $X$ . This estimation procedure even enjoys theoretical convergence properties (Garreau et al., 2017). Note that, when using Algorithm 2 for causal discovery in Algorithm 1, the kernel lengthscale is re-computed each time a node is removed from the data matrix $X$ . + +# Algorithm 2 Estimating the Jacobian of the score + +Input: Data matrix $X\in \mathbb{R}^{n\times d}$ , regularisation parameter $\eta >0$ + +$$ +\begin{array}{l} s \leftarrow \operatorname {m e d i a n} (\{\| x _ {i} - x _ {j} \| _ {2}: i, j = 1, \dots , n, x _ {k} = \\ X [ k,: ] \}). \end{array} +$$ + +Compute $\hat{\mathbf{J}}^{\mathrm{Stein}}$ using RBF kernel $\kappa_{s}$ , regularisation parameter $\eta$ and data matrix $X$ based on (13). + +Algorithm complexity Estimating the topological order requires inverting $d$ times an $n \times n$ kernel matrix, hence the complexity is $\mathcal{O}(dn^3)$ (and could be improved using, e.g., Strassen's algorithm (Strassen, 1969)). Including the pruning step, the final complexity is hence $\mathcal{O}(dn^3 + dr(n, d))$ where $r(n, d)$ is the complexity of fitting a generalized additive model using $n$ data points in $d$ dimensions. In comparison, the complexity of CAM is $\mathcal{O}(d^2 r(n, d))$ . The total computational complexity of GraNDAG is not discussed in (Lachapelle et al., 2019); it is difficult to specify it since it depends on the number of iterations used in the Augmented Lagrangian method, which may depend on the dimension and number of samples. However, GraNDAG is particularly slow due to the computation of the acyclicity constraint at each iteration, which requires computing the exponential of a $d \times d$ matrix, taking $\mathcal{O}(d^3)$ operations. + +In practice, in our method, the time for estimating the topological order is much smaller than the time for pruning it (30% of the total time for $(d,n) = (20,1000)$ and 5% of the total time for $(d,n) = (50,1000)$ ). In comparison, CAM spends most of the time estimating the topological order (more than 95% of the total time in all tested scenarios). Hence, we expect the dominant term in our method's time complexity to be $dr(n,d)$ , thus improving upon CAM's complexity. Moreover, in the case where $n$ + +becomes very large, it is possible to use kernel approximation methods to reduce the time complexity of our method (Si et al., 2014). + +# 4.3. Extension to non-Gaussian additive noise models + +In the previous section, we exploited the structure of the additive Gaussian noise model to deduce the causal graph from the score function (1). Actually, the main ingredient required in our analysis is the additive structure. Indeed, for any additive noise model (including non-Gaussian noise), the score function has a similar structure as in (6). + +Lemma 2. Suppose that the random variable $X$ is generated from (1) where the noise variables $\epsilon_{i}$ are i.i.d. with smooth probability distribution function $p^{\epsilon}$ . Then, the score function of $X$ can be written as follows: + +$$ +\begin{array}{l} s _ {j} (\boldsymbol {x}) = \frac {d \log p ^ {\epsilon}}{d x} \left(x _ {j} - f _ {j} \left(p a _ {j} (\boldsymbol {x})\right)\right) \\ - \sum_ {i \in \text {c h i l d r e n} (j)} \frac {\partial f _ {i}}{\partial x _ {j}} \left(p a _ {i} (\boldsymbol {x})\right) \frac {d \log p ^ {\epsilon}}{d x} \left(x _ {i} - f _ {i} \left(p a _ {i} (\boldsymbol {x})\right)\right). \tag {14} \\ \end{array} +$$ + +The decomposition of the score's components $j$ into a common term $\frac{d\log p^{\epsilon}}{dx} (x_j - f_j(\mathrm{pa}_j(\mathbf{x})))$ and a term involving only the parents of the node $j$ is hence characteristic of general additive noise models. Recall that our method identifies leaves by identifying non-linearity in the components of the score. When the common term is linear in $x_{j}$ , as it is the case with Gaussian noise, the second term is the only one carrying non-linearities, and the leaves can hence be perfectly identified with this method (see Lemma 1). However, intuitively speaking, even when the noise is non-Gaussian, i.e., when the common term carries non-linearities, the second term still carries non-linearities proportionally to the number of parents of node $j$ . Hence, we may expect that the proposed algorithm can work in the case of general additive models, even when the noise is non-Gaussian. While this does not provide a formal identifiability statement, we will show in the experimental section that our proposed method outperforms other state-of-the-art algorithms on non-Gaussian additive models. + +# 5. Numerical Experiments + +We now apply Algorithm 1 with Algorithm 2 as score estimator to synthetic and real-world datasets and compare its performance to state-of-the-art methods, such as CAM (Buhlmann et al., 2014), GraNDAG (Lachapelle et al., 2019), SELF (Cai et al., 2018) and GES (Chickering, 2002). Some other methods such as NOTEARS, PC or FCI are omitted since they perform much worse (Buhlmann et al., 2014; Lachapelle et al., 2019). Recent work (Reisach et al., 2021) warned about the fact that sim + +ulated data sometimes lead to scenario where a topological order can simply be estimated by sorting the nodes variances. In order to defend ourselves against this, we randomly generate the noise variances in the generative model, and show that the estimated order when sorting the variance is much worse than the one estimated by Algorithm 1. The code can be found in https://github.com/paulrolland1307/SCORE/. + +# 5.1. Synthetic data + +We test our algorithm on synthetic data generated from a non-linear additive Gaussian noise model (1). Mimicking (Lachapelle et al., 2019; Zhu et al., 2019), we generate the link functions $f_{i}$ by sampling Gaussian processes with a unit bandwidth RBF kernel. The noise variances $\sigma_{i}^{2}$ are independently sampled uniformly in [0.4, 0.8]. The causal graph is generated using the Erdős-Rényi model (Erdős & Rényi, 2011). For a fixed number of nodes $d$ , we vary the sparsity of the sampled graph by setting the average number of edges to be either $d$ (ER1) or $4d$ (ER4). Moreover, to test the robustness of the algorithm against noise type misspecification, we also generate data with Laplace noise instead of Gaussian noise. Additional experiments, using Gumbel noise and scale free graphs (Barabási & Albert, 1999) can be found in Appendix A. + +For each method, we compute the structural Hamming distance (SHD) between the output and the true causal graph, which counts the number of missing, falsely detected or reversed edges, as well as the structural intervention distance (SID) (Peters & Buhlmann, 2015) which counts the number of interventional distribution which would be miscalculated using the chosen causal graph. + +For all order-based causal discovery methods, we always apply the same pruning procedure, i.e., CAM with the same cutoff parameter of 0.001. Moreover, we compute a quantity measuring how well the topological order is estimated. For an ordering $\pi$ , and a target adjacency matrix $A$ , we define the topological order divergence $D_{top}(\pi, A)$ as + +$$ +D _ {t o p} (\pi , A) = \sum_ {i = 1} ^ {d} \sum_ {j: \pi_ {i} > \pi_ {j}} A _ {i j}. +$$ + +If $\pi$ is a correct topological order for $A$ , then $D_{top}(\pi, A) = 0$ . Otherwise, $D_{top}(\pi, A)$ counts the number of edges that cannot be recovered due to the choice of topological order. It hence provides a lower bound on the SHD of the final algorithm (irrespective of the pruning method). + +The results of the synthetic experiments are shown in Tables 1 to 6. The computed quantities are averages over 10 independent runs. We can see that, for sparser graphs (ER1), our method performs similarly as the best method CAM. However, for denser graphs (ER4), our method per + +forms better, and in particular seems to estimate a better topological order, since the $D_{top}$ value is smaller. For 50 nodes graphs, the two best methods are CAM and ours, which both perform similarly. Note that, in order to run it within a reasonable time frame, we had to restrict the maximum number of neighbours, hence providing a sparsity prior to the algorithm, which fits the correct graph in this situation, since sparse Erdős-Renyi graphs usually do not contain high degree nodes. Since we restricted the number of neighbours in the graph, the order finding part of CAM does not yield a single topological order, hence we could not compute $D_{top}$ in this setting. We also observe that the topological ordering resulting from sorting the variances (VarSort) is much worse in general than with all other methods, showing that finding a topological order for the generated datasets is not a trivial task. Finally, we observe that our method is quite robust to noise misspecification, since the accuracy remains very similar for Laplace noise. + +In terms of running time (Table 7), we see that our method is significantly faster compared to the other competitive algorithms CAM and GraN-DAG. Actually, most of the time (95% for $d = 50$ ) is spent on pruning the final DAG using CAM. + +# 5.2. Real data + +We now compare the algorithms on a popular real-world dataset for causal discovery (Sachs et al., 2005) (11 nodes, 17 edges and 853 observations), as well as the pseudo-real dataset sampled from SynTReN generator (Van den Bulcke et al., 2006) (Table 8). We can see that on Sachs, our method matches the SHD of CAM while improving the SID. On the SynTReN datasets, GraN-DAG seems to perform best, but the confidence intervals highly overlap. + +# 6. Conclusion + +In this work, we demonstrated a new connection between score matching and causal discovery methods. We found that, in the case of non-linear additive Gaussian noise model, the causal graph can easily be recovered from the score function. In addition to generative models, this provides a new promising application for score estimation techniques. The proposed technique includes two modules: one that evaluates the (Jacobian of the) score, and one that prunes the final DAG given a topological order. Note that any score matching or pruning method can be plugged in to obtain a new practical algorithm. + +Future work One focus of this work was to build a fast algorithm for estimating a topological order, while avoiding the combinatorial complexity of searching over permutations, and the use of any heuristic optimization approaches. For this reason, we avoided using popular score + +Table 1: Synthetic experiment for $d = {10}$ with Gaussian noise + +
ER1ER4
SHDSID\( D_{top}(\pi, A) \)SHDSID\( D_{top}(\pi, A) \)
SCORE (ours)1.1 ± 0.94.5 ± 5.30.4 ± 0.619.5 ± 2.935.0 ± 9.10.3 ± 0.3
CAM1.7 ± 1.06.4 ± 4.20.4 ± 0.524.4 ± 3.145.2 ± 10.24.4 ± 3.2
GraN-DAG1.5 ± 1.46.5 ± 7.2-22.2 ± 2.642.0 ± 6.2-
SELF8.4 ± 1.632.5 ± 7.6-37.2 ± 2.183.0 ± 5.2-
GES7.8 ± 2.732.5 ± 13.6-34.3 ± 3.078.9 ± 6.0-
VarSort--1.9 ± 1.1--9.7 ± 3.1
+ +Table 2: Synthetic experiment for $d = {20}$ with Gaussian noise + +
ER1ER4
SHDSID\(D_{top}(\pi, A)\)SHDSID\(D_{top}(\pi, A)\)
SCORE (ours)2.6 ± 1.99.9 ± 8.51.2 ± 1.747.5 ± 4.5177.5 ± 11.63.1 ± 1.5
CAM3.5 ± 1.614.3 ± 9.80.8 ± 1.054.2 ± 5.4201.9 ± 29.013.6 ± 6.9
GraN-DAG7.6 ± 4.231.6 ± 22.7-49.3 ± 4.5211.4 ± 36.6-
SELF16.6 ± 2.189.9 ± 31.2-75.5 ± 1.6336.8 ± 31.2-
GES17.7 ± 3.877.3 ± 30.5-67.4 ± 6.1322.9 ± 21.7-
VarSort--3.7 ± 1.6--18.3 ± 6.7
+ +Table 3: Synthetic experiment for $d = {50}$ with Gaussian noise + +
ER1ER4
SHDSID\( D_{top}(\pi, A) \)SHDSID\( D_{top}(\pi, A) \)
SCORE (ours)10.4 ± 3.950.9 ± 32.93.9 ± 2.4131.5 ± 7.51262 ± 11016.3 ± 6.1
CAM8.3 ± 2.953.7 ± 31.9-140.8 ± 5.51337 ± 94-
GraN-DAG20.2 ± 6.1135.3 ± 45.9-140.8 ± 9.51432 ± 110-
SELF45.4 ± 3.5326.6 ± 74.3-192.7 ± 3.22097 ± 103-
GES50.5 ± 4.2233.5 ± 60.8-182.9 ± 7.32003 ± 105-
VarSort--8.8 ± 3.0--43.3 ± 9.7
+ +Table 4: Synthetic experiment for $d = 10$ with Laplace noise + +
ER1ER4
SHDSID\(D_{top}(\pi, A)\)SHDSID\(D_{top}(\pi, A)\)
SCORE (ours)1.4 ± 0.84.5 ± 4.70.8 ± 0.719.6 ± 2.531.9 ± 7.90.2 ± 0.4
CAM1.5 ± 1.36.1 ± 6.50.5 ± 0.524.4 ± 1.544.4 ± 8.11.5 ± 1.6
GraN-DAG1.3 ± 1.44.4 ± 4.9-20.3 ± 2.739.3 ± 13.0-
SELF9.7 ± 2.533.4 ± 10.8-38.2 ± 1.886.9 ± 4.3-
GES8.9 ± 2.228.3 ± 12.0-33.7 ± 2.378.9 ± 7.4-
VarSort--1.6 ± 1.3--7.2 ± 2.3
+ +Table 5: Synthetic experiment for $d = 20$ with Laplace noise + +
ER1ER4
SHDSID\( D_{top}(\pi, A) \)SHDSID\( D_{top}(\pi, A) \)
SCORE (ours)1.6 ± 1.26.8 ± 11.40.5 ± 0.948.0 ± 4.0199.8 ± 21.44.9 ± 1.8
CAM2.3 ± 1.410.0 ± 7.00.3 ± 0.552.4 ± 3.9208.7 ± 17.511.6 ± 7.9
GraN-DAG4.9 ± 2.127.5 ± 13.2-48.2 ± 3.8198.3 ± 42.8-
SELF16.4 ± 3.687.5 ± 32.3-77.4 ± 2.2349.5 ± 19.0-
GES17.7 ± 6.872.6 ± 25.5-69.7 ± 7.1325.5 ± 28.3-
VarSort--3.4 ± 2.0--20.8 ± 4.5
+ +Table 6: Synthetic experiment for $d = 50$ with Laplace noise + +
ER1ER4
SHDSID\(D_{top}(\pi, A)\)SHDSID\(D_{top}(\pi, A)\)
SCORE (ours)11.0 ± 4.571.8 ± 50.24.0 ± 2.5128.1 ± 7.91384 ± 13119.8 ± 3.5
CAM10.1 ± 3.466.1 ± 47.9-134.6 ± 7.21361 ± 136-
GraN-DAG21.9 ± 3.9165.7 ± 46.2-138.3 ± 8.81603 ± 166-
SELF42.4 ± 2.9361.4 ± 112.5-191.4 ± 2.92053 ± 110-
GES52.4 ± 7.7292.2 ± 105.9-182.5 ± 7.22028 ± 120-
VarSort--8.1 ± 4.2--47.3 ± 8.7
+ +Table 7: Run time (in seconds) comparison of the algorithms on ER1. The first row corresponds to the time spent for finding the topological order in our method. (*) In order to run CAM on 50 nodes within a reasonable time, we had to use preliminary neighbour search while restricting the maximum number of neighbours to 20 (Buhlmann et al., 2014). + +
d=10d=20d=50
SCORE order3.3 ± 0.18.5 ± 0.831 ± 2.9
SCORE6.3 ± 0.232.7 ± 6.7257 ± 17
CAM30.1 ± 3.7313 ± 801143 ± 79(*)
GraN-DAG185 ± 26357 ± 471410 ± 73
+ +Table 8: Comparison of several algorithms on the real world dataset Sachs and 10 datasets sampled from SynTReN. + +
Sachs SHDSIDSynTReN SHDSID
SCORE124536.2 ± 4.7193.4 ± 60.2
CAM125540.5 ± 6.8152.3 ± 48.0
GraN-DAG134734.0 ± 8.5161.7 ± 53.4
+ +matching algorithms developed for score-based generative modelling in high-dimensions (Song & Ermon, 2020), since re-training a neural network after each leaf removal would be quite expensive in practice. Amortization (Lowe et al., 2020) is a promising direction to alleviate this issue. + +In addition, we would like to further study the application of score matching causal discovery methods to generative model other than additive (Gaussian) noise. Due to the one-to-one correspondence between the score of a distribution and its density function, it should be possible to recover the graph from the score for any identifiable model. The question is hence: How to read the graph from the score function for a given model, and is there a universal way to do it that encapsulates a large class of models? + +# 7. Acknowledgements + +This project has received funding from the European Research Council (ERC) under the European Union's Horizon 2020 research and innovation programme (grant agreement n°725594 - time-data). This work was also supported by Hasler Foundation Program: Hasler Responsible AI (project number 21043). + +# References + +Barabási, A.-L. and Albert, R. Emergence of scaling in random networks. science, 286(5439):509-512, 1999. +Barp, A., Briol, F.-X., Duncan, A. B., Girolami, M., and Mackey, L. Minimumstein discrepancy estimators. arXiv preprint arXiv:1906.08283, 2019. +Bouckaert, R. R. Optimizing causal orderings for generating dags from data. In Uncertainty in Artificial Intelligence, pp. 9-16. Elsevier, 1992. +Buhlmann, P., Peters, J., and Ernest, J. Cam: Causal additive models, high-dimensional order search and penalized regression. The Annals of Statistics, 42(6):2526-2556, 2014. +Cai, R., Qiao, J., Zhang, Z., and Hao, Z. Self: structural equational likelihood framework for causal discovery. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 32, 2018. +Chickering, D. M. Learning bayesian networks is npcomplete. In Learning from data, pp. 121-130. Springer, 1996. +Chickering, D. M. Optimal structure identification with greedy search. Journal of machine learning research, 3 (Nov):507-554, 2002. +Cooper, G. F. and Herskovits, E. A bayesian method for the induction of probabilistic networks from data. Machine learning, 9(4):309-347, 1992. +Diaconis, P., Stein, C., Holmes, S., and Reinert, G. Use of exchangeable pairs in the analysis of simulations. + +In Stein's Method, pp. 1-25. Institute of Mathematical Statistics, 2004. +Erdős, P. and Rényi, A. On the evolution of random graphs, pp. 38-82. Princeton University Press, 2011. doi: doi:10.1515/9781400841356.38. URL https://doi.org/10.1515/9781400841356.38. +Garreau, D., Jitkrittum, W., and Kanagawa, M. Large sample analysis of the median heuristic. arXiv preprint arXiv:1707.07269, 2017. +Ghoshal, A. and Honorio, J. Learning linear structural equation models in polynomial time and sample complexity. In International Conference on Artificial Intelligence and Statistics, pp. 1466-1475. PMLR, 2018. +Hyvärinen, A. and Dayan, P. Estimation of non-normalized statistical models by score matching. Journal of Machine Learning Research, 6(4), 2005. +Lachapelle, S., Brouillard, P., Deleu, T., and Lacoste-Julien, S. Gradient-based neural dag learning. arXiv preprint arXiv:1906.02226, 2019. +Larranaga, P., Kuijpers, C. M., Murga, R. H., and Yurramendi, Y. Learning bayesian network structures by searching for the best ordering with genetic algorithms. IEEE transactions on systems, man, and cybernetics-part A: systems and humans, 26(4):487-493, 1996. +Li, Y. and Turner, R. E. Gradient estimators for implicit models. arXiv preprint arXiv:1705.07107, 2017. +Liu, Q., Lee, J., and Jordan, M. A kernelized stein discrepancy for goodness-of-fit tests. In International conference on machine learning, pp. 276-284. PMLR, 2016. +Loh, P.-L. and Buhlmann, P. High-dimensional learning of linear causal networks via inverse covariance estimation. The Journal of Machine Learning Research, 15(1): 3065-3105, 2014. +Löwe, S., Madras, D., Zemel, R., and Welling, M. Amortized causal discovery: Learning to infer causal graphs from time-series data. arXiv preprint arXiv:2006.10833, 2020. +Marra, G. and Wood, S. N. Practical variable selection for generalized additive models. Computational Statistics & Data Analysis, 55(7):2372-2387, 2011. +Peters, J. and Buhlmann, P. Structural intervention distance for evaluating causal graphs. Neural computation, 27(3): 771-799, 2015. +Peters, J., Mooij, J. M., Janzing, D., and Scholkopf, B. Causal discovery with continuous additive noise models. 2014. + +Peters, J., Janzing, D., and Schölkopf, B. Elements of causal inference: foundations and learning algorithms. The MIT Press, 2017. +Raskutti, G. and Uhler, C. Learning directed acyclic graph models based on sparsest permutations. Stat, 7(1):e183, 2018. +Reisach, A. G., Seiler, C., and Weichwald, S. Beware of the simulated dag! varisortability in additive noise models. NeurIPS, 2021. +Sachs, K., Perez, O., Pe'er, D., Lauffenburger, D. A., and Nolan, G. P. Causal protein-signaling networks derived from multiparameter single-cell data. Science, 308 (5721):523-529, 2005. +Schölkopf, B., Locatello, F., Bauer, S., Ke, N. R., Kalchbrenner, N., Goyal, A., and Bengio, Y. Toward causal representation learning. Proceedings of the IEEE, 109 (5):612-634, 2021. +Si, S., Hsieh, C.-J., and Dhillon, I. Memory efficient kernel approximation. In International Conference on Machine Learning, pp. 701-709. PMLR, 2014. +Singh, M. and Valtorta, M. An algorithm for the construction of bayesian network structures from data. In Uncertainty in Artificial Intelligence, pp. 259-265. Elsevier, 1993. +Solus, L., Wang, Y., and Uhler, C. Consistency guarantees for greedy permutation-based causal inference algorithms. Biometrika, 108(4):795-814, 2021. +Song, Y. and Ermon, S. Generative modeling by estimating gradients of the data distribution. In Advances in Neural Information Processing Systems, pp. 11918-11930, 2019. +Song, Y. and Ermon, S. Improved techniques for training score-based generative models. arXiv preprint arXiv:2006.09011, 2020. +Song, Y., Garg, S., Shi, J., and Ermon, S. Sliced score matching: A scalable approach to density and score estimation. In Uncertainty in Artificial Intelligence, pp. 574-584. PMLR, 2020a. +Song, Y., Sohl-Dickstein, J., Kingma, D. P., Kumar, A., Ermon, S., and Poole, B. Score-based generative modeling through stochastic differential equations. arXiv preprint arXiv:2011.13456, 2020b. +Spirtes, P., Glymour, C. N., Scheines, R., and Heckerman, D. Causation, prediction, and search. MIT press, 2000. + +Stein, C. A bound for the error in the normal approximation to the distribution of a sum of dependent random variables. In Proceedings of the sixth Berkeley symposium on mathematical statistics and probability, volume 2: Probability theory, volume 6, pp. 583-603. University of California Press, 1972. +Strassen, V. Gaussian elimination is not optimal. Numerische mathematik, 13(4):354-356, 1969. +Teyssier, M. and Koller, D. Ordering-based search: A simple and effective algorithm for learning bayesian networks. arXiv preprint arXiv:1207.1429, 2012. +Van den Bulcke, T., Van Leemput, K., Naudts, B., van Remortel, P., Ma, H., Verschoren, A., De Moor, B., and Marchal, K. Syntren: a generator of synthetic gene expression data for design and analysis of structure learning algorithms. BMC bioinformatics, 7(1):1-12, 2006. +Wang, X., Du, Y., Zhu, S., Ke, L., Chen, Z., Hao, J., and Wang, J. Ordering-based causal discovery with reinforcement learning. arXiv preprint arXiv:2105.06631, 2021. +Wilks, S. S. Mathematical statistics, 1962. +Zhang, J. On the completeness of orientation rules for causal discovery in the presence of latent confounders and selection bias. Artificial Intelligence, 172(16-17): 1873-1896, 2008. +Zheng, X., Aragam, B., Ravikumar, P., and Xing, E. P. Dags with no tears: Continuous optimization for structure learning. arXiv preprint arXiv:1803.01422, 2018. +Zhu, J. Hessian estimation via stein's identity in black-box problems. arXiv preprint arXiv:2104.01317, 2021. +Zhu, S., Ng, I., and Chen, Z. Causal discovery with reinforcement learning. arXiv preprint arXiv:1906.04477, 2019. +Zimmermann, R. S., Schott, L., Song, Y., Dunn, B. A., and Klindt, D. A. Score-based generative classifiers. arXiv preprint arXiv:2110.00473, 2021. + +# A. Additional Experiments + +We show here additional synthetic experiments. Tables 9, 10 and 11 show the result for additive noise model with Gumbel noise on Erdős-Renyi graphs. Tables 12, 13 and 13 show the results for Gaussian noise with Scale-free graphs. + +Table 9: Synthetic experiment for $d = 10$ with Gumbel noise + +
ER1ER4
SHDSID\(D_{top}(\pi, A)\)SHDSID\(D_{top}(\pi, A)\)
SCORE (ours)1.1 ± 1.24.5 ± 5.00.4 ± 0.521.7 ± 2.935.3 ± 7.40.3 ± 0.4
CAM2.0 ± 1.56.1 ± 5.81.6 ± 0.827.2 ± 1.848.9 ± 9.03.8 ± 2.5
GraN-DAG2.1 ± 1.99.7 ± 10.422.9 ± 3.243.2 ± 11.7
SELF8.8 ± 2.737.0 ± 8.9-38.9 ± 1.285.9 ± 5.0-
GES7.6 ± 2.429.6 ± 11.5-34.9 ± 3.581.9 ± 5.3-
VarSort1.9 ± 0.88.2 ± 3.0
+ +Table 10: Synthetic experiment for $d = 20$ with Gumbel noise + +
ER1ER4
SHDSID\(D_{top}(\pi, A)\)SHDSID\(D_{top}(\pi, A)\)
SCORE (ours)3.3 ± 2.612.0 ± 11.50.7 ± 0.952.9 ± 4.4205.5 ± 35.55.1 ± 1.6
CAM5.8 ± 1.524.6 ± 13.03.0 ± 2.057.1 ± 4.2230.0 ± 39.310.7 ± 5.8
GraN-DAG7.4 ± 2.529.2 ± 11.354.9 ± 4.3239.5 ± 43.6
SELF19.2 ± 2.196.2 ± 27.9-77.7 ± 1.4342.9 ± 15.2-
GES19.0 ± 3.984.0 ± 32.7-72.7 ± 4.2323.2 ± 28.5-
VarSort3.8 ± 1.720.8 ± 6.6
+ +Table 11: Synthetic experiment for $d = 50$ with Gumbel noise + +
ER1ER4
SHDSID\( D_{top}(\pi, A) \)SHDSID\( D_{top}(\pi, A) \)
SCORE (ours)11.3 ± 4.668.2 ± 45.14.1 ± 2.5132.6 ± 8.01390 ± 13219.7 ± 3.4
CAM11.0 ± 3.769.7 ± 48.8-141.1 ± 6.71350 ± 137-
GraN-DAG22.5 ± 4.2167.1 ± 47.3-139.9 ± 7.01552 ± 143-
SELF46.3 ± 3.7306.5 ± 41.1-193.3 ± 3.12100 ± 102-
GES51.0 ± 5.1273.0 ± 57.9-182.1 ± 3.22012 ± 105-
VarSort--8.8 ± 1.6--45.5 ± 8.0
+ +Table 12: Synthetic experiment for $d = 10$ with Gaussian noise on scale free graphs + +
SF1SF4
SHDSID\( D_{top}(\pi, A) \)SHDSID\( D_{top}(\pi, A) \)
SCORE (ours)0.3 ± 0.62.7 ± 5.80.1 ± 0.34.6 ± 1.721.5 ± 9.60.5 ± 0.9
CAM0.4 ± 0.52.8 ± 3.60.3 ± 0.39.6 ± 2.040.4 ± 11.44.1 ± 1.6
GraN-DAG1.4 ± 1.012.5 ± 9.7-4.7 ± 1.823.0 ± 7.3-
SELF10.4 ± 2.760.2 ± 16.2-26.8 ± 1.484.6 ± 3.6-
GES12.5 ± 3.357.2 ± 15.2-22.7 ± 4.176.6 ± 7.2-
VarSort--2.8 ± 1.7--7.0 ± 3.2
+ +Table 13: Synthetic experiment for $d = 20$ with Gaussian noise on scale free graphs + +
SF1SF4
SHDSID\( D_{top}(\pi, A) \)SHDSID\( D_{top}(\pi, A) \)
SCORE (ours)0.9 ± 0.913.8 ± 12.60.7 ± 0.617.5 ± 3.5179.2 ± 23.83.6 ± 1.4
CAM0.9 ± 0.912.9 ± 14.00.5 ± 0.426.4 ± 3.9253.7 ± 28.84.6 ± 3.2
GraN-DAG3.2 ± 1.925.5 ± 15.6-14.7 ± 4.0168.0 ± 39.2-
SELF18.9 ± 2.9245.7 ± 28.2-65.9 ± 2.6369.2 ± 7.8-
GES23.6 ± 3.6166.4 ± 47.6-60.0 ± 4.0345.7 ± 11.4-
VarSort--7.4 ± 2.5--20.2 ± 7.2
+ +Table 14: Synthetic experiment for $d = 50$ with Gaussian noise on scale free graphs + +
SF1SF4
SHDSID\(D_{top}(\pi, A)\)SHDSID\(D_{top}(\pi, A)\)
SCORE (ours)4.6 ± 2.4132.6 ± 75.84.0 ± 1.068.3 ± 3.61724 ± 10921.8 ± 5.0
CAM3.6 ± 1.9115.4 ± 72.6-85.3 ± 4.21935 ± 99-
GraN-DAG9.2 ± 3.3281.8 ± 129.8-63.8 ± 9.71677 ± 118-
SELF57.6 ± 6.61780 ± 150-176.0 ± 4.02424 ± 16-
GES81.3 ± 8.81049 ± 174-167.6 ± 9.22289 ± 49-
VarSort--21.0 ± 4.0--73.0 ± 10.6
\ No newline at end of file diff --git a/scorematchingenablescausaldiscoveryofnonlinearadditivenoisemodels/images.zip b/scorematchingenablescausaldiscoveryofnonlinearadditivenoisemodels/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..4fd84dc53f1c1f0c746bd0915301b9e198a64f78 --- /dev/null +++ b/scorematchingenablescausaldiscoveryofnonlinearadditivenoisemodels/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0369426705499a8114db1d78d35b1a6a771edd16307f4b2b75e59e21df74036d +size 792104 diff --git a/scorematchingenablescausaldiscoveryofnonlinearadditivenoisemodels/layout.json b/scorematchingenablescausaldiscoveryofnonlinearadditivenoisemodels/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..87fdbdad638afdc5148c1f3651c7b8ad4aa1fbd4 --- /dev/null +++ b/scorematchingenablescausaldiscoveryofnonlinearadditivenoisemodels/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:abefc5d7df5c96f6849e674797ee7d5d72651446a1ea10cdc44756d276a3888a +size 521138 diff --git a/searchingforburgerformerwithmicromesomacrospacedesign/41ee27fb-4599-44ba-b0f3-66370bc61563_content_list.json b/searchingforburgerformerwithmicromesomacrospacedesign/41ee27fb-4599-44ba-b0f3-66370bc61563_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..6502020a8d76760941c961565e6de51d1db61df8 --- /dev/null +++ b/searchingforburgerformerwithmicromesomacrospacedesign/41ee27fb-4599-44ba-b0f3-66370bc61563_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f3db6cd7c76d57fce7dd207d2c4096fcf47dc0219f5d8c4777d780d68653894a +size 82879 diff --git a/searchingforburgerformerwithmicromesomacrospacedesign/41ee27fb-4599-44ba-b0f3-66370bc61563_model.json b/searchingforburgerformerwithmicromesomacrospacedesign/41ee27fb-4599-44ba-b0f3-66370bc61563_model.json new file mode 100644 index 0000000000000000000000000000000000000000..4ecdfb3837f089f4400d4ddf28d1694f8346b31d --- /dev/null +++ b/searchingforburgerformerwithmicromesomacrospacedesign/41ee27fb-4599-44ba-b0f3-66370bc61563_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fc9b05888412456422d64ff7d977fd64932c11b004f0ff6786fdfd7652dfe5e0 +size 102199 diff --git a/searchingforburgerformerwithmicromesomacrospacedesign/41ee27fb-4599-44ba-b0f3-66370bc61563_origin.pdf b/searchingforburgerformerwithmicromesomacrospacedesign/41ee27fb-4599-44ba-b0f3-66370bc61563_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..32e8396978d9ef9017d37d4b99721f51fa76db9c --- /dev/null +++ b/searchingforburgerformerwithmicromesomacrospacedesign/41ee27fb-4599-44ba-b0f3-66370bc61563_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:385b850187c2fdcb68875642b8712084a9dcd4893951b9c833e75f2f25f09316 +size 3504692 diff --git a/searchingforburgerformerwithmicromesomacrospacedesign/full.md b/searchingforburgerformerwithmicromesomacrospacedesign/full.md new file mode 100644 index 0000000000000000000000000000000000000000..b0b47a8a5c350f8c4b9ee5e4c46ed292557ec930 --- /dev/null +++ b/searchingforburgerformerwithmicromesomacrospacedesign/full.md @@ -0,0 +1,342 @@ +# Searching for BurgerFormer with Micro-Meso-Macro Space Design + +Longxing Yang $^{123}$ Yu Hu $^{123}$ Shun Lu $^{123}$ Zihao Sun $^{123}$ Jilin Mei $^{123}$ Yinhe Han $^{123}$ Xiaowei Li $^{23}$ + +# Abstract + +With the success of Transformers in the computer vision field, the automated design of vision Transformers has attracted significant attention. Recently, MetaFormer found that simple average pooling can achieve impressive performance, which naturally raises the question of how to design a search space to search diverse and high-performance Transformer-like architectures. By revisiting typical search spaces, we design micro-meso-macro space to search for Transformer-like architectures, namely BurgerFormer. Micro, meso, and macro correspond to the granularity levels of operation, block and stage, respectively. At the microscopic level, we enrich the atomic operations to include various normalizations, activation functions, and basic operations (e.g., multi-head self attention, average pooling). At the mesoscopic level, a hamburger structure is searched out as the basic BurgerFormer block. At the macroscopic level, we search for the depth, width, and expansion ratio of the network based on the multi-stage architecture. Meanwhile, we propose a hybrid sampling method for effectively training the supernet. Experimental results demonstrate that the searched BurgerFormer architectures achieve comparable even superior performance compared with current state-of-the-art Transformers on the ImageNet and COCO datasets. The codes can be available at https://github.com/xingxing-123/BurgerFormer. + +$^{1}$ Research Center for Intelligent Computing Systems, Institute of Computing Technology, University of Chinese Academy of Sciences, Beijing, China $^{2}$ State Key Laboratory of Computer Architecture, Institute of Computing Technology, University of Chinese Academy of Sciences, Beijing, China $^{3}$ School of Computer Science and Technology, University of Chinese Academy of Sciences, Beijing, China. Correspondence to: Yu Hu . + +Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s). + +# 1. Introduction + +Since the emergence of landmark works such as Vision Transformer (ViT) (Dosovitskiy et al., 2021), DeiT (Touvron et al., 2021b) and Swin (Liu et al., 2021), Transformers have made encouraging performance advances in the Computer Vision (CV) field such as recognition, detection, and segmentation. As a result, combining Transformer and Neural Architecture Search (NAS) (Chen et al., 2021b;a) has also gained increasing attention. Recently, MetaFormer (Yu et al., 2022) leverages simple average pooling to achieve impressive performance, which naturally raises the question of how to design a search space to search high-performance Transformer-like architectures. + +Recalling the development of NAS, the design of search space plays a key role. In the early stage, the NAS-RL (Zoph & Le, 2017) search space is proposed to find out optimal hyper-parameters of the entire network. Afterwards, NASNet (Zoph et al., 2018) proposes a search space containing 13 operations for searching cells and then stacks cells into a network. The search space is further compacted to 8 operations in DARTS (Liu et al., 2019). ProxylessNAS (Cai et al., 2019) and FBNet (Wu et al., 2019) search spaces borrow from the block design of MobileNet (Sandler et al., 2018), which means the search spaces contain various MBConv blocks. Similarly, in Transformer NAS, the search space of AutoFormer (Chen et al., 2021b) is borrowed from the block design of Transformer. + +As shown in Fig. 1, we classify the typical search space design according to the granularity of operations, blocks, and stages from the micro, meso, and macro perspectives. In the NASNet and DARTS search spaces, diverse and rich atomic operations belong to micro design. The ProxylessNAS, FBNet, AutoFormer, and ViT-ResNAS (Liao et al., 2021) search spaces contain MobileNet or Transformer blocks which belong to meso design. In the RegNet (Ilija et al., 2020), FBNet, AutoFormer and ViT-ResNAS search spaces, the search for hyper-parameters such as depth and width of the stage belongs to macro design. + +In this paper, we aim to design a search space at the micromeso-macro level to search for more efficient Transformer-like architectures. At the microscopic level, we use richer atomic operations, including various normalizations, activation functions, and basic operations (e.g., multi-head self + +![](images/2cae263335034c95bad4f6a519688acb1ee1aa6c800a88015bd6b0ba0cf5d753.jpg) +Figure 1. A taxonomy of search space designs. Micro, Meso, and Macro correspond to operation, block, and stage granularity, respectively. + +attention, average pooling). At the mesoscopic level, we design a combined Norm-Op-Norm-Act operation structure and propose the hamburger structure to search for diverse Transformer-like blocks. At the macroscopic level, we search for the depth, width, and expansion ratio based on the multi-stage architecture. + +Our major contributions are as follows: + +1. We propose a micro-meso-macro search space for the first time and propose a Norm-Op-Norm-Act and Hamburger structure to offer more diverse operations and block design. Based on the proposed search space, high-performance Transformer-like architecture BurgerFormer can be searched. +2. We utilized One-Shot NAS for searching and propose a hybrid sampling method to effectively train the supernet. +3. Experiments on the ImageNet and COCO datasets show that the searched BurgerFormers match even outperform state-of-the-art Transformers. + +# 2. Related Work + +Neural Architecture Search. NAS is designed to automatically search for efficient neural architectures to reduce the cost of manual trial and error. Early NAS utilized reinforcement learning (Zoph & Le, 2017) and evolutionary algorithms (Real et al., 2019) to search for convolutional neural network and recurrent neural network. These methods had an immense resource overhead because hundreds of individual networks needed to be trained from scratch, resulting in thousands of GPU days even on small-scale datasets. Subsequently, ENAS (Pham et al., 2018) proposed the weight sharing strategy, which reduced the search time to a few GPU days as only one supernet needs to be trained. Based on the strategy, differentiable NAS methods (Liu et al., 2019; Chu et al., 2020; Xu et al., 2020; Chen et al., 2019) make the search space continuous and adopt architecture parameters to select operations. Single-Path methods + +(Guo et al., 2020; Chu et al., 2021; Yu et al., 2020) further reduce the resource consumption by sampling and training single-path sub-networks from the supernet, and then searching sub-networks based on validation set accuracy. + +Vision Transformer. Dosovitskiy et al (Dosovitskiy et al., 2021) introduced Transformer to the computer vision field, which achieved competitive performance compared to Convolutional Neural Networks (CNNs). Subsequently, DeiT (Touvron et al., 2021b) proposed data-efficient ViT and a teacher-student distillation strategy. Swin-Transformer (Liu et al., 2021) and PVT (Wang et al., 2021) used multi-stage strategy to successfully apply Transformer to different vision tasks such as detection and segmentation. TNT (Han et al., 2021) proposed that attention to finer-grained patches can effectively improve performance. ConViT (d'Ascoli et al., 2021) introduced a soft inductive bias of CNN into ViT to bridge the gap between CNN and Transformer. CeiT (Yuan et al., 2021) combined the benefits of CNN in extracting low-level features and locality with the advantage of Transformer in extracting long-range dependencies. MLP-Mixer (Tolstikhin et al., 2021) and ResMLP (Touvron et al., 2021a) used MLP instead of the self-attention module, still achieving comparable results. Moreover, MetaFormer (Yu et al., 2022) discovered that using the average pooling operation instead of the self-attention module also achieved promising performance. + +Vision Transformer NAS. AutoFormer (Chen et al., 2021b) is the first algorithm to automatically search ViT for embedding dimension, depth, MLP ratio, and the number of heads. ViTAS (Su et al., 2021) searched ViT models based on the weight-sharing mechanism. GLiT (Chen et al., 2021a) introduced locality modules into the search space, proposed a hierarchical search strategy, and searched ViT from both global and local levels. ViT-ResNAS (Liao et al., 2021) proposed residual spatial reduction and multi-architectural sampling techniques for searching a multi-stage ViT architecture. (Minghao et al., 2021) proposed S3 space based on ViT and Swin, and leveraged weight sharing and E-T + +![](images/1b5fab531fdd41c2956246495c5d5fad1641a8d915fbcb06f1bb68b6985f94df.jpg) + +![](images/ea19320e2b908e1ea07bad87bafa821abd1540f48a92570a2247be44ce0e1cad.jpg) + +![](images/efdb1bbe33f2fe4f714653379ca27fa1c0a2536141789de2ae407be7e9c119f1.jpg) +Figure 2. The micro-meso-macro search space. The top left is the micro search space, which contains candidate activation functions, normalizations and basic operations. Skip indicates no data processing. The top right is the meso search space, which includes the Hamburger and the Norm-Op-Norm-Act structure. Norm, Op, and Act represent normalization, basic operation, and activation function, respectively. The lower part is the macro search space, which produces a multi-stage architecture. + +Error to search the architecture and search space. NASViT (Chengyue et al., 2022) designed a hybrid space based on MBConv and Transformer blocks and developed ViTs from 200M to 800M FLOPs. These works focus on the design of the block or stage granularity, lacking the diversity of block structures and a comprehensive consideration of all three granularities. + +# 3. Search Space Design + +In this section, we will first introduce the micro-meso-macro search space design of BurgerFormer in detail. Then we will briefly discuss the size of the proposed search space. + +# 3.1. Micro Search Space Design + +The micro search space corresponds to the operation granularity. Rich candidate operations facilitate the search for different mesoscopic structures. For example, eight operations can build about $10^{9}$ normal or reduction cells in the DARTS search space. To improve the richness of operations, our micro search space contains varied normalizations, activation functions, and basic operations. + +Normalization and Activation Function. Normalization and activation are two types of atomic operations. Normalization can accelerate training and improve the generalization, while activation functions can enhance the nonlinear fitting ability of the network. Proper selection of the two types of atomic operations can improve performance. Previous NAS methods directly utilize fixed combinations of normalization and activation, e.g., Conv-BN-ReLU. However, existing Transformers and CNNs already employ different normalization and activation functions, which inspires us to search varied normalization and activation functions. As shown in Fig. 2, our micro search space includes layer normalization (LN) (Ba et al., 2016), batch normalization (BN) (Ioffe & Szegedy, 2015), group normalization (GN) (Wu & He, 2018), activation functions of ReLU6 (Agarap, 2018), GELU (Hendrycks & Gimpel, 2016), and SiLU (Ramachandran et al., 2018). + +Basic Operation. Basic operations refer to micro operations other than normalizations and activation functions. Following Transformer-like architectures, the basic operations of BurgerFormer contain Multi-Head Self Attention (MHSA) (Dosovitskiy et al., 2021), Spatial MLP (Touvron et al., 2021a), and Pooling (Yu et al., 2022), where the pool + +![](images/05f1d13d905db87e40f75eae7099c6b7a4cf4a151262537090c920aced14c775.jpg) +Figure 3. Transformer block vs. Hamburger block. + +![](images/2a8a3757a4b0a165f5d076702bb57542b0f5e7895c658ade846cd805608ccd57.jpg) + +ing size is 3. In addition, we extend the $3 \times 3$ depthwise convolution (Dwise 3x3) and 1x1 convolution (Conv 1x1) to introduce more locality to the network. Specifically, MHSA, Spatial MLP, and Pooling are formulated as follows: + +$$ +M H S A (Y) = C o n c a t \left(\text {h e a d} _ {1}, \dots , \text {h e a d} _ {h}\right) W ^ {o}, +$$ + +$$ +h e a d _ {i} = S o f t m a x \left(\frac {\left(Y W _ {i} ^ {Q}\right) \left(Y W _ {i} ^ {K}\right) ^ {T}}{\sqrt {d _ {i}}}\right) Y W _ {i} ^ {V}, \tag {1} +$$ + +$$ +S p a t i a l M L P (Y) = \left(Y ^ {T} W\right) ^ {T} + b, \tag {2} +$$ + +$$ +P o o l i n g \left(X _ {i, j, k}\right) = \frac {1}{9} \sum_ {p, q = 1} ^ {3} X _ {i, j + p - 2, k + q - 2} - X _ {i, j, k}, (3) +$$ + +where $W^{Q}, W^{K}, W^{V}, W^{o} \in R^{c \times c}$ , and $W \in R^{wh \times wh}$ are the weights, $X \in R^{c \times w \times h}$ are 2D feature maps, and $Y \in R^{n \times d}$ are 1D tokens, respectively. $c, w, h, n, d$ represent channel, width, height, number of tokens, and embedding dimension, respectively. Following DeiT (Touvron et al., 2021b) source code, the token dimension in each head is $R^{(c / head)}$ , so $W^{o} \in R^{head * (c / head) \times c} = R^{c \times c}$ . Please note that the Pooling operator is from MetaFormer, where the subtraction is only used as a preprocessing method for the subsequent residual connection. In practice, pooling and convolutions require 2D feature maps, while MHSA and Spatial MLP require 1D tokens, so two data formats need to be converted. For the conversion of a 2D feature map to a 1D token, we first flatten the spatial dimension of $X \in R^{c \times w \times h}$ to obtain $X \in R^{c \times (wh)}$ , then transpose $X$ to get $Y \in R^{(wh) \times c} = R^{n \times d}$ . Conversion of a 1D token to a 2D feature map is an inverse process. + +# 3.2. Meso Search Space Design + +Good blocks in the meso search space are halfway to successfully search for high-performance macro architecture. As shown in Fig. 3, we design the hamburger block based on three modifications to the classical Transformer block. Firstly, the combination of LN and MHSA is abstracted as a Norm-Op-Norm-Act structure for search, where Norm, + +
StageDepthWidthRatio
1{1,2,3,4}{32,64,96}{1,2,4,6}
2{1,2,3,4}{64,96,128}{1,2,4,6}
3{1,2,3,4,5,6,7,8}{128,192,256,320}{1,2,4,6}
4{1,2,3,4}{128,256,384,512}{1,2,4,6}
+ +Table 1. Macro Search Space. Depth is the number of blocks per stage. Width refers to the channels of 2D feature maps or the embedding dimension of 1D tokens. Ratio is the expansion ratio between the two 1x1 convolutions. + +Act, and Op represent normalization, activation function, and basic operation, respectively. Please note that both the pre-Op normalization and the post-Op normalization are determined by searching, so the two normalizations can be different. Secondly, on the one hand, adding convolution to feed-forward network (FFN) can improve performance (Yuan et al., 2021), on the other hand, we observe that both of the MobileNet and Transformer blocks have inverse bottleneck structures. Therefore, we split the FFN into two 1x1 convolutions and add Norm-Op-Norm-Act between them. Finally, we symmetrically add Norm-Op-Norm-Act before and after the FFN to search for more diverse meso blocks. Since the block structure resembles a hamburger, we call it hamburger block. Meanwhile, we vividly call the three Norm-Op-Norm-Act structures from input to output as the first bread, the meat, and the second bread. + +# 3.3. Macro Search Space Design + +The macro search space corresponds to the design of the stage granularity. Referring from PVT (Wang et al., 2021) and Swin (Liu et al., 2021), we design the multi-stage search space for searching optimal depth, width, and expansion ratio, which mean the number of hamburger blocks, the channels of 2D feature map or the embedding dimension of 1D tokens, and the expansion ratio between the two 1x1 convolutions, respectively. The search ranges of these hyperparameters are shown in Table 1. + +# 3.4. Search Space Size + +In order to reduce resource consumption, we have adjusted the search space as follows. First, we did not search MHSA and Spatial MLP in the first and the second stages, because the complexity of these two operations is quadratic to $h w$ , which is not suitable for use in large resolution. Second, the basic operations in the meat part of the burger contain only skip and $3 \times 3$ depthwise convolution. Third, we search for hamburger blocks for each stage. There are about $4.5 \times 10^{28}$ architectures in the search space. The range of parameters is from $0.5M$ to $41.6M$ , and the range of FLOPs is from $0.2G$ to $7.4G$ . + +![](images/1e026454911b5519432bd817a93de26a82bcc8eed42a9caf5cacda82e50cff28.jpg) +Figure 4. Hybrid sampling method. Meso sampling is sampling one hamburger block for each stage. Macro sampling is sampling the minimum, maximum, and random sub-networks in the macro search space, whose blocks are determined by the meso sampling. The supernet weights are updated with the accumulated gradients from the sampled three sub-networks. + +# 4. One-Shot NAS + +One-Shot NAS is a search strategy based on a weight sharing mechanism. The strategy only needs to train one supernet $N$ and then evaluates the accuracy of the sub-networks $A$ that inherit supernet weights, which greatly reduces the search cost compared with training thousands of stand-alone networks. For keeping consistency and reducing memory usage, the supernet is usually optimized by uniformly sampling the sub-networks: + +$$ +W _ {A} ^ {*} = \underset {A} {\arg \min } L _ {t r a i n} (N (A, W)), +$$ + +$$ +\alpha^ {*} = \underset {a \in A} {\arg \max } A c c _ {v a l} (N (\alpha , W ^ {*})), \tag {4} +$$ + +$$ +s. t. \operatorname {R e s o u r c e} \left(N \left(\alpha , W _ {\alpha^ {*}}\right)\right) \leq C, +$$ + +where $L_{train}$ is the training loss, $Acc_{val}$ is the validation accuracy, and $C$ is the resource constraint (e.g., FLOPs). + +# 4.1. Supernet Training with Hybrid Sampling + +In One-Shot NAS, it is common practice to sample a sub-network (SPOS) (Guo et al., 2020) in each iteration and train the supernet. However, SPOS suffers from low-accuracy sub-networks in our search space. Sandwich sampling (Yu et al., 2020) can improve the accuracy of sub-networks, but we observe that the maximum model in the search space has poor performance and slow convergence speed. The convergence ability of the maximum model is usually worse than the minimum model, so it is not suitable to use the sandwich sampling directly. More details can be referred to Appendix A. In order to better train the supernet, we propose a hybrid sampling method that combines SPOS and sandwich sampling. + +As shown in Fig. 4, hybrid sampling consists of two steps, + +i.e., meso sampling and macro sampling. In the meso sampling step, for each Norm-Op-Norm-Act structure, we first randomly select normalization, activation, and basic operation from the candidates, then randomly select pre-Op normalization and post-Op normalization. Note that normalization and activation will be set to skip when the basic operation is skip, and the residual connections next to the Norm-Op-Norm-Act structure will be removed in first and second bread. After three independent samplings, a specific hamburger block is determined per stage. In the macro sampling step, we randomly select one hyper-parameter from the candidate depth, width, and expansion ratio for each stage. In order to better train the supernet, we additionally sample the maximum macro architecture and the minimum macro architecture of each stage after confirming the hamburger block. The three sampled paths are trained separately, and then the gradients are accumulated to update the supernet weights. + +# 4.2. Evolutionary Search + +After training supernet, we utilize an evolutionary algorithm to search sub-networks by evaluating performance with the inherited weights from the supernet. During evolutionary iteration, we maintain the population of sub-networks. In the first iteration, $P_0$ sub-networks are randomly selected. In subsequent iterations, parent sub-networks are randomly selected from the sub-network population to generate child sub-networks by crossover and mutation. Crossover is the exchange of architecture parameters with a certain probability $P_c$ , and mutation randomly changes the architecture parameters with a certain probability $P_m$ . During search, sub-networks that satisfy the resource constraints will be selected. The whole process will be repeated $T$ iterations. + +
ModelParams. (M)FLOPs (G)Top-1 acc. (%)Top-5 acc. (%)Design Type
DeiT-Ti (Touvron et al., 2021b)61.372.291.1Manual
TNT-Ti (Han et al., 2021)61.473.9-Manual
CeiT-T (Yuan et al., 2021)61.276.4-Manual
AutoFormer-tiny (Chen et al., 2021b)61.374.792.6Auto
GLiT-Tiny (Chen et al., 2021a)71.476.391.1Auto
ViTAS-DeiT-A (Su et al., 2021)71.475.692.5Auto
BurgerFormer-Tiny101.078.093.7Auto
ConVi-Ti+ (d'Ascoli et al., 2021)102.076.793.6Manual
PVT-Tiny (Wang et al., 2021)131.975.1-Manual
PoolFormer-S12 (Yu et al., 2022)122.077.2Manual
BurgerFormer-Small142.180.495.0Auto
Deit-S (Touvron et al., 2021b)224.779.9-Manual
Swin-T (Liu et al., 2021)294.581.3-Manual
CvT-13 (Haiping et al., 2021)204.581.6-Manual
TNT-S (Han et al., 2021)245.281.595.7Manual
PVT-Small (Wang et al., 2021)253.879.8-Manual
ViL-Small (Pengchuan et al., 2021)254.982.0-Manual
ResMLP-S12 (Touvron et al., 2021a)316.079.4-Manual
Twins-PCPVT-S (Xiangxiang et al., 2021)243.881.2-Manual
PoolFormer-S36 (Yu et al., 2022)315.281.4-Manual
RegNetY-4G (Ilija et al., 2020)214.080.0-Auto
AutoFormer-small (Chen et al., 2021b)235.181.7-Auto
GLiT-Small (Chen et al., 2021a)254.480.5-Auto
ViTAS-DeiT-B (Su et al., 2021)234.980.295.1Auto
S3-T (Minghao et al., 2021)284.782.195.8Auto
ViT-ResNAS-Medium (Liao et al., 2021)974.582.4-Auto
BurgerFormer-Base263.982.796.2Auto
Swin-S (Liu et al., 2021)508.783.0-Manual
Twins-PCPVT-B (Xiangxiang et al., 2021)446.482.7-Manual
CvT-21 (Haiping et al., 2021)327.182.5-Manual
BoTNet-S1-59 (A. et al., 2021)347.381.7-Manual
RegNetY-8G (Ilija et al., 2020)398.081.7-Auto
BossNet-T1 (Changlin et al., 2021)-7.982.295.8Auto
BurgerFormer-Large366.583.096.8Auto
+ +Table 2. Comparison with state-of-the-art models on ImageNet. "Param." is the volume of parameters. "acc." is accuracy. The gray color highlights the searched BurgerFormer architectures. We group different models according to their FLOPs. + +![](images/ad8440c5af4334e9563f89af4baa16106e1eaa0e209202f00218d74d7d22e407.jpg) +Figure 5. Comparison between BurgerFormer and efficient vision transformers, in terms of ImageNet Top-1 over FLOPs. + +# 5. Experiments + +In this section, we first show the searched architectures and compare them with state-of-the-art transformers. In addition, we transfer the searched Burgerformer to the COCO dataset to verify its transferability. We then conduct an ablation study of search methods and hamburger blocks. Finally, the searched architectures and visualization are discussed. + +# 5.1. Results on ImageNet + +Searching Settings. ImageNet (Olga et al., 2015) contains $1.28M$ training images and 50,000 validation images. We split 25,000 images from the training set as the validation set for searching. In the supernet training phase, we trained the supernet using AdamW (Ilya & Frank, 2019) optimizer with learning rate $1e - 3$ and weight decay 0.05. we turned off the normalization statistics because of varying sampled architectures. The data augmentation and other + +
BackBoneRetinaNet 1x
Param. (M)APbAP50AP75APSAPMAPL
ResNet50 (He et al., 2016)37.736.355.338.619.340.048.8
PVT-Small (Wang et al., 2021)34.240.461.343.025.042.955.7
PoolFormer-S24 (Yu et al., 2022)31.138.959.741.323.342.151.8
BurgerFormer-Base35.941.261.343.924.244.455.4
BackBoneMask R-CNN 1x
Param. (M)APbAP50AP75APMAPM50APM75
ResNet50 (He et al., 2016)44.238.058.641.434.455.136.7
PVT-Small (Wang et al., 2021)44.140.462.943.837.860.140.3
PoolFormer-S24 (Yu et al., 2022)41.040.162.243.437.059.136.9
Swin-T (Liu et al., 2021)48.043.766.647.739.863.342.7
BurgerFormer-Base45.944.065.648.140.262.743.4
+ +Table 3. Comparison with state-of-the-art models on COCO. + +techniques are essentially the same as for retraining, except that stochastic depth is not used. The epochs are 120 and the warmup epochs are 10. Experiments are performed on eight V100s with a batch size of 32 per GPU. In the searching phase, our settings follow (Liao et al., 2021). The initial population size $P_0$ is 500 and the number of iterations $T$ is 20. The number of parents and child networks are 75 and 150, respectively. The crossover and mutation probability is 0.3. We select the Top-5 architectures and validate them on ImageNet-100 (Yonglong et al., 2020), and then take the optimal architecture and retrain it on ImageNet. + +Retraining Settings. Our implementations follow DeiT (Touvron et al., 2021b) and MetaFormer (Yu et al., 2022). Models are optimized using AdamW with learning rate $1e - 3$ and weight decay 0.05 and batch size 1,024. Data augmentations include MixUp (Hongyi et al., 2018), CutMix (Sangdoo et al., 2019), CutOut (Zhun et al., 2020) and RandAugment (Ekin Dogus et al., 2020). We also use stochastic depth (Gao et al., 2016) and layerscale (Hugo et al., 2021). Label Smoothing (Szegedy et al., 2016) is set to 0.1. The training epochs are 300 and the warmup epochs are 10. Retraining is also conducted on eight V100s. + +Results. The experimental results are shown in Table 2. We searched BurgerFormer under four different levels of FLOPs and compared it with state-of-the-art Transformers. BurgerFormers are competitive even superior to either manually designed or automatically searched Transformers under similar FLOPs. For example, BurgerFormer-Tiny has only $1.0G$ FLOPs, but the accuracy is higher than the manually designed DeiT-T and the automatically searched AutoFormer-Tiny by $5.8\%$ and $3.3\%$ . Meanwhile, BurgerFormer-Base outperforms Swin-T by $1.4\%$ points with even fewer FLOPs $(3.9G$ vs. $4.5G)$ and parameters $(26M$ vs. $29M)$ . In addition, although BurgerFormer-Large has the same Top-1 accuracy as Swin-S, it has $25\%$ and $28\%$ fewer FLOPs and parameters, respectively. BurgerFormer-Large also outperforms the pure CNN model RegNetY-8G and the hy + +brid CNN-Transformer model BossNAS-T1. Furthermore, BurgerFormer consistently outperforms the automatically searched Transformer-like model, indicating the effectiveness of our micro-meso-macro designed search space. + +# 5.2. Results on COCO + +Setting. We conduct experiments on COCO benchmark (Lin et al., 2014) to verify the transferability of Burger-Former architectures. COCO benchmark contains 118K training images (train2017) and 5K validation images (val2017). We employ BurgerFormer as backbone for two standard detectors, i.e., RetinaNet (TsungYi et al., 2017) and Mask R-CNN (Kaiming et al., 2017). The backbone is initialized with the weights pre-trained on ImageNet, while the added layers are initialized by Xavier (Xavier & Yoshua, 2010). The detectors are trained with AdamW (Ilya & Frank, 2019) optimizer and an initial learning rate of $1e - 4$ . Following (TsungYi et al., 2017; Kaiming et al., 2017), we utilized $1\times$ training schedule where the detectors are trained with 12 epochs. The training images are resized to 800 pixels (short side) by no more than 1,333 pixels (long side). The testing images have a short side of 800 pixels. + +Results. As shown in Table 3, under a similar volume of parameters, BurgerFormer significantly outperforms ResNet50 and PoolFormer-S24. When compared with powerful handcrafted baselines such as PVT-Small and Swin-T, BurgerFormer achieves competitive results, which validates the transferability of the searched model. + +# 5.3. Ablation Study + +Search Method. In Table 4, we compared random search, SPOS, Sandwich, and our hybrid sampling search method on ImageNet. For a fair comparison, all models are constrained to $1G$ FLOPs and are trained under the same settings. The experimental results demonstrate that our hybrid sampling search method outperforms random search, + +![](images/5de8c46fafd3a3592908a0cbe83809f394083386308c6d24713e121b972ba511.jpg) + +![](images/26f8171ed67911af473e518403eb9927d02da497e8a92837da23913f21eab0b1.jpg) +BurgerFormer-Tiny + +![](images/4008ed39f0691951e51b6f3a546d692e94795790f8b20591ea92e6c0b901e572.jpg) + +![](images/c386e2c9bbf0fe3270c0d3b27135c2b2bd153ac14fa973b188114cd00b623928.jpg) + +![](images/3516ec25bda92fd0129c0571931d623dd3863eb5cdfd1590bc7cc4cb566eabba.jpg) +Figure 6. The architecture of BurgerFormer-Tiny. "d2, w32, r4" means that depth, width, and expansion ratio are 2, 32, and 4, respectively. +Figure 7. Visualization of features for Deit and BurgerFormer on ImageNet. + +
MethodsFLOPs (G)Top-1 acc. (%)
Random Search1.075.6
SPOS1.077.0
Sandwich1.077.5
Hybrid Sampling1.078.0
+ +SPOS and sandwich by 2.4 points, 1.0 points and 0.5 points, respectively, validating the effectiveness of the proposed method. + +Hamburger Blocks. Table 5 analyzes the effect of each Norm-OP-Norm-Act in hamburger blocks. We choose the Transformer-Tiny model as the baseline. We remove the part corresponding to burger, i.e., replace the part with skip + +Table 4. Comparisons of Random Search, SPOS, Sandwich and our hybrid sampling search method on ImageNet. + +
ModelFLOPs (G)Top-1 acc. (%)
BurgerFormer-Tiny1.078.0
w/o the first bread0.8577.7
w/o the second bread0.8277.2
w/o the meat0.8476.9
+ +Table 5. Ablation study of Hamburger blocks. + +and remove the residual connections, to check its impact on performance. Table 5 shows that each part contributes to the performance with similar FLOPs, but the impact of the meat part is somewhat larger, which we attribute to that this part locates in the inverse bottleneck structure thus has a greater impact on the performance. We can see the hamburger structure offers more diversity to find a better architecture. + +# 5.4. Discussion + +Searched Architecture. Fig. 6 visualizes the structure of BurgeFormer-Tiny, where $d$ , $w$ , and $r$ denote depth, width, and expansion ratio, respectively. Overall, local operations such as pooling and convolution dominate in BurgerFormer-Tiny, while there is only one global operation (i.e., Spatial MLP) in the third stage. Interestingly, the hamburger block of the fourth stage resembles a depthwise separable convolution but does not use an activation function with a different normalization. Meanwhile, the second stage uses three depthwise convolutions to obtain a larger perceptual field. More discussions can be referred to Appendix B. + +Visualization. Fig. 7 visualizes learned features of DeiT-Small and BurgerFormer-Base on ImageNet. For a fair comparison, both methods use the same visualization technique (Ramprasaath R. et al., 2017). The visualized heat map is calculated by multiplying the output feature map by its gradient and then scaling it to the size of the input image. As shown in Fig. 7, BurgerFormer locates objects more accurately than DeiT, which indicates that the searched architectures have a better ability to extract features. + +Micro-Meso-Macro Design. In this work, we present a micro-meso-macro schema for designing search spaces. An intuitive question is whether three granularities are needed. We believe that the co-design of the three granularities is beneficial and necessary. Micro multivariate operations can constitute diverse local and global operators, and the appropriate pairing of these is helpful to improve performance; Meso hamburger block covers the common structure of Mobilenet and Transformer block (e.g., inverse bottleneck, residuals); macro-level design can significantly affect FLOPs and parameters, and thus the model capacity. Recently, ConvNeXt (Liu et al., 2022) manually improved ResNet from three granularities to outperform Swin (Liu et al., 2021), so the automatic search for three granularities should be a direction worth thinking about and exploring. + +Limitation. Limited by hardware resources, the ranges of FLOPs and parameters of the searched architectures are relatively small (e.g., maximum FLOPs $< 8\mathrm{G}$ ), and we conjecture that BurgerFormer searched under larger FLOPs or higher volume of parameters will have stronger representation capability. In addition, because all of the three granularities are involved in the micro-meso-macro search space, the search cost is high, e.g., training of the supernet takes 11 days on eight V100s. Therefore, reducing the search cost is a direction for our future work. + +# 6. Conclusion + +In this work, we design a new search space for searching BurgerFormer architectures from a micro-meso-macro perspective. Meanwhile, we propose a hybrid search strategy + +to train supernet effectively. Experiments on ImageNet and COCO datasets verify the effectiveness of the BurgerFormer architecture. While demonstrating better performance than state-of-the-art Transformers, this work indicates that good search space is very critical for finding out powerful visual Transformer-like architectures. In the future, we will further explore the Transformer-like search space design and experiment with other computer vision tasks. + +# Acknowledgement + +This work is supported in part by the National Key R&D Program of China under Grant No. 2018AAA0102701, and in part by the National Natural Science Foundation of China under Grant No. 62176250. + +# References + +A., S., Tsung-Yi, L., Niki, P., Jonathon, S., P., A., and Ashish, V. Bottleneck transformers for visual recognition. In Conference on Computer Vision and Pattern Recognition, 2021. +Agarap, A. F. Deep learning using rectified linear units (relu). arXiv preprint arXiv:1803.08375, 2018. +Ba, J. L., Kiros, J. R., and Hinton, G. E. Layer normalization. arXiv preprint arXiv:1607.06450, 2016. +Cai, H., Zhu, L., and Han, S. Proxylessnas: Direct neural architecture search on target task and hardware. In International Conference on Learning Representations, 2019. +Changlin, L., Tao, T., Guangrun, W., Jiefeng, P., Bing, W., Xiaodan, L., and Xiaojun, C. Bossnas: Exploring hybrid cnn-transformers with block-wisely self-supervised neural architecture search. In International Conference on Computer Vision, 2021. +Chen, B., Li, P., Li, C., Li, B., Bai, L., Lin, C., Sun, M., Yan, J., and Ouyang, W. Glit: Neural architecture search for global and local image transformer. In International Conference on Computer Vision, 2021a. +Chen, M., Peng, H., Fu, J., and Ling, H. Autoformer: Searching transformers for visual recognition. In International Conference on Computer Vision, 2021b. +Chen, X., Xie, L., Wu, J., and Tian, Q. Progressive differentiable architecture search: Bridging the depth gap between search and evaluation. In International Conference on Computer Vision, 2019. +Chengyue, G., Dilin, W., Meng, L., Xinlei, C., Zhicheng, Y., Yuandong, T., Qiang, L., and Vikas, C. Nasvit: Neural architecture search for efficient vison transformers with + +gradient conflict-aware supernet training. In International Conference on Learning Representations, 2022. +Chu, X., Zhou, T., Zhang, B., and Li, J. Fair darts: Eliminating unfair advantages in differentiable architecture search. In European Conference on Computer Vision, 2020. +Chu, X., Zhang, B., and Xu, R. Fairnas: Rethinking evaluation fairness of weight sharing neural architecture search. In International Conference on Computer Vision, 2021. +d'Ascoli, S., Touvron, H., Leavitt, M., Morcos, A., Biroli, G., and Sagun, L. Convit: Improving vision transformers with soft convolutional inductive biases. In International Conference on Machine Learning, 2021. +Dosovitskiy, A., Beyer, L., Kolesnikov, A., Weissenborn, D., Zhai, X., Unterthiner, T., Dehghani, M., Minderer, M., Heigold, G., Gelly, S., et al. An image is worth 16x16 words: Transformers for image recognition at scale. In International Conference on Learning Representations, 2021. +Ekin Dogus, C., Barret, Z., Jonathon, S., and Quoc V., L. Randaugment: Practical automated data augmentation with a reduced search space. In Conference on Computer Vision and Pattern Recognition Workshops, 2020. +Gao, H., Yu, S., Zhuang, L., Daniel, S., and Kilian Q., W. Deep networks with stochastic depth. In European Conference on Computer Vision, 2016. +Guo, Z., Zhang, X., Mu, H., Heng, W., Liu, Z., Wei, Y., and Sun, J. Single path one-shot neural architecture search with uniform sampling. In European Conference on Computer Vision, 2020. +Haiping, W., Bin, X., Noel C. F., C., Mengchen, L., Xiyang, D., Lu, Y., and Lei, Z. Cvt: Introducing convolutions to vision transformers. In International Conference on Computer Vision, 2021. +Han, K., Xiao, A., Wu, E., Guo, J., Xu, C., and Wang, Y. Transformer in transformer. In Advances in Neural Information Processing Systems, 2021. +He, K., Zhang, X., Ren, S., and Sun, J. Deep residual learning for image recognition. In Conference on Computer Vision and Pattern Recognition, 2016. +Hendrycks, D. and Gimpel, K. Gaussian error linear units (gelus). arXiv preprint arXiv:1606.08415, 2016. +Hongyi, Z., Moustapha, C., Yann, D., and David, L.-P. mixup: Beyond empirical risk minimization. In International Conference on Learning Representations, 2018. + +Hugo, T., Matthieu, C., Alexandre, S., Gabriel, S., and Herv'e, J. Going deeper with image transformers. In International Conference on Computer Vision, 2021. +Ilija, R., Raj Prateek, K., Ross B., G., Kaiming, H., and Piotr, D. Designing network design spaces. In Conference on Computer Vision and Pattern Recognition, 2020. +Ilya, L. and Frank, H. Decoupled weight decay regularization. In International Conference on Learning Representations, 2019. +Ioffe, S. and Szegedy, C. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In International conference on machine learning, 2015. +Kaiming, H., Georgia, G., Piotr, D., and Ross B., G. Mask R-CNN. In International Conference on Computer Vision, 2017. +Langley, P. Crafting papers on machine learning. In Langley, P. (ed.), Proceedings of the 17th International Conference on Machine Learning (ICML 2000), pp. 1207-1216, Stanford, CA, 2000. Morgan Kaufmann. +Liao, Y.-L., Karaman, S., and Sze, V. Searching for efficient multi-stage vision transformers. arXiv preprint arXiv:2109.00642, 2021. +Lin, T.-Y., Maire, M., Belongie, S., Hays, J., Perona, P., Ramanan, D., Dollar, P., and Zitnick, C. L. Microsoft coco: Common objects in context. In European Conference on Computer Vision, 2014. +Liu, H., Simonyan, K., and Yang, Y. Darts: Differentiable architecture search. In International Conference on Learning Representations, 2019. +Liu, Z., Lin, Y., Cao, Y., Hu, H., Wei, Y., Zhang, Z., Lin, S., and Guo, B. Swin transformer: Hierarchical vision transformer using shifted windows. In International Conference on Computer Vision, 2021. +Liu, Z., Mao, H., Wu, C.-Y., Feichtenhofer, C., Darrell, T., and Xie, S. A convnet for the 2020s. 2022. +Minghao, C., Kan, W., Bolin, N., Houwen, P., Bei, L., Jianlong, F., Hongyang, C., and Haibin, L. Searching the search space of vision transformer. In Advances in Neural Information Processing Systems, 2021. +Olga, R., Jia, D., Hao, S., Jonathan, K., Sanjeev, S., Sean, M., Zhiheng, H., Andrej, K., Khosla, A., Michael, B., Alexander C., B., and Li, F.-F. Imagenet large scale visual recognition challenge. International Journal of Computer Vision, 2015. + +Pengchuan, Z., Xiyang, D., Jianwei, Y., Bin, X., Lu, Y., Lei, Z., and Jianfeng, G. Multi-scale vision longformer: A new vision transformer for high-resolution image encoding. In International Conference on Computer Vision, 2021. +Pham, H., Guan, M., Zoph, B., Le, Q., and Dean, J. Efficient neural architecture search via parameters sharing. In International Conference on Machine Learning, 2018. +Ramachandran, P., Zoph, B., and Le, Q. V. Searching for activation functions. In International Conference on Learning Representations, 2018. +Ramprasaath R., S., Michael, C., Abhishek, D., Ramakrishna, V., Devi, P., and Dhruv, B. Grad-cam: Visual explanations from deep networks via gradient-based localization. In International Conference on Computer Vision, 2017. +Real, E., Aggarwal, A., Huang, Y., and Le, Q. V. Regularized evolution for image classifier architecture search. In AAAI Conference on Artificial Intelligence, 2019. +Sandler, M., Howard, A., Zhu, M., Zhmoginov, A., and Chen, L.-C. Mobilenetv2: Inverted residuals and linear bottlenecks. In Conference on Computer Vision and Pattern Recognition, 2018. +Sangdoo, Y., Dongyoon, H., Seong Joon, O., Sanghyuk, C., Junsuk, C., and Young Joon, Y. Cutmix: Regularization strategy to train strong classifiers with localizable features. In International Conference on Computer Vision, 2019. +Su, X., You, S., Xie, J., Zheng, M., Wang, F., Qian, C., Zhang, C., Wang, X., and Xu, C. Vision transformer architecture search. arXiv preprint arXiv:2106.13700, 2021. +Szegedy, C., Vanhoucke, V., Ioffe, S., Shlens, J., and Wojna, Z. Rethinking the inception architecture for computer vision. In Conference on Computer Vision and Pattern Recognition, 2016. +Tolstikhin, I., Houlsby, N., Kolesnikov, A., Beyer, L., Zhai, X., Unterthiner, T., Yung, J., Keysers, D., Uszkoreit, J., Lucic, M., et al. Mlp-mixer: An all-mlx architecture for vision. In Advances in Neural Information Processing Systems, 2021. +Touvron, H., Bojanowski, P., Caron, M., Cord, M., El-Nouby, A., Grave, E., Izacard, G., Joulin, A., Synnaeve, G., Verbeek, J., et al. Resmlp: Feedforward networks for image classification with data-efficient training. arXiv preprint arXiv:2105.03404, 2021a. + +Touvron, H., Cord, M., Douze, M., Massa, F., Sablayrolles, A., and Jégou, H. Training data-efficient image transformers & distillation through attention. In International Conference on Machine Learning, 2021b. +TsungYi, L., Priya, G., Ross B., G., Kaiming, H., and Piotr, D. Focal loss for dense object detection. In International Conference on Computer Vision, 2017. +Wang, W., Xie, E., Li, X., Fan, D.-P., Song, K., Liang, D., Lu, T., Luo, P., and Shao, L. Pyramid vision transformer: A versatile backbone for dense prediction without convolutions. In International Conference on Computer Vision, 2021. +Wu, B., Dai, X., Zhang, P., Wang, Y., Sun, F., Wu, Y., Tian, Y., Vajda, P., Jia, Y., and Keutzer, K. Fbnet: Hardware-aware efficient convnet design via differentiable neural architecture search. In Conference on Computer Vision and Pattern Recognition, 2019. +Wu, Y. and He, K. Group normalization. In European Conference on Computer Vision, 2018. +Xavier, G. and Yoshua, B. Understanding the difficulty of training deep feedforward neural networks. In Artificial Intelligence and Statistics, 2010. +Xiangxiang, C., Zhi, T., Yuqing, W., Bo, Z., Haibing, R., Xiaolin, W., Huaxia, X., and Chunhua, S. Twins: Revisiting the design of spatial attention in vision transformers. In Advances in Neural Information Processing Systems, 2021. +Xu, Y., Xie, L., Zhang, X., Chen, X., Qi, G.-J., Tian, Q., and Xiong, H. Pc-darts: Partial channel connections for memory-efficient architecture search. In International Conference on Learning Representations, 2020. +Yonglong, T., Dilip, K., and Phillip, I. Contrastive multiview coding. In European Conference on Computer Vision, 2020. +Yu, J., Jin, P., Liu, H., Bender, G., Kindermans, P.-J., Tan, M., Huang, T., Song, X., Pang, R., and Le, Q. Bignas: Scaling up neural architecture search with big single-stage models. In European Conference on Computer Vision, 2020. +Yu, W., Luo, M., Zhou, P., Si, C., Zhou, Y., Wang, X., Feng, J., and Yan, S. Metaformer is actually what you need for vision. In Conference on Computer Cision and Pattern Recognition, 2022. +Yuan, K., Guo, S., Liu, Z., Zhou, A., Yu, F., and Wu, W. Incorporating convolution designs into visual transformers. In International Conference on Computer Vision, 2021. + +Zhun, Z., Liang, Z., Guoliang, K., Shaozi, L., and Yi, Y. Random erasing data augmentation. In Association for the Advancement of Artificial Intelligence, 2020. +Zoph, B. and Le, Q. V. Neural architecture search with reinforcement learning. In International Conference on Learning Representations, 2017. +Zoph, B., Vasudevan, V., Shlens, J., and Le, Q. V. Learning transferable architectures for scalable image recognition. In Conference on Computer Cision and Pattern Recognition, 2018. + +# A. The Sampling Methods + +![](images/b2caf502dcc0e1bf303d9ddeedfcd3e4115ae28ff9a3c8aa9842d3b197dd6585.jpg) +(a) The Sub-networks Accuracy + +![](images/147c3cac4226504f732d38253d8bd1df9684da5304d40a39fd303537ccdc8685.jpg) +(b) The Maximum and Minimum Models +Figure 8. (a) The sub-networks accuracy of SPOS and Hybrid Sampling Method on ImageNet. (b) The Top-1 accuracy along epochs of the maximum and minimum models on ImageNet-100. + +Fig. 8(a) shows the FLOPs and accuracy of 100 random sampled sub-networks with weights inherited from the supernet. The figure indicates that the sub-networks accuracy of the SPOS method is generally lower than that of the hybrid sampling method, especially when the FLOPs are larger than 3G. Fig. 8 shows the retraining accuracy along training epochs of the maximum and minimum models on ImageNet-100. The training configuration is the same as that on ImageNet except that the batch size is 128. The experimental results demonstrate that the maximum model has much worse convergence ability than the minimum model before 200 epochs. Furthermore, the Top-1 accuracy of the maximum model is not the upper bound in the search space, so it is not suitable to train the supernet directly using the sandwich sampling method. + +# B. Searched BurgerFormers + +![](images/c7b2630d699165aa1194e32f352e5f8563cd0ec5116fc4aa7734c3935d606bd9.jpg) + +![](images/9429f537b726c10109980939992f06781a817354d587ba3824869ab6d3071833.jpg) +BurgerFormer-Small + +![](images/e587ce99c4d971713f0c1f43da64c8ce035a8605ca5ecff0e446c59fe90d6510.jpg) + +![](images/1afbca1a7b0968e178a2bc3cbf6c7d8490f3e0289ab1124606593bad27920d4e.jpg) + +![](images/d129b10d4a3a0e6d79fef1f42ec9c4b39693fcaf8998713cd77bb04f5a95fa47.jpg) + +![](images/18ac7cbc09a2e08aebd043da8ea9e5aee7ebdece71223b4331f695fb194f9550.jpg) +BurgerFormer-Base + +![](images/6af11f3dc3443d8e711419917f64a0c8cb25f0ca3b06a15efe2c7a49d356b7a2.jpg) + +![](images/139dbb95ea290d5f1473f4ba4f447fb29ac8147fbeab421243daa96cffe70166.jpg) + +![](images/b1765c34bc755ebb89f296303022c4158ecfa6a516f8c8680df0ec450cfc87fe.jpg) +Figure 9. The architectures of BurgerFormer-Small, BurgerFormer-Base, and BurgerFormer-Large. + +![](images/5fec68def3cea2e997fc6f86c4ac7016e3eba947da9037e346fd533ca6443782.jpg) +BurgerFormer-Large + +![](images/1ef002e86a5a47580b7c6345772a68a5785783792fbbf1978957a39c763883a1.jpg) +Fig. 9 visualizes the structure of BurgerFormer-Small, BurgerFormer-Base and BurgerFormer-Large. At the microscopic level, global operators (i.e., Spatial MLP, MHSA) always exist in stage three or stage four. And the searched architectures prefer MHSA to Spatial MLP when the model size grows. Besides, an interesting observation is that Pooling, Spatial MLP, and MHSA can be followed by an activation function, which is rarely considered in previous architecture designs. At the mesoscopic and macroscopic levels, all three parts of the hamburger block tend to be leveraged and the architectures become deeper and wider as the model size grows. + +![](images/15119614f9dd0d93b974496a7256fac2b006c7005c35301e85004c0902417141.jpg) + +# C. More details of Architectures + +
StagesTokensPatch EmbeddingMHSA Head Number
1H/4 × W/43 × 3, stride 2, 24-
[3 × 3, stride 1, 24]
[3 × 3, stride 1, 24]
3 × 3, stride 2, C1
2H/8 × W/83 × 3, stride 2, C2-
3H/16 × W/163 × 3, stride 2, C34
4H/32 × W/323 × 3, stride 2, C48
+ +Table 6. The tokens, patch embedding and MHSA head number settings of each stage. + +Table 6 shows the tokens, patch embedding, and MHSA head number settings of each stage. $K \times K$ , stride $S$ , $C$ in the patch embedding column indicates the kernel size $K$ , the stride $S$ and the output channels $C$ of convolution. Following (Liao et al., 2021), we add three additional 3x3 convolutions into the patch embedding of stage one. Since the three convolutions already have a large receptive field, we set the kernel size three in the first patch embedding. \ No newline at end of file diff --git a/searchingforburgerformerwithmicromesomacrospacedesign/images.zip b/searchingforburgerformerwithmicromesomacrospacedesign/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..ac74704256eb36eea6a6768409326b51e3885100 --- /dev/null +++ b/searchingforburgerformerwithmicromesomacrospacedesign/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b9d28e8fed3e05fb048faee7530981941b74d130bbe40be30d38797dbaa5e948 +size 981393 diff --git a/searchingforburgerformerwithmicromesomacrospacedesign/layout.json b/searchingforburgerformerwithmicromesomacrospacedesign/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..6a5e045f9bd9ea227e88c073a6629f20af7c2245 --- /dev/null +++ b/searchingforburgerformerwithmicromesomacrospacedesign/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4ff26c031eb5aeb8a1e1c35c4e637d9714b38ce92a4ac3e5e5d3a8c5407ec1c0 +size 403317 diff --git a/securedistributedtrainingatscale/3275d82c-ea5a-4c49-9d36-dd8474e1354d_content_list.json b/securedistributedtrainingatscale/3275d82c-ea5a-4c49-9d36-dd8474e1354d_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..70d9981793da2095c448d52a3f760753e3ba5e68 --- /dev/null +++ b/securedistributedtrainingatscale/3275d82c-ea5a-4c49-9d36-dd8474e1354d_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5caf51a7225631464e11e9e4db18358d863645bb71648d49eb87ad1b142cf0d1 +size 442628 diff --git a/securedistributedtrainingatscale/3275d82c-ea5a-4c49-9d36-dd8474e1354d_model.json b/securedistributedtrainingatscale/3275d82c-ea5a-4c49-9d36-dd8474e1354d_model.json new file mode 100644 index 0000000000000000000000000000000000000000..080a580f500ff286f8bfeace3fd7ce7347be94ac --- /dev/null +++ b/securedistributedtrainingatscale/3275d82c-ea5a-4c49-9d36-dd8474e1354d_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a1ce22343bb96371d3548b1c43d598a46ded4216fe32d14c40bc311a1d2bc103 +size 519337 diff --git a/securedistributedtrainingatscale/3275d82c-ea5a-4c49-9d36-dd8474e1354d_origin.pdf b/securedistributedtrainingatscale/3275d82c-ea5a-4c49-9d36-dd8474e1354d_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..0083025e7e7e55208354877e7175f5fb97b343cc --- /dev/null +++ b/securedistributedtrainingatscale/3275d82c-ea5a-4c49-9d36-dd8474e1354d_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:68e720ba9937ed24d388d1cc9877fd4694cf55004f5e9309411929b0b90ac994 +size 1614748 diff --git a/securedistributedtrainingatscale/full.md b/securedistributedtrainingatscale/full.md new file mode 100644 index 0000000000000000000000000000000000000000..ee0c3aaa37b09afb5ae03107d2c2f372be2501db --- /dev/null +++ b/securedistributedtrainingatscale/full.md @@ -0,0 +1,2337 @@ +Eduard Gorbunov\*123 Alexander Borzunov\*43 Michael Diskin43 Max Ryabinin43 + +# Abstract + +Many areas of deep learning benefit from using increasingly larger neural networks trained on public data, as is the case for pre-trained models for NLP and computer vision. Training such models requires a lot of computational resources (e.g., HPC clusters) that are not available to small research groups and independent researchers. One way to address it is for several smaller groups to pool their computational resources together and train a model that benefits all participants. Unfortunately, in this case, any participant can jeopardize the entire training run by sending incorrect updates, deliberately or by mistake. Training in presence of such peers requires specialized distributed training algorithms with Byzantine tolerance. These algorithms often sacrifice efficiency by introducing redundant communication or passing all updates through a trusted server, making it infeasible to apply them to large-scale deep learning, where models can have billions of parameters. In this work, we propose a novel protocol for secure (Byzantine-tolerant) decentralized training that emphasizes communication efficiency. + +# 1. Introduction + +Many hard scientific problems were solved through collaboration between many nations, groups and individuals. This is especially evident in natural sciences, where researchers formed multinational collaborations to run large-scale experiments and share compute infrastructure (Aad et al., 2012; Ruttley et al., 2017; Abbott et al., 2016). Projects like Folding@home (Beberg et al., 2009) and BOINC (Anderson, 2004) push this trend even further by recruiting volunteers that donate their compute to collectively run computational experiments at an unprecedented scale (Merritt, 2020). + +*Equal contribution ¹MIPT ²Mila - Quebec AI Institute ³Yandex ⁴HSE University. Correspondence to: Eduard Gorbunov , Alexander Borzunov . + +Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s). + +Recently, similar techniques were proposed for deep learning. They aim to solve the challenges caused by the sheer computational complexity of many machine learning tasks, such as pretraining transformers for NLP (Devlin et al., 2019; Brown et al., 2020; Liu et al., 2019) or learning on huge datasets in vision (Sun et al., 2017; Kolesnikov et al., 2020; Goyal et al., 2021). Recent works (Kijsjipongse et al., 2018; Ryabinin & Gusev, 2020; Atre et al., 2021; Diskin et al., 2021) propose several systems sharing the computation across many volunteers that donate the idle time of their computers to train large models on public datasets. + +Despite their strengths, volunteer computing systems have so far seen limited practical applications (Kijsjipongse et al., 2018). A major roadblock towards the global adoption of these techniques is trust in reliability of each participant. For distributed training, all progress made by the collaboration can be undermined if a single peer sends incorrect outputs due to an error in computation (Smith, 2019) or malicious intent (Tolpegin et al., 2020). + +Prior art in decentralized optimization proposed several optimization algorithms that are resistant to such "Byzantine" faults. However, most Byzantine-tolerant training protocols require either passing all updates through a trusted central server or exchanging additional messages that increase the network load by several times (Chen et al., 2018; Rajput et al., 2019). This is a major problem for large-scale distributed deep learning, where hundreds of peers must exchange updates for millions of parameters at regular intervals (Li et al., 2020; Sergeev & Balso, 2018; Shoeybi et al., 2019). Thus, in many practical scenarios, the computation and communication overhead of Byzantine-tolerant algorithms outweighs the benefits of collaborating with others. + +In this work, we set out to solve this problem by proposing a novel Byzantine-tolerant distributed training protocol designed for large-scale deep learning workloads. Our approach combines the scalability and communication efficiency of modern distributed training techniques such as All-Reduce SGD (Sergeev & Balso, 2018) with resilience against Byzantine and Sybil attackers. To achieve this, we leverage cryptographic techniques to verify the integrity of training with minimal overhead that does not depend on the model size. Our protocol does not require any specific peers to be trusted. + +Our contributions can be summarized as follows: + +- We propose a novel protocol for decentralized Byzantine-tolerant training on data available to all participants, where the extra communication cost does not depend on the number of parameters. +- We rigorously analyze this protocol and prove convergence bounds for convex and non-convex losses with Byzantine attackers. Furthermore, we derive accelerated convergence rates for the same task under realistic assumptions about model gradients. +- We propose a heuristic for resisting Sybil attacks from computationally constrained attackers, allowing to accept new untrusted peers joining midway through training. +- We verify the effectiveness of our algorithm in controlled experiments1 and actual large-scale training runs. Specifically, we start with ResNet-18 for CIFAR-10 classification and follow up with pretraining ALBERT-large in a setup where almost a half of all peers are malicious. + +# 2. Related work + +# 2.1. Distributed deep learning + +Training modern neural networks often requires the amount of computation that is infeasible to achieve on any single machine. One has to train such models on multiple machines using methods for distributed training. Most of these methods fall into two groups: in data-parallel training, each worker trains the entire model by sampling batches from the training data (Sergeev & Balso, 2018; Goyal et al., 2017); in contrast, model-parallel training allocates parts of the model on different workers (Huang et al., 2019; Narayanan et al., 2019; Shoeybi et al., 2019). In this study, we consider only the first group; notably, most model-parallel systems still rely on data parallelism between nodes at the same stage (Rajbhandari et al., 2020; Narayanan et al., 2021). + +Usually, data-parallel training consists of two phases: first, each worker computes the gradients over its data; then, all workers aggregate the gradients and run an SGD step. The simplest aggregation strategy is known as Parameter Servers (PS) (Li, 2014; Dean et al., 2012; Recht et al., 2011): one of the servers stores and updates the model parameters, while all others iteratively compute the gradients, send them to the PS, and download the updated parameters. This strategy can be quite efficient with a small number of workers; as it increases, the parameter server eventually becomes unable to handle the load. While gradient compression (Seide et al., 2014; Lin et al., 2018; Mishchenko et al., 2019; Koloskova et al., 2020; Gorbunov et al., 2020; 2021) and local up + +![](images/23564a68a5dfae0b8efc298ad8173405aff67f3952b45b82edc0bcc7670e4310.jpg) +Figure 1. A scheme of Butterfly All-Reduce (Li et al., 2017). Each peer transfers only $O(d)$ data when averaging a vector of size $d$ . + +dates (Zinkevich et al., 2010) partially address this issue, it still remains a bottleneck of such methods. + +In practice, most distributed training systems leverage AllReduce (AR) (Goyal et al., 2017; Mikami et al., 2019; You et al., 2020)—a family of collective communication protocols that allow servers to average their data and receive the result on each machine. The resulting method, named All-Reduce SGD (AR-SGD), runs AR on local gradients of each peer to compute the global average. Usually, AR-SGD uses bandwidth-optimal versions of All-Reduce (Sergeev & Balso, 2018; Patarasuk & Yuan, 2009), such as Butterfly AllReduce (see Figure 1). Depending on the exact algorithm, they require each peer to transfer only $O(d)$ or $O(d\log n)$ data when averaging a vector of size $d$ across $n$ peers (unlike the PS-based approaches, where PS transfers $O(dn)$ data). + +# 2.2. Byzantine-tolerant optimization + +Standard distributed training methods are not robust against Byzantine attacks. In the vanilla parallel SGD, one malicious worker can break the convergence of the whole method by shifting the mean of the resulting vector in an arbitrary way. Therefore, the research community invented special algorithms that can train models even in this setup. + +Parameter-server (PS) based approaches. Most of the algorithms designed to be Byzantine-resilient rely on the existence of a trusted parameter server. In such approaches, the standard mean estimator, e.g., the one used in parallel SGD, is typically replaced with a more robust aggregation rule (Blanchard et al., 2017; Yin et al., 2018; Damaskinos et al., 2019; El Mhamdi et al., 2018; Pillutla et al., 2019). However, recent works show that it is not enough by proposing special types of Byzantine attacks (Baruch et al., 2019; Xie et al., 2020) and showing that permutation-invariant algorithms cannot converge to any predefined accuracy of the solution (Karimireddy et al., 2020). + +Although there are several approaches aiming to circumvent this issue, most of them have significant limitations such as no convergence analysis (Chen et al., 2018; Rajput et al., 2019; Rodríguez-Barroso et al., 2020; Xu & Lyu, 2020), too restrictive assumptions in the analysis (Alistarh + +et al., 2018; Allen-Zhu et al., 2021; Regatti et al., 2020), or the usage of variance-reduced estimators (Wu et al., 2020), which are known to converge slowly in deep learning applications (Defazio & Bottou, 2019). The only paper without such limitations is Karimireddy et al. (2020): it proposes a new aggregation rule called CENTEREDCLIP, applies it to SGD with client momentum, and proves convergence results for the obtained method in the non-convex case under reasonable assumptions. We provide more details on Byzantine-tolerant PS-based approaches in Appendix A.1.1. + +Decentralized approaches for Byzantine-tolerant optimization are studied only in a few papers. Unfortunately, the known approaches are not well-suited for distributed deep learning since they either rely on full gradient computations (Yang & Bajwa, 2019a;b), or use redundant communications with multiple servers (El-Mhamdi et al., 2020), or require peer-to-peer communication of full vectors at each step (Gupta et al., 2021; Gupta & Vaidya, 2021), which is not scalable, or provide the convergence guarantees that are inferior to non-parallel SGD (Peng et al., 2021), which has prohibitively slow convergence on modern deep learning tasks. We defer further details to Appendix A.1.2. + +# 2.3. Security in distributed systems + +Message propagation protocols. In this work, we consider distributed systems relying exclusively on peer-to-peer connections (e.g., the ones working over the Internet). Several key stages of our algorithm require peers to broadcast small messages to all other peers. For the sake of consistency, if at least one honest peer receives a message, we expect all other honest peers to eventually receive it as well. + +A naive solution would be for all peers to relay each previously unseen message to all other peers. In this case, for $n$ peers and a $b$ -bit message, one all-to-all broadcast would require each peer to transfer $O(n^{2}b)$ data. To improve efficiency, we use GossipSub (Vyzovitis et al., 2020) that reduces this cost to $O(nb)$ data per peer by relaying each message to only $D$ carefully chosen neighbors, where $D$ is a constant chosen based on latency requirements. + +Digital signatures. Our approach relies on the fact that an attacker cannot impersonate an honest peer or change messages an honest peer broadcasts. To achieve that, we require all peers to declare their public keys and sign all their messages with digital signatures (Rivest et al., 1978). + +Multi-party random number generator. To ensure that peers compute gradients honestly, our approach verifies a random subset of all computed gradients. Thus, we need to choose who is going to be checked in such a way that the attackers can neither predict nor influence the random draw. This can be done with a multi-party random number generator (MPRNG) based on the coin tossing protocol from Blum + +(1983). We explain the full algorithm in Appendix A.2. The algorithm requires each peer to only broadcast 3 scalars, so its communication cost is $O(n)$ data per peer. + +# 3. Method + +We consider secure distributed training on public datasets, where each peer can access the entire training data and communicate with any other peer. In this scenario, multiple parties cooperate by combining their computational resources for a single large-scale training run. Specifically, we consider a data-parallel training setup with All-Reduce SGD (as described in Section 2.1), where peers aggregate their gradient vectors of size $d$ . + +We describe our strategy in several stages: + +- Section 3.1 outlines our approach for Byzantine-Tolerant All-Reduce (BTARD). +- In Section 3.2, we formulate the underlying optimization problem and derive its convergence bounds. +- In Section 3.3, we propose a heuristic for resisting Sybil attacks, allowing our system to accept new untrusted peers midway through training. + +# 3.1. Byzantine-Tolerant All-Reduce + +We assume that some workers can be malicious, i.e., they can arbitrarily deviate from our algorithm: for instance, send arbitrary vectors instead of stochastic gradients or violate the communication protocol. Such workers are called Byzantine nodes or just Byzantines. We assume them to be omniscient (Karimireddy et al., 2020) (except for the honest nodes' private keys and the internals of MPRNG) and able to collude with each other. We denote the set of all "good" workers as $\mathcal{G}$ and the set of Byzantine workers as $\mathcal{B}$ . We further assume that $\mathcal{B}$ is fixed throughout the optimization process, and less than a half of the nodes are Byzantine: $|\mathcal{B}| \leq \delta n$ , where $\delta \in [0,1/2)$ . Finally, we assume that all workers have access to the data defining the objective function, sampling minibatches from the full dataset. + +We design our algorithm in such a way that all types of Byzantine faults have limited effect and chance of being discovered. To limit the damage over a single SGD step, we modify Butterfly All-Reduce $^3$ (see Figure 1) with a robust aggregation technique known as CENTEREDCLIP (Karimireddy et al., 2020). We apply CENTEREDCLIP to each + +![](images/521bed112ed66e0253a074926ec75ac63626c4313678d8489183eaeb68892161.jpg) +Figure 2. A scheme illustrating one step of Byzantine-Tolerant All-Reduce — a part of Algorithm 1 executed between the consecutive SGD steps. Here, $t$ is the step number, $x^t$ is the model weights, and $\xi_i^t$ is a publicly known random seed for sampling a minibatch. + +partition of the gradient vector instead of naive averaging. We denote this procedure as BUTTERFLYCLIP (see Algorithm 2 for its formal description). + +However, Byzantine peers can circumvent this limit by attacking over many iterations. To protect against this, BTARD periodically chooses random peers to serve as invalidators. The invalidators must recalculate the gradients of other peers and report any discrepancies instead of computing their own gradients. Since such tests are effective only if the attackers cannot predict whether they will be validated, we use a multi-party random number generator (as described in Section 2.3) to choose the validated peers. + +After each training step, peers use MPRNG to choose $m$ placeholders and $m$ peers to validate (each validator checks one peer). The Byzantines cannot predict "safe" iterations before they commit to an attack. Thus, more frequent attacks (with greater total damage) are more likely to be detected by an honest validator. + +Since processors can also be malicious, BTARD uses a special ACCUSE procedure to detect false reports. Before each averaging round, peers broadcast hashes of their gradients using GossipSub $^4$ (line 2 of Algorithm 2). Then, if the processor $i$ accuses peer $j$ of modifying gradients, all other peers will be able to recalculate $j$ 's gradients and compare their hash against the broadcasted one. If the peers find that $j$ 's gradients are correct, peer $i$ is banned instead (Hammurabi & Harper, 1904). This procedure is described in Algorithm 3. + +The resulting algorithm is resilient to attacks made through incorrect gradients. However, malicious peers may also harm training by violating the CENTEREDCLIP procedure for the portion of gradients they are aggregating. Fortunately, we can design a test through which peers can verify that a vector they received is indeed the output of CENTEREDCLIP. We need to view CENTEREDCLIP as a fixed-point iteration + +for the equation (see details in Appendix D.2): + +$$ +\sum_ {i = 1} ^ {n} \left(\vec {g} _ {i} - \vec {x}\right) \min \left\{1, \frac {\tau}{\| \vec {g} _ {i} - \vec {x} \|} \right\} = 0 \tag {1} +$$ + +The workers are not able to test whether (1) holds directly, since collecting $\vec{g}_i$ would require sending $O(dn)$ data per peer, defeating the purpose of our algorithm. + +Instead, workers should use the MPRNG output to sample a random direction $\vec{z}$ in the space of model gradients. Then, each peer computes and broadcasts the inner product (2): + +$$ +s _ {i} = \left\langle \vec {z}, (\vec {g} _ {i} - \vec {x}) \min \left\{1, \frac {\tau}{\| \vec {g} _ {i} - \vec {x} \|} \right\} \right\rangle \tag {2} +$$ + +Finally, all peers can verify that $\sum_{i=1}^{n} s_i = 0$ . Similarly to our previous use of MPRNG, all aggregators must broadcast the hashes of their aggregation results (line 6 of Alg. 2) before they learn $\vec{z}$ . This ensures that a malicious aggregator cannot modify the results in such a way that the difference would be orthogonal to $\vec{z}$ (this and more complex attack vectors are analyzed in Appendices C and D.5). + +We combine all these procedures in Algorithm 1 (see its scheme in Figure 2 and its detailed version in Alg. 6-7). Crucially, one step of Algorithm 1 requires each peer to (a) receive and send $n$ partitions of the gradient vector (exactly as in Butterfly All-Reduce), (b) broadcast $O(n)$ scalar values (all hashes, the inner products $s_i^j$ , and the necessary accusations), and (c) run MPRNG once. According to Sections 2.1 and 2.3, the total communication cost of these procedures is $O(d + n^2)$ data per peer. This is close to $O(d)$ cost of the bandwidth-optimal versions of All-Reduce: the $O(n^2)$ extra cost is usually much smaller than $O(d)$ for models that benefit from distributed training. + +The algorithm's synchronization points and computational overhead are reviewed in Appendix B. + +# 3.2. Convergence analysis + +From the perspective of the optimization theory, our task is the expectation minimization problem: + +$$ +\min _ {x \in Q \subseteq \mathbb {R} ^ {d}} \left\{f (x) := \mathbb {E} _ {\xi \sim \mathcal {D}} [ f (x, \xi) ] \right\} \tag {3} +$$ + +Algorithm 1 BTARD-SGD for peer $i$ (informal) +Input: rank $i$ , model $x^0$ , seed $\xi_i^0$ , step count $T$ , peer count $n$ +1: for $t \in 0, \ldots, T-1$ do +2: $g_i = \text{COMPUTERGRADIENTS}(x^t, \xi_i^t)$ +3: $\hat{g} = \text{BUTTERFLYCLIP}(i, g_i)$ +4: $r^t = \text{MPRNG}$ +5: $z = \text{GETRANDOMVECTOR}(r^t)$ +6: for $j \in 1, \ldots, n$ do +7: // $\hat{g}[j]$ is the aggregated part from peer $j$ +8: $\Delta_i^j = (g_i[j] - \hat{g}[j]) \min \left\{1, \frac{\tau}{||g_i[j] - \hat{g}[j)||_2} \right\}$ +9: broadcast $s_i^j = \langle z[j], \Delta_i^j \rangle$ +10: for $j \in 1, \ldots, n$ do +11: // We know $\Delta_j^i$ from CENTEREDCLIP +12: if $s_j^i \neq \langle z[j], \Delta_j^i \rangle$ then +13: broadcast $s_j^i$ is wrong // Invokes Alg. 3 +14: if $\sum_{t}^{n} s_t^j \neq 0$ then +15: // Peer $j$ lied that all $s_j^i$ are correct +16: broadcast $\hat{g}[j]$ is wrong // Invokes Alg. 3 +17: $x^{t+1} = \text{SGDSTEP}(x^t, \hat{g})$ +18: $\xi_i^{t+1} = \text{hash}(r^t || i)$ +19: if $i \in \text{CHOOSEVALIDATORS}(r^t)$ then +20: $j = \text{CHOOSETARGET}(r^t, i)$ +21: VALIDATEPEER(j, $x^t$ , $\xi_j^t$ , $c_j$ , $h_j^*$ , $s_j^*$ ) +22: // ... instead of computing gradients for step $t+1$ +23: return $x^T$ + +Here, the objective function $f$ is smooth and uniformly lower bounded, $Q \subseteq \mathbb{R}^d$ is a closed convex set of admissible parameters and $\xi$ is the source of stochasticity, such as minibatch indices. We assume that the problem (3) can be solved in a distributed manner, i.e., one can use $n$ workers calculating (mini-batched) stochastic gradients in parallel and communicating according to some protocol. We denote the set of workers as $[n] := \{1, 2, \dots, n\} = \mathcal{G} \sqcup \mathcal{B}$ . + +There are many ways for Byzantines to affect the training. We can classify all of them into four categories: (a) gradient attacks, where Byzantines modify their $g_{i}^{k}$ , but otherwise behave normally; (b) aggregation attacks, where a malicious aggregator returns wrong $\hat{g}_{i}$ and relies on others to cover it up by misreporting $s_{i}$ ; (c) reputation attacks, such as slander via false ACCUSE(i,j,·); and (d) protocol violations, that is, any other deviations from the steps of Algorithm 1 (e.g., refusing to send data within a predefined timeout). We elaborate on each attack type in Appendix C. + +For the purpose of this analysis, the latter two attacks can be repelled with an extra policy that allows an active worker to ELIMINATE any other worker at the cost of also being banned. If peer $i$ encounters a protocol violation from peer $j$ , it broadcasts a message asking to remove both peers $i$ and $j$ from training. The design of this policy ensures that every + +Algorithm 2 BUTTERFLYCLIP for peer $i$ +Input: rank i, gradients gi ∈ Rd 1: gi[1],..., gi[n] = SPLIT(gi,n) 2: broadcast ∀j, hj = hash(gi[j]) 3: send ∀j, gi[j] → peerj 4: receive ∀j, gj[i] ← peerj // and verify against hi j 5: $\hat{g}_i =$ CENTEREDCLIP(g1[i],...,gn[i]) 6: broadcast $\hat{h}_i =$ hash( $\hat{g}_i$ 7: send ∀j, $\hat{g}_i\rightarrow$ peerj 8: receive ∀j, $\hat{g}_j\gets$ peerj // and verify against $\hat{h}_j$ 9: return MERGE( $\hat{g}_1,\dots ,\hat{g}_n$ ) Algorithm 3 ACCUSE (i,j), invoked on all peers Input: accuser i, target j 1: $g_j =$ COMPUTEGRADIENTS(xt, $\xi_{j}^{t}$ ) 2: if $\exists k:(\mathrm{hash}(g_j[k])\neq h_j^k$ 3: or $s_j^k\neq \langle z[k],\Delta_j^k\rangle)$ or $\sum_{k = 1}^{n}s_k^j\neq 0$ then 4: BAN(peerj) // and everyone who covered it up 5: else 6: BAN(peeri) + +such message, whether sent by honest or Byzantine peers, eliminates at least 1 Byzantine peer and at most 1 honest peer (see details in Appendix D.3). Thus, if a Byzantine minority uses this against honest peers, it will only decrease their relative numbers: $(\delta n - 1) / (n - 2) < \delta$ . This leaves us only with the attacks targeting the aggregated gradients. + +We provide convergence guarantees for variants of BTARD-SGD with $Q = \mathbb{R}^d$ under different sets of assumptions about the function $f$ and its stochastic gradients. Our first two setups assume that: + +Assumption 3.1. There exist such constant $\sigma \geq 0$ , $s_0 \in [d]$ that for any set of indices $S = (i_1, \ldots, i_s)$ , $1 \leq i_1 < i_2 < \ldots < i_s \leq d$ , $s \geq s_0$ stochastic gradient $\nabla f(x, \xi)$ satisfy + +$$ +\mathbb {E} [ \nabla f (x, \xi) ] = \nabla f (x), +$$ + +$$ +\mathbb {E} \left[ \left\| \nabla_ {[ S ]} f (x, \xi) - \nabla_ {[ S ]} f (x) \right\| ^ {2} \right] \leq \frac {s \sigma^ {2}}{d}, \tag {4} +$$ + +where $\nabla_{[S]}f(x,\xi) = (\nabla_{i_1}f(x,\xi),\dots ,\nabla_{i_s}f(x,\xi))^{\top},$ $\nabla_{[S]}f(x) = (\nabla_{i_1}f(x),\dots ,\nabla_{i_s}f(x))^{\top},$ and $\nabla f_j(x,\xi),\nabla_jf(x)$ are $j$ -th components of $\nabla f(x,\xi)$ and $f(x)$ respectively. + +Here, (4) is an extension of the classical uniformly bounded variance (UBV) assumption (Nemirovski et al., 2009; Ghadimi & Lan, 2012; 2013) ensuring that the noise in all subvectors of large enough dimension has the variance dependent on the ratio between the dimension of the subvector $s$ and the dimension of the full vector $d$ . For example, it holds when the noise is isotropic. Moreover, one can relax this assumption to the standard UBV assumption, if + +Table 1. Summary of complexity bounds for BTARD-SGD in different scenarios. By complexity we mean the number of iterations sufficient to find such point $\widehat{x}$ that $\mathbb{E}[\|\nabla f(\widehat{x})\|^2] \leq \varepsilon^2$ for non-convex problems and $\mathbb{E}[f(\widehat{x}) - f(x^*)] \leq \varepsilon$ for convex and $\mu$ -strongly convex problems (see Def. E.2) with $x^*$ being the solution. Notation: "known $|\mathcal{B}_k^a| =$ the exact number of attacking Byzantine workers at iteration $k$ is known to each participant, $L =$ smoothness constant (see Def. E.1), $\Delta_0 = f(x^0) - f_*$ , $f_* =$ uniform lower bound for $f$ , $\sigma^2 =$ variance parameter from As. 3.1, $n =$ the initial number of peers, $b =$ the initial number of Byzantine workers, $\delta = b/n$ , $m =$ number of peers checked at each iteration, $R_0 = \|x^0 - x^*\|$ . + +
AssumptionsConvexity of f
Non-convexConvexStrongly convex
As. 3.1+ As. 3.2 + known |Bak|LΔ0/ε2 + LΔ0σ2/nε4 + nδσ2/mε2LR02/ε + σ2R02/nε2 + n√δσR0/mεL/μ log μR02/ε + σ2/nμε + n√δσ m√με
As. 3.1+ As. 3.2LΔ0/ε2 + LΔ0σ2/nε4 + n2δσ2/mε2LR02/ε + σ2R02/nε2 + n2δσR0/mεL/μ log μR02/ε + σ2/nμε + n2δσ m√με
+ +blocks for aggregation in BTARD are chosen uniformly at random (see Appendix E.3.1). In order to further reduce overhead from Verification 3 in the full Algorithm 6, we also assume that the stochastic gradient distributions have sub-quadratically decreasing tails (see Appendix E.3.1). + +Assumption 3.2. There exist such constant $\sigma \geq 0$ , $s_0 \in [d]$ that for any set of indices $S = (i_1, \ldots, i_s)$ , $1 \leq i_1 < i_2 < \ldots < i_s \leq d$ , $s \geq s_0$ and any $t > 0$ stochastic gradient $\nabla f(x, \xi)$ satisfy + +$$ +\mathbb {P} \left\{\left\| \frac {1}{k} \sum_ {i = 1} ^ {k} \nabla_ {[ S ]} f (x, \xi_ {i}) - \nabla_ {[ S ]} f (x) \right\| ^ {2} > \frac {t s \sigma^ {2}}{k d} \right\} < \frac {1}{t ^ {2}}, +$$ + +where $\xi_1, \ldots, \xi_k$ are i.i.d. samples from $\mathcal{D}$ , and $\nabla_{[S]}f(x, \xi)$ , $\nabla_{[S]}f(x)$ are defined in As. 3.1. + +Under these assumptions, we derive the following convergence bounds for strongly convex, generally convex, and non-convex objectives (see Table 1). The respective proofs and further details are deferred to Appendix E.3. + +Discussion of the convergence bounds. Let us briefly discuss the main properties of the derived results. When $\delta = 0$ (there are no Byzantine peers), we recover the tightest known rates for parallel SGD for strongly convex, generally convex, and non-convex objectives with both sets of assumptions. Next, we notice that in all complexity bounds in the known $|\mathcal{B}_k^a |$ case, the term depending on the ratio of Byzantine workers $\delta$ (the third one in all bounds) has better dependence on the accuracy of the solution $\varepsilon$ than the classical variance term (the second one in all bounds). Therefore, for sufficiently small $\varepsilon$ , the derived complexity bounds are the same as in the case when there are no Byzantine workers and parallel SGD is used. However, these bounds are obtained under the assumption that all participants know the exact number of attacking Byzantine workers at each iteration, which is not realistic but helps to better adjust clipping parameter $\tau$ in CENTEREDCLIP. + +As for the more general case, the third term is much worse + +than the corresponding term in the previous setup. Nevertheless, the term that depends on the ratio of Byzantine workers $\delta$ has the same dependence on $\varepsilon$ as in the known $|\mathcal{B}_k^a |$ case. This implies that for sufficiently small $\varepsilon$ the derived complexity bounds are the same as in the case when there are no Byzantine workers and parallel SGD is used. We provide the complete formulations and proofs in Appendix E.3. + +Finally, the derived convergence results are superior to the previous state-of-the-art ones even in the PS setup if $\varepsilon$ is sufficiently small. For example, in the non-convex case, Karimireddy et al. (2020) show the $\mathcal{O}(1 / \varepsilon^2 +\sigma^2 /n\varepsilon^4 +\delta \sigma^2 /\varepsilon^4)^5$ complexity bound for a version of MOMENTUM-SGD that uses CENTEREDCLIP aggregation rule when PS is available. When there is at least one Byzantine peer, the leading term in the above bound is $\mathcal{O}(\delta \sigma^2 /\varepsilon^4)$ since $\delta \geq 1 / n$ . In contrast, when $\varepsilon$ is sufficiently small, i.e., $\varepsilon \leq \mathcal{O}(\sqrt{L\Delta_0m / n^3\delta\sigma^2})$ (see Table 1), the leading term in our bound is $\mathcal{O}(\sigma^2 /n\varepsilon^4)$ , which is better than $\mathcal{O}(\delta \sigma^2 /\varepsilon^4)$ . However, it is worth mentioning the differences between the setups. Although we do not assume the existence of PS, our algorithm and theoretical analysis rely on the usage of part of the workers to check the computations of some other workers and we allow bans of the participants. This is the key feature of our algorithm allowing us to obtain the improvement. See the detailed comparison with other works in Appendix A.1. + +Intuition behind the proofs. First, we show that all possible violations of our protocol either lead to the instant ban of a Byzantine peer or (with some positive probability) to the ban during the checks of computations following each iteration of the algorithm (Appendix D.5). Next, we upper-bound the (expected squared) shifts that Byzantines can create at each iteration (Lemmas E.3 and E.4). Therefore, in expectation, Byzantines can deviate from the protocol only a finite number of times, and "the power" of their attacks + +is limited at each particular iteration. Using these results, we analyze BTARD-SGD as parallel SGD with shifted updates, where the shifts are bounded and exist during the finite number of steps (see Appendices E.3.3-E.3.5). + +Results for heavy-tailed problems. So far, all our convergence results rely on As. 3.2, i.e., that the stochastic gradients have not too heavy tails. This assumption holds for many real-world neural networks. However, there are important NLP tasks such as BERT training (Zhang et al., 2020), where the noise in the stochastic gradient has so heavy tails that As. 3.2 becomes unrealistic. The third and final setup in our analysis aims to address such heavy-tailed problems with BTARD-CLIPPED-SGD (Algorithm 9 in Appendix E.4). We analyze the method under the assumption that $\alpha$ -th moments of the stochastic gradients are uniformly upper-bounded for some $\alpha \in (1,2]$ . We notice that for $\alpha < 2$ this assumption allows the variance of the stochastic gradient to be unbounded. In this setting, we prove that BTARD-CLIPPED-SGD finds an $\varepsilon$ -solution of the convex problem after $\mathcal{O}\left(\varepsilon^{-\alpha / (\alpha - 1)}\left(1 + \left(n\sqrt{\delta} / m\right)^{\alpha / (\alpha - 1)}\right)\right)$ iterations when the number of attacking Byzantine peers is known at each iteration and $\mathcal{O}\left(\varepsilon^{-\alpha / (\alpha - 1)}\left(1 + \left(n^2\delta^2 / m\right)^{\alpha / (\alpha - 1)}\right)\right)$ iterations otherwise. One can find the full statements and complete proofs of our results in Appendix E. + +# 3.3. Resisting Sybil attacks + +The algorithm described in Section 3.1 operates with a predefined list of peers that can only decrease in size. However, many real-world scenarios would benefit from new peers joining midway through training. Unfortunately, this exposes the system to Sybil attacks (Douceur, 2002), when a single computationally constrained attacker adopts multiple pseudonymous identities in order to establish a dishonest majority and break the algorithm. + +To handle this, one may augment BTARD with a heuristic protocol that dictates how new peers can join the experiment. A new participant must prove that it has honestly computed enough gradients over multiple continuous iterations before it is allowed to actually contribute to the training. This ensures that the influence of Sybil attackers is proportional to their computing power (see details in Appendix F). + +# 4. Experiments + +# 4.1. CIFAR10 classification + +First, we evaluate our approach in controlled conditions. Our setup is a ResNet-18 (He et al., 2015) model trained to solve the CIFAR10 classification task (Krizhevsky et al.). We train the model on 16 peers (each peer processes 8 samples per batch) using SGD with Nesterov (1983) momentum and the cosine annealing learning rate (Loshchilov & Hutter, + +2017). We use a tuned setup achieving $93.5\%$ test accuracy. + +Our method has a hyperparameter $\tau$ responsible for clipping strength in CENTEREDCLIP. We experiment with $\tau = 10$ (weaker clipping) and $\tau = 1$ (stronger clipping). These values were chosen based on the maximal standard deviation of the gradient parts averaged by the workers during normal training, so that almost no vectors are clipped for the weaker clipping and almost half of the vectors are clipped for the stronger clipping scenario. We begin with using only 1 val-. idator on each step. If a validator happens to be Byzantine, it never accuses its peers. + +We compare our method to the regular All-Reduce without clipping and the baselines that use a trusted parameter server: the original variant of CENTEREDCLIP (Karimireddy et al., 2020), the coordinate-wise and geometric medians. Some other popular robust aggregation techniques are omitted because they were shown to be inferior in Karimireddy et al. (2020). We run all iterative algorithms (such as CENTEREDCLIP) to convergence with $\epsilon = 10^{-6}$ , as we have found that limiting the number of iterations can significantly decrease the final model quality (see Figure 9 in Appendix I.1). + +In addition to measuring training convergence, we evaluate our setup in presence of malicious peers. To test pessimistic conditions, we pick a setting where 7 of 16 peers are Byzantine (see Appendix I.1 for a setup with 3 Byzantines). We experiment with the following attack types: + +- SIGN FLIPPING: each attacker sends the opposite of its true gradient. +- RANDOM DIRECTION: all attackers send large vectors pointed in a common random direction. +- LABEL FLIPPING: each attacker computes its gradient based on the cross-entropy loss with flipped labels. For CIFAR-10, we replace label $l \in \{0, \dots, 9\}$ with $9 - l$ . +- DELAYED GRADIENT: attackers send their real gradients delayed by 1000 steps. +- INNER PRODUCT MANIPULATION (IPM): attackers send the average of all honest peers' gradients multiplied by $-\epsilon$ . We test $\epsilon = 0.1$ (Xie et al. (2020) demonstrate its efficiency against the coordinate-wise median and Krum) and $\epsilon = 0.6$ (Allen-Zhu et al. (2021) report it as the most efficient attack against their SAFEGUARDSGD). +- "A LITTLE IS ENOUGH" (ALIE): attackers collude to move the coordinate-wise median while still sending values inside the population variance. Baruch et al. (2019) show that this attack is effective against TrimmedMean (Yin et al., 2018) and Krum (Blanchard et al., 2017). + +We further amplify the Byzantine gradients from the first two attacks by a large coefficient $\lambda = 1000$ so they would + +![](images/143697e9fc85852d89e0f262f59ac5a47dd7571b07bb5071be541b1d5209896c.jpg) + +![](images/253b56e8675779cafb8f1283285833484cfb6c467b147ad2a36b090c51046a44.jpg) + +![](images/b00b42318d286a6f0ddf884d8c5fb4fa26dc3910c05fd703f8de18c264d6cf29.jpg) + +![](images/49774f349d618d5911338e28d92932b74388421853ff5daedf34f44a24dff0cd.jpg) + +![](images/87e43816b817804991462fb6b4687fc6f61103432fd81269f077eafe22ec6c74.jpg) + +![](images/59fb01e34153324869e3a01465af2807c35bccda737ba415629f5ae080d767c3.jpg) + +![](images/baa9192c268f57f03fd634b1022763667f80f50c38b1fe1d58792b91ee141736.jpg) +Figure 3. The ResNet-18 test accuracy in the case of various attacks and robust aggregation techniques. + +![](images/31188b51878d7664fe0e3435c8b50733a89bdf73fb71faf50b57148f6bd99b5e.jpg) + +![](images/3c09dc57b98c0d553a6d0f6dc251c0981bd7a9a746f1add5deb01110337ff0a8.jpg) + +dominate the aggregated gradient if no clipping is used. While in practice such attacks can be identified right away by the large gradient norms, we deliberately avoid doing that to test our clipping approach. + +Here, we make Byzantines behave honestly prior to step $s = 1000$ , then simultaneously attack on each step until they are banned (i.e., attacks start at the early stage of training). In Appendix I.1, we have also evaluated our method in the case of $s = 10,000$ (i.e., attacks start closer to the convergence stage) and in the case of Byzantines attacking periodically, but found no significant differences in its behavior. + +We repeat each experiment 5 times and report the mean and range (between the minimum and maximum) of the test accuracy during at least 2000 steps after all Byzantines are banned. In our experiments, this usually happened within 150 steps after $s$ . + +We observe that our method does not significantly worsen the speed of convergence compared to the All-Reduce baseline (see Figure 3, upper-left). On average, the final test accuracy after 25,000 steps is only $0.6\%$ worse for $\tau = 1$ and even $0.1\%$ better for $\tau = 10$ . The other tested defenses have a similar effect, except for the coordinate-wise median, which does not converge even without attacks. + +Next, we find that BTARD with the stronger clipping and only 1 validator protects from all tested attack types except the ALIE attack, where we need 2 validators to guarantee recovery (see Figure 3). In general, the weaker clipping is most sensitive to the attacks with large magnitudes (sign flipping and random direction), while the stronger clipping is sensitive to the low-magnitude ALIE attack6. The other defenses fail to protect training from most attack types. + +We conclude that BTARD with the stronger clipping and 2 invalidators (i.e., $1/8$ of the compute dedicated for validation) allows to quickly recover the pre-attack accuracy after all tested attack types even in the extreme case with 7 out of 16 peers being Byzantine. + +# 4.2. Pre-training transformers + +In this section, we choose a more compute-intensive and hyperparameter-sensitive model with an adaptive optimizer + +![](images/978efb5fb34dfa7c5301c71255d0fa7fa189a12da9df44acb37abd453b90d482.jpg) + +![](images/4ca0980c0b978dd3d6d9f85a588dc7d9345178be51ce6deed0c1328fafd5b3dd.jpg) + +![](images/c4d5b98be17b14827758d23ff8779a5675b9b5e8486ea8c8ca8192d74ca7e239.jpg) + +![](images/d3c9be6d7e2f889dab5918e4f6465b2f4f979e765b844ccf3f811dc869a96131.jpg) +Figure 4. The ALBERT-large training objective in the case of BTARD-CLIPPED-SGD (in presence of various attacks) and the standard All-Reduce SGD (without attacks). + +![](images/455516857afe396090674991f29bb1bfdb55f8258d7777dc0fbca87e4bea0b16.jpg) + +![](images/1585107acf7102d5055ee81b7c26582435878b5b656d9c89e400c1ed0b8cc294.jpg) + +to demonstrate that our approach may be applied to the models commonly used in distributed training scenarios. Our setup is pre-training ALBERT-large (Lan et al., 2019) on the WikiText-103 dataset (Merit et al., 2017) using the LAMB optimizer (You et al., 2020) (see details in Appendix H). Since the original ALBERT setup uses gradient clipping, we use BTARD-CLIPPED-SGD (see Algorithm 9 in Appendix E.4). We train the model on 16 machines that jointly accumulate 4096 samples for every batch. + +We evaluate the All-Reduce baseline without attacks, as well as BTARD with weaker and stronger clipping (larger and smaller $\tau$ respectively) in presence of attackers. In the last case, we make 7 workers malicious, use 1 validator, and test two attack regions: $s = 1000$ and $s = 5000$ . We omit reporting of the delayed gradient attack (due to its inefficiency), as well as ALIE and IPM attacks (they require Byzantines to make an extra All-Reduce round on each step, which is hard to do efficiently in the real multi-host setup). + +As in the previous section, we observe that without attacks both $\tau$ values have no significant effect on the training progress, reaching only $1.3\%$ larger loss in the worst case. However, the stronger clipping shows faster recovery from the tested attacks (see Figure 4). Crucially, while some attacks significantly increase the loss function, the model recovers much faster than it takes to reach the pre-attack loss when training from scratch. + +We also report the computation overhead of BTARD-SGD in this setup in Appendix I.2 and conduct experiments with 64 machines and most efficient attacks in Appendix I.3, confirming that BTARD remains efficient at a larger scale. + +# 5. Conclusion + +In this work, we formulated BTARD-SGD - a Byzantine-tolerant training strategy for large neural networks. We verified its robustness and efficiency through theoretical analysis and large-scale distributed training experiments. + +Our research opens new opportunities in many deep learning applications, making it possible to train large neural networks in a cooperative manner. Small research groups can host open cooperative training projects where the training hardware is crowdsourced by volunteers around the world, or a group of small companies can compete with larger corporations by combining their compute clusters. While these applications also require engineering effort to become practical, our algorithm ensures that they can run securely without the need to screen every potential participant. + +# Acknowledgments + +This work was partially supported by a grant for research centers in the field of artificial intelligence, provided by the Analytical Center for the Government of the Russian Federation in accordance with the subsidy agreement (agreement identifier 000000D730321P5Q0002) and the agreement with the Moscow Institute of Physics and Technology dated November 1, 2021 No. 70-2021-00138. + +We thank Sai Praneeth Karimireddy for useful discussions and suggestions, Lie He for providing the code with CENTEREDCLIP, William Cappelletti for pointing out several relevant papers, Gennady Pekhimenko for his technical expertise and infrastructure for the distributed training experiments, and Dmitrii Emelianenko for helpful discussions. + +# References + +Aad, G., Abajyan, T., and Collaboration, T. A. Observation of a new particle in the search for the Standard Model Higgs boson with the ATLAS detector at the LHC. Physics Letters B, 716:1-29, 09 2012. +Abbott, B., Collaboration, L. S., and Collaboration, V. Observation of Gravitational Waves from a Binary Black Hole Merger. Physical Review Letters, 116, 02 2016. doi: 10.1103/PhysRevLett.116.061102. +Alistarh, D., Allen-Zhu, Z., and Li, J. Byzantine stochastic gradient descent. In Proceedings of the 32nd International Conference on Neural Information Processing Systems, pp. 4618-4628, 2018. +Allen-Zhu, Z., Ebrahimianghazani, F., Li, J., and Alistarh, D. Byzantine-resilient non-convex stochastic gradient descent. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id=PbEHqvFtcS. +Anderson, D. P. Boinc: A system for public-resource computing and storage. In *Fifth IEEE/ACM international workshop on grid computing*, pp. 4-10. IEEE, 2004. +Atre, M., Jha, B., and Rao, A. Distributed deep learning using volunteer computing-like paradigm, 2021. +Balakrishnan, H., Kaashoek, M. F., Karger, D., Morris, R., and Stoica, I. Looking up data in p2p systems. Communications of the ACM, 46(2):43-48, 2003. +Baruch, G., Baruch, M., and Goldberg, Y. A little is enough: Circumventing defenses for distributed learning. In Wallach, H., Larochelle, H., Beygelzimer, A., d'Alché-Buc, F., Fox, E., and Garnett, R. (eds.), Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc., 2019. URL https://proceedings.neurips.cc/paper/2019/file/ec1c59141046cd1866bbbcbdfb6ae31d4-Paper.pdf. +Beberg, A. L., Ensign, D., Jayachandran, G., Khaliq, S., and Pande, V. Folding@home: Lessons from eight years of volunteer distributed computing. 2009 IEEE International Symposium on Parallel & Distributed Processing, pp. 1-8, 2009. +Ben-Ameur, W., Bianchi, P., and Jakubowicz, J. Robust consensus in distributed networks using total variation. arXiv preprint arXiv:1309.7264, 2013. +Blanchard, P., El Mhamdi, E. M., Guerraoui, R., and Stainer, J. Machine learning with adversaries: Byzantine tolerant gradient descent. In Proceedings of the 31st International + +Conference on Neural Information Processing Systems, pp. 118-128, 2017. +Blum, M. Coin flipping by telephone a protocol for solving impossible problems. ACM SIGACT News, 15(1):23-27, 1983. +Brown, T., Mann, B., Ryder, N., Subbiah, M., Kaplan, J. D., Dhariwal, P., Neelakantan, A., Shyam, P., Sastry, G., Askell, A., Agarwal, S., Herbert-Voss, A., Krueger, G., Henighan, T., Child, R., Ramesh, A., Ziegler, D., Wu, J., Winter, C., Hesse, C., Chen, M., Sigler, E., Litwin, M., Gray, S., Chess, B., Clark, J., Berner, C., McCandlish, S., Radford, A., Sutskever, I., and Amodei, D. Language models are few-shot learners. In Larochelle, H., Ranzato, M., Hadsell, R., Balcan, M. F., and Lin, H. (eds.), Advances in Neural Information Processing Systems, volume 33, pp. 1877-1901. Curran Associates, Inc., 2020. URL https://proceedings.neurips.cc/paper/2020/file/1457c0d6bfbcb4967418bfb8ac142f64a-Paper.pdf. +Bulusu, S., Khanduri, P., Sharma, P., and Varshney, P. K. On distributed stochastic gradient descent for nonconvex functions in the presence of byzantines. In ICASSP 2020-2020 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 3137-3141. IEEE, 2020. +Chen, L., Wang, H., Charles, Z., and Papailiopoulos, D. Draco: Byzantine-resilient distributed training via redundant gradients. In International Conference on Machine Learning, pp. 903-912. PMLR, 2018. +Cleve, R. Limits on the security of coin flips when half the processors are faulty. In Proceedings of the eighteenth annual ACM symposium on Theory of computing, pp. 364-369, 1986. +Damaskinos, G., El Mhamdi, E. M., Guerraoui, R., Guirguis, A. H. A., and Rouault, S. L. A. Aggregator: Byzantine machine learning via robust gradient aggregation. In The Conference on Systems and Machine Learning (SysML), 2019, 2019. +Dean, J., Corrado, G., Monga, R., Chen, K., Devin, M., Mao, M., Ranzato, M. a., Senior, A., Tucker, P., Yang, K., Le, Q., and Ng, A. Large scale distributed deep networks. In Pereira, F., Burges, C. J. C., Bottou, L., and Weinberger, K. Q. (eds.), Advances in Neural Information Processing Systems, volume 25, pp. 1223-1231. Curran Associates, Inc., 2012. URL https://proceedings.neurips.cc/paper/2012/file/6aca97005c68f1206823815f66102863-Paper.pdf. + +Defazio, A. and Bottou, L. On the ineffectiveness of variance reduced optimization for deep learning. In Wallach, H., Larochelle, H., Beygelzimer, A., d'Alché-Buc, F., Fox, E., and Garnett, R. (eds.), Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc., 2019. URL https://proceedings.neurips.cc/paper/2019/file/84d2004bf28a2095230e8e14993d398d-Paper.pdf. +Defazio, A., Bach, F., and Lacoste-Julien, S. Saga: A fast incremental gradient method with support for non-strongly convex composite objectives. In Advances In Neural Information Processing Systems, 2014. +Devlin, J., Chang, M.-W., Lee, K., and Toutanova, K. BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. In NAACL-HLT, 2019. +Diskin, M., Bukhtiyarov, A., Ryabinin, M., Saulnier, L., Lhoest, Q., Sinitsin, A., Popov, D., Pyrkin, D., Kashirin, M., Borzunov, A., del Moral, A. V., Mazur, D., Koberlev, I., Jernite, Y., Wolf, T., and Pekhimenko, G. Distributed deep learning in open collaborations. CoRR, abs/2106.10207, 2021. URL https://arxiv.org/abs/2106.10207. +Douceur, J. R. The sybil attack. In IPTPS, 2002. +El Mhamdi, E. M., Guerraoui, R., and Rouault, S. The hidden vulnerability of distributed learning in Byzantium. In Dy, J. and Krause, A. (eds.), Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pp. 3521-3530. PMLR, 10-15 Jul 2018. URL http://proceedings.mlr.press/v80/mhamdi18a.html. +El-Mhamdi, E.-M., Guerraoui, R., Guirguis, A., Hoang, L. N., and Rouault, S. Genuinely distributed byzantine machine learning. In Proceedings of the 39th Symposium on Principles of Distributed Computing, pp. 355-364, 2020. +Ghadimi, S. and Lan, G. Optimal stochastic approximation algorithms for strongly convex stochastic composite optimization i: A generic algorithmic framework. SIAM Journal on Optimization, 22(4):1469-1492, 2012. +Ghadimi, S. and Lan, G. Stochastic first-and zeroth-order methods for nonconvex stochastic programming. SIAM Journal on Optimization, 23(4):2341-2368, 2013. +Gorbunov, E., Kovalev, D., Makarenko, D., and Richtárik, P. Linearly converging error compensated sgd. Advances in Neural Information Processing Systems, 33, 2020. + +Gorbunov, E., Burlachenko, K., Li, Z., and Richtárik, P. Marina: Faster non-convex distributed learning with compression. arXiv preprint arXiv:2102.07845, 2021. +Goyal, P., Dólar, P., Girshick, R., Noordhuis, P., Wesolowski, L., Kyrola, A., Tulloch, A., Jia, Y., and He, K. Accurate, large minibatch sgd: TrainingImagenet in 1 hour, 2017. +Goyal, P., Duval, Q., Reizenstein, J., Leavitt, M., Xu, M., Lefaudeauux, B., Singh, M., Reis, V., Caron, M., Bojanowski, P., Joulin, A., and Misra, I. Vissl, 2021. URL https://github.com/facebookresearch/vissl. +Gupta, N. and Vaidya, N. H. Byzantine fault-tolerance in peer-to-peer distributed gradient-descent. arXiv preprint arXiv:2101.12316, 2021. +Gupta, N., Doan, T. T., and Vaidya, N. H. Byzantine fault-tolerance in decentralized optimization under 2f-redundancy. In 2021 American Control Conference (ACC), pp. 3632-3637. IEEE, 2021. +Hammurabi, K. o. B. and Harper, R. F. The Code of Hammurabi, King of Babylon: About 2250 BC: Autographed Text, Transliteration, Translation, Glossary Index of Subjects, Lists of Proper Names, Signs, Numerals... University of Chicago Press, 1904. URL https://books.google.ru/books?id=jeLz_BYUoeQC&pg=PA11. Page 11, §1. +He, K., Zhang, X., Ren, S., and Sun, J. Deep residual learning for image recognition. 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 770-778, 2015. +He, L., Karimireddy, S. P., and Jaggi, M. Byzantine-robust learning on heterogeneous datasets via resampling. arXiv preprint arXiv:2006.09365v3, 2020. +Huang, Y., Cheng, Y., Chen, D., Lee, H., Ngiam, J., Le, Q. V., and Chen, Z. Gpipe: Efficient training of giant neural networks using pipeline parallelism. *ArXiv*, abs/1811.06965, 2019. +Jiang, Y., Zhu, Y., Lan, C., Yi, B., Cui, Y., and Guo, C. A unified architecture for accelerating distributed DNN training in heterogeneous cpu/cpu clusters. In 14th USENIX Symposium on Operating Systems Design and Implementation (OSDI 20), pp. 463-479. USENIX Association, November 2020. ISBN 978-1-939133-19-9. URL https://www.usenix.org/conference/osdi20/presentation/jiang. +Karimireddy, S. P., He, L., and Jaggi, M. Learning from history for byzantine robust optimization. arXiv preprint arXiv:2012.10333v3, 2020. + +Kijsjipongse, E., Piyatumrong, A., and U-ruekolan, S. A hybridgpu cluster and volunteer computing platform for scalable deep learning. The Journal of Supercomputing, 04 2018. doi: 10.1007/s11227-018-2375-9. +Kolesnikov, A., Beyer, L., Zhai, X., Puigcerver, J., Yung, J., Gelly, S., and Houlsby, N. Big transfer (bit): General visual representation learning. In ECCV, 2020. +Koloskova, A., Lin, T., Stich, S. U., and Jaggi, M. Decentralized deep learning with arbitrary communication compression. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id=SkgGcKrKvH. +Krizhevsky, A., Nair, V., and Hinton, G. Cifar-10 (canadian institute for advanced research). URL http://www.cs.toronto.edu/~kriz/cifar.html. +Lan, Z.-Z., Chen, M., Goodman, S., Gimpel, K., Sharma, P., and Soricut, R. Albert: A lite bert for self-supervised learning of language representations. ArXiv, abs/1909.11942, 2019. +Li, L., Xu, W., Chen, T., Giannakis, G. B., and Ling, Q. Rsa: Byzantine-robust stochastic aggregation methods for distributed learning from heterogeneous datasets. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pp. 1544–1551, 2019. +Li, M. Scaling distributed machine learning with the parameter server. In Proceedings of the 2014 International Conference on Big Data Science and Computing, BigDataScience '14, New York, NY, USA, 2014. Association for Computing Machinery. ISBN 9781450328913. doi: 10.1145/2640087.2644155. URL https://doi.org/10.1145/2640087.2644155. +Li, S., Zhao, Y., Varma, R., Salpekar, O., Noordhuis, P., Li, T., Paszke, A., Smith, J., Vaughan, B., Damania, P., and Chintala, S. Pytorch distributed: Experiences on accelerating data parallel training. Proc. VLDB Endow., 13(12):3005-3018, August 2020. ISSN 2150-8097. doi: 10.14778/3415478.3415530. URL https://doi.org/10.14778/3415478.3415530. +Li, Z., Davis, J., and Jarvis, S. An efficient task-based all-reduce for machine learning applications. In Proceedings of the Machine Learning on HPC Environments, MLHPC'17, New York, NY, USA, 2017. Association for Computing Machinery. ISBN 9781450351379. doi: 10.1145/3146347.3146350. URL https://doi.org/10.1145/3146347.3146350. +Lin, Y., Han, S., Mao, H., Wang, Y., and Dally, W. J. Deep Gradient Compression: Reducing the communication bandwidth for distributed training. In The International Conference on Learning Representations, 2018. + +Liu, Y., Ott, M., Goyal, N., Du, J., Joshi, M., Chen, D., Levy, O., Lewis, M., Zettlemoyer, L., and Stoyanov, V. Roberta: A robustly optimized bert pretraining approach. ArXiv, abs/1907.11692, 2019. +Loshchilov, I. and Hutter, F. Sgdr: Stochastic gradient descent with warm restarts. In International Conference on Learning Representations (ICLR) 2017 Conference Track, April 2017. +Lyu, L., Yu, H., Ma, X., Sun, L., Zhao, J., Yang, Q., and Yu, P. S. Privacy and robustness in federated learning: Attacks and defenses. arXiv preprint arXiv:2012.06337, 2020. +Maymounkov, P. and Mazieres, D. Kademlia: A peer-to-peer information system based on the xor metric. In International Workshop on Peer-to-Peer Systems, pp. 53-65. Springer, 2002. +McMahan, B., Moore, E., Ramage, D., Hampson, S., and y Arcas, B. A. Communication-efficient learning of deep networks from decentralized data. In Artificial Intelligence and Statistics, pp. 1273-1282, 2017. +Merit, S., Xiong, C., Bradbury, J., and Socher, R. Pointer sentinel mixture models. ArXiv, abs/1609.07843, 2017. +Merritt, R. Folding@home gets 1.5+ Ex +aflops to Fight COVID-19, 04 2020. +https://blogs.nvidia.com/blog/ +2020/04/01/foldingathome-exaflop- +coronavirus/(accessed on Apr 29, 2021). +Mikami, H., Suganuma, H., U-chupala, P., Tanaka, Y., and Kageyama, Y. Massively distributed sgd: Imagenet/resnet-50 training in a flash, 2019. +Mishchenko, K., Gorbunov, E., Takáč, M., and Richtárik, P. Distributed learning with compressed gradient differences. arXiv preprint arXiv:1901.09269, 2019. +Narayanan, D., Harlap, A., Phanishayee, A., Seshadri, V., Devanur, N. R., Ganger, G. R., Gibbons, P. B., and Zaharia, M. Pipedream: Generalized pipeline parallelism for dnn training. In Proceedings of the 27th ACM Symposium on Operating Systems Principles, SOSP '19, pp. 1-15, New York, NY, USA, 2019. Association for Computing Machinery. ISBN 9781450368735. doi: 10.1145/3341301.3359646. URL https://doi.org/10.1145/3341301.3359646. +Narayanan, D., Shoeybi, M., Casper, J., LeGresley, P., Patwary, M., Korthikanti, V., Vainbrand, D., Kashinkunti, P., Bernauer, J., Catanzaro, B., et al. Efficient large-scale language model training on gpu clusters. arXiv preprint arXiv:2104.04473, 2021. + +Nemirovski, A., Juditsky, A., Lan, G., and Shapiro, A. Robust stochastic approximation approach to stochastic programming. SIAM Journal on optimization, 19(4):1574-1609, 2009. +Nesterov, Y. A method for solving the convex programming problem with convergence rate $o(1 / k^2)$ . Proceedings of the USSR Academy of Sciences, 269:543-547, 1983. +Nesterov, Y. Introductory lectures on convex optimization: A basic course, volume 87. Springer Science & Business Media, 2003. +Paszke, A., Gross, S., Massa, F., Lerer, A., Bradbury, J., Chanan, G., Killeen, T., Lin, Z., Gimelshein, N., Antiga, L., et al. Pytorch: An imperative style, high-performance deep learning library. In Advances in Neural Information Processing Systems, pp. 8024-8035, 2019. +Patarasuk, P. and Yuan, X. Bandwidth optimal all-reduce algorithms for clusters of workstations. J. Parallel Distrib. Comput., 69(2):117-124, February 2009. ISSN 0743-7315. doi: 10.1016/j.jpdc.2008.09.002. URL https://doi.org/10.1016/j.jpdc.2008.09.002. +Peng, J., Li, W., and Ling, Q. Byzantine-robust decentralized stochastic optimization over static and time-varying networks. Signal Processing, 183:108020, 2021. +Pillutla, K., Kakade, S. M., and Harchaoui, Z. Robust aggregation for federated learning. arXiv preprint arXiv:1912.13445, 2019. +Rabin, T. and Ben-Or, M. Verifiable secret sharing and multiparty protocols with honest majority. In Proceedings of the twenty-first annual ACM symposium on Theory of computing, pp. 73-85, 1989. +Rajbhandari, S., Rasley, J., Ruwase, O., and He, Y. Zero: Memory optimizations toward training trillion parameter models. SC20: International Conference for High Performance Computing, Networking, Storage and Analysis, pp. 1-16, 2020. +Rajput, S., Wang, H., Charles, Z., and Papailiopoulos, D. Detox: A redundancy-based framework for faster and more robust gradient aggregation. In Wallach, H., Larochelle, H., Beygelzimer, A., d'Alché-Buc, F., Fox, E., and Garnett, R. (eds.), Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc., 2019. URL https://proceedings.neurips.cc/paper/2019/file/415185ea244ea2b2bedeb0449b926802-Paper.pdf. +Recht, B., Re, C., Wright, S., and Niu, F. Hogwild: A lock-free approach to parallelizing stochastic gradient descent. In Advances in neural information processing systems, pp. 693-701, 2011. + +Regatti, J., Chen, H., and Gupta, A. Bygars: Byzantine sgd with arbitrary number of attackers. arXiv preprint arXiv:2006.13421, 2020. +Rivest, R. L., Shamir, A., and Adleman, L. A method for obtaining digital signatures and public-key cryptosystems. Communications of the ACM, 21(2):120-126, 1978. +Rodriguez-Barroso, N., Martínez-Cármara, E., Luzón, M., Seco, G. G., Veganzones, M. Á., and Herrera, F. Dynamic federated learning model for identifying adversarial clients. arXiv preprint arXiv:2007.15030, 2020. +Rowstron, A. and Druschel, P. Pastry: Scalable, decentralized object location, and routing for large-scale peer-to-peer systems. In IFIP/ACM International Conference on Distributed Systems Platforms and Open Distributed Processing, pp. 329-350. Springer, 2001. +Rutley, T., Robinson, J., and Gerstenmaier, W. The international space station: Collaboration, utilization, and commercialization*: The international space station. Social Science Quarterly, 98:1160-1174, 12 2017. doi: 10.1111/ssqu.12469. +Ryabinin, M. and Gusev, A. Towards crowdsourced training of large neural networks using decentralized mixture-of-experts. In Larochelle, H., Ranzato, M., Hadsell, R., Balcan, M. F., and Lin, H. (eds.), Advances in Neural Information Processing Systems, volume 33, pp. 3659-3672. Curran Associates, Inc., 2020. URL https://proceedings.neurips.cc/paper/2020/file/25ddc0f8c9d3e22e03d3076f98d83cb2-Paper.pdf. +Seide, F., Fu, H., Droppo, J., Li, G., and Yu, D. 1-bit stochastic gradient descent and its application to data-parallel distributed training of speech dnns. In *Fifteenth Annual Conference of the International Speech Communication Association*, 2014. +Sennrich, R., Haddow, B., and Birch, A. Neural machine translation of rare words with subword units. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 1715-1725, Berlin, Germany, August 2016. Association for Computational Linguistics. doi: 10.18653/v1/P16-1162. URL https://www.aclweb.org/anthology/P16-1162. +Sergeev, A. and Balso, M. D. Horovod: fast and easy distributed deep learning in tensorflow, 2018. +Shoeybi, M., Patwary, M., Puri, R., LeGresley, P., Casper, J., and Catanzaro, B. Megatron-lm: Training multi-billion parameter language models usinggpu model parallelism. arXiv preprint arXiv:1909.08053, 2019. + +Smith, B. Flakey amd/ati gpus, including rx 5700 xt, cross validating, polluting the database, 2019. URL https://setiathome.berkeley.edu/forum_thread.php?id=84508. Accessed: 2021-05-20. +Sun, C., Shrivastava, A., Singh, S., and Gupta, A. Revisiting unreasonable effectiveness of data in deep learning era. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), Oct 2017. +Tolpegin, V., Truex, S., Gursoy, M. E., and Liu, L. Data poisoning attacks against federated learning systems. In *ESORICS*, 2020. +Trifa, Z. and Khemakhem, M. Sybil nodes as a mitigation strategy against sybil attack. Procedia Computer Science, 32:1135-1140, 2014. +Urdaneta, G., Pierre, G., and Steen, M. V. A survey of dht security techniques. ACM Computing Surveys (CSUR), 43(2):1-49, 2011. +Vyzovitis, D., Napora, Y., McCormick, D., Dias, D., and Psaras, Y. GossipSub: Attack-resilient message propagation in the Filecoin and ETH2.0 networks. arXiv preprint arXiv:2007.02754, 2020. +Wang, L. and Kangasharju, J. Real-world sybil attacks in bittorrent mainline dht. In 2012 IEEE Global Communications Conference (GLOBECOM), pp. 826-832. IEEE, 2012. +Wu, Z., Ling, Q., Chen, T., and Giannakis, G. B. Federated variance-reduced stochastic gradient descent with robustness to byzantine attacks. IEEE Transactions on Signal Processing, 68:4583-4596, 2020. +Xie, C., Koyejo, O., and Gupta, I. Fall of empires: Breaking byzantine-tolerant sgd by inner product manipulation. In Uncertainty in Artificial Intelligence, pp. 261-270. PMLR, 2020. +Xu, X. and Lyu, L. Towards building a robust and fair federated learning system. arXiv preprint arXiv:2011.10464, 2020. +Yang, Z. and Bajwa, W. U. Bridge: Byzantine-resilient decentralized gradient descent. arXiv preprint arXiv:1908.08098, 2019a. +Yang, Z. and Bajwa, W. U. Byrdie: Byzantine-resilient distributed coordinate descent for decentralized learning. IEEE Transactions on Signal and Information Processing over Networks, 5(4):611-627, 2019b. +Yin, D., Chen, Y., Kannan, R., and Bartlett, P. Byzantine-robust distributed learning: Towards optimal statistical + +rates. In International Conference on Machine Learning, pp. 5650-5659. PMLR, 2018. +You, Y., Li, J., Reddi, S., Hseu, J., Kumar, S., Bhojanapalli, S., Song, X., Demmel, J., Keutzer, K., and Hsieh, C.-J. Large batch optimization for deep learning: Training bert in 76 minutes. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id=Syx4wnEtvH. +Zhang, E., Liu, F.-H., Lai, Q., Jin, G., and Li, Y. Efficient multi-party private set intersection against malicious adversaries. In Proceedings of the 2019 ACM SIGSAC Conference on Cloud Computing Security Workshop, pp. 93-104, 2019. +Zhang, J., Karimireddy, S. P., Veit, A., Kim, S., Reddi, S., Kumar, S., and Sra, S. Why are adaptive methods good for attention models? In Larochelle, H., Ranzato, M., Hadsell, R., Balcan, M. F., and Lin, H. (eds.), Advances in Neural Information Processing Systems, volume 33, pp. 15383-15393. Curran Associates, Inc., 2020. URL https://proceedings.neurips.cc/paper/2020/file/b05b57f6add810d3b7490866d74c0053-Paper.pdf. +Zhao, B., Huang, L., Sribling, J., Rhea, S., Joseph, A., and Kubiatowicz, J. Tapestry: A resilient global-scale overlay for service deployment. IEEE Journal on Selected Areas in Communications, 22, 07 2003. doi: 10.1109/JSAC.2003.818784. +Zinkevich, M., Weimer, M., Li, L., and Smola, A. Parallelized stochastic gradient descent. In Lafferty, J., Williams, C., Shawe-Taylor, J., Zemel, R., and Culotta, A. (eds.), Advances in Neural Information Processing Systems, volume 23, pp. 2595-2603. Curran Associates, Inc., 2010. URL https://proceedings.neurips.cc/paper/2010/file/abea47ba24142ed16b7d8fbf2c740e0d-Paper.pdf. + +# Appendix + +# Table of contents + +# 1 Introduction 1 + +# 2 Related work 2 + +2.1 Distributed deep learning 2 +2.2Byzantine-tolerant optimization 2 +2.3 Security in distributed systems 3 + +# 3 Method 3 + +3.1Byzantine-Tolerant All-Reduce 3 +3.2 Convergence analysis 4 +3.3 Resisting Sybil attacks 7 + +# 4 Experiments 7 + +4.1 CIFAR10 classification 7 +4.2 Pre-training transformers 8 + +# 5 Conclusion 9 + +# A Additional related work 16 + +A.1Byzantine-tolerant optimization: additional details 16 +A.1.1 Parameter-server (PS) based approaches 16 +A.1.2 Decentralized approaches 16 +A.2 Multi-party random number generators: additional details 18 + +# B Synchronization points and computation overhead of BTARD-SGD 19 + +# C Overview of attack vectors 20 + +# D Detailed algorithm description 21 + +D.1 Basic building blocks 21 +D.2 CenteredClip and verification of its results 21 +D.3 Protocols for banning Byzantine peers 22 +D.4ButterflyClip 23 +D.5Byzantine-tolerant All-Reduce and its verification procedures 23 +D.6 BTARD-SGD training loop 26 + +# E Convergence analysis: missing proofs and extra details 27 + +E.1 Preliminaries 27 +E.2 Impossibility of Byzantine-tolerant learning in heterogeneous case 27 +E.3 Convergence guarantees for BTARD-SGD 28 + +E.3.1 On Assumptions 3.1 and 3.2 28 +E.3.2 Quality of the aggregation 28 +E.3.3 Non-convex case 32 +E.3.4 Convex case 35 +E.3.5 Strongly convex case: Restarted-BTARD-SGD 39 + +E.4 Convergence guarantees for BTARD-Clipped-SGD 42 + +E.4.1 Quality of the aggregation 43 +E.4.2 Convex case 46 +E.4.3 Strongly convex case: Restarted-BTARD-Clipped-SGD 52 + +# F Resisting Sybil attacks 55 + +# G Secure distributed hash tables 57 + +# H Details of the ALBERT experiment setup 57 + +# I Additional experiments 58 + +I.1 Extra evaluations on the CIFAR10 classification task 58 +I.2 Evaluating computation overhead in terms of wall time 59 +I.3 Experiments at a larger scale (64 machines) 61 + +# A. Additional related work + +# A.1. Byzantine-tolerant optimization: additional details + +In this section, we provide extra details on the related work discussed in Section 2.2. The summary of complexity results is presented in Table 2. + +# A.1.1. PARAMETER-SERVER (PS) BASED APPROACHES + +There is a quite large number of papers on Byzantine-tolerant optimization that aim to robustify parallel SGD in the case when a trusted parameter-server (PS) is available. Since in the classical parallel SGD even one Byzantine worker can break the convergence of the whole method by shifting the mean of the resulting vector in an arbitrary way, it is natural to substitute averaging of the vectors received from the workers by a more robust aggregation rule, e.g., Krum (Blanchard et al., 2017), coordinate-wise median, trimmed median (Yin et al., 2018), Multi-Krum (Damaskinos et al., 2019), Bulyan (El Mhamdi et al., 2018), geometric median (Pillutla et al., 2019). However, all these methods were shown to be brittle and not robust to special types of Byzantine attacks (Baruch et al., 2019; Xie et al., 2020; Karimireddy et al., 2020). Moreover, Karimireddy et al. (2020) show that all permutation-invariant algorithms cannot converge to any predefined accuracy of the solution, meaning that simple application of some aggregation rules on top of SGD does not lead to Byzantine tolerance. + +There are several approaches to circumvent this issue. Alistarh et al. (2018) propose ByzANTINESGD and prove the convergence results for convex problems. Allen-Zhu et al. (2021) extend this approach to handle non-convex problems as well. In both papers, the key idea is based on applying the concentration properties of the sums depending on the stochastic gradients as well as iterative removing of Byzantine peers. However, theoretical guarantees from Alistarh et al. (2018); Allen-Zhu et al. (2021) rely on the restrictive assumption that the noise in the stochastic gradients is uniformly bounded with probability 1. Bulusu et al. (2020) propose similar approach to the one from (Allen-Zhu et al., 2021) but analyze their method under more restrictive assumptions (boundedness of the gradient). Next, Wu et al. (2020) propose a Byzantine-tolerant version of parallel SAGA (Defazio et al., 2014), i.e., variance-reduced version of SGD, with geometric median as an aggregation rule — BYRD-SAGA – and prove its convergence for strongly convex objectives. However, the authors do not establish the convergence of BYRD-SAGA to any predefined accuracy of the solution. Moreover, variance-reduced methods are known to converge slowly in deep learning applications (Defazio & Bottou, 2019), which limits the practical utility of BYRD-SAGA. Finally, Karimireddy et al. (2020) propose a new aggregation rule called CENTEREDCLIP, apply it to SGD with client momentum, and prove convergence results for the obtained method in the non-convex case under reasonable assumptions. Alternative lines of work achieve Byzantine-tolerant optimization through redundant computations (Chen et al., 2018; Rajput et al., 2019) or reputation-based approaches (Rodriguez-Barroso et al., 2020; Regatti et al., 2020; Xu & Lyu, 2020). Unfortunately, these papers either do not contain theoretical (non-asymptotic) convergence results for the proposed methods or rely on too restrictive assumptions in the analysis. See more references in the recent survey by Lyu et al. (2020). + +# A.1.2. DECENTRALIZED APPROACHES + +Byzantine-tolerant optimization methods for decentralized communication architectures are studied only in a couple of papers. Yang & Bajwa (2019a;b) consider a specific scenario when workers compute full gradients, local loss functions on peers are heterogeneous, and the trimmed coordinate-wise median is used as an aggregation rule. In this setup, the authors prove convergence results in the strongly convex case to some accuracy depending on the heterogeneity level of local loss functions, which is natural in the presence of Byzantine peers. However, these results are not applicable to a wide range of practically important problems where stochastic gradients have to be used. This issue was partially resolved in Peng et al. (2021), where the authors propose a version of GossIP SGD applied to the equivalent reformulation of the original problem based on TV-regularization (Ben-Ameur et al., 2013). However, the established convergence results in the strongly convex case do not show any benefits of using communications with other workers in the homogeneous data regime that appears in large-batch training of deep learning models. Li et al. (2019) use the same idea for a parameter-server architecture. Next, there are approaches requiring peer-to-peer communications of full vectors at each step (Gupta et al., 2021; Gupta & Vaidya, 2021), which is not scalable. + +Table 2. Summary of the complexity results for Parameter-Server (PS) based and distributed Byzantine-tolerant optimization. The columns "Non-convex", "Convex", and "Strongly convex" contain the complexity bounds for $L$ -smooth non-convex, convex, and $\mu$ -strongly convex problems respectively. By complexity we mean the number of iterations sufficient to find such point $\widehat{x}$ that $\mathbb{E}[||\nabla f(\widehat{x})||^2] \leq \varepsilon^2$ for non-convex problems and $\mathbb{E}[f(\widehat{x}) - f(x^*)] \leq \varepsilon$ for convex and $\mu$ -strongly convex problems (see Def. E.2) with $x^*$ being the solution. For simplicity, we omit numerical factors, logarithmic terms depending on the parameters of the problem, and factors, quantifying suboptimality of the starting point, i.e., $R_0 = \| x^0 - x^*\|$ and $f(x^0) - \inf_{x \in \mathbb{R}^d} f(x)$ . Notation: $\delta = |B| / n$ , $m =$ number of peers checked at each iteration. The results from Yang & Bajwa (2019a;b) are not included since they rely on full-gradient computations. + +
Non-PS?WorkNon-convexConvexStrongly convex
X(Alistarh et al., 2018)(1),(2)X1/ε + σ2/nε2 + δ2σ2/ε21/μ + σ2/nμε + δ2σ2/με
(Allen-Zhu et al., 2021)(1),(3)1/nε4 + δ2/ε4XX
(Wu et al., 2020)(4)XXL2/μ2(5)
(Karimireddy et al., 2020)(6)1/ε2 + σ2/nε4 + δσ2/ε4XX
✓(Peng et al., 2021)(6),(7)XX1/με + nσ2/μ2ε + λ2dN2/μ2ε
This work(8)1/ε2 + σ2/nε4 + nδσ2/mε21/ε + σ2/nε2 + n√δσ/mε1/μ + σ2/nμε + n√δσ/m√με
This work(9)1/ε2 + σ2/nε4 + n2δσ2/mε21/ε + σ2/nε2 + n2δσ/mε1/μ + σ2/nμε + n2δσ/m√με
This work(10)X(GA1/ε)α/α-1(G2/μ1)α/2(α-1)
This work(11)X(GA2/ε)α/α-1(G2/με)α/2(α-1)
+ +(1) The results are proven under uniformly bounded noise assumption: $\| \nabla f(x, \xi) - \nabla f(x) \| \leq \sigma$ for all $x$ and $\xi$ . High-probability guarantees are established, i.e., it is proven that with probability at least $1 - \beta$ algorithms from (Alistarh et al., 2018) find $\hat{x}$ such that $f(\hat{x}) - f(x^{*}) \leq \varepsilon$ and algorithms from (Allen-Zhu et al., 2021) find $\hat{x}$ such that $\| \nabla f(\hat{x}) \| \leq \varepsilon$ . +(2) Dependencies on $\beta$ are logarithmic and, therefore, omitted. The optimization problems are assumed to be defined on a bounded set, the rates depend on the diameter of this set. +(3) The results are derived for the case $\sigma = 1$ . Allen-Zhu et al. (2021) also derive convergence guarantees for finding second-order stationary points. +(4) Wu et al. (2020) consider finite-sum case of (3), i.e., $f(x) = \frac{1}{N} \sum_{j=1}^{N} f(x, j)$ . The results are derived under the uniformly bounded variance (UBV) assumption: $\mathbb{E}_j[\| \nabla f(x, j) - \nabla f(x) \|^2] \leq \sigma^2$ for all $x \in \mathbb{R}^d$ , where $j$ is sampled uniformly at random from $\{1, \dots, N\}$ . Wu et al. (2020) also derive convergence guarantees under $\zeta$ -bounded dissimilarity assumption, i.e., when $f(x) = \frac{1}{|\mathcal{G}|} \sum_{i \in \mathcal{G}} f_i(x)$ , $f_i(x) = \frac{1}{N} \sum_{j=1}^{N} f_i(x, j)$ for all $i \in \mathcal{G}$ , and $\frac{1}{|\mathcal{G}|} \sum_{i \in \mathcal{G}} \| \nabla f_i(x) - \nabla f(x) \|^2 \leq \zeta^2$ . +(5) This result is obtained the main result of (Wu et al., 2020) and states that the method from (Wu et al., 2020) finds $\hat{x}$ such that $f(\hat{x}) - f(x^{*})\leq \varepsilon$ only for $\varepsilon \geq \sigma^2 /\mu^2 (\frac{1}{2} -\delta)^2$ , which can be large. +(6) The result is derived under the UBV assumption, i.e., $\mathbb{E}_{\xi \sim \mathcal{D}}[\| \nabla f(x,\xi) - \nabla f(x)\| ^2 ]\leq \sigma^2$ for all $x\in \mathbb{R}^d$ +(7) Peng et al. (2021) consider the case, when peers are allowed to communicate with their neighbors that are defined via some communication graph. The result establishes the total number of iterations/communication rounds needed to find $\hat{x}$ such that $\mathbb{E}\|\hat{x} - x^{*}\|^{2} \leq \varepsilon$ for $\varepsilon \geq \frac{\lambda^{2}d}{\mu^{2}} \sum_{i \in \mathcal{G}} |\mathcal{B}_{i}|^{2}$ , where $\lambda \geq 0$ is any non-negative number and $\mathcal{B}_{i}$ is the set of Byzantine peers neighboring with the $i$ -th peer. In the complexity result, we use the notation $\overline{N}^{2} = \sum_{i \in \mathcal{G}} (|\mathcal{G}_{i}|^{2} + |\mathcal{B}_{i}|^{2})$ , where $\mathcal{G}_{i}$ is the set of good neighbors of the $i$ -th peer. When $\lambda = 0$ , the workers do not communicate at all. Moreover, Peng et al. (2021) analyze the case of heterogeneous local functions, composite optimization problems and time-varying setup but in that case $\lambda$ is lower bounded by a strictly positive quantity depending on the heterogeneity level and minimal non-zero singular value of the node-edge incidence matrix, i.e., any predefined accuracy cannot be achieved. +(8) The results are derived for BTARD-SGD (in the strongly convex case, for RESTARTED-BTARD-SGD) under Assumptions 3.1 and 3.2 in the case when the exact number of attacking Byzantine workers at iteration $k$ is known to each participant. See Theorems E.2, E.4, and E.6. +(9) The results are derived for BTARD-SGD (in the strongly convex case, for RESTARTED-BTARD-SGD) under Assumptions 3.1 and 3.2. See Theorems E.3, E.5, and E.7. +(10) The results are derived for BTARD-CLIPPED-SGD (in the strongly convex case, for RESTARTED-BTARD-CLIPPED-SGD) under Assumption E.1 without any additional assumptions on the tails of the distribution. Moreover, it is assumed that the exact number of attacking Byzantine workers at iteration $k$ is known to each participant. See Theorems E.8 and E.10. In the complexity results, we use the notation $\Lambda_1 = 1 + \frac{n\sqrt{\delta}}{m}$ . +(11) The results are derived for BTARD-CLIPPED-SGD (in the strongly convex case, for RESTARTED-BTARD-CLIPPED-SGD) under Assumption E.1 without any additional assumptions on the tails of the distribution. See Theorems E.9 and E.11. In the complexity results, we use the notation $\Lambda_{2} = 1 + \frac{n^{2}\delta}{m}$ . + +Finally, El-Mhamdi et al. (2020) propose an algorithm based on the usage of multiple servers. The authors assume that both workers and servers can be Byzantines, which is a realistic scenario. However, their approach requires the workers to send their gradients to all servers at each iteration and receive parameters from all servers as well. This leads to a significant communication overhead in practice. Moreover, El-Mhamdi et al. (2020) do not provide non-asymptotic convergence rates, making it problematic to provide an in-depth comparison with existing works and with our results as well. Therefore, it is unclear whether the usage of multiple servers speeds up training or it just leads to overhead in the communications and computations. + +In contrast, our results do benefit from the communications between workers. First of all, as one can see from Table 2, the terms depending on the fraction $\delta$ of Byzantine peers in our complexity bounds for BTARD-SGD and RESTARTED-BTARD-SGD (the third terms) have better dependence on the target accuracy $\varepsilon$ than the corresponding terms in the complexity bounds from all previous works (even from those relying on the existence of a PS). Moreover, for sufficiently small $\varepsilon$ these terms in our complexity results are smaller than the second terms, which correspond to the main term in the complexity of parallel SGD. That is, BTARD-SGD/RESTARTED-BTARD-SGD applied to the problem with Byzantine peers has convergence guarantees that are not worse than the corresponding guarantees for parallel SGD applied to the problem without any Byzantine workers. In such regimes, our theoretical convergence results outperform even ones derived for PS-based algorithms. + +We notice that Assumptions 3.1 and 3.2 used in the analysis of BTARD-SGD/RESTARTED-BTARD-SGD are slightly stronger than uniformly bounded variance assumption used in (Wu et al., 2020; Karimireddy et al., 2020; Peng et al., 2021). However, as we explain in Appendix E.3.1, our analysis allows to relax Assumptions 3.1 to uniformly bounded variance assumption, and Assumption 3.2 is reasonable for many practically important problems. Finally, we also propose and analyze BTARD-CLIPPED-SGD and RESTARTED-BTARD-CLIPPED-SGD under Assumption E.1 that may hold even in the case of unbounded variance of the stochastic gradient. To the best of our knowledge, this is the first time in the literature on the Byzantine-tolerant optimization when the complexity results are obtained without assuming boundedness of the stochastic gradient's variance. + +# A.2. Multi-party random number generators: additional details + +Many distributed systems may benefit from the multi-party random number generators (MPRNG) where a group of malicious peers would have little influence (bias) on the generator output. MPRNGs are usually based on multi-party coin tossing protocols, such as the protocol from Blum (1983). As an example, MPRNG allows to choose a participant winning a lottery or choose a peer whose calculations are going to be validated by other peers to detect possible cheating. + +While Blum (1983) formally introduces a protocol for one bit and two parties, its generalization to multiple bits and parties (as necessary for MPRNG) is trivial assuming the presence of the broadcast channel. This modification is widely known in literature, e.g., described in Zhang et al. (2019). According to this generalization, peers should execute the following protocol to obtain $k$ random bits (see the intuitive scheme in Figure 5): + +1. Each peer generates its own random string $x_{i}$ made of $k$ bits. +2. Each peer broadcasts commitment $h_i = h(i||x_i||s_i)$ , where $||$ denotes concatenation, $h(x)$ is a common cryptographic hash function, $i$ is the peer's unique identifier (known by other peers), and $s_i$ is a large random string. +3. Peers wait until all of them finish broadcasting the commitments. After that, no peer can alter its $x_{i}$ to influence the protocol output (otherwise, peers would notice that the new value $x_{i}'$ does not match the commitment). +4. Each peer reveals their random string by broadcasting its $x_{i}$ and $s_{i}$ . +5. Each peer verifies that all other peers revealed values $x_{j}$ and $s_j$ that match their commitments $h_j = h(j||x_j||s_j)$ . +6. If a peer detects that peer $j$ aborted the procedure or its commitment does not match its revealed values, it concludes that we cannot trust peer $j$ . Since other peers read the same broadcast channel, all of them can make the same conclusion. In this case, the system repeats the protocol. +7. If peers do not detect any mismatches, they calculate the protocol output $x = x_{1} \oplus \ldots \oplus x_{n}$ , where $\oplus$ denotes the bitwise XOR operation. + +![](images/5050249f678a104404fdf5c62d93ef941a81476e78843f73f638d736494b5f2b.jpg) +Figure 5. A scheme of MPRNG based on the generalization of Blum (1983). Here, $||$ denotes concatenation, $\oplus$ denotes bitwise XOR, $h(x)$ is a common cryptographic hash function. The hashed values include the peer identifier $i$ to protect from the replay attacks and a large random string $s_i$ to resist the dictionary attacks. + +In this protocol, the commitments include the peer identifier $i$ to protect from replay attacks (when an attacker repeats someone else's message) and the large random string $s_i$ to resist dictionary attacks (when an attacker reverses the hash function using a large dictionary of its values). + +While there are MPRNGs (Rabin & Ben-Or, 1989) with a negligible bias for the case when more than a half parties are honest (assuming the presence of the broadcast channel), Cleve (1986) proves that it is impossible to reach the negligible bias for the case of dishonest majority, which may be reached in practice with the Sybil attacks. + +However, we note that the bias in Blum (1983) (and its modification above) appears only in the case when an attacker learns the result earlier than other peers and forces the protocol to be repeated. If we are using MPRNG to choose a peer that to be checked for cheating, we may ban all peers that aborted the procedure and restart from scratch without them, therefore eliminating the bias problem. + +# B. Synchronization points and computation overhead of BTARD-SGD + +Synchronization points. An important aspect of BTARD performance is synchronization. The naive implementation of Algorithm 1 would have many global synchronization "barriers" per step: one for aggregating gradients, another for choosing a random direction $z$ , yet another for electing invalidators, etc. These frequent synchronizations could undermine the practical training performance of BTARD in high-latency networks, such as when training over the Internet. + +Fortunately, it is possible to reduce the number of synchronizations by bundling them together. For instance, peers use a single MPRNG round for sampling $z$ and for electing placeholders. Furthermore, this MPRNG round and subsequent checks can be done in background, while a peer accumulates gradients for the next step. The only restriction is that this "shared" MPRNG round must be performed after all peers declare their checksums for that round. + +With these optimizations, BTARD-SGD requires only two points of synchronization per round. The first one occurs right before gradient aggregation, and the second one is in a background task that performs verifications. Finally, there is a non-regular need for synchronization when one peer accuses another of being Byzantine. However, as we elaborated earlier, each accusation will result in at least one Byzantine being banned. Therefore, this additional cost will occur only a limited number of times over the training run. + +Computation overhead. In terms of computation, BTARD-SGD introduces two main overheads: from processors and CENTEREDCLIP respectively. As we have shown empirically in Section 4 and Appendix I, both BTARD-SGD and BTARD-CLIPPED-SGD can withstand even attacks with 7 out of 16 peers being Byzantine using only 1-2 processors randomly chosen from 16 peers. As such, the computation overhead for validation is no more than $\frac{1}{8}$ of the total compute. + +As for the CENTEREDCLIP, our algorithm executes the same amount of computation as the original CENTEREDCLIP (Karimireddy et al., 2020), except that now the extra load is distributed evenly across all peers. We provide an empirical evaluation of such overhead in Appendix I.2. + +Finally, we note that generating a shared vector $z$ from a scalar seed $r^t$ (as defined in Algorithm 1) has a negligible cost and can be done with any standard pseudo-random number generator. For instance, generating $z$ for ALBERT-large (the setup from Section 4.2) takes $30 \pm 1.2$ ms on the same T4 GPU that we use in our experiments. + +# C. Overview of attack vectors + +In Section 3.2, we have outlined the four types of Byzantine attacks that can affect BTARD-SGD. Here, we analyze each of these types in detail and provide a list of attacks that fit these types. + +Gradient attacks. This attack vector encompasses all attacks where Byzantine peers replace their true gradients with something else, but otherwise act normally. With this attack, $b$ Byzantine peers can collectively shift the outputs of CENTEREDCLIP by up to $\tau \cdot b / n$ in any chosen direction. However, since Byzantine peers will need to commit hash of their incorrect gradients, every honest validator can accuse one of these peers with probability $b / n$ . + +Aggregation attacks. A similar, but opposite attack type can be attempted when a Byzantine peer performs gradient aggregation. Instead of honestly computing CENTEREDCLIP, an attacker may modify the returned vector to incorporate the same kinds of changes as in gradient attacks (see above). This time, the maximum difference that can be applied through such attacks is larger, but it only affects $b / n$ of vector coordinates that are aggregated by Byzantines. + +Done naively, such attacks can be detected and banned by the gradient checksum (see L15-17 in Algorithm 1). In order to ensure that the above check passes, Byzantines can misreport their $s_i^j$ in such a way that $\sum_{i} s_i^j = 0$ . However, since actual $s_i^j$ depend only on $g_i^k$ and $\hat{g}^k$ , these values can be verified by the chosen placeholders, and, in case of mismatch, reported via ACCUSE. We rigorously prove this in Appendix D.5. + +Furthermore, if an honest validator finds that a certain peer has broadcast incorrect $s_i^j$ , the validator can simultaneously accuse the corresponding Byzantine aggregator $j$ that should have notified about the incorrect $s_i^j$ (see L12-14 in Algorithm 1). + +Reputation abuse. Since BTARD-SGD provides means by which benign participants can ban Byzantine attackers, it is important to ensure that the same means cannot be exploited by Byzantine peers to eliminate benign ones or otherwise abuse the system. There are three potential attack vectors that fit this description: + +- Falsely accusing a benign peer, +- Persistently calling the ACCUSE procedure to slow down training, +- Automatically approving gradients without actual validation, + +In BTARD-SGD, we protect against slander (issues 1. and 2.) by the design of ACCUSE protocol, by which a peer that initiates false allegations will itself be banned. As such, Byzantines can only invoke ACCUSE protocol a limited number of times before they are all permanently banned. + +In turn, the attack vector (3.) is more effective: if one Byzantine was chosen as validator for another Byzantine, they can automatically report successful validation without negative consequences for either of them. However, since all validators are chosen through MPRNG, an attacker has no way of predicting whether its validator will be benign or Byzantine. Thus, any malicious activity will always have a chance of being caught by an honest validator. + +Protocol violations. Finally, a Byzantine attacker can deviate from the protocol prescribed by BTARD-SGD in simpler ways ways, for instance: + +1. Not committing the hash of its gradient when required by 6, +2. Not sending data to a particular peer when required (or sending data twice), +3. Deliberately broadcasting a hash that mismatches the subsequently sent data, +4. Sending metadata (e.g. gradient norm) that is inconsistent with previously sent gradient part, +5. Sending $s_i$ that is inconsistent with previously sent gradient, +6. Not validating when chosen as validator, validating when not chosen, or validating a different peer than was chosen by BTARD-SGD. + +For protocol deviations that are visible to all benign participants, such as in (1.) or (6.), benign peers can ban the offender instantaneously. However, this is not the case for attacks such as (2.), where the deviation is only visible to one or few peers. + +As described earlier in Section 3.2, we address this issue with a special procedure that allows any peer to ban any other peer at the cost of also being banned. Thus, if an attacker sends inconsistent gradients, norms or inner products to only one benign peer, that peer can still get the attacker banned even though it wouldn't be able to call ACCUSE. + +Protecting from attacks 3, 4 and 5 from the above list also relies on this mutual elimination procedure. Specifically, if an attacker sends provably incorrect data to a benign peer, that peer will immediately trigger the mutual elimination procedure. The only exception to this rule is if one Byzantine peer sends incorrect data to another Byzantine peer: this behavior is neither punishable nor, in itself, harmful. In turn, the mutuality of this elimination procedure prevents potential misuse by Byzantines: if an attacker decides to ban someone through this procedure, that attacker will also be banned. + +# D. Detailed algorithm description + +In this section, we provide more formal versions of the BTARD (Alg. 6) and BTARD-SGD (Alg. 7) algorithms, as well as auxiliary subroutines and further details. We describe our approach in a bottom-up manner. + +# D.1. Basic building blocks + +We begin with a glossary of basic functions used in the algorithms: + +- broadcast $m$ — broadcast the message $m$ to all other peers using GossipSub (Vyzovitis et al., 2020) and receive for the respective messages of other peers. $m$ should be signed by the sender's private key (Rivest et al., 1978) before sending. A receiver should ignore messages with an invalid signature and ban a peer in case of receiving two contradicting messages signed by it (e.g., two different hashes for the same iteration and the same stage of the algorithm). +- $\mathrm{SPLIT}(v, n)$ — split vector $v$ of size $d$ into $n$ parts. The first $d \mod n$ parts are of size $\lceil d / n \rceil$ and the remaining parts have size $\lfloor d / n \rfloor$ . +- $\mathrm{MERGE}(v_1, \ldots, v_n)$ — concatenate vectors $v_1, \ldots, v_n$ into one. +- $\mathrm{BAN}(\mathrm{peer}_j)$ — add peer $j$ to a local blacklist, ignore any subsequent messages from that peer, and continue training without it. Note that the honest peers do not need to explicitly coordinate on their decisions to ban someone, because these decisions are made using the broadcasted data only. +- CHECKCOMPUTATIONS $(j)$ or VALIDATEPEER — run COMPUTEGRADIENTS $(x^t, \xi_j^t)$ and compare against the $c_j, h_j^*, s_j^*$ broadcasted by that peer. If there is mismatch, ACCUSE. + +# D.2. CenteredClip and verification of its results + +An important building block of BTARD is CENTEREDCLIP – a robust aggregation rule proposed in Karimireddy et al. (2020). Unlike a number of other aggregation rules as coordinate-wise median, Krum, geometric median, CENTEREDCLIP is provably robust against Byzantine attacks (see Theorem III from Karimireddy et al. (2020) and Lemma E.1). + +Let $\mathcal{G}$ be the set of good peers, $\mathcal{B}$ be the set of Byzantine workers, and, for simplicity, let $[n] = \mathcal{G} \sqcup \mathcal{B}$ , $|\mathcal{B}| = \delta n \leq \delta_0 n < n/2$ . Assume that we have $n$ random vectors $x_1, \ldots, x_n$ , such that $\forall i, j \in \mathcal{G}$ + +$$ +\mathbb {E} [ x _ {i} ] = \mathbb {E} [ x _ {j} ] = x, \quad \mathbb {E} [ \| x _ {i} - x _ {j} \| ^ {2} ] \leq \sigma^ {2}, +$$ + +and for all $i \in \mathcal{B}$ vectors $x_{i}$ can be arbitrary. CENTEREDCLIP works as follows: it is an iterative procedure generating a sequence $\{v_{l}\}_{l \geq 0}$ satisfying + +$$ +v ^ {l + 1} = v ^ {l} + \frac {1}{n} \sum_ {i = 1} ^ {n} \left(x _ {i} - v ^ {l}\right) \min \left\{1, \frac {\tau_ {l}}{\| x _ {i} - v ^ {l} \|} \right\}, \quad \text {(C e n t e r e d C l i p)} +$$ + +where + +$$ +\tau_ {l} = 4 \sqrt {\frac {(1 - \delta) \left(B _ {l} ^ {2} / 3 + \sigma^ {2}\right)}{\sqrt {3} \delta}}, \quad B _ {l + 1} ^ {2} = 6. 4 5 \delta B _ {l} ^ {2} + 5 \sigma^ {2}. \tag {5} +$$ + +Intuitively, CENTEREDCLIP behaves like the mean for all points within the sphere of radius $\tau$ and like the median for "outliers". In turn, choosing different values of $\tau$ allows one to smoothly interpolate between the mean ( $\tau \rightarrow \inf$ ) and the geometric median ( $\tau \rightarrow 0$ ) aggregation rules. + +The goal of this procedure is natural: find good enough approximation $\widehat{x}$ of $\overline{x} = \frac{1}{|\mathcal{G}|}\sum_{i\in \mathcal{G}}x_i$ . Karimireddy et al. (2020) show that, for $\delta \leq 0.1$ , the sequence $\{v_l\}_{l\geq 0}$ generated by CENTEREDCLIP satisfies + +$$ +\mathbb {E} \left[ \| v ^ {l} - \bar {x} \| ^ {2} \right] \leq (9. 7 \delta) ^ {l} 3 \mathbb {E} \left[ \| v _ {0} - \bar {x} \| ^ {2} \right] + 4 0 0 0 \delta \sigma^ {2}. \tag {6} +$$ + +Moreover, Karimireddy et al. (2020) prove that for all possible aggregation rules producing $\widehat{x}$ and given $\delta_0$ , $\sigma$ there exists such set of vectors $x_{1},\ldots ,x_{n}$ and such a partition $[n] = \mathcal{G}\sqcup \mathcal{B}$ that + +$$ +\mathbb {E} [ \| \widehat {x} - \overline {{x}} \| ^ {2} ] = \Omega (\delta \sigma^ {2}). +$$ + +Therefore, CENTEREDCLIP can be seen as an optimal aggregation rule neglecting numerical constants. The usage of CENTEREDCLIP helps the good peer $i$ to produce a good enough approximation of the ideal average of the $i$ -th parts of stochastic gradients among good peers in BTARD. + +Moreover, since $\delta \leq 0.1$ we have that $6.45\delta \leq 0.645$ implying that $B_{l}^{2}\rightarrow B^{2}\sim \sigma^{2}$ when $l\to \infty$ , and $\tau_l\rightarrow \tau \sim \sqrt{\sigma^2 / \delta}$ . These limits can be easily computed from (5). Next, for $l\to \infty$ CenteredClip converges to the solution of the following equation: + +$$ +\sum_ {i = 1} ^ {n} \left(x _ {i} - v\right) \min \left\{1, \frac {\tau}{\| x _ {i} - v \|} \right\} = 0. \tag {7} +$$ + +In other words, CenteredClip for large enough $l$ approximates the fixed-point iteration process of solving (7). This property plays a key role in Verification 2 of BTARD. + +# D.3. Protocols for banning Byzantine peers + +ACCUSE and ELIMINATE are the two protocols by which peers ban Byzantine attackers from training. The ACCUSE protocol is only invoked if there the malicious activity of the target peer can be proven to others. We detail the exact mechanism in Algorithm 4, which is a formal version of Algorithm 3 from Section 3.1. + +In contrast, ELIMINATE is a mechanism that allows any peer $i$ to ban any other peer $j$ from training without proof — but at the cost of peer $i$ also being banned. We have described this protocol earlier as a countermeasure for protocol violations (see Appendix C). + +Both $\mathrm{ACCUSE}(i,j)$ and $\mathrm{ELIMINATE}(i,j)$ imply that peer $i$ uses the broadcast channel to declare its intent to ban peer $j$ . Since the broadcast channel does not guarantee the order of receiving these messages, peers should collect all of them during a training step and process them at the end of the step in some specific order (e.g. sorted by (type, public_key_i, public_key_j), where type $\in$ {ACCUSE, ELIMINATE} and $\mathrm{ACCUSE} < \mathrm{ELIMINATE}$ ). If processing one of the messages results in banning peer $p$ , further messages involving $p$ are ignored regardless of the $p$ 's role. + +This way, it is impossible for a Byzantine to eliminate more than one honest peer along with itself. Peers reach consensus since their decisions on banning someone are based solely on the messages from the broadcast channel (sorted in the common order) and the calculations with identical results. + +Algorithm 4 ACCUSE (i, j), the formal version of Algorithm 3 +Input: accuser $i$ target $j$ , peer count $n$ , all values exchanged in Algorithm 6 +1: Recalculate $g_{j}^{k} = \mathrm{COMPUTERADIENTS}(x^{k},\xi_{j}^{k})$ +2: Split gi into n parts: $g_{i} = (g_{i}(1)^{\top},\dots,g_{i}(n)^{\top})^{\top}$ $g_{i}(j)\in \mathbb{R}^{d_{j}}$ for all $j\in [n]$ +3: +4: for $l = 1\dots n$ do +5: if hash $(g_j^k)\neq c_j^k$ or hash $(g_j^k (l))\neq h_j^l$ then +6: $\mathrm{BAN}(\mathrm{peer}_j)\quad //$ For gradient attack +7: +8: $\Delta_l^j = (g_l(j) - \widehat{g} (j))\cdot \min \left\{1,\frac{\tau}{\|g_l(j) - \widehat{g} (j)\|_2}\right\}$ +9: if $\| g_{j}(l) - \widehat{g} (l)\|_{2}\neq \mathrm{norm}_{jl}$ or $\langle \Delta_l^j,z_j\rangle \neq s_l^j$ or $\sum_{l = 1}^{n}s_l^j\neq 0$ then +10: $\mathrm{BAN}(\mathrm{peer}_j)\quad //$ For aggregation attack +11: for $o = 1,\ldots ,n$ do +12: if peer o approved normjo or $s_j^o$ then +13: $\mathrm{BAN}(\mathrm{peer}_o)\quad //$ for covering up the $j$ -th peer's aggregation attack + +# D.4. ButterflyClip + +Algorithm 5 provides details on peer-to-peer communication conducted during a BTARD aggregation step. It was outlined earlier in Algorithm 2 from Section 3.1. For simplicity, we assume (here and below) that workers run each line in a synchronous manner (e.g. wait for all peers to broadcast $\mathrm{hash}(g_i)$ before communicating the actual gradients). In practice, this restriction can be lifted in favor of asynchronous steps with several explicit synchronization barriers, but that would further complicate the pseudo-code. + +Algorithm 5 BUTTERFLYCLIP for peer $i$ , the formal version of Algorithm 2 +Input: rank $i$ gradients $g_{i}\in \mathbb{R}^{d}$ +1: Split $g_{i}$ into $n$ parts: $g_{i} = (g_{i}(1)^{\top},\dots ,g_{i}(n)^{\top})^{\top}$ $g_{i}(j)\in \mathbb{R}^{d_{j}}$ for all $j\in [n]$ +2: +3: for $j = 1,\ldots ,n$ do +4: broadcast $c_{i}(j) = \mathrm{hash}(g_{i}(j))$ +5: Send $g_{i}(j)$ to peer $j$ for all $j\neq i$ +6:Receive $g_{j}(i)$ from peer $j$ for all $j\neq i$ +7: for $j = 1,\ldots ,n$ do +8: if hash $(g_j(i))\neq c_j(i)$ then +9: ELIMINATE(i,j // Signed with peer $i$ private key +10: +11: $\widehat{g} (i) =$ CENTEREDCLIP $(g_1(i),g_2(i),\dots ,g_n(i))$ +12: +13: broadcast $\widehat{c} (i) = \mathrm{hash}(\widehat{g} (i))$ +14: Send $\widehat{g} (i)$ to each worker +15: Receive $\widehat{g} (j)$ for all $j\neq i$ from other workers +16: for $j = 1,\ldots ,n$ do +17: if hash $(\widehat{g} (j))\neq \widehat{c} (j)$ then +18: ELIMINATE(i,j // Signed with peer $i$ private key +19: +20: return MERGE $(\widehat{g} (1),\dots ,\widehat{g} (n))$ + +# D.5. Byzantine-tolerant All-Reduce and its verification procedures + +Algorithm 6 defines a single gradient aggregation step with additional verification procedures needed to reduce the negative influence of Byzantine peers. We explain the motivation for each of these procedures below. + +Algorithm 6 Byzantine-Tolerant All-Reduce (BTARD) +Input: number of workers $n$ , gradient vectors on the workers $g_{1}, g_{2}, \ldots, g_{n} \in \mathbb{R}^{d}$ , $d > n$ , $\Delta_{\max} > 0$ - parameter for Verification 3 +1: for workers $i = 1, \ldots, n$ in parallel do +2: $\widehat{g} = \text{BUTTERFLYCLIP}(i, g_{i})$ // Described in Algorithm 5 +3: +4: Send metadata for verification: +5: Generate $r$ via MPRNG +6: $z = \text{GETRANDOMVECTOR}(r)$ +7: for $j \in 1, \ldots, n$ do +8: $\Delta_{i}^{j} = (g_{i}(j) - \widehat{g}(j)) \cdot \min \left\{1, \frac{\tau}{||g_{i}(j) - \widehat{g}(j)||_{2}}\right\}$ +9: broadcast $s_{i}^{j} = \langle z[j], \Delta_{i}^{j} \rangle$ +10: broadcast norm $_{ij} = ||g_{i}(j) - \widehat{g}(j)||_{2}$ +11: for $l = 1, \ldots, n$ do +12: $w_{lj} = \min \left\{1, \frac{\tau}{\text{norm}_{lj}}\right\}$ +13: +14: for $j = 1, \ldots, n$ do +Verification 1: +if norm $_{ji} \neq ||g_{j}(i) - \widehat{g}(i)||_{2}$ then +17: broadcast norm $_{ji}$ does not match $c_{j}(i)$ // All recipients should run ACCUSE $(i, j)$ (Algorithm 4) +18: +Verification 2: +// Peer $i$ knows $\Delta_{j}^{i}$ from CenteredClip +if $s_{j}^{i} \neq \langle z^{k}[j], \Delta_{j}^{i} \rangle$ then +12: broadcast $s_{i}^{j}$ does not match $c_{j}(i)$ // All recipients should run ACCUSE $(i, j)$ (Algorithm 4) +if $\sum_{i}^{n} s_{i}^{j} \neq 0$ then +// Peer $j$ lied that all $s_{i}^{j}$ are correct +broadcast $\widehat{g}(j)$ is wrong // All recipients should run ACCUSE $(i, j)$ (Algorithm 4) +Verification 3: +broadcast check $_{ij} = [||g_{i}(j) - \widehat{g}(j)||_{2} > \Delta_{\max}]$ +if $\sum_{l} check_{lj} > \frac{n}{2}$ then +CHECKAVERAGING $(j)$ + +Verifications 1 and 2. While good peers always run CENTEREDCLIP, Byzantine peers can arbitrary violate the protocol meaning that they can send an arbitrary vector instead of sending the result of CENTEREDCLIP. Verification 1 and 2 are needed to prevent such violations and make it possible to identify them during the check of computations. + +First of all, both verifications are split into 2 rounds in order to let the aggregators of the corresponding part accuse those peers who send inconsistent norms or inner products. Next, in theory, we assume that all good peers find exactly the solution of CENTEREDCLIP equation (7). Therefore, it is possible to compute the weights from (7) for each worker $i$ and each component $j$ knowing only a norm of the difference of corresponding vectors, i.e., one can compute $\min \{1, \frac{\tau}{\|g_i(j) - \widehat{g}(i)\|} \}$ by $\| g_i(j) - \widehat{g}(i) \|$ . That is, if Byzantine peer $i$ sends $\text{norm}_{ij} \neq \| g_i(j) - \widehat{g}(j) \|$ , it will be either revealed by $j$ -th worker if $j \in \mathcal{G}$ or it will be revealed with some probability during the subsequent checks of computations. + +However, Verification 1 is insufficient to prevent malicious behavior: at iteration $k$ Byzantine peer can send $g_{i}^{k}(j)$ such that $\| g_{i}^{k}(j) - \widehat{g}^{k}(j)\| = \| \nabla_{(j)}f(x^{k},\xi_{i,k}) - \widehat{g}^{k}(j)\|$ . If $j\in \mathcal{B}$ , then it can be the case that $i$ -th worker commits the hash of $\nabla_{(j)}f(x^k,\xi_{i,k})$ and the check of gradient computation will not identify the violation of the protocol. That is why, Verification 2 is required. + +GETRANDOMVector is a function that generates a random unit vector $z$ in the space of model parameters. This vector is based on a random seed $r$ obtained from MPRNG. + +The goal of Verification 2, is to check that CENTEREDCLIP equation (7) holds for the received vector. The idea is simple: if + +$$ +\sum_ {l = 1} ^ {n} \left(g _ {l} (i) - \widehat {g} (i)\right) \min \left\{1, \frac {\tau}{\| g _ {l} (i) - \widehat {g} (i) \|} \right\} = 0, \tag {8} +$$ + +then for any $z_{i}$ of an appropriate dimension + +$$ +\sum_ {l = 1} ^ {n} \left\langle g _ {l} (i) - \widehat {g} (i), z _ {i} \right\rangle \min \left\{1, \frac {\tau}{\| g _ {l} (i) - \widehat {g} (i) \|} \right\} = 0. \tag {9} +$$ + +Since $z_{i}$ in BTARD is generated from the uniform distribution on the unit Euclidean sphere, we have + +$$ +\mathbb {P} \left\{\text {(8) d o e s n o t h o l d} \quad \& \quad \text {(9) h o l d s} \right\} = 0. \tag {10} +$$ + +However, it is impossible to verify (9) explicitly for workers $j \neq i$ . Therefore, in the algorithm, good workers check + +$$ +\sum_ {l = 1} ^ {n} s _ {l} ^ {i} = 0, \quad \text {w h e r e} s _ {l} ^ {i} = \left\{ \begin{array}{l l} \langle g _ {l} (i) - \widehat {g} (i), z _ {i} \rangle \min \left\{1, \frac {\tau}{\| g _ {l} (i) - \widehat {g} (i) \|} \right\}, & \text {i f} l \in \mathcal {G}, \\ * , & \text {i f} l \in \mathcal {B}. \end{array} \right. \tag {11} +$$ + +Unfortunately, Byzantine peers can send arbitrary $s_l^i$ . This can lead to the situations when (11) holds while (9) and, as a consequence, (8) do not. Below, we rigorously show that all possible violations of the protocol that are not detected by verifications of BTARD can be detected by the auxiliary check of computations with some probability. + +Verification 3. This is an additional verification that serves to limit the potential scope of aggregation attacks (as described in Appendix C). If the result of CenteredClip landed far from too many benign participants, BTARD will verify it by re-running the same aggregation across all peers. While this procedure is costly, our analysis proves that it is has a very small probability of triggering unless some of the peers perform aggregation attacks. In the latter case, verifying the gradient accumulation will root out such attacks and ban the corresponding peers. + +Check of computations. As we mentioned earlier, it is possible to violate the protocol without being detected by the verifications of BTARD. Therefore, extra checks of computations are required. In particular, after each aggregation in BTARD-SGD $2m$ workers are selected uniformly at random: $m$ workers check the computations at the previous step of other $m$ workers. That is, each Byzantine peer is checked at iteration $k$ with probability $\sim m/n$ by some good worker (see the proof of Thm. E.2). Consider an arbitrary Byzantine peer $j$ and all possible violations of the protocol at iteration $k$ that are not detected by verifications of BTARD. + +First of all, we notice that if $c_{j}(i) \neq \mathrm{hash}(\nabla_{(i)}f(x^{k},\xi_{j,k}))$ , then it will be detected during the check of computations with some probability8. Moreover, if $i \in \mathcal{G}$ , then $j$ -th worker has to send $c_{j}(i) = \mathrm{hash}(g_{j}(i))$ to avoid ban. + +Therefore, the only non-trivial case is when $i \in \mathcal{B}$ as well. In this case, $j$ -th worker can commit $c_{j}(i) = \mathrm{hash}(\nabla_{(i)}f(x^{k},\xi_{j,k}))$ since it is meaningless for $i$ -th worker to accuse $j$ -th one. Since $\mathrm{norm}_{ij}, s_i^j$ and $\widehat{g}(i)$ are known for all $i$ and $j$ , $j$ -th worker has to broadcast $\mathrm{norm}_{ji} = \| \nabla_{(i)}f(x^k,\xi_{j,k}) - \widehat{g}(i)\|$ and $s_j^i = \langle \nabla_{(i)}f(x^k,\xi_{j,k}) - \widehat{g}(i), z_i \rangle$ min $\left\{1, \frac{\tau}{\|\nabla_{(i)}f(x^k,\xi_{j,k}) - \widehat{g}(i)\|}\right\}$ to avoid the ban during the check of the computations. Therefore, regardless to the choice $g_{j}(i)$ , to pass Verification 2 $i$ -th worker should send such $\widehat{g}(i)$ that + +$$ +\sum_ {l \in \mathcal {G} \cup \{j \}} \langle \nabla_ {(i)} f (x ^ {k}, \xi_ {l, k}) - \widehat {g} (i), z _ {i} \rangle \min \left\{1, \frac {\tau}{\| \nabla_ {(i)} f (x ^ {k} , \xi_ {l , k}) - \widehat {g} (i) \|} \right\} + \sum_ {l \in \mathcal {B} \setminus \{j \}} s _ {l} ^ {i} = 0. +$$ + +In this case, the behavior of the $j$ -th worker along $i$ -th component is equivalent to the behavior of the good one. It means, that to avoid ban during the check of computations, each Byzantine worker $l$ should broadcast $\mathrm{norm}_{li} = \|\nabla_{(i)}f(x^k,\xi_{l,k}) - \widehat{g}(i)\|$ + +and $s_l^i = \langle \nabla_{(i)}f(x^k,\xi_{l,k}) - \widehat{g} (i),z_i\rangle$ min $\left\{1,\frac{\tau}{\|\nabla_{(i)}f(x^k,\xi_{l,k}) - \widehat{g}(i)\|}\right\}$ implying that $i$ -th worker should send such $\widehat{g} (i)$ that + +$$ +\sum_ {l = 1} ^ {n} \langle \nabla_ {(i)} f (x ^ {k}, \xi_ {l, k}) - \widehat {g} (i), z _ {i} \rangle \min \left\{1, \frac {\tau}{\| \nabla_ {(i)} f (x ^ {k} , \xi_ {l , k}) - \widehat {g} (i) \|} \right\} = 0. +$$ + +In view of (10), it implies that + +$$ +\widehat {g} (i) = \mathbf {C e n t e r e d C l i p} (\nabla_ {(i)} f (x ^ {k}, \xi_ {1, k}), \nabla_ {(i)} f (x ^ {k}, \xi_ {2, k}), \ldots , \nabla_ {(i)} f (x ^ {k}, \xi_ {2, k})), +$$ + +i.e., there are no violations of the protocol along the $i$ -th component. + +# D.6. BTARD-SGD training loop + +Finally, Algorithm 7 combines all procedures above into a training loop for secure decentralized SGD. Algorithms 6-7 represent a formal version of Algorithm 1 from Section 3.1. + +Algorithm 7 BTARD-SGD, the formal version of Algorithm 1 +Input: $x^0$ - starting point, $\gamma$ - stepsize, $K$ - number of iterations, $\{s_{i,k}\}_{i,k=0,0}^{n,K-1}$ - seeds for batches computations +1: $C_0 = \text{Banned}_{-1} = \varnothing$ +2: for $k = 0,1,\ldots,K-1$ do +3: Worker $i$ computes $g_i^k = \begin{cases} \nabla f(x^k,\xi_{i,k}), & \text{if } i \in \mathcal{G}_k \setminus \mathcal{C}_k, \\ *, & \text{if } i \in \mathcal{B}_k \setminus \mathcal{C}_k, \end{cases}$ where $\xi_{i,k}$ is generated via seed $s_{i,k}$ available to every worker +4: $\left(\widehat{g}^k, \text{public\_info}_k\right) = \text{BTARD}(g_{i_1^k}^k, g_{i_1^k}^k, \ldots, g_{i_{a_k}^k}^k)$ , where $\{i_1^k, \ldots, i_{a_k}^k\} = (\mathcal{G}_k \cup \mathcal{B}_k) \setminus \mathcal{C}_k$ +5: // BTARD is described in Algorithm 6 +7: +8: Choose $2m$ workers $c_1^{k+1}, \ldots, c_m^{k+1}, u_1^{k+1}, \ldots, u_m^{k+1}$ uniformly at random without replacement, $\mathcal{C}_{k+1} = \{c_1^{k+1}, \ldots, c_m^{k+1}\}, \mathcal{U}_{k+1} = \{u_1^{k+1}, \ldots, u_m^{k+1}\}$ +9: Banned $k = \text{CHECKCOMPUTATIONS}(\mathcal{C}_{k+1}, \mathcal{U}_{k+1}, \text{public\_info}_k)$ +10: $x^{k+1} = \operatorname{proj}_Q(x^k - \gamma \widehat{g}^k) := \operatorname*{argmin}_{x \in Q} \|x - (x^k - \gamma \widehat{g}^k)\|$ +11: $\mathcal{G}_{k+1} = \mathcal{G}_k \setminus \text{Banned}_{k-1}$ +12: $\mathcal{B}_{k+1} = \mathcal{B}_k \setminus \text{Banned}_{k-1}$ + +# E. Convergence analysis: missing proofs and extra details + +# E.1. Preliminaries + +For convenience, we provide the classical definitions and facts on smooth and strongly convex functions below. + +Definition E.1 (L-smoothness). We say that function $f:Q\to \mathbb{R}$ , $Q\subseteq \mathbb{R}^d$ is $L$ -smooth if it is differentiable and + +$$ +\forall x, y \in Q \quad \| \nabla f (x) - \nabla f (y) \| \leq L \| x - y \|. \tag {12} +$$ + +One can show (Nesterov, 2003) that $L$ -smoothness implies + +$$ +\forall x, y \in Q \quad f (y) \leq f (x) + \left\langle \nabla f (x), y - x \right\rangle + \frac {L}{2} \| y - x \| ^ {2}, \tag {13} +$$ + +$$ +\forall x \in Q \| \nabla f (x) \| ^ {2} \leq 2 L (f (x) - f _ {*}), \tag {14} +$$ + +where $f_{*}$ is a uniform lower bound for $f$ . + +Definition E.2 ( $\mu$ -strong convexity). Differentiable function $f:Q\to \mathbb{R}$ , $Q\subseteq \mathbb{R}^d$ is called $\mu$ -strongly convex if + +$$ +\forall x, y \in Q \quad f (y) \geq f (x) + \left\langle \nabla f (x), y - x \right\rangle + \frac {\mu}{2} \| y - x \| ^ {2}. \tag {15} +$$ + +# E.2. Impossibility of Byzantine-tolerant learning in heterogeneous case + +Several papers on Byzantine-tolerant optimization consider non-homogeneous setup, when good workers have different local functions (Wu et al., 2020; He et al., 2020). Formally, it means that instead of solving + +$$ +\min _ {x \in Q \subseteq \mathbb {R} ^ {d}} \left\{f (x) := \mathbb {E} _ {\xi \sim \mathcal {D}} [ f (x, \xi) ] \right\}, \tag {16} +$$ + +where good peers sample stochastic gradients from the full dataset (i.e., they can sample $\xi$ from $\mathcal{D}$ ), the following problem is considered: + +$$ +\min _ {x \in Q \subseteq \mathbb {R} ^ {d}} \left\{f (x) := \frac {1}{| \mathcal {G} |} \sum_ {i \in \mathcal {G}} f _ {i} (x) \right\}, \tag {17} +$$ + +where $f_{i}(x) = \mathbb{E}_{\xi_{i}\sim \mathcal{D}_{i}}[f(x,\xi_{i})]$ and there exists $\zeta \geq 0$ such that for all $x\in Q$ + +$$ +\frac {1}{| \mathcal {G} |} \sum_ {i \in \mathcal {G}} \| \nabla f _ {i} (x) - \nabla f (x) \| ^ {2} \leq \zeta^ {2}. \tag {18} +$$ + +However, under $\zeta$ -bounded heterogeneity assumption (18) it is impossible in general to solve (17) with any predefined accuracy in the presence of Byzantine peers (He et al., 2020). Moreover, this is true even when trusted Parameter-Server is available. + +Theorem E.1 (Theorem III from (He et al., 2020)). For any optimization method $\mathsf{A}\mathsf{I}\mathsf{g}$ there exist $n$ functions $f_{1}(x),\ldots ,f_{n}(x)$ such that at least $(1 - \delta)n$ of them are good (corresponding workers belong to $\mathcal{G}$ ), 1-smooth, $\mu$ -strongly convex and satisfy (18) such that the output $\widehat{x}$ of $\mathsf{A}\mathsf{I}\mathsf{g}$ given the access to these $n$ functions has an error at least + +$$ +\mathbb {E} \left[ f (\widehat {x}) - \min _ {x \in \mathbb {R} ^ {d}} f (x) \right] \geq \Omega \left(\frac {\delta \zeta^ {2}}{\mu}\right) \quad a n d \quad \mathbb {E} \left[ \| \nabla f (\widehat {x}) \| ^ {2} \right] \geq \Omega \left(\delta \zeta^ {2}\right), \tag {19} +$$ + +where the expectation is taken w.r.t. the randomness of $\mathsf{A1g}$ . + +The intuition behind this negative result is as following: since the only assumption on the similarity of "good" functions is (18), Byzantine peers can shift the gradients by a vector with a norm $\sim \zeta$ without being detected. In this case, it is impossible to distinguish good peers from Byzantines but the solution of (17) depends on which workers are good and which are bad. Therefore, the best one can hope for is the convergence to some neighborhood of the solution. + +The lower bounds from (19) are proportional to $\delta \zeta^2$ and cannot be made arbitrary small for given $\delta$ and $\zeta^2$ . It means that the convergence to any predefined accuracy of the solution is impossible to achieve when local loss functions are + +$\zeta$ -heterogeneous. In this sense, Byzantine-tolerant learning is impossible in the heterogeneous case. Moreover, in some practical applications (e.g., in Federated Learning (McMahan et al., 2017)), $\zeta$ from (18) can be large implying that one cannot achieve reasonable accuracy of the solution when $\delta$ is not too small (e.g., $\delta \geq 0.01$ ). Finally, strong convexity parameter $\mu$ is typically much smaller than 1 (assuming that the smoothness parameter is 1). In these cases, $\delta \zeta^2/\mu$ can be too large and, as a result, all methods are not converging at all. + +# E.3. Convergence guarantees for BTARD-SGD + +# E.3.1. ON ASSUMPTIONS 3.1 AND 3.2 + +First of all, Assumption 3.1 holds whenever standard uniformly bounded variance (UBV) assumption is satisfied. Indeed, if $\mathbb{E}_{\xi \sim \mathcal{D}}[\| \nabla f(x,\xi) - \nabla f(x)\| ^2 ]\leq \hat{\sigma}^2$ , then $\mathbb{E}_{\xi \sim \mathcal{D}}[(\nabla_if(x,\xi) - \nabla_if(x))^2 ]\leq \hat{\sigma}^2$ for all $i = 1,\dots ,d$ , since $\| \nabla f(x,\xi) - \nabla f(x)\| ^2 = \sum_{i = 1}^{d}(\nabla_if(x,\xi) - \nabla_if(x))^2$ . This implies that Assumption 3.1 holds with $\sigma^2\leq d\hat{\sigma}^2$ . However, $\sigma^2$ can be significantly smaller than $d\hat{\sigma}^2$ . For example, if the noise in stochastic gradients is isotropic, e.g., Gaussian, then + +$$ +\mathbb {E} _ {\xi \sim \mathcal {D}} [ (\nabla_ {1} f (x, \xi) - \nabla_ {1} f (x)) ^ {2} ] = \dots = \mathbb {E} _ {\xi \sim \mathcal {D}} [ (\nabla_ {d} f (x, \xi) - \nabla_ {d} f (x)) ^ {2} ], +$$ + +implying that + +$$ +\mathbb {E} _ {\xi \sim \mathcal {D}} [ (\nabla_ {i} f (x, \xi) - \nabla_ {i} f (x)) ^ {2} ] = \frac {1}{d} \mathbb {E} _ {\xi \sim \mathcal {D}} [ (\nabla f (x, \xi) - \nabla f (x)) ^ {2} ] \leq \frac {\widehat {\sigma} ^ {2}}{d} +$$ + +for all $i = 1,\ldots ,d$ . Therefore, in this case, Assumption 3.1 holds with $\sigma^2 = \hat{\sigma}^2$ + +Next, it is possible to relax Assumption 3.1 to the classical UBV assumption. Indeed, in our proofs, we use Assumption 3.1 to bound the variance in the blocks of the stochastic gradients, where the blocks of components are chosen for workers to execute BTARD. If these blocks are chosen uniformly at random, i.e., the vector is split into several parts of the given sizes uniformly at random, then it is enough to have + +$$ +\mathbb {E} \left[ \| \nabla f _ {[ S ]} (x, \xi) - \nabla_ {[ S ]} f (x) \| ^ {2} \right] \leq \frac {s \sigma^ {2}}{d} \tag {20} +$$ + +for a random subset $S$ of $\{1,\dots ,d\}$ such that $|S| = s$ , where expectation is taken w.r.t. $\xi$ and $S$ . To derive inequality (20) from UBV assumption $\mathbb{E}_{\xi \sim \mathcal{D}}[\|\nabla f(x,\xi) - \nabla f(x)\|^2] \leq \hat{\sigma}^2$ we use tower property of the expectation: + +$$ +\begin{array}{l} \mathbb {E} \left[ \| \nabla f _ {[ S ]} (x, \xi) - \nabla_ {[ S ]} f (x) \| ^ {2} \right] = \mathbb {E} _ {\xi \sim \mathcal {D}} \left[ \mathbb {E} _ {S} \left[ \| \nabla f _ {[ S ]} (x, \xi) - \nabla_ {[ S ]} f (x) \| ^ {2} \right] \right] \\ { = } { \mathbb { E } _ { \xi \sim \mathcal { D } } \left[ \sum _ { i = 1 } ^ { d } \mathbb { P } \{ i \in S \} ( \nabla _ { i } f ( x , \xi ) - \nabla _ { i } f ( x ) ) ^ { 2 } \right] } \\ { = } { \frac { s } { d } \mathbb { E } _ { \xi \sim \mathcal { D } } \left[ \sum _ { i = 1 } ^ { d } ( \nabla _ { i } f ( x , \xi ) - \nabla _ { i } f ( x ) ) ^ { 2 } \right] } \\ { = } { \frac { s } { d } \mathbb { E } _ { \xi \sim \mathcal { D } } \left[ \| \nabla f ( x , \xi ) - \nabla f ( x ) \| ^ { 2 } \right] \leq \frac { s \widehat { \sigma } ^ { 2 } } { d } , } \\ \end{array} +$$ + +i.e., (20) holds for $\sigma^2 = \widehat{\sigma}^2$ + +Finally, as we show in Lemmas E.2 and E.4, under As. 3.2 Verification 3 at BTARD leads to extra checking of computations with probability $\sim 1/n$ at each iteration when all workers honestly follow the protocol and under a proper choice of $\Delta_{\max}$ . Therefore, extra computations either appear due to malicious manipulations of Byzantine peers, and lead eventually to the ban for the Byzantine peers who deviate from the protocol, or, when all workers honestly follow the protocol, only once per $n$ iterations on average. There are a number of important machine learning tasks, such as training ResNet-50 onImagenet (Zhang et al., 2020) and many others image classification problems, where the noise in the stochastic gradient has much "lighter" (sub-Gaussian) tails. That is, As. 3.2 is reasonable for a large class of practically important problems. Moreover, in Appendix E.4, we also provide an analysis of BTARD-CLIPPED-SGD and RESTARTED-BTARD-CLIPPED-SGD without any assumptions on the tails of the stochastic gradients distribution. + +# E.3.2. QUALITY OF THE AGGREGATION + +The quality of the aggregation at each iteration of BTARD-SGD significantly affects the rate of the method. That is, properties of $\widetilde{g}^k$ are highly important for the convergence of BTARD-SGD. This aggregator is obtained via BTARD that + +requires to know a tight estimate of the total number of Byzantine workers violating the protocol at iteration $k$ - clipping parameter $\tau$ depends on this quantity. Therefore, it is natural to start with relatively simple setup when the number of Byzantine workers violating the protocol is known at each iteration. + +Before we formulate the first result we introduce some useful notations. Let $n_k$ be the total number of peers at iteration $k$ , $b_k$ be the total number of Byzantine peers at iteration $k$ , $\widehat{b}^k$ be the total number of Byzantine peers violating the protocol at iteration $k$ , and $\delta_k = \frac{b_k}{n_k}$ , $\widehat{\delta}_k = \frac{\widehat{b}_k}{n_k - m}$ . In view of new notation, we start with the ideal situation when $\widehat{b}_k$ is known for each worker at each iteration $k$ . First of all, it is needed to estimate the quality of the aggregation for good workers. + +Lemma E.1 (Theorem IV from Karimireddy et al. (2020)). Let As. 3.1 hold, $\delta \leq 0.1(n - m)$ , and $i\in \mathcal{G}_k\setminus \mathcal{C}_k$ . Assume that $\widehat{b}_k$ is known for each worker at iteration $k$ and $\delta = \widehat{\delta}_k$ is used to compute clipping parameter $\tau_{l}$ for CenteredClip. If the total number of iterations $T$ of CenteredClip satisfies $T\geq \log_{9.7\delta}\frac{\delta\sigma^2}{3\mathbb{E}[\|v^0 - \overline{g}^k\|^2]}$ , then + +$$ +\mathbb {E} \left[ \| \widehat {g} ^ {k} (i) - \bar {g} ^ {k} (i) \| ^ {2} \mid x ^ {k} \right] \leq 4 0 0 1 \widehat {\delta_ {k}} \frac {\sigma^ {2}}{n _ {k} - m}, \tag {21} +$$ + +where $\overline{g}^k (i) = \frac{1}{|\mathcal{G}_k\setminus\mathcal{C}_k|}\sum_{j\in \mathcal{G}_k\setminus \mathcal{C}_k}g_j^k (i)$ . + +Proof. The proof follows directly from (6). + +Unlike the good peers, Byzantine workers can cooperate and shift the result of CENTEREDCLIP in the components they aggregate without being revealed at Verification 2 of BTARD. However, they cannot produce an arbitrary large shifts due to Verification 3. The next lemma estimates the maximal possible magnitude of a shift together with probability of triggering CHECKAVERAGING at iteration $k$ for at least one worker. + +Lemma E.2. Let As. 3.1 and 3.2 hold, $b \leq 0.1(n - m)$ , and $i \in \mathcal{B}_k \setminus \mathcal{C}_k$ . Assume that $\widehat{b}_k$ is known for each worker at iteration $k$ , $\Delta_{\max}^k = \frac{(1 + \sqrt{3})\sqrt{2}\sigma}{\sqrt{n_k - m}}$ and $\delta = \widehat{\delta}_k$ is used to compute clipping parameter $\tau_l$ for CenteredClip. If the total number of iterations $T$ of CenteredClip satisfies $T \geq \log_{9.7\delta} \frac{\delta\sigma^2}{3\mathbb{E}[||v^0 - \overline{g}^k||^2]}$ and CHECKAVERAGING(i) is not triggered, then + +$$ +\mathbb {E} \left[ \| \widehat {g} ^ {k} (i) - \bar {g} ^ {k} (i) \| ^ {2} \mid x ^ {k} \right] \leq \frac {4 \left((1 + \sqrt {3}) ^ {2} + 4\right) \sigma^ {2}}{n _ {k} - m}, \tag {22} +$$ + +where $\overline{g}^k (i) = \frac{1}{|\mathcal{G}_k\setminus\mathcal{C}_k|}\sum_{j\in \mathcal{G}_k\setminus \mathcal{C}_k}g_j^k (i)$ . Moreover, if $\widehat{b}_k = 0$ and $n_k - m\geq 170$ , then $\widehat{g}^k (i) = \overline{g}^k (i)$ and + +$$ +\mathbb {P} \left\{\text {C H E C K A V E R A G I N G i s t r i g g e d f o r} \geq 1 \text {p e e r} \mid x ^ {k} \right\} \leq \frac {1 4 9}{4 9 \left(n _ {k} - m\right)}. \tag {23} +$$ + +Proof. If $\text{CHECKAVERAGING}(i)$ is not triggered at iteration $k$ , then for $r_k \geq \frac{n_k - m}{2}$ good workers $i_1, i_2, \ldots, i_{r_k} \in \mathcal{G}_k \setminus \mathcal{C}_k$ + +we have $\| g_{i_j}^k (i) - \widehat{g}^k (i)\| \leq \Delta_{\max}^k$ . Therefore, due to the independence of $g_{i}^{k}$ , $i\in \mathcal{G}_k\setminus \mathcal{C}_k$ for fixed $x^{k}$ we have + +$$ +\begin{array}{l} \mathbb {E} \left[ \left\| \widehat {g} ^ {k} (i) - \bar {g} ^ {k} (i) \right\| ^ {2} \mid x ^ {k} \right] \leq 2 \mathbb {E} \left[ \left\| \widehat {g} ^ {k} (i) - \frac {1}{r _ {k}} \sum_ {j = 1} ^ {r _ {k}} g _ {i _ {j}} ^ {k} (i) \right\| ^ {2} \mid x ^ {k} \right] \\ + 2 \mathbb {E} \left[ \left\| \frac {1}{r _ {k}} \sum_ {j = 1} ^ {r _ {k}} g _ {i _ {j}} ^ {k} (i) - \overline {{g}} ^ {k} (i) \right\| ^ {2} \mid x ^ {k} \right] \\ \leq 2 \mathbb {E} \left[ \frac {1}{r _ {k}} \sum_ {j = 1} ^ {r _ {k}} \| \widehat {g} ^ {k} (i) - g _ {i j} ^ {k} (i) \| ^ {2} \right] + 4 \mathbb {E} \left[ \| \nabla_ {(i)} f (x ^ {k}) - \overline {{g}} ^ {k} (i) \| ^ {2} \mid x ^ {k} \right] \\ 4 \mathbb {E} \left[ \left\| \frac {1}{r _ {k}} \sum_ {j = 1} ^ {r _ {k}} g _ {i _ {j}} ^ {k} (i) - \nabla_ {(i)} f (x ^ {k}) \right\| ^ {2} \mid x ^ {k} \right] \\ \leq 2 (\Delta_ {\max} ^ {k}) ^ {2} + \frac {4 \sigma^ {2}}{| \mathcal {G} _ {k} \setminus \mathcal {C} _ {k} |} + \frac {8 \sigma^ {2}}{n _ {k} - m} \\ \leq \frac {4 \left((1 + \sqrt {3}) ^ {2} + 4\right) \sigma^ {2}}{n _ {k} - m}, \\ \end{array} +$$ + +where we use $|\mathcal{G}_k \setminus \mathcal{C}_k| \geq r_k \geq \frac{n_k - m}{2}$ and $\nabla f_{(i)}(x^k) = \mathbb{E}[g_{ij}^k \mid x^k]$ . Finally, let us estimate the probability of triggering CHECKAVERAGING when all workers follow the protocol. In this case, $\widehat{g}^{(i)} = \overline{g}^{k}(i)$ . Next, due to As. 3.2 and $b \leq 0.1(n - m)$ we have + +$$ +\mathbb {P} \left\{\| \overline {{g}} ^ {k} (i) - \nabla f _ {(i)} (x ^ {k}) \| _ {2} > \sqrt {\frac {\sigma^ {2}}{n _ {k} - m}} \mid x ^ {k} \right\} \leq \frac {1}{| \mathcal {G} _ {k} \setminus \mathcal {C} _ {k} | ^ {2}} \leq \frac {1 0 0}{4 9 (n _ {k} - m) ^ {2}} +$$ + +and for all $j\in \mathcal{G}_k\setminus \mathcal{C}_k$ + +$$ +\mathbb {P} \left\{\| g _ {j} ^ {k} (i) - \nabla f _ {(i)} (x ^ {k}) \| _ {2} > \sqrt {\frac {3 \sigma^ {2}}{n _ {k} - m}} \mid x ^ {k} \right\} \leq \frac {1}{9}. +$$ + +Consider the independent random variables $\eta_j, j \in \mathcal{G}_k \setminus \mathcal{C}_k$ , where + +$$ +\eta_ {j} = \left\{ \begin{array}{l l} 1, & \text {i f} \| g _ {j} ^ {k} (i) - \nabla f _ {(i)} (x ^ {k}) \| _ {2} \leq \sqrt {\frac {3 \sigma^ {2}}{n _ {k} - m}}, \\ 0, & \text {o t h e r w i s e}, \end{array} \right. +$$ + +where $x^{k}$ is fixed. Then, $\eta_{j}$ is a Bernoulli random variable with parameter of "success" $q \geq 8/9$ . Applying Hoeffding's inequality we get that + +$$ +\begin{array}{l} \mathbb {P} \left\{\sum_ {j \in \mathcal {G} _ {k} \backslash \mathcal {C} _ {k}} \eta_ {j} \leq \frac {n _ {k} - m}{2} \mid x ^ {k} \right\} \leq \exp \left(- 2 (n _ {k} - m) \left(q - \frac {n _ {k} - m}{2 | \mathcal {G} _ {k} \backslash \mathcal {C} _ {k} |}\right) ^ {2}\right) \\ \leq \exp \left(- 2 (n _ {k} - m) \left(\frac {8}{9} - \frac {n - m}{1 . 4 (n - m)}\right) ^ {2}\right) \\ { = } { \exp \left( - \frac { 2 4 2 ( n _ { k } - m ) } { 3 9 6 9 } \right) . } \\ \end{array} +$$ + +Since for all $j \in \mathcal{G}_k \setminus \mathcal{C}_k$ we have $\| \overline{g}^k (i) - g_j^k (i)\| _2 \leq \| \overline{g}^k (i) - \nabla_{(i)}f(x^k)\| _2 + \| \nabla_{(i)}f(x^k) - g_j^k (i)\| _2$ the obtained bounds imply that CHECKAVERAGING is triggered for at least one worker at iteration $k$ with probability not greater than + +$$ +\frac {1 0 0}{4 9 (n _ {k} - m)} + (n _ {k} - m) \exp \left(- \frac {2 4 2 (n _ {k} - m)}{3 9 6 9}\right) \leq \frac {1 4 9}{4 9 (n _ {k} - m)}, +$$ + +where we use that $\exp \left(-\frac{242x}{3969}\right) \leq \frac{1}{x^2}$ for all $x \geq 170$ . + +We notice that Byzantine peers can trigger CHECKAVERAGING by violating the protocol. However, each Byzantine is checked at iteration $k$ with probability $p \sim m / n$ (see Thm. E.2). Therefore, Byzantine workers can trigger only $\mathcal{O}(bn / m)$ extra rounds of communications and computations on average via triggering CHECKAVERAGING. In contrast, when there are no Byzantine workers or all workers follow the protocol CHECKAVERAGING is triggered only once per $\mathcal{O}(n - m)$ iterations that is a negligible communication an computation overhead when $n$ is large. + +Combining two previous lemmas we get the following result. + +Lemma E.3. Let As. 3.1 hold and $b\leq 0.1(n - m)$ . Assume that $\widehat{b}_k$ is known for each worker at iteration $k,\Delta_{\mathrm{max}}^k =$ $\frac{(1 + \sqrt{3})\sqrt{2}\sigma}{\sqrt{n_k - m}}$ and $\delta = \widehat{\delta}_k$ is used to compute clipping parameter $\tau_{l}$ for CenteredClip. If the total number of iterations $T$ of CenteredClip satisfies $T\geq \log_{9.7\delta}\frac{\delta\sigma^2}{3\mathbb{E}[\|v^0 - \overline{g}^k\|^2]}$ and CHECKAVERAGING is not triggered for any worker, then + +$$ +\mathbb {E} \left[ \| \widehat {g} ^ {k} - \bar {g} ^ {k} \| ^ {2} \mid x ^ {k} \right] \leq C \widehat {\delta} _ {k} \sigma^ {2}, \tag {24} +$$ + +$$ +\mathbb {E} \left[ \| \widehat {g} ^ {k} \| ^ {2} \mid x ^ {k} \right] \leq 2 C \widehat {\delta} _ {k} \sigma^ {2} + 2 \| \nabla f (x ^ {k}) \| ^ {2} + \frac {2 \sigma^ {2}}{n - 2 b - m}, \tag {25} +$$ + +where $\overline{g}^k = \frac{1}{|\mathcal{G}_k\setminus\mathcal{C}_k|}\sum_{j\in \mathcal{G}_k\setminus \mathcal{C}_k}g_j^k$ and $C = 4001 + 4((1 + \sqrt{3})^2 +4)$ + +Proof. We have + +$$ +\begin{array}{l} \mathbb {E} \left[ \| \widehat {g} ^ {k} - \overline {{g}} ^ {k} \| ^ {2} \mid x ^ {k} \right] = \sum_ {i \in \mathcal {G} _ {k} \backslash \mathcal {C} _ {k}} \mathbb {E} \left[ \| \widehat {g} ^ {k} (i) - \overline {{g}} ^ {k} (i) \| ^ {2} \mid x ^ {k} \right] + \sum_ {i \in \mathcal {B} _ {k} \backslash \mathcal {C} _ {k}} \mathbb {E} \left[ \| \widehat {g} ^ {k} (i) - \overline {{g}} ^ {k} (i) \| ^ {2} \mid x ^ {k} \right] \\ \stackrel {(2 1), (2 2)} {\leq} (1 - \widehat {\delta} _ {k}) (n _ {k} - m) \cdot 4 0 0 1 \widehat {\delta} _ {k} \frac {\sigma^ {2}}{n _ {k} - m} + \widehat {\delta} _ {k} (n _ {k} - m) \cdot \frac {4 ((1 + \sqrt {3}) ^ {2} + 4) \sigma^ {2}}{n _ {k} - m} \\ = \quad C \widehat {\delta_ {k}} \sigma^ {2}. \\ \end{array} +$$ + +Next, using the independence of $g_{j}^{k}$ for $j\in \mathcal{G}_k\setminus \mathcal{C}_k$ and fixed $x^{k}$ we derive + +$$ +\begin{array}{l} \mathbb {E} \left[ \| \widehat {g} ^ {k} \| ^ {2} \mid x ^ {k} \right] \leq 2 \mathbb {E} \left[ \| \widehat {g} ^ {k} - \overline {{g}} ^ {k} \| ^ {2} \mid x ^ {k} \right] + 2 \mathbb {E} \left[ \| \overline {{g}} ^ {k} \| ^ {2} \mid x ^ {k} \right] \\ \stackrel {(2 4)} {\leq} 2 C \widehat {\delta} _ {k} \sigma^ {2} + 2 \| \nabla f (x ^ {k}) \| ^ {2} + 2 \mathbb {E} \left[ \| \overline {{g}} ^ {k} - \nabla f (x ^ {k}) \| ^ {2} \mid x ^ {k} \right] \\ \leq 2 C \widehat {\delta} _ {k} \sigma^ {2} + 2 \| \nabla f (x ^ {k}) \| ^ {2} + \frac {2 \sigma^ {2}}{\left| \mathcal {G} _ {k} \backslash \mathcal {C} _ {k} \right|} \\ \leq 2 C \widehat {\delta} _ {k} \sigma^ {2} + 2 \| \nabla f (x ^ {k}) \| ^ {2} + \frac {2 \sigma^ {2}}{n - 2 b - m}. \\ \end{array} +$$ + +In view of the definition of $(\delta, c)$ -robust aggregator from Karimireddy et al. (2020), the result of BTARD at iteration $k$ is $(\widehat{\delta_k}, C)$ -robust. However, we derive this property under assumption that $\widehat{b}_k$ is known to all workers at each iteration $k$ , which is impractical. + +When $\widehat{b}_k$ is unknown the situation changes dramatically: in general, good peers can only know some upper bound for the fraction of Byzantine peers at iteration $k$ . Unfortunately, if used without bans, this is not enough to converge to any accuracy of the solution since BTARD-SGD is a permutation-invariant algorithm in terms of Karimireddy et al. (2020). Therefore, in this case, we always use CENTEREDCLIP with $\tau_l = \infty$ for all $l \geq 0$ , i.e., good peers compute an exact average. In this settings, even 1 Byzantine worker can significantly shift the average in all parts of the vector. The next lemma quantifies the negative effect of Byzantine workers in this case. + +Lemma E.4. Let As. 3.1 and 3.2 hold, $b\leq 0.1(n - m)$ $m\leq (n - 2b) / 2$ Assume that $\Delta_{\mathrm{max}}^k = \frac{(1 + \sqrt{3})\sqrt{2}\sigma}{\sqrt{n_k} - m}$ and $\delta = 0$ is used to compute clipping parameter $\tau_{l}$ for CenteredClip. If CHECKAVERAGING is not triggered for any worker, then + +$$ +\mathbb {E} \left[ \| \widehat {g} ^ {k} - \bar {g} ^ {k} \| ^ {2} \mid x ^ {k} \right] \leq C \sigma^ {2} \mathbb {1} _ {k, v}, \tag {26} +$$ + +$$ +\mathbb {E} \left[ \| \widehat {g} ^ {k} \| ^ {2} \mid x ^ {k} \right] \leq 2 C \sigma^ {2} \mathbb {1} _ {k, v} + 2 \| \nabla f (x ^ {k}) \| ^ {2} + \frac {2 \sigma^ {2}}{n - 2 b - m}, \tag {27} +$$ + +where $\overline{g}^k = \frac{1}{|\mathcal{G}_k\setminus\mathcal{C}_k|}\sum_{j\in \mathcal{G}_k\setminus \mathcal{C}_k}g_j^k$ $C = 4((1 + \sqrt{3})^{2} + 4)$ , and $\mathbb{1}_{k,v}$ is an indicator function of the event that at least 1 Byzantine peer violates the protocol at iteration k. Moreover, if $\widehat{b}_k = 0$ and $n_k - m\geq 170$ then $\widehat{g}^k (i) = \overline{g}^k (i)$ and + +$$ +\mathbb {P} \left\{\text {C H E C K A V E R A G I N G i s t r i g g e d f o r} \geq 1 \text {p e e r} \mid x ^ {k} \right\} \leq \frac {1 4 9}{4 9 \left(n _ {k} - m\right)}. \tag {28} +$$ + +Proof. If CHECK AVERAGING is not triggered for any worker, then $\| \widehat{g}^k (i) - \overline{g}^k (i)\| ^2\leq (\Delta_{\max}^k)^2\mathbb{1}_{k,v}$ for all $i\in (\mathcal{G}_k\cup \mathcal{C}_k)\backslash \mathcal{C}_k$ implying + +$$ +\begin{array}{l} \mathbb {E} \left[ \| \widehat {g} ^ {k} - \overline {{g}} ^ {k} \| ^ {2} \mid x ^ {k} \right] = \sum_ {i \in (\mathcal {G} _ {k} \cup \mathcal {C} _ {k}) \backslash \mathcal {C} _ {k}} \mathbb {E} \left[ \| \widehat {g} ^ {k} (i) - \overline {{g}} ^ {k} (i) \| ^ {2} \mid x ^ {k} \right] \\ \leq (n _ {k} - m) \cdot \frac {2 ((1 + \sqrt {3}) ^ {2} + 8) \sigma^ {2}}{n _ {k} - m} \mathbb {1} _ {k, v} \leq C \sigma^ {2} \mathbb {1} _ {k, v}. \\ \end{array} +$$ + +Next, using the independence of $g_{j}^{k}$ for $j \in G_{k} \setminus C_{k}$ and fixed $x^{k}$ we derive + +$$ +\begin{array}{l} \mathbb {E} \left[ \| \widehat {g} ^ {k} \| ^ {2} \mid x ^ {k} \right] \leq 2 \mathbb {E} \left[ \| \widehat {g} ^ {k} - \bar {g} ^ {k} \| ^ {2} \mid x ^ {k} \right] + 2 \mathbb {E} \left[ \| \bar {g} ^ {k} \| ^ {2} \mid x ^ {k} \right] \\ \stackrel {(2 6)} {\leq} 2 C \sigma^ {2} \mathbb {1} _ {k, v} + 2 \| \nabla f (x ^ {k}) \| ^ {2} + 2 \mathbb {E} \left[ \| \bar {g} ^ {k} - \nabla f (x ^ {k}) \| ^ {2} \mid x ^ {k} \right] \\ \leq 2 C \sigma^ {2} \mathbb {1} _ {k, v} + 2 \| \nabla f (x ^ {k}) \| ^ {2} + \frac {2 \sigma^ {2}}{| \mathcal {G} _ {k} \setminus \mathcal {C} _ {k} |} \\ \leq 2 C \sigma^ {2} \mathbb {1} _ {k, v} + 2 \| \nabla f (x ^ {k}) \| ^ {2} + \frac {2 \sigma^ {2}}{n - 2 b - m}. \\ \end{array} +$$ + +The proof of the final part of the lemma is identical to the proof of the same result from Lemma E.2. + +![](images/08576f216411570eb42a92a54cf7295bbd43bc44b0dbe39108c35ff52159feda.jpg) + +# E.3.3. NON-CONVEX CASE + +In this section, we provide the complete statements and the full proofs of the convergence results for BTARD-SGD when the objective function $f$ is smooth, but can be non-convex. We start with the case when the number of attacking Byzantine workers is known at each iteration. + +Theorem E.2. Let As. 3.1 and As. 3.2 hold, $Q = \mathbb{R}^d$ , and $f$ be $L$ -smooth (see Def. E.1) and uniformly lower bounded by $f_*$ . Moreover, assume that $b \leq 0.1(n - m)$ , $m \leq (n - 2b)/2$ , and the exact number of attacking Byzantine peers is known to all good peers at each iteration. Next, assume that + +$$ +\gamma = \min \left\{\frac {1}{4 L}, \sqrt {\frac {\Delta_ {0} n}{L \sigma^ {2} K}} \right\}, \quad \Delta_ {\max } ^ {k} = \frac {(1 + \sqrt {3}) \sqrt {2} \sigma}{\sqrt {n _ {k} - m}}, \tag {29} +$$ + +where $\Delta_0 = f(x^0) - f_*$ and $\Delta_{\mathrm{max}}^k$ is the parameter for verification 3 at iteration $k$ of BTARD-SGD. Then, we have $\mathbb{E}[\| \nabla f(\overline{x}^K)\| ^2 ]\leq \varepsilon^2$ after $K$ iterations of BTARD-SGD, where + +$$ +K = \mathcal {O} \left(\frac {L \Delta_ {0}}{\varepsilon^ {2}} + \frac {L \Delta_ {0} \sigma^ {2}}{n \varepsilon^ {4}} + \frac {n \delta \sigma^ {2}}{m \varepsilon^ {2}}\right) \tag {30} +$$ + +and $\overline{x}^K$ is picked uniformly at random from $\{x^0, x^1, \ldots, x^{K-1}\}$ . + +Proof. From $L$ -smoothness of $f$ we have + +$$ +\begin{array}{l} f (x ^ {k + 1}) \stackrel {(1 3)} {\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 } ) - \gamma \langle \nabla f ( x ^ { k } ) , \widehat { g } ^ { k } \rangle + \frac { L \gamma ^ { 2 } } { 2 } \| \widehat { g } ^ { k } \| ^ { 2 } . } \\ \end{array} +$$ + +Taking the conditional expectation $\mathbb{E}[\cdot \mid x^{k}]$ from the both sides of the previous inequality we obtain + +$$ +\begin{array}{l} \mathbb {E} \left[ f \left(x ^ {k + 1}\right) \mid x ^ {k} \right] \leq f \left(x ^ {k}\right) - \gamma \| \nabla f \left(x ^ {k}\right) \| ^ {2} - \gamma \left\langle \nabla f \left(x ^ {k}\right), \mathbb {E} \left[ \widehat {g} ^ {k} - \bar {g} ^ {k} \mid x ^ {k} \right] \right\rangle \\ + \frac {L \gamma^ {2}}{2} \mathbb {E} \left[ | | \widehat {g} ^ {k} | | ^ {2} \mid x ^ {k} \right] \\ \stackrel {(2 5)} {\leq} f (x ^ {k}) - \frac {\gamma}{2} \| \nabla f (x ^ {k}) \| ^ {2} + \frac {\gamma}{2} \left\| \mathbb {E} \left[ \widehat {g} ^ {k} - \overline {{g}} ^ {k} \mid x ^ {k} \right] \right\| ^ {2} \\ + C L \gamma^ {2} \widehat {\delta} _ {k} \sigma^ {2} + L \gamma^ {2} \| \nabla f (x ^ {k}) \| + \frac {L \gamma^ {2} \sigma^ {2}}{n - 2 b - m} \\ \leq f (x ^ {k}) - \frac {\gamma}{2} (1 - 2 L \gamma) \| \nabla f (x ^ {k}) \| ^ {2} + \frac {\gamma}{2} \mathbb {E} \left[ \| \widehat {g} ^ {k} - \overline {{g}} ^ {k} \| ^ {2} \mid x ^ {k} \right] \\ + C L \gamma^ {2} \widehat {\delta} _ {k} \sigma^ {2} + \frac {L \gamma^ {2} \sigma^ {2}}{n - 2 b - m}. \\ \end{array} +$$ + +Since $\gamma \leq \frac{1}{4L}$ we continue our derivations as + +$$ +\begin{array}{l} \mathbb {E} \left[ f (x ^ {k + 1}) \mid x ^ {k} \right] \leq f (x ^ {k}) - \frac {\gamma}{4} \| \nabla f (x ^ {k}) \| ^ {2} + \gamma C \sigma^ {2} (1 + L \gamma) \widehat {\delta} _ {k} + \frac {L \gamma^ {2} \sigma^ {2}}{n - 2 b - m} \\ \leq f \left(x ^ {k}\right) - \frac {\gamma}{4} \| \nabla f \left(x ^ {k}\right) \| ^ {2} + 2 \gamma C \sigma^ {2} \widehat {\delta} _ {k} + \frac {L \gamma^ {2} \sigma^ {2}}{n - 2 b - m}. \\ \end{array} +$$ + +Taking the full expectation from the both sides of the obtained inequality and summing up the results for $k = 0,1,\dots ,K - 1$ we get + +$$ +\begin{array}{l} \frac {1}{K} \sum_ {k = 0} ^ {K - 1} \mathbb {E} \left[ \| \nabla f (x ^ {k}) \| ^ {2} \right] \leq \frac {4}{\gamma K} \sum_ {k = 0} ^ {K - 1} \mathbb {E} \left[ f (x ^ {k}) - f (x ^ {k + 1}) \right] + \frac {8 C \sigma^ {2}}{K} \mathbb {E} \left[ \sum_ {k = 0} ^ {K - 1} \widehat {\delta} _ {k} \right] + \frac {4 L \gamma \sigma^ {2}}{n - 2 b - m} \\ = \frac {4 (f (x ^ {0}) - \mathbb {E} [ f (x ^ {K}) ])}{\gamma K} + \frac {8 C \sigma^ {2}}{K} \mathbb {E} \left[ \sum_ {k = 0} ^ {K - 1} \frac {\widehat {b} _ {k}}{n _ {k} - m} \right] + \frac {4 L \gamma \sigma^ {2}}{n - 2 b - m} \\ \leq \frac {4 (f \left(x ^ {0}\right) - f _ {*})}{\gamma K} + \frac {8 C \sigma^ {2}}{K (n - 2 b - m)} \mathbb {E} \left[ \sum_ {k = 0} ^ {K - 1} \widehat {b} _ {k} \right] + \frac {4 L \gamma \sigma^ {2}}{n - 2 b - m}. \\ \end{array} +$$ + +If a Byzantine peer deviates from the protocol at iteration $k$ , it will be detected with some probability $p_k$ during the next iteration. One can lower bound this probability as + +$$ +p _ {k} \geq m \cdot \frac {\left| \mathcal {G} _ {k} \right|}{n _ {k}} \cdot \frac {1}{n _ {k}} = \frac {m (1 - \delta_ {k})}{n _ {k}} \geq \frac {m}{n}. +$$ + +Therefore, each individual Byzantine worker can violate the protocol no more than $1 / p$ times on average implying that + +$$ +\begin{array}{l} \frac {1}{K} \sum_ {k = 0} ^ {K - 1} \mathbb {E} \left[ \| \nabla f (x ^ {k}) \| ^ {2} \right] \leq \frac {4 (f (x ^ {0}) - f _ {*})}{\gamma K} + \frac {8 C n b \sigma^ {2}}{K m (n - 2 b - m)} + \frac {4 L \gamma \sigma^ {2}}{n - 2 b - m} \\ \leq \frac {4 (f (x ^ {0}) - f _ {*})}{\gamma K} + \frac {1 6 C n b \sigma^ {2}}{K m (n - 2 b)} + \frac {8 L \gamma \sigma^ {2}}{n - 2 b} \\ \leq \frac {4 (f (x ^ {0}) - f _ {*})}{\gamma K} + \frac {1 6 0 C n \delta \sigma^ {2}}{7 K m} + \frac {8 0 L \gamma \sigma^ {2}}{7 n}. \\ \end{array} +$$ + +Since $\overline{x}^K$ is picked uniformly at random from $\{x^0, x^1, \ldots, x^{K-1}\}$ we have + +$$ +\mathbb {E} \left[ \| \nabla f (\bar {x} ^ {K}) \| ^ {2} \right] \leq \frac {4 (f (x ^ {0}) - f _ {*})}{\gamma K} + \frac {1 6 0 C n \delta \sigma^ {2}}{7 K m} + \frac {8 0 L \gamma \sigma^ {2}}{7 n}. +$$ + +Using the stepsize rule + +$$ +\gamma = \min \left\{\frac {1}{4 L}, \sqrt {\frac {\Delta_ {0} n}{L \sigma^ {2} K}} \right\} +$$ + +we derive + +$$ +\mathbb {E} \left[ \| \nabla f (\bar {x} ^ {K}) \| ^ {2} \right] = \mathcal {O} \left(\frac {L \Delta_ {0}}{K} + \frac {\sqrt {L \Delta_ {0}} \sigma}{\sqrt {n K}} + \frac {n \delta \sigma^ {2}}{m K}\right) +$$ + +meaning that after + +$$ +K = \mathcal {O} \left(\frac {L \Delta_ {0}}{\varepsilon^ {2}} + \frac {L \Delta_ {0} \sigma^ {2}}{n \varepsilon^ {4}} + \frac {n \delta \sigma^ {2}}{m \varepsilon^ {2}}\right) +$$ + +iterations BTARD-SGD guarantees $\mathbb{E}\left[\| \nabla f(\overline{x}^K)\| ^2\right]\leq \varepsilon^2$ + +In the main part of the paper, we notice that the rate of BTARD-SGD in the presence of bad workers is asymptotically the same as for SGD without Byzantine peers when $\varepsilon$ is sufficiently small9. This phenomenon has a clear intuition. When the target accuracy $\varepsilon$ is small, the stepsize $\gamma$ is also needed to be small enough. However, as we show in Lemmas E.3 and E.4, Byzantine workers can produce only a bounded shift independent of the stepsize. Moreover, they can violate the protocol at only $\sim n / m$ iterations on average. Therefore, the overall impact of Byzantine workers on the convergence of BTARD-SGD decreases when the stepsize $\gamma$ decreases. + +Next, we derive the result without assuming that $\widehat{b}^k$ is known to all peers at each iteration. + +Theorem E.3. Let As. 3.1 and 3.2 hold, $Q = \mathbb{R}^d$ , and $f$ be $L$ -smooth (see Def. E.1) and uniformly lower bounded by $f_{*}$ Moreover, assume that $b\leq 0.1(n - m)$ $m\leq (n - 2b) / 2$ , and $\delta = 0$ is used to compute clipping parameter $\tau_{l}$ for CenteredClip. Next, assume that + +$$ +\gamma = \min \left\{\frac {1}{4 L}, \sqrt {\frac {\Delta_ {0} n}{L \sigma^ {2} K}} \right\}, \quad \Delta_ {\max } ^ {k} = \frac {(1 + \sqrt {3}) \sqrt {2} \sigma}{\sqrt {n _ {k} - m}}, \tag {31} +$$ + +where $\Delta_0 = f(x^0) - f_*$ and $\Delta_{\mathrm{max}}^k$ is the parameter for verification 3 at iteration $k$ of BTARD-SGD. Then, we have $\mathbb{E}[\| \nabla f(\overline{x}^K)\| ^2 ]\leq \varepsilon^2$ after $K$ iterations of BTARD-SGD, where + +$$ +K = \mathcal {O} \left(\frac {L \Delta_ {0}}{\varepsilon^ {2}} + \frac {L \Delta_ {0} \sigma^ {2}}{n \varepsilon^ {4}} + \frac {n b \sigma^ {2}}{m \varepsilon^ {2}}\right) \tag {32} +$$ + +and $\overline{x}^K$ is picked uniformly at random from $\{x^0, x^1, \ldots, x^{K-1}\}$ . + +Proof. The proof is almost identical to the proof of Theorem E.2. Following the same steps and using (26) and (27) instead of (24) and (25) respectively we obtain the same sequence of inequalities up to the following change: instead of $\widehat{\delta}_k$ we should use $\mathbb{1}_{k,v}$ . Therefore, we have + +$$ +\frac {1}{K} \sum_ {k = 0} ^ {K - 1} \mathbb {E} \left[ \| \nabla f (x ^ {k}) \| ^ {2} \right] \leq \frac {4 (f (x ^ {0}) - f _ {*})}{\gamma K} + \frac {8 C \sigma^ {2}}{K} \mathbb {E} \left[ \sum_ {k = 0} ^ {K - 1} \mathbb {1} _ {k, v} \right] + \frac {4 L \gamma \sigma^ {2}}{n - 2 b - m}. +$$ + +If a Byzantine peer deviates from the protocol at iteration $k$ , it will be detected with some probability $p_k$ during the next iteration. One can lower bound this probability as + +$$ +p _ {k} \geq m \cdot \frac {| \mathcal {G} _ {k} |}{n _ {k}} \cdot \frac {1}{n _ {k}} = \frac {m (1 - \delta_ {k})}{n _ {k}} \geq \frac {m}{n}. +$$ + +That is, each individual Byzantine worker can violate the protocol no more than $\frac{1}{p}$ times on average. However, even one Byzantine peer can create a shift of the order $\Delta_{\max}^{k}$ at each part of the resulting vector. Therefore, all Byzantine peers can violate the protocol no more than $\frac{b}{p}$ times on average implying that + +$$ +\begin{array}{l} \frac {1}{K} \sum_ {k = 0} ^ {K - 1} \mathbb {E} \left[ \| \nabla f (x ^ {k}) \| ^ {2} \right] \leq \frac {4 (f (x ^ {0}) - f _ {*})}{\gamma K} + \frac {8 C n b \sigma^ {2}}{K m} + \frac {4 L \gamma \sigma^ {2}}{n - 2 b - m} \\ \leq \frac {4 (f (x ^ {0}) - f _ {*})}{\gamma K} + \frac {8 C n b \sigma^ {2}}{K m} + \frac {8 L \gamma \sigma^ {2}}{n - 2 b} \\ \leq \frac {4 (f (x ^ {0}) - f _ {*})}{\gamma K} + \frac {8 C n b \sigma^ {2}}{K m} + \frac {8 0 L \gamma \sigma^ {2}}{7 n}. \\ \end{array} +$$ + +Since $\overline{x}^K$ is picked uniformly at random from $\{x^0, x^1, \ldots, x^{K-1}\}$ we have + +$$ +\mathbb {E} \left[ \| \nabla f (\overline {{x}} ^ {K}) \| ^ {2} \right] \leq \frac {4 (f (x ^ {0}) - f _ {*})}{\gamma K} + \frac {8 C n b \sigma^ {2}}{K m} + \frac {8 0 L \gamma \sigma^ {2}}{7 n}. +$$ + +Using the stepsize rule + +$$ +\gamma = \min \left\{\frac {1}{4 L}, \sqrt {\frac {\Delta_ {0} n}{L \sigma^ {2} K}} \right\} +$$ + +we derive + +$$ +\mathbb {E} \left[ \| \nabla f (\bar {x} ^ {K}) \| ^ {2} \right] = \mathcal {O} \left(\frac {L \Delta_ {0}}{K} + \frac {\sqrt {L \Delta_ {0}} \sigma}{\sqrt {n K}} + \frac {n b \sigma^ {2}}{m K}\right) +$$ + +meaning that after + +$$ +K = \mathcal {O} \left(\frac {L \Delta_ {0}}{\varepsilon^ {2}} + \frac {L \Delta_ {0} \sigma^ {2}}{n \varepsilon^ {4}} + \frac {n b \sigma^ {2}}{m \varepsilon^ {2}}\right) +$$ + +iterations BTARD-SGD guarantees $\mathbb{E}\left[\| \nabla f(\overline{x}^K)\| ^2\right]\leq \varepsilon^2$ + +As we notice in the main part of the paper, the third term of the obtained complexity result is significantly worse than in (30): it is proportional to $b$ instead of $\delta = \frac{b}{n}$ . However, (32) is derived without assuming that $\widehat{b}_k$ is known for all workers at each iteration. Moreover, as in (30), the third term in (32) has better dependence on $\varepsilon$ than the second term implying that for small enough $\varepsilon$ the rate of BTARD-SGD in the presence of bad workers without assuming that $\widehat{b}_k$ is known at each iteration is asymptotically the same as for SGD without Byzantine peers10. + +# E.3.4. CONVEX CASE + +In this section, we provide the complete statements and the full proofs of the convergence results for BTARD-SGD when the objective function $f$ is smooth and convex. We start with the case when the number of attacking Byzantine workers is known at each iteration. + +Theorem E.4. Let As. 3.1 and 3.2 hold, $Q = \mathbb{R}^d$ , $f$ be L-smooth (see Def. E.1), convex, and $x^{*}$ be some optimum of $f$ . Moreover, assume that $b \leq 0.1(n - m)$ , $m \leq (n - 2b)/2$ , and the exact number of attacking Byzantine peers is known to all good peers at each iteration. Next, assume that + +$$ +\gamma = \min \left\{\frac {1}{4 L}, \sqrt {\frac {7 n R _ {0} ^ {2}}{1 2 0 \sigma^ {2} K}}, \sqrt {\frac {m ^ {2} R _ {0} ^ {2}}{1 4 4 0 C \sigma^ {2} n ^ {2} \delta}} \right\}, \quad \Delta_ {\max } ^ {k} = \frac {(1 + \sqrt {3}) \sqrt {2} \sigma}{\sqrt {n _ {k} - m}}, \tag {33} +$$ + +where $R_0 \geq \| x^0 - x^*\|$ and $\Delta_{\max}^k$ is the parameter for verification 3 at iteration $k$ of BTARD-SGD. Then, we have $\mathbb{E}[f(\overline{x}^K) - f(x^*)] \leq \varepsilon$ after $K$ iterations of BTARD-SGD, where + +$$ +K = \mathcal {O} \left(\frac {L R _ {0} ^ {2}}{\varepsilon} + \frac {\sigma^ {2} R _ {0} ^ {2}}{n \varepsilon^ {2}} + \frac {n \sqrt {\delta} \sigma R _ {0}}{m \varepsilon}\right) \tag {34} +$$ + +and $\overline{x}^K = \frac{1}{K}\sum_{k = 0}^{K - 1}$ + +Proof. Lemma E.3 implies + +$$ +\begin{array}{l} \mathbb {E} \left[ \| x ^ {k + 1} - x ^ {*} \| ^ {2} \mid x ^ {k} \right] = \mathbb {E} \left[ \| x ^ {k} - x ^ {*} - \gamma \widehat {g} ^ {k} \| ^ {2} \mid x ^ {k} \right] \\ { = } { \| x ^ { k } - x ^ { * } \| ^ { 2 } - 2 \gamma \mathbb { E } \left[ \langle x ^ { k } - x ^ { * } , \widehat { g } ^ { k } \rangle \mid x ^ { k } \right] + \gamma ^ { 2 } \mathbb { E } \left[ \| \widehat { g } ^ { k } \| ^ { 2 } \mid x ^ { k } \right] } \\ \end{array} +$$ + +$$ +\begin{array}{l} \stackrel {(2 5)} {\leq} \| x ^ {k} - x ^ {*} \| ^ {2} - 2 \gamma \langle x ^ {k} - x ^ {*}, \nabla f (x ^ {k}) \rangle + 2 \gamma^ {2} \| \nabla f (x ^ {k}) \| ^ {2} \\ - 2 \gamma \mathbb {E} \left[ \langle x ^ {k} - x ^ {*}, \widehat {g} ^ {k} - \overline {{g}} ^ {k} \rangle \mid x ^ {k} \right] + 2 \gamma^ {2} C \widehat {\delta} _ {k} \sigma^ {2} + \frac {2 \gamma^ {2} \sigma^ {2}}{n - 2 b - m}. \\ \end{array} +$$ + +Next, we use convexity (see (15) with $\mu = 0$ ) and $L$ -smoothness of $f$ : + +$$ +\begin{array}{l} \mathbb {E} \left[ \| x ^ {k + 1} - x ^ {*} \| ^ {2} \mid x ^ {k} \right] \stackrel {(1 4), (1 5)} {\leq} \| x ^ {k} - x ^ {*} \| ^ {2} - 2 \gamma \left(1 - 2 L \gamma\right) \left(f \left(x ^ {k}\right) - f \left(x ^ {*}\right)\right) \\ - 2 \gamma \mathbb {E} \left[ \langle x ^ {k} - x ^ {*}, \widehat {g} ^ {k} - \overline {{g}} ^ {k} \rangle \mid x ^ {k} \right] + 2 \gamma^ {2} C \sigma^ {2} \frac {\widehat {b} _ {k}}{n _ {k} - m} + \frac {2 \gamma^ {2} \sigma^ {2}}{n - 2 b - m}. \\ \end{array} +$$ + +To estimate the inner product in the right-hand side we apply Cauchy-Schwarz inequality: + +$$ +\begin{array}{l} - 2 \gamma \mathbb {E} \left[ \langle x ^ {k} - x ^ {*}, \widehat {g} ^ {k} - \bar {g} ^ {k} \rangle \mid x ^ {k} \right] \leq 2 \gamma \| x ^ {k} - x ^ {*} \| \mathbb {E} \left[ \| \widehat {g} ^ {k} - \bar {g} ^ {k} \| \mid x ^ {k} \right] \\ \leq 2 \gamma \| x ^ {k} - x ^ {*} \| \sqrt {\mathbb {E} \left[ \| \widehat {g} ^ {k} - \bar {g} ^ {k} \| ^ {2} \mid x ^ {k} \right]} \\ \stackrel {(2 4)} {\leq} 2 \gamma \sqrt {C} \sigma \| x ^ {k} - x ^ {*} \| \sqrt {\widehat {\delta} _ {k}} \leq \frac {2 \gamma \sqrt {C} \sigma}{\sqrt {n _ {k} - m}} \| x ^ {k} - x ^ {*} \| \sqrt {\widehat {b} _ {k}} \\ \leq \frac {2 \gamma \sqrt {C} \sigma}{\sqrt {n - 2 b - m}} \| x ^ {k} - x ^ {*} \| \sqrt {\widehat {b _ {k}}}. \\ \end{array} +$$ + +Putting all together and using $b \leq 0.1(n - m)$ , $m \leq \frac{(n - 2b)}{2}$ , $\gamma \leq \frac{1}{4L}$ , $n_k - m \geq n - 2b - m$ , we obtain + +$$ +\begin{array}{l} \mathbb {E} \left[ \| x ^ {k + 1} - x ^ {*} \| ^ {2} \mid x ^ {k} \right] \leq \| x ^ {k} - x ^ {*} \| ^ {2} - \gamma \left(f \left(x ^ {k}\right) - f \left(x ^ {*}\right)\right) \\ + \frac {4 \gamma \sqrt {5 C} \sigma}{\sqrt {n}} \| x ^ {k} - x ^ {*} \| \sqrt {\widehat {b} _ {k}} + \frac {4 0 \gamma^ {2} C \sigma^ {2}}{7 n} \widehat {b} _ {k} + \frac {4 0 \gamma^ {2} \sigma^ {2}}{7 n}. \\ \end{array} +$$ + +Taking the full expectation from the both sides of the above inequality and summing up the results for $k = 0,1,\ldots ,K - 1$ we derive + +$$ +\begin{array}{l} \frac {\gamma}{K} \sum_ {k = 0} ^ {K - 1} \mathbb {E} [ f (x ^ {k}) - f (x ^ {*}) ] \leq \frac {1}{K} \sum_ {k = 0} ^ {K - 1} \left(\mathbb {E} \left[ \| x ^ {k} - x ^ {*} \| ^ {2} \right] - \mathbb {E} \left[ \| x ^ {k + 1} - x ^ {*} \| ^ {2} \right]\right) + \frac {4 0 \gamma^ {2} \sigma^ {2}}{7 n} \\ + \frac {4 \gamma \sqrt {5 C} \sigma}{\sqrt {n} K} \sum_ {k = 0} ^ {K - 1} \mathbb {E} \left[ \| x ^ {k} - x ^ {*} \| \sqrt {\widehat {b} _ {k}} \right] + \frac {4 0 \gamma^ {2} C \sigma^ {2}}{7 n K} \sum_ {k = 0} ^ {K - 1} \mathbb {E} [ \widehat {b} _ {k} ] \\ \leq \frac {\| x ^ {0} - x ^ {*} \| ^ {2} - \mathbb {E} [ \| x ^ {K} - x ^ {*} \| ^ {2} ]}{K} + \frac {4 0 \gamma^ {2} \sigma^ {2}}{7 n} \\ + \frac {4 \gamma \sqrt {5 C} \sigma}{\sqrt {n} K} \sum_ {k = 0} ^ {K - 1} \sqrt {\mathbb {E} \left[ \| x ^ {k} - x ^ {*} \| ^ {2} \right] \mathbb {E} [ \widehat {b _ {k}} ]} + \frac {4 0 \gamma^ {2} C \sigma^ {2}}{7 n K} \sum_ {k = 0} ^ {K - 1} \mathbb {E} [ \widehat {b _ {k}} ]. \\ \end{array} +$$ + +From Jensen's inequality we have $f(\overline{x}^K) \leq \frac{1}{K} \sum_{k=0}^{K-1} f(x^k)$ , where $\overline{x}^K = \frac{1}{K} \sum_{k=0}^{K-1} x^k$ . Using this and new notation $R_k = \|x^k - x^*\|, k > 0, R_0 \geq \|x^0 - x^*\|$ we get + +$$ +\begin{array}{l} 0 \leq \gamma \mathbb {E} \left[ f (\bar {x} ^ {K}) - f (x ^ {*}) \right] \leq \frac {R _ {0} ^ {2} - \mathbb {E} \left[ R _ {K} ^ {2} \right]}{K} + \frac {4 0 \gamma^ {2} \sigma^ {2}}{7 n} \\ + \frac {4 \gamma \sqrt {5 C} \sigma}{\sqrt {n} K} \sum_ {k = 0} ^ {K - 1} \sqrt {\mathbb {E} \left[ R _ {k} ^ {2} \right] \mathbb {E} \left[ \widehat {b} _ {k} \right]} + \frac {4 0 \gamma^ {2} C \sigma^ {2}}{7 n K} \sum_ {k = 0} ^ {K - 1} \mathbb {E} [ \widehat {b} _ {k} ] \tag {35} \\ \end{array} +$$ + +implying (after changing the indices) that + +$$ +\mathbb {E} \left[ R _ {k} ^ {2} \right] \leq R _ {0} ^ {2} + \frac {4 0 \gamma^ {2} \sigma^ {2} k}{7 n} + \frac {4 \gamma \sqrt {5 C} \sigma}{\sqrt {n}} \sum_ {l = 0} ^ {k - 1} \sqrt {\mathbb {E} \left[ R _ {l} ^ {2} \right] \mathbb {E} [ \widehat {b} _ {l} ]} + \frac {4 0 \gamma^ {2} C \sigma^ {2}}{7 n} \sum_ {l = 0} ^ {k - 1} \mathbb {E} [ \widehat {b} _ {l} ] \tag {36} +$$ + +holds for all $k \geq 0$ . In the remaining part of the proof we derive by induction that + +$$ +R _ {0} ^ {2} + \frac {4 0 \gamma^ {2} \sigma^ {2} k}{7 n} + \frac {4 \gamma \sqrt {5 C} \sigma}{\sqrt {n}} \sum_ {l = 0} ^ {k - 1} \sqrt {\mathbb {E} \left[ R _ {l} ^ {2} \right] \mathbb {E} [ \widehat {b _ {l}} ]} + \frac {4 0 \gamma^ {2} C \sigma^ {2}}{7 n} \sum_ {l = 0} ^ {k - 1} \mathbb {E} [ \widehat {b _ {l}} ] \leq 2 R _ {0} ^ {2} \tag {37} +$$ + +for all $k = 0, \ldots, K$ . For $k = 0$ this inequality trivially holds. Next, assume that it holds for all $k = 0, 1, \ldots, T - 1$ , $T \leq K - 1$ . Let us show that it holds for $k = T$ as well. From (36) and (37) we have that $\mathbb{E}[R_k^2] \leq 2R_0^2$ for all $k = 0, 1, \ldots, T - 1$ . Therefore, + +$$ +\begin{array}{l} \mathbb {E} [ R _ {T} ^ {2} ] \leq R _ {0} ^ {2} + \frac {4 0 \gamma^ {2} \sigma^ {2} T}{7 n} + \frac {4 \gamma \sqrt {5 C} \sigma}{\sqrt {n}} \sum_ {l = 0} ^ {T - 1} \sqrt {\mathbb {E} [ R _ {l} ^ {2} ] \mathbb {E} [ \widehat {b _ {l}} ]} + \frac {4 0 \gamma^ {2} C \sigma^ {2}}{7 n} \sum_ {l = 0} ^ {T - 1} \mathbb {E} [ \widehat {b _ {l}} ] \\ \leq R _ {0} ^ {2} + \frac {4 0 \gamma^ {2} \sigma^ {2} T}{7 n} + \frac {4 \gamma \sqrt {1 0 C} \sigma R _ {0}}{\sqrt {n}} \sum_ {l = 0} ^ {T - 1} \sqrt {\mathbb {E} [ b _ {l} ]} + \frac {4 0 \gamma^ {2} C \sigma^ {2}}{7 n} \sum_ {l = 0} ^ {T - 1} \mathbb {E} [ b _ {l} ]. \\ \end{array} +$$ + +If a Byzantine peer deviates from the protocol at iteration $k$ , it will be detected with some probability $p_k$ during the next iteration. One can lower bound this probability as + +$$ +p _ {k} \geq m \cdot \frac {| \mathcal {G} _ {k} |}{n _ {k}} \cdot \frac {1}{n _ {k}} = \frac {m (1 - \delta_ {k})}{n _ {k}} \geq \frac {m}{n}. +$$ + +Therefore, each individual Byzantine worker can violate the protocol no more than $1 / p$ times on average implying that + +$$ +\begin{array}{l} \mathbb {E} [ R _ {T} ^ {2} ] \leq R _ {0} ^ {2} + \frac {4 0 \gamma^ {2} \sigma^ {2} T}{7 n} + \frac {4 n \gamma \sqrt {1 0 C b} \sigma R _ {0}}{m \sqrt {n}} + \frac {4 0 \gamma^ {2} C \sigma^ {2} n b}{7 n m} \\ = R _ {0} ^ {2} + \frac {4 0 \gamma^ {2} \sigma^ {2} T}{7 n} + \frac {4 n \gamma \sqrt {1 0 C \delta} \sigma R _ {0}}{m} + \frac {4 0 \gamma^ {2} C \sigma^ {2} n \delta}{7 m}. \\ \end{array} +$$ + +Taking + +$$ +\gamma = \min \left\{\frac {1}{4 L}, \sqrt {\frac {7 n R _ {0} ^ {2}}{1 2 0 \sigma^ {2} K}}, \sqrt {\frac {m ^ {2} R _ {0} ^ {2}}{1 4 4 0 C \sigma^ {2} n ^ {2} \delta}} \right\} +$$ + +we ensure that + +$$ +\frac {4 0 \gamma^ {2} \sigma^ {2} T}{7 n} + \frac {4 n \gamma \sqrt {1 0 C \delta} \sigma R _ {0}}{m} + \frac {4 0 \gamma^ {2} C \sigma^ {2} n \delta}{7 m} \leq \frac {R _ {0} ^ {2}}{3} + \frac {R _ {0} ^ {2}}{3} + \frac {R _ {0} ^ {2}}{3} = R _ {0} ^ {2}, +$$ + +and, as a result, we get $\mathbb{E}[R_T^2] \leq 2R_0^2$ . Therefore, (37) holds for all $k = 0,1,\ldots,K$ . Together with (35) it implies + +$$ +\mathbb {E} \left[ f (\overline {{x}} ^ {K}) - f (x ^ {*}) \right] \leq \frac {2 R _ {0} ^ {2}}{\gamma K}. +$$ + +Next, from our stepsize rule (33) it follows that + +$$ +\mathbb {E} \left[ f (\overline {{x}} ^ {K}) - f (x ^ {*}) \right] = \mathcal {O} \left(\frac {L R _ {0} ^ {2}}{K} + \frac {\sigma R _ {0}}{\sqrt {n K}} + \frac {n \sqrt {\delta} \sigma R _ {0}}{m K}\right) +$$ + +meaning that after + +$$ +K = \mathcal {O} \left(\frac {L R _ {0} ^ {2}}{\varepsilon} + \frac {\sigma^ {2} R _ {0} ^ {2}}{n \varepsilon^ {2}} + \frac {n \sqrt {\delta} \sigma R _ {0}}{m \varepsilon}\right) +$$ + +iterations BTARD-SGD guarantees $\mathbb{E}[f(\overline{x}^K) - f(x^*)] \leq \varepsilon$ . + +In the convex case, similar observations hold as in the non-convex case. Next, we derive the result without assuming that $\widehat{b}^k$ is known to all peers at each iteration. + +Theorem E.5. Let As. 3.1 and 3.2 hold, $Q = \mathbb{R}^d$ , $f$ be L-smooth (see Def. E.1), convex, and $x^{*}$ be some optimum of $f$ . Moreover, assume that $b \leq 0.1(n - m)$ , $m \leq (n - 2b)/2$ , and $\delta = 0$ is used to compute clipping parameter $\tau_l$ for CenteredClip. Next, assume that + +$$ +\gamma = \min \left\{\frac {1}{4 L}, \sqrt {\frac {7 n R _ {0} ^ {2}}{1 2 0 \sigma^ {2} K}}, \sqrt {\frac {m ^ {2} R _ {0} ^ {2}}{7 2 C \sigma^ {2} n ^ {2} b ^ {2}}} \right\}, \quad \Delta_ {\max } ^ {k} = \frac {(1 + \sqrt {3}) \sqrt {2} \sigma}{\sqrt {n _ {k} - m}}, \tag {38} +$$ + +where $R_0 \geq \| x^0 - x^*\|$ and $\Delta_{\mathrm{max}}^k$ is the parameter for verification 3 at iteration $k$ of BTARD-SGD. Then, we have $\mathbb{E}[f(\overline{x}^K) - f(x^*)] \leq \varepsilon$ after $K$ iterations of BTARD-SGD, where + +$$ +K = \mathcal {O} \left(\frac {L R _ {0} ^ {2}}{\varepsilon} + \frac {\sigma^ {2} R _ {0} ^ {2}}{n \varepsilon^ {2}} + \frac {n b \sigma R _ {0}}{m \varepsilon}\right) \tag {39} +$$ + +and $\overline{x}^K = \frac{1}{K}\sum_{k = 0}^{K - 1}$ + +Proof. The proof is almost identical to the proof of Theorem E.4. Following the same steps and using (26) and (27) instead of (24) and (25) respectively we obtain the same sequence of inequalities up to the following change: instead of $\widehat{\delta}_k$ we should use $\mathbb{1}_{k,v}$ . Therefore, we have + +$$ +\begin{array}{l} \mathbb {E} \left[ \| x ^ {k + 1} - x ^ {*} \| ^ {2} \mid x ^ {k} \right] \leq \| x ^ {k} - x ^ {*} \| ^ {2} - 2 \gamma (1 - 2 L \gamma) (f (x ^ {k}) - f (x ^ {*})) \\ - 2 \gamma \mathbb {E} \left[ \langle x ^ {k} - x ^ {*}, \widehat {g} ^ {k} - \overline {{g}} ^ {k} \rangle \mid x ^ {k} \right] + 2 \gamma^ {2} C \sigma^ {2} \mathbb {1} _ {k, v} + \frac {2 \gamma^ {2} \sigma^ {2}}{n - 2 b - m}, \\ {- 2 \gamma \mathbb {E} \left[ \langle x ^ {k} - x ^ {*}, \widehat {g} ^ {k} - \overline {{g}} ^ {k} \rangle \mid x ^ {k} \right]} \leq {2 \gamma \sqrt {C} \sigma \| x ^ {k} - x ^ {*} \| \mathbb {1} _ {k, v},} \\ \end{array} +$$ + +that result in + +$$ +\begin{array}{l} \mathbb {E} \left[ \| x ^ {k + 1} - x ^ {*} \| ^ {2} \mid x ^ {k} \right] \leq \| x ^ {k} - x ^ {*} \| ^ {2} - \gamma \left(f (x ^ {k}) - f (x ^ {*})\right) \\ + 2 \gamma \sqrt {C} \sigma \| x ^ {k} - x ^ {*} \| \mathbb {1} _ {k, v} + 2 \gamma^ {2} C \sigma^ {2} \mathbb {1} _ {k, v} + \frac {4 0 \gamma^ {2} \sigma^ {2}}{7 n}. \\ \end{array} +$$ + +Taking the full expectation from the both sides of the above inequality and summing up the results for $k = 0,1,\ldots ,K - 1$ we derive + +$$ +\begin{array}{l} \frac {\gamma}{K} \sum_ {k = 0} ^ {K - 1} \mathbb {E} [ f (x ^ {k}) - f (x ^ {*}) ] \leq \frac {1}{K} \sum_ {k = 0} ^ {K - 1} \left(\mathbb {E} \left[ \| x ^ {k} - x ^ {*} \| ^ {2} \right] - \mathbb {E} \left[ \| x ^ {k + 1} - x ^ {*} \| ^ {2} \right]\right) + \frac {4 0 \gamma^ {2} \sigma^ {2}}{7 n} \\ + \frac {2 \gamma \sqrt {C} \sigma}{K} \sum_ {k = 0} ^ {K - 1} \mathbb {E} \left[ \| x ^ {k} - x ^ {*} \| \mathbb {1} _ {k, v} \right] + \frac {2 \gamma^ {2} C \sigma^ {2}}{K} \sum_ {k = 0} ^ {K - 1} \mathbb {E} [ \mathbb {1} _ {k, v} ] \\ \leq \frac {\| x ^ {0} - x ^ {*} \| ^ {2} - \mathbb {E} [ \| x ^ {K} - x ^ {*} \| ^ {2} ]}{K} + \frac {4 0 \gamma^ {2} \sigma^ {2}}{7 n} \\ + \frac {2 \gamma \sqrt {C} \sigma}{K} \sum_ {k = 0} ^ {K - 1} \sqrt {\mathbb {E} \left[ \left\| x ^ {k} - x ^ {*} \right\| ^ {2} \right] \mathbb {E} [ \mathbb {1} _ {k , v} ]} + \frac {2 \gamma^ {2} C \sigma^ {2}}{K} \sum_ {k = 0} ^ {K - 1} \mathbb {E} [ \mathbb {1} _ {k, v} ]. \\ \end{array} +$$ + +From Jensen's inequality we have $f(\overline{x}^K) \leq \frac{1}{K} \sum_{k=0}^{K-1} f(x^k)$ , where $\overline{x}^K = \frac{1}{K} \sum_{k=0}^{K-1} x^k$ . Using this and new notation $R_k = \|x^k - x^*\|, k \geq 0$ we get + +$$ +\begin{array}{l} 0 \leq \gamma \mathbb {E} \left[ f (\bar {x} ^ {K}) - f (x ^ {*}) \right] \leq \frac {R _ {0} ^ {2} - \mathbb {E} [ R _ {K} ^ {2} ]}{K} + \frac {4 0 \gamma^ {2} \sigma^ {2}}{7 n} \\ + \frac {2 \gamma \sqrt {C} \sigma}{K} \sum_ {k = 0} ^ {K - 1} \sqrt {\mathbb {E} \left[ R _ {k} ^ {2} \right] \mathbb {E} \left[ \mathbb {1} _ {k , v} \right]} + \frac {2 \gamma^ {2} C \sigma^ {2}}{K} \sum_ {k = 0} ^ {K - 1} \mathbb {E} \left[ \mathbb {1} _ {k, v} \right] \tag {40} \\ \end{array} +$$ + +implying (after changing the indices) that + +$$ +\mathbb {E} \left[ R _ {k} ^ {2} \right] \leq R _ {0} ^ {2} + \frac {4 0 \gamma^ {2} \sigma^ {2} k}{7 n} + 2 \gamma \sqrt {C} \sigma \sum_ {l = 0} ^ {k - 1} \sqrt {\mathbb {E} \left[ R _ {l} ^ {2} \right] \mathbb {E} \left[ \mathbb {1} _ {l , v} \right]} + 2 \gamma^ {2} C \sigma^ {2} \sum_ {l = 0} ^ {k - 1} \mathbb {E} \left[ \mathbb {1} _ {l, v} \right] \tag {41} +$$ + +holds for all $k \geq 0$ . In the remaining part of the proof we derive by induction that + +$$ +R _ {0} ^ {2} + \frac {4 0 \gamma^ {2} \sigma^ {2} k}{7 n} + 2 \gamma \sqrt {C} \sigma \sum_ {l = 0} ^ {k - 1} \sqrt {\mathbb {E} \left[ R _ {l} ^ {2} \right] \mathbb {E} \left[ \mathbb {1} _ {l , v} \right]} + 2 \gamma^ {2} C \sigma^ {2} \sum_ {l = 0} ^ {k - 1} \mathbb {E} \left[ \mathbb {1} _ {l, v} \right] \leq 2 R _ {0} ^ {2} \tag {42} +$$ + +for all $k = 0, \ldots, K$ . For $k = 0$ this inequality trivially holds. Next, assume that it holds for all $k = 0, 1, \ldots, T - 1$ , $T \leq K - 1$ . Let us show that it holds for $k = T$ as well. From (41) and (42) we have that $\mathbb{E}[R_k^2] \leq 2R_0^2$ for all $k = 0, 1, \ldots, T - 1$ . Therefore, + +$$ +\begin{array}{l} \mathbb {E} [ R _ {T} ^ {2} ] \leq R _ {0} ^ {2} + \frac {4 0 \gamma^ {2} \sigma^ {2} k}{7 n} + 2 \gamma \sqrt {C} \sigma \sum_ {l = 0} ^ {T - 1} \sqrt {\mathbb {E} [ R _ {l} ^ {2} ] \mathbb {E} [ \mathbb {1} _ {l , v} ]} + 2 \gamma^ {2} C \sigma^ {2} \sum_ {l = 0} ^ {T - 1} \mathbb {E} [ \mathbb {1} _ {l, v} ] \\ \leq R _ {0} ^ {2} + \frac {4 0 \gamma^ {2} \sigma^ {2} k}{7 n} + 2 \gamma \sqrt {2 C} \sigma R _ {0} \sum_ {l = 0} ^ {T - 1} \sqrt {\mathbb {E} [ \mathbb {1} _ {l , v} ]} + 2 \gamma^ {2} C \sigma^ {2} \sum_ {l = 0} ^ {T - 1} \mathbb {E} [ \mathbb {1} _ {l, v} ]. \\ \end{array} +$$ + +If a Byzantine peer deviates from the protocol at iteration $k$ , it will be detected with some probability $p_k$ during the next iteration. One can lower bound this probability as + +$$ +p _ {k} \geq m \cdot \frac {| \mathcal {G} _ {k} |}{n _ {k}} \cdot \frac {1}{n _ {k}} = \frac {m (1 - \delta_ {k})}{n _ {k}} \geq \frac {m}{n}. +$$ + +That is, each individual Byzantine worker can violate the protocol no more than $\frac{1}{p}$ times on average. However, even one Byzantine peer can create a shift of the order $\Delta_{\max}^{k}$ at each part of the resulting vector. Therefore, all Byzantine peers can violate the protocol no more than $\frac{b}{p}$ times on average implying that + +$$ +\mathbb {E} [ R _ {T} ^ {2} ] \leq R _ {0} ^ {2} + \frac {4 0 \gamma^ {2} \sigma^ {2} T}{7 n} + \frac {2 \gamma n b \sqrt {2 C} \sigma R _ {0}}{m} + \frac {2 \gamma^ {2} n b C \sigma^ {2}}{m}. +$$ + +Taking + +$$ +\gamma = \min \left\{\frac {1}{4 L}, \sqrt {\frac {7 n R _ {0} ^ {2}}{1 2 0 \sigma^ {2} K}}, \sqrt {\frac {m ^ {2} R _ {0} ^ {2}}{7 2 C \sigma^ {2} n ^ {2} b ^ {2}}} \right\} +$$ + +we ensure that + +$$ +\frac {4 0 \gamma^ {2} \sigma^ {2} T}{7 n} + \frac {2 \gamma n b \sqrt {2 C} \sigma R _ {0}}{m} + \frac {2 \gamma^ {2} n b C \sigma^ {2}}{m} \leq \frac {R _ {0} ^ {2}}{3} + \frac {R _ {0} ^ {2}}{3} + \frac {R _ {0} ^ {2}}{3} = R _ {0} ^ {2}, +$$ + +and, as a result, we get $\mathbb{E}[R_T^2] \leq 2R_0^2$ . Therefore, (42) holds for all $k = 0,1,\ldots,K$ . Together with (40) it implies + +$$ +\mathbb {E} \left[ f (\overline {{x}} ^ {K}) - f (x ^ {*}) \right] \leq \frac {2 R _ {0} ^ {2}}{\gamma K}. +$$ + +Next, from our stepsize rule (38) it follows that + +$$ +\mathbb {E} \left[ f (\bar {x} ^ {K}) - f (x ^ {*}) \right] = \mathcal {O} \left(\frac {L R _ {0} ^ {2}}{K} + \frac {\sigma R _ {0}}{\sqrt {n K}} + \frac {n b \sigma R _ {0}}{m K}\right) +$$ + +meaning that after + +$$ +K = \mathcal {O} \left(\frac {L R _ {0} ^ {2}}{\varepsilon} + \frac {\sigma^ {2} R _ {0} ^ {2}}{n \varepsilon^ {2}} + \frac {n b \sigma R _ {0}}{m \varepsilon}\right) +$$ + +iterations BTARD-SGD guarantees $\mathbb{E}[f(\overline{x}^K) - f(x^*)] \leq \varepsilon$ . + +# E.3.5. STRONGLY CONVEX CASE: RESTARTED-BTARD-SGD + +In this section, we provide the complete statements and the full proofs of the convergence results for the restarted version of BTARD-SGD (RESTARTED-BTARD-SGD, Alg. 8) when the objective function $f$ is smooth and strongly convex. + +# Algorithm 8 RESTARTED-BTARD-SGD + +Input: $x^0$ - starting point, $r$ - number of restarts, $\{\gamma_t\}_{t=1}^r$ - stepsizes for BTARD-SGD, $\{K_t\}_{t=1}^r$ - number of iterations for BTARD-SGD, $\{s_{i,k,t}\}_{i,k,t=0,0,0}^{n,K-1,r}$ - seeds for batches computations + +1: $\widehat{x}^0 = x^0$ +2: for $t = 1, 2, \ldots, r$ do +3: Run BTARD-SGD (Alg. 7) for $K_{t}$ iterations with stepsize $\gamma_{t}$ , starting point $\widehat{x}^{t-1}$ , and seeds for batches computations $\{s_{i,k,t}\}_{i,k=0,0}^{n,K-1}$ . Define $\widehat{x}^t$ as $\widehat{x}^t = \frac{1}{K_t} \sum_{k=0}^{K_t} x^{k,t}$ , where $x^{0,t}, x^{1,t}, \ldots, x^{K_t,t}$ are the iterates produced by BTARD-SGD. + +Output: $\widehat{x}^r$ + +We start with the case when the number of attacking Byzantine workers is known at each iteration. + +Theorem E.6. Let As. 3.1 and 3.2 hold, $Q = \mathbb{R}^d$ , $f$ be L-smooth (see Def. E.1), $\mu$ -strongly convex (see Def. E.2), and $x^*$ be some optimum of $f$ . Moreover, assume that $b \leq 0.1(n - m)$ , $m \leq \frac{(n - 2b)}{2}$ , and the exact number of attacking Byzantine peers is known to all good peers at each iteration. Next, assume that + +$$ +\gamma_ {t} = \min \left\{\frac {1}{4 L}, \sqrt {\frac {7 n R _ {0} ^ {2}}{1 2 0 \cdot 2 ^ {t} \sigma^ {2} K _ {t}}}, \sqrt {\frac {m ^ {2} R _ {0} ^ {2}}{1 4 4 0 \cdot 2 ^ {t} C \sigma^ {2} n ^ {2} \delta}} \right\}, \quad \Delta_ {\max } ^ {k, t} = \frac {(1 + \sqrt {3}) \sqrt {2} \sigma}{\sqrt {n _ {k} ^ {t} - m}}, \tag {43} +$$ + +$$ +K _ {t} = \left\lceil \max \left\{\frac {1 6 L}{\mu}, \frac {3 2 \sigma^ {2} 2 ^ {t}}{\mu^ {2} R _ {0} ^ {2}}, \frac {4 8 \sqrt {1 0 C} n \sqrt {\delta} \sigma 2 ^ {\frac {t}{2}}}{m \mu R _ {0}} \right\}\right\rceil , \quad r = \left\lceil \log_ {2} \frac {\mu R _ {0} ^ {2}}{\varepsilon} \right\rceil - 1 \tag {44} +$$ + +where $R_0 \geq \|x^0 - x^*\|$ , $\Delta_{\max}^{k,t}$ is the parameter for verification 3 at iteration $k$ of BTARD-SGD during the $t$ -th restart, $n_k^t$ is the total number of workers at iteration $k$ of $t$ -th restart. Then, we have $\mathbb{E}[f(\widehat{x}^r) - f(x^*)] \leq \varepsilon$ after $r$ restarts of BTARD-SGD and the total number of executed iterations of BTARD-SGD is + +$$ +\sum_ {t = 1} ^ {r} K _ {t} = \mathcal {O} \left(\frac {L}{\mu} \log \frac {\mu R _ {0} ^ {2}}{\varepsilon} + \frac {\sigma^ {2}}{n \mu \varepsilon} + \frac {n \sqrt {\delta} \sigma}{m \sqrt {\mu \varepsilon}}\right). \tag {45} +$$ + +Proof. Theorem E.4 implies that BTARD-SGD with + +$$ +\gamma = \min \left\{\frac {1}{4 L}, \sqrt {\frac {7 n R _ {0} ^ {2}}{1 2 0 \sigma^ {2} K}}, \sqrt {\frac {m ^ {2} R _ {0} ^ {2}}{1 4 4 0 C \sigma^ {2} n ^ {2} \delta}} \right\} +$$ + +guarantees + +$$ +\mathbb {E} \left[ f (\bar {x} ^ {K}) - f (x ^ {*}) \right] \leq \frac {2 R _ {0} ^ {2}}{\gamma K} +$$ + +after $K$ iterations. Therefore, after the first restart we have + +$$ +\mathbb {E} \left[ f \left(\widehat {x} ^ {1}\right) - f \left(x ^ {*}\right) \right] \leq \frac {2 R _ {0} ^ {2}}{\gamma_ {1} K _ {1}} \leq \frac {\mu R _ {0} ^ {2}}{4}. +$$ + +From $\mu$ -strong convexity of $f$ and $\nabla f(x^{*}) = 0$ we have + +$$ +\frac {\mu}{2} \| \widehat {x} ^ {1} - x ^ {*} \| ^ {2} \leq f (\widehat {x} ^ {1}) - f (x ^ {*}) \Longrightarrow \mathbb {E} [ \| \widehat {x} ^ {1} - x ^ {*} \| ^ {2} ] \leq \frac {R _ {0} ^ {2}}{2}. +$$ + +Next, assume that we have $\mathbb{E}[f(\widehat{x}^t) - f(x^*)] \leq \frac{\mu R_0^2}{2^{t + 1}}$ , $\mathbb{E}[\| \widehat{x}^t - x^* \|^2] \leq \frac{R_0^2}{2^t}$ for some $t \leq r - 1$ . Then, Theorem E.4 implies that + +$$ +\mathbb {E} [ f (\widehat {x} ^ {t + 1}) - f (x ^ {*}) \mid x ^ {t} ] \leq \frac {2 \| \widehat {x} ^ {t} - x ^ {*} \| ^ {2}}{\gamma_ {t} K _ {t}}. +$$ + +Taking the full expectation from the both sides of previous inequality we get + +$$ +\mathbb {E} [ f (\widehat {x} ^ {t + 1}) - f (x ^ {*}) ] \leq \frac {2 \mathbb {E} [ \| \widehat {x} ^ {t} - x ^ {*} \| ^ {2} ]}{\gamma_ {t} K _ {t}} \leq \frac {2 R _ {0} ^ {2}}{2 ^ {t} \gamma_ {t} K _ {t}} \leq \frac {\mu R _ {0} ^ {2}}{2 ^ {t + 2}}. +$$ + +From $\mu$ -strong convexity of $f$ and $\nabla f(x^{*}) = 0$ we have + +$$ +\frac {\mu}{2} \| \widehat {x} ^ {t + 1} - x ^ {*} \| ^ {2} \leq f (\widehat {x} ^ {t + 1}) - f (x ^ {*}) \Longrightarrow \mathbb {E} [ \| \widehat {x} ^ {t + 1} - x ^ {*} \| ^ {2} ] \leq \frac {R _ {0} ^ {2}}{2 ^ {t + 1}}. +$$ + +Therefore, by mathematical induction we have that for all $t = 1,\dots ,r$ + +$$ +\mathbb {E} [ f (\widehat {x} ^ {t}) - f (x ^ {*}) ] \leq \frac {\mu R _ {0} ^ {2}}{2 ^ {t + 1}}, \quad \mathbb {E} \left[ \| \widehat {x} ^ {t} - x ^ {*} \| ^ {2} \right] \leq \frac {R _ {0} ^ {2}}{2 ^ {t}}. +$$ + +Then, after $r = \left\lceil \log_2 \frac{\mu R_0^2}{\varepsilon} \right\rceil - 1$ restarts of BTARD-SGD we have $\mathbb{E}[f(\widehat{x}^r) - f(x^*)] \leq \varepsilon$ . The total number of iterations executed by BTARD-SGD is + +$$ +\begin{array}{l} \sum_ {t = 1} ^ {r} K _ {t} = \mathcal {O} \left(\sum_ {t = 1} ^ {r} \max \left\{\frac {L}{\mu}, \frac {\sigma^ {2} 2 ^ {t}}{\mu^ {2} R _ {0} ^ {2}}, \frac {n \sqrt {\delta} \sigma 2 ^ {\frac {t}{2}}}{m \mu R _ {0}} \right\}\right) \\ = \mathcal {O} \left(\frac {L}{\mu} r + \frac {\sigma^ {2} 2 ^ {r}}{\mu^ {2} R _ {0} ^ {2}} + \frac {n \sqrt {\delta} \sigma 2 ^ {\frac {r}{2}}}{m \mu R _ {0}}\right) \\ = \mathcal {O} \left(\frac {L}{\mu} \log \frac {\mu R _ {0} ^ {2}}{\varepsilon} + \frac {\sigma^ {2}}{\mu^ {2} R _ {0} ^ {2}} \cdot \frac {\mu R _ {0} ^ {2}}{\varepsilon} + \frac {n \sqrt {\delta} \sigma}{m \mu R _ {0}} \cdot \sqrt {\frac {\mu R _ {0} ^ {2}}{\varepsilon}}\right) \\ { = } { \mathcal { O } \left( \frac { L } { \mu } \log \frac { \mu R _ { 0 } ^ { 2 } } { \varepsilon } + \frac { \sigma ^ { 2 } } { n \mu \varepsilon } + \frac { n \sqrt { \delta } \sigma } { m \sqrt { \mu \varepsilon } } \right) . } \\ \end{array} +$$ + +![](images/4beffd1057f39e41e3c2a7d780034a2e680f64f7e5b1575281ee63407fbbdf84.jpg) + +In the strongly convex case, similar observations hold as in the non-convex case. Next, we derive the result without assuming that $\widehat{b}^k$ is known to all peers at each iteration. + +Theorem E.7. Let As. 3.1 and 3.2 hold, $Q = \mathbb{R}^d$ , $f$ be L-smooth (see Def. E.1), $\mu$ -strongly convex (see Def. E.2), and $x^{*}$ be some optimum of $f$ . Moreover, assume that $b \leq 0.1(n - m)$ , $m \leq \frac{(n - 2b)}{2}$ , and $\delta = 0$ is used to compute clipping parameter $\tau_{l}$ for CenteredClip. Next, assume that + +$$ +\gamma_ {t} = \min \left\{\frac {1}{4 L}, \sqrt {\frac {7 n R _ {0} ^ {2}}{1 2 0 \cdot 2 ^ {t} \sigma^ {2} K _ {t}}}, \sqrt {\frac {m ^ {2} R _ {0} ^ {2}}{7 2 \cdot 2 ^ {t} C \sigma^ {2} n ^ {2} b ^ {2}}} \right\}, \quad \Delta_ {\max } ^ {k, t} = \frac {(1 + \sqrt {3}) \sqrt {2} \sigma}{\sqrt {n _ {k} ^ {t} - m}}, \tag {46} +$$ + +$$ +K _ {t} = \left\lceil \max \left\{\frac {1 6 L}{\mu}, \frac {3 2 \sigma^ {2} 2 ^ {t}}{\mu^ {2} R _ {0} ^ {2}}, \frac {2 4 \sqrt {2 C} n b \sigma 2 ^ {\frac {t}{2}}}{m \mu R _ {0}} \right\}\right\rceil , \quad r = \left\lceil \log_ {2} \frac {\mu R _ {0} ^ {2}}{\varepsilon} \right\rceil - 1 \tag {47} +$$ + +where $R_0 \geq \| x^0 - x^*\|$ , $\Delta_{\max}^{k,t}$ is the parameter for verification 3 at iteration $k$ of BTARD-SGD during the $t$ -th restart, $n_k^t$ is the total number of workers at iteration $k$ of $t$ -th restart. Then, we have $\mathbb{E}[f(\widehat{x}^r) - f(x^*)] \leq \varepsilon$ after $r$ restarts of BTARD-SGD and the total number of executed iterations of BTARD-SGD is + +$$ +\sum_ {t = 1} ^ {r} K _ {t} = \mathcal {O} \left(\frac {L}{\mu} \log \frac {\mu R _ {0} ^ {2}}{\varepsilon} + \frac {\sigma^ {2}}{n \mu \varepsilon} + \frac {n b \sigma}{m \sqrt {\mu \varepsilon}}\right). \tag {48} +$$ + +Proof. Theorem E.5 implies that BTARD-SGD with + +$$ +\gamma = \min \left\{\frac {1}{4 L}, \sqrt {\frac {7 n R _ {0} ^ {2}}{1 2 0 \sigma^ {2} K}}, \sqrt {\frac {m ^ {2} R _ {0} ^ {2}}{7 2 C \sigma^ {2} n ^ {2} b ^ {2}}} \right\} +$$ + +guarantees + +$$ +\mathbb {E} \left[ f (\overline {{x}} ^ {K}) - f (x ^ {*}) \right] \leq \frac {2 R _ {0} ^ {2}}{\gamma K} +$$ + +after $K$ iterations. Therefore, after the first restart we have + +$$ +\mathbb {E} [ f (\widehat {x} ^ {1}) - f (x ^ {*}) ] \leq \frac {2 R _ {0} ^ {2}}{\gamma_ {1} K _ {1}} \leq \frac {\mu R _ {0} ^ {2}}{4}. +$$ + +From $\mu$ -strong convexity of $f$ and $\nabla f(x^{*}) = 0$ we have + +$$ +\frac {\mu}{2} \| \widehat {x} ^ {1} - x ^ {*} \| ^ {2} \leq f (\widehat {x} ^ {1}) - f (x ^ {*}) \Longrightarrow \mathbb {E} [ \| \widehat {x} ^ {1} - x ^ {*} \| ^ {2} ] \leq \frac {R _ {0} ^ {2}}{2}. +$$ + +Next, assume that we have $\mathbb{E}[f(\widehat{x}^t) - f(x^*)] \leq \frac{\mu R_0^2}{2^{t + 1}}$ , $\mathbb{E}[\| \widehat{x}^t - x^* \|^2] \leq \frac{R_0^2}{2^t}$ for some $t \leq r - 1$ . Then, Theorem E.5 implies that + +$$ +\mathbb {E} [ f (\widehat {x} ^ {t + 1}) - f (x ^ {*}) \mid x ^ {t} ] \leq \frac {2 \| \widehat {x} ^ {t} - x ^ {*} \| ^ {2}}{\gamma_ {t} K _ {t}}. +$$ + +Taking the full expectation from the both sides of previous inequality we get + +$$ +\mathbb {E} [ f (\widehat {x} ^ {t + 1}) - f (x ^ {*}) ] \leq \frac {2 \mathbb {E} [ \| \widehat {x} ^ {t} - x ^ {*} \| ^ {2} ]}{\gamma_ {t} K _ {t}} \leq \frac {2 R _ {0} ^ {2}}{2 ^ {t} \gamma_ {t} K _ {t}} \leq \frac {\mu R _ {0} ^ {2}}{2 ^ {t + 2}}. +$$ + +From $\mu$ -strong convexity of $f$ and $\nabla f(x^{*}) = 0$ we have + +$$ +\frac {\mu}{2} \| \widehat {x} ^ {t + 1} - x ^ {*} \| ^ {2} \leq f (\widehat {x} ^ {t + 1}) - f (x ^ {*}) \Longrightarrow \mathbb {E} [ \| \widehat {x} ^ {t + 1} - x ^ {*} \| ^ {2} ] \leq \frac {R _ {0} ^ {2}}{2 ^ {t + 1}}. +$$ + +Therefore, by mathematical induction we have that for all $t = 1,\dots ,r$ + +$$ +\mathbb {E} [ f (\widehat {x} ^ {t}) - f (x ^ {*}) ] \leq \frac {\mu R _ {0} ^ {2}}{2 ^ {t + 1}}, \quad \mathbb {E} \left[ \| \widehat {x} ^ {t} - x ^ {*} \| ^ {2} \right] \leq \frac {R _ {0} ^ {2}}{2 ^ {t}}. +$$ + +Then, after $r = \left\lceil \log_2\frac{\mu R_0^2}{\varepsilon}\right\rceil -1$ restarts of BTARD-SGD we have $\mathbb{E}[f(\widehat{x}^r) - f(x^*)]\leq \varepsilon$ . The total number of iterations executed by BTARD-SGD is + +$$ +\begin{array}{l} \sum_ {t = 1} ^ {r} K _ {t} = \mathcal {O} \left(\sum_ {t = 1} ^ {r} \max \left\{\frac {L}{\mu}, \frac {\sigma^ {2} 2 ^ {t}}{\mu^ {2} R _ {0} ^ {2}}, \frac {n b \sigma 2 ^ {\frac {t}{2}}}{m \mu R _ {0}} \right\}\right) \\ { = } { \mathcal { O } \left( \frac { L } { \mu } r + \frac { \sigma ^ { 2 } 2 ^ { r } } { \mu ^ { 2 } R _ { 0 } ^ { 2 } } + \frac { n b \sigma 2 ^ { \frac { r } { 2 } } } { m \mu R _ { 0 } } \right) } \\ { = } { \mathcal { O } \left( \frac { L } { \mu } \log \frac { \mu R _ { 0 } ^ { 2 } } { \varepsilon } + \frac { \sigma ^ { 2 } } { \mu ^ { 2 } R _ { 0 } ^ { 2 } } \cdot \frac { \mu R _ { 0 } ^ { 2 } } { \varepsilon } + \frac { n b \sigma } { m \mu R _ { 0 } } \cdot \sqrt { \frac { \mu R _ { 0 } ^ { 2 } } { \varepsilon } } \right) } \\ { = } { \mathcal { O } \left( \frac { L } { \mu } \log \frac { \mu R _ { 0 } ^ { 2 } } { \varepsilon } + \frac { \sigma ^ { 2 } } { n \mu \varepsilon } + \frac { n b \sigma } { m \sqrt { \mu \varepsilon } } \right) . } \\ \end{array} +$$ + +![](images/faadd98500fb36d004602a1665b8c41b974b1618046e3b2726dd04fd6ec9f335.jpg) + +# E.4. Convergence guarantees for BTARD-Clipped-SGD + +The results for BTARD-SGD and RESTARTED-BTARD-SGD rely on As. 3.2 that the stochastic gradients have not too heavy tails, i.e., sub-quadratically decreasing tails. The main reason why it is needed in the analysis is to prevent too often extra computations because of Verification 3 from BTARD when all workers honestly follow the protocol. However, in many important NLP tasks such as BERT training (Zhang et al., 2020), the noise in the stochastic gradient has such a heavy noise that As. 3.2 becomes unnatural. + +# Algorithm 9 BTARD-CLIPPED-SGD + +Input: $x^0$ - starting point, $\gamma$ - stepsize, $K$ - number of iterations, $\{s_{i,k}\}_{i,k=0,0}^{n,K-1}$ - seeds for batches computations, $\{\lambda_k\}_{k=0}^{K-1}$ - gradient clipping parameter + +1: $C_0 = \mathsf{Banned}_{-1} = \emptyset$ +2: for $k = 0,1,\ldots ,K - 1$ do + +3: Worker $i$ computes $\widetilde{g}_i^k = \left\{ \begin{array}{ll} \min \left\{1, \frac{\lambda_k}{\|\nabla f(x^k,\xi_{i,k})\|}\right\} \nabla f(x^k,\xi_{i,k}), & \text{if } i \in \mathcal{G}_k \setminus \mathcal{C}_k, \\ * , & \text{if } i \in \mathcal{B}_k \setminus \mathcal{C}_k, \end{array} \right.$ where $\xi_{i,k}$ is generated via seed $s_{i,k}$ available to every worker + +4: $\left(\widehat{g}^{k},\mathrm{public\_info}_{k}\right) = \mathrm{BTARD}(\widetilde{g}_{i_{1}^{k}}^{k},g_{i_{1}^{k}}^{k},\ldots ,\widetilde{g}_{i_{a_{k}}^{k}}^{k}),$ where $\{i_1^k,\dots,i_{a_k}^k\} = (\mathcal{G}_k\cup \mathcal{B}_k)\setminus \mathcal{C}_k$ +7: Choose $2m$ workers $c_{1}^{k + 1},\ldots ,c_{m}^{k + 1},u_{1}^{k + 1},\ldots ,u_{m}^{k + 1}$ uniformly at random without replacement, $\mathcal{C}_{k + 1} = \{c_1^{k + 1},\dots ,c_m^{k + 1}\} ,\mathcal{U}_{k + 1} = \{u_1^{k + 1},\dots ,u_m^{k + 1}\}$ +8: Banned $k =$ CHECKCOMPUTATIONS $(\mathcal{C}_{k + 1},\mathcal{U}_{k + 1}$ ,public $\_ \mathrm{info}_k)$ +9: $x^{k + 1} = \mathrm{proj}_Q(x^k -\gamma \widehat{g}^k)\coloneqq \mathrm{argmin}_{x\in Q}\| x - (x^k -\gamma \widehat{g}^k)\|$ +10: $\mathcal{G}_{k + 1} = \mathcal{G}_k\setminus \mathrm{Banned}_{k - 1}$ +11: $\mathcal{B}_{k + 1} = \mathcal{B}_k\setminus \mathrm{Banned}_{k - 1}$ + +To handle the problems with heavy-tailed noise distributions we consider BTARD-CLIPPED-SGD (see Algorithm 9) applied to solve (3) such that $Q$ is bounded. Essentially, this algorithm coincides with BTARD-SGD up to the following change: all good peers $i \in G_k \setminus C_k$ use clipped stochastic gradients $\widetilde{g}_i^k = (\widetilde{g}_i^k(1)^\top, \ldots, \widetilde{g}_i^k(n_k - m)^\top)$ , where $\widetilde{g}_i^k(l) = \min\left\{1, \frac{\lambda_k}{\|g_i^k(l)\|} \right\} g_i^k(l)$ , $l = 1, \ldots, n_k - m$ , and $g_i^k$ is the stochastic gradient. Next, we introduce the following assumption. + +Assumption E.1. There exist such constant $G > 0$ , $s_0 \in [d]$ , and $\alpha \in (1,2]$ that for any set of indices $S = (i_1,\ldots ,i_d)$ , $1 \leq i_{1} < i_{2} < \ldots < i_{s} \leq d$ , $s \geq s_0$ and arbitrary $x \in Q$ stochastic gradient $\nabla f(x,\xi)$ satisfy + +$$ +\mathbb {E} [ \nabla f (x, \xi) ] = \nabla f (x), \quad \mathbb {E} \left[ \left\| \nabla_ {[ S ]} f (x, \xi) \right\| ^ {\alpha} \right] \leq \left(\frac {\sqrt {s} G}{\sqrt {d}}\right) ^ {\alpha}, \tag {49} +$$ + +where $\nabla_{[S]}f(x,\xi)$ is defined in As. 3.1. + +This is a modified version of the assumption used in Zhang et al. (2020). When $\alpha < 2$ the variance of the stochastic gradient can be unbounded. One can show that in such a regime vanilla SGD can diverge (Zhang et al., 2020). + +Under As. E.1 we derive the convergence results for convex and strongly convex problems. + +# E.4.1. QUALITY OF THE AGGREGATION + +Since now we have As. E.1 instead of As. 3.1 and 3.2 it is needed to derive new guarantees for the quality of the aggregation. We start with the following useful lemma about the properties of clipped stochastic gradeints. + +Lemma E.5 (See also Lemma 9 from Zhang et al. (2020)). Let As. E.1 holds and $i,j\in \mathcal{G}_k\setminus \mathcal{C}_k$ . Then, for all $l = 1,2,\ldots ,n_k - m$ we have + +$$ +\sqrt {\mathbb {E} \left[ \| \widetilde {g} _ {i} ^ {k} (l) - \widetilde {g} _ {j} ^ {k} (l) \| ^ {4} \mid x ^ {k} \right]} \leq 4 \lambda_ {k} ^ {\frac {4 - \alpha}{2}} \left(\frac {G}{\sqrt {n _ {k} - m}}\right) ^ {\frac {\alpha}{2}}, \tag {50} +$$ + +$$ +\mathbb {E} \left[ \| \bar {g} ^ {k} (l) \| ^ {2} \mid x ^ {k} \right] \leq \frac {G ^ {\alpha} \lambda_ {k} ^ {2 - \alpha}}{\left(n _ {k} - m\right) ^ {\frac {\alpha}{2}}}, \tag {51} +$$ + +$$ +\left\| \mathbb {E} \left[ \bar {g} ^ {k} (l) \mid x ^ {k} \right] - \nabla_ {(l)} f \left(x ^ {k}\right) \right\| ^ {2} \leq \frac {G ^ {2 \alpha}}{\left(n _ {k} - m\right) ^ {\alpha} \lambda_ {k} ^ {2 (\alpha - 1)}}, \tag {52} +$$ + +where $\overline{g}^k (l) = \frac{1}{|\mathcal{G}_k\setminus\mathcal{C}_k|}\sum_{i\in \mathcal{G}_k\setminus \mathcal{C}_k}\widetilde{g}_i^k (l)$ for all $l = 1,\ldots ,n_k - m$ + +Proof. First of all, we derive + +$$ +\begin{array}{l} \mathbb {E} \left[ \| \widetilde {g} _ {i} ^ {k} (l) - \widetilde {g} _ {j} ^ {k} (l) \| ^ {4} \mid x ^ {k} \right] = \mathbb {E} \left[ \| \widetilde {g} _ {i} ^ {k} (l) - \widetilde {g} _ {j} ^ {k} (l) \| ^ {\alpha} \| \widetilde {g} _ {i} ^ {k} (l) - \widetilde {g} _ {j} ^ {k} (l) \| ^ {4 - \alpha} \mid x ^ {k} \right] \\ \leq 8 \lambda_ {k} ^ {4 - \alpha} \mathbb {E} \left[ \| \nabla_ {(l)} f (x ^ {k}, \xi_ {i, k}) \| ^ {\alpha} + \| \nabla_ {(l)} f (x ^ {k}, \xi_ {j, k}) \| ^ {\alpha} \mid x ^ {k} \right] \\ \stackrel {(4 9)} {\leq} \quad 1 6 \lambda_ {k} ^ {4 - \alpha} \left(\frac {G}{\sqrt {n _ {k} - m}}\right) ^ {\alpha} \\ \end{array} +$$ + +implying (50). Next, for all $i\in \mathcal{G}_k\setminus \mathcal{C}_k$ we have + +$$ +\begin{array}{l} \mathbb {E} \left[ \| \widetilde {g} _ {i} ^ {k} (l) \| ^ {2} \mid x ^ {k} \right] = \mathbb {E} \left[ \| \widetilde {g} _ {i} ^ {k} (l) \| ^ {\alpha} \| \widetilde {g} _ {i} ^ {k} (l) \| ^ {2 - \alpha} \mid x ^ {k} \right] \leq \lambda_ {k} ^ {2 - \alpha} \mathbb {E} \left[ \| \nabla_ {(l)} f (x ^ {k}, \xi_ {i, k}) \| ^ {\alpha} \mid x ^ {k} \right] \\ \stackrel {(4 9)} {\leq} \frac {G ^ {\alpha} \lambda_ {k} ^ {2 - \alpha}}{(n _ {k} - m) ^ {\frac {\alpha}{2}}} \\ \end{array} +$$ + +implying + +$$ +\mathbb {E} \left[ \| \bar {g} ^ {k} (l) \| ^ {2} \mid x ^ {k} \right] \leq \frac {1}{| \mathcal {G} _ {k} \setminus \mathcal {C} _ {k} |} \sum_ {i \in \mathcal {G} _ {k} \setminus \mathcal {C} _ {k}} \mathbb {E} \left[ \| \tilde {g} _ {i} ^ {k} (l) \| ^ {2} \mid x ^ {k} \right] \leq \frac {G ^ {\alpha} \lambda_ {k} ^ {2 - \alpha}}{\left(n _ {k} - m\right) ^ {\frac {\alpha}{2}}}. +$$ + +Finally, for all $i\in \mathcal{G}_k\setminus \mathcal{C}_k$ we derive + +$$ +\begin{array}{l} \left\| \mathbb {E} \left[ \tilde {g} _ {i} ^ {k} (l) \mid x ^ {k} \right] - \nabla_ {(l)} f \left(x ^ {k}\right) \right\| = \left\| \mathbb {E} \left[ \tilde {g} _ {i} ^ {k} (l) - \nabla_ {(l)} f \left(x ^ {k}, \xi_ {i, k}\right) \mid x ^ {k} \right] \right\| \\ \leq \mathbb {E} \left[ \left\| \widetilde {g} _ {i} ^ {k} (l) - \nabla_ {(l)} f \left(x ^ {k}, \xi_ {i, k}\right) \right\| \mid x ^ {k} \right] \\ = \mathbb {E} \left[ \left\| \widetilde {g} _ {i} ^ {k} (l) - \nabla_ {(l)} f \left(x ^ {k}, \xi_ {i, k}\right) \right\| \mathbb {1} _ {\{\| \nabla_ {(l)} f \left(x ^ {k}, \xi_ {i, k}\right) \| \geq \lambda_ {k} \}} \mid x ^ {k} \right] \\ \leq \mathbb {E} \left[ \left\| \nabla_ {(l)} f \left(x ^ {k}, \xi_ {i, k}\right) \right\| \mathbb {1} _ {\{\| \nabla_ {(l)} f \left(x ^ {k}, \xi_ {i, k}\right) \| \geq \lambda_ {k} \}} \mid x ^ {k} \right] \\ \leq \frac {\mathbb {E} \left[ \left\| \nabla_ {(l)} f \left(x ^ {k} , \xi_ {i , k}\right) \right\| ^ {\alpha} \mathbb {1} _ {\{\| \nabla_ {(l)} f \left(x ^ {k} , \xi_ {i , k}\right) \| \geq \lambda_ {k} \}} \mid x ^ {k} \right]}{\lambda_ {k} ^ {\alpha - 1}} \\ \stackrel {(4 9)} {\leq} \frac {G ^ {\alpha}}{(n _ {k} - m) ^ {\frac {\alpha}{2}} \lambda_ {k} ^ {\alpha - 1}} \\ \end{array} +$$ + +implying + +$$ +\begin{array}{l} \left| \left| \mathbb {E} \left[ \bar {\mathcal {G}} ^ {k} (l) \mid x ^ {k} \right] - \nabla_ {(l)} f \left(x ^ {k}\right) \right| \right| ^ {2} \leq \frac {1}{\left| \mathcal {G} _ {k} \backslash \mathcal {C} _ {k} \right|} \sum_ {i \in \mathcal {G} _ {k} \backslash \mathcal {C} _ {k}} \mathbb {E} \left[ \| \tilde {\mathcal {G}} _ {i} ^ {k} (l) - \nabla_ {(l)} f \left(x ^ {k}\right) \| ^ {2} \mid x ^ {k} \right] \\ \leq \frac {G ^ {2 \alpha}}{(n _ {k} - m) ^ {\alpha} \lambda_ {k} ^ {2 (\alpha - 1)}}. \\ \end{array} +$$ + +![](images/7be6032c0904bca120ae17c7b78066825764236e627e5a0c547f56538b52870f.jpg) + +Next, we derive the guarantees for the quality of the aggregation in the case when the number of Byzantine peers violating the protocol $\widehat{b}_k$ is known at each iteration. + +Lemma E.6. Let As. E.1 hold and $b \leq 0.15(n - m)$ . Assume that $\widehat{b}_k$ is known for each worker at iteration $k$ , $\Delta_{\max}^k = 2\lambda_k = \frac{2\lambda}{\sqrt{n_k - m}}$ and $\delta = \widehat{\delta}_k$ is used to compute clipping parameter $\tau_l$ for CenteredClip. If the total number of iterations $T$ of CenteredClip satisfies $T \geq \log_{0.94}\frac{2\delta\sigma^2}{\mathbb{E}[\|v^0 - \overline{g}^k\|^2]}$ and CHECK AVERAGING is not triggered for any worker, then + +$$ +\mathbb {E} \left[ \| \widehat {g} ^ {k} - \bar {g} ^ {k} \| ^ {2} \mid x ^ {k} \right] \leq \widehat {\delta} _ {k} \left(C _ {1} \lambda^ {\frac {4 - \alpha}{2}} G ^ {\frac {\alpha}{2}} + C _ {2} \lambda^ {2}\right), \tag {53} +$$ + +$$ +\mathbb {E} \left[ \| \widehat {g} ^ {k} \| ^ {2} \mid x ^ {k} \right] \leq 2 \widehat {\delta_ {k}} \left(C _ {1} \lambda^ {\frac {4 - \alpha}{2}} G ^ {\frac {\alpha}{2}} + C _ {2} \lambda^ {2}\right) + 2 G ^ {\alpha} \lambda^ {2 - \alpha}, \tag {54} +$$ + +where $\overline{g}^k = \frac{1}{|\mathcal{G}_k\setminus\mathcal{C}_k|}\sum_{j\in \mathcal{G}_k\setminus \mathcal{C}_k}g_j^k$ $C_1 = 384$ and $C_2 = 4$ + +Proof. Consider the $i$ -th part of $\widehat{g}^k$ , i.e., consider $\widehat{g}^k(i)$ . If $i \in \mathcal{G}_k \setminus \mathcal{C}_k$ , then, in view of (50), we can directly apply Lemma E.1 and get + +$$ +\mathbb {E} \left[ \| \widehat {g} ^ {k} (i) - \overline {{g}} ^ {k} (i) \| ^ {2} \mid x ^ {k} \right] \leq 3 8 4 \widehat {\delta_ {k}} \lambda_ {k} ^ {\frac {4 - \alpha}{2}} \frac {G ^ {\frac {\alpha}{2}}}{(n _ {k} - m) ^ {\frac {\alpha}{4}}} = \frac {3 8 4 \widehat {\delta_ {k}} \lambda^ {\frac {4 - \alpha}{2}} G ^ {\frac {\alpha}{2}}}{n _ {k} - m}. +$$ + +Next, if $i\in \mathcal{B}_k\setminus \mathcal{C}_k$ , then + +$$ +\mathbb {E} \left[ \| \widehat {g} ^ {k} (i) - \overline {{g}} ^ {k} (i) \| ^ {2} \mid x ^ {k} \right] \leq (\Delta_ {\max} ^ {k}) ^ {2} = 4 \lambda_ {k} ^ {2} = \frac {4 \lambda^ {2}}{n _ {k} - m}. +$$ + +Putting all together, we derive + +$$ +\begin{array}{l} \mathbb {E} \left[ \| \widehat {g} ^ {k} - \overline {{g}} ^ {k} \| ^ {2} \mid x ^ {k} \right] = \sum_ {i \in \mathcal {G} _ {k} \backslash \mathcal {C} _ {k}} \mathbb {E} \left[ \| \widehat {g} ^ {k} (i) - \overline {{g}} ^ {k} (i) \| ^ {2} \mid x ^ {k} \right] + \sum_ {i \in \mathcal {B} _ {k} \backslash \mathcal {C} _ {k}} \mathbb {E} \left[ \| \widehat {g} ^ {k} (i) - \overline {{g}} ^ {k} (i) \| ^ {2} \mid x ^ {k} \right] \\ \leq (1 - \widehat {\delta} _ {k}) (n _ {k} - m) \cdot \frac {3 8 4 \widehat {\delta} _ {k} \lambda^ {\frac {4 - \alpha}{2}} G ^ {\frac {\alpha}{2}}}{n _ {k} - m} + \widehat {\delta} _ {k} (n _ {k} - m) \cdot \frac {4 \lambda^ {2}}{n _ {k} - m} \\ \leq \widehat {\delta} _ {k} (C _ {1} \lambda^ {\frac {4 - \alpha}{2}} G ^ {\frac {\alpha}{2}} + C _ {2} \lambda^ {2}). \\ \end{array} +$$ + +Using (51) we obtain + +$$ +\begin{array}{l} \mathbb {E} \left[ \| \widehat {g} ^ {k} \| ^ {2} \mid x ^ {k} \right] \leq 2 \mathbb {E} \left[ \| \widehat {g} ^ {k} - \overline {{g}} ^ {k} \| ^ {2} \mid x ^ {k} \right] + 2 \mathbb {E} \left[ \| \overline {{g}} ^ {k} \| ^ {2} \mid x ^ {k} \right] \\ \stackrel {(5 3)} {\leq} \quad 2 \widehat {\delta} _ {k} \left(C _ {1} \lambda^ {\frac {4 - \alpha}{2}} G ^ {\frac {\alpha}{2}} + C _ {2} \lambda^ {2}\right) + 2 \sum_ {i \in \left(\mathcal {G} _ {k} \cup \mathcal {B} _ {k}\right) \backslash \mathcal {C} _ {k}} \frac {G ^ {\alpha} \lambda_ {k} ^ {2 - \alpha}}{\left(n _ {k} - m\right) ^ {\frac {\alpha}{2}}} \\ { = } { 2 \widehat { \delta } _ { k } \big ( C _ { 1 } \lambda ^ { \frac { 4 - \alpha } { 2 } } G ^ { \frac { \alpha } { 2 } } + C _ { 2 } \lambda ^ { 2 } \big ) + 2 G ^ { \alpha } \lambda ^ { 2 - \alpha } . } \\ \end{array} +$$ + +![](images/64885ecdeb71dc79c94e5e22fe5c3d84018743e1f7df7217d1681cc932615b27.jpg) + +We notice that Verification 3 can be simplified in the following way: if at least on good peer $i$ notices that $\| \widetilde{g}_i^k (j) - \widehat{g}^k (j)\| > \Delta_{\max}^k = 2\lambda_k$ , then peer $i$ should accuse $j$ -th peer and both are removed from the training process. In this scenario, there is no sense for Byzantine workers in triggering to deviate significantly from the clipped stochastic gradients of the good peers. + +As for BTARD-SGD, when $\widehat{b}_k$ is unknown we always use CENTEREDCLIP with $\tau_l = \infty$ for all $l \geq 0$ , i.e., good peers compute an exact average. In this settings, even 1 Byzantine worker can significantly shift the average in all parts of the vector. The next lemma quantifies the negative effect of Byzantine workers in this case. + +Lemma E.7. Let As. E.1 hold and $b \leq 0.15(n - m)$ . Assume that $\widehat{b}_k$ is known for each worker at iteration $k$ , $\Delta_{\max}^k = 2\lambda_k = \frac{2\lambda}{\sqrt{n_k - m}}$ and $\delta = \widehat{\delta}_k$ is used to compute clipping parameter $\tau_l$ for CenteredClip. If the total number of iterations $T$ of CenteredClip satisfies $T \geq \log_{0.94}\frac{2\delta\sigma^2}{\mathbb{E}[||v^0 - \overline{g}^k\|^2]}$ and CHECK AVERAGING is not triggered for any worker, then + +$$ +\mathbb {E} \left[ \| \widehat {g} ^ {k} - \bar {g} ^ {k} \| ^ {2} \mid x ^ {k} \right] \leq C _ {2} \lambda^ {2} \mathbb {1} _ {k, v}, \tag {55} +$$ + +$$ +\mathbb {E} \left[ \| \widehat {g} ^ {k} \| ^ {2} \mid x ^ {k} \right] \leq 2 C _ {2} \lambda^ {2} \mathbb {1} _ {k, v} + 2 G ^ {\alpha} \lambda^ {2 - \alpha}, \tag {56} +$$ + +where $\overline{g}^k = \frac{1}{|\mathcal{G}_k\backslash\mathcal{C}_k|}\sum_{j\in \mathcal{G}_k\backslash \mathcal{C}_k}g_j^k$ $C_2 = 4$ , and $\mathbb{1}_{k,v}$ is an indicator function of the event that at least 1 Byzantine peer violates the protocol at iteration $k$ + +Proof. For all $i\in (\mathcal{G}_k\cup \mathcal{B}_k)\setminus \mathcal{C}_k$ we have + +$$ +\mathbb {E} \left[ \| \widehat {g} ^ {k} (i) - \overline {{g}} ^ {k} (i) \| ^ {2} \mid x ^ {k} \right] \leq (\Delta_ {\max} ^ {k}) ^ {2} \mathbb {1} _ {k, v} = 4 \lambda_ {k} ^ {2} \mathbb {1} _ {k, v} = \frac {4 \lambda^ {2}}{n _ {k} - m} \mathbb {1} _ {k, v} +$$ + +implying + +$$ +\begin{array}{l} \mathbb {E} \left[ \| \widehat {g} ^ {k} - \overline {{g}} ^ {k} \| ^ {2} \mid x ^ {k} \right] = \sum_ {i \in \left(\mathcal {G} _ {k} \cup \mathcal {B} _ {k}\right) \backslash \mathcal {C} _ {k}} \mathbb {E} \left[ \| \widehat {g} ^ {k} (i) - \overline {{g}} ^ {k} (i) \| ^ {2} \mid x ^ {k} \right] \\ \leq (n _ {k} - m) \cdot \frac {4 \lambda^ {2}}{n _ {k} - m} \mathbb {1} _ {k, v} = C _ {2} \lambda^ {2} \mathbb {1} _ {k, v}. \\ \end{array} +$$ + +Using (51) we obtain + +$$ +\begin{array}{l} \mathbb {E} \left[ \| \widehat {g} ^ {k} \| ^ {2} \mid x ^ {k} \right] \leq 2 \mathbb {E} \left[ \| \widehat {g} ^ {k} - \overline {{g}} ^ {k} \| ^ {2} \mid x ^ {k} \right] + 2 \mathbb {E} \left[ \| \overline {{g}} ^ {k} \| ^ {2} \mid x ^ {k} \right] \\ \stackrel {(5 3)} {\leq} 2 C _ {2} \lambda^ {2} \mathbb {1} _ {k, v} + 2 \sum_ {i \in (\mathcal {G} _ {k} \cup \mathcal {B} _ {k}) \backslash \mathcal {C} _ {k}} \frac {G ^ {\alpha} \lambda_ {k} ^ {2 - \alpha}}{(n _ {k} - m) ^ {\frac {\alpha}{2}}} = 2 C _ {2} \lambda^ {2} \mathbb {1} _ {k, v} + 2 G ^ {\alpha} \lambda^ {2 - \alpha}. \\ \end{array} +$$ + +![](images/041c4c63f15e317f9d8e9b56cbe09150b82695e23f353b87dcc3817a6a57a18f.jpg) + +# E.4.2. CONVEX CASE + +In this section, we provide the complete statements and the full proofs of the convergence results for BTARD-CLIPPED-SGD when the objective function $f$ is smooth and convex. We start with the case when the number of Byzantine peers violating the protocol $\widehat{b}_k$ is known at each iteration. + +Theorem E.8. Let As. E.1 hold, $Q$ is bounded, $f$ be convex, $x^{*}$ be some optimum of $f$ , and $\nabla f(x^{*}) = 0$ . Moreover, assume that $b \leq 0.15(n - m)$ , $m \leq (n - 2b)/2$ , and the exact number of attacking Byzantine peers is known to all good peers at each iteration. Next, assume that + +$$ +\gamma = \min \left\{\frac {R _ {0}}{\sqrt {6} G K ^ {\frac {1}{\alpha}}}, \frac {m R _ {0}}{1 2 G n \sqrt {1 0 \delta \left(C _ {1} K ^ {\frac {4 - \alpha}{2 \alpha}} + C _ {2} K ^ {\frac {2}{\alpha}}\right)}} \right\}, \quad \Delta_ {\max } ^ {k} = 2 \lambda_ {k} = \frac {2 \lambda}{\sqrt {n _ {k} - m}}, \tag {57} +$$ + +$$ +\lambda = G K ^ {\frac {1}{\alpha}}, \tag {58} +$$ + +where $R_0 \geq \| x^0 - x^*\|$ and $\Delta_{\mathrm{max}}^k$ is the parameter for verification 3 at iteration $k$ of BTARD-CLIPPED-SGD. Then, we have $\mathbb{E}[f(\overline{x}^K) - f(x^*)] \leq \varepsilon$ after $K$ iterations of BTARD-CLIPPED-SGD, where + +$$ +K = \mathcal {O} \left(\left(\frac {G R _ {0}}{\varepsilon}\right) ^ {\frac {\alpha}{\alpha - 1}} + \left(\frac {n \sqrt {\delta} G R _ {0}}{m \varepsilon}\right) ^ {\frac {\alpha}{\alpha - 1}}\right) \tag {59} +$$ + +and $\overline{x}^K = \frac{1}{K}\sum_{k = 0}^{K - 1}$ + +Proof. Non-expansiveness of the projection operator and convexity of $f$ imply + +$$ +\begin{array}{l} \left\| x ^ {k + 1} - x ^ {*} \right\| ^ {2} = \left\| \operatorname {p r o j} _ {Q} \left(x ^ {k} - \gamma \widehat {g} ^ {k}\right) - \operatorname {p r o j} _ {Q} \left(x ^ {*}\right) \right\| ^ {2} \\ \leq \| x ^ {k} - x ^ {*} - \gamma \widehat {g} ^ {k} \| ^ {2} \\ = \| x ^ {k} - x ^ {*} \| ^ {2} - 2 \gamma \langle x ^ {k} - x ^ {*}, \widehat {g} ^ {k} \rangle + \gamma^ {2} \| \widehat {g} ^ {k} \| ^ {2} \\ = \| x ^ {k} - x ^ {*} \| ^ {2} - 2 \gamma \langle x ^ {k} - x ^ {*}, \nabla f (x ^ {k}) \rangle - 2 \gamma \langle x ^ {k} - x ^ {*}, \widehat {g} ^ {k} - \nabla f (x ^ {k}) \rangle + \gamma^ {2} \| \widehat {g} ^ {k} \| ^ {2} \\ \leq \| x ^ {k} - x ^ {*} \| ^ {2} - 2 \gamma (f (x ^ {k}) - f (x ^ {*})) - 2 \gamma \langle x ^ {k} - x ^ {*}, \widehat {g} ^ {k} - \nabla f (x ^ {k}) \rangle + \gamma^ {2} \| \widehat {g} ^ {k} \| ^ {2}. \\ \end{array} +$$ + +Taking conditional expectation $\mathbb{E}[\cdot \mid x^{k}]$ from the both sides of previous inequality we derive + +$$ +\begin{array}{l} \mathbb {E} \left[ \| x ^ {k + 1} - x ^ {*} \| ^ {2} \mid x ^ {k} \right] \leq \| x ^ {k} - x ^ {*} \| ^ {2} - 2 \gamma (f (x ^ {k}) - f (x ^ {*})) \\ - 2 \gamma \mathbb {E} \left[ \langle x ^ {k} - x ^ {*}, \widehat {g} ^ {k} - \nabla f (x ^ {k}) \rangle \mid x ^ {k} \right] + \gamma^ {2} \mathbb {E} \left[ \| \widehat {g} ^ {k} \| ^ {2} \mid x ^ {k} \right] \\ \stackrel {(5 4)} {\leq} \| x ^ {k} - x ^ {*} \| ^ {2} - 2 \gamma (f (x ^ {k}) - f (x ^ {*})) + 2 \gamma^ {2} G ^ {\alpha} \lambda^ {2 - \alpha} \\ - 2 \gamma \left\langle x ^ {k} - x ^ {*}, \mathbb {E} \left[ \widehat {g} ^ {k} - \bar {g} ^ {k} \mid x ^ {k} \right] \right\rangle + 2 \gamma^ {2} \widehat {\delta} _ {k} \left(C _ {1} \lambda^ {\frac {4 - \alpha}{2}} G ^ {\frac {\alpha}{2}} + C _ {2} \lambda^ {2}\right) \\ = \| x ^ {k} - x ^ {*} \| ^ {2} - 2 \gamma (f (x ^ {k}) - f (x ^ {*})) + 2 \gamma^ {2} G ^ {2} K ^ {\frac {2 - \alpha}{\alpha}} \\ - 2 \gamma \left\langle x ^ {k} - x ^ {*}, \mathbb {E} \left[ \widehat {g} ^ {k} - \overline {{g}} ^ {k} \mid x ^ {k} \right] \right\rangle + \frac {2 \gamma^ {2} G ^ {2} (C _ {1} K ^ {\frac {4 - \alpha}{2 \alpha}} + C _ {2} K ^ {\frac {2}{\alpha}})}{n _ {k} - m} \widehat {b} _ {k}. \\ \end{array} +$$ + +To estimate the inner product in the right-hand side we apply Cauchy-Schwarz inequality: + +$$ +\begin{array}{l} - 2 \gamma \left\langle x ^ {k} - x ^ {*}, \mathbb {E} \left[ \widehat {g} ^ {k} - \overline {{g}} ^ {k} \mid x ^ {k} \right] \right\rangle \leq 2 \gamma \| x ^ {k} - x ^ {*} \| \cdot \left\| \mathbb {E} \left[ \widehat {g} ^ {k} - \overline {{g}} ^ {k} \mid x ^ {k} \right] \right\| \\ \leq 2 \gamma \| x ^ {k} - x ^ {*} \| \mathbb {E} \left[ \| \widehat {g} ^ {k} - \bar {g} ^ {k} \| \mid x ^ {k} \right] \\ \leq 2 \gamma \| x ^ {k} - x ^ {*} \| \sqrt {\mathbb {E} \left[ \| \hat {g} ^ {k} - \bar {g} ^ {k} \| ^ {2} \mid x ^ {k} \right]} \\ \stackrel {(5 3)} {\leq} 2 \gamma \| x ^ {k} - x ^ {*} \| \sqrt {\widehat {\delta} _ {k} \left(C _ {1} \lambda^ {\frac {4 - \alpha}{2}} G ^ {\frac {\alpha}{2}} + C _ {2} \lambda^ {2}\right)} \\ = \frac {2 \gamma G \| x ^ {k} - x ^ {*} \| \sqrt {C _ {1} K ^ {\frac {4 - \alpha}{2 \alpha}} + C _ {2} K ^ {\frac {2}{\alpha}}}}{\sqrt {n _ {k} - m}} \sqrt {\widehat {b} _ {k}} \\ \leq \frac {2 \gamma G \| x ^ {k} - x ^ {*} \| \sqrt {2 0 (C _ {1} K ^ {\frac {4 - \alpha}{2 \alpha}} + C _ {2} K ^ {\frac {2}{\alpha}})}}{\sqrt {7 n}} \sqrt {\widehat {b} _ {k}}, \\ \end{array} +$$ + +where in the last inequality we use $b \leq 0.15(n - m)$ , $m \leq \frac{(n - 2b)}{2}$ , $\gamma \leq \frac{1}{4L}$ , $n_k - m \geq n - 2b - m \geq \frac{7}{20} n$ . Putting all together we obtain + +$$ +\begin{array}{l} \mathbb {E} \left[ \| x ^ {k + 1} - x ^ {*} \| ^ {2} \mid x ^ {k} \right] \leq \| x ^ {k} - x ^ {*} \| ^ {2} - 2 \gamma \left(f (x ^ {k}) - f (x ^ {*})\right) + 2 \gamma^ {2} G ^ {2} K ^ {\frac {2 - \alpha}{\alpha}} \\ + \frac {2 \gamma G \| x ^ {k} - x ^ {*} \| \sqrt {2 0 (C _ {1} K ^ {\frac {4 - \alpha}{2 \alpha}} + C _ {2} K ^ {\frac {2}{\alpha}})}}{\sqrt {7 n}} \sqrt {\widehat {b} _ {k}} \\ + \frac {4 0 \gamma^ {2} G ^ {2} \left(C _ {1} K ^ {\frac {4 - \alpha}{2 \alpha}} + C _ {2} K ^ {\frac {2}{\alpha}}\right)}{7 n} \widehat {b} _ {k}. \\ \end{array} +$$ + +Taking the full expectation from the both sides of the above inequality and summing up the results for $k = 0,1,\dots ,T - 1$ we derive + +$$ +\begin{array}{l} \frac {2 \gamma}{T} \sum_ {k = 0} ^ {T - 1} \mathbb {E} [ f (x ^ {k}) - f (x ^ {*}) ] \leq \frac {1}{T} \sum_ {k = 0} ^ {T - 1} \left(\mathbb {E} \left[ \| x ^ {k} - x ^ {*} \| ^ {2} \right] - \mathbb {E} \left[ \| x ^ {k + 1} - x ^ {*} \| ^ {2} \right]\right) + 2 \gamma^ {2} G ^ {2} K ^ {\frac {2 - \alpha}{\alpha}} \\ + \frac {4 \gamma G \sqrt {5 \left(C _ {1} K ^ {\frac {4 - \alpha}{2 \alpha}} + C _ {2} K ^ {\frac {2}{\alpha}}\right)}}{\sqrt {n T}} \sum_ {k = 0} ^ {T - 1} \mathbb {E} \left[ \| x ^ {k} - x ^ {*} \| \sqrt {\widehat {b} _ {k}} \right] \\ + \frac {4 0 \gamma^ {2} G ^ {2} \left(C _ {1} K ^ {\frac {4 - \alpha}{2 \alpha}} + C _ {2} K ^ {\frac {2}{\alpha}}\right)}{7 n T} \sum_ {k = 0} ^ {T - 1} \mathbb {E} [ \widehat {b} _ {k} ] \\ \leq \frac {\| x ^ {0} - x ^ {*} \| ^ {2} - \mathbb {E} [ \| x ^ {K} - x ^ {*} \| ^ {2} ]}{K} + 2 \gamma^ {2} G ^ {2} K ^ {\frac {2 - \alpha}{\alpha}} \\ + \frac {4 \gamma G \sqrt {5 \left(C _ {1} K ^ {\frac {4 - \alpha}{2 \alpha}} + C _ {2} K ^ {\frac {2}{\alpha}}\right)}}{\sqrt {n} T} \sum_ {k = 0} ^ {T - 1} \sqrt {\mathbb {E} \left[ \| x ^ {k} - x ^ {*} \| ^ {2} \right] \mathbb {E} \left[ \widehat {b} _ {k} \right]} \\ + \frac {4 0 \gamma^ {2} G ^ {2} \left(C _ {1} K ^ {\frac {4 - \alpha}{2 \alpha}} + C _ {2} K ^ {\frac {2}{\alpha}}\right)}{7 n T} \sum_ {k = 0} ^ {T - 1} \mathbb {E} [ \widehat {b} _ {k} ]. \\ \end{array} +$$ + +From Jensen's inequality we have $f(\overline{x}^T) \leq \frac{1}{T} \sum_{k=0}^{T-1} f(x^k)$ , where $\overline{x}^T = \frac{1}{T} \sum_{k=0}^{T-1} x^k$ . Using this and new notation $R_k = \|x^k - x^*\|, k > 0$ , $R_0 \geq \|x^0 - x^*\|$ we get + +$$ +\begin{array}{l} 0 \leq 2 \gamma \mathbb {E} [ f (\bar {x} ^ {T}) - f (x ^ {*}) ] \leq \frac {R _ {0} ^ {2} - \mathbb {E} [ R _ {T} ^ {2} ]}{T} + 2 \gamma^ {2} G ^ {2} K ^ {\frac {2 - \alpha}{\alpha}} \\ + \frac {4 \gamma G \sqrt {5 \left(C _ {1} K ^ {\frac {4 - \alpha}{2 \alpha}} + C _ {2} K ^ {\frac {2}{\alpha}}\right)}}{\sqrt {n} T} \sum_ {k = 0} ^ {T - 1} \sqrt {\mathbb {E} \left[ R _ {k} ^ {2} \right] \mathbb {E} \left[ \widehat {b} _ {k} \right]} \\ + \frac {4 0 \gamma^ {2} G ^ {2} \left(C _ {1} K ^ {\frac {4 - \alpha}{2 \alpha}} + C _ {2} K ^ {\frac {2}{\alpha}}\right)}{7 n T} \sum_ {k = 0} ^ {T - 1} \mathbb {E} [ \widehat {b} _ {k} ] \tag {60} \\ \end{array} +$$ + +implying (after changing the indices) that + +$$ +\begin{array}{l} \mathbb {E} [ R _ {k} ^ {2} ] \leq R _ {0} ^ {2} + 2 \gamma^ {2} G ^ {2} k K ^ {\frac {2 - \alpha}{\alpha}} + \frac {4 \gamma G \sqrt {5 (C _ {1} K ^ {\frac {4 - \alpha}{2 \alpha}} + C _ {2} K ^ {\frac {2}{\alpha}})}}{\sqrt {n}} \sum_ {l = 0} ^ {k - 1} \sqrt {\mathbb {E} [ R _ {l} ^ {2} ] \mathbb {E} [ \widehat {b} _ {l} ]} \\ + \frac {4 0 \gamma^ {2} G ^ {2} \left(C _ {1} K ^ {\frac {4 - \alpha}{2 \alpha}} + C _ {2} K ^ {\frac {2}{\alpha}}\right)}{7 n} \sum_ {l = 0} ^ {k - 1} \mathbb {E} [ \widehat {b} _ {l} ] \tag {61} \\ \end{array} +$$ + +holds for all $k \geq 0$ . In the remaining part of the proof we derive by induction that + +$$ +\begin{array}{l} R _ {0} ^ {2} + 2 \gamma^ {2} G ^ {2} k K ^ {\frac {2 - \alpha}{\alpha}} + \frac {4 \gamma G \sqrt {5 (C _ {1} K ^ {\frac {4 - \alpha}{2 \alpha}} + C _ {2} K ^ {\frac {2}{\alpha}})}}{\sqrt {n}} \sum_ {l = 0} ^ {k - 1} \sqrt {\mathbb {E} [ R _ {l} ^ {2} ] \mathbb {E} [ \widehat {b} _ {l} ]} \\ + \frac {4 0 \gamma^ {2} G ^ {2} \left(C _ {1} K ^ {\frac {4 - \alpha}{2 \alpha}} + C _ {2} K ^ {\frac {2}{\alpha}}\right)}{7 n} \sum_ {l = 0} ^ {k - 1} \mathbb {E} [ \widehat {b} _ {l} ] \leq 2 R _ {0} ^ {2} \tag {62} \\ \end{array} +$$ + +for all $k = 0, \ldots, K$ . For $k = 0$ this inequality trivially holds. Next, assume that it holds for all $k = 0, 1, \ldots, T - 1$ , $T \leq K - 1$ . Let us show that it holds for $k = T$ as well. From (36) and (37) we have that $\mathbb{E}[R_k^2] \leq 2R_0^2$ for all $k = 0, 1, \ldots, T - 1$ . Therefore, + +$$ +\begin{array}{l} \mathbb {E} [ R _ {T} ^ {2} ] \leq R _ {0} ^ {2} + 2 \gamma^ {2} G ^ {2} T K ^ {\frac {2 - \alpha}{\alpha}} + \frac {4 \gamma G \sqrt {5 (C _ {1} K ^ {\frac {4 - \alpha}{2 \alpha}} + C _ {2} K ^ {\frac {2}{\alpha}})}}{\sqrt {n}} \sum_ {l = 0} ^ {T - 1} \sqrt {\mathbb {E} [ R _ {l} ^ {2} ] \mathbb {E} [ \widehat {b} _ {l} ]} \\ + \frac {4 0 \gamma^ {2} G ^ {2} (C _ {1} K ^ {\frac {4 - \alpha}{2 \alpha}} + C _ {2} K ^ {\frac {2}{\alpha}})}{7 n} \sum_ {l = 0} ^ {T - 1} \mathbb {E} [ \widehat {b} _ {l} ] \\ \leq R _ {0} ^ {2} + 2 \gamma^ {2} G ^ {2} T K ^ {\frac {2 - \alpha}{\alpha}} + \frac {4 \gamma G R _ {0} \sqrt {1 0 (C _ {1} K ^ {\frac {4 - \alpha}{2 \alpha}} + C _ {2} K ^ {\frac {2}{\alpha}})}}{\sqrt {n}} \sum_ {l = 0} ^ {T - 1} \sqrt {\mathbb {E} [ \widehat {b} _ {l} ]} \\ + \frac {4 0 \gamma^ {2} G ^ {2} (C _ {1} K ^ {\frac {4 - \alpha}{2 \alpha}} + C _ {2} K ^ {\frac {2}{\alpha}})}{7 n} \sum_ {l = 0} ^ {T - 1} \mathbb {E} [ \widehat {b} _ {l} ] \\ \end{array} +$$ + +If a Byzantine peer deviates from the protocol at iteration $k$ , it will be detected with some probability $p_k$ during the next iteration. One can lower bound this probability as + +$$ +p _ {k} \geq m \cdot \frac {| \mathcal {G} _ {k} |}{n _ {k}} \cdot \frac {1}{n _ {k}} = \frac {m (1 - \delta_ {k})}{n _ {k}} \geq \frac {m}{n}. +$$ + +Therefore, each individual Byzantine worker can violate the protocol no more than $1 / p$ times on average implying that + +$$ +\begin{array}{l} \mathbb {E} [ R _ {T} ^ {2} ] \leq R _ {0} ^ {2} + 2 \gamma^ {2} G ^ {2} T K ^ {\frac {2 - \alpha}{\alpha}} + \frac {4 \gamma G R _ {0} n \sqrt {1 0 (C _ {1} K ^ {\frac {4 - \alpha}{2 \alpha}} + C _ {2} K ^ {\frac {2}{\alpha}}) b}}{m \sqrt {n}} \\ + \frac {4 0 \gamma^ {2} G ^ {2} (C _ {1} K ^ {\frac {4 - \alpha}{2 \alpha}} + C _ {2} K ^ {\frac {2}{\alpha}}) n b}{7 n m} \\ \end{array} +$$ + +$$ +\begin{array}{l} \stackrel {T \le K} {\underset {\le} {\le}} R _ {0} ^ {2} + 2 \gamma^ {2} G ^ {2} K ^ {\frac {2}{\alpha}} + \frac {4 \gamma G R _ {0} n \sqrt {1 0 (C _ {1} K ^ {\frac {4 - \alpha}{2 \alpha}} + C _ {2} K ^ {\frac {2}{\alpha}}) \delta}}{m} \\ + \frac {4 0 \gamma^ {2} G ^ {2} (C _ {1} K ^ {\frac {4 - \alpha}{2 \alpha}} + C _ {2} K ^ {\frac {2}{\alpha}}) n \delta}{7 m}. \\ \end{array} +$$ + +Taking + +$$ +\gamma = \min \left\{\frac {R _ {0}}{\sqrt {6} G K ^ {\frac {1}{\alpha}}}, \frac {m R _ {0}}{1 2 G n \sqrt {1 0 \delta (C _ {1} K ^ {\frac {4 - \alpha}{2 \alpha}} + C _ {2} K ^ {\frac {2}{\alpha}})}} \right\} +$$ + +we ensure that + +$$ +\begin{array}{l} 2 \gamma^ {2} G ^ {2} K _ {\alpha} ^ {\frac {2}{\alpha}} + \frac {4 \gamma G R _ {0} n \sqrt {1 0 (C _ {1} K ^ {\frac {4 - \alpha}{2 \alpha}} + C _ {2} K ^ {\frac {2}{\alpha}}) \delta}}{m} \\ + \frac {4 0 \gamma^ {2} G ^ {2} (C _ {1} K ^ {\frac {4 - \alpha}{2 \alpha}} + C _ {2} K ^ {\frac {2}{\alpha}}) n \delta}{7 m} \leq \frac {R _ {0} ^ {2}}{3} + \frac {R _ {0} ^ {2}}{3} + \frac {R _ {0} ^ {2}}{3} = R _ {0} ^ {2} \\ \end{array} +$$ + +and, as a result, we get $\mathbb{E}[R_T^2] \leq 2R_0^2$ . Therefore, (62) holds for all $k = 0,1,\ldots,K$ . Together with (60) it implies + +$$ +\mathbb {E} \left[ f (\overline {{x}} ^ {K}) - f (x ^ {*}) \right] \leq \frac {R _ {0} ^ {2}}{\gamma K}. +$$ + +Next, from our stepsize rule (57) it follows that + +$$ +\mathbb {E} \left[ f (\bar {x} ^ {K}) - f (x ^ {*}) \right] = \mathcal {O} \left(\frac {G R _ {0}}{K ^ {\frac {1 - \alpha}{\alpha}}} + \frac {n \sqrt {\delta} G R _ {0}}{m K ^ {\frac {1 - \alpha}{\alpha}}}\right) +$$ + +meaning that after + +$$ +K = \mathcal {O} \left(\left(\frac {G R _ {0}}{\varepsilon}\right) ^ {\frac {\alpha}{\alpha - 1}} + \left(\frac {n \sqrt {\delta} G R _ {0}}{m \varepsilon}\right) ^ {\frac {\alpha}{\alpha - 1}}\right) +$$ + +iterations BTARD-CLIPPED-SGD guarantees $\mathbb{E}[f(\overline{x}^K) - f(x^*)] \leq \varepsilon$ . + +If there are no Byzantine peers $(\delta = 0)$ , the theorem establishes new result for the convergence of CLIPPED-SGD for convex objectives. In the strongly convex case, the theorem recovers the rates that are optimal in this setting as shown in Zhang et al. (2020). Next, when the number of attacking Byzantines is known at each iteration and $n\sqrt{\delta} /m = \mathcal{O}(1)$ , the complexity bound is the same as in the case when $\delta = 0$ . This means that the negative impact of Byzantine workers is negligible. Finally, the derived theoretical guarantees do not benefit from the increase of the total number of peers $n$ . However, the result holds even for non-smooth problems and it is known that parallelization does not help to improve the complexity bounds in such generality. Nevertheless, our results show that BTARD-CLIPPED-SGD provably converges to any predefined accuracy $\varepsilon > 0$ . This is a property that the majority of previous methods does not have (Karimireddy et al., 2020). + +Next, we derive the result without assuming that $\widehat{b}^k$ is known to all peers at each iteration. + +Theorem E.9. Let As. E.1 hold, $Q$ is bounded, $f$ be convex, $x^{*}$ be some optimum of $f$ , and $\nabla f(x^{*}) = 0$ . Moreover, assume that $b \leq 0.15(n - m)$ , $m \leq (n - 2b)/2$ , and $\delta = 0$ is used to compute clipping parameter $\tau_{l}$ for CenteredClip. Next, assume that + +$$ +\gamma = \min \left\{\frac {R _ {0}}{\sqrt {6} G K ^ {\frac {1}{\alpha}}}, \frac {m R _ {0}}{1 2 \sqrt {2 C _ {2}} G n b K ^ {\frac {1}{\alpha}}} \right\}, \quad \Delta_ {\max } ^ {k} = 2 \lambda_ {k} = \frac {2 \lambda}{\sqrt {n _ {k} - m}}, \tag {63} +$$ + +$$ +\lambda = G K ^ {\frac {1}{\alpha}}, \tag {64} +$$ + +where $R_0 \geq \|x^0 - x^*\|$ and $\Delta_{\max}^k$ is the parameter for verification 3 at iteration $k$ of BTARD-CLIPPED-SGD. Then, we have $\mathbb{E}[f(\overline{x}^K) - f(x^*)] \leq \varepsilon$ after $K$ iterations of BTARD-CLIPPED-SGD, where + +$$ +K = \mathcal {O} \left(\left(\frac {G R _ {0}}{\varepsilon}\right) ^ {\frac {\alpha}{\alpha - 1}} + \left(\frac {n b G R _ {0}}{m \varepsilon}\right) ^ {\frac {\alpha}{\alpha - 1}}\right) \tag {65} +$$ + +and $\overline{x}^K = \frac{1}{K}\sum_{k = 0}^{K - 1}$ + +Proof. The proof is almost identical to the proof of Theorem E.8. Following the same steps and using (55) and (56) instead of (53) and (54) respectively we obtain the same sequence of inequalities up to the following change: instead of $\widehat{\delta}_k$ we should use $\mathbb{1}_{k,v}$ . Therefore, we have + +$$ +\begin{array}{l} \mathbb {E} \left[ \| x ^ {k + 1} - x ^ {*} \| ^ {2} \mid x ^ {k} \right] \leq \| x ^ {k} - x ^ {*} \| ^ {2} - 2 \gamma \left(f (x ^ {k}) - f (x ^ {*})\right) + 2 \gamma^ {2} G ^ {2} K ^ {\frac {2 - \alpha}{\alpha}} \\ - 2 \gamma \left\langle x ^ {k} - x ^ {*}, \mathbb {E} \left[ \widehat {g} ^ {k} - \overline {{g}} ^ {k} \mid x ^ {k} \right] \right\rangle + 2 \gamma^ {2} C _ {2} G ^ {2} K ^ {\frac {2}{\alpha}} \mathbb {1} _ {k, v}. \\ \end{array} +$$ + +$$ +- 2 \gamma \left\langle x ^ {k} - x ^ {*}, \mathbb {E} \left[ \widehat {g} ^ {k} - \bar {g} ^ {k} \mid x ^ {k} \right] \right\rangle \leq 2 \gamma G \| x ^ {k} - x ^ {*} \| \sqrt {C _ {2}} K ^ {\frac {1}{\alpha}} \mathbb {1} _ {k, v}, +$$ + +and + +$$ +\begin{array}{l} \mathbb {E} \left[ \| x ^ {k + 1} - x ^ {*} \| ^ {2} \mid x ^ {k} \right] \leq \| x ^ {k} - x ^ {*} \| ^ {2} - 2 \gamma \left(f (x ^ {k}) - f (x ^ {*})\right) + 2 \gamma^ {2} G ^ {2} K ^ {\frac {2 - \alpha}{\alpha}} \\ + 2 \gamma G \sqrt {C _ {2}} K ^ {\frac {1}{\alpha}} \| x ^ {k} - x ^ {*} \| \mathbb {1} _ {k, v} + 2 \gamma^ {2} C _ {2} G ^ {2} K ^ {\frac {2}{\alpha}} \mathbb {1} _ {k, v}. \\ \end{array} +$$ + +Taking the full expectation from the both sides of the above inequality and summing up the results for $k = 0,1,\dots ,T - 1$ we derive + +$$ +\begin{array}{l} \frac {2 \gamma}{T} \sum_ {k = 0} ^ {T - 1} \mathbb {E} [ f (x ^ {k}) - f (x ^ {*}) ] \leq \frac {1}{T} \sum_ {k = 0} ^ {T - 1} \left(\mathbb {E} \left[ \| x ^ {k} - x ^ {*} \| ^ {2} \right] - \mathbb {E} \left[ \| x ^ {k + 1} - x ^ {*} \| ^ {2} \right]\right) + 2 \gamma^ {2} G ^ {2} K ^ {\frac {2 - \alpha}{\alpha}} \\ + \frac {2 \gamma G \sqrt {C _ {2}} K ^ {\frac {1}{\alpha}}}{T} \sum_ {k = 0} ^ {T - 1} \mathbb {E} \left[ \| x ^ {k} - x ^ {*} \| \mathbb {1} _ {k, v} \right] + \frac {2 \gamma^ {2} C _ {2} G ^ {2} K ^ {\frac {2}{\alpha}}}{T} \sum_ {k = 0} ^ {T - 1} \mathbb {E} [ \mathbb {1} _ {k, v} ] \\ \leq \frac {\| x ^ {0} - x ^ {*} \| ^ {2} - \mathbb {E} [ \| x ^ {K} - x ^ {*} \| ^ {2} ]}{K} + 2 \gamma^ {2} G ^ {2} K ^ {\frac {2 - \alpha}{\alpha}} \\ + \frac {2 \gamma G \sqrt {C _ {2}} K ^ {\frac {1}{\alpha}}}{T} \sum_ {k = 0} ^ {T - 1} \sqrt {\mathbb {E} \left[ \| x ^ {k} - x ^ {*} \| ^ {2} \right] \mathbb {E} \left[ \mathbb {1} _ {k , v} \right]} \\ + \frac {2 \gamma^ {2} C _ {2} G ^ {2} K ^ {\frac {2}{\alpha}}}{T} \sum_ {k = 0} ^ {T - 1} \mathbb {E} [ \mathbb {1} _ {k, v} ]. \\ \end{array} +$$ + +From Jensen's inequality we have $f(\overline{x}^T) \leq \frac{1}{T} \sum_{k=0}^{T-1} f(x^k)$ , where $\overline{x}^T = \frac{1}{T} \sum_{k=0}^{T-1} x^k$ . Using this and new notation $R_k = \|x^k - x^*\|, k > 0, R_0 \geq \|x^0 - x^*\|$ we get + +$$ +\begin{array}{l} 0 \leq 2 \gamma \mathbb {E} \left[ f (\bar {x} ^ {T}) - f (x ^ {*}) \right] \leq \frac {R _ {0} ^ {2} - \mathbb {E} \left[ R _ {T} ^ {2} \right]}{T} + 2 \gamma^ {2} G ^ {2} K ^ {\frac {2 - \alpha}{\alpha}} \\ + \frac {2 \gamma G \sqrt {C _ {2}} K ^ {\frac {1}{\alpha}}}{T} \sum_ {k = 0} ^ {T - 1} \sqrt {\mathbb {E} \left[ R _ {k} ^ {2} \right] \mathbb {E} \left[ \mathbb {1} _ {k , v} \right]} \\ + \frac {2 \gamma^ {2} C _ {2} G ^ {2} K ^ {\frac {2}{\alpha}}}{T} \sum_ {k = 0} ^ {T - 1} \mathbb {E} [ \mathbb {1} _ {k, v} ] \tag {66} \\ \end{array} +$$ + +implying (after changing the indices) that + +$$ +\begin{array}{l} \mathbb {E} \left[ R _ {k} ^ {2} \right] \leq R _ {0} ^ {2} + 2 \gamma^ {2} G ^ {2} k K ^ {\frac {2 - \alpha}{\alpha}} + 2 \gamma G \sqrt {C _ {2}} K ^ {\frac {1}{\alpha}} \sum_ {l = 0} ^ {k - 1} \sqrt {\mathbb {E} \left[ R _ {l} ^ {2} \right] \mathbb {E} \left[ \mathbb {1} _ {l , v} \right]} \\ + 2 \gamma^ {2} C _ {2} G ^ {2} K ^ {\frac {2}{\alpha}} \sum_ {l = 0} ^ {k - 1} \mathbb {E} [ \mathbb {1} _ {l, v} ] \tag {67} \\ \end{array} +$$ + +holds for all $k \geq 0$ . In the remaining part of the proof we derive by induction that + +$$ +\begin{array}{l} R _ {0} ^ {2} + 2 \gamma^ {2} G ^ {2} k K ^ {\frac {2 - \alpha}{\alpha}} + 2 \gamma G \sqrt {C _ {2}} K ^ {\frac {1}{\alpha}} \sum_ {l = 0} ^ {k - 1} \sqrt {\mathbb {E} [ R _ {l} ^ {2} ] \mathbb {E} [ \mathbb {1} _ {l , v} ]} \\ + 2 \gamma^ {2} C _ {2} G ^ {2} K ^ {\frac {2}{\alpha}} \sum_ {l = 0} ^ {k - 1} \mathbb {E} [ \mathbb {1} _ {l, v} ] \leq 2 R _ {0} ^ {2} \tag {68} \\ \end{array} +$$ + +for all $k = 0, \ldots, K$ . For $k = 0$ this inequality trivially holds. Next, assume that it holds for all $k = 0, 1, \ldots, T - 1$ , $T \leq K - 1$ . Let us show that it holds for $k = T$ as well. From (41) and (42) we have that $\mathbb{E}[R_k^2] \leq 2R_0^2$ for all + +$k = 0,1,\ldots ,T - 1$ . Therefore, + +$$ +\begin{array}{l} \mathbb {E} [ R _ {T} ^ {2} ] \leq R _ {0} ^ {2} + 2 \gamma^ {2} G ^ {2} T K ^ {\frac {2 - \alpha}{\alpha}} + 2 \gamma G \sqrt {C _ {2}} K ^ {\frac {1}{\alpha}} \sum_ {l = 0} ^ {T - 1} \sqrt {\mathbb {E} [ R _ {l} ^ {2} ] \mathbb {E} [ \mathbb {1} _ {l , v} ]} \\ + 2 \gamma^ {2} C _ {2} G ^ {2} K ^ {\frac {2}{\alpha}} \sum_ {l = 0} ^ {T - 1} \mathbb {E} [ \mathbb {1} _ {l, v} ] \\ \leq R _ {0} ^ {2} + 2 \gamma^ {2} G ^ {2} T K ^ {\frac {2 - \alpha}{\alpha}} + 2 \gamma G R _ {0} \sqrt {2 C _ {2}} K ^ {\frac {1}{\alpha}} \sum_ {l = 0} ^ {T - 1} \sqrt {\mathbb {E} [ \mathbb {1} _ {l , v} ]} \\ + 2 \gamma^ {2} C _ {2} G ^ {2} K ^ {\frac {2}{\alpha}} \sum_ {l = 0} ^ {T - 1} \mathbb {E} [ \mathbb {1} _ {l, v} ] \\ \end{array} +$$ + +If a Byzantine peer deviates from the protocol at iteration $k$ , it will be detected with some probability $p_k$ during the next iteration. One can lower bound this probability as + +$$ +p _ {k} \geq m \cdot \frac {| \mathcal {G} _ {k} |}{n _ {k}} \cdot \frac {1}{n _ {k}} = \frac {m (1 - \delta_ {k})}{n _ {k}} \geq \frac {m}{n}. +$$ + +That is, each individual Byzantine worker can violate the protocol no more than $1/p$ times on average. However, even one Byzantine peer can create a shift of the order $\Delta_{\max}^{k}$ at each part of the resulting vector. Therefore, all Byzantine peers can violate the protocol no more than $b/p$ times on average implying that + +$$ +\mathbb {E} [ R _ {T} ^ {2} ] \leq R _ {0} ^ {2} + 2 \gamma^ {2} G ^ {2} T K ^ {\frac {2 - \alpha}{\alpha}} + \frac {2 \gamma G R _ {0} \sqrt {2 C _ {2}} K ^ {\frac {1}{\alpha}} n b}{m} + \frac {2 \gamma^ {2} C _ {2} G ^ {2} K ^ {\frac {2}{\alpha}} n b}{m}. +$$ + +Taking + +$$ +\gamma = \min \left\{\frac {R _ {0}}{\sqrt {6} G K ^ {\frac {1}{\alpha}}}, \frac {m R _ {0}}{1 2 \sqrt {2 C _ {2}} G n b K ^ {\frac {1}{\alpha}}} \right\} +$$ + +we ensure that + +$$ +2 \gamma^ {2} G ^ {2} T K ^ {\frac {2 - \alpha}{\alpha}} + \frac {2 \gamma G R _ {0} \sqrt {2 C _ {2}} K ^ {\frac {1}{\alpha}} n b}{m} + \frac {2 \gamma^ {2} C _ {2} G ^ {2} K ^ {\frac {2}{\alpha}} n b}{m} \leq \frac {R _ {0} ^ {2}}{3} + \frac {R _ {0} ^ {2}}{3} + \frac {R _ {0} ^ {2}}{3} = R _ {0} ^ {2} +$$ + +and, as a result, we get $\mathbb{E}[R_T^2] \leq 2R_0^2$ . Therefore, (68) holds for all $k = 0,1,\ldots,K$ . Together with (66) it implies + +$$ +\mathbb {E} \left[ f (\overline {{x}} ^ {K}) - f (x ^ {*}) \right] \leq \frac {R _ {0} ^ {2}}{\gamma K}. +$$ + +Next, from our stepsize rule (63) it follows that + +$$ +\mathbb {E} \left[ f (\bar {x} ^ {K}) - f (x ^ {*}) \right] = \mathcal {O} \left(\frac {G R _ {0}}{K ^ {\frac {1 - \alpha}{\alpha}}} + \frac {n b G R _ {0}}{m K ^ {\frac {1 - \alpha}{\alpha}}}\right) +$$ + +meaning that after + +$$ +K = \mathcal {O} \left(\left(\frac {G R _ {0}}{\varepsilon}\right) ^ {\frac {\alpha}{\alpha - 1}} + \left(\frac {n b G R _ {0}}{m \varepsilon}\right) ^ {\frac {\alpha}{\alpha - 1}}\right) +$$ + +iterations BTARD-CLIPPED-SGD guarantees $\mathbb{E}[f(\overline{x}^K) - f(x^*)] \leq \varepsilon$ . + +That is, when the number of attacking Byzantines is unknown the complexity bound becomes $\left(\frac{nb}{m}\right)^{\alpha / (\alpha - 1)}$ times worse in comparison to (59). + +# E.4.3. STRONGLY CONVEX CASE: RESTARTED-BTARD-CLIPPED-SGD + +In this section, we provide the complete statements and the full proofs of the convergence results for the restarted version of BTARD-CLIPPED-SGD (RESTARTED-BTARD-CLIPPED-SGD, Alg. 8) when the objective function $f$ is smooth and strongly convex. + +# Algorithm 10 RESTARTED-BTARD-CLIPPED-SGD + +Input: $x^0$ - starting point, $r$ - number of restarts, $\{\gamma_t\}_{t=1}^r$ - stepsizes for BTARD-CLIPPED-SGD, $\{K_t\}_{t=1}^r$ - number of iterations for BTARD-CLIPPED-SGD, $\{s_{i,k,t}\}_{i,k,t=0,0,1}^{n,K-1,r}$ - seeds for batches computations, $\{\lambda_{k,t}\}_{k,t=0,1}^{K_t,r}$ - gradient clipping parameters + +1: $\widehat{x}^0 = x^0$ +2: for $t = 1, 2, \ldots, r$ do +3: Run BTARD-CLIPPED-SGD (Alg. 9) for $K_{t}$ iterations with stepsize $\gamma_{t}$ , starting point $\widehat{x}^{t - 1}$ , gradient clipping parameters $\{\lambda_{k,t}\}_{k = 0}^{K - 1}$ , and seeds for batches computations $\{s_{i,k,t}\}_{i,k = 0,0}^{n,K - 1}$ . Define $\widehat{x}^t$ as $\widehat{x}^t = \frac{1}{K_t}\sum_{k = 0}^{K_t}x^{k,t}$ , where $x^{0,t}, x^{1,t},\ldots ,x^{K_t,t}$ are the iterates produced by BTARD-CLIPPED-SGD. + +Output: $\widehat{x}^r$ + +We start with the case when the number of attacking Byzantine workers is known at each iteration. + +Theorem E.10. Let As. E.1 hold, $Q$ is bounded, $f$ be $\mu$ -strongly convex (see Def. E.2), $x^{*}$ be some optimum of $f$ , and $\nabla f(x^{*}) = 0$ . Moreover, assume that $b \leq 0.15(n - m)$ , $m \leq \frac{(n - 2b)}{2}$ , and the exact number of attacking Byzantine peers is known to all good peers at each iteration. Next, assume that + +$$ +\gamma = \min \left\{\frac {R _ {0}}{\sqrt {6} \cdot 2 ^ {\frac {t}{2}} G K _ {t} ^ {\frac {1}{\alpha}}}, \frac {m R _ {0}}{1 2 \cdot 2 ^ {\frac {t}{2}} G n \sqrt {1 0 \delta \left(C _ {1} K _ {t} ^ {\frac {4 - \alpha}{2 \alpha}} + C _ {2} K _ {t} ^ {\frac {2}{\alpha}}\right)}} \right\}, \quad \Delta_ {\max } ^ {k, t} = 2 \lambda_ {k, t} = \frac {2 \lambda_ {t}}{\sqrt {n _ {k} ^ {t} - m}}, \tag {69} +$$ + +$$ +K _ {t} = \max \left\{\left(\frac {2 \sqrt {6} G \cdot 2 ^ {\frac {t}{2}}}{\mu R _ {0}}\right) ^ {\frac {\alpha}{\alpha - 1}}, \left(\frac {2 4 G n \sqrt {1 0 \delta \left(C _ {1} + C _ {2}\right)} 2 ^ {\frac {t}{2}}}{m \mu R _ {0}}\right) ^ {\frac {\alpha}{\alpha - 1}} \right\}, \quad \lambda_ {t} = G K _ {t} ^ {\frac {1}{\alpha}}, \tag {70} +$$ + +$$ +r = \left\lceil \log_ {2} \frac {\mu R _ {0} ^ {2}}{\varepsilon} \right\rceil - 1, \tag {71} +$$ + +where $R_0 \geq \|x^0 - x^*\|$ and $\Delta_{\max}^{k,t}$ is the parameter for verification 3 at iteration $k$ of BTARD-CLIPPED-SGD, $n_k^t$ is the total number of workers at iteration $k$ of $t$ -th restart. Then, we have $\mathbb{E}[f(\hat{x}^r) - f(x^*)] \leq \varepsilon$ after $r$ restarts of BTARD-CLIPPED-SGD and the total number of executed iterations of BTARD-CLIPPED-SGD is + +$$ +\sum_ {t = 1} ^ {r} K _ {t} = \mathcal {O} \left(\left(\frac {G ^ {2}}{\mu \varepsilon}\right) ^ {\frac {\alpha}{2 (\alpha - 1)}} + \left(\frac {n \sqrt {\delta}}{m}\right) ^ {\frac {\alpha}{\alpha - 1}} \left(\frac {G ^ {2}}{\mu \varepsilon}\right) ^ {\frac {\alpha}{2 (\alpha - 1)}}\right) \tag {72} +$$ + +Proof. Theorem E.8 implies that BTARD-CLIPPED-SGD with + +$$ +\gamma = \min \left\{\frac {R _ {0}}{\sqrt {6} G K ^ {\frac {1}{\alpha}}}, \frac {m R _ {0}}{1 2 G n \sqrt {1 0 \delta (C _ {1} K ^ {\frac {4 - \alpha}{2 \alpha}} + C _ {2} K ^ {\frac {2}{\alpha}})}} \right\} +$$ + +guarantees + +$$ +\mathbb {E} \left[ f (\bar {x} ^ {K}) - f (x ^ {*}) \right] \leq \frac {R _ {0} ^ {2}}{\gamma K} +$$ + +after $K$ iterations. Therefore, after the first restart we have + +$$ +\mathbb {E} \left[ f \left(\widehat {x} ^ {1}\right) - f \left(x ^ {*}\right) \right] \leq \frac {R _ {0} ^ {2}}{\gamma_ {1} K _ {1}} \leq \frac {\mu R _ {0} ^ {2}}{4}. +$$ + +From $\mu$ -strong convexity of $f$ and $\nabla f(x^{*}) = 0$ we have + +$$ +\frac {\mu}{2} \| \widehat {x} ^ {1} - x ^ {*} \| ^ {2} \leq f (\widehat {x} ^ {1}) - f (x ^ {*}) \Longrightarrow \mathbb {E} [ \| \widehat {x} ^ {1} - x ^ {*} \| ^ {2} ] \leq \frac {R _ {0} ^ {2}}{2}. +$$ + +Next, assume that we have $\mathbb{E}[f(\widehat{x}^t) - f(x^*)] \leq \frac{\mu R_0^2}{2^{t + 1}}$ , $\mathbb{E}[\| \widehat{x}^t - x^* \|^2] \leq \frac{R_0^2}{2^t}$ for some $t \leq r - 1$ . Then, Theorem E.8 implies that + +$$ +\mathbb {E} \left[ f \left(\widehat {x} ^ {t + 1}\right) - f \left(x ^ {*}\right) \mid x ^ {t} \right] \leq \frac {\| \widehat {x} ^ {t} - x ^ {*} \| ^ {2}}{\gamma_ {t} K _ {t}}. +$$ + +Taking the full expectation from the both sides of previous inequality we get + +$$ +\mathbb {E} \left[ f \left(\widehat {x} ^ {t + 1}\right) - f \left(x ^ {*}\right) \right] \leq \frac {\mathbb {E} \left[ \| \widehat {x} ^ {t} - x ^ {*} \| ^ {2} \right]}{\gamma_ {t} K _ {t}} \leq \frac {R _ {0} ^ {2}}{2 ^ {t} \gamma_ {t} K _ {t}} \leq \frac {\mu R _ {0} ^ {2}}{2 ^ {t + 2}}. +$$ + +From $\mu$ -strong convexity of $f$ and $\nabla f(x^{*}) = 0$ we have + +$$ +\frac {\mu}{2} \| \widehat {x} ^ {t + 1} - x ^ {*} \| ^ {2} \leq f (\widehat {x} ^ {t + 1}) - f (x ^ {*}) \Longrightarrow \mathbb {E} [ \| \widehat {x} ^ {t + 1} - x ^ {*} \| ^ {2} ] \leq \frac {R _ {0} ^ {2}}{2 ^ {t + 1}}. +$$ + +Therefore, by mathematical induction we have that for all $t = 1,\dots ,r$ + +$$ +\mathbb {E} \left[ f \left(\widehat {x} ^ {t}\right) - f \left(x ^ {*}\right) \right] \leq \frac {\mu R _ {0} ^ {2}}{2 ^ {t + 1}}, \quad \mathbb {E} \left[ \left\| \widehat {x} ^ {t} - x ^ {*} \right\| ^ {2} \right] \leq \frac {R _ {0} ^ {2}}{2 ^ {t}}. +$$ + +Then, after $r = \left\lceil \log_2\frac{\mu R_0^2}{\varepsilon}\right\rceil -1$ restarts of BTARD-CLIPPED-SGD we have $\mathbb{E}[f(\widehat{x}^r) - f(x^*)]\leq \varepsilon$ . The total number of iterations executed by BTARD-CLIPPED-SGD is + +$$ +\begin{array}{l} \sum_ {t = 1} ^ {r} K _ {t} = \mathcal {O} \left(\sum_ {t = 1} ^ {r} \max \left\{\left(\frac {G \cdot 2 ^ {\frac {t}{2}}}{\mu R _ {0}}\right) ^ {\frac {\alpha}{\alpha - 1}}, \left(\frac {G n \sqrt {\delta} 2 ^ {\frac {t}{2}}}{m \mu R _ {0}}\right) ^ {\frac {\alpha}{\alpha - 1}} \right\}\right) \\ = \mathcal {O} \left(\max \left\{\left(\frac {G}{\mu R _ {0}}\right) ^ {\frac {\alpha}{\alpha - 1}} \cdot 2 ^ {\frac {r \alpha}{2 (\alpha - 1)}}, \left(\frac {G n \sqrt {\delta}}{m \mu R _ {0}}\right) ^ {\frac {\alpha}{\alpha - 1}} \cdot 2 ^ {\frac {r \alpha}{2 (\alpha - 1)}} \right\}\right) \\ = \mathcal {O} \left(\max \left\{\left(\frac {G}{\mu R _ {0}}\right) ^ {\frac {\alpha}{\alpha - 1}} \cdot \left(\frac {\mu R _ {0} ^ {2}}{\varepsilon}\right) ^ {\frac {\alpha}{2 (\alpha - 1)}}, \left(\frac {G n \sqrt {\delta}}{m \mu R _ {0}}\right) ^ {\frac {\alpha}{\alpha - 1}} \cdot \left(\frac {\mu R _ {0} ^ {2}}{\varepsilon}\right) ^ {\frac {\alpha}{2 (\alpha - 1)}} \right\}\right) \\ = \mathcal {O} \left(\left(\frac {G ^ {2}}{\mu \varepsilon}\right) ^ {\frac {\alpha}{2 (\alpha - 1)}} + \left(\frac {n \sqrt {\delta}}{m}\right) ^ {\frac {\alpha}{\alpha - 1}} \left(\frac {G ^ {2}}{\mu \varepsilon}\right) ^ {\frac {\alpha}{2 (\alpha - 1)}}\right). \\ \end{array} +$$ + +![](images/59ea91a1fa2a0fe967510a1eb9b340b4b9ba59b7519e543a8e69f2c2086878ef.jpg) + +In the strongly convex case, similar observations hold as in the convex case. Next, we derive the result without assuming that $\widehat{b}^k$ is known to all peers at each iteration. + +Theorem E.11. Let As. E.1 hold, $Q$ is bounded, $f$ be $\mu$ -strongly convex (see Def. E.2), $x^{*}$ be some optimum of $f$ , and $\nabla f(x^{*}) = 0$ . Moreover, assume that $b \leq 0.15(n - m)$ , $m \leq (n - 2b)/2$ , and $\delta = 0$ is used to compute clipping parameter $\tau_{l}$ for CenteredClip. Next, assume that + +$$ +\gamma = \min \left\{\frac {R _ {0}}{\sqrt {6} \cdot 2 ^ {\frac {t}{2}} G K _ {t} ^ {\frac {1}{\alpha}}}, \frac {m R _ {0}}{1 2 \cdot 2 ^ {\frac {t}{2}} G n b \sqrt {2 C _ {2}} K _ {t} ^ {\frac {1}{\alpha}}} \right\}, \quad \Delta_ {\max } ^ {k, t} = 2 \lambda_ {k, t} = \frac {2 \lambda_ {t}}{\sqrt {n _ {k} ^ {t} - m}}, \tag {73} +$$ + +$$ +K _ {t} = \max \left\{\left(\frac {2 \sqrt {6} G \cdot 2 ^ {\frac {t}{2}}}{\mu R _ {0}}\right) ^ {\frac {\alpha}{\alpha - 1}}, \left(\frac {2 4 G n b \sqrt {2 C _ {2}} 2 ^ {\frac {t}{2}}}{m \mu R _ {0}}\right) ^ {\frac {\alpha}{\alpha - 1}} \right\}, \quad \lambda_ {t} = G K _ {t} ^ {\frac {1}{\alpha}}, \tag {74} +$$ + +$$ +r = \left\lceil \log_ {2} \frac {\mu R _ {0} ^ {2}}{\varepsilon} \right\rceil - 1, \tag {75} +$$ + +where $R_0 \geq \|x^0 - x^*\|$ and $\Delta_{\max}^{k,t}$ is the parameter for verification 3 at iteration $k$ of BTARD-CLIPPED-SGD, $n_k^t$ is the total number of workers at iteration $k$ of $t$ -th restart. Then, we have $\mathbb{E}[f(\widehat{x}^r) - f(x^*)] \leq \varepsilon$ after $r$ restarts of BTARD-CLIPPED-SGD and the total number of executed iterations of BTARD-CLIPPED-SGD is + +$$ +\sum_ {t = 1} ^ {r} K _ {t} = \mathcal {O} \left(\left(\frac {G ^ {2}}{\mu \varepsilon}\right) ^ {\frac {\alpha}{2 (\alpha - 1)}} + \left(\frac {n b}{m}\right) ^ {\frac {\alpha}{\alpha - 1}} \left(\frac {G ^ {2}}{\mu \varepsilon}\right) ^ {\frac {\alpha}{2 (\alpha - 1)}}\right) \tag {76} +$$ + +Proof. Theorem E.9 implies that BTARD-CLIPPED-SGD with + +$$ +\gamma = \min \left\{\frac {R _ {0}}{\sqrt {6} G K ^ {\frac {1}{\alpha}}}, \frac {m R _ {0}}{1 2 \sqrt {2 C _ {2}} G n b K ^ {\frac {1}{\alpha}}} \right\} +$$ + +guarantees + +$$ +\mathbb {E} \left[ f (\overline {{x}} ^ {K}) - f (x ^ {*}) \right] \leq \frac {R _ {0} ^ {2}}{\gamma K} +$$ + +after $K$ iterations. Therefore, after the first restart we have + +$$ +\mathbb {E} [ f (\widehat {x} ^ {1}) - f (x ^ {*}) ] \leq \frac {R _ {0} ^ {2}}{\gamma_ {1} K _ {1}} \leq \frac {\mu R _ {0} ^ {2}}{4}. +$$ + +From $\mu$ -strong convexity of $f$ and $\nabla f(x^{*}) = 0$ we have + +$$ +\frac {\mu}{2} \| \widehat {x} ^ {1} - x ^ {*} \| ^ {2} \leq f (\widehat {x} ^ {1}) - f (x ^ {*}) \Longrightarrow \mathbb {E} [ \| \widehat {x} ^ {1} - x ^ {*} \| ^ {2} ] \leq \frac {R _ {0} ^ {2}}{2}. +$$ + +Next, assume that we have $\mathbb{E}[f(\widehat{x}^t) - f(x^*)] \leq \frac{\mu R_0^2}{2^{t + 1}}$ , $\mathbb{E}[\| \widehat{x}^t - x^* \|^2] \leq \frac{R_0^2}{2^t}$ for some $t \leq r - 1$ . Then, Theorem E.9 implies that + +$$ +\mathbb {E} \left[ f \left(\widehat {x} ^ {t + 1}\right) - f \left(x ^ {*}\right) \mid x ^ {t} \right] \leq \frac {\| \widehat {x} ^ {t} - x ^ {*} \| ^ {2}}{\gamma_ {t} K _ {t}}. +$$ + +Taking the full expectation from the both sides of previous inequality we get + +$$ +\mathbb {E} [ f (\widehat {x} ^ {t + 1}) - f (x ^ {*}) ] \leq \frac {\mathbb {E} [ \| \widehat {x} ^ {t} - x ^ {*} \| ^ {2} ]}{\gamma_ {t} K _ {t}} \leq \frac {R _ {0} ^ {2}}{2 ^ {t} \gamma_ {t} K _ {t}} \leq \frac {\mu R _ {0} ^ {2}}{2 ^ {t + 2}}. +$$ + +From $\mu$ -strong convexity of $f$ and $\nabla f(x^{*}) = 0$ we have + +$$ +\frac {\mu}{2} \| \widehat {x} ^ {t + 1} - x ^ {*} \| ^ {2} \leq f (\widehat {x} ^ {t + 1}) - f (x ^ {*}) \Longrightarrow \mathbb {E} [ \| \widehat {x} ^ {t + 1} - x ^ {*} \| ^ {2} ] \leq \frac {R _ {0} ^ {2}}{2 ^ {t + 1}}. +$$ + +Therefore, by mathematical induction we have that for all $t = 1,\dots ,r$ + +$$ +\mathbb {E} [ f (\widehat {x} ^ {t}) - f (x ^ {*}) ] \leq \frac {\mu R _ {0} ^ {2}}{2 ^ {t + 1}}, \quad \mathbb {E} \left[ \| \widehat {x} ^ {t} - x ^ {*} \| ^ {2} \right] \leq \frac {R _ {0} ^ {2}}{2 ^ {t}}. +$$ + +Then, after $r = \left\lceil \log_2 \frac{\mu R_0^2}{\varepsilon} \right\rceil - 1$ restarts of BTARD-CLIPPED-SGD we have $\mathbb{E}[f(\widehat{x}^r) - f(x^*)] \leq \varepsilon$ . The total number of iterations executed by BTARD-CLIPPED-SGD is + +$$ +\begin{array}{l} \sum_ {t = 1} ^ {r} K _ {t} = \mathcal {O} \left(\sum_ {t = 1} ^ {r} \max \left\{\left(\frac {G \cdot 2 ^ {\frac {t}{2}}}{\mu R _ {0}}\right) ^ {\frac {\alpha}{\alpha - 1}}, \left(\frac {G n \sqrt {\delta} 2 ^ {\frac {t}{2}}}{m \mu R _ {0}}\right) ^ {\frac {\alpha}{\alpha - 1}} \right\}\right) \\ = \mathcal {O} \left(\max \left\{\left(\frac {G}{\mu R _ {0}}\right) ^ {\frac {\alpha}{\alpha - 1}} \cdot 2 ^ {\frac {r \alpha}{2 (\alpha - 1)}}, \left(\frac {G n b}{m \mu R _ {0}}\right) ^ {\frac {\alpha}{\alpha - 1}} \cdot 2 ^ {\frac {r \alpha}{2 (\alpha - 1)}} \right\}\right) \\ { = } { \mathcal { O } \left( \operatorname* { m a x } \left\{ \left( \frac { G } { \mu R _ { 0 } } \right) ^ { \frac { \alpha } { \alpha - 1 } } \cdot \left( \frac { \mu R _ { 0 } ^ { 2 } } { \varepsilon } \right) ^ { \frac { \alpha } { 2 ( \alpha - 1 ) } } , \left( \frac { G n b } { m \mu R _ { 0 } } \right) ^ { \frac { \alpha } { \alpha - 1 } } \cdot \left( \frac { \mu R _ { 0 } ^ { 2 } } { \varepsilon } \right) ^ { \frac { \alpha } { 2 ( \alpha - 1 ) } } \right\} \right) } \\ = \mathcal {O} \left(\left(\frac {G ^ {2}}{\mu \varepsilon}\right) ^ {\frac {\alpha}{2 (\alpha - 1)}} + \left(\frac {n b}{m}\right) ^ {\frac {\alpha}{\alpha - 1}} \left(\frac {G ^ {2}}{\mu \varepsilon}\right) ^ {\frac {\alpha}{2 (\alpha - 1)}}\right). \\ \end{array} +$$ + +# F. Resisting Sybil attacks + +In this section, we address Byzantine-tolerant training in a setup where new participants can join or leave collaboration midway through training. This requirement arises naturally if a training run relies on volunteers or an open pool of paid participants (Kijspongse et al., 2018; Ryabinin & Gusev, 2020; Atre et al., 2021; Diskin et al., 2021). In addition to all existing concerns from Section 3, this setup allows Byzantine attackers to assume new identity each time they are blocked. Further yet, Byzantine participants can simultaneously use multiple identities in order to obtain majority in the voting procedure, which is known as Sybil attacks (Douceur, 2002; Trifa & Khemakhem, 2014; Wang & Kangasharju, 2012). + +In this analysis11, we consider a training run where Byzantine peers collectively possess $\delta < \delta_{max}$ of all compute resources (we explore the role of $\delta_{max} < 1/2$ later in this section). Intuitively, one can think of this setting as distributed training with $n$ identical computers, $\lfloor \delta \cdot n \rfloor$ of which are controlled by Byzantines. The "Byzantine GPUs" can be allocated between an arbitrary number of identities. For instance, one accelerator can run full BTARD-SGD protocol for one peer or drop some of the computation and use the freed "compute cycles" to run computation for another participant. Theoretically, a device can run computation for an arbitrarily large number of peers, as long as it actually computes as many gradients as one benign participant does in the same time-frame. + +To protect against this new attack type, we augment BTARD-SGD with a reputation system designed to limit the impact of pseudonymous identities with the actual underlying compute. We base this system on the following assumptions: + +1. Unique and optimal computations: the gradients computed by peer $i$ at step $k$ cannot be circumvented or reused from other peers and/or previous steps. +2. Sybil-resistance of the message propagation protocol: the underlying message propagation protocol should be resistant to various forms of Sybil attacks: they should not harm the protocol's ability to deliver a broadcasted message to all honest peers. Vyzovitis et al. (2020) empirically show that GossipSub used in BTARD-SGD is resistant to such attacks. +3. Usage of digital signatures: peers should have unique public/private key pairs, know each other's public keys, sign their messages (Rivest et al., 1978), and ignore all received messages with invalid signatures. +4. Existence of a cryptographic hash function: peers should have access to a hash function such that finding a vector $x$ satisfying $\mathrm{hash}(x) = y$ is infeasible for $\lfloor \delta \cdot n \rfloor$ compute over the entire training duration. + +We associate each participant with a public record that is used to verify that peer's legitimacy. These records can be securely stored in a Distributed Hash Table (see Appendix G). When a new peer joins the network, it begins with an empty record and is therefore "untrusted". Untrusted peers compute gradients normally, but cannot aggregate vectors from others and cannot serve as invalidators. More importantly, other peers exclude untrusted gradients from aggregation, using them only for the purpose of validating those peers. + +Each time a peer computes gradients $g_{i}^{k}$ over publicly known batch $\xi_{i}^{k}$ , it must write $\mathrm{hash}(g_i^k)$ to its own public record and sign it with its private key. As in the original BTARD-SGD, some of those entries will be validated by other peers chosen by MPRNG. In turn, the chosen validators will either approve their entry or invoke ACCUSE to ban the peer. + +In order to become trusted, a given peer must report consecutive gradients until it accumulates $T$ entries approved by (provably) random peers. Here, $T$ is a hyperparameter that should be large enough for the training to recover from any previous attacks and make some progress before previously banned malicious peers can earn trust again. In practice, $T$ may be chosen experimentally by observing the number of iterations it takes to improve the loss upon its pre-attack value in case of the most effective attacks, as reported in Section 4. + +While $T$ may be application-dependent, we note that its minimal value is small in terms of the relative training time in all our experiments. $T$ corresponding to the $10\%$ of total training time is more than 3 times larger than the worst "recovery time" for both setups considered in Section 4, where almost a half of the peers are Byzantine. Moreover, Appendix I.1 suggests that recovery from the worst-case attack may happen even faster in case of a smaller share of Byzantines. In that setup (with $\approx 20\%$ of peers being Byzantine), $T$ corresponding to the $1\%$ of training time is already enough. + +Once a peer becomes trusted, it must continue reporting gradient hashes to maintain trust. Even a single missing or invalidated hash breaks the chain and results in the corresponding peer being banned. To maintain this invariant, peers chosen as a facilitators add the recalculated hashes into their own record instead of the skipped iteration. + +To protect against dilution attacks, a cooperative training run can simultaneously consider at most $\frac{t}{2}$ "untrusted" peers, where $t$ is the number of currently trusted peers. All subsequent peers should wait in a queue until one of the untrusted peers becomes either trusted or banned. + +Analysis. Under this formalism, a Sybil attacker will attempt to maximize the number of trusted identities it can control with a limited amount of compute. In the simplest case, an attacker has exactly one GPU that can be used to either run all computations for identity or partial computation for multiple identities. + +In the latter case, an attacker can honestly compute gradients for identity A with probability $p \in [0,1]$ and for identity B with probability $1 - p$ . To breaking the chain, the identity that does not compute gradients at a given step can report arbitrary (e.g. random) entries instead of $\mathrm{hash}(g_i^k)$ . + +Consider the expected number of "trusted" identities after enough steps for $T$ validations by honest gradators (on average, $T \cdot \frac{n}{k \cdot (1 - \delta)}$ steps). Identity A becomes trusted with probability $p^T$ , otherwise it is banned. Similarly, identity B survives with probability $(1 - p)^T$ . Thus, the expected number of trusted identities after $T$ steps is $p^T + (1 - p)^T$ . + +For $T > 1$ , this expectation is maximal iff $p \in \{0,1\}$ . Thus, if a peer needs more than one validation to become trusted, the "optimal strategy" for a Sybil attacker is to fully support one identity instead of spreading the resources between multiple ones. This observation can be generalized for distributing $\lfloor \delta \cdot n \rfloor$ over an $m \geq \lfloor \delta \cdot n \rfloor$ pseudonymous identities, where maximizing the expected number of trusted identities requires fully supporting any $\lfloor \delta \cdot n \rfloor$ identities and disregarding the rest (for $T > 1$ , as before). + +Overhead computation. When training without Byzantine participants, this modified version of BTARD-SGD requires, on average, $T \cdot \frac{n}{k}$ additional gradient computations per participant at the very beginning. However, once all peers become trusted, the algorithm computes exactly the same number of gradients as regular BTARD-SGD, effectively training at $\frac{n - k}{n}$ efficiency of AR-SGD, plus the same communication overhead. + +Remark 1: Temporary majority. Despite the fact that spreading 1 "compute unit" across multiple identities reduces the expected number of trusted identities, it may still be useful to establish a temporary majority, albeit with a small probability. For instance, splitting one compute unit evenly among $m$ identities (each with $p = 1 / m$ ) may result in both $m$ identities temporarily gaining trust with probability: + +$$ +P \left(\operatorname {p e e r} _ {1} \wedge \dots \wedge \operatorname {p e e r} _ {m}\right) = \prod_ {i = 1} ^ {m} \frac {1}{m ^ {T}} = m ^ {- T m} \tag {77} +$$ + +A Sybil attacker can simply repeat this procedure on every step until it can establish a temporary majority and use this majority to harm training (e.g. ban non-malicious peers). A natural way to remedy this is to increase $T$ to such an extent that (77) becomes negligibly small. + +Remark 2: Extra compute for Byzantine nodes. Unlike benign peers, Byzantine attackers do not need to honestly validate each other. When a Byzantine peer is chosen as validator, it can approve its target without actually computing the gradients. In turn, the freed compute resources can be used to support additional Byzantine identities. + +Thus, if a given training run has $n$ trusted peers and chooses $k$ collaborators on each step, Sybil attackers can control slightly more than $\lfloor \delta \cdot n \rfloor$ of all identities by using the free compute cycles from validation to support additional peers. Thus, the proposed reputation system requires that the total computational power $B_{max}$ available to Byzantines is less than $\frac{1}{2}$ by a (typically small) margin that depends on $n, k,$ and $T$ . + +Remark 3: Perpetual attacks. When training in open collaborations, one cannot ban the Byzantine peers entirely: a Byzantine attacker will always be able to assume a new identity at the cost of running honestly for $T \cdot \frac{n}{k \cdot (1 - \delta)}$ gradient steps. Thus, unlike in Appendix E, we cannot make BTARD-SGD unbiased by increasing $\tau$ . However, as we demonstrated in + +Section 4, the biased variant of BTARD-SGD with constant $\tau$ can still train real-world deep learning models with the same or virtually the same learning curves as regular SGD. + +# G. Secure distributed hash tables + +Distributed Hash Tables (DHT) are protocols that establish a decentralized key-value storage over decentralized unreliable participants (Maymounkov & Mazieres, 2002; Balakrishnan et al., 2003; Zhao et al., 2003; Rowstron & Druschel, 2001). To determine which DHT peers are responsible for a given key-value pair, each participant samples a unique binary identifier (ID) sampled uniformly from the space of hash function outputs. When "storing a (key, value)" on the DHT, one finds $k$ peers whose IDs are nearest to hash(key) and sends the data to each one of those peers. In turn, a peer that wants to read the value or a given key will also search for neighbors whose IDs are close to hash(key) and request the data from those peers. Thus, the data can be accessed as long as at least one o $k$ chosen peers remains active, with some DHT variants introducing additional replication protocols. + +Our specific implementation is based on Kademlia (Maymounkov & Mazieres, 2002), a popular DHT variant that determines nearest neighbors based on XOR distance function or their IDs: $d(x,y) = \mathrm{int}(x\oplus y)$ . More importantly, Kademlia protocol organizes nodes in such a way that each individual peer only "knows" a small subset of $O(\log_2n)$ direct neighbors, however, it is possible to navigate the neighborhood graph to find the globally nearest neighbors in $O(\log_2N)$ network requests. + +DHT protocols were originally designed for large-scale distributed systems such as BitTorrent, IPFS and several cryptocurrencies. To maintain integrity in these applications, modern DHT protocols also employ security measures that make them resistant to Byzantine and Sybil attacks (Urdaneta et al., 2011). + +In our specific scenario, the most sensitive DHT entries are personal records that determine whether or not a given peer is trusted. We protect these records by enforcing that every value stored in the DHT must be signed by their author's digital signature (Rivest et al., 1978). Thus, if a malicious peer attempts to modify a record it was not supposed to, all other peers will be able to detect that and eliminate such peers from the collective. + +However, digital signature are known to be vulnerable to replay attacks: every time a non-Byzantine peer stores an given key-value pair signed with its private key, a Byzantine eavesdropper can record the signed entry and replay it in future. For ordinary DHTs, this would allow an attacker to revert any key-value pair to its previous state by replaying such pre-recorded messages. + +Our algorithm protects against replay attacks by associating each key-value pair with a third value denoted as expiration time. Given two entries for the same key, DHT nodes will now prioritize the ones with the latest expiration time and consider it valid up to that time. Furthermore, in order to store a new entry to the DHT, a peer must now sign the entire key-value-expiration tuple. Thus, if a Byzantine peer replays a pre-recorded message, it will not be able to overwrite newer DHT entries that were signed for a more recent expiration time. + +# H. Details of the ALBERT experiment setup + +In Section 4.2, we pretrain ALBERT (Lan et al., 2019) — a self-supervised Transformer model for learning representations of language data. We deliberately choose ALBERT instead of other models like BERT (Devlin et al., 2019) due to its high communication efficiency, which is caused by layerwise weight sharing and embedding layer factorization. In particular, we focus on a communication-efficient model, because the connection speed between the workers can become a noticeable constraint when averaging gradients of models with hundreds of millions of parameters. We train ALBERT-large on sequences of 512 tokens from the WikiText-103 (Merit et al., 2017) dataset. The training procedure starts from a random initialization, but the subword vocabulary (Sennrich et al., 2016) is the same as created by the authors of the original ALBERT models. + +This model is trained with two objectives: masked language modeling (given a sentence with several masked tokens, predict the tokens that were masked) and sentence order prediction (given two segments from the same document, determine if they were swapped). We use LAMB optimizer (You et al., 2020) with batches that contain 4,096 examples, training with a peak learning rate equal to 0,00176 and a warmup of 5,000 gradient descent steps. In addition, we use gradient clipping with a maximum norm of 1 and weight decay regularization with the weight of 0,01. We run distributed training on 16 cloud instances, each equipped with a single Tesla T4 GPU. Each training run takes 2-3 days, depending on the instance availability. + +![](images/4f0678f32bde88f5b433077fe64e242a23c40aa1ebd88c4e11c4c783958013ad.jpg) + +![](images/676baa749c6066107da1dc87cb787c59501179efe1f377153ae9b157c8e6b526.jpg) + +![](images/cc7d5a74aee5cda254f359b9f4d026d4631bb9ff76599f12f0918807169b981d.jpg) + +![](images/46933f4ca161de0cc46eaee04a559c333fa2a7b91d5fcc8e264ab30b6a447f8c.jpg) + +![](images/c0fd7c76f4f507372f003adcf7f9b53fd0fa89d0614c06fab6d88f1a5a771af8.jpg) + +![](images/a439bbd9909704c2397918b3fe4f908da35a694d79c0bea4e4ba8cc6e28cfd18.jpg) + +![](images/e3d3bd035dec9ad2b3a19f7aa84c67eb171b0e0dadd4c2c6f54ab022f41c7a0b.jpg) +Figure 6. The ResNet-18 test accuracy in the case of various attacks performed at each step starting from step $s = 10,000$ by 7 Byzantines. + +![](images/4364ffe836155014d60d139e62d246261f5e1da3e281b67175cad88c7fea4dc4.jpg) + +![](images/ed368b1f7bb4af65db62682275fab41b55ad133a0e0ec43e69a79ff0ca7ed0c1.jpg) + +# I. Additional experiments + +# I.1. Extra evaluations on the CIFAR10 classification task + +In this section, we perform several additional experiments with BTARD-SGD used to train the ResNet-18 model to solve the CIFAR10 classification task. We start with the same configuration as used in Section 4.1 and consider several changes to this setup. In this section, we omit reporting the behavior of the baselines in presence of the attacks since Figure 3 already shows that the baselines cannot withstand most of them. + +First, we evaluate our method in case of $s = 10,000$ : we make Byzantines behave honestly prior to step 10,000, then simultaneously attack on each step until they are banned (i.e., attacks start closer to the convergence stage). The results are shown in Figure 6. The behavior of BTARD turns out to be similar to the case of $s = 1000$ , with the same kinds of attacks being most efficient against the stronger and weaker clipping scenarios. BTARD with the stronger clipping and 2 invalidators is still enough to combat all considered attacks. + +Next, we explore a situation where Byzantine peers send incorrect gradients periodically, e.g. once per $T = 10$ iterations. This reduces the attack intensity but allows them to stay undetected for longer. In this setting, we consider 7 Byzantine peers and reuse all parameters from the original setup, except for the new attack period. The attacks are performed at steps $s + k \cdot T, k \in \mathbb{N}$ until the attacker is eventually banned. As expected, this setup increases the duration of each attack by a factor of $T$ , but decreases the peak attack influence (see Figure 7). In this case, even BTARD with one validator is enough to combat all kinds of attacks regardless of the clipping strength. + +Next, we consider a situation where Byzantine peers are less numerous. For this experiment, we use the same configuration as in Section 4.1, but with only 3 Byzantine peers out of 16 (just under $20\%$ ). Figure 8 demonstrates similar behavior to our original setup, but with significantly weaker magnitude across all attacks. Here, BTARD with one validator and any clipping strength is also enough to combat all kinds of attacks. + +![](images/c8e755da3652fc90b5dac04a6f18054f150afc11bab09d9de14e3594d260ed8c.jpg) + +![](images/7a3161321a2ce85c7291f30484e4df8f1231614a4715734fc78b71a668f2cffc.jpg) + +![](images/b0b72a5bf1337a8b2888c933a14c9a77f444f96601a33c2e173de4de0b0f28a0.jpg) + +![](images/fd281e0944dfd781e1b30fea480d5a247c3d1f51d31e80e938c38b975f6b0710.jpg) + +![](images/28a8c04377163ddf45e68e9b42e8b9a4ad44265fb139ca23ab6ae2bb9dc86e73.jpg) + +![](images/e51812f72a0c08d1e2dbaef1a4c647b5f26b6d0ee958d4b04ccfc806795dd7ff.jpg) + +![](images/c5cecfe41a37cde8d2253ac6e0a2bf53cf2beb4751239beb8d3676d4e4619d88.jpg) +Figure 7. The ResNet-18 test accuracy in the case of various attacks performed at every $T$ -th step ( $T = 10$ ) starting from step $s = 1000$ by 7 Byzantines. + +![](images/2830d941702fde824f9ce99a082f97d7efedd038dfb0780e1a1f53cd518e3e4f.jpg) + +Finally, we evaluate the convergence and the final test accuracy of the less computationally intensive variants of BTARD-SGD that limit the maximal number of iterations in the CenteredClip procedure to $M$ , where $M$ varies from 1 to 50. In the setup with $\tau = 1$ , we observe that $M = 50$ iterations are always enough for CenteredClip to converge with $\epsilon = 10^{-6}$ in absence of the attacks. Figure 9 demonstrates that stopping the procedure earlier harms the final test accuracy. This negative effect becomes more significant for the smaller values of $M$ . + +# I.2. Evaluating computation overhead in terms of wall time + +For this analysis, we consider the ALBERT-large training setup from Section 4.2. Our training "swarm" contains 16 peers with T4 GPUs and 1 GiB/s network bandwidth. On average over 1000 training steps, the full training step for this model takes up 28.56 seconds. Of this, approximately 23.96 seconds were used up for communication and the remaining 4.60 seconds were spent for gradient aggregation CENTEREDCLIP. + +Since MPRNG is running in the background, the only part of BTARD that affects the training time is Algorithm 2 (BUTTERFLYCLIP). Thus, we measure the time complexity of this algorithm with different numbers of internal iterations. During "normal" epochs where all Byzantines remained passive, the algorithm converged in 2-3 iterations for $\tau = 0.25$ and 5-10 iterations with $\tau = 0.125$ . We also noticed that this value has temporarily increased by 2-3 times while Byzantine peers were performing their attack. + +In Table 3, we report the wall time (the mean and the standard deviation over 10 runs) of our algorithm with a different number of iterations in two hardware setups: running on a 8-core VM with 3.1Ghz Intel Xeon 6148 CPU and on a single 1080 Ti GPU. Even the worst case overhead ( $\tau = 0.125$ , CPU) is less than the $3\%$ of the total step time without attacks and less than the $4\%$ when the attack is active. One important consideration here is that the overhead is constant with respect to the number of peers due to the scaling properties of All-Reduce. Thus, if we train with hundreds of peers, the 0.3–0.6 second overhead can eventually become significant. However, it can be easily offset by moving the CENTEREDCLIP execution to GPU, which at this stage is waiting for the CENTEREDCLIP results anyway. + +![](images/320d7a6a2b1fa71312a43bc0f53ca540fbfcb3480c2dbacc9f7d2039888423f3.jpg) + +![](images/20d64fa69dccea8be3b8a9be2684b82756389980be69d76789cb6407f67c0156.jpg) + +![](images/da7086725bf181712d626f6062472e3978124f55b217b96724d48548af5d383f.jpg) + +![](images/16dc53d5ce3cde68a1cfb49a745c7adddc12ee9e6a834dfc6bc156b106fb3f87.jpg) + +![](images/e79ffc1acfe020bd05629eeab608c0caa3f9bba8477cb038bcef05add27cb133.jpg) + +![](images/0c22ba9aa4f7ff75e469b293bad3ebc39391995a0238e38685d4b9eb37979627.jpg) + +![](images/dcdd8ff812ff19c5ef829a04ce3779fcc813eb16363f8453386af92a0c85bf91.jpg) +Figure 8. The ResNet-18 test accuracy in the case of various attacks performed at each step starting from step $s = 1000$ by 3 Byzantines. + +![](images/edfedccd73511706b05db945c943cb2feb3e89625b281f52fe09fd17534bd28e.jpg) + +![](images/ce7f703804fd7928fe0bd9244976df6f5c2de584b4dd243b19d3eb03e03b6954.jpg) +Figure 9. Convergence of BTARD-SGD with $\tau = 1$ depending on the maximal number of iterations $M$ in the CenteredClip procedure. + +Table 3. Computation overhead of BTARD in terms of wall time. + +
No. of iterationsWall time (CPU), secWall time (GPU), sec
30.362 ± 0.0030.040 ± 0.002
50.430 ± 0.0020.042 ± 0.002
100.601 ± 0.0030.056 ± 0.005
200.943 ± 0.0020.085 ± 0.009
+ +![](images/adc8041350725cddc1cc3cee6fdd2fb41cd5666eb077c186103cf94ca7acb426.jpg) +Figure 10. The ALBERT-large training objective in the case of BTARD-CLIPPED-SGD (with 31 out of 64 peers being Byzantine) and the standard All-Reduce SGD (without attacks). + +![](images/6244ad125b5f31d41a8bafca1d47ca98e94efc52d532ba1aee3a7fab0976bf67.jpg) + +# I.3. Experiments at a larger scale (64 machines) + +In this section, we evaluate the most effective attacks against BTARD-SGD in the case of a larger number of peers to ensure that our algorithm scales well. We consider the ALBERT-large training setup from Section 4.2 and increase the number of machines to 64 (the largest hardware setup available to us), setting up 31 of them to be Byzantine. To balance the increased number of peers, we divide the individual batch size of each peer by 4 and use 4 placeholders. + +Due to the large computation costs, we only evaluate the two most effective strategies for Byzantines based on Figure 4, making only one training run for each of them. We choose the random direction attack starting at step 1000 and the sign flipping attack starting at step 5000. + +The results are shown in Figure 10. As in our previous experiments, the Byzantine peers manage to temporarily offset the training loss. As in the case with 16 peers, the sign flipping attack at step 5000 obtains the "peak" distortion approximately 20 steps into the attack, and the random direction attack at step 1000 has a longer but less intensive effect. However, BTARD-SGD is able to quickly detect and ban the attackers, banning all 31 Byzantines in 100-150 steps and catching up with the original learning curve after approximately 150 steps (or even temporarily surpassing it). We conclude that BTARD-SGD maintains its efficiency even at this scale. \ No newline at end of file diff --git a/securedistributedtrainingatscale/images.zip b/securedistributedtrainingatscale/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..ec330ba697b7d0e331bdbf3a55bf8d20adc50836 --- /dev/null +++ b/securedistributedtrainingatscale/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:baeeb734d5f8809157eb81b7c38cb6e7084da9b5f7581e68313c4dc3fe601bad +size 3464156 diff --git a/securedistributedtrainingatscale/layout.json b/securedistributedtrainingatscale/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..3b4b029dbf7cb5786727571e5b84befca68f092e --- /dev/null +++ b/securedistributedtrainingatscale/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:649e833ddf70b8ca1a9de3f3c1368237d9c39679f8cbfee399d946ff675ff2ad +size 2710193 diff --git a/securequantizedtrainingfordeeplearning/a7df72a7-3906-463b-87b2-9644159f6530_content_list.json b/securequantizedtrainingfordeeplearning/a7df72a7-3906-463b-87b2-9644159f6530_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..7207bad4fb73230b26aa71a53475c6ef9cd65b89 --- /dev/null +++ b/securequantizedtrainingfordeeplearning/a7df72a7-3906-463b-87b2-9644159f6530_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b8e115653553119f0f9bd6e0f5643eed814c91692d3a3171f49d165fbaaaa725 +size 178547 diff --git a/securequantizedtrainingfordeeplearning/a7df72a7-3906-463b-87b2-9644159f6530_model.json b/securequantizedtrainingfordeeplearning/a7df72a7-3906-463b-87b2-9644159f6530_model.json new file mode 100644 index 0000000000000000000000000000000000000000..30de1506ecb2773315296130ef8456b85794af5e --- /dev/null +++ b/securequantizedtrainingfordeeplearning/a7df72a7-3906-463b-87b2-9644159f6530_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5cf89c3aa38be25ea4dbcb58b9d0f27741d18c741fc646e3e82da9182bae362d +size 214278 diff --git a/securequantizedtrainingfordeeplearning/a7df72a7-3906-463b-87b2-9644159f6530_origin.pdf b/securequantizedtrainingfordeeplearning/a7df72a7-3906-463b-87b2-9644159f6530_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..ff13a17588f4b8464ecc1b94f968d6709b60ca59 --- /dev/null +++ b/securequantizedtrainingfordeeplearning/a7df72a7-3906-463b-87b2-9644159f6530_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:66a90b2bed8f414acf59cafacdea07d8cc4e05349219b5c5d682080d7b4947ff +size 587415 diff --git a/securequantizedtrainingfordeeplearning/full.md b/securequantizedtrainingfordeeplearning/full.md new file mode 100644 index 0000000000000000000000000000000000000000..d2a7de65435192c207588452d65119d6c21bdf43 --- /dev/null +++ b/securequantizedtrainingfordeeplearning/full.md @@ -0,0 +1,884 @@ +Marcel Keller1 Ke Sun1,2 + +# Abstract + +We implement training of neural networks in secure multi-party computation (MPC) using quantization commonly used in said setting. We are the first to present an MNIST classifier purely trained in MPC that comes within 0.2 percent of the accuracy of the same convolutional neural network trained via plaintext computation. More concretely, we have trained a network with two convolutional and two dense layers to $99.2\%$ accuracy in 3.5 hours (under one hour for $99\%$ accuracy). We have also implemented AlexNet for CIFAR-10, which converges in a few hours. We develop novel protocols for exponentiation and inverse square root. Finally, we present experiments in a range of MPC security models for up to ten parties, both with honest and dishonest majority as well as semi-honest and malicious security. + +# 1. Introduction + +Secure multi-party computation (MPC) is a cryptographic technique that allows a set of parties to compute a public output on private inputs without revealing the inputs or any intermediate results. This makes it a potential solution to federated learning where the sample data stays private and only the model or even only inference results are revealed. + +Imagine a set of healthcare providers holding sensitive patient data. MPC allows them to collaboratively train a model. This model could then either be released or even kept private for inference using MPC again. See Figure 1 for an illustration. Note that MPC is oblivious to how the input data is split among participants, that is, it can be used for the horizontal as well as the vertical case. + +A more conceptual example is the well-known millionaires' problem where two people want to find out who is richer without revealing their wealth. There is clearly a difference + +1CSIRO's Data61, Sydney, Australia 2The Australian National University. Correspondence to: Marcel Keller , Ke Sun . + +Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s). + +between the one bit of information desired and the full figures. + +There has been a sustained interest in applying secure computation to machine learning and neural networks going back to at least Barni et al. (2006). More recent advances in practical MPC have led to an increased effort in implementing both inference and training. + +A number of works such as Mohassel & Zhang (2017), Mohassel & Rindal (2018), Wagh et al. (2019), Wagh et al. (2021) implement neural network training with MPC at least in parts. However, for the task of classifying MNIST digits, they either give accuracy figures below $95\%$ or figures obtained using plaintext training. For the latter case, the works do not clarify how close the computation for plaintext training matches the lower precision and other differences in the MPC setting. Agrawal et al. (2019) achieved an accuracy of $99.38\%$ in a comparable setting for a convolutional neural network with more channels than we use. However, their actual implementation only uses dense layers, and we achieve comparable accuracy in this model. All works use quantization in the sense that a fractional number $x$ is represented as $\lfloor x \cdot 2^{f}\rfloor$ where $\lfloor \cdot \rfloor$ denotes rounding to the nearest integer, and $f \in \mathbb{Z}$ ( $\mathbb{Z}$ : the set of integers) is a precision parameter. This makes addition considerably faster in the secure computation setting because it reduces to integer addition (at the cost of compounding rounding errors). Furthermore, some of the works suggest replacing the softmax function that uses exponentiation with a ReLU-based replacement. Keller & Sun (2020) discovered that this softmax replace + +![](images/9d171922c891141487e4b50153c546cd3760e9a95f0f7317c2ee5991b4e19f13.jpg) +Figure 1: Outsourced computation: Data holders (on the left) secret-share their data to a number of computing parties (on the right), who then return the desired result (e.g., a model or inference results on further queries). All communication except the outputs is secret-shared and thus secure if no two computing parties collude. + +ment deteriorates accuracy in multilayer perceptrons to the extent that it does not justify the efficiency gains. + +The concurrent work of Tan et al. (2021) gives some figures on the learning curves when trained with secure computation. However, they stop at five epochs for MNIST training and achieve $94\%$ accuracy, whereas we present the figures up to 50 epochs and $99.2\%$ accuracy using AMSGrad. Our implementation using stochastic gradient descent (SGD) is $40\%$ faster than theirs. Note that we use the CPU of one AWS c5.9xlarge instance per party whereas Tan et al. use one NVIDIA Tesla V100 GPU per party. We believe this somewhat counter-intuitive result comes from MPC heavily relying on communication, which is an aspect where GPUs do not have an advantage over CPUs. While GPUs are very efficient in computing on data in their cache, it is no more efficient to transfer data in and out of these caches. + +In this paper, we present an extensible framework for secure deep learning based on MP-SPDZ by Keller (2020), a software library for multi-party computation. Similar to TensorFlow and PyTorch, our approach allows representing deep learning models as a succession of layers. We then use this implementation to obtain accuracy figures for MNIST and CIFAR-10 training by utilizing the MP-SPDZ emulator, which allows us to run the plaintext equivalent of secure computation, that is, the same algorithms with the same precision. Finally, we run one of the most promising instantiations in real secure computation in order to benchmark it, confirming the results from the plaintext emulator. We use less sophisticated datasets because the relatively high cost of MPC makes it less feasible to use datasets with millions of examples rather than tens of thousands. + +For our implementation, we have designed novel protocols for exponentiation and inverse square root computation. Both play an important role in deep learning, the first in softmax, and the second in the Adam and AMSGrad optimizers. Our protocols are based on mixed-circuit computation, that is, we combine a protocol that works over $\mathbb{Z}_M$ for some large modulus $M$ and thus integer-like computation with a protocol in the same security model that works over $\mathbb{Z}_2$ , which allows computing binary circuits. + +There are several projects that integrate secure computation directly into popular machine learning frameworks such as CryptTen by Knott et al. (2021), PySyft by Ryffel et al. (2018), and TF Encrypted by Dahl et al. (2018). Our approach differs from all of them by running the protocol as native CPU code (implemented using C++. This allows for much faster execution. For example, CryptTen provides an MNIST training example (mpc_autograd_cnn), which + +we adapted to full LeNet (LeCun et al., 1998) training. It took over three hours to run one epoch on one machine. In comparison, our implementation takes 11 minutes to run one epoch with the full dataset of 60,000 samples with the same hardware across instances. + +An alternative to MPC would be using purely homomorphic encryption. Lou et al. (2020) trained an MNIST network to $98.6\%$ accuracy in 8 days whereas we achieved the same accuracy in less than 5 days when using a two-party protocol based on homomorphic encryption. + +A number of works (Juvekar et al., 2018; Mishra et al., 2020; Rathee et al., 2020) only implemented deep learning inference. None of them implements all building blocks necessary for training. It is therefore not possible to make any statement on the training performance of these works. + +Another line of work (e.g., Quoc et al. 2021) uses trusted execution environments that provide computation outside the reach of the operating system. This is a different security model to multi-party computation that works with distributing the information among several entities. + +The rest of this paper is structured as follows: We highlight some secure computation aspects in Section 2 and do the same for machine learning in Section 3. Section 4 analyzes the error introduced by the quantization. Finally, we present our implementation and our experimental results for MNIST and CIFAR-10 classification in Section 5. + +# 2. Secure Computation Building Blocks + +Our secure implementation has two layers of abstraction. The lower level is concerned with a few basic operations that depend on the actual protocol and security model. The basic operations include integer addition and multiplication, input, output, and domain conversion, that is converting between integer-focused and bit-focused computation. Appendices A and B give the details of our honest-majority three-party protocol and our dishonest-majority protocol, respectively. Honest and dishonest majority refer to how many computing parties are being trusted. For an honest majority, strictly more than half parties must follow the protocol and not reveal information to anyone else. This setting allows for more efficient protocols while the dishonest-majority setting requires more expensive cryptographic schemes such as homomorphic encryption to be used. See Keller (2020) for a cost comparison between a range of protocols. The higher level of abstraction is common to all protocols as it builds in a generic way on the primitives in the lower level. Notable operations on this level are division, exponentiation, and inverse square root. Appendix C provides more details. + +In this section, we focus on two aspects: How to implement fractional-number computation with integers, and how to im + +plement exponentiation. The former plays a crucial role in efficient secure computation, and the latter presents a novel protocol. We also contribute a novel protocol for inverse square root computation, which is deferred to Appendix C due to space constraints. + +# 2.1. Quantization + +While Aliasgari et al. (2013) showed that it is possible to implement floating-point computation, the cost is far higher than integer computation. It is therefore common to represent fractional numbers using quantization (also called fixed-point representation) as suggested by Catrina & Saxena (2010). A real number $x$ is represented as $Q^{f}(x) := \lfloor x \cdot 2^{f} \rfloor$ where $f$ is a positive integer specifying the precision. The linearity of the representation allows to compute addition by simply adding the representing integers. Multiplication however requires adjusting the result because it will have twice the precision: $(x \cdot 2^{f}) \cdot (y \cdot 2^{f}) = xy \cdot 2^{2f}$ . There are two ways to rectify this: + +- An obvious correction would be to shift the result by $f$ bits after adding $2^{f - 1}$ to the integer representation, as $\lfloor xy \cdot 2^f \rceil = \lfloor 2^{-f} \cdot (xy \cdot 2^{2f} + 2^{f - 1}) \rfloor$ , where $\lfloor \cdot \rfloor$ is the floor function. This ensures rounding to the nearest number possible in the representation, with the tie being broken by rounding up. +- However, Catrina & Saxena found that in the context of secure computation it is more efficient to use probabilistic truncation. This method rounds up or down probabilistically depending on the input. For example, probabilistically rounding 0.75 to an integer would see it rounded up with probability 0.75 and down with probability 0.25. + +Our quantization scheme is related to quantized neural networks (see e.g. Hubara et al. 2016). However, our consideration is not to compress the model, but to improve the computational speed and to reduce communication. + +# 2.2. Exponentiation + +Exponentiation is a core computational module in deep learning and is useful to evaluate non-linear activation functions such as the softmax. Mohassel & Zhang (2017) introduced a simplification of softmax to avoid computing exponentiation. In this section, we present an optimized exponentiation protocol instead. + +As noted by Aly & Smart (2019), exponentiation can be reduced to exponentiation with base two using $a^x = 2^x \log_2 a$ . Furthermore, if the base is public, this reduction only costs one public-private multiplication, and it introduces an ac + +# Algorithm 1 Exponentiation with base two (Aly & Smart, 2019) + +Input: Secret share $\langle x; f \rangle^{\mathsf{A}}$ with precision $f$ where $-(k - f - 1) < x < k - f - 1$ + +Output: $\langle 2^x; f \rangle^{\mathsf{A}}$ with precision $f$ and total bit length $k$ + +1: $\langle s\rangle^{\mathsf{A}}\gets \langle x;f\rangle^{\mathsf{A}} < 0$ {sign} +2: $\langle x; f \rangle^{\mathsf{A}} \gets \langle x; f \rangle^{\mathsf{A}} - 2 \cdot \langle s \rangle^{\mathsf{A}} \cdot \langle x; f \rangle^{\mathsf{A}}$ {absolute value} + +3: $\langle i\rangle^{\mathsf{A}}\gets \mathrm{Trunc}(\langle x;f\rangle^{\mathsf{A}})$ {integer component} +4: $\langle r;f\rangle^{\mathsf{A}}\gets \langle x;f\rangle^{\mathsf{A}} - \langle i\rangle^{\mathsf{A}}$ {fractional component} +5: $\ell \gets \lceil \log_2(k - f)\rceil$ +6: $\langle i_0\rangle^{\mathsf{A}},\ldots ,\langle i_{\ell -1}\rangle^{\mathsf{A}}\gets \mathrm{BitDec}(\langle r\rangle^{\mathsf{A}},\ell)$ {bit decomposition} +7: $\langle d\rangle^{\mathsf{A}}\gets \prod_{j = 0}^{\ell -1}(\langle i_j\rangle^{\mathsf{A}}\cdot 2^{2^j} + 1 - \langle i_j\rangle^{\mathsf{A}})$ {integer expon-mentation} +8: $\langle u; f \rangle^{\mathsf{A}} \gets \text{Approx}_{2*}(\langle r; f \rangle^{\mathsf{A}})$ {polynomial approximation} +9: $\langle g;f\rangle^{\mathsf{A}}\gets \langle u;f\rangle^{\mathsf{A}}\cdot \langle d\rangle^{\mathsf{A}}$ +10: return $\langle s\rangle^{\mathsf{A}}\cdot \left(\frac{1}{\langle g;f\rangle^{\mathsf{A}}} -\langle g;f\rangle^{\mathsf{A}}\right) + \langle g;f\rangle^{\mathsf{A}}$ {correct for sign} + +# Algorithm 2 Exponentiation with base two (ours) + +Input: Secret share $\langle x; f \rangle^{\mathsf{A}}$ with precision $f$ where $x < k - f - 1$ + +Output: $\langle 2^x; f \rangle^{\mathsf{A}}$ with precision $f$ and total bit length $k$ . + +1: $\langle x_0\rangle^{\mathsf{B}},\dots ,\langle x_{k - 1}\rangle^{\mathsf{B}}\gets \mathsf{A2B}(\langle x;f\rangle^{\mathsf{A}})$ {bit decomposition} + +2: $\langle z\rangle^{\mathsf{B}}\gets \sum_{i = 0}^{k - 1}2^{i - f}\langle x_i\rangle^{\mathsf{B}} < -(k - f - 1)$ {binary comparison with fixed-representation} + +3: $\ell \gets \lceil \log_2(k - f)\rceil$ + +4: for $j = f, \dots, f + \ell - 1$ do + +5: $\langle x_j\rangle^{\mathsf{A}}\gets \mathrm{Bit2A}(\langle x_j\rangle^{\mathsf{B}})$ + +6: end for + +7: $\langle d\rangle^{\mathsf{A}}\gets \prod_{j = 0}^{\ell -1}(\langle x_{f + j}\rangle^{\mathsf{A}}\cdot 2^{2^j} + 1 - \langle x_{f + j}\rangle^{\mathsf{A}})$ {integer exponentiation} + +8: $\langle r\rangle^{\mathsf{A}}\gets \mathsf{B}2\mathsf{A}(\langle x_0\rangle^{\mathsf{B}},\ldots ,\langle x_{f - 1}\rangle^{\mathsf{B}})$ {fractional component} + +9: $\langle u; f \rangle^{\mathsf{A}} \gets \text{Approx}_{2*}(\langle r; f \rangle^{\mathsf{A}})$ {polynomial approximation} + +10: $\langle g;f\rangle^{\mathsf{A}}\gets \langle u;f\rangle^{\mathsf{A}}\cdot \langle d\rangle^{\mathsf{A}}$ + +11: $\langle g'; f \rangle^{\mathsf{A}} \gets \text{Round}(\langle g; f \rangle^{\mathsf{A}}, f + 2^{\ell}, 2^{\ell})$ {result for negative input} + +12: $\langle h;f\rangle^{\mathsf{A}}\gets \mathrm{Bit2A}(\langle x_{k - 1}\rangle^{\mathsf{B}})\cdot \big(\langle g^{\prime};f\rangle^{\mathsf{A}} - \langle g;f\rangle^{\mathsf{A}}\big) +$ $\langle g;f\rangle^{\mathsf{A}}$ {correct for sign} + +13: return $(1 - \mathrm{Bit2A}(\langle z\rangle^{\mathrm{B}}))\cdot \langle h;f\rangle^{\mathrm{A}}$ {output 0 if input is too small} + +ceptable error as + +$$ +2 ^ {x \log_ {2} a \pm 2 ^ {- f}} = 2 ^ {x \log_ {2} a} \cdot 2 ^ {\pm 2 ^ {- f}}. +$$ + +# Algorithm 3 Procedures in Algorithms 1 and 2 + +$\langle x_0\rangle^{\mathsf{B}},\ldots ,\langle x_{k - 1}\rangle^{\mathsf{B}}\gets \mathsf{A2B}(\langle x;f\rangle^{\mathsf{A}})$ Arithmetic to binary conversion of the $k$ least significant bits, which can be implemented using edaBits (Escudero et al., 2020) or local share conversion (Demmler et al., 2015; Araki et al., 2018) if available in the underlying protocol. +$\langle x\rangle^{\mathsf{A}}\gets \mathrm{Bit2A}(\langle x\rangle^{\mathsf{B}})$ Bit to arithmetic conversion, which can be implemented using daBits (Rotaru & Wood, 2019). +$\langle x\rangle^{\mathsf{A}}\gets \mathsf{B2A}(\langle x_0\rangle^{\mathsf{B}},\ldots ,\langle x_k\rangle^{\mathsf{B}})$ Binary to arithmetic conversion of $k$ -bit values, which can be implemented using edaBits. +$\langle y; f \rangle^{\mathsf{A}} \gets \text{Round}(\langle x; f \rangle^{\mathsf{A}}, k, m)$ Truncate a $k$ -bit value by $m$ bits with either nearest or probabilistic rounding, corresponding to a division by $2^{m}$ . Both also benefit from mixed-circuit computation as shown by Dalskov et al. (2021). +$\langle y; f \rangle^{\mathsf{A}} \gets \text{Approx}_{2^*}(\langle x; f \rangle^{\mathsf{A}})$ Approximate $2^x$ for $x \in [0,1]$ using a Taylor series. + +The second multiplicand on the right-hand side is easily seen to be within $[1 - 2^{-f}, 1 + 2^{-f}]$ . + +Algorithm 1 shows the exponentiation method by Aly & Smart. It uses $\langle \cdot \rangle^{\mathsf{A}}$ to indicate integer sharing and $\langle \cdot ;f\rangle^{\mathsf{A}}$ to indicate fixed-point sharing. We use the superscript A to indicate that both secret sharing are in the arithmetic domain, that is, in $Z_{M}$ for some large $M$ . This distinguishes them from the bit-wise secret sharing indicated by B used below. The algorithm uses a number of standard components such as addition, multiplication, comparison, and bit decomposition. Furthermore, it uses a polynomial approximation of $2^{x}$ for $x\in [0,1]$ . They propose to use the polynomial $P_{1045}$ by Hart (1978). However, we found that Taylor approximation at 0 leads to better results than $P_{1045}$ . + +Algorithm 1 suffers from two shortcomings. First, it is unnecessarily restrictive on negative inputs because it uses the absolute value of the input, the exponentiation of which falls outside the representation range for values as small as $k - f - 1$ where $k$ is a parameter defining the range of inputs $([-2^{k - f - 1}, 2^{k - f - 1}])$ . Second, the truncation used to find the integer component resembles bit decomposition in many protocols. It is therefore wasteful to separate the truncation and the bit decomposition. Algorithm 2 fixes these two issues. It also explicitly uses mixed circuits, with binary secrets denoted using $\langle \cdot \rangle^{\mathsf{B}}$ . + +The general structure of Algorithm 2 is the same as Algorithm 1. It splits the input into an integer and a fractional + +Table 1: Total communication in kbit for Algorithms 1 and 2 across a range of security models with one corrupted party. "SH" stands for semi-honest security and "Mal." for malicious security. + +
3 Parties2 Parties
SHMal.SHMal.
Aly & Smart (2019)274981,338214,476
Algorithm 2 (ours)16323813121,747
+ +part and then computes the exponential separately, using an exact algorithm for the integer part and an approximation for the fractional part. It differs in that it uses mixed circuits and it allows any negative input. The biggest difference however is in step 11, where the exponentiation of a negative number is not computed by inverting the exponentiation of the absolute value. Instead, we use the following observation. If $-2^{\ell} \leq x < 0$ , $x = -2^{\ell} + y + r$ , where $y = x + 2^{\ell} - r$ and $r$ is the fractional component of $x$ . Then, + +$$ +2 ^ {x} = 2 ^ {- 2 ^ {\ell}} \cdot 2 ^ {y} \cdot 2 ^ {r}. +$$ + +$2^{y}$ equals $d$ in Algorithm 2 because $y$ is the composition of the bits used in integer exponentiation, namely $y = \sum_{i=0}^{\ell-1} x_{f+i}$ . Therefore, $g \approx 2^{y} \cdot 2^{r}$ , and + +$$ +g ^ {\prime} \approx \frac {g}{2 ^ {2 \ell}} \approx 2 ^ {x} +$$ + +for $g$ and $g'$ in steps 10 and 11 because rounding by $2^{\ell}$ bits implies division by $2^{2^{\ell}}$ . This saves a relatively expensive division compared to Algorithm 1. + +Table 1 shows how the two algorithms compare in terms of communication across a number of security models. All figures are obtained using MP-SPDZ (Keller, 2020) with $f = 16$ , $k = 31$ , computation modulo $2^{64}$ for three-party computation, and computation modulo a 128-bit prime for two-party computation (as in Section 5.1.1). We use edaBits for mixed-circuit computation in Algorithm 2. Across all security models, our algorithm saves about 30 percent in communication despite the improved input range. In the context of the figures in Table 5 the improvement is less than one percent because exponentiation is only used once for every example per epoch, namely for the computation of softmax. + +# 3. Deep Learning Building Blocks + +In this section, we give a high-level overview of our secure deep learning framework, and how it builds upon our low-level computational modules (implemented from scratch) to tackle challenges in secure computation. Table 2 shows a non-exhaustive list of basic operations that is our computational alphabet, with a rough estimation of their cost in + +Table 2: Basic operations and their cost. The column "MPC Cost" shows the roughly approximated computational cost in MPC, as compared to integer multiplication. The last column displays the computational and communication resource consumption. "□" means the cheapest computation; "□" means the most expensive. + +
OperationMPC Cost (≈)Efficiency
[x > y]101□
x ± y10-1□
x × y (integer)100□
x × y (fractional)101□
x/y102□
1/√x102□
exp(x), log(x)102□
+ +MPC. The "MPC Cost" column shows how an operation relates to integer multiplication in terms of magnitude order because integer multiplication is the most basic operation that involves communication. Most notably, comparison is not the basic operation as in silicon computation. + +Linear Operations Matrix multiplication is the workhorse of deep learning frameworks. The forward and backward computation for both dense layers and convolutional layers are implemented as matrix multiplication, which in turn is based on dot products. A particular challenge in secure computation is to compute a number of outputs in parallel to save communication rounds. We overcome this challenge by having a dedicated infrastructure that computes all dot products for a matrix multiplication in a single batch of communication, thus reducing the number of communication rounds. Another challenge is the accumulated error when evaluating matrix multiplication using quantized numbers. The following Section 4 presents a careful analysis on our solution to this potential issue. Our secure computation implementation uses efficient dot products when available (Appendix A) or efficient use of SIMD-style homomorphic encryption (Appendix B). + +Non-linear Operations A major part of the non-linear computation is the non-linear neural network layers. Both rectified linear unit (ReLU; Nair & Hinton 2010) and max pooling are based on comparison followed by oblivious selection. For example, $\operatorname{ReLU}(x) := \max(x, 0) = (x > 0 \mid x : 0)$ , where the C expression (condition? $a : b$ ) outputs $a$ if condition is true and outputs $b$ if otherwise. In secure computation, it saves communication rounds if the process uses a balanced tree rather than iterating over all input values of one maximum computation. For example, two-dimensional max pooling over a 2x2 window requires computing the maximum of four values. We compute the + +maximum of two pairs of values followed by the maximum of the two results. Our softmax and sigmoid activation functions are implemented using the exponentiation algorithm in section 2.2. Another source of non-linear computation is the inverse square root $1 / \sqrt{x}$ , which appears in batch normalization (Ioffe & Szegedy, 2015), our secure version of Adam (Kingma & Ba, 2015) and AMSGrad (Reddi et al., 2018) optimizers, and Glorot initialization (Glorot & Bengio, 2010) of the neural network weights. Our novel implementation of $1 / \sqrt{x}$ (explained in Appendix C) is more efficient than state-of-the-art alternatives (Aly & Smart, 2019; Lu et al., 2020). It helps to avoid numerical division, which is much more expensive than multiplication. Taking Adam as an example, the increment of the parameter $\theta_{i}$ in each learning step is altered to $\gamma g_{i} / \sqrt{v_{i} + \varepsilon}$ ( $\gamma$ : learning rate; $g_{i}$ and $v_{i}$ : first and second moments of the gradient; $\varepsilon = 10^{-8}$ ) as compared to $\gamma g_{i} / (\sqrt{v_{i}} + \varepsilon)$ in Kingma & Ba's original algorithm, so that we only need to take the inverse square root of $v_{i} + \varepsilon$ , then multiply by $\gamma$ and $g_{i}$ . + +Random Operations Our secure framework supports random initialization of the network weights (Glorot & Bengio, 2010), random rounding, random shuffling of the training samples, and Dropout (Srivastava et al., 2014). Our implementation relies on uniform random samplers (Dalskov et al., 2021; Escudero et al., 2020) based on mixed-circuit computation. Random rounding and Dropout require to draw samples from Bernoulli random variables. By a reparameterization trick, a sample $x$ from the distribution $\operatorname{Prob}(x = a) = p$ , $\operatorname{Prob}(x = b) = 1 - p$ ( $\operatorname{Prob}(\cdot)$ : probability of statement being true) can be expressed as $x = b + (a - b)\lfloor p + r\rfloor$ , where $r \sim \mathcal{U}(0,1)$ (uniform distribution on $[0,1]$ ). + +# 4. An Analysis of Probabilistic Rounding + +In this section, we analyze the rounding error of our secure quantized representation for matrix multiplication. We show that our rounding algorithm ① is unbiased; ② has acceptable error; ③ is potentially helpful to training. Fixed point numbers (Lin et al., 2016) and stochastic rounding (Wang et al., 2018) have been applied to deep learning. The rounding error analysis presented here is potentially useful to similar quantized representations. + +Recall that any $x \in \mathbb{R}$ is stored as an integer (equivalently, a fixed point number) $Q^{f}(x) := \lfloor x \cdot 2^{f} \rfloor$ . As the maximum error of the nearest rounding $\lfloor \cdot \rfloor$ is $1/2$ , we have $|x - Q^{f}(x) 2^{-f}| = 2^{-f} |x \cdot 2^{f} - Q^{f}(x)| \leq 2^{-f - 1} = \epsilon / 2$ , where $\epsilon := 2^{-f}$ is the smallest positive number we can represent. Our multiplication algorithm outputs $R^{f}(xy)$ , the integer representation of the product $xy$ . By definition, + +$$ +\begin{array}{l} R ^ {f} (x y) := \lfloor \mu \rfloor + b, \\ \mu := Q ^ {f} (x) Q ^ {f} (y) 2 ^ {- f}, \quad b \sim \mathcal {B} (\{\mu \}), \tag {1} \\ \end{array} +$$ + +where $\{\mu\}$ is the fractional part of $\mu$ ( $0 \leq \{\mu\} < 1$ ), the random variable $b \in \{0,1\}$ means rounding down or up, and $\mathcal{B}(\cdot)$ denotes a Bernoulli distribution with given mean. Notice that the input $Q^{f}(x)$ and $Q^{f}(y)$ and the output $R^{f}(xy)$ are integers. They all have to be multiplied by $2^{-f}$ to get the underlying fixed point number. Eq. (1) can be computed purely based on integer operations (see Appendix C). The Bernoulli random variable $b$ in Eq. (1) is sampled independently for each numerical product we compute. + +Given two real matrices $A_{m \times n}$ and $B_{n \times p}$ represented by $Q^{f}(A)$ and $Q^{f}(B)$ , where $Q^{f}(\cdot)$ is elementwisely applied to the matrix entries, the integer representation of their product is $R^{f}(AB) := \left( \sum_{l} R^{f}(A_{il}B_{lj}) \right)_{m \times p}$ . Its correctness is guaranteed in the following proposition. + +Proposition 4.1. $\forall A\in \mathbb{R}^{m\times n},\forall B\in \mathbb{R}^{n\times p},$ $E(R^{f}(AB)) = 2^{-f}Q^{f}(A)Q^{f}(B)$ , where $E(\cdot)$ denotes the expectation with respect to the random rounding in Eq. (1). + +The expectation of the random matrix $R^{f}(AB)$ is exactly the matrix product of $Q^{f}(A)$ and $Q^{f}(B)$ up constant scaling. Hence, our matrix multiplication is unbiased. Product of fixed point numbers can also be based on nearest rounding by replacing Eq. (1) with $\tilde{R}^{f}(xy) \coloneqq \lfloor Q^{f}(x)Q^{f}(y)2^{-f}\rfloor$ . As a deterministic estimation, it is unbiased only if the rounding error is absolutely zero, which is not true in general. Therefore, matrix product by nearest rounding is biased. + +We bound the worst case error during matrix multiplication as follows. + +Proposition 4.2. Assume $A \in \mathbb{R}^{m \times n}$ , $B \in \mathbb{R}^{n \times p}$ , and the absolute value of all entries are bounded by $2^k$ ( $k \geq 0$ ). Then, $\| R^f(AB) - 2^f AB \| < \sqrt{mp} \cdot n \cdot (2^k + 1 + \epsilon/4)$ , where $\epsilon := 2^{-f}$ , and $\|\cdot\|$ is the Frobenius norm. + +In Proposition 4.2, $k$ corresponds to the number of bits to present the integer part of any $x \in \mathbb{R}$ . To get some intuition, we have the trivial bound $\| AB \| \leq \sqrt{mp} \cdot n \cdot 2^{k+1}$ . By Proposition 4.2, the computational error $\| 2^{-f} R^f(AB) - AB \|$ has a smaller order of magnitude, as it scales with $\epsilon = 2^{-f}$ . The precision $f$ should be high enough to avoid a large error. Let us remark that nearest rounding has similar deterministic error bounds (omitted here). + +The following proposition shows our rounding in eq. (1) satisfies another probabilistic bound, which improves over the above worst case bound. + +Proposition 4.3. Let $A \in \mathbb{R}^{m \times n}$ , $B \in \mathbb{R}^{n \times p}$ . With probability at least $1 - \frac{1}{4\iota^2}$ , the following is true + +$$ +\| R ^ {f} (A B) - 2 ^ {- f} Q ^ {f} (A) Q ^ {f} (B) \| \leq \iota \sqrt {m n p}. +$$ + +By Proposition 4.1, $2^{-f}Q^{f}(A)Q^{f}(B)$ is the expectation of $R^{f}(AB)$ . Therefore the first term is the "distance" between the random matrix $R^{f}(AB)$ and its mean. One can + +roughly approximate $2^{-f}Q^{f}(A)Q^{f}(B) \approx 2^{f}AB$ to compare Proposition 4.3 with Proposition 4.2. The probabilistic bound scales the deterministic bound by a factor of $2^{-k} / \sqrt{n}$ . That means our matrix multiplication is potentially more accurate than alternative implementations based on nearest rounding, especially for large matrices ( $n$ is large). + +One can write Dropout (Srivastava et al., 2014) in a similar way to eq. (1): $\text{Dropout}(A) = A \odot B$ , $b_{ij} \sim \mathcal{B}(\tau)$ , where $\odot$ is Hadamard product, and $\tau > 0$ is a dropout rate. Our probabilistic rounding is naturally equipped with noise injection, which is helpful to avoid bad local optima and over-fitting. Based on our observations, one can achieve better classification accuracy than nearest rounding in general. + +# 5. Implementation and Benchmarks + +We build our implementation on MP-SPDZ by Keller (2020). MP-SPDZ not only implements a range of MPC protocols, but also comes with a high-level library containing some of the building blocks in Appendix C. We have added the exponentiation in Section 2.2, the inverse square root computation in Appendix C, and all machine learning building blocks. + +MP-SPDZ allows implementing the computation in Python code, which is then compiled into a specific bytecode. This code can be executed by a virtual machine performing the actual secure computation. The process allows optimizing the computation in the context of MPC. + +The framework also features an emulator that executes the exact computation in the clear that could be done securely. This allowed us collecting the accuracy figures in the next section at a lower cost. Our implementation is licensed under a BSD-style license. + +# 5.1. MNIST Classification + +For a concrete measurement of accuracy and running times, we train a multi-class classifier3 for the widely-used MNIST dataset (LeCun et al., 2010). We work mainly with the models used by Wagh et al. (2019) with secure computation, and we reuse their numbering (A-D). The models contain up to four layers. Network C is a convolutional neural network that appeared in the seminal work of LeCun et al. (1998) whereas the others are simpler networks used by related literature on secure computation such as Mohassel & Zhang (2017), Liu et al. (2017), and Riazi et al. (2018). See Figures 5-8 in the Appendix for the exact network structures. + +Figure 2 shows the learning curves for various quantization precisions and two rounding options, namely, nearest and + +![](images/cd31da24a403cbb106981922d07a06aeaf31e4fbba949ce0abc5b6e1144d3cdd.jpg) +Figure 2: Loss and accuracy for LeNet and various precision options when running SGD with a learning rate of 0.01. Interval only available for $f = 32$ and $f = 16$ with probabilistic rounding. + +![](images/f036a68ed0d20a3d0cc486bd0ad62e57ff1a7e8e114edc794a7e27c4bd8659cf.jpg) +Figure 3: Loss and accuracy for LeNet with various optimizer options, $f = 16$ , and probabilistic truncation. $\gamma$ is the learning rate. Interval only available for AMSGrad with $\gamma = 0.0001$ . + +![](images/83a3a80864dbe064979cc209df97d4e3d17b343dc46846519a97b3bc1e9101a4.jpg) +Figure 4: Comparison of cleartext training and secure training for LeNet with $f = 16$ and probabilistic truncation. $\gamma$ is the learning rate. + +probabilistic rounding. We use SGD with learning rate 0.01, batch size 128, and the usual MNIST training/test split. Most configurations perform similarly except for 16-bit precision with nearest rounding which gives worse results. We run the best-performing configurations several times. The range of the performance scores is indicated by the shaded area. For the rest of the paper, we focus on $f = 16$ with probabilistic rounding because it offers the best overall performance in terms of accuracy and efficiency. + +The choice of $f = 16$ (and $k = 31$ ) is informed on one hand by the fact that it is close to the lower limit for reasonable results. The works listed in Table 3 use values in the range 13-20, and we found that $f = 8$ leads to divergence. On the other hand, Figure 2 shows that increasing the precision does not lead to an increase in accuracy. Finally, the division algorithm by Catrina & Saxena (2010) requires that $k$ is roughly twice $f$ , and that $k$ is half the domain size (strictly less than half the domain size for efficiency). A domain size of 64 is natural given the 64-bit word size of common hardware. The choice of $f$ and $k$ follows from these constraints. Learning rate and minibatch size are set empirically based on satisfactory performance in plaintext training. + +Figure 3 reports the results with a variety of optimizers. AMSGrad (Reddi et al., 2018) stands out in terms of convergence and final accuracy. Agrawal et al. (2019) suggest using normalized gradients in AMSGrad for training binary neural networks to improve performance. In our experiments using quantized weights with higher precision, similar improvements are not observed. + +Furthermore, Figure 3 also shows that using a Dropout layer as described in Figure 7 in Appendix E only slightly improves the performance. This is possibly due to the fact that the reduced precision and probabilistic rounding already prevent overfitting to some degree. + +Resources We run the emulator on AWS c5.9xlarge instances. One epoch takes a few seconds to several minutes depending on the model that is being trained. For all our experiments, we used a few weeks of computational time including experiments not presented here. + +# 5.1.1. SECURE COMPUTATION + +In order to verify our emulation results, we run LeNet with precision $f = 16$ and probabilistic rounding in our actual multi-party computation protocol. We could verify that it converges on $99.2\%$ accuracy at 25 epochs, taking 3.6 hours (or one hour for $99\%$ accuracy). Tables 3 and 4 compare our results to previous works in a LAN setting. + +Note that Wagh et al. (2019) and Wagh et al. (2021) give accuracy figures. The authors have told us in personal com + +Table 3: Benchmarks in the three-party LAN setting with one corruption. Accuracy N/A means that the accuracy figures were not given or computed in a way that does not reflect the secure computation. (*) Wagh et al. (2021) only implemented their online phase. + +
NetworkEpoch time (s)Comm. per epoch (GB)Acc. (# epochs)Precision (f)
AMohassel & Rindal (2018)180N/A94.0% (15)N/A
Wagh et al. (2019)247N/AN/A13
Wagh et al. (2021)*413N/A13
Ours (SGD)312697.8% (15)16
Ours (AMSGrad)8813998.1% (15)16
BWagh et al. (2019)4,176N/AN/A13
Wagh et al. (2021)*891108N/A13
Ours (SGD)14420198.0% (15)16
Ours (AMSGrad)18723498.6% (15)16
CWagh et al. (2019)7,188N/AN/A13
Wagh et al. (2021)*1,412162N/A13
Tan et al. (2021)1,03653494.0% (5)20
Knott et al. (2021)10,940N/A96.7% (4)16
Ours (SGD)34335298.5% (5)16
Ours (AMSGrad)51376599.0% (5)16
DMohassel & Rindal (2018)234N/AN/AN/A
Wagh et al. (2021)*10111N/A13
Ours (SGD)414198.1% (15)16
Ours (AMSGrad)9513798.5% (15)16
+ +Table 4: Benchmarks in the two-party LAN setting. In the column "Epoch time (s)", two numbers refer to online and offline time. Accuracy N/A means that the accuracy figures were not given or computed in a way that does not reflect the secure computation. Figures for Network C are estimates based on ten batch iterations. + +
NetworkEpoch time (s)Comm. per epoch (GB)Acc. (# epochs)Precision (f)
AMohassel & Zhang (2017)283/19,333N/A93.4% (15)13
Agrawal et al. (2019)31,392N/A95.0% (10)N/A
Ours (SGD)3,7411,12897.8% (15)16
Ours (AMSGrad)5,6884,98498.1% (15)16
DOurs (SGD)141,54125,60498.1% (15)16
Ours (AMSGrad)196,74551,77098.5% (15)16
+ +Table 5: Benchmarks for Network C (LeNet) with AMSGrad across a range of security models in the LAN setting. Figures are mostly estimates based on ten batch iterations. + +
Protocol# parties# corruptionsMaliciousTime per epoch (s)Comm. per epoch (GB)
Appendix B21×196,74551,770
Appendix A31×513765
Dalskov et al. (2021)31✓4,9619,101
Appendix B32×357,214271,595
Dalskov et al. (2021)41✓1,1752,945
Appendix B.2101/8×29,07899,775
Goyal et al. (2021)104×129,667434,138
Appendix B109×2,833,64113,875,834
+ +munication that their figures do not reflect the secure computation. This is related to the fact that they do not implement exponentiation and thus softmax but use the ReLU-based alternative, which has been found to perform poorly by Keller & Sun (2020). The same holds for Mohassel & Rindal (2018) and Mohassel & Zhang (2017). Agrawal et al. (2019) instead use ternary weights, which explains their reduced accuracy. + +Tan et al. (2021) rely entirely on Taylor series approximation for exponentiation whereas we use approximation only for the fractional part of the input (Algorithm 2). This might explain their lower accuracy. + +The figures for CrypTen (Knott et al., 2021) were obtained by running an adaption of their mpc_autograd_cnn example to the full LeNet with SGD and learning rate 0.01. We found that it would eventually diverge even with a relatively low learning rate of 0.001. The given accuracy is the highest we achieved before divergence. We estimate that this is due to the approximations used in CrypTen. It use the following approximation for the exponential function: + +$$ +(1 + x / 2 ^ {n}) ^ {2 ^ {n}}. +$$ + +According to the CrypTen code $^4$ , $n$ is set to 9. Furthermore, they use a fixed-point precision of 16. This leads to a relatively low precision. For $x = -4$ , their approximation is 0.018030 when rounding to the nearest multiple of $2^{-16}$ at every step. In contrast, the correct value is 0.018315, a relative error of more than one percent. In comparison, our solution produces values in the range [0.018310, 0.018325], a relative error of less than $10^{-3}$ and an absolute error of less than the representation step of $2^{-16}$ . + +There are a number of factors that make it hard to compare the performance. Wagh et al. (2021) have only implemented their online phase, which makes their figures incomplete. The implementation of Knott et al. (2021) is purely in Python whereas all others use $\mathrm{C} / \mathrm{C}++$ . Finally, we rely on figures obtained using different platforms except for Knott et al. (2021). In general, it is likely that MP-SPDZ benefits from being an established framework that has undergone more work than other code bases. + +Further security models MP-SPDZ supports a wide range of security models, that is, choices for the number of (corrupted) parties and the nature of their corruption, i.e., whether they are assumed to follow the protocol or not. Table 5 shows our results across a range of security models. + +# 5.1.2. COMPARISON TO CLEARTEXT TRAINING + +Figure 4 compares the performance of our secure training with cleartext training in TensorFlow. It shows that secure + +training performs only slightly worse with the same optimizer. + +# 5.2. CIFAR-10 Classification + +In order to highlight the generality of our approach, we have implemented training for CIFAR-10 with a network by Wagh et al. (2021), which is based on AlexNet (Krizhevsky et al., 2017). See Figure 9 in Appendix E for details. Unlike the networks for MNIST, the network for CIFAR-10 uses batch normalization (Ioffe & Szegedy, 2015). Table 6 shows our results. Our results are not comparable with Wagh et al. (2021) because they do not implement the full training. Furthermore, Tan et al. (2021) do not provide accuracy figures for training from scratch, which makes it unclear how their less accurate approximations perform in this setting. Figure 12 in Appendix G shows that our secret training comes within a few percentage points of cleartext training. Similar figures for MPC training on CIFAR-10 are not widely seen in the literature. + +Table 6: Time (seconds) and communication (GB) per epoch, accuracy after ten epochs, and fixed-point precision for CIFAR-10 training in the three-party LAN setting with one corruption. Tan et al. (2021) do not train from scratch, which is why we do include their accuracy figure. $(^{*})$ Wagh et al. (2021) only implemented their online phase. + +
Networks/ep.GB/ep.Acc.f
Wagh et al. (2021)*3,15680N/A13
Tan et al. (2021)1,137535N/A20
Ours (SGD)1,60377164.9%16
Ours (Adam)2,4313,31764.7%16
Ours (AMSGrad)2,4733,28563.6%16
+ +# 6. Conclusions + +We implement deep neural network training purely in multi-party computation, and we present extensive results of convolutional neural networks on benchmark datasets. We find that the low precision of MPC computation increases the error slightly. We only consider one particular implementation of division and exponentiation, which are crucial to the learning process as part of softmax. Future work might consider different approximations of these building blocks. + +# References + +Agrawal, N., Shamsabadi, A. S., Kusner, M. J., and Gascon, A. QUOTIENT: Two-party secure neural network training and prediction. In Cavallaro, L., Kinder, J., Wang, X., and Katz, J. (eds.), ACM CCS 2019, pp. 1231-1247. ACM Press, November 2019. doi: 10.1145/3319535.3339819. + +Aliasgari, M., Blanton, M., Zhang, Y., and Steele, A. Secure computation on floating point numbers. In NDSS 2013. The Internet Society, February 2013. +Aly, A. and Smart, N. P. Benchmarking privacy preserving scientific operations. In Deng, R. H., Gauthier-Umana, V., Ochoa, M., and Yung, M. (eds.), ACNS 19, volume 11464 of LNCS, pp. 509-529. Springer, Heidelberg, June 2019. doi: 10.1007/978-3-030-21568-2_25. +Araki, T., Furukawa, J., Lindell, Y., Nof, A., and Ohara, K. High-throughput semi-honest secure three-party computation with an honest majority. In Weippl, E. R., Katzenbeisser, S., Kruegel, C., Myers, A. C., and Halevi, S. (eds.), ACM CCS 2016, pp. 805-817. ACM Press, October 2016. doi: 10.1145/2976749.2978331. +Araki, T., Barak, A., Furukawa, J., Keller, M., Lindell, Y., Ohara, K., and Tsuchida, H. Generalizing the SPDZ compiler for other protocols. In Lie, D., Mannan, M., Backes, M., and Wang, X. (eds.), ACM CCS 2018, pp. 880-895. ACM Press, October 2018. doi: 10.1145/3243734.3243854. +Barni, M., Orlandi, C., and Piva, A. A privacy-preserving protocol for neural-network-based computation. In Proceedings of the 8th workshop on Multimedia and security, pp. 146-151, 2006. +Beaver, D. Efficient multiparty protocols using circuit randomization. In Feigenbaum, J. (ed.), CRYPTO'91, volume 576 of LNCS, pp. 420-432. Springer, Heidelberg, August 1992. doi: 10.1007/3-540-46766-1_34. +Benaloh, J. C. and Leichter, J. Generalized secret sharing and monotone functions. In Goldwasser, S. (ed.), CRYPTO'88, volume 403 of LNCS, pp. 27-35. Springer, Heidelberg, August 1990. doi: 10.1007/0-387-34799-2_3. +Catrina, O. and Saxena, A. Secure computation with fixed-point numbers. In Sion, R. (ed.), FC 2010, volume 6052 of LNCS, pp. 35-50. Springer, Heidelberg, January 2010. +Cock, M. d., Dowsley, R., Nascimento, A. C., and Newman, S. C. Fast, privacy preserving linear regression over distributed datasets based on pre-distributed data. In Proceedings of the 8th ACM Workshop on Artificial Intelligence and Security, AIsec '15, pp. 3-14, New York, NY, USA, 2015. Association for Computing Machinery. ISBN 9781450338264. doi: 10.1145/2808769.2808774. +Cramer, R., Damgård, I., and Nielsen, J. B. Multiparty computation from threshold homomorphic encryption. In Pfitzmann, B. (ed.), EUROCRYPT 2001, volume 2045 of LNCS, pp. 280-299. Springer, Heidelberg, May 2001. doi: 10.1007/3-540-44987-6_18. + +Dahl, M., Mancuso, J., Dupis, Y., Decoste, B., Giraud, M., Livingstone, I., Patriquin, J., and Uhma, G. Private machine learning in TensorFlow using secure computation. CoRR, abs/1810.08130, 2018. +Dalskov, A., Escudero, D., and Keller, M. Fantastic four: Honest-majority four-party secure computation with malicious security. In 30th USENIX Security Symposium (USENIX Security 21), 2021. +Dalskov, A. P. K., Escudero, D., and Keller, M. Secure evaluation of quantized neural networks. *PoPETs*, 2020(4): 355-375, October 2020. doi: 10.2478/popets-2020-0077. +Damgård, I., Fitzi, M., Kiltz, E., Nielsen, J. B., and Toft, T. Unconditionally secure constant-rounds multi-party computation for equality, comparison, bits and exponentiation. In Halevi, S. and Rabin, T. (eds.), TCC 2006, volume 3876 of LNCS, pp. 285-304. Springer, Heidelberg, March 2006. doi: 10.1007/11681878_15. +Damgård, I., Pastro, V., Smart, N. P., and Zakarias, S. Multiparty computation from somewhat homomorphic encryption. In Safavi-Naini, R. and Canetti, R. (eds.), CRYPTO 2012, volume 7417 of LNCS, pp. 643-662. Springer, Heidelberg, August 2012. doi: 10.1007/978-3-642-32009-5_38. +Damgård, I., Escudero, D., Frederiksen, T. K., Keller, M., Scholl, P., and Volgushev, N. New primitives for actively-secure MPC over rings with applications to private machine learning. In 2019 IEEE Symposium on Security and Privacy, pp. 1102–1120. IEEE Computer Society Press, May 2019. doi: 10.1109/SP.2019.00078. +Demmler, D., Schneider, T., and Zohner, M. ABY - A framework for efficient mixed-protocol secure two-party computation. In NDSS 2015. The Internet Society, February 2015. +Eerikson, H., Keller, M., Orlandi, C., Pullonen, P., Puura, J., and Simkin, M. Use your brain! Arithmetic 3PC for any modulus with active security. In Kalai, Y. T., Smith, A. D., and Wicha, D. (eds.), ITC 2020, pp. 5:1-5:24. Schloss Dagstuhl, June 2020. doi: 10.4230/LIPIcs.ITC.2020.5. +Escudero, D., Ghosh, S., Keller, M., Rachuri, R., and Scholl, P. Improved primitives for MPC over mixed arithmetic binary circuits. In Micciancio, D. and Ristenpart, T. (eds.), CRYPTO 2020, Part II, volume 12171 of LNCS, pp. 823-852. Springer, Heidelberg, August 2020. doi: 10.1007/978-3-030-56880-1_29. +Glorot, X. and Bengio, Y. Understanding the difficulty of training deep feedforward neural networks. In International conference on artificial intelligence and statistics (AISTATS), pp. 249-256, 2010. + +Goldschmidt, R. E. Applications of division by convergence. Master's thesis, MIT, 1964. +Goyal, V., Li, H., Ostrovsky, R., Polychroniadou, A., and Song, Y. ATLAS: Efficient and scalable MPC in the honest majority setting. In Malkin, T. and Peikert, C. (eds.), CRYPTO 2021, Part II, volume 12826 of LNCS, pp. 244-274, Virtual Event, August 2021. Springer, Heidelberg. doi: 10.1007/978-3-030-84245-1_9. +Halevi, S. and Shoup, V. Algorithms in HLib. In Garay, J. A. and Gennaro, R. (eds.), CRYPTO 2014, Part I, volume 8616 of LNCS, pp. 554-571. Springer, Heidelberg, August 2014. doi: 10.1007/978-3-662-44371-2_31. +Hart, J. F. Computer approximations. Krieger Publishing Co., Inc., 1978. +Hubara, I., Courbariaux, M., Soudry, D., El-Yaniv, R., and Bengio, Y. Binarized neural networks. In Advances in Neural Information Processing Systems (NeurIPS), volume 29. Curran Associates, Inc., 2016. +Ioffe, S. and Szegedy, C. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In Bach, F. and Blei, D. (eds.), Proceedings of the 32nd International Conference on Machine Learning, volume 37 of Proceedings of Machine Learning Research, pp. 448-456, Lille, France, 2015. PMLR. +Juvekar, C., Vaikuntanathan, V., and Chandrakasan, A. GAZELLE: A low latency framework for secure neural network inference. In Enck, W. and Felt, A. P. (eds.), USENIX Security 2018, pp. 1651-1669. USENIX Association, August 2018. +Keller, M. MP-SPDZ: A versatile framework for multi-party computation. In Ligatti, J., Ou, X., Katz, J., and Vigna, G. (eds.), ACM CCS 2020, pp. 1575–1590. ACM Press, November 2020. doi: 10.1145/3372297.3417872. +Keller, M. and Sun, K. Effectiveness of MPC-friendly softmax replacement. In Privacy Preserving Machine Learning - PriML and PPML Joint Edition (NeurIPS 2020 workshop), 2020. +Keller, M., Pastro, V., and Rotaru, D. Overdrive: Making SPDZ great again. In Nielsen, J. B. and Rijmen, V. (eds.), EUROCRYPT 2018, Part III, volume 10822 of LNCS, pp. 158-189. Springer, Heidelberg, April / May 2018. doi: 10.1007/978-3-319-78372-7_6. +Kingma, D. P. and Ba, J. Adam: A method for stochastic optimization. In International Conference on Learning Representations (ICLR), 2015. + +Knott, B., Venkataraman, S., Hannun, A., Sengupta, S., Ibrahim, M., and van der Maaten, L. CryptTen: Secure multi-party computation meets machine learning. In Beygelzimer, A., Dauphin, Y., Liang, P., and Vaughan, J. W. (eds.), Advances in Neural Information Processing Systems, 2021. +Kolesnikov, V., Sadeghi, A.-R., and Schneider, T. A systematic approach to practically efficient general two-party secure function evaluation protocols and their modular design. Journal of Computer Security, 21(2):283-315, 2013. +Krizhevsky, A., Sutskever, I., and Hinton, G. E. Imagenet classification with deep convolutional neural networks. Commun. ACM, 60(6):84-90, may 2017. +LeCun, Y., Bottou, L., Bengio, Y., and Haffner, P. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278-2324, 1998. +LeCun, Y., Cortes, C., and Burges, C. MNIST handwritten digit database. ATT Labs [Online]. Available: http://yann.lecun.com/exdb/mnist, 2, 2010. Creative Commons Attribution-Share Alike 3.0 license, https://creativecommons.org/licenses/by-sa/3.0/. +Li, H., De, S., Xu, Z., Studer, C., Samet, H., and Goldstein, T. Training quantized nets: A deeper understanding. In Advances in Neural Information Processing Systems (NeurIPS), volume 30. Curran Associates, Inc., 2017. +Lin, D., Talathi, S., and Annapureddy, S. Fixed point quantization of deep convolutional networks. In Balcan, M. F. and Weinberger, K. Q. (eds.), Proceedings of The 33rd International Conference on Machine Learning, volume 48 of Proceedings of Machine Learning Research, pp. 2849-2858, New York, New York, USA, 20-22 Jun 2016. PMLR. +Liu, J., Juuti, M., Lu, Y., and Asokan, N. Oblivious neural network predictions via MiniONN transformations. In Thuraisingham, B. M., Evans, D., Malkin, T., and Xu, D. (eds.), ACM CCS 2017, pp. 619-631. ACM Press, October / November 2017. doi: 10.1145/3133956.3134056. +Lou, Q., Feng, B., Fox, G. C., and Jiang, L. Glyph: Fast and accurately training deep neural networks on encrypted data. In Proceedings of the 34th International Conference on Neural Information Processing Systems, NIPS'20, Red Hook, NY, USA, 2020. Curran Associates Inc. ISBN 9781713829546. +Lu, W.-j., Fang, Y., Huang, Z., Hong, C., Chen, C., Qu, H., Zhou, Y., and Ren, K. Faster secure multiparty computation of adaptive gradient descent. In Proceedings of the + +2020 Workshop on Privacy-Preserving Machine Learning in Practice, PPMLP'20, pp. 47-49, 2020. +Mishra, P., Lehmkuhl, R., Srinivasan, A., Zheng, W., and Popa, R. A. Delphi: A cryptographic inference service for neural networks. In Capkun, S. and Roesner, F. (eds.), USENIX Security 2020, pp. 2505-2522. USENIX Association, August 2020. +Mohassel, P. and Rindal, P. $\mathrm{ABY}^3$ : A mixed protocol framework for machine learning. In Lie, D., Mannan, M., Backes, M., and Wang, X. (eds.), ACM CCS 2018, pp. 35-52. ACM Press, October 2018. doi: 10.1145/3243734.3243760. +Mohassel, P. and Zhang, Y. SecureML: A system for scalable privacy-preserving machine learning. In 2017 IEEE Symposium on Security and Privacy, pp. 19-38. IEEE Computer Society Press, May 2017. doi: 10.1109/SP.2017.12. +Nair, V. and Hinton, G. E. Rectified linear units improve Restricted Boltzmann machines. In International Conference on Machine Learning (ICML), pp. 807-814, 2010. +Quoc, D. L., Gregor, F., Arnautov, S., Kunkel, R., Bhatotia, P., and Fetzer, C. secureTF: A secure TensorFlow framework. CoRR, abs/2101.08204, 2021. +Rathee, D., Rathee, M., Kumar, N., Chandran, N., Gupta, D., Rastogi, A., and Sharma, R. CrypTFlow2: Practical 2-party secure inference. In Ligatti, J., Ou, X., Katz, J., and Vigna, G. (eds.), ACM CCS 2020, pp. 325-342. ACM Press, November 2020. doi: 10.1145/3372297.3417274. +Reddi, S. J., Kale, S., and Kumar, S. On the convergence of Adam and beyond. In International Conference on Learning Representations (ICLR), 2018. +Riazi, M. S., Weinert, C., Tkachenko, O., Songhori, E. M., Schneider, T., and Koushanfar, F. Chameleon: A hybrid secure computation framework for machine learning applications. In Kim, J., Ahn, G.-J., Kim, S., Kim, Y., López, J., and Kim, T. (eds.), ASIACCS 18, pp. 707-721. ACM Press, April 2018. +Rotaru, D. and Wood, T. MArBled circuits: Mixing arithmetic and Boolean circuits with active security. In Hao, F., Ruj, S., and Sen Gupta, S. (eds.), INDOCRYPT 2019, volume 11898 of LNCS, pp. 227-249. Springer, Heidelberg, December 2019. doi: 10.1007/978-3-030-35423-7_12. +Ryffel, T., Trask, A., Dahl, M., Wagner, B., Mancuso, J., Rueckert, D., and Passerat-Palmbach, J. A generic framework for privacy preserving deep learning. In Privacy Preserving Machine Learning (NeurIPS 2018 Workshop), 2018. + +Srivastava, N., Hinton, G., Krizhevsky, A., Sutskever, I., and Salakhutdinov, R. Dropout: A simple way to prevent neural networks from overfitting. Journal of Machine Learning Research (JMLR), 15:1929-1958, 2014. +Tan, S., Knott, B., Tian, Y., and Wu, D. J. CryptGPU: Fast privacy-preserving machine learning on the GPU. In IEEE Symposium on Security and Privacy, 2021. +Wagh, S., Gupta, D., and Chandran, N. SecureNN: 3-party secure computation for neural network training. *PoPETs*, 2019(3):26-49, July 2019. doi: 10.2478/popets-2019-0035. +Wagh, S., Tople, S., Benhamouda, F., Kushilevitz, E., Mittal, P., and Rabin, T. Falcon: Honest-majority maliciously secure framework for private deep learning. *PoPETs*, 2021(1):188-208, January 2021. doi: 10.2478/popets-2021-0011. +Wang, N., Choi, J., Brand, D., Chen, C.-Y., and Gopalakrishnan, K. Training deep neural networks with 8-bit floating point numbers. In Advances in Neural Information Processing Systems, volume 31. Curran Associates, Inc., 2018. +Xiao, H., Rasul, K., and Vollgraf, R. Fashion-MNIST: a novel image dataset for benchmarking machine learning algorithms. CoRR, abs/1708.07747, 2017. + +# A. An Efficient Secure Three-Party Computation Protocol + +There is a wide range of MPC protocols with a variety of security properties (see Keller (2020) for an overview). In this section, we focus on the setting of three-party computation with one semi-honest corruption. This means that, out of the three parties, two are expected to behave honestly, i.e., they follow the protocol and keep their view of the protocol secret, and one party is expected to follow the protocol but might try to extract information from their view. The reason for choosing this setting is that it allows for an efficient MPC protocol while still providing secure outsourced computation. The protocol does not easily generalize to any other setting. However, protocols exist for any number of parties, see Keller for an overview. The concrete protocol we use goes back to Benaloh & Leichter (1990) with further aspects by Araki et al. (2016), Mohassel & Rindal (2018), and Eerikson et al. (2020). We summarize the core protocol below. The mathematical building blocks in the next section mostly use the aspects below. + +Secret sharing The simplest variant of secure computation is only data-oblivious, that is, the participants are aware of the nature of the computation (addition, multiplication, etc.) but not the values being operated on. In the context of machine learning, this means that they know the hyper-parameters such as the layers but not the sample data or the neural network weights. All of these values in our protocol are stored using replicated secret sharing. A secret value $x$ is a represented as a random sum $x = x_0 + x_1 + x_2$ , and party $P_i$ holds $(x_{i - 1},x_{i + 1})$ where the indices are computed modulo three. Clearly, each party is missing one value to compute the sum. On the other hand, each pair of parties hold all necessary to reconstruct the secret. For a uniformly random generation of shares, the computation domain has to be finite. Most commonly, this domain is defined by integer computation modulo a number. We use $2^{k}$ for $k$ being a multiple of 64 as well as 2 as the moduli. The first case corresponds to an extension of 64-bit arithmetic found on most processors. We will refer to the two settings as arithmetic and binary secret sharing throughout the paper. + +Input sharing The secret sharing scheme implies a protocol to share inputs where the inputting party samples the shares and distributes them accordingly. Eerikson et al. (2020) propose a more efficient protocol where the inputting party only needs to send one value instead of two pairs of values. If $P_{i}$ would like to input $x$ , $x_{i}$ is set to zero, and $x_{i-1}$ is generated with a pseudo-random generator using a key previously shared between $P_{i}$ and $P_{i+1}$ . $P_{i}$ can compute $x_{i+1} = x - x_{i-1}$ and send it to $P_{i-1}$ . While the resulting secret sharing is not entirely random, the fact that $P_{i}$ already knows $x$ makes randomizing $x_{i}$ obsolete. + +Addition, subtraction, and scalar multiplication The commutative nature of addition allows to add secret sharings without communication. More concretely, secret sharings $x = x_0 + x_1 + x_2$ and $y = y_0 + y_1 + y_2$ imply the secret sharing $x + y = (x_0 + y_0) + (x_1 + y_1) + (x_2 + y_2)$ . The same works for subtraction. Furthermore, the secret sharing $x = x_0 + x_1 + x_2$ allows to compute $\lambda x = \lambda x_0 + \lambda x_1 + \lambda x_2$ locally. + +Multiplication The product of $x = x_0 + x_1 + x_2$ and $y = y_0 + y_1 + y_2$ is + +$$ +\begin{array}{l} x \cdot y = \left(x _ {0} + x _ {1} + x _ {2}\right) \cdot \left(y _ {0} + y _ {1} + y _ {2}\right) \\ = \left(x _ {0} y _ {0} + x _ {0} y _ {1} + x _ {1} y _ {0}\right) + \left(x _ {1} y _ {1} + x _ {1} y _ {2} + x _ {2} y _ {1}\right) + \left(x _ {2} y _ {2} + x _ {2} y _ {0} + x _ {0} y _ {2}\right). \\ \end{array} +$$ + +On the right-hand side (RHS), each term in parentheses only contains shares known by one of the parties. They can thus compute an additive secret sharing (one summand per party) of the product. However, every party only holding one share does not satisfy the replication requirement for further multiplications. It is not secure for every party to pass their value on to another party because the summands are not distributed randomly. This can be fixed by rerandomization: Let $xy = z_0 + z_1 + z_2$ where $z_i$ is known to $P_i$ . Every party $P_i$ computes $z_i' = z_i + r_{i,i+1} - r_{i-1,i}$ where $r_{i,i+1}$ is generated with a pseudo-random generator using a key pre-shared between $P_i$ and $P_{i+1}$ . The resulting sum $xy = z_0' + z_1' + z_2'$ is pseudorandom, and it is thus secure for $P_i$ to send $z_i'$ to $P_{i+1}$ in order to create a replicated secret sharing $((xy)_{i-1}, (xy)_{i+1}) = (z_i', z_{i-1}')$ . + +# Domain conversion + +Recall that we use computation modulo $2^k$ for $k$ being a multiple of 64 as well as 1. Given that the main operations are just addition and multiplication in the respective domain, it is desirable to compute integer arithmetic in the large domain but operations with a straight-forward binary circuit modulo two. There has been a long-running interest in this going back to least Kolesnikov et al. (2013). We mainly rely on the approach proposed by Mohassel & Rindal (2018) and Araki + +et al. (2018). Recall that $x \in 2^k$ is shared as $x = x_0 + x_1 + x_2$ . Now let $\{x_0^{(i)}\}_{i=0}^{k-1}$ the bit decomposition of $x_0$ , that is, $x_0^{(i)} \in \{0,1\}$ and $x_0 = \sum_{i=0}^{k-1} x_0^{(i)} 2^i$ . It is self-evident that $x_0^{(i)} = x_0^{(i)} + 0 + 0$ is a valid secret sharing modulo two (albeit not a random one). Furthermore, every party holding $x_0$ can generate $x_0^{(i)}$ . It is therefore possible for the parties to generate a secret sharing modulo two of a single share modulo $2^k$ . Repeating this for all shares and computing the addition as a binary circuit allows the parties to generate a secret sharing modulo two from a secret sharing modulo $2^k$ . Conversion in the other direction can be achieved using a similar technique or using "daBits" described by Rotaru & Wood (2019). In the following, we will use the term mixed-circuit computation for any technique that works over both computation domains. + +Dot products Dot products are an essential building block of linear computation such as matrix multiplication. In light of quantization, it is possible to reduce the usage of truncation by deferring it to after the summation. In other words, the dot product in the integer representations is computed before truncating. This not only reduces the truncation error, but also is more efficient because the truncation is the most expensive part in quantized secure multiplication. Similarly, our protocol allows to defer the communication needed for multiplication. Let $\vec{x}$ and $\vec{y}$ be two vectors where the elements are secret-shared, that is, $\{x^{(i)}\} = x_0^{(i)} + x_1^{(i)} + x_2^{(i)}$ and similarly for $y^{(i)}$ . The inner product then is + +$$ +\begin{array}{l} \sum_ {i} x ^ {(i)} \cdot y ^ {(i)} = \sum_ {i} (x _ {0} ^ {(i)} + x _ {1} ^ {(i)} + x _ {2} ^ {(i)}) \cdot (y _ {0} ^ {(i)} + y _ {1} ^ {(i)} + y _ {2} ^ {(i)}) \\ = \sum_ {i} (x _ {0} ^ {(i)} y _ {0} ^ {(i)} + x _ {0} ^ {(i)} y _ {1} ^ {(i)} + x _ {1} ^ {(i)} y _ {0} ^ {(i)}) + \sum_ {i} (x _ {1} ^ {(i)} y _ {1} ^ {(i)} + x _ {1} ^ {(i)} y _ {2} ^ {(i)} + x _ {2} ^ {(i)} y _ {1} ^ {(i)}) \\ + \sum_ {i} (x _ {2} ^ {(i)} y _ {2} ^ {(i)} + x _ {2} ^ {(i)} y _ {0} ^ {(i)} + x _ {0} ^ {(i)} y _ {2} ^ {(i)}). \\ \end{array} +$$ + +The three sums in the last term can be computed locally by one party each before applying the same protocol as for a single multiplication. + +Comparisons Arithmetic secret sharing does not allow to access the individual bits directly. It is therefore not straightforward to compute comparisons such as "less than". There is a long line of literature on how to achieve this going back to at least Damgård et al. (2006). More recently, most attention has been given to combining the power of arithmetic and binary secret sharing in order to combine the best of worlds. One possibility to do so is to plainly convert to the binary domain and compute the comparison circuit there. In our concrete implementation, we use the more efficient approach by Mohassel & Rindal (2018). It starts by taking the difference between the two inputs. Computing the comparison then reduces to comparing to zero, which in turn is equivalent to extracting the most significant bit as it indicates the sign. The latter is achieved by converting the shares locally to bit-wise sharing of the arithmetic shares, which sum up to the secret value. It remains to compute the sum of the binary shares in order to come up with the most significant bit. + +Shifting and truncation Dalskov et al. (2021) present an efficient implementation of the deterministic truncation using mixed-circuit computation, and Dalskov et al. (2020) present an efficient protocol for the probabilistic truncation. + +The probabilistic truncation involves the truncation of a randomized value, that is the computation of $\lfloor (x + r) / 2^f\rfloor$ for a random $f$ -bit value $r$ . It is easy to see that + +$$ +\lfloor (x + r) / 2 ^ {f} \rfloor = \left\{ \begin{array}{l l} \lfloor x / 2 ^ {f} \rfloor & \text {i f} (x \bmod 2 ^ {f} + r) < 2 ^ {f} \\ \lfloor x / 2 ^ {f} \rfloor + 1 & \text {o t h e r w i s e .} \end{array} \right. +$$ + +Therefore, the larger $(x \bmod 2^f)$ is, the more likely the latter condition is true. + +# B. An Efficient Multi-Party Computation Protocol Based on Homomorphic Encryption + +While the protocol in the previous is very efficient, the multiplication only works with an honest majority, that is, the number of corrupted parties is strictly less than half of the total number. Multiplications with more corruptions than that requires more involved cryptographic schemes. In this section, we present a semi-honest protocol based on homomorphic encryption that tolerates $n - 1$ corrupted parties out of $n$ . + +Secret sharing The simplest secret sharing is additive secret sharing, which can be used in this setting. The share of party $i$ is a random element $x_{i}$ of the relevant domain such that the sum of all elements is the secret. + +Input sharing The canonical input sharing would be for the inputting party to generate random shares such that they add up to the input and then distribute the shares. Using a one-time setup, it is possible to share without communication as shown in Algorithm 4. It is easy to see that the resulting sharing is correct and that the unknown shares are indistinguishable to random for an adversary corrupting any number of parties. + +# Algorithm 4 Additive input sharing without communication. + +Setup: PRG key $K_{ij}$ known only to parties $P_i$ and $P_j$ + +Input: Party $P_{i}$ has input $x$ + +Output: $\langle x\rangle^{\mathsf{A}}$ + +1: Party $P_{i}$ sets $x_{i} \gets x - \sum_{j \neq i} \mathsf{PRG}_{K_{ij}}($ ). +2: For all $j \neq i$ , party $P_{j}$ sets $x_{j} \gets \mathsf{PRG}_{K_{ij}}(\cdot)$ . + +Addition, subtraction, and scalar multiplication As with any linear secret sharing scheme, these operation can trivially be computed locally. + +Multiplication We use Beaver's technique (Beaver, 1992). Assume that $a$ and $b$ are random numbers in the domain, and $c = ab$ . Then, for any $x, y$ , it holds that + +$$ +\begin{array}{l} x y = (x + a - a) \cdot (y + b - b) \\ = (x + a) \cdot (y + b) - (y + b) \cdot a - (x + a) \cdot b + c. \\ \end{array} +$$ + +As $a$ and $b$ and random, they can be used to used to mask $x$ and $y$ , respectively. Once $x + a$ and $y + b$ have been revealed, the operation becomes linear in $a$ and $b$ : + +$$ +[ x y ] = (x + a) \cdot (y + b) - (y + b) \cdot [ a ] - (x + a) \cdot [ b ] + [ c ] +$$ + +It remains to produce a fresh triple $(a, b, c)$ for every multiplication. Keller et al. (2018) show how to do this using semi-homomorphic encryption based on Learning With Errors (LWE), a widely used cryptographic assumption. They make optimal use of the SIMD (single instruction, multiple data) nature of LWE-based encryption. Their protocol involves pair-wise communication between parties, which scale quadratically in the number of parties. In the following section, we propose a protocol that scales better, which is inspired by Cramer et al. (2001). + +Matrix multiplication Cock et al. (2015) have extended Beaver's technique to matrix multiplication by replacing $x, a$ with $m \times n$ and $y, b$ with $n \times p$ matrices. Using the diagonal packing by Halevi & Shoup (2014) allows to implement the matrix triple generation with $O(m(n + l))$ communication instead of the naive $O(mnl)$ . Unlike Halevi and Shoup, we only use the semi-homomorphic encryption, that is, only public-private multiplications. This avoids the need for cycling or shifting because we can simply generate the necessary cleartexts as needed. + +Domain conversion daBits (Rotaru & Wood, 2019) and edaBits (Escudero et al., 2020) are a generic method to convert between integer and binary computation. For the special case of semi-honest two-party computation, Demmler et al. (2015) have presented a more efficient protocol similar to the one in the previous section. + +Comparison, shifting, and truncation Escudero et al. (2020) have shown how to use edaBits to implement these computations. Essentially, they make minimal use of binary computation before switching back to integer computation so that the result is available for further computation in the integer domain. + +# B.1. Linear-cost Triple Generation with Semi-homomorphic Encryption + +Assume an encryption system that allows to multiply a ciphertext and a plaintext, that is, $\mathsf{Dec}(\mathsf{Enc}(\mathbf{a})\cdot \mathbf{b} = \mathbf{a}*\mathbf{b}$ where $\mathbf{a}$ and $\mathbf{b}$ are vectors and $*$ denotes the Schur product. LWE allows the efficient creation of such a system. Furthermore, assume a distributed key setup as used by Damgård et al. (2012). Since we only want to achieve semi-honest security, it is straight-forward to generate without using any protocol to check the correctness. Algorithm 5 show the details of our protocol. + +# Algorithm 5 Triple Generation with distributed semi-homomorphic encryption + +# Input: Distributed key setup + +# Output: Random multiplication triples + +1: Each party $P_{i}$ samples $\mathbf{a}_i$ and send $\mathrm{Enc}(\mathbf{a}_i)$ to $P_{1}$ . +2: $P_{1}$ computes $C_a = \sum_i\mathsf{Enc}(\mathbf{a}_i)$ and broadcasts it. +3: Each $P_{i}$ samples $\mathbf{b}_i$ and sends $C_i = C_a*\mathbf{b}_i + \mathsf{Enc}(0)$ to $P_{1}$ . +4: $P_{1}$ computes $C_c = \sum_i C_i$ and broadcasts it. +5: The parties run distributed the decryption to obtain the share $\mathbf{c}_i$ . + +By definition, + +$$ +\begin{array}{l} \sum \mathbf {c} _ {i} = \operatorname {D e c} \left(C _ {c}\right) \\ = \operatorname {D e c} \left(\sum_ {i} C _ {a} * \mathbf {b} _ {i} + \operatorname {E n c} (0)\right) \\ = \operatorname {D e c} \left(C _ {a} * \sum_ {i} \mathbf {b} _ {i}\right) \\ = \operatorname {D e c} \left(\sum_ {i} \operatorname {E n c} \left(\mathbf {a} _ {i}\right) * \sum_ {i} \mathbf {b} _ {i}\right) \\ = \left(\sum_ {i} \mathbf {a} _ {i}\right) * \left(\sum_ {i} \mathbf {b} _ {i}\right). \\ \end{array} +$$ + +This proves correctness. Furthermore, the distributed key setup hides encrypted values from all parties, and the addition of $\mathsf{Enc}(0)$ in step 3 ensures that $P_{1}$ only receives a fresh encryption of $\mathbf{a}*\mathbf{b}_i$ . + +# B.2. Replacing Homomorphic Encryption by a Dealer + +It is possible to generate all correlated randomness (triples, random bits, (e)daBits etc.) by one party. The security then relies on the fact that either the dealer is trusted or all of the remaining parties. The offline phase simply consists of the dealer generating the necessary randomness (for example, a random triple $(a,b,ab)$ ) and then sending an additive secret sharing to the remaining parties. + +# C. High-Level Secure Computation Building Blocks + +In this section, we will discuss how to implement computation with MPC with a focus on how it differs from computation on CPUs or GPUs. Most of the techniques below are already known individually. To the best of our knowledge, however, we are the first to put them together in an efficient and extensible framework for secure training of deep neural networks. + +Oblivious Selection Plain secure computation does not allow branching because the parties would need to be aware of which branch is followed. Conditional assignment can be implemented as follows. If $b \in \{0,1\}$ denotes the condition, $x + b \cdot (y - x)$ is either $x$ or $y$ depending on $b$ . If the condition is available in binary secret sharing but $x$ and $y$ in arithmetic secret sharing, $b$ has to be converted to the latter. This can be done using a daBit (Rotaru & Wood, 2019), which is a secret random bit shared both in arithmetic and binary. It allows to mask a bit in one world by XORing it. The result is then revealed and the masking is undone in the other world. + +Division Catrina & Saxena (2010) show how to implement quantized division using the algorithm by Goldschmidt (1964). It mainly uses arithmetic and the probabilistic truncation already explained. In addition, the initial approximation requires a full bit decomposition as described above. The error of the output depends on the error in the multiplications used for Goldschmidt's iteration, which compounds in particular when using probabilistic truncation. Due to the nature of secure computation, the result of division by zero is undefined. One could obtain a secret failure bit by testing the divisor to zero. However, that is unnecessary in our algorithm, because so far we only use division by secret value for the softmax function, where the divisor is guaranteed to strictly positive. + +Algorithm 6 Separation (Sep) (Lu et al., 2020) +Input: Secret share $\langle \tilde{x};f\rangle^{\mathsf{A}}$ where $2^{-f + 1}\leq \tilde{x}\leq 2^{f - 1}$ +Output: $\langle \tilde{u};f\rangle^{\mathsf{A}}$ and $\langle z_0\rangle^{\mathsf{B}},\ldots ,\langle z_{k - 1}\rangle^{\mathsf{B}}$ such that $z_{e + f} = 1,z_i = 0$ for $i\neq e + f$ , and $\tilde{u} = \tilde{x}^{-1}\cdot 2^{e + 1}\in [0.25,0.5)$ 1: $\langle z_0\rangle^{\mathsf{B}},\dots ,\langle z_{k - 1}\rangle^{\mathsf{B}}\gets \mathsf{NP2}(\langle \tilde{x};f\rangle^{\mathsf{A}})$ +2: $\langle 2^{e - 1};f\rangle^{\mathsf{A}}\gets \mathsf{B2A}(\langle z_{2f - 1}\rangle^{\mathsf{B}},\dots ,\langle z_0\rangle^{\mathsf{B}})$ +3: $\langle \tilde{u};f\rangle^{\mathsf{A}}\gets \langle \tilde{x};f\rangle^{\mathsf{A}}\cdot \langle 2^{e - 1};f\rangle^{\mathsf{A}}$ +4: return $\langle \tilde{u};f\rangle^{\mathsf{A}},(\langle z_0\rangle^{\mathsf{B}},\dots ,\langle z_{k - 1}\rangle^{\mathsf{B}}$ + +Algorithm 7 Square-root compensation (SqrtComp) +Input: Secret share $\langle z_0\rangle^{\mathsf{B}},\ldots ,\langle z_{k - 1}\rangle^{\mathsf{B}}$ such that $z_{e + f} = 1,z_{i} = 0$ for $i\neq e + f$ +Output: $\langle 2^{-(e - 1) / 2};f\rangle^{\mathsf{A}}$ +1: $k^{\prime}\gets k / 2,f^{\prime}\gets f / 2,c_{0}\gets 2^{f / 2 + 1},c_{1} = 2^{(f + 1) / 2 + 1}$ +2: for $\mathrm{i} = 0,\dots ,\mathrm{k}'$ do +3: $\langle a_i\rangle^{\mathsf{B}}\leftarrow \langle z_{2i}\rangle^{\mathsf{B}}\vee \langle z_{2i + 1}\rangle^{\mathsf{B}}$ {only $a_{e'} = 1$ for $e' = \lfloor (e + f) / 2\rfloor \}$ +4: end for +5: $\langle 2^{-e' - 2};f\rangle^{\mathsf{A}}\gets \mathsf{B}2\mathsf{A}(\langle a_{2f' - 1}\rangle^{\mathsf{B}},\ldots ,\langle a_0\rangle^{\mathsf{B}})$ +6: $\langle b\rangle^{\mathsf{B}} = \bigoplus_{i = 0}^{k' - 1}\langle z_{2i}\rangle^{\mathsf{B}}$ $\{b = \mathsf{LSB}(e + f)\}$ +7: return $\langle 2^{-(e - 1) / 2};f\rangle^{\mathsf{A}}\gets \mathsf{MUX}(c_0,c_1,\langle b\rangle^{\mathsf{B}})\cdot \langle 2^{-e' - 2};f\rangle^{\mathsf{A}}$ + +Algorithm 8 InvertSqrt (Lu et al., 2020) +Input: Share $\langle \tilde{x};f\rangle^{\mathsf{A}}$ where $2^{-f + 1}\leq \tilde{x}\leq 2^{f - 1}$ where $2^{e - 1}\leq \tilde{x}\leq 2^{e}$ for some $e\in \mathbb{Z}$ +Output: Share $\langle \tilde{y};f\rangle^{\mathsf{A}}$ such $\tilde{y}\approx 1 / \sqrt{\tilde{x}}$ +1: $\langle \tilde{u};f\rangle^{\mathsf{A}},\langle z_0\rangle^{\mathsf{B}},\ldots ,\langle z_{k - 1}\rangle^{\mathsf{B}}\gets \mathsf{Seq}(\langle \tilde{x};f\rangle^{\mathsf{A}})$ $\{z_{e + f} = 1\}$ +2: $\langle \tilde{c};f\rangle^{\mathsf{A}}\gets 3.14736 + \langle \tilde{u};f\rangle^{\mathsf{A}}\cdot (4.63887\cdot \langle \tilde{u};f\rangle^{\mathsf{A}} - 5.77789)$ +3: $\langle 2^{-(e - 1) / 2};f\rangle^{\mathsf{A}}\gets \mathsf{SqrtComp}(\langle z_0\rangle^{\mathsf{B}},\dots ,\langle z_{k - 1}\rangle^{\mathsf{B}})$ +4: return $\langle \tilde{c};f\rangle^{\mathsf{A}}\cdot \langle 2^{-(e - 1) / 2};f\rangle^{\mathsf{A}}$ + +Algorithm 9 Procedures in Algorithms 6-8 +$\langle x_0\rangle^{\mathsf{B}},\ldots ,\langle x_{k - 1}\rangle^{\mathsf{B}}\gets \mathsf{NP2}(\langle x;f\rangle^{\mathsf{A}})$ Next power of two. This returns a one-hot vector of bits such indicating the closes larger power of two. We adapt Protocol 3.5 by Catrina & Saxena (2010) for this. + $\langle x\rangle^{\mathtt{A}}\gets \mathtt{B2A}(\langle x_0\rangle^{\mathtt{B}},\dots ,\langle x_{k - 1}\rangle^{\mathtt{B}})$ Domain conversion from binary to arithmetic as above. + $\langle c_b;f\rangle^{\mathtt{A}}\gets \mathtt{MUX}(c_0,c_1,\langle b\rangle^{\mathtt{B}})$ Oblivious selection as in Appendix C. + +**Logarithm** Computation logarithm with any public base can be reduced to logarithm to base two using $\log_x y = \log_2 y \cdot \log_x 2$ . Aly & Smart (2019) propose to represent $y$ as $y = a \cdot 2^b$ , where $a \in [0.5, 1)$ and $b \in \mathbb{Z}$ . This then allows to compute $\log_2 y = \log_2 a + b$ . Given the restricted range of $a$ , $\log_2 a$ can be approximated using a division of polynomials. Numerical stability and input range control are less of an issue here, because we only use logarithm for the loss computation, which does not influence the training. + +Inverse square root Aly & Smart (2019) propose to compute square root using Goldschmidt and Raphson-Newton iterations. We could combine this with the division operator introduced above. However, Lu et al. (2020) propose a more direct computation that avoids running two successive iterations. We have optimized their algorithm SqurComp computing the square root of a power of two as shown in Algorithm 7. As an essential optimization, we compute the least significant bit of $e + f$ by simply XORing every other $z_{i}$ in step 6 of Algorithm 7. Given that XOR does not require communication with binary secret sharing, this is much more efficient than computing the least significant bit of a sum of oblivious selections done by Lu et al. Remarkably, our optimization cuts the cost by roughly half. This is due to the reduction in conversions + +Table 7: Total communication in kbit for inverse square root across a range of security models with one corrupted party. "SH" stands for semi-honest security and "Mal." for malicious security. + +
3 Parties2 Parties
SHMal.SHMal.
Lu et al. (2020)1916048125,456
Ours911434221,522
+ +from binary to arithmetic. Furthermore, we correct some issues which result in outputs that are off by a multiplication with a power of two. We present the rest of their approach in Algorithms 6 and 8 (unchanged) for completeness. Unlike Lu et al. (2020), we do not explicitly state the truncation after fixed-point multiplication. + +Table 7 shows how our approach compares to Lu et al. (2020). In the context of the Figures in Table 5, this implies an improvement of up one quarter. The importance of inverse square root stems from the fact that it is computed for every iteration and trainable parameter in the parameter update. + +Uniformly random fractional number Limiting ourselves to intervals of the form $[x, x + 2^e)$ for a potentially negative integer $e$ , we can reduce the problem to generate a random $(f + e)$ -bit number where $f$ is the fixed-point precision. Recall that we represent a fractional number $x$ as $\lfloor x \cdot 2^{-f} \rfloor$ . Generating a random $n$ -bit number is straightforward using random bits, which in our protocol can be generated as presented by Damgård et al. (2019). However, Dalskov et al. (2021) and Escudero et al. (2020) present more efficient approaches that involve mixed-circuit computation. + +Communication cost Table 8 shows the total communication cost of some of the building blocks in our three-party protocol for $f = 16$ . This setting mandates the modulus $2^{64}$ because the division protocol requires a bit length of $4f$ . + +Table 8: Communication cost of select computation for $f = {16}$ and integer modulus ${2}^{64}$ . + +
Bits
Integer multiplication192
Probabilistic truncation960
Nearest truncation2,225
Comparison668
Division (prob. truncation)10,416
Division (nearest truncation)24,081
Exponentiation (prob. truncation)16,303
Exponentiation (nearest truncation)43,634
Invert square root (prob. truncation)9,455
Invert square root (nearest truncation)15,539
+ +# D. Deep Learning Building Blocks + +In this section, we will use the building blocks in Appendix C to construct high-level computational modules for deep learning. + +Fully connected layers Both forward and back-propagation of fully connected layers can be seen as matrix multiplications and thus can be implemented using dot products. A particular challenge in secure computation is to compute a number of outputs in parallel in order to save communication rounds. We overcome this challenge by having a dedicated infrastructure in our implementation that computes all dot products for a matrix multiplication in a single batch of communication, thus reducing the number of communication rounds. + +2D convolution layers Similar to fully connected layers, 2D convolution and its corresponding gradient can be implemented using only dot products, and we again compute several output values in parallel. + +ReLU Given the input $x\in \mathbb{R}$ , a rectified linear unit (ReLU Nair & Hinton 2010) outputs + +$$ +\operatorname {R e L U} (x) := \max (x, 0) = [ [ x > 0 ] ] \cdot x. +$$ + +It can thus be implemented as a comparison followed by an oblivious selection. For back-propagation, it is advantageous to reuse the comparison results from forward propagation due to the relatively high cost of secure computation. Note that the comparison results are stored in secret-shared form and thus there is no reduction in security. + +Max pooling Similar to ReLU, max pooling can be reduced to comparison and oblivious selection. In secure computation, it saves communication rounds if the process uses a balanced tree rather than iterating over all input values of one maximum computation. For example, two-dimensional max pooling with a $2 \times 2$ window requires computing the maximum of four values. We compute the maximum of two pairs of values followed by the maximum of the two results. For back-propagation, it again pays off to store the intermediate results from forward propagation in secret-shared form. + +Dropout Dropout layers (Srivastava et al., 2014) require generating a random bit according to some probability and oblivious selection. For simplicity, we only support probabilities that are a power of two. + +Batch normalization As another widely used deep learning module, batch normalization (BN, Ioffe & Szegedy 2015). Based on a mini-batch $\mathcal{B} = \{x_i\}$ of any input statistic $x$ , the BN layer outputs + +$$ +y _ {i} = \gamma \frac {x _ {i} - \mu_ {\mathcal {B}}}{\sqrt {\sigma_ {\mathcal {B}} ^ {2}} + \epsilon} + \beta , \tag {2} +$$ + +where $\mu_{\mathcal{B}}$ and $\sigma_B^2$ are the first and second central moments of $x$ , and $\gamma, \beta$ and $\epsilon$ are hyper-parameters. In addition to basic arithmetic, it requires inverse square root, which is not trivial in MPC. + +Softmax output and cross-entropy loss For classification tasks, consider softmax output units $\frac{\exp(x_i)}{\sum_j\exp(x_j)}$ , where $\boldsymbol{x} = (x_{1},x_{2},\dots)$ is the linear output (logits) of the last layer, and the cross-entropy loss $\ell = -\sum_{i}y_{i}\log \frac{\exp(x_{i})}{\sum_{j}\exp(x_{j})} = -\sum_{i}x_{i}y_{i} + \log \sum_{j}\exp (x_{j})$ , where $\boldsymbol{y} = (y_1,y_2,\dots)$ is the ground truth one-hot vector. This usual combination requires computing the following gradient for back-propagation: + +$$ +\begin{array}{l} \bigvee_ {i} := \frac {\partial \ell}{\partial x _ {i}} = \frac {\partial}{\partial x _ {i}} \Big (- \sum_ {k} y _ {k} \cdot x _ {k} + \log \sum_ {j} \exp (x _ {j}) \Big) \\ = - y _ {i} + \frac {\exp \left(x _ {i}\right)}{\sum_ {j} \exp \left(x _ {j}\right)}. \tag {3} \\ \end{array} +$$ + +On the RHS of the above eq. (3), the values in the denominator are potentially large due to the exponentiation. This is prone to numerical overflow in our quantized representation, because the latter puts strict limits on the values. We therefore optimize the computation by first taking the maximum of the input values: $x_{\mathrm{max}} = \max_i x_i$ . Then we evaluate $\bigtriangledown_i$ based on + +$$ +\bigtriangledown_ {i} = \frac {\exp (x _ {i} - x _ {\mathrm {m a x}})}{\sum_ {j} \exp (x _ {j} - x _ {\mathrm {m a x}})} - y _ {i}. +$$ + +As $\forall j, x_{j} \leq x_{\max}$ , we have $1 \leq \sum_{j} \exp(x_{j} - x_{\max}) \leq L$ , where $L$ is the number of class labels ( $L = 10$ for MNIST). Hence numerical overflow is avoided. The same technique can be used to compute the sigmoid activation function, as sigmoid $(x) := \frac{1}{1 + \exp(-x)} = \frac{\exp(0)}{\exp(0) + \exp(-x)}$ is a special case of softmax. + +Stochastic gradient descent The model parameter update in SGD only involves basic arithmetic: + +$$ +\theta_ {j} \leftarrow \theta_ {j} - \frac {\gamma}{B} \sum_ {i = 1} ^ {B} \frac {\partial \ell_ {i}}{\partial \theta_ {j}}, \tag {4} +$$ + +where $\theta_{j}$ is the parameter indexed by $j$ , $\gamma > 0$ is the learning rate, $B$ is the mini-batch size, $\ell_{i}$ is the cross-entropy loss with respect to the $i$ 'th sample in the mini-batch. To tackle the limited precision with quantization, we defer dividing by the + +batch size $B$ to the model update in eq. (4). In other words, the back-propagation computes the gradient $\frac{\partial \ell_i}{\partial \theta_j}$ , where the back-propagated error terms are not divided by $B$ . Division by the batch size $B$ only happens when the parameter update is performed. Since the batch size is a power of two (128), it is sufficient to use probabilistic truncation instead of full-blown division. This both saves time and decreases the error. + +Adam (Kingma & Ba, 2015) and AMSGrad (Reddi et al., 2018) Optimizers in this category perform a more sophisticated parameter update rule5: + +$$ +\theta_ {j} \leftarrow \theta_ {j} - \frac {\gamma}{\sqrt {v _ {j} + \epsilon}} g _ {j}, +$$ + +where $\epsilon > 0$ is a small constant to prevent division by zero, and $g_{j}$ and $v_{j}$ are the first and second moments of the gradient $\frac{\partial\ell}{\partial\theta_j} = \frac{1}{B}\sum_{i = 1}^{B}\frac{\partial\ell_i}{\partial\theta_j}$ , respectively. Division by the batch size $B$ can be skipped in computing $\frac{\partial\ell}{\partial\theta_j}$ , because scaling of the gradient leads to the same scaling factor of $g_{j}$ and $\sqrt{v_j}$ . Both $g_{j}$ and $v_{j}$ are computed from the back-propagation result using simple arithmetic and comparison (in the case of AMSGrad). We compute the inverse square root as described in Section C above. + +Parameter initialization We use the widely adopted initialization method proposed by Glorot & Bengio (2010). Each weight $w$ between two layers with size $d_{\mathrm{in}}$ and $d_{\mathrm{out}}$ is initialized by + +$$ +w \sim \mathcal {U} \left[ - \sqrt {\frac {6}{d _ {\mathrm {i n}} + d _ {\mathrm {o u t}}}}, \sqrt {\frac {6}{d _ {\mathrm {i n}} + d _ {\mathrm {o u t}}}} \right], +$$ + +where $\mathcal{U}[a,b]$ means the uniform distribution in the given range $[a,b]$ . Besides basic operations, it involves generating a uniformly distributed random fractional value in a given interval, which is introduced in the previous section C. All bias values are initialized to 0. + +# E. Models + +The neural network structures investigated in this paper are given by the following Figures 5, 6, 7, 8 and 9. The structure of each network is formatted in Keras code. + +```python +tf keras.layers.Flatten(), +tf keras.layers.Dense(128, activation='relu'), +tf keras.layers.Dense(128, activation='relu'), +tf keras.layers.Dense(10, activation='softmax') +``` + +Figure 5: Network A used by Mohassel & Zhang (2017) + +```python +tf keras.layers.Conv2D(16, 5, 1, 'same', activation='relu'), tf keras.layers.MaxPooling2D(2), tf keras.layers.Conv2D(16, 5, 1, 'same', activation='relu'), tf keras.layers.MaxPooling2D(2), tf keras.layers.Flatten(), tf keras.layers.Dense(100, activation='relu'), tf keras.layers.Dense(10, activation='softmax') +``` + +Figure 6: Network B used by Liu et al. (2017) + +# F. Fashion MNIST + +We run our implementation on Fashion MNIST (Xiao et al., 2017) for a more complete picture. Figure 10 shows our results. See Xiao et al. (2017) for an overview on how other models perform in cleartext. + +Figure 7: Network C used by LeCun et al. (1998) (with optional Dropout layer) +```python +tf keras.layers.Conv2D(20, 5, 1, 'valid', activation='relu'), tf keras.layers.MaxPooling2D(2), tf keras.layers.Conv2D(50, 5, 1, 'valid', activation='relu'), tf keras.layers.MaxPooling2D(2), tf keras.layers.Flatten(), tf keras.layers.Dropout(0.5), tf keras.layers.Dense(100, activation='relu'), tf keras.layers.Dense(10, activation='softmax') +``` + +Figure 8: Network D used by Riazi et al. (2018) +```python +tf keras.layers.Conv2D(5, 5, 2, 'same', activation='relu'), tf keras.layers.Flatten(), tf keras.layers.Dense(100, activation='relu'), tf keras.layers.Dense(10, activation='softmax') +``` + +```python +1st Convolutional Layer +Conv2D(filters=96, input_shape=(32,32,3), kernel_size=(11,11), strides=(4,4), padding=9), +Activation('relu'), +MaxPooling2D(pool_size=3, strides=(2,2)), +BatchNormalization., +#2nd Convolutional Layer +Conv2D(filters=256, kernel_size=(5,5), strides=(1,1), padding=1), +Activation('relu'), +BatchNormalization., +MaxPooling2D(pool_size=(2,2), strides=1), +#3rd Convolutional Layer +Conv2D(filters=384, kernel_size=(3,3), strides=(1,1), padding=1), +Activation('relu'), +#4th Convolutional Layer +Conv2D(filters=384, kernel_size=(3,3), strides=(1,1), padding=1), +Activation('relu'), +#5th Convolutional Layer +Conv2D(filters=256, kernel_size=(3,3), strides=(1,1), padding=1), +Activation('relu'), +#Passing it to a Fully Connected layer +#1st Fully Connected Layer +Dense(256), +Activation('relu'), +#2nd Fully Connected Layer +Dense(256), +Activation('relu'), +``` + +Output Layer Dense(10) + +![](images/aeb2c8bd5b50890d408ee4bfd505d95494e348d1b8d14e83b361e2ca4cc9a0eb.jpg) +Figure 9: AlexNet for CIFAR-10 by Wagh et al. (2021). Note that our implementation allows any padding unlike Keras. +Figure 10: Learning curves for image classification using network C on the Fashion MNIST dataset, with $f = 16$ and probabilistic truncation. $\gamma$ is the learning rate. + +![](images/d60691068b8bfafd86b20f27a37fce2db6d8f42b70bab3bb1fc98804950fb4f6.jpg) + +# G. More Experimental Results + +For the task of classifying MNIST digits, Figure 11 shows the learning curves for all networks used by Wagh et al. (2019). Among all the investigated structures, LeNet (network C) performs the best. Furthermore, AMSGrad consistently improves the classification performance as compared to SGD. + +Figure 12 shows the comparison of cleartext training and secure training for CIFAR-10 with $f = 16$ and probabilistic truncation. Our MPC implementation has gained similar performance with the cleartext counterpart. + +# H. Hyperparameter Settings + +In the following we discuss our choice of hyperparameters. + +Number of epochs As we found convergence after 100 epochs, we have run most of our benchmarks for 150 epochs, except for the comparison of optimizers where we stopped at 100. + +Early stop We have not used early stop. + +Mini-batch size We have used 128 throughout as it is a standard size. We briefly trialed 1024 as suggested by Li et al. (2017), but did not found any improvement. + +Reshuffling training samples At the beginning of each epoch, we randomly re-shuffle the training samples using the Fisher-Yates shuffle with MP-SPDZ's internal pseudo-random number generator as randomness source. + +Learning rate We have tried a number of learning rates as documented in Figure 3. As a result, we settled for 0.01 for SGD and 0.001 for AMSGrad in further benchmarks. + +Learning rate decay/schedule We have not used either. + +Random initialization The platform uses independent random initialization by design. + +![](images/53a9696a002a36d9a77d8c02e6ed3d5f043d5d3be45e939eda9902f265071db1.jpg) +Figure 11: Loss and accuracy for various networks, $f = 16$ , and probabilistic truncation. + +![](images/3195f35815b71386f3a50fed952098207e4e58991821502182fb2365eb49e31e.jpg) + +![](images/52360e2fdde311eb54a79644cd8c8ce935e0fd6b0790f763988f74c5549ed21a.jpg) +Figure 12: Comparison of cleartext training and secure training for CIFAR-10 with $f = 16$ and probabilistic truncation. $\gamma$ is the learning rate. + +![](images/faad30f23642bb22f971962f5ac791ea99886099c9980ec619d3b52f310ee988.jpg) + +Dropout We have experimented with Dropout but not found any improvement as shown in Figure 3. + +Input preprocessing We have normalized the inputs to [0, 1]. + +Test/training split We have used the usual MNIST split. + +Hyperparameters for Adam/AMSGrad We use the common choice $\beta_{1} = 0.9$ , $\beta_{2} = 0.999$ , and $\epsilon = 10^{-8}$ . + +# I. List of Symbols + +Table 9: List of Symbols + +
Rthe set of real numbers
Zthe set of integers
x,y,λreal numbers in R
x,yreal vectors
[x]nearest rounding of x: [x] := arg minz∈Z |x-z|
[x]floor function: [x] := max{z ∈ Z | z ≤ x}
{x}the fractional part of x: {x} := x - [x]
Qf(x)the integer representation of x: Qf(x) = [x·2f]
U(a,b)uniform distribution on [a,b]
B(p)Bernoulli distribution (with probability p the random variable equals 1)
[c]Iverson bracket ([c] = 1 if c is true otherwise 0)
|·|absolute value
||·||Frobenius norm
Prob(·)probability of the parameter statement being true
(condition? a : b)oblivious selection
+ +# J. Proofs + +# J.1. Proof of Proposition 4.1 + +Proof. By Eq. (1), + +$$ +E (b) = 0 \times (1 - \{\mu \}) + 1 \times \{\mu \} = \{\mu \}. +$$ + +Therefore + +$$ +E \left(R ^ {f} (x y)\right) = E (\lfloor \mu \rfloor + b) = \lfloor \mu \rfloor + E (b) = \lfloor \mu \rfloor + \{\mu \} = \lfloor \mu \rfloor + (\mu - \lfloor \mu \rfloor) = \mu = Q ^ {f} (x) Q ^ {f} (y) 2 ^ {- f}. +$$ + +Notice that $Q^{f}(A)$ is simply obtained through entry-wise quantization $Q^{f}(a_{ij})$ . By our matrix multiplication algorithm, + +$$ +\begin{array}{l} E \left(R _ {i j} ^ {f} (A B)\right) = E \left(\sum_ {k} R ^ {f} \left(A _ {i k} B _ {k j}\right)\right) \\ = \sum_ {k} E \left(R ^ {f} \left(A _ {i k} B _ {k j}\right)\right) \\ = \sum_ {k} Q ^ {f} (A _ {i k}) Q ^ {f} (B _ {k j}) 2 ^ {- f} \\ = 2 ^ {- f} \sum_ {k} Q _ {i k} ^ {f} (A) Q _ {k j} ^ {f} (B _ {k j}) \\ = 2 ^ {- f} \left(Q ^ {f} (A) Q ^ {f} (B)\right) _ {i j}. \\ \end{array} +$$ + +In matrix form, it gives + +$$ +E \left(R ^ {f} (A B)\right) = 2 ^ {- f} Q ^ {f} (A) Q ^ {f} (B). +$$ + +![](images/b743fbfe9fee2cb3a961fb0b1f209aa7e687252e7885de2d6916ffc6d5b011a0.jpg) + +# J.2. A Lemma of Probabilistic Rounding + +Lemma J.1. Given $x, y \in (-2^k, 2^k) \subset \mathbb{R}$ , + +$$ +\left| x y - R ^ {f} (x y) 2 ^ {- f} \right| < (\max \{| x |, | y | \} + 1) \epsilon + \epsilon^ {2} / 4 < (2 ^ {k} + 1) \epsilon + \epsilon^ {2} / 4, +$$ + +where $\epsilon \coloneqq 2^{-f}$ + +Proof. We have + +$$ +| x y - R ^ {f} (x y) 2 ^ {- f} | \leq | x y - \mu 2 ^ {- f} | + | R ^ {f} (x y) 2 ^ {- f} - \mu 2 ^ {- f} | = | x y - \mu 2 ^ {- f} | + 2 ^ {- f} | R ^ {f} (x y) - \mu |. +$$ + +By the definition of $R^f(xy)$ , + +$$ +\left| R ^ {f} (x y) - \mu \right| = \left| \lfloor \mu \rfloor + b - \mu \right| = \left| b - (\mu - \lfloor \mu \rfloor) \right| = \left| b - \{\mu \} \right| < 1. +$$ + +Therefore, we have + +$$ +| x y - R ^ {f} (x y) 2 ^ {- f} | < | x y - \mu 2 ^ {- f} | + 2 ^ {- f} = | x y - \mu 2 ^ {- f} | + \epsilon . +$$ + +Now we only need to bound the deterministic term $|xy - \mu 2^{-f}|$ . We have + +$$ +\begin{array}{l} \left| x y - \mu 2 ^ {- f} \right| = \left| x y - Q ^ {f} (x) Q ^ {f} (y) 2 ^ {- 2 f} \right| \\ = \left| Q ^ {f} (x) Q ^ {f} (y) 2 ^ {- 2 f} - x y \right| \\ = \left| \left(Q ^ {f} (x) 2 ^ {- f} - x\right) \left(Q ^ {f} (y) 2 ^ {- f} - y\right) + 2 ^ {- f} Q ^ {f} (x) y + 2 ^ {- f} Q ^ {f} (y) x - 2 x y \right| \\ = \left| \left(Q ^ {f} (x) 2 ^ {- f} - x\right) \left(Q ^ {f} (y) 2 ^ {- f} - y\right) + \left(2 ^ {- f} Q ^ {f} (x) - x\right) y + \left(2 ^ {- f} Q ^ {f} (y) - y\right) x \right| \\ \leq | Q ^ {f} (x) 2 ^ {- f} - x | \cdot | Q ^ {f} (y) 2 ^ {- f} - y | + | 2 ^ {- f} Q ^ {f} (x) - x | \cdot | y | + | 2 ^ {- f} Q ^ {f} (y) - y | \cdot | x |. \\ \end{array} +$$ + +We notice that $\forall x\in \mathbb{R}$ + +$$ +\begin{array}{l} \left| 2 ^ {- f} Q ^ {f} (x) - x \right| = \left| 2 ^ {- f} \lfloor x \cdot 2 ^ {f} \rceil - x \right| = 2 ^ {- f} \left| \lfloor x \cdot 2 ^ {f} \rceil - x \cdot 2 ^ {f} \right| \\ \leq 2 ^ {- f} \times \frac {1}{2} = 2 ^ {- f - 1} = \frac {\epsilon}{2}. \\ \end{array} +$$ + +Then, we get + +$$ +\begin{array}{l} | x y - \mu 2 ^ {- f} | \leq \frac {\epsilon}{2} \cdot \frac {\epsilon}{2} + \frac {\epsilon}{2} \cdot (| x | + | y |) = \frac {\epsilon^ {2}}{4} + \frac {\epsilon}{2} \cdot (| x | + | y |) \\ \leq \frac {\epsilon^ {2}}{4} + \frac {\epsilon}{2} \cdot (2 \max \{| x |, | y | \}) = \frac {\epsilon^ {2}}{4} + \max \{| x |, | y | \} \epsilon . \\ \end{array} +$$ + +In summary, + +$$ +| x y - R ^ {f} (x y) 2 ^ {- f} | < | x y - \mu 2 ^ {- f} | + \epsilon \leq \frac {\epsilon^ {2}}{4} + \max \{| x |, | y | \} \epsilon + \epsilon = (\max \{| x |, | y | \} + 1) \epsilon + \frac {\epsilon^ {2}}{4}. +$$ + +The second $<$ is trivial by noting our assumption + +$$ +\max \{| x |, | y | \} < 2 ^ {k}. +$$ + +□ + +# J.3. Proof of Proposition 4.2 + +Proof. The proof is based on Lemma J.1. + +$$ +\begin{array}{l} \left\| A B - R ^ {f} (A B) 2 ^ {- f} \right\| = \sqrt {\sum_ {i , j} \left(\left(A B\right) _ {i j} - R _ {i j} ^ {f} (A B) 2 ^ {- f}\right) ^ {2}} \\ = \sqrt {\sum_ {i , j} \left(\sum_ {l} A _ {i l} B _ {l j} - \sum_ {l} R ^ {f} \left(A _ {i l} B _ {l j}\right) 2 ^ {- f}\right) ^ {2}} \\ = \sqrt {\sum_ {i , j} \left| \sum_ {l} \left(A _ {i l} B _ {l j} - R ^ {f} \left(A _ {i l} B _ {l j}\right) 2 ^ {- f}\right) \right| ^ {2}} \\ \leq \sqrt {\sum_ {i , j} \left(\sum_ {l} \left| A _ {i l} B _ {l j} - R ^ {f} \left(A _ {i l} B _ {l j}\right) 2 ^ {- f} \right|\right) ^ {2}} \\ < \sqrt {\sum_ {i , j} \left[ \sum_ {l} \left((2 ^ {k} + 1) \epsilon + \frac {\epsilon^ {2}}{4}\right) \right] ^ {2}} \\ = \sqrt {m p \cdot n ^ {2} \cdot \left((2 ^ {k} + 1) \epsilon + \frac {\epsilon^ {2}}{4}\right) ^ {2}} \\ = \sqrt {m p} n \left((2 ^ {k} + 1) \epsilon + \frac {\epsilon^ {2}}{4}\right). \\ \end{array} +$$ + +Multiplying both sides by $2^{f}$ , we get + +$$ +\left\| R ^ {f} (A B) - 2 ^ {f} A B \right\| < \sqrt {m p} n \left(\left(2 ^ {k} + 1\right) + \frac {\epsilon}{4}\right). +$$ + +# J.4. Proof of Proposition 4.3 + +Proof. Note that the variance, denoted as $\sigma^2 (\cdot)$ , of $R^{f}(xy)$ is + +$$ +\begin{array}{l} \sigma^ {2} \left(R ^ {f} (x y)\right) = \sigma^ {2} (b) = E \left(b ^ {2}\right) - \left(E (b)\right) ^ {2} = E (b) - \left(E (b)\right) ^ {2} = \{\mu \} - \left(\{\mu \}\right) ^ {2} = \{\mu \} (1 - \{\mu \}) \\ \leq \left(\frac {\{\mu \} + (1 - \{\mu \})}{2}\right) ^ {2} = \frac {1}{4}. \\ \end{array} +$$ + +Therefore, + +$$ +\begin{array}{l} \sigma^ {2} \left(R _ {i j} ^ {f} (A B)\right) = \sigma^ {2} \left(\sum_ {k} R ^ {f} \left(A _ {i k} B _ {k j}\right)\right) = \sum_ {k} \sigma^ {2} \left(R ^ {f} \left(A _ {i k} B _ {k j}\right)\right) \\ \leq \sum_ {k} \frac {1}{4} = \frac {n}{4}. \\ \end{array} +$$ + +In matrix form, the element-wise variance of the random matrix $R^{f}(AB)$ is + +$$ +\sigma^ {2} (R ^ {f} (A B)) \leq \frac {n}{4} \mathbf {1 1} ^ {\top}, +$$ + +where $\mathbf{1}$ is the column vector of 1's. Note all $mp$ entries in $R^{f}(AB)$ are independent. By the Chebyshev inequality, with probability at least $1 - \frac{mp}{\rho}$ , the following is true + +$$ +\frac {\left\| R ^ {f} (A B) - E \left(R ^ {f} (A B)\right) \right\| ^ {2}}{n / 4} \leq \rho , +$$ + +which can be re-written as + +$$ +\left\| R ^ {f} (A B) - E \left(R ^ {f} (A B)\right) \right\| \leq \frac {\sqrt {\rho n}}{2}. +$$ + +Let $\iota := \frac{1}{2}\sqrt{\frac{\rho}{mp}}$ . Then $\rho = 4t^2 mp$ . In conclusion, with probability at least + +$$ +1 - \frac {m p}{\rho} = 1 - \frac {m p}{4 \iota^ {2} m p} = 1 - \frac {1}{4 \iota^ {2}}, +$$ + +the following is true: + +$$ +\| R ^ {f} (A B) - E (R ^ {f} (A B)) \| \leq \frac {\sqrt {\rho n}}{2} = \frac {\sqrt {4 \iota^ {2} m p \cdot n}}{2} = \iota \sqrt {m n p}. +$$ + +Based on Proposition 4.1, the statement can be equivalently written as + +$$ +\| R ^ {f} (A B) - 2 ^ {- f} Q ^ {f} (A) Q ^ {f} (B) \| \leq \iota \sqrt {m n p}. +$$ + +![](images/6434c22afbb6ba7ef2e7cd7575a4a1a8151e1aa28c43bc1db45003aeea62079d.jpg) \ No newline at end of file diff --git a/securequantizedtrainingfordeeplearning/images.zip b/securequantizedtrainingfordeeplearning/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..20ed0936da9a5be0313a796930691f69c05f06c2 --- /dev/null +++ b/securequantizedtrainingfordeeplearning/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fef0b728e8978220389af5e0f14333ca2d39b9d53e953779d7b5a769858a248d +size 993224 diff --git a/securequantizedtrainingfordeeplearning/layout.json b/securequantizedtrainingfordeeplearning/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..998bd6a66d1a936204bd545d535733d88d979c1a --- /dev/null +++ b/securequantizedtrainingfordeeplearning/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:93200646cbf3f09a2a6e773f15a5c14f30a185a8670702ef3c394bee6f5c4984 +size 1087583 diff --git a/selectivenetworklinearizationforefficientprivateinference/0f3c4581-cf39-4112-ad04-71ee2fb851b7_content_list.json b/selectivenetworklinearizationforefficientprivateinference/0f3c4581-cf39-4112-ad04-71ee2fb851b7_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..30d91129b9864950e5e4f2722d78938219aac957 --- /dev/null +++ b/selectivenetworklinearizationforefficientprivateinference/0f3c4581-cf39-4112-ad04-71ee2fb851b7_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a1bc2da68e160c21779edebf8060fd76355040f1ed51afcf542eac2856013aa2 +size 100398 diff --git a/selectivenetworklinearizationforefficientprivateinference/0f3c4581-cf39-4112-ad04-71ee2fb851b7_model.json b/selectivenetworklinearizationforefficientprivateinference/0f3c4581-cf39-4112-ad04-71ee2fb851b7_model.json new file mode 100644 index 0000000000000000000000000000000000000000..4eb021f4d92e459b67d3995a0823a545d5dbb776 --- /dev/null +++ b/selectivenetworklinearizationforefficientprivateinference/0f3c4581-cf39-4112-ad04-71ee2fb851b7_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fd4cfe571aeba6fae99cb06525553765280ccb1a81366fbb14a6ae5fb04e3e9e +size 124145 diff --git a/selectivenetworklinearizationforefficientprivateinference/0f3c4581-cf39-4112-ad04-71ee2fb851b7_origin.pdf b/selectivenetworklinearizationforefficientprivateinference/0f3c4581-cf39-4112-ad04-71ee2fb851b7_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..986868c34caf00fe840f284deaff4712b95e9c0b --- /dev/null +++ b/selectivenetworklinearizationforefficientprivateinference/0f3c4581-cf39-4112-ad04-71ee2fb851b7_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3bf9bca9bdf2c08c866cfbdee415473cb1152608f121aa7dd6695a488aba10b9 +size 1125460 diff --git a/selectivenetworklinearizationforefficientprivateinference/full.md b/selectivenetworklinearizationforefficientprivateinference/full.md new file mode 100644 index 0000000000000000000000000000000000000000..df6304992689ba710df4fbe304147c58312769af --- /dev/null +++ b/selectivenetworklinearizationforefficientprivateinference/full.md @@ -0,0 +1,454 @@ +Minsu Cho1 Ameya Joshi1 Siddharth Garg1 Brandon Reagen1 Chinmay Hegde1 + +# Abstract + +Private inference (PI) enables inference directly on cryptographically secure data. While promising to address many privacy issues, it has seen limited use due to extreme runtimes. Unlike plaintext inference, where latency is dominated by FLOPs, in PI non-linear functions (namely ReLU) are the bottleneck. Thus, practical PI demands novel ReLU-aware optimizations. To reduce PI latency we propose a gradient-based algorithm that selectively linearizes ReLUs while maintaining prediction accuracy. We evaluate our algorithm on several standard PI benchmarks. The results demonstrate up to $4.25\%$ more accuracy (iso-ReLU count at 50K) or $2.2\times$ less latency (iso-accuracy at $70\%$ ) than the current state of the art and advance the Pareto frontier across the latency-accuracy space. To complement empirical results, we present a "no free lunch" theorem that sheds light on how and when network linearization is possible while maintaining prediction accuracy. Public code is available at https://github.com/NYU-DICE-Lab/selective_networklinearization. + +# 1. Introduction + +Cloud-based machine learning frameworks motivate the setting of private inference (PI). At a high level, the vision of private inference is to enable a user to (efficiently) perform inference of their data on a model owned by a cloud service provider. But both parties wish to preserve their privacy and both the user's data and the service provider's model are encrypted prior to inference using cryptographic techniques. + +Curiously, the difficulty in realizing this vision is the nonlinear operations of a deep network. Private execution of the linear operations in a network using ciphertext can be made essentially as fast as normal (plaintext) evaluation of the + +![](images/12313e98d75373c81089f3214c3de3d2cbff3c6c494fc14a3bde30a637b03ef3.jpg) +Figure 1. Our approach, SNL, achieves the Pareto frontier on ReLU counts vs. test accuracy for CIFAR-100. + +same operations with secret sharing techniques and input independent preprocessing phases. However, to privately evaluate ReLUs in the network, some version of Yao's Gar-bled Circuits (GC) is necessary, resulting in proportionally high latency costs and storage overheads. In a nutshell: standard deep network architectures (such as ResNets) are ill-suited for efficient PI, since they contain far too many ReLUs. See (Mishra et al., 2020; Ghodsi et al., 2020; Jha et al., 2021) and a detailed discussion below in Section 2. + +Thus, unlocking the full potential of fast, accurate, and private neural inference require rethinking network design to have as few ReLUs as possible. Numerous efforts in this direction have already emerged. Prior work such as MiniONN (Liu et al., 2017) focus on the security protocols themselves, while more recent works such as Delphi (Mishra et al., 2020) or Circa (Ghodsi et al., 2021) propose to replace ReLUs with other activations. An alternative line of work designs ReLU-efficient network skeletons using neural architecture search (NAS). CryptoNAS (Ghodsi et al., 2020) uses evolutionary NAS, while Sphynx (Cho et al., 2021a) uses micro-search NAS. + +Our work in this paper pursues a new path, and applies to several architectures that are used in imaging, computer vision, or other perception problems (specifically, deep convolutional networks with/without residual connections and ReLU activations). For these networks we study a problem that we call deep network linearization. This refers to the process of judiciously picking a subset of neurons in such a network and eliminating their nonlinearities (i.e., replacing + +their ReLU operation with an identity, or linear, operation) minimizing tradeoff between overall performance and number of ReLU operations. Note that via this process, we are not reducing the number of parameters in the network. Since ReLU activations are simple scalar operations, in normal scenarios we are essentially not getting any reduction in FLOP counts during network training or testing. However, in the PI setting, a major advantage of linearization is due to reducing the number of GC computations. + +This paper introduces a simple gradient-based algorithm (that we call Selective Network Linearization, or SNL) to solve the deep network linearization problem, validates this algorithm on a variety of standard benchmarks, and provides theoretical evidence that illuminates its observed behavior. + +Currently, the state-of-the-art in private inference is achieved by DeepReLU (Jha et al., 2021). The authors introduce a concept known as ReLU dropping in deep networks that, at a conceptual level, is equivalent to network linearization. Their proposed algorithm consists of three stages: ReLU "culling", ReLU "thinning", and ReLU "reshaping", each of which requires several manual design choices, involving several hyper-parameters. The search space of candidate architectures is very large; applying DeepReLU to a ResNet with $D$ stages would require training $\Omega(D)$ different networks and picking the one with the best accuracy. Also, crucially, the keep/drop decisions made by DeepReLU are made in stages: either entire ReLU layers are linearized, or entire ReLU layers are retained as is. + +In contrast, our proposed technique, SNL, is highlyautomated, involving very few hyper-parameters. SNL is implemented using a single gradient-based training procedure (which we describe below in detail) and requires no searching over multiple network skeletons. Finally, SNL provides fine-grained control, all the way down to the pixel feature map level, of which ReLUs to retain or eliminate. + +The intuition underlying SNL is simple and applicable to many deep networks. Consider any standard architecture (e.g., a ResNet-34), except with a twist. All ReLUs are now replaced with parametric ReLUs (or pReLUs) (He et al., 2015) with an independent, trainable slope parameter for each ReLU in the network. Further, each slope parameter is further constrained to be binary (0 or 1). Having defined this network, SNL proceeds to perform standard training (using, say, SGD or Adam); there is no other manual intervention necessary. + +Some care is needed to make things work. The main challenges lie in (a) enforcing the binary constraints on the slopes of the pReLUs, and (b) ensuring that only a small number of ReLUs are retained, i.e., the vector of slope parameters is (anti) sparse. Mirroring the approach adopted by certain network pruning algorithms (Lee et al., 2019; + +Cho et al., 2021b), we resolve these difficulties by augmenting the standard train error loss with an $\ell_1$ -penalty term defined over the slope coefficients, decaying the weight of this penalty on a schedule, and applying a final rounding step that binarizes the slopes. See Section 3. + +We validate SNL on a variety of benchmark datasets commonly used in the literature on private image classification, and show that SNL achieves Pareto dominance over the entire accuracy-latency tradeoff curve over all existing approaches. Figure 1 above demonstrates this in the context of CIFAR-100; we provide several additional results (and ablation studies) below and also show the same benefits for CIFAR-10 and Tiny ImageNet. See Section 4 and Appendix. + +Probing into the results of SNL reveals curious behavior. It appears that ReLUs in earlier layers are selectively linearized at a (much) higher rate than ReLUs in later layers; this aligns with the conclusions arrived at by earlier PI works such as DeepReDuce (Jha et al., 2021). Could this be indicative of some fundamental property of network learning? In a step towards rigorously answering this question, we prove no free lunch theorems showing that linearization comes at the cost of reducing memorization capacity of 3-layer networks. Moreover, if the network is contractive, i.e., if the second layer has fewer neurons than the first layer (typical in classification-type scenarios), then selective linearization retains original network capacity only if fewer neurons in the second layer are linearized. See Section 5. + +# 2. Related Work + +Private inference. Prior work on private inference (PI) have proposed methods that leverage existing cryptographic primitives for evaluating the output of deep networks. Cryptographic protocols can be categorized by choice of ciphertext computation used for linear and non-linear operations in a network. Operations are computed using some combination of: (1) secret-sharing (SS) under a secure multi-party computation (MPC) (Shamir, 1979; Goldreich et al., 2019) model; (2) partial homomorphic encryptions (PHE) (Gentry & Halevi, 2011), which allow limited ciphertext operations (e.g. additions and multiplications), and (3) garbled circuits (GC) (Yao, 1982; 1986) that rely on specialized circuitry. + +In this paper, our focus is exclusively on the DELPHI protocol for private inference1. DELPHI assumes the threat model that both parties are honest-but-curious. Therefore, each party strictly follows the protocol, but may try to learn information about the other party's input based on the tran + +Selective Network Linearization + +
ApproachMethodsReduce ReLUsUnits that are removed
CryptoNAS (Ghodsi et al., 2020)NASYeslayers
Sphynx (Cho et al., 2021a)NASYeslayers
DELPHI (Mishra et al., 2020)NAS + polynomial approx.Yeslayers
SAFENet (Lou et al., 2021)NAS + polynomial approx.Yeschannels
Unstructured PruningN/ANonot exist
Structured PruningN/AYeschannels, layers
DeepReDuce(Jha et al., 2021)manualYeslayers
SNL (ours)gradient-basedYespixels, channels
+ +Table 1. Comparison of various techniques that reduce ReLU operations in deep networks. NAS stands for neural architecture search. "Pruning" techniques eliminate entire neurons. SNL, our proposed gradient-based network linearization method, achieves the accuracy-latency Pareto frontier in private inference. + +scripts they receive from the protocol. This threat model is standard in prior PI works, including MiniONN (Liu et al., 2017), DELPHI, CryptoNAS (Ghodsi et al., 2020), SAFENet (Lou et al., 2021), and DeepReDuce (Jha et al., 2021). + +DELPHI is a hybrid protocol that combines cryptographic primitives such as secret sharing (SS) and homomorphic encryptions (HE) for all linear operations, and garbled circuits (GC) for ReLU operations. DELPHI divides the inference into two phases to make the private inference happen: the offline phase and an online phase. DELPHI's cryptographic protocol allows for front-loading all input-independent computations to an offline phase. By doing so, this enables ciphertext linear computations to be as fast as plaintext linear computations while performing the actual inference. + +For non-linear (especially ReLU) operations, all the above approaches leverage GC's for secure computation. However, such circuits cause major latency bottlenecks. Mishra et al. (2020) show empirical evidence that ReLU computation requires $90\%$ of the overall private inference time for typical deep networks. As a remedy, DELPHI and SAFENET (Lou et al., 2021) propose neural architecture search (NAS) to selectively replace ReLUs with polynomial operations. CryptoNAS (Ghodsi et al., 2020), Sphynx (Cho et al., 2021a) and DeepReDuce (Jha et al., 2021) design new ReLU efficient architectures by using macro-search NAS, micro-search NAS and multi-step optimization respectively. + +Network compression. We emphasize that network linearization is distinct from neural network compression, which fundamentally focuses on reducing the number of learnable parameters in a deep network. Broadly, network compression (or pruning) techniques can be divided into two buckets. Unstructured pruning approaches identify and remove "unimportant" weights (edges) in a deep network to reduce model size. Zhu & Gupta (2017); Gale et al. (2019) retain top- $k$ parameters by measuring the importance of weight parameters based on their absolute magnitude. Lee et al. (2019) proposes measuring importance according to + +gradient magnitudes. Xiao et al. (2019); Cho et al. (2021b) trains the network with iterative multi-objective loss functions and reparameterized weights. + +In contrast, structured pruning approaches remove entire channels in convolutional architectures; this has the effect of eliminating both nodes and edges in the network. Li et al. (2016) uses a combination of magnitude-pruning and fin-tuning to prune channels in every layer. He et al. (2020a) achieves state-of-the-art pruning performance in this direction. While structured pruning methods do end up reducing ReLU counts as a by-product, this reduction comes at the cost of losing expressivity. On the other hand, selective linearization retains the original number of learnable parameters while only reducing the number of ReLUs in the network. Below we show extensive experiments (and preliminary theory) showing why selective linearization is superior in the context of private inference. + +# 3. Selective Network Linearization + +Notation. We represent matrices and tensors with upper-case variables unless stated otherwise. Elements of vectors and matrices are represented using appropriate subscripts. $\| \cdot \| _0$ represents number of non-zeros; $\odot$ represents elementwise products. $[d]$ is the natural number set $\{1,2,3,\dots ,d\}$ 1 is the all-ones vector of the appropriate dimension. + +# 3.1. Setup + +Our approach applies to any feed-forward deep network architecture with $d$ layers and ReLU activations $(\sigma(\cdot))$ . Let $f_{\mathbf{W}}$ be any such network where $\mathbf{W} = \{W^0, W^1, \ldots, W^d\}$ are the layer weight. Denote the pre-activation outputs of each linear layer by $z^1, z^2, \ldots, z^d$ . Denote $x$ be the input vector and $z^1 = W^1 x$ . Let $a^i = \sigma(z^i)$ be the outputs after each layer of ReLUs. Expanding $f_{\mathbf{W}}(x)$ , we get + +$$ +f _ {\mathbf {W}} (x) = W ^ {d} \left(\sigma \left(W ^ {d - 1} \left(\sigma \left(W ^ {d - 2} \left(\dots \sigma \left(W ^ {1} x\right) \dots\right). \right. \right.\right. \right. +$$ + +![](images/bb4fa85ce79eb929c0ac189e64a32635ee852e5b5773620701d75218276e7067.jpg) +(a) Visual comparison on SNL and Structured Pruning + +![](images/2c31c916a3ff14ef7e7f472f14fbd3f279be7a94506b98890179118b630eff4e.jpg) +(b) Visual representation of Equation 2 +Figure 2. Visualization of SNL, structured pruning, and Equation 2. (a) Both SNL and structured pruning have two non-linear activations. While all 55 parameters are on in SNL, the network from structured pruning has only 18 parameters. We note that number of non-linear activations (especially ReLU) is what matters in PI. (b) Visual representation of the convex combination between $x$ and $\sigma(x)$ . If non-linear activation $\sigma$ is ReLU and $c \in \mathbb{R}$ , then this convex combination is equivalent to PReLU. + +We now introduce a set of auxiliary binary vectors $\mathbf{C} = \{c^1, c^2, \ldots, c^d\}$ , where for $i \in [d]$ , we define $\sigma_{c^i}$ as the parametric ReLU (PReLU) activation function (with (left) slope equal to $1 - c^i$ ) defined for every neuron in the network. Then, the output, $\sigma_{c^i}(\cdot)$ , at the $i^{\text{th}}$ layer can be formally expressed as: + +$$ +a _ {c ^ {i}} ^ {i} = \sigma_ {c ^ {i}} \left(z ^ {i}\right) = c ^ {i} \odot \sigma \left(z ^ {i}\right) + \left(\mathbf {1} - c ^ {i}\right) \odot z ^ {i} \tag {2} +$$ + +Notice that according to our definition, $a_{c^i}^i = \mathrm{ReLU}(z^i)$ for $c_i = 1$ , and $a_{c^i}^i = z^i$ for $c_i = 0$ . In essence, we are re-defining $\sigma$ to $\sigma_{c^i}$ for all $i \in [d]$ in equation 1, so that now the feed-forward deep network $f_{\mathbf{W},\mathbf{C}}$ is parameterized both by $\mathbf{W}$ and $\mathbf{C}$ . + +Our goal is to learn a model with high accuracy but with as few RLUs as possible. This motivates the following $\ell_0$ -constrained optimization problem: + +$$ +\min _ {\mathbf {W}, \mathbf {C}} L \left(f _ {\mathbf {W}, \mathbf {C}} (\mathbf {x}), \mathbf {y}\right) \quad \text {s . t .} \sum_ {i = 1} ^ {d} \| c _ {i} \| _ {0} \leq B, c _ {i} \text {b i n a r y}. \tag {3} +$$ + +In terms of optimization difficulty, the main challenges with Equation 3 are in enforcing the binary constraints on each entry of $c_{i}$ , and the overall $\ell_0$ constraint. Below, we propose a solution to these challenges. + +# 3.2. The SNL Algorithm + +We first drop the binary constraints, and relax the optimization problem in Equation 3 to a Lasso-style objective function (Tibshirani, 1996): + +$$ +\min _ {\mathbf {W}, \mathbf {C}} L \left(f _ {\mathbf {W}, \mathbf {C}} (\mathbf {x}), \mathbf {y}\right) + \lambda \left(\sum_ {i = 1} ^ {d} \| c _ {i} \| _ {1}\right). \tag {4} +$$ + +In principle, both the weights $\mathbf{W}$ and the slope parameters $\mathbf{C}$ can be updated via standard gradient iterations over this + +# Algorithm 1 SNL: Selective Network Linearization + +1: Inputs: $f_{\mathbf{W}}$ : pre-trained network, $\lambda$ : Lasso coefficient, $\kappa$ : scheduling factor, $B$ : ReLU budget, $\epsilon$ : threshold. +2: Set $\mathbf{C} = 1$ : same dimensions to all feature maps. +3: $\overline{\mathbf{W}}\gets (\mathbf{W},\mathbf{C})$ +4: while ReLU Count $>B$ do +5: Update $\overline{\mathbf{W}}$ via ADAM for one epoch. +6: ReLU Count $\leftarrow \|\mathbb{1}(\mathbf{C} > \epsilon)\|_0$ +7: if ReLU count not decreased then +8: Increment Lasso coefficient $\lambda \gets \kappa \cdot \lambda$ . +9: end if +10: end while +11: $\mathbf{C}\gets \mathbb{1}(\mathbf{C} > \epsilon)$ +12: Freeze $\mathbf{C}$ and finetune $f_{\mathbf{W}}$ + +objective. In practice, to ensure good performance, our approach requires four steps: (1) Start with a pre-trained network $f_{\mathbf{W}}$ . (2) Update $\mathbf{W}$ and $\mathbf{C}$ simultaneously by gradient descent over Equation 4. (3) Binarize elements of $\mathbf{C}$ by rounding to 0 or 1. (4) freeze $\mathbf{C}$ and perform final finetuning of $f_{\mathbf{W}}$ . + +In Step 2, we first initialize $\mathbf{C}$ to all ones in the vector space. Then, we update $\mathbf{W}$ and $\mathbf{C}$ simultaneously via standard backpropagation (using ADAM), until the desired sparsity level of $\mathbf{C}$ is achieved. We monitor the sparsity of $\mathbf{C}$ by computing the quantity $\| \mathbb{1}(\mathbf{C} > \epsilon)\| _0$ , where $\epsilon$ is a very small non-negative hyperparameter. Similar to the technique of homotopy continuation in Lasso, if the sparsity of $\mathbf{C}$ increases compared to previous epochs we increase $\lambda$ with a small multiplicative factor $\kappa$ and repeat. Once the desired number of nonzero elements in $\mathbf{C}$ reached, we binarize by thresholding $\mathbb{1}(\mathbf{C} > \epsilon)$ . Finally, we freeze $\mathbf{C}$ and fine-tune the network weights $\mathbf{W}$ to boost final performance. Algorithm 1 provides detailed pseudocode. + +# 3.3. Aside: Linearization versus pruning + +Let us pause to highlight the essential diffences of Equation 3 with unstructured network pruning (Zhu & Gupta, 2017; Lee et al., 2019; Cho et al., 2021b). There, one typi + +cally chooses a masking parameter for every weight in the network, and solves a similar looking optimization: + +$$ +\min _ {\mathbf {w}, \mathbf {m}} L (f (\mathbf {w} \odot \mathbf {m}; \mathbf {x}), \mathbf {y}) \quad \text {s . t .} \| \mathbf {m} \| _ {0} \leq k \tag {5} +$$ + +where $k$ is a parameter counting the total number of retained weights. + +But eliminating (individual) edges do not lead to reduction in ReLU counts; only if all incoming weights to a given ReLU operation are removed – or if an entire channel is removed – then one can safely eliminate the corresponding ReLU operation in the feature map. This is akin to structured pruning, but as we will show below, this leads to significantly worse performance as well as representation capacity compared to SNL. Figure 2(a) visualizes the difference between SNL and structured pruning. + +# 4. Experiments + +Architectures, datasets, training. We apply SNL to the ResNet18/34 architectures (He et al., 2016) and Wide-ResNet 22-8 (Zagoruyko & Komodakis, 2016) architectures. As standard in prior work (Jha et al., 2021), we remove the ReLU layers in the first convolution layer. This layer serves to raise the input channel dimension from 3 to a higher number (e.g. 64 for ResNet18/34). + +We focus on standard image classification datasets (CIFAR-10/100 and Tiny ImageNet). The image resolutions on both CIFAR-10 and CIFAR-100 is $32 \times 32$ ; Tiny-ImageNet is $64 \times 64$ . CIFAR10 has 10 output classes with 5000 training images and 1000 test images per class, while CIFAR-100 has 100 output classes with 500 training images and 100 test images per class. TinyImageNet has 200 output classes with 500 training images and 50 validation images. + +We first pre-train networks on CIFAR-10/100 using SGD with initial learning rate 0.1 and momentum 0.9, decay the learning rate at 80 and 120 epochs with 0.1 learning rate decay factor, 0.0005 weight decay, and use batch-size 256. For Tiny/ImageNet, we use the same hyperparameters, except that we train for 100 epochs and perform learning rate decay at 50 and 75 epochs with decay factor 0.1. + +For the SNL algorithm, we initialize $\lambda = 0.00001$ and increment $\lambda$ by a multiplicative factor 1.1 if the ReLU count increases compared to previous epochs. We set the thresholding parameter $\epsilon = 0.01$ . We use the ADAM optimizer with learning rate equal to 0.001. In the finetuning stage, we update the network parameter $W$ via SGD with a learning rate of 0.001 and 0.9 momentum for 100 epochs. Finally, like DeepReLU, we use knowledge distillation during finetuning (Hinton et al., 2015) with temperature parameter 4 and equal relative weights on both cross-entropy (on the hard labels) and KL divergence (on the soft labels). We + +use the original pretrained model with identical network topology as the teacher. + +Latency estimates for private inference. We report results both in terms of ReLU counts and wall-clock time for private inference. Existing open-source implementations of DELPHI are unfortunately not compatible with networks with pixel-wise parametric ReLU operations. Therefore, we propose a method to empirically estimate the online latency for private inference over such networks per input data sample. We break down the sources of latency into two categories: ciphertext linear operations and ciphertext ReLU operations. Since ciphertext linear operations in DELPHI are essentially as fast as plaintext linear operations (and since ReLUs in plaintext are essentially free), we simply report the latency of ciphertext linear operations as the same as that for one plaintext network inference. For ciphertext ReLU operations, we experimentally measure the wall-clock time for 1000 ReLU operations using DELPHI, resulting in $t = 0.021$ seconds per 1000 ReLUs $^{2}$ . + +Pareto analysis and comparisons. Our main result, Figure 3, shows that SNL achieves the ReLU count-accuracy Pareto frontier on CIFAR-10, CIFAR-100, as well as TinyImageNet over all previous competing approaches. + +To our knowledge, the previous best approach is due to DeepReDuce, which (as we discussed in the Introduction) optimizes networks in three stages, each with a fair bit of manual intervention. On the other hand, SNL outperforms DeepReDuce with a fairly straightforward gradient-based procedure. Furthermore, we used identical hyperparameters for all target ReLU budgets and base networks, showing that SNL is capable of giving robust state-of-the-art performance without careful hyperparameter tuning. + +We now discuss our results in detail in two regimes of interest: high-ReLU and low-ReLU budgets (Table 2). At a high-ReLU budget, SNL achieves $76.35\%$ test accuracy with budget $= 120\mathrm{K}$ on CIFAR-100, while DeepReDuce achieves $75.50\%$ accuracy given a significantly higher (197K) ReLU count. Therefore, the network produced by SNL cuts down latency to $60\%$ of that of DeepReDuce, while achieving $0.85\%$ higher accuracy. In comparison, the network from CryptoNAS with a comparable performance as SNL requires nearly 3 times the total ReLU counts. Similarly, the network produced by Sphynx (Cho et al., 2021a) with achieves $74.93\%$ with ReLU count $= 230\mathrm{K}$ ; SNL matches this performance with approximately half the ReLU count. + +![](images/e5c7a32ec5a50e89cc059a49ed1c7e9c341200519719ffc1674a235eb3333842.jpg) +Figure 3. SNL achieves Pareto frontiers of ReLU counts versus test accuracy on CIFAR-10, CIFAR-100, and Tiny-ImageNet. SNL outperforms the state-of-the-art methods (DeepReLU, SAFENet, and CryptoNAS) in all range of ReLU counts on all three dataset. $\ell_1$ Filter Pruning (Li et al., 2016) and LFPC (He et al., 2020b) are structured pruning techniques. + +On Tiny-ImageNet, SNL produces a network that only uses $55\%$ of ReLUs as that of DeepReduce (500K vs. 917K) with par accuracy (64.42% vs. 64.66%). + +At low-ReLU budgets, the SNL network achieves $73.75\%$ test accuracy with 49.4K ReLU count on CIFAR-100. Both DeepReDuce and Sphynx use around 50K ReLU count, and achieve $69.50\%$ and $69.57\%$ test accuracy respectively. CryptoNAS network with 100K ReLU count reaches $68.75\%$ test accuracy, but SNL beats CryptoNAS by nearly $5\%$ in terms of accuracy with only half its ReLU budget. At the extreme case, we see that the SNL network with ReLU count 25K achieves $70.05\%$ , outperforming DeepReDuce models with $68.68\%$ containing ReLU count 28.6K. On Tiny-ImageNet, SNL achieves $63.39\%$ with ReLU count 200K, whereas DeepReDuce network reaches $61.65\%$ accuracy with nearly double the ReLU count (400K). Furthermore, Sphynx achieves $4\%$ less accuracy with $3\times$ the ReLU counts (614K), compared to SNL with ReLU count 200K. + +Analysis of networks produced by SNL. In SNL we only impose a total ReLU budget constraint; the algorithm automatically decides how it wants to allocate its budget across different layers. To study the effects of this allocation, we run SNL on ResNet-18 trained on CIFAR-100 with various ReLU budgets ranging from 20K to 300K; the base ResNet-18 requires approximately 492K ReLU operations. Comparing the blue and the orange bars in Figure 4, we see that SNL drops earlier ReLUs at a higher rate than later ReLUs; this indicates that ReLU operations on later layers are generally more crucial than the earlier layers. Indeed, the ReLU distribution plots with ReLU budget 100K, 200K, and 300K show that the ReLU operations in later layers (13, 14, 15, and 16) are mostly preserved. In contrast, the ReLUs in the earlier layers (1, 2, 3, 4) are largely eliminated and replaced with the identity operation. This observation mirrors the approach in DeepReDuce. There, the authors discovered by exhaustive manual ablation studies that Re + +LUs in later layers had a more significant effect than earlier layers, and therefore proposed a "ReLU criticality metric" to decide whether or not to cull entire layers of ReLUs. Interestingly, SNL arrives at a similar strategy without any manual intervention3. We revisit this in Section 5. + +Channel-wise SNL. As described, the SNL algorithm proposes linearizing ReLUs at the finest (pixel-level) scale. We can develop "channel-wise" extensions of this method with a straightforward change-of-variables. Consider a CNN architecture, where our decision to linearize is at the channel (filter) scale. In this case, everything is the same as before, except that $\mathbf{C}$ in Algorithm 1 is the same dimension as the total number of convolution filters. Let $x_{i}^{d}$ be the feature map after applying the $i^{\text{th}}$ filter in the $d^{\text{th}}$ layers. We can selectively linearize this via: + +$$ +z _ {i} ^ {d} = c _ {i} ^ {d} \cdot R e L U \left(x _ {i} ^ {d}\right) + \left(1 - c _ {i} ^ {d}\right) \cdot \left(x _ {i} ^ {d}\right) \tag {6} +$$ + +and the rest of the algorithm proceeds identically. We call this Structured SNL and test this with ResNet-18 and WideResNet 22-8 on the CIFAR-100 dataset. Table 6 in the Appendix shows that structured SNL outperforms SAFENet with $0.7\%$ higher accuracy (68.26% vs. $67.50\%$ ), with $11.5 \times$ faster online inference time (0.628s vs. 7.20s). + +SNL outperforms structured pruning. We also compare SNL to magnitude-based structured pruning. As discussed previously, structured pruning methods remove entire filters (and as a by-product also reduce ReLU counts). However, the loss of learnable parameters leads to significant losses in accuracy. We compare SNL, $\ell_1$ -magnitude filter pruning (Li + +![](images/8a0af34671f468af72779841a97a5f28bfba2aefc193ccce71252158a7cda1a0.jpg) +ReLU 20K + +![](images/6596f303f8c6dd2e5ce7d6f59fe22319309119e83610c2291d1b7921c3e77c28.jpg) +ReLU 30K + +![](images/920c2b3f0b0d5deef0d643e7c4711d682a4ca731ce89fdc9fef12178c5a672a8.jpg) +ReLU 50K + +![](images/b42619ae4d04ac6bc0b329af377867cd28c2dd3886a87e0055b456f45c092f1b.jpg) +ReLU 100K + +![](images/bb0eecf8af5ce632de9f96defc129c4034b447c828377c1030de9708ce318977.jpg) +ReLU 200K + +![](images/450e809115a5f2d945175001f717b77fe1ea0fa828d3047355de319b99c1269c.jpg) +ReLU 300K +Figure 4. ReLU distribution on ResNet18 from SNL. Before and After stand for ReLU counts before SNL and after SNL, respectively. $x$ -axis corresponds to a layer index of the network. The larger gap between a blue and orange bar means the more ReLU operations replaced with identity function. Aligning to the theoretical results from Corollary 2, SNL replaces more ReLU operations to identity function in the earlier layers (1-4) while later layers' ReLU operations preserved (13-16). + +Table 2. CIFAR-100 Comparison + +
Methods#ReLUs (K)Test Acc. (%)Online Lat. (s)Acc./ReLU
ReLU ≤ 100KSNL#12.966.530.2915.517
SNL#15.067.170.3344.478
SNL#24.970.050.5422.813
SNL#49.973.751.0661.478
DeepReLU12.364.970.455.282
DeepReLU28.768.680.562.393
DeepReLU49.269.501.191.413
Sphynx25.666.130.7272.583
Sphynx51.269.571.3351.359
Sphynx102.472.902.3850.712
CryptoNAS100.068.52.300.685
ReLU ≤ 300KSNL*120.076.352.8020.636
SNL*150.077.353.3980.516
SNL*180.077.654.0540.431
DeepReLU197.075.513.940.383
DeepReLU229.476.224.610.332
CryptoNAS344.076.07.500.221
Sphynx230.074.935.120.326
+ +Starts with pretrained ResNet18. +* Starts with pretrained Wide-ResNet 22-8. + +et al., 2016) and LFPS-filter pruning (He et al., 2019) with pretrained Resnet-18 networks on CIFAR-10 and CIFAR100. The results are available in Fig. 3. SNL outperforms $\ell_1$ pruning by a large margin on accuracy for similar ReLU counts. While LFPS-pruning is more accurate than $\ell_1$ pruning, SNL is able to achieve the same accuracy while only requiring $\sim 4\times$ fewer ReLUs. See also Appendix B for several additional ablation studies. + +# 5. Theoretical analysis + +Figure 4 in Section 4 reveals interesting trends. The blue bars indicate the number of ReLUs in every layer of a (standard) ResNet-18 model. Since the network is contractive, this number generally decreases as a function of depth. But after applying SNL, the red bars indicate that across the entire range of ReLU target budgets, neurons in earlier layers are linearized at a far greater rate than later layers. This aligns well with earlier findings; DeepReDuce (Jha et al., 2021) also hypothesized that (manually) culling all ReLUs in the first few layers provides the largest latency improvement with the smallest accuracy drop. + +We now present theoretical evidence as to why this might be the case. One way to measure the effect of linearizing RLUs in a network is to compare the expressivity of networks before and after linearization. To measure the expressivity, we leverage the notion of memorization capacity. + +Definition 1 (Yun et al. (2019); Vershynin (2020)). Let $f_W$ be a neural network of a given architecture with learnable parameters $W$ . The memorization capacity of $f_W$ is the largest $N$ such that the following condition is satisfied: For all inputs $\{x_i\}_{i=1}^N \subset \mathbb{R}^{d_x}$ and for all $\{y_i\}_{i=1}^N \subset [-1,1]$ , there exists a choice of parameters $W$ such that $f_W(x_i) = y_i$ for $1 \leq i \leq N$ . + +Our main results focus on dense feed-forward neural networks (FNN) $^{4}$ . Under the assumption that the dataset + +$\{(x_i, y_i)\}_{i=1}^N$ contains distinct data points, (Yun et al., 2019) provide an upper bound on memorization capacity of FNNs with 2 hidden layers. + +Theorem 1 (Yun et al. (2019)). Consider an FNN $f_{W}$ with two hidden layers and piecewise linear activation function $\sigma$ . Suppose that the hidden layers have width $d_{1}$ and $d_{2}$ and that the number of pieces in the activation function is $p$ . Then, the memorization capacity of $f_{W}$ is no greater than: + +$$ +p (p - 1) d _ {1} d _ {2} + (p - 1) d _ {2} + 2. +$$ + +For the case of ReLU networks, $p = 2$ and the above bound on the capacity simplifies to $2d_{1}d_{2} + d_{2} + 2$ . + +The intuition for this theorem is based on the fact that FNNs with ReLU activations implement piecewise affine functions; so an upper bound on their capacity can be obtained by counting the number of "linear pieces" in the range of the FNN, which can be recursively computed for each layer. See the appendix of (Yun et al., 2019) for a detailed proof. + +Let us now imagine selectively linearizing such an FNN; more specifically, suppose we only linearize all but a fraction $\alpha_{1}$ of the neurons in the first layer, and all but a fraction $\alpha_{2}$ of the neurons in the second layer. Mirroring the same counting argument as above, we obtain the following corollary to Theorem 1. + +Corollary 1. Consider an FNN $f_{W}$ with 2 hidden layers of width $d_{1}$ and $d_{2}$ respectively, and piecewise linear activation function $\sigma$ with $p$ pieces. Let $\alpha_{i} \in [0,1], i \in \{1,2\}$ be the fraction of nonlinear activations retained at each layer, i.e., without loss of generality the $l^{\mathrm{th}}$ layer $k^{\mathrm{th}}$ neuron exhibits the activation: + +$$ +a _ {k} ^ {l} (x) = \left\{ \begin{array}{l l} \sigma (z _ {k} ^ {l} (x)) & \text {i f} k \in [ \alpha_ {l} d _ {l} ] \\ z _ {k} ^ {l} (x) & \text {i f} k \in [ d _ {l} ] \setminus [ \alpha_ {l} d _ {l} ] \end{array} \right. +$$ + +Then, the memorization capacity of $f_{W}$ is no greater than: + +$$ +\begin{array}{l} \alpha_ {1} \alpha_ {2} d _ {1} d _ {2} p (p - 1) + \alpha_ {2} d _ {2} (p - 1) + \\ \alpha_ {1} (1 - \alpha_ {2}) d _ {1} d _ {2} (p - 1) + 2. \\ \end{array} +$$ + +For ReLU networks, the above bound simplifies to: $\alpha_{1}(1 + \alpha_{2})d_{1}d_{2} + \alpha_{2}d_{2} + 2$ . + +Corollary 1 shows that the memorization capacity of a selectively linearized network (obtained, say, by applying SNL) is strictly smaller than the original network whenever $\alpha_{1}$ or $\alpha_{2}$ is smaller than 1. + +It is useful to see how selective linearization compares with (structured) pruning. Suppose that instead of just dropping the ReLUs activation, we eliminate the entire neuron from the network, i.e., the network widths now become $\alpha_{1}d_{1}$ and $\alpha_{2}d_{2}$ respectively. The following corollary can be obtained by directly instantiating these in Theorem 1. + +Corollary 2. Consider a 3-layer FNN $f_{W}$ with piecewise linear activation $\sigma$ with $p$ pieces. Let $\alpha_{1}, \alpha_{2} \in [0,1]$ be the fraction of nonlinear activations retained at the first and second layers, respectively. Then, the memorization capacity of $f_{W}$ is no greater than: + +$$ +\alpha_ {1} \alpha_ {2} d _ {1} d _ {2} p (p - 1) + \alpha_ {2} d _ {2} (p - 1) + 2 < N. +$$ + +For ReLU networks, the above bound simplifies to $2\alpha_{1}\alpha_{2}d_{1}d_{2} + \alpha_{2}d_{2} + 2$ + +Notice the gap between the capacity upper bounds in Corollary 1 and Corollary 2. Specifically, selective linearization enjoys an additional additive term: + +$$ +\alpha_ {1} (1 - \alpha_ {2}) d _ {1} d _ {2}, +$$ + +compared to pruning. In fact, equality between the capacity bounds is achieved when $\alpha_{2} = 1$ , i.e., when all the neurons in the second layer are retained. + +This observation might indicate that retaining most ReLUs (i.e., driving $\alpha_{2} \rightarrow 1$ in the second layer is the key. In fact, we can go further. From Corollary 1, if we fix an overall ReLU budget for the network, then we can derive optimal conditions on the fraction parameters $\alpha_{1}$ and $\alpha_{2}$ to maximize memorization capacity. To simplify notation, we restrict our attention to ReLU activations (i.e., $p = 2$ ). + +Theorem 2. Consider a 3-layer FNN with ReLU activation. Let $\alpha_{1},\alpha_{2}\in [0,1]$ be the fraction of nonlinear activations retaiend at the first and second hidden layers, respectively. Given a ReLU budget $B > d_{2}$ , the choice $\alpha_{1} = \frac{B + d_{2} - 1}{2d_{1}}$ and $\alpha_{2} = \frac{B - d_{2} + 1}{2d_{2}}$ maximizes the memorization capacity. + +This result confirms that the optimal "retention ratio" for each network is inversely proportional to its width, and therefore in contractive networks (such as those typical in classification) where $d_{1} > d_{2}$ , linearizing a greater number of neurons in the first layer is beneficial. As a concrete example, consider a 3-layer FNN with $d_{1} = 50000$ and $d_{2} = 5000$ , and budget $B = 10000$ . Then, the optimal choices are $\alpha_{1} = 14999 / 100000 \approx 0.15$ and $\alpha_{2} = 5001 / 10000 \approx 0.5$ . Therefore, linearizing 42,500 neurons in the first layer, and only 7,500 neurons with ReLU in the second layer gives the best memorization capacity among all possible choices. + +# 6. Discussion + +We have developed a simple method to selectively linearize deep neural networks with ReLU activations, and using this method, demonstrated state-of-the-art networks for the problem of private inference. + +Numerous directions for further work remain. Our work focused on reducing online runtime of private inference; a more holistic approach would consider both pre-processing + +and online costs. Instead of selectively linearizing certain ReLUs, replacing with other activations may be beneficial. Finally, deriving tighter bounds on memorization capacity for general architectures appears doable. + +# Acknowledgements + +This work was supported in part by the National Science Foundation (under grants CCF-2005804 and 1801495), USDA/NIFA (under grant 2021-67021-35329), the Applications Driving Architectures (ADA) Research Center, a JUMP Center co-sponsored by Semiconductor Research Consortium (SRC) and the Defense Advanced Research Projects Agency (DARPA). + +# References + +Cho, M., Ghodsi, Z., Reagen, B., Garg, S., and Hegde, C. Sphynx: Relu-efficient network design for private inference. arXiv preprint arXiv:2106.11755, 2021a. +Cho, M., Joshi, A., and Hegde, C. Espn: Extremely sparse pruned networks. In 2021 IEEE Data Science and Learning Workshop (DSLW), pp. 1-8. IEEE, 2021b. +Gale, T., Olsen, E., and Hooker, S. The state of sparsity in deep neural networks. arXiv preprint arXiv:1902.09574, 2019. +Gentry, C. and Halevi, S. Implementing gentry's fully-homomorphic encryption scheme. In Annual international conference on the theory and applications of cryptographic techniques, pp. 129-148. Springer, 2011. +Ghodsi, Z., Veldanda, A. K., Reagen, B., and Garg, S. Cryptonas: Private inference on a relu budget. In Adv. Neural Inf. Proc. Sys. (NeurIPS), 2020. +Ghodsi, Z., Jha, N. K., Reagen, B., and Garg, S. Circa: Stochastic relus for private deep learning. In Adv. Neural Inf. Proc. Sys. (NeurIPS), 2021. +Goldreich, O., Micali, S., and Wigderson, A. How to play any mental game, or a completeness theorem for protocols with honest majority. In *Providing Sound Foundations for Cryptography: On the Work of Shafi Goldwasser and Silvio Micali*, pp. 307-328. 2019. +He, K., Zhang, X., Ren, S., and Sun, J. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In IEEE Intl. Conf. Comp. Vision, 2015. +He, K., Zhang, X., Ren, S., and Sun, J. Deep residual learning for image recognition. In IEEE Intl. Conf. Comp. Vision, pp. 770-778, 2016. + +He, Y., Liu, P., Wang, Z., Hu, Z., and Yang, Y. Filter pruning via geometric median for deep convolutional neural networks acceleration. IEEE Conf. Comp. Vision and Pattern Recog, pp. 4335-4344, 2019. +He, Y., Ding, Y., Liu, P., Zhu, L., Zhang, H., and Yang, Y. Learning filter pruning criteria for deep convolutional neural networks acceleration. In IEEE Conf. Comp. Vision and Pattern Recog, 2020a. +He, Y., Ding, Y., Liu, P., Zhu, L., Zhang, H., and Yang, Y. Learning filter pruning criteria for deep convolutional neural networks acceleration. In IEEE Conf. Comp. Vision and Pattern Recog, pp. 2009-2018, 2020b. +Hinton, G., Vinyals, O., and Dean, J. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015. +Jha, N. K., Ghodsi, Z., Garg, S., and Reagen, B. DeepReduce: Relu reduction for fast private inference. In Proc. Int. Conf. Machine Learning, 2021. +Lee, N., Ajanthan, T., and Torr, P. H. S. Snip: Single-shot network pruning based on connection sensitivity. In Proc. Int. Conf. Learning Representations, volume abs/1810.02340, 2019. +Li, H., Kadav, A., Durdanovic, I., Samet, H., and Graf, H. P. Pruning filters for efficient convnets. arXiv preprint arXiv:1608.08710, 2016. +Liu, J., Juuti, M., Lu, Y., and Asokan, N. Oblivious neural network predictions via minionn transformations. In Proc. of the 2017 ACM SIGSAC Conf. on Computer and Communications Security, pp. 619-631, 2017. +Lou, Q., Shen, Y., Jin, H., and Jiang, L. Safenet: Asecure, accurate and fast neu-ral network inference. In Proc. Int. Conf. Learning Representations, 2021. +Mishra, P., Lehmkuhl, R., Srinivasan, A., Zheng, W., and Popa, R. A. Delphi: A cryptographic inference service for neural networks. In 29th USENIX Security Symposium (USENIX Security 20), pp. 2505-2522. USENIX Association, Aug. 2020. ISBN 978-1-939133-17-5. URL https://www.usenix.org/conference/usenixsecurity20/presentation/mishra. +Rathee, D., Rathee, M., Kumar, N., Chandran, N., Gupta, D., Rastogi, A., and Sharma, R. Cryptflow2: Practical 2-party secure inference. In Proceedings of the 2020 ACM SIGSAC Conference on Computer and Communications Security, pp. 325-342, 2020. +Shamir, A. How to share a secret. Communications of the ACM, 22(11):612-613, 1979. + +Telgarsky, M. Representation benefits of deep feedforward networks. arXiv preprint arXiv:1509.08101, 2015. +Tibshirani, R. Regression shrinkage and selection via the lasso. Journal of the Royal Statistical Society. Series B (Methodological), pp. 267-288, 1996. +Vershynin, R. Memory capacity of neural networks with threshold and rectified linear unit activations. SIAM Journal on Mathematics of Data Science, 2(4):1004-1033, 2020. +Xiao, X., Wang, Z., and Rajasekaran, S. Autoprune: Automatic network pruning by regularizing auxiliary parameters. In Adv. Neural Inf. Proc. Sys. (NeurIPS), 2019. +Yao, A. C.-C. Protocols for secure computations. In 23rd Annual Symposium on Foundations of Computer Science (sfcs 1982), pp. 160-164. IEEE, 1982. +Yao, A. C.-C. How to generate and exchange secrets. In 27th Annual Symposium on Foundations of Computer Science (sfcs 1986), pp. 162-167. IEEE, 1986. +Yun, C., Sra, S., and Jabbabaie, A. Small relu networks are powerful memorizers: a tight analysis of memorization capacity. In Wallach, H., Larochelle, H., Beygelzimer, A., d'Alché-Buc, F., Fox, E., and Garnett, R. (eds.), Adv. Neural Inf. Proc. Sys. (NeurIPS), 2019. +Zagoruyko, S. and Komodakis, N. Wide residual networks. arXiv preprint arXiv:1605.07146, 2016. +Zhu, M. and Gupta, S. To prune, or not to prune: exploring the efficacy of pruning for model compression. arXiv preprint arXiv:1710.01878, 2017. + +# A. Proofs + +# A.1. Proof of Corollary 1 + +Proof. The proof is based on the idea of counting the number of pieces in the range of networks with piecewise linear activations. Consider any vector $u \in \mathbb{R}^{d_x}$ , and define the following dataset: $x_{i} = i u, y_{i} = (-1)^{i}$ , for all $i \in [N]$ . From (Telgarsky, 2015; Yun et al., 2019) we have: + +Lemma 1. If $g: \mathbb{R} \to \mathbb{R}$ and $h: \mathbb{R} \to \mathbb{R}$ are piecewise linear with $k$ and $l$ linear pieces, respectively, then $g + h$ is piecewise linear with at most $k + l - 1$ pieces, and $g \circ h$ is piecewise linear with at most $kl$ pieces. + +Fix $u$ and consider the output of layer 1 for input $x = tu$ , where $t$ is a scalar variable: $\bar{a}_j^1(t) := a^1(tu)$ . For each $j \in [\alpha_1d_1]$ , $\bar{a}_j^1(\cdot)$ has at most $p$ pieces. On the other hand, $j' \in [d_1] \setminus [[\alpha_1d_1]]$ , $\bar{a}_{j'}^1(\cdot)$ is a linear function and has 1 piece. The input to layer 2 is the weighted sum of $\bar{a}_j^1(\cdot)'s$ and $\bar{a}_{j'}^1(\cdot)'s$ . Each $\bar{z}_k^2(t) = z_k^2(tu)$ has $\alpha_1d_1(p - 1) + 1$ pieces. Now $\alpha_2d_2$ neurons after the activation $\sigma$ have at most $\alpha_1d_1p(p - 1) + p$ pieces and $(1 - \alpha_2)d_2$ neurons have at most $\alpha_1d_1(p - 1) + 1$ pieces. Therefore, the maximum number of pieces from the weighted sum of the second hidden layer neurons is calculated as: + +$$ +\begin{array}{l} \alpha_ {1} d _ {1} p (p - 1) + p + \sum_ {i = 1} ^ {\alpha_ {2} d _ {2} - 1} (\alpha_ {1} d _ {1} p (p - 1) + p - 1) + \sum_ {i = 1} ^ {(1 - \alpha_ {2}) d _ {2}} (\alpha_ {1} d _ {1} (p - 1) + 1 - 1) \\ = \alpha_ {1} \alpha_ {2} d _ {1} d _ {2} p (p - 1) + \alpha_ {2} d _ {2} (p - 1) + \alpha_ {1} (1 - \alpha_ {2}) d _ {1} d _ {2} (p - 1) + 1 \\ \end{array} +$$ + +This calculation tells that a 3-layer network has at most $\alpha_{1}\alpha_{2}d_{1}d_{2}p(p - 1) + \alpha_{2}d_{2}(p - 1) + \alpha_{1}(1 - \alpha_{2})d_{1}d_{2}(p - 1) + 1$ pieces. If this number is strictly smaller than $N - 1$ , the network cannot never perfectly fit the given dataset. + +# A.2. Proof of Corollary 2 + +Proof. The proof is a direct consequence of Theorem 1 by replacing $d_{1}$ and $d_{2}$ with $\alpha_{1}d_{1}$ and $\alpha_{2}d_{2}$ . + +# A.3. Proof of Theorem 2 + +Proof. By setting $p = 2$ , we consider the following optimization problem: + +$$ +\begin{array}{l} \max _ {\alpha_ {1}, \alpha_ {2}} \alpha_ {1} \alpha_ {2} d _ {1} d _ {2} + \alpha_ {1} d _ {1} d _ {2} + \alpha_ {2} d _ {2} + 1, \\ \mathrm {s . t .} \alpha_ {1} d _ {1} + \alpha_ {2} d _ {2} = B. \\ \end{array} +$$ + +Constructing the Lagrangian, + +$$ +L (\alpha_ {1}, \alpha_ {2}, \lambda) = \alpha_ {1} \alpha_ {2} d _ {1} d _ {2} + \alpha_ {1} d _ {1} d _ {2} + \alpha_ {2} d _ {2} + 1 - \lambda (\alpha_ {1} d _ {1} + \alpha_ {2} d _ {2} - B). +$$ + +By checking the first order condition of the Lagrangian, we get + +$$ +\alpha_ {1} = \frac {B + d _ {2} - 1}{2 d _ {1}}, \qquad \alpha_ {2} = \frac {B - d _ {2} + 1}{2 d _ {2}}. +$$ + +We examine the determinant of the Hessian $H$ which is defined as + +$$ +H = \left[ \begin{array}{c c c} 0 & d _ {1} & d _ {2} \\ d _ {1} & 0 & d _ {1} d _ {2} \\ d _ {2} & d _ {1} d _ {2} & 0 \end{array} \right]. +$$ + +One can verify that the determinant $\det H > 0$ since $d_1, d_2 > 0$ and $\det H$ has the sign $(-1)^2 = (-1)^{1 + 1}$ so the critical point $\left(\frac{B + d_2 - 1}{2d_1}, \frac{B - d_2 + 1}{2d_2}\right)$ from the first order condition is indeed a maximum. + +![](images/f556f75380047fcfe2bd454c7fc0be3a4e5f31cc863957153651184467f0fa05.jpg) + +![](images/2a0da0532699b2beae313a30727c42da0abf7429ea99571a25774769e3af5c89.jpg) +(b) $\lambda = 10^{-4}$ + +![](images/331229aebd3d020f086593d1becc329cec5d7519d1bee645003320bf51bdb871.jpg) +(a) $\lambda = 10^{-5}$ +(e) $lr = 10^{-4}$ +Figure 5. Ablation studies on Lasso coefficient $\lambda$ and learning rate $lr$ . We test on ResNet18 architecture with CIFAR-100. (a)-(d) show the differences in behavior on test accuracy and ReLU counts with various Lasso coefficient values given the learning rate $lr = 0.001$ and ADAM optimizer. High initial Lasso coefficients (as shown in (c) and (d)) induces the sparsity on $C$ rapidly and consequently the architecture's performance rapidly degrades as well. Small initial lasso coefficients from (a) and (b) gradually induce the sparsity on $C$ allowing the $W$ to adapt as well in order to maintain the networks' performance. (e)-(f) tracks the test accuracy and ReLU count given the Lasso coefficient $10^{-5}$ . We observe the similar trend in learning rate compared to Lasso coefficients; using a small learning rate ((e), (f)) helps to gradually reduce ReLU counts and maintain the test accuracy. + +![](images/9b4b2c94f2e50350ccc24eb6189b4a78b8b1c7dc4a670791cefc8488aabd3c2e.jpg) +(f) $lr = 10^{-3}$ + +![](images/7511a8e0feea51372e5100d4f7bfc0e846a46f1ee87852b16686c5600979e474.jpg) + +![](images/f9fee88673422730a4bb177c23ac9f6c66565af4b428664c0fca5776078d5c6a.jpg) +(c) $\lambda = 5\cdot 10^{-4}$ +(g) $lr = 10^{-2}$ + +![](images/439182be2bde370b75fe750c3e4096e174e8cae6a7935622c96c7c6e93d3c61c.jpg) + +![](images/b78e3a7ab76d2c0e59ffba807fc3a8d917e88802e1f468c6a9902c599705a4c5.jpg) +(d) $\lambda = 10^{-3}$ +(h) $lr = 10^{-1}$ + +# B. Additional Results + +# B.1. Ablation Studies on Hyperparameters + +We study the ablation studies on the primary hyperparameters: sparsity factor $\alpha$ and learning rate $lr$ . We choose the network ResNet18 with the CIFAR-100 dataset. We first examine the role of the sparsity factor $\alpha$ . The targeted ReLU budget here is $B = 50000$ , and the plots show the change of ReLU counts and test accuracy along with the training (corresponds to Algorithm 1 line 4-8). We use an ADAM optimizer with a learning rate of 0.001. + +Along with the simultaneous training on the model parameter $W$ and auxiliary parameter $C$ , the ideal situation will gradually reduce ReLU counts while maintaining the test accuracy close to the baseline pretrained model. We observe that increasing $\alpha$ induces the sparsity on $C$ faster; however, the test accuracy rapidly drops. On the other hand, the small $\alpha$ (e.g., first and second plot) gradually reduces the ReLU count while almost preserving the test accuracy. We heuristically observed incrementing the Lasso coefficient (line 5-6 in Algorithm 1) allows reaching the desired sparsity level on $C$ with Lasso coefficients initialized with small values. + +We also examine the role of learning rate. We use the equivalent hyperparameters as above but with different targeted ReLU budget $B = 100000$ and initial sparsity factor $\alpha = 0.00001$ . We observed that high learning rate such as 0.1 or 0.01 loses the performance in the beginning of the training and struggles to recover the performance compare to the original baseline performance (around $76\%$ ). Our empirical results show that SNL algorithm works well with lower learning rate such as 0.001 and 0.0001. SNL algorithm with $lr = 0.001$ terminates the simultaneous training with the test accuracy (before the finetuning) $75.04\%$ while $lr = 0.0001$ achieves the $71.55\%$ . + +# B.2. Ablation Studies on Algorithmic Components + +We study the variant of SNL algorithm by changing the algorithmic components. First, we consider zeroing out non-activated output instead of passing through the pre-activated inputs. In this case, the output, $\sigma_{c^i}(\cdot)$ at the $i^{\mathrm{th}}$ layer, can be expressed as: + +$$ +a _ {c ^ {i}} ^ {i} = c ^ {i} \odot \sigma \left(z ^ {i}\right) + \left(\mathbf {1} - c ^ {i}\right) \odot \mathbf {0} \tag {7} +$$ + +Equation 7 is equivalent to feature map sparsification where feature maps are zeroed out pixel-wise rather than filter-wise. Second, we perform the SNL algorithm from randomly initialized network (remark: SNL starts from the pretrained network). + +![](images/42b7a404cda462b3aff414376de771aa2af68fa877b819d1b59d37a1f4ee4383.jpg) +Figure 6. Comparison between SNL and its variants on CIFAR-100. All experiments in this plot uses ResNet18. + +![](images/abc0d0400c20a231951024484878e95396d2542d084b80027ebafe387f835139.jpg) +Figure 7. Effect of the Lasso Coefficient on supports of c. We track the number of supports in the auxiliary parameter c for various Lasso coefficients. See that the magnitude of Lasso coefficient $(\lambda)$ determines the convergence rate and the support of c. + +In Figure 6, "SNL-Zero-Out" and "SNL-Scratch" correspond to feature map sparsification and the SNL network trained from scratch, respectively. For this comparison, we train a ResNet18 architecture with the CIFAR100 dataset. A black horizontal line is the reference performance (76.95% test accuracy) of the original ResNet18 network with $490K$ ReLU. We observe that the "SNL-Zero-Out" performance degrades heavily in the sparse ReLU regime ( $< 50K$ ). Interestingly, "SNL-Scratch" showed a competitive performance to SNL while the original SNL consistently performed better in all cases except for one data point. Overall, this plot gives further evidence that the current SNL algorithm finds better performing architectures for a given ReLU budget over the SNL variants suggested by the reviewers. Finally, note that we incorporate knowledge distillation (KD) during the training, as clearly stated in the main paper (Line 268). We will add these results and discussion in the final draft. + +# B.3. Role of the Lasso Coefficient + +From our empirical observations, the magnitude of the Lasso coefficient $(\lambda)$ determines the final (anti) sparsity of the slope parameters, and the convergence rate. We conduct experiments with a pre-trained ResNet18 architecture trained on CIFAR-100. We modify the SNL algorithm by removing the "if-else" condition, gradually increasing the Lasso coefficient, and track ReLU counts given by the auxiliary parameter $c$ until 200 epochs. The other hyperparameters remain the same as our reported experiments: ADAM, $lr = 0.001$ , weight decay of 0.0005. Figure 7 shows that the magnitude of the Lasso coefficient directly contributes to the size of the support of $c$ and the convergence rate. These observations motivate Line 6-7 in SNL, which uses homotopy-style optimization to gradually increases the Lasso coefficient to reach the desired sparsity while ensuring mild accuracy drop (also see Figure 5 in the main paper showing that large $\lambda$ hurts test accuracy). + +Table 3. CIFAR-10 Comparison. + +
Methods#ReLUs(K)Test Acc.(%)Acc./ReLU
ReLU<100KSNL#12.988.236.840
SNL#25.090.883.635
SNL#60.092.631.544
DeepReLU36.088.52.458
DeepReLU80.090.51.131
CryptoNAS86.091.281.061
400KSNL*240.094.240.4712
SNL*300.095.060.317
CryptoNAS344.094.040.273
+ +Starts with pretrained ResNet18. +* Starts with pretrained Wide-ResNet 22-8. + +# B.4. Additional PI Results + +Table 3 and Table 4 shows the PI comparison on CIFAR-10 and Tiny-ImageNet, respectively. Table 5 includes the additional PI results with pretrained ResNet34 network. Table 6 contains the SNL results with channel-wise method demonstrated in Section 4. + +Table 4. Tiny-ImageNet Comparison + +
Methods#ReLUs (K)Test Acc. (%)Online Lat. (s)Acc./ReLU
100KSNL#59.154.241.2650.918
SNL#99.658.942.1170.592
V1DeepReDuce57.3553.751.850.937
DeepReDuce98.355.672.640.566
ReLUSphynx102.448.442.3500.473
300KSNL#198.163.394.1830.320
SNL#298.264.046.2810.215
V1DeepReDuce196.657.514.610.293
DeepReDuce393.261.657.770.157
ReLUSphynx204.853.514.4010.261
1000KSNL*488.864.4210.2810.132
DeepReDuce917.564.6617.160.070
V1Sphynx614.460.7612.5480.099
+ +Starts with pretrained ResNet18. +* Starts with pretrained Wide-ResNet 22-8. + +Table 5. SNL on ResNet34 Networks on CIFAR-100, Tiny-ImageNet + +
Methods#ReLUs (K)Test Acc. (%)Online Lat. (s)Acc./ReLU
CIFAR-100SNL14.967.080.3394.502
SNL25.069.680.5512.787
SNL30.070.990.6562.366
SNL50.072.911.0751.458
SNL80.074.191.7050.927
SNL99.974.762.1220.748
SNL118.075.322.5020.638
SNL197.176.034.1610.385
Tiny-ImageNetSNL200.062.494.2310.312
SNL300.063.996.3290.213
SNL400.065.318.4260.163
SNL500.065.3410.5240.131
+ +Table 6. CIFAR-100 Results on Channel-wise SNL. + +
Methods#ReLUs (K)Test Acc. (%)Online Lat. (s)Acc./ReLU
Channel-wise SNL#29.068.260.6282.354
Channel-wise SNL#39.370.520.8431.794
Channel-wise SNL#49.871.561.0651.437
Channel-wise SNL*77.773.471.6500.940
Channel-wise SNL*117.374.332.4810.634
Channel-wise SNL*200.077.454.2160.387
+ +Starts with pretrained ResNet18. +* Starts with pretrained Wide-ResNet 22-8. \ No newline at end of file diff --git a/selectivenetworklinearizationforefficientprivateinference/images.zip b/selectivenetworklinearizationforefficientprivateinference/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..f3847c8c23943e5a846cddd506fb029aa6852d6a --- /dev/null +++ b/selectivenetworklinearizationforefficientprivateinference/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7560f6629fc8bc2337ebc6e4f6b642c5102cadc19ccc4d435a8e2e8b602648f7 +size 810619 diff --git a/selectivenetworklinearizationforefficientprivateinference/layout.json b/selectivenetworklinearizationforefficientprivateinference/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..df0cb09b0ee85614fdeae59f44fd491d28c3dd7b --- /dev/null +++ b/selectivenetworklinearizationforefficientprivateinference/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3db89ef8ab37d9102182fc5076bff3114767fbadc684fa7bd29240289479e75e +size 637293 diff --git a/selectiveregressionunderfairnesscriteria/b07f7640-2727-4eee-a53f-4395e656e402_content_list.json b/selectiveregressionunderfairnesscriteria/b07f7640-2727-4eee-a53f-4395e656e402_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..2ed6cba29d23400b93a71d5da5f3488ad75bbf88 --- /dev/null +++ b/selectiveregressionunderfairnesscriteria/b07f7640-2727-4eee-a53f-4395e656e402_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3a2f66bcabe001737d6c7fcc199b2e84f4a124a1bb25d61d2948ef45fd897f45 +size 129422 diff --git a/selectiveregressionunderfairnesscriteria/b07f7640-2727-4eee-a53f-4395e656e402_model.json b/selectiveregressionunderfairnesscriteria/b07f7640-2727-4eee-a53f-4395e656e402_model.json new file mode 100644 index 0000000000000000000000000000000000000000..e64cff49c08435b8e81b92af7318e203b1e8e79d --- /dev/null +++ b/selectiveregressionunderfairnesscriteria/b07f7640-2727-4eee-a53f-4395e656e402_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8406b83be84442a9894ab319a85ffc0c7f3803ba8f17a8111d5a263d67fe24f1 +size 159242 diff --git a/selectiveregressionunderfairnesscriteria/b07f7640-2727-4eee-a53f-4395e656e402_origin.pdf b/selectiveregressionunderfairnesscriteria/b07f7640-2727-4eee-a53f-4395e656e402_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c9e4b1babf9aa42a9b9ba7523a577f2cb4b38975 --- /dev/null +++ b/selectiveregressionunderfairnesscriteria/b07f7640-2727-4eee-a53f-4395e656e402_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:56c1fc7e9b941d7cf705c4664180e1f651038941443aef090368aa7dc98a2ef2 +size 708573 diff --git a/selectiveregressionunderfairnesscriteria/full.md b/selectiveregressionunderfairnesscriteria/full.md new file mode 100644 index 0000000000000000000000000000000000000000..2a961a5e909ec5fa23001aa4665614ec9c35be93 --- /dev/null +++ b/selectiveregressionunderfairnesscriteria/full.md @@ -0,0 +1,646 @@ +# Selective Regression Under Fairness Criteria + +Abhin Shah $^{*1}$ Yuheng Bu $^{*1}$ Joshua Ka-Wing Lee $^{2}$ Subhro Das $^{3}$ Rameswar Panda $^{3}$ Prasanna Sattigeri $^{3}$ Gregory W. Wornell $^{1}$ + +# Abstract + +Selective regression allows abstention from prediction if the confidence to make an accurate prediction is not sufficient. In general, by allowing a reject option, one expects the performance of a regression model to increase at the cost of reducing coverage (i.e., by predicting on fewer samples). However, as we show, in some cases, the performance of a minority subgroup can decrease while we reduce the coverage, and thus selective regression can magnify disparities between different sensitive subgroups. Motivated by these disparities, we propose new fairness criteria for selective regression requiring the performance of every subgroup to improve with a decrease in coverage. We prove that if a feature representation satisfies the sufficiency criterion or is calibrated for mean and variance, then the proposed fairness criteria is met. Further, we introduce two approaches to mitigate the performance disparity across subgroups: (a) by regularizing an upper bound of conditional mutual information under a Gaussian assumption and (b) by regularizing a contrastive loss for conditional mean and conditional variance prediction. The effectiveness of these approaches is demonstrated on synthetic and real-world datasets. + +# 1. Introduction + +As the adoption of machine learning (ML) based systems accelerates in a wide range of applications, including critical workflows such as healthcare management (Bellamy et al., 2018), employment screening (Selbst et al., 2019), automated loan processing, there is a renewed focus on the + +*Equal contribution 1Massachusetts Institute of Technology 2This work was done while J. Lee was at Massachusetts Institute of Technology; the author is now with Snap 3MIT-IBM Watson AI Lab, IBM Research. Correspondence to: Abhin Shah , Yuheng Bu . + +Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s). + +trustworthiness of such systems. An important attribute of a trustworthy ML system is to reliably estimate the uncertainty in its predictions. For example, consider a loan approval ML system where the prediction task is to suggest appropriate loan terms (e.g., loan approval, interest rate). If the model's uncertainty in its prediction is high for an applicant, the prediction can be rejected to avoid potentially costly errors. The users of the system, i.e., the decision-maker, can intervene, and take remedial actions such as gathering more information for applicants with rejected model predictions or involving a special human credit committee before arriving at a decision. This paradigm is known as prediction with reject-option or selective prediction. + +By making the tolerance for uncertainty more stringent, the user expects the error rate of the predictions made by the system to decrease as the system makes predictions for fewer samples, i.e., as coverage is reduced. Although the error may lessen over the entire population, (Jones et al., 2020) demonstrated that for selective classification, this may not be true for different sub-populations. In other words, selective classification could magnify disparities across different sensitive groups (e.g., race, gender). For example, in the loan approval ML system, the error rate for a sensitive group could increase with a decrease in coverage. To mitigate such disparities, (Lee et al., 2021; Schreuder & Chzhen, 2021) proposed methods for performing fair selective classification. + +In this work, we demonstrate and investigate the performance disparities across different subgroups for selective regression as well as develop novel methods to mitigate such disparities. Similar to (Lee et al., 2021), we do not assume access to the identity of sensitive groups at test time. Compared to selective classification, one major challenge to tackling the aforementioned disparities in selective regression is as follows: in selective classification, generating an uncertainty measure (i.e., the model's uncertainty for its prediction) from an existing classifier is straightforward. For example, one could take the softmax output of an existing classifier as an uncertainty measure. In contrast, there is no direct method to extract an uncertainty measure from an existing regressor designed only to predict the conditional mean. + +Contributions. First, we show via the Insurance dataset and a toy example that selective regression, like selective classification, can decrease the performance of some subgroups when coverage (the fraction of samples for which a decision is made) is reduced (see Section 3.1). + +1. Motivated by this, we provide a novel fairness criteria (Definition 1) for selective regression, namely, monotonic selective risk, which requires the risk of each subgroup to monotonically decrease with a decrease in coverage (see Section 3.2). +2. We prove that if a feature representation satisfies the standard sufficiency criterion or is calibrated for mean and variance (Definition 2), then the monotonic selective risk criteria is met (see Theorem 4.1 and 4.2). +3. We provide two neural network-based algorithms: one to impose the sufficiency criterion by regularizing an upper bound of conditional mutual information under a Gaussian assumption (see Section 5.1) and the other to impose the calibration for mean and variance by regularizing a contrastive loss (see Section 5.2). +4. Finally, we empirically1 demonstrate the effectiveness of these algorithms on real-world datasets (see Section 6). + +# 2. Background + +# 2.1. Fair Regression + +In standard (supervised) regression, given pairs of input variables $X \in \mathcal{X}$ (e.g., demographic information) and target variable $Y \in \mathbb{R}$ (e.g., annual medical expenses), we want to find a predictor $f: \mathcal{X} \to \mathbb{R}$ that best estimates the target variable for new input variables. Formally, given a set of predictors $\mathcal{F}$ and a set of training samples of $X$ and $Y$ , i.e., $\{(x_1, y_1), \ldots, (x_n, y_n)\}$ , the goal is to construct $f^* \in \mathcal{F}$ which minimizes the mean-squared error (MSE): + +$$ +f ^ {*} = \underset {f \in \mathcal {F}} {\arg \min } \mathbb {E} [ (Y - f (X)) ^ {2} ]. \tag {1} +$$ + +In fair regression, we augment the goal in (1) by requiring our predictor to retain "fairness" w.r.t. some sensitive attributes $D \in \mathcal{D}$ (e.g., race, gender). For example, we may want our predictions of annual medical expenses using the demographic information not to discriminate w.r.t. race. + +In this work, we assume $D$ to be discrete and consider members with the same value of $D$ as being in the same subgroup. While numerous criteria have been proposed to enforce fairness in machine learning, we focus on the notion of subgroup risks (Williamson & Menon, 2019), which ensures that the predictor $f$ behaves similarly (in terms of risks) across all subgroups. This notion, also known as accuracy disparity, has been used frequently + +in fair regression, e.g., (Chzhen & Schreuder, 2020; Chi et al., 2021), and has also received attention in the field of domain generalization, e.g., (Krueger et al., 2021). Formally, given a set of training samples of $X$ , $Y$ , and $D$ , i.e., $\{(x_{1},y_{1},d_{1}),\ldots ,(x_{n},y_{n},d_{n})\}$ , the goal is to construct $f^{*}\in \mathcal{F}$ which minimizes the overall MSE subject to the subgroup MSE being equal for all subgroups: + +$$ +\begin{array}{l} f ^ {*} = \underset {f \in \mathcal {F}} {\arg \min } \mathbb {E} [ (Y - f (X)) ^ {2} ] \text {s . t} \forall d, d ^ {\prime} \in \mathcal {D}, \\ \mathbb {E} \left[ (Y - f (X)) ^ {2} \mid D = d \right] = \mathbb {E} \left[ (Y - f (X)) ^ {2} \mid D = d ^ {\prime} \right]. \tag {2} \\ \end{array} +$$ + +In this work, we consider the scenario where the sensitive attribute is available only during training i.e., we do not assume access to the sensitive attribute at test time. + +# 2.2. Selective Regression + +In selective regression, given pairs of input variables $X \in \mathcal{X}$ and target variable $Y \in \mathbb{R}$ , for new input variables, the system has a choice to: (a) make a prediction of the target variable or (b) abstain from a prediction (if it is not sufficiently confident). In the example of predicting annual medical expenses, we may prefer abstention in certain scenarios to avoid harms arising from wrong predictions. By only making predictions for those input variables with low prediction uncertainty, the performance (in terms of MSE) is expected to improve. Formally, in addition to a predictor $f: \mathcal{X} \to \mathbb{R}$ that best estimates the target variable for new input variables, we need to construct a rejection rule $\Gamma: \mathcal{X} \to \{0,1\}$ that decides whether or not to make a prediction for new input variables. Thereafter, for $X = x$ , the system outputs $f(x)$ as the prediction when $\Gamma(x) = 1$ , and makes no prediction if $\Gamma(x) = 0$ . + +There are two quantities that characterize the performance of selective regression: (i) coverage, i.e., the fraction of samples that the system makes predictions on, which is denoted by $c(\Gamma) = \mathbb{P}(|\Gamma(X)| = 1)$ and (ii) the MSE when prediction is performed + +$$ +\mathbb {E} [ (Y - f (X)) ^ {2} | \Gamma (X) = 1 ]. +$$ + +In order to construct a rejection rule $\Gamma$ , we need some measure of the uncertainty $g(\cdot)$ associated with a prediction $f(\cdot)$ . Then, the rejection rule $\Gamma$ can be defined as: + +$$ +\Gamma (x) := \left\{ \begin{array}{l l} 1, & \text {i f} g (x) \leq \tau \\ 0, & \text {o t h e r w i s e .} \end{array} \right. +$$ + +where $\tau$ is the parameter that balances the MSE vs. coverage tradeoff: larger $\tau$ results in a larger coverage but also yields a larger MSE. Therefore, $\tau$ can be interpreted as the cost for not making predictions. As discussed in (Zaoui et al., 2020), a natural choice for the uncertainty measure $g(\cdot)$ could be the conditional variance of $Y$ given $X$ . + +The goal of selective regression is to build a model with (a) high coverage and (b) low MSE. However, there may not exist any $\tau$ for which both (a) and (b) are satisfied simultaneously. Therefore, in practice, the entire MSE vs. coverage tradeoff curve is generated by sweeping over all possible values of $\tau$ allowing the system designer to choose any convenient operating point. + +# 2.3. Related Work + +Selective Regression. While selective classification has received a lot of attention in the machine learning community (Chow, 1957; 1970; Hellman, 1970; Herbei & Wegkamp, 2006; Bartlett & Wegkamp, 2008; Nadeem et al., 2009; Lei, 2014; Geifman & El-Yaniv, 2017), there is very limited work on selective regression. It is also known that existing methods for selective classification cannot be used directly for selective regression (Jiang et al., 2020). (Wiener & El-Yaniv, 2012) studied regression with reject option to make predictions inside a ball of small radius around the regression function with high probability. (Geifman & El-Yaniv, 2019) proposed SelectiveNet, a neural network with an integrated reject option, to optimize both classification (or regresssion) performance and rejection rate simultaneously. (Zaoui et al., 2020) considered selective regression with a fixed rejection rate and derived the optimal rule which relies on thresholding the conditional variance. (Jiang et al., 2020) analyzed selective regression with the goal to minimize the rejection rate given a regression risk bound. We emphasize that none of these works study the question of fairness in selective regression. + +Fair Regression. (Calders et al., 2013), one of the first works on fair regression, studied linear regression with constraints on the mean outcome or residuals of the models. More recently, several works including (Berk et al., 2017; Pérez-Suay et al., 2017; Komiyama & Shimao, 2017; Komiyama et al., 2018; Fitzsimons et al., 2018; Raff et al., 2018; Agarwal et al., 2019; Nabi et al., 2019; Oneto et al., 2020) considered fair regression employing various fairness criteria. (Mary et al., 2019) and (Lee et al., 2020) enforced independence between prediction and sensitive attribute by ensuring that the maximal correlation is below a fixed threshold. (Chzhen et al., 2020) considered learning an optimal regressor requiring the distribution of the output to remain the same conditioned on the sensitive attribute. We emphasize that none of these works could be used for selective regression as they are designed to only predict the conditional mean and not the conditional variance (i.e., the uncertainty). + +Fairness Criteria. Numerous metrics and criteria have been proposed to enforce fairness in machine learning (Verma & Rubin, 2018). Many of these criteria are mutually + +exclusive outside of trivial cases (Gölz et al., 2019). Further, the existing approaches also differ in the way they enforce these criteria: (a) pre-processing methods (Zemel et al., 2013; Louizos et al., 2015; Calmon et al., 2017) modify the training set to ensure fairness of any learned model, (b) post-processing methods (Hardt et al., 2016; Pleiss et al., 2017; Corbett-Davies et al., 2017) transform the predictions of a trained model to satisfy a measure of fairness, and (c) in-processing methods (Kamishima et al., 2011; Zafar et al., 2017; Agarwal et al., 2018) modify the training process to directly learn fair predictors e.g., minimizing a loss function that accounts for both accuracy and fairness as in (2). Additionally, these criteria also differ in the kind of fairness they consider (see (Mehrabi et al., 2021; Castelnovo et al., 2022) for details): (a) group fairness ensures that subgroups that differ by sensitive attributes are treated similarly and (b) individual fairness ensures that individuals who are similar (with respect to some metric) are treated similarly. In this work, we consider group fairness and propose a novel fairness criteria specific to selective regression. Our approach falls under the umbrella of in-processing methods as will be evident in Section 5 (see (5), (8), and (9)). + +# 3. Fair Selective Regression + +While fair regression and selective regression have been independently studied before, consideration of fair selective regression (i.e., selective regression while ensuring fairness) is missing in the literature. In this section, we explore the disparities between different subgroups that may arise in selective regression. Building on top of this, we formulate a notion of fairness for selective regression. + +# 3.1. Disparities in Selective Regression + +(Jones et al., 2020) argued that, in selective classification, increasing abstentions (i.e., decreasing coverage) could decrease accuracies on some subgroups and observed this behavior for CelebA dataset. In this section, we show that a similar phenomenon can be observed in selective regression. + +Insurance dataset. Consider the task of predicting the annual medical expenses charged to patients from input variables such as age, BMI, number of children, etc., as in Insurance dataset. Suppose we construct our predictor as the conditional expectation and our uncertainty measure as the conditional variance following (Zaoui et al., 2020). Then, generating the subgroup MSE vs. coverage tradeoff curve across the subgroups induced by gender, as shown in Figure 1a, we see that while decreasing the coverage improves the performance for the majority subgroup (i.e., females), the performance for the minority subgroup (i.e., males) + +![](images/4a7f5f6863ec39463c6efd89e8641d5e60b10d0c7b449493703bd5fa9df1b0e1.jpg) +(a) The disparity for the Insurance dataset when the predictor is the conditional expectation and the uncertainty measure is the conditional variance. + +![](images/b58cfeb8d60189486f615108d9483096b049230a2afd9caede054f5352b2178a.jpg) +(b) The disparity for toy example when the predictor is the conditional expectation and the uncertainty measure is the conditional variance of $Y$ given $X_{1}$ and $X_{2}$ . + +![](images/df423f7dfc5c21ece0e984a2e32d6a78b662f5ee1e4269ce1216fd3b3ac55e66.jpg) +(c) The disparity could be mitigated for toy example when the predictor is the conditional expectation and the uncertainty measure is the conditional variance of $Y$ given $X_{1}$ . +Figure 1: Subgroup MSE vs. coverage to illustrate disparities in selective regression via Insurance dataset and toy example. + +degrades. Thus, unknowingly, selective regression can magnify disparities between different sensitive subgroups. + +Motivated to further understand this phenomenon, we explicitly recreate it via the following toy example. + +Toy example. Consider predicting $Y$ from two normalized input variables $X_{1}$ and $X_{2}$ that are generated i.i.d. from the uniform distribution over [0, 1]. Suppose we have a binary sensitive attribute $D$ with $\mathbb{P}(D = 0) = 0.9$ , where $D = 0$ represents majority and $D = 1$ represents minority. To illustrate the disparities that may arise in selective regression, we let the distribution of $Y$ differ with $D$ . More specifically, for majority subgroup, we let the target be + +$$ +Y \mid_ {D = 0} = X _ {1} + X _ {2} + \mathcal {N} (0, 0. 1 X _ {1} + 0. 1 5 X _ {2}) +$$ + +and, for minority subgroup, we let the target be + +$$ +Y \mid_ {D = 1} = X _ {1} + X _ {2} + \mathcal {N} (0, 0. 1 X _ {1} + 0. 1 5 (1 - X _ {2})). +$$ + +To summarize, the only difference is that for the majority, the variance of $Y$ increases in $X_{2}$ , and for the minority, the variance of $Y$ decreases in $X_{2}$ . + +In this case, the conditional variance $\operatorname{Var}(Y|X)$ , i.e., our uncertainty measure would mainly capture the behavior of the majority subgroup $D = 0$ , i.e., the subgroup with more samples. Since $\operatorname{Var}(Y|X, D = 0)$ differs significantly from $\operatorname{Var}(Y|X, D = 1)$ , $\operatorname{Var}(Y|X)$ may not be a good measure of uncertainty for the minority subgroup $D = 1$ . As a result, for minority subgroup, when we decrease the coverage, we may make predictions on samples that erroneously achieve low uncertainty based on $\operatorname{Var}(Y|X)$ . This results in an increase in the MSE for the subgroup $D = 1$ (Figure 1b). + +An alternative could be to use the conditional variance of $Y$ given $X_{1}$ (instead of both $X_{1}$ and $X_{2}$ ) as our uncertainty measure. While this may be a slightly worse measure of uncertainty for $D = 0$ than $\operatorname{Var}(Y|X)$ , it is a much better measure of uncertainty for $D = 1$ . All in all, using this + +uncertainty measure, when we decrease the coverage, we make predictions on samples with low uncertainty for all subgroups resulting in a decrease in the MSE for every subgroup as shown in Figure 1c (albeit at the cost of a slight increase in the overall MSE). + +It is important to note that the toy example is designed to highlight the disparities when the uncertainty measure, a component of selective regression, is designed unfairly. The disparities could generally occur due to the predictor or the uncertainty measure (or both). + +# 3.2. When is Selective Regression Fair? + +Motivated by the disparities (that may arise) in selective regression, as shown above, we define the first notion of fairness for selective regression, which is called monotonic selective risk. This notion requires our predictor and uncertainty measure to ensure the primary goal of selective regression that the subgroup MSE decreases monotonically with a decrease in coverage for every subgroup. The subgroup MSE for $d \in \mathcal{D}$ , as a function of the predictor $f$ and the uncertainty measure $g$ , for a fixed coverage (parameterized by $\tau$ ) is given by + +$$ +\operatorname {M S E} (f, g, \tau , d) = \mathbb {E} [ (Y - f (X)) ^ {2} | g (X) \leq \tau , D = d ]. +$$ + +Now, we formalize the criteria of monotonic selective risk which ensures that no subgroup is discriminated against when the coverage is reduced in selective regression. + +Definition 1. We say that a predictor $f$ and an uncertainty measure $g$ satisfy monotonic selective risk if for any $\tau < \tau'$ + +$$ +\operatorname {M S E} (f, g, \tau , d) \leq \operatorname {M S E} (f, g, \tau^ {\prime}, d) \forall d \in \mathcal {D}. +$$ + +Inspired by the success of representation based learning in machine learning (Bengio et al., 2013), we seek to find a representation $\Phi : \mathcal{X} \to \mathcal{H}$ that maps the input variable $X \in \mathcal{X}$ to an intermediate representation $\Phi(X) \in \mathcal{H}$ and + +use $\Phi(X)$ to construct our predictor $f: \mathcal{H} \to \mathbb{R}$ and our uncertainty measure $g: \mathcal{H} \to \mathbb{R}_{\geq 0}$ . Then, for $X = x$ , our prediction and uncertainty measure are (with a slight abuse of notation) $f(\Phi(x))$ and $g(\Phi(x))$ respectively. + +# 4. Theoretical Results + +In this section, we show that under certain conditions on the feature representation $\Phi$ , the conditional mean as the predictor and the conditional variance as the uncertainty measure satisfy monotonic selective risk (Definition 1). + +# 4.1. Sufficiency + +The sufficiency criterion requires $Y \perp D|\Phi(X)$ , i.e., the learned representation $\Phi(X)$ completely subsumes all information about the sensitive attribute that is relevant to the target variable (Cleary, 1966). Sufficiency is closely tied with learning domain-invariant feature representation (Arjovsky et al., 2019; Creager et al., 2021) and has been used in fair selective classification (Lee et al., 2021). + +The theorem below shows that if the feature representation is sufficient, then the choice of conditional mean as the predictor and the conditional variance as the uncertainty measure ensures the fairness criteria of monotonic selective risk, i.e., the subgroup MSE decreases monotonically with coverage for all subgroups. See Appendix A for a proof. + +Theorem 4.1. Suppose the representation $\Phi(X)$ is sufficient i.e., $Y \perp D|\Phi(X)$ . Let $f(\Phi(X)) = \mathbb{E}[Y|\Phi(X)]$ and $g(\Phi(X)) = \operatorname{Var}[Y|\Phi(X)]$ . Then, for any $d \in \mathcal{D}$ and any $\tau < \tau'$ , we have $\operatorname{MSE}(f, g, \tau, d) < \operatorname{MSE}(f, g, \tau', d)$ . + +# 4.2. Calibration for mean and variance + +In practice, the conditional independence $Y \perp D|\Phi(X)$ required by sufficiency may be too difficult to satisfy. Since we only care about MSE, which depends on the first and second-order moments, one could relax the sufficiency condition by requiring the representation $\Phi$ to be such that these moments are the same across all subgroups. This inspires our notion of $\Phi$ calibrated for mean and variance. + +Definition 2. We say a representation $\Phi(X)$ is calibrated for mean and variance if + +$$ +\begin{array}{l} \mathbb {E} [ Y | \Phi (X), d ] = \mathbb {E} [ Y | \Phi (X) ] \forall d \in \mathcal {D}, \\ \operatorname {V a r} [ Y | \Phi (X), d ] = \operatorname {V a r} [ Y | \Phi (X) ] \forall d \in \mathcal {D}. \\ \end{array} +$$ + +The theorem below shows that if the feature representation is calibrated for mean and variance, then the choice of + +conditional mean as the predictor and the conditional variance as the uncertainty measure ensures the fairness criteria of monotonic selective risk, i.e., the subgroup MSE decreases monotonically with coverage for all subgroups. The proof is similar to the proof of Theorem 4.1 and is omitted. + +Theorem 4.2. Suppose the representation $\Phi(X)$ is calibrated for mean and variance. Let $f(\Phi(X)) = \mathbb{E}[Y|\Phi(X)]$ and $g(\Phi(X)) = \operatorname{Var}[Y|\Phi(X)]$ . Then, for any $d \in \mathcal{D}$ and any $\tau < \tau'$ , we have $\mathrm{MSE}(f, g, \tau, d) < \mathrm{MSE}(f, g, \tau', d)$ . + +# 5. Algorithm Design + +In this section, we provide two neural network-based algorithms: one to impose sufficiency and the other to impose the calibration for mean and variance. + +# 5.1. Imposing sufficiency + +To simplify our algorithm when directly enforcing sufficiency, we utilize the framework of heteroskedastic neural network (Gal, 2016). A heteroskedastic neural network, which requires training only a single neural network, assumes that the distribution of $Y$ conditioned on $X$ is Gaussian. Then, it is trained by minimizing the negative log likelihood: + +$$ +L _ {G} (\Phi , \theta) \triangleq - \sum_ {i = 1} ^ {n} \log \mathbb {P} _ {G} (y _ {i} | \Phi (x _ {i}); \theta) +$$ + +where $\mathbb{P}_G(y|\Phi (x);\theta)$ represents a Gaussian distribution with $f(\Phi (x);\theta_{f})$ and $g(\Phi (x);\theta_{g})$ as the conditional mean and the conditional variance (of $Y$ given $\Phi (X)$ ) respectively. The feature representation $\Phi$ is parameterized by $\theta_{\Phi}$ and the neural network is supposed to learn the parameters $\theta_{\Phi}$ and $\theta = (\theta_f,\theta_g)$ . + +To impose sufficiency, we augment minimizing the negative log likelihood as follows: + +$$ +\min _ {\theta , \Phi} L _ {G} (\Phi , \theta), \quad \text {s . t .} \quad Y \perp D | \Phi (X). +$$ + +To relax the hard constraint of $Y \perp D|\Phi(X)$ into a soft constraint, we use the conditional mutual information, since $Y \perp D|\Phi(X)$ is equivalent to $I(Y;D|\Phi(X)) = 0$ . For $\lambda \geq 0$ , + +$$ +\min _ {\theta , \Phi} L _ {G} (\Phi , \theta) + \lambda I (Y; D | \Phi (X)). +$$ + +As discussed in (Lee et al., 2021), existing methods using mutual information for fairness are ill-equipped to handle conditioning on the feature representation $\Phi(\cdot)$ . Therefore, we further relax the soft constraint by using the following + +Algorithm 1 Heteroskedastic neural network with sufficiency-based regularizer +Input: training samples $\{(x_i,y_i,d_i)\}_{i = 1}^n$ , regularizer $\lambda$ +Draw: $\{\widetilde{d}_1,\ldots ,\widetilde{d}_n\}$ drawn i.i.d. from $\hat{\mathbb{P}}_D$ +Initialize: $\theta ,\theta_{\Phi}$ , and $w^{(d)}$ with pre-trained models +Initialize: $n_d =$ number of samples in group $d,\forall d\in \mathcal{D}$ +for each training iteration do for each batch do for $d = 1,\dots ,|\mathcal{D}|$ do # update subgroup-specific mean/variance predictor $w^{(d)}\gets w^{(d)} - \frac{1}{nd}\eta_w\nabla_wL_d(w)$ end for end for for each batch do # update feature extractor $\theta_{\Phi}\gets \theta_{\Phi} - \frac{1}{n}\eta \nabla_{\theta_{\Phi}}(L_G(\Phi ,\theta) + \lambda L_R(\Phi))$ # update mean/variance predictor $\theta \leftarrow \theta -\frac{1}{n}\eta \nabla_{\theta}L_{G}(\Phi ,\theta)$ end for end for + +upper bound for $I(Y;D|\Phi (X))$ from (Lee et al., 2021): + +$$ +\begin{array}{l} I (Y; D | \Phi (X)) \leq \mathbb {E} _ {\Phi (X), Y, D} [ \log \mathbb {P} (Y | \Phi (X), D) ] \tag {3} \\ - \mathbb {E} _ {D} \left[ \mathbb {E} _ {\Phi (X), Y} \left[ \log \mathbb {P} (Y | \Phi (X), D) \right] \right]. \\ \end{array} +$$ + +where equality is achieved if and only if $Y \perp D \mid \Phi(X)$ . + +In order to compute the upper bound in (3), we need to learn the unknown distribution $\mathbb{P}(y|\Phi(x), d)$ . We approximate this by $\mathbb{P}_G(y|\Phi(x), d; w)$ which is a Gaussian distribution with $f(\Phi(x), d; w_f)$ and $g(\Phi(x), d; w_g)$ as the conditional mean and the conditional variance of $Y$ given $\Phi(X)$ and $D$ , respectively. The neural network is supposed to learn the parameters $w = (w_f, w_g)$ . + +In scenarios where $\Phi(X)$ is high-dimensional compared to $D$ , it would be preferred to approximate $\mathbb{P}_G(y|\Phi(x), d; w)$ by $\mathbb{P}_G(y|\Phi(x); w^{(d)})$ , i.e., train a subgroup-specific Gaussian model with parameters $w^{(d)}$ for each $d \in \mathcal{D}$ instead of using $D$ as a separate input to ensure that $D$ has an effect in $\mathbb{P}_G(y|\Phi(x), d; w)$ . Then, for $d \in \mathcal{D}$ , + +$$ +w ^ {(d)} = \underset {w} {\arg \min } L _ {d} (w), \quad \text {w h e r e} \tag {4} +$$ + +$$ +L_{d}(w)\triangleq -\sum_{i:d_{i} = d}\log \mathbb{P}_{G}(y_{i}|\Phi (x_{i});w). +$$ + +To summarize, the first term of the upper bound in (3) is approximated by the log-likelihood of the training samples using $\mathbb{P}_G(y|\Phi (x);w^{(d_i)})$ for each subgroup $d_{i}\in \mathcal{D}$ (i.e., subgroup-specific loss). Then, drawing $\widetilde{d}_i$ i.i.d from $\mathbb{P}_D$ i.e., the marginal distribution of $D$ (which could be approximated by $\hat{\mathbb{P}}_D$ ), the second term of the upper bound in (3) is approximated by the negative log-likelihood + +of the samples using the randomly-selected Gaussian model $\mathbb{P}_G(y|\Phi (x);w^{(\widetilde{d}_i)})$ for each subgroup $\widetilde{d}_i\in \mathcal{D}$ (i.e., subgroup-agnostic loss). Combining everything and replacing all the expectations in (3) with empirical averages, the regularizer is given by + +$$ +L _ {R} (\Phi) \triangleq \sum_ {i = 1} ^ {n} \log \left(\frac {\mathbb {P} _ {G} (y _ {i} | \Phi (x _ {i}) ; w ^ {(d _ {i})})}{\mathbb {P} _ {G} (y _ {i} | \Phi (x _ {i}) ; w ^ {(\widetilde {d} _ {i})})}\right), +$$ + +where $\widetilde{d_i}$ are drawn i.i.d. from the marginal distribution $\hat{\mathbb{P}}_D$ . Summarizing, the overall objective is + +$$ +\min _ {\theta , \Phi} L _ {G} (\Phi , \theta) + \lambda L _ {R} (\Phi). \tag {5} +$$ + +As shown in Algorithm 1, we train our model by alternating between the fitting subgroup-specific models in (4) and feature updating in (5). + +# 5.2. Imposing calibration for mean and variance + +To achieve the calibration for mean and variance, we let the representation $\Phi = (\Phi_1, \Phi_2)$ . Then, to enable the use of the residual-based neural network (Hall & Carroll, 1989), we let the conditional expectation depend only on $\Phi_1$ i.e., $f(\Phi(X)) = f(\Phi_1(X))$ and let the conditional variance depend only on $\Phi_2$ i.e., $g(\Phi(X)) = g(\Phi_2(X))$ . This method is useful in scenarios where the conditional Gaussian assumption in the Section 5.1 does not hold. + +In a residual-based neural network, the conditional mean-prediction network is trained by minimizing: + +$$ +L _ {S 1} \left(\Phi_ {1}, \theta_ {f}\right) \triangleq \sum_ {i = 1} ^ {n} \left(y _ {i} - f \left(\Phi_ {1} \left(x _ {i}\right); \theta_ {f}\right)\right) ^ {2}. +$$ + +The feature representation $\Phi_1$ is parameterized by $\theta_{\Phi_1}$ and the mean-prediction network is supposed to learn the parameters $\theta_{\Phi_1}$ and $\theta_f$ . + +Then, the conditional variance-prediction network is trained by fitting the residuals obtained from the mean-prediction network, i.e., $r_i \triangleq (y_i - f(\Phi_1(x_i); \theta_f))^2$ by minimizing: + +$$ +L _ {S 2} \left(\Phi_ {2}, \theta_ {g}\right) \triangleq \sum_ {i = 1} ^ {n} \left(r _ {i} - g \left(\Phi_ {2} \left(x _ {i}\right); \theta_ {g}\right)\right) ^ {2}. +$$ + +The feature representation $\Phi_2$ is parameterized by $\theta_{\Phi_2}$ and the variance-prediction network is supposed to learn the parameters $\theta_{\Phi_2}$ and $\theta_g$ . + +To impose calibration under mean, we need to convert the following hard constraint + +$$ +\mathbb {E} [ Y | \Phi_ {1} (X), D ] = \mathbb {E} [ Y | \Phi_ {1} (X) ] \tag {6} +$$ + +into a soft constraint. We do this by using the following contrastive loss: + +$$ +\begin{array}{l} \mathbb {E} _ {D} \left[ \mathbb {E} _ {\Phi (X), Y} \left[ (Y - \mathbb {E} [ Y | \Phi_ {1} (X), D ]) ^ {2} \right] \right] \\ \left. - \mathbb {E} _ {\Phi (X), Y, D} \left[ \left(Y - \mathbb {E} [ Y | \Phi_ {1} (X), D ]\right) ^ {2} \right], \quad (7) \right. \\ \end{array} +$$ + +which is inspired from (3) and obtained by replacing the negative log-likelihood $-\log \mathbb{P}(Y|\Phi(X), D)$ in (3) by the MSE achieved using the representation $\Phi_1(X)$ and sensitive attribute $D$ . We emphasize that (7) is zero when (6) holds and therefore (7) is a relaxation of (6). + +To compute (7), we need to learn the unknown conditional expectation $\mathbb{E}[Y|\Phi_1(X),D]$ . Similar to Section 5.1, we approximate this by $f(y|\Phi_1(x);w_f^{(d)})$ (i.e., train a subgroup-specific mean-prediction model with parameters $w_{f}^{(d)}$ for each $d\in \mathcal{D}$ , instead of using $D$ as a separate input). Similar to Section 5.1, combining everything and replacing all the expectations in (7) with empirical averages, the regularizer for the mean-prediction network is given by + +$$ +\begin{array}{l} L _ {R 1} \left(\Phi_ {1}\right) \triangleq \sum_ {i = 1} ^ {n} \left(\left(y _ {i} - f \left(\Phi_ {1} \left(x _ {i}\right); w _ {f} ^ {\left(\widetilde {d} _ {i}\right)}\right)\right) ^ {2} \right. \\ \left. - \left(y _ {i} - f \left(\Phi_ {1} \left(x _ {i}\right); w _ {f} ^ {(d _ {i})}\right)\right) ^ {2}\right), \\ \end{array} +$$ + +where $\widetilde{d_i}$ are drawn i.i.d. from $\mathbb{P}_D$ i.e., the marginal distribution of $D$ (approximated by $\hat{\mathbb{P}}_D$ ) and for $d\in \mathcal{D}$ , + +$$ +w _ {f} ^ {(d)} = \arg \min _ {w} \sum_ {i: d _ {i} = d} \left(y _ {i} - f (\Phi_ {1} (x _ {i}); w)\right) ^ {2}. +$$ + +In summary, the overall objective for mean-prediction is + +$$ +\min _ {\theta_ {f}, \Phi_ {1}} L _ {S 1} \left(\Phi_ {1}, \theta_ {f}\right) + \lambda_ {1} L _ {R 1} \left(\Phi_ {1}\right). \tag {8} +$$ + +Once the mean-prediction network is trained, we obtain the residuals and train the variance-prediction network $g$ using a similar regularizer: + +$$ +\min _ {\theta_ {g}, \Phi_ {2}} L _ {S 2} \left(\Phi_ {2}, \theta_ {g}\right) + \lambda_ {2} L _ {R 2} \left(\Phi_ {2}\right), \tag {9} +$$ + +where $L_{S2}$ and $L_{R2}$ are defined in a similar manner as $L_{S1}$ and $L_{R1}$ . More details about these and the pseudo-code (i.e., Algorithm 2) are provided in the Appendix B. + +# 6. Experimental Results + +Datasets. We test our algorithms on Insurance and Crime datasets, and provide an application of our method in Causal Inference via IHDP dataset. These datasets (summarized in Table 1) are selected due to their potential fairness concerns, e.g., (a) presence of features often associated with possible discrimination, such as race and sex, and (b) potential sensitivity regarding the predictions being made such as medical expenses, violent crimes, and cognitive test score. + +Table 1: Summary of datasets. + +
DatasetTargetAttribute
InsuranceMedical ExpensesSex
CrimeCrimes per PopulationRace
IHDPCognitive Test ScoreSex
+ +Insurance. The Insurance dataset (Lantz, 2019) considers predicting total annual medical expenses charged to patients using demographic statistics. Following (Chi et al., 2021), we use sex as the sensitive attribute: $D = 1$ (i.e., minority) if male otherwise 0. After preprocessing (see Appendix C), the dataset contains 1000 samples (338 with $D = 1$ and 662 with $D = 0$ ) and 5 features. + +Communities and Crime. The Crime dataset (Redmond & Baveja, 2002) considers predicting the number of violent crimes per 100K population using socio-economic information of communities in U.S. Following (Chi et al., 2021), we use race (binary) $^4$ as the sensitive attribute: $D = 1$ (i.e., minority) if the population percentage of the black is more or equal to 20 otherwise 0. After preprocessing (see Appendix C), the dataset contains 1994 samples (532 with $D = 1$ and 1462 with $D = 0$ ) and 99 features. + +IHDP. The IHDP dataset (Hill, 2011) is generated based on a randomized control trial targeting low-birth-weight, premature infants. In the treated group, the infants were provided with both intensive and high-quality childcare and specialist home visits. The task is to predict the infants' cognitive test scores. We let sex be the sensitive attribute and observe that male is the minority group (i.e., $D = 1$ ) in both the control group and the treatment group. After preprocessing (see Appendix C), the control group has 608 samples (296 with $D = 1$ and 312 with $D = 0$ ) and the treatment group has 139 samples (67 with $D = 1$ and 72 with $D = 0$ ). The dataset contains 25 features. + +Choice of $\lambda$ . We observe our algorithms to be agnostic to the choice of $\lambda$ as long as it is in a reasonable range, i.e., $\lambda \in [0.5, 3]$ . To be consistent, we set $\lambda = 1$ throughout. + +Baselines. We compare against the following baselines: + +- Baseline 1: Heteroskedastic neural network without any regularizer i.e., Algorithm 1 with $\lambda = 0$ . +- Baseline 2: Residual-based neural network without any regularizer i.e., Algorithm 2 with $\lambda = 0$ . + +Experimental Details. In all of our experiments, we use two-layer neural networks, and train our model only once on a fixed training set. We evaluate and report the empirical findings on a held-out test set with a train-test split ratio + +![](images/4f78b01c2e289c6d86919a987f3fd8f23923b89f04b078828b8c0047e3b5b92b.jpg) + +![](images/ff124f89913a3548f20d5c443d9254577562909d390a939d48182904b5140aaf.jpg) +(c) Performance of Baseline 1 for the Crime dataset. + +![](images/5dbff789d23ca061f774c1f89ff28962b034fc0a824e26502a2c7740f95b8a64.jpg) + +![](images/0a57beb419f6f03106c7e28dcbe6474979dc9ebc3ac37b755a97ae022b2f45be.jpg) +(a) Performance of Baseline 2 for the Insurance dataset. +(b) Performance of Algorithm 2 for the Insurance dataset. + +![](images/17f8c4aae7cc6a46ddea47a400106bf2d0f1bfec070d53c885e269f99e74b16c.jpg) +(d) Performance of Algorithm 1 for the Crime dataset. + +![](images/d0f08153d4a059f336c4f80e768d5da8e92a438eb45f92c5789f9383d4091c9a.jpg) +(e) Performance of Baseline 1 for the IHDP (treatment) dataset. +(f) Performance of Algorithm 1 for the IHDP (treatment) dataset. +Figure 2: Subgroup MSE vs. coverage plots. Compared to baselines (top), our algorithms (bottom) (a) show a consistent trend of decreasing MSE with decrease in coverage for both subgroups, (b) achieve better minority MSE for fixed coverage, i.e., a smaller AUC for minority subgroup (red), (c) achieve comparable majority MSE for fixed coverage, i.e., a comparable AUC for majority subgroup (green), (d) reduce gap between the subgroup MSE curves, i.e., a smaller AUADC. + +of 0.8/0.2. More experimental details can be found in Appendix C. + +Comparison in terms of selective regression. To compare different algorithms in terms of how well they perform selective regression (i.e., without fairness), we look at area under MSE vs. coverage curve (AUC), which encapsulates performance across different coverage (Franc & Prusa, 2019; Lee et al., 2021). We provide the results in Table 2 (smaller AUC indicates better performance) and observe that our algorithms are competitive (if not better) than baselines. We provide MSE vs. coverage curves in Appendix C. + +Comparison in terms of fairness. To compare different algorithms in terms of fair selective regression, we look at subgroup MSE vs coverage curves. for the Insurance dataset, we show these curves for Baseline 2 in Figure 2a and Algorithm 2 in Figure 2b. for the Crime dataset, we show these curves for Baseline 1 in Figure 2c and Algorithm 1 in Figure 2d. See Appendix C for remaining set of curves. + +For the Insurance dataset, we see that subgroup MSE for Baseline 2 increases with decrease in coverage for both majority and minority subgroups (Figure 2a). In contrast, the subgroup MSE for Algorithm 2 tends to decrease with a decrease in coverage for both subgroups (Figure 2b). For the Crime dataset, we see that the subgroup + +MSE for Baseline 1 as well as Algorithm 1 tends to decrease with a decrease in coverage for both subgroups (Figure 2c and Figure 2d). However, for a particular coverage, Algorithm 1 achieves a better MSE for the minority subgroup, a comparable MSE for the majority subgroup, and reduces the gap between the subgroup curves than Baseline 1. + +As hinted above, in addition to ensuring monotonic selective risk, one may wish to (a) achieve a better performance focusing solely on the majority subgroup, (b) achieve a better performance focusing solely on the minority subgroup, and (c) reduce the gap between the minority subgroup MSE and the majority subgroup MSE across all thresholds. These aspects could be quantitatively captured by looking at (a) the area under the majority MSE vs. coverage curve, i.e., AUC $(\mathrm{D} = 0)$ , (b) the area under the minority MSE vs. coverage curve, i.e., AUC $(\mathrm{D} = 1)$ , and (c) the area under the absolute difference of the subgroup MSE vs. coverage curves (AUADC) (Franc & Prusa, 2019; Lee et al., 2021) respectively. We provide these results in Table 2 and observe that our algorithms outperform the baselines across datasets in terms of AUC $(\mathrm{D} = 1)$ and AUADC while being comparable in terms of AUC $(\mathrm{D} = 0)$ . + +Application to Causal Inference. We provide an application of our work to fair-treatment effect estimation. + +Table 2: AUC, AUC (D=0), AUC (D=1), and AUADC (averaged across 5 runs) for all algorithms and all datasets. Smaller values are better. B1, B2, A1, and A2 refer to Baseline 1, Baseline 2, Algorithm 1, and Algorithm 2. See Appendix C for standard deviations. + +
DatasetAlgo-rithmAUCAUC (D=0)AUC (D=1)AUADC
InsuranceB10.03710.03420.04420.0069
A10.01950.02070.01670.0052
B20.01420.01290.01750.0079
A20.00990.00870.01200.0051
CrimeB10.00750.00400.03450.0309
A10.00790.00450.02960.0298
B20.01010.00600.04420.0272
A20.01170.00820.03750.0257
IHDP (Treatment)B10.30530.20000.35090.2266
A10.24350.20240.28490.2034
IHDP (Control)B10.20410.21440.19830.0495
A10.20170.21690.18770.0398
+ +Treatment effect estimation has been studied under the paradigm of prediction with reject option (Jesson et al., 2020), and we explore an additional dimension to this, i.e., the behavior across sub-populations. We follow the standard approach (Kunzel et al., 2019) of viewing the dataset as two distinct datasets — one corresponding to treatment group and the other corresponding to control group — and apply our framework to these distinct datasets. We focus only on Algorithm 1 (Hill, 2011) and compare with Baseline 1 since the simulated target for the IHDP dataset perfectly fits the conditional Gaussian assumption (Hill, 2011). For treatment group, we provide the subgroup MSE vs coverage behavior for Baseline 1 in Figure 2e and Algorithm 1 in Figure 2f. We provide corresponding curves for the control group in Appendix C. Compared to Baseline 1 (Figure 2e), Algorithm 1 (Figure 2f) (a) shows a general trend of decreasing MSE with decrease in coverage for both subgroups and (b) achieves a better minority MSE for a fixed coverage. Table 2 suggests that our algorithm outperforms the baseline in terms of AUC $(\mathrm{D} = 1)$ and AUADC while being comparable in AUC $(\mathrm{D} = 0)$ . + +# 7. Concluding Remarks + +We proposed a new fairness criterion, monotonic selective risk for selective regression, which requires the performance of each subgroup to improve with a decrease in coverage. We provided two conditions for the feature representation (sufficiency and calibrated for mean and variance) under which the proposed fairness criterion is met. We presented algorithms to enforce these conditions and demonstrated + +mitigation of disparity in the performances across groups for three real-world datasets. + +Monotonic selective risk is one criteria for fairness in selective regression. Developing and investigating other such criteria and understanding their relationship with monotonic selective risk is an important question for future research. + +# Acknowledgements + +We thank the anonymous reviewers for their comments and suggestions. This work was supported, in part, by the MIT-IBM Watson AI Lab, and its member companies Boston Scientific, Samsung, and Wells Fargo; and NSF under Grant No. CCF-1717610. + +# References + +Agarwal, A., Beygelzimer, A., Dudik, M., Langford, J., and Wallach, H. A reductions approach to fair classification. In International Conference on Machine Learning, pp. 60-69. PMLR, 2018. +Agarwal, A., Dudík, M., and Wu, Z. S. Fair regression: Quantitative definitions and reduction-based algorithms. In International Conference on Machine Learning, pp. 120-129. PMLR, 2019. +Arjovsky, M., Bottou, L., Gulrajani, I., and Lopez-Paz, D. Invariant risk minimization. arXiv preprint arXiv:1907.02893, 2019. +Bartlett, P. L. and Wegkamp, M. H. Classification with a reject option using a hinge loss. Journal of Machine Learning Research, 9(8), 2008. +Bellamy, R. K., Dey, K., Hind, M., Hoffman, S. C., Houde, S., Kannan, K., Lohia, P., Martino, J., Mehta, S., Mojsilovic, A., et al. AI Fairness 360: An extensible toolkit for detecting, understanding, and mitigating unwanted algorithmic bias. arXiv preprint arXiv:1810.01943, 2018. +Bengio, Y., Courville, A., and Vincent, P. Representation learning: A review and new perspectives. IEEE transactions on pattern analysis and machine intelligence, 35(8):1798-1828, 2013. +Berk, R., Heidari, H., Jabbari, S., Joseph, M., Kearns, M., Morgenstern, J., Neel, S., and Roth, A. A convex framework for fair regression. arXiv preprint arXiv:1706.02409, 2017. +Calders, T., Karim, A., Kamiran, F., Ali, W., and Zhang, X. Controlling attribute effect in linear regression. In 2013 IEEE 13th international conference on data mining, pp. 71-80. IEEE, 2013. +Calmon, F., Wei, D., Vinzamuri, B., Ramamurthy, K. N., and Varshney, K. R. Optimized pre-processing for discrimination prevention. In Advances in Neural Information Processing Systems, pp. 3992-4001, 2017. +Castelnovo, A., Crupi, R., Greco, G., Regoli, D., Penco, I. G., and Cosentini, A. C. A clarification of the nuances in the fairness metrics landscape. Scientific Reports, 12 (1):1-21, 2022. +Chi, J., Tian, Y., Gordon, G. J., and Zhao, H. Understanding and mitigating accuracy disparity in regression. arXiv preprint arXiv:2102.12013, 2021. +Chow, C. On optimum recognition error and reject tradeoff. IEEE Transactions on information theory, 16(1):41-46, 1970. + +Chow, C.-K. An optimum character recognition system using decision functions. IRE Transactions on Electronic Computers, (4):247-254, 1957. +Chzhen, E. and Schreuder, N. An example of prediction which complies with demographic parity and equalizes group-wise risks in the context of regression. arXiv preprint arXiv:2011.07158, 2020. +Chzhen, E., Denis, C., Hebiri, M., Oneto, L., and Pontil, M. Fair regression via plug-in estimator and recalibration with statistical guarantees. In NeurIPS 2020-34th Conference on Neural Information Processing Systems, 2020. +Cleary, T. A. Test bias: Validity of the scholastic aptitude test for negro and white students in integrated colleges ETS Research Bulletin Series, 1966(2):i-23, 1966. +Corbett-Davies, S., Pierson, E., Feller, A., Goel, S., and Huq, A. Algorithmic decision making and the cost of fairness In Proceedings of the 23rd acm sigkdd international conference on knowledge discovery and data mining, pp 797-806, 2017. +Creager, E., Jacobsen, J.-H., and Zemel, R. Environment inference for invariant learning. In International Conference on Machine Learning, pp. 2189-2200 PMLR, 2021. +Dorie, V. Npci: Non-parametrics for causal inference. 2016. URL https://github.com/vdorie/npci. +Fitzsimons, J., Ali, A., Osborne, M., and Roberts, S. Equality constrained decision trees: For the algorithmic enforcement of group fairness. arXiv preprint arXiv:1810.05041, 2018. +Franc, V. and Prusa, D. On discriminative learning of prediction uncertainty. In International Conference on Machine Learning, pp. 1963-1971. PMLR, 2019. +Gal, Y. Uncertainty in deep learning. 2016. +Geifman, Y. and El-Yaniv, R. Selective classification for deep neural networks. In Advances in neural information processing systems, pp. 4878-4887, 2017. +Geifman, Y. and El-Yaniv, R. Selectivenet: A deep neural network with an integrated reject option. In International Conference on Machine Learning, pp 2151-2159. PMLR, 2019. +Gölz, P., Kahng, A., and Procaccia, A. D. Paradoxes in fair machine learning. In Advances in Neural Information Processing Systems, pp. 8340-8350, 2019. + +Hall, P. and Carroll, R. J. Variance function estimation in regression: The effect of estimating the mean. Journal of the Royal Statistical Society: Series B (Methodological), 51(1):3-14, 1989. +Hardt, M., Price, E., and Srebro, N. Equality of opportunity in supervised learning. In Advances in Neural Information Processing Systems 29, pp. 3315-3323, Barcelona, Spain, December 2016. +Hellman, M. E. The nearest neighbor classification rule with a reject option. IEEE Transactions on Systems Science and Cybernetics, 6(3):179-185, 1970. +Herbei, R. and Wegkamp, M. H. Classification with reject option. The Canadian Journal of Statistics/La Revue Canadienne de Statistique, pp. 709-721, 2006. +Hill, J. L. Bayesian nonparametric modeling for causal inference. Journal of Computational and Graphical Statistics, 20(1):217-240, 2011. +Jesson, A., Mindermann, S., Shalit, U., and Gal, Y. Identifying causal-effect inference failure with uncertainty-aware models. Advances in Neural Information Processing Systems, 33, 2020. +Jiang, W., Zhao, Y., and Wang, Z. Risk-controlled selective prediction for regression deep neural network models. In 2020 International Joint Conference on Neural Networks (IJCNN), pp. 1-8. IEEE, 2020. +Jones, E., Sagawa, S., Koh, P. W., Kumar, A., and Liang, P. Selective classification can magnify disparities across groups. arXiv preprint arXiv:2010.14134, 2020. +Kamishima, T., Akaho, S., and Sakuma, J. Fairness-aware learning through regularization approach. In 2011 IEEE 11th International Conference on Data Mining Workshops, pp. 643-650. IEEE, 2011. +Komiyama, J. and Shimao, H. Two-stage algorithm for fairness-aware machine learning. arXiv preprint arXiv:1710.04924, 2017. +Komiyama, J., Takeda, A., Honda, J., and Shimao, H. Nonconvex optimization for regression with fairness constraints. In International conference on machine learning, pp. 2737-2746. PMLR, 2018. +Krueger, D., Caballero, E., Jacobsen, J.-H., Zhang, A., Binas, J., Zhang, D., Le Priol, R., and Courville, A. Out-of-distribution generalization via risk extrapolation (rex). In International Conference on Machine Learning, pp. 5815-5826. PMLR, 2021. +Künzel, S. R., Sekhon, J. S., Bickel, P. J., and Yu, B. Metalearners for estimating heterogeneous treatment + +effects using machine learning. Proceedings of the national academy of sciences, 116(10):4156-4165, 2019. +Lantz, B. Machine learning with $R$ : expert techniques for predictive modeling. Packt publishing Ltd, 2019. +Lee, J., Bu, Y., Sattigeri, P., Panda, R., Wornell, G., Karlinsky, L., and Feris, R. A maximal correlation approach to imposing fairness in machine learning. arXiv preprint arXiv:2012.15259, 2020. +Lee, J. K., Bu, Y., Rajan, D., Sattigeri, P., Panda, R., Das, S., and Wornell, G. W. Fair selective classification via sufficiency. In International Conference on Machine Learning, pp. 6076-6086. PMLR, 2021. +Lei, J. Classification with confidence. Biometrika, 101(4): 755-769, 2014. +Liu, L. T., Simchowitz, M., and Hardt, M. The implicit fairness criterion of unconstrained learning. In International Conference on Machine Learning, pp. 4051-4060. PMLR, 2019. +Louizos, C., Swersky, K., Li, Y., Welling, M., and Zemel, R. The variational fair autoencoder. arXiv preprint arXiv:1511.00830, 2015. +Mary, J., Calauzenes, C., and El Karoui, N. Fairness-aware learning for continuous attributes and treatments. In International Conference on Machine Learning, pp. 4382-4391, 2019. +Mehrabi, N., Morstatter, F., Saxena, N., Lerman, K., and Galstyan, A. A survey on bias and fairness in machine learning. ACM Computing Surveys (CSUR), 54(6):1-35, 2021. +Nabi, R., Malinsky, D., and Shpitser, I. Learning optimal fair policies. In International Conference on Machine Learning, pp. 4674-4682. PMLR, 2019. +Nadeem, M. S. A., Zucker, J.-D., and Hanczar, B. Accuracy-rejection curves (arcs) for comparing classification methods with a reject option. In Machine Learning in Systems Biology, pp. 65-81. PMLR, 2009. +Oneto, L., Donini, M., and Pontil, M. General fair empirical risk minimization. In 2020 International Joint Conference on Neural Networks (IJCNN), pp. 1-8. IEEE, 2020. +Pérez-Suay, A., Laparra, V., Mateo-García, G., Muñoz-Mari, J., Gómez-Chova, L., and Camps-Valls, G. Fair kernel learning. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pp. 339-355. Springer, 2017. + +Pleiss, G., Raghavan, M., Wu, F., Kleinberg, J., and Weinberger, K. Q. On fairness and calibration. In Advances in Neural Information Processing Systems, pp. 5680-5689, 2017. +Raff, E., Sylvester, J., and Mills, S. Fair forests: Regularized tree induction to minimize model bias. In Proceedings of the 2018 AAAI/ACM Conference on AI, Ethics, and Society, pp. 243-250, 2018. +Redmond, M. and Baveja, A. A data-driven software tool for enabling cooperative information sharing among police departments. European Journal of Operational Research, 141(3):660-678, 2002. +Schreuder, N. and Chzhen, E. Classification with abstention but without disparities. arXiv preprint arXiv:2102.12258, 2021. +Selbst, A. D., Boyd, D., Friedler, S. A., Venkatasubramanian, S., and Vertesi, J. Fairness and abstraction in sociotechnical systems. In Proceedings of the Conference on Fairness, Accountability, and Transparency, pp. 59-68, 2019. +Verma, S. and Rubin, J. Fairness definitions explained. In 2018 ieee/acm international workshop on software fairness (fairware), pp. 1-7. IEEE, 2018. +Wiener, Y. and El-Yaniv, R. Pointwise tracking the optimal regression function. In Advances in Neural Information Processing Systems, pp. 2042-2050, 2012. +Williamson, R. and Menon, A. Fairness risk measures. In International Conference on Machine Learning, pp. 6786-6797. PMLR, 2019. +Zafar, M. B., Valera, I., Rodriguez, M. G., and Gummadi, K. P. Fairness constraints: Mechanisms for fair classification. In Artificial Intelligence and Statistics, pp. 962-970. PMLR, 2017. +Zaoui, A., Denis, C., and Hebiri, M. Regression with reject option and application to knn. Advances in Neural Information Processing Systems, 33:20073-20082, 2020. +Zemel, R., Wu, Y., Swersky, K., Pitassi, T., and Dwork, C. Learning fair representations. In International Conference on Machine Learning, pp. 325-333, 2013. + +# Appendix + +Organization. The Appendix is organized as follows. In Appendix A, we provide the proof of Theorem 4.1. In Appendix B, we provide more details for imposing calibration for mean and variance via the residual-based neural network as well as provide the pseudo-code, i.e., Algorithm 2. In Appendix C, we provide more experimental details and results. + +# A. Proof of Theorem 4.1 + +We restate the Theorem below and then provide a proof. + +Theorem 4.1. Suppose the representation $\Phi(X)$ is sufficient i.e., $Y \perp D|\Phi(X)$ . Let $f(\Phi(X)) = \mathbb{E}[Y|\Phi(X)]$ and $g(\Phi(X)) = \operatorname{Var}[Y|\Phi(X)]$ . Then, for any $d \in \mathcal{D}$ and any $\tau < \tau'$ , we have $\operatorname{MSE}(f,g,\tau,d) < \operatorname{MSE}(f,g,\tau',d)$ . + +Proof. First, let us simplify the expression for $\mathrm{MSE}(f,g,\tau ,d)$ . We have + +$$ +\begin{array}{l} \operatorname {M S E} (f, g, \tau , d) = \frac {\mathbb {E} [ (Y - f (\Phi (X))) ^ {2} \cdot \mathbb {1} (g (\Phi (X)) \leq \tau) | D = d ]}{\mathbb {E} [ \mathbb {1} (g (\Phi (X)) \leq \tau) | D = d ]} \\ = \frac {\mathbb {E} [ (Y - f (\Phi (X))) ^ {2} \cdot \mathbb {1} (g (\Phi (X)) \leq \tau) | D = d ]}{\mathbb {P} (g (\Phi (X)) \leq \tau | D = d)} \tag {10} \\ \end{array} +$$ + +Let $c_{\tau ,d}\triangleq \mathbb{P}(g(\Phi (X))\leq \tau |D = d)$ . Using (10), we have + +$$ +\begin{array}{l} \operatorname {M S E} (f, g, \tau , d) - \operatorname {M S E} (f, g, \tau^ {\prime}, d) \\ = \frac {1}{c _ {\tau , d}} \mathbb {E} [ (Y - f (\Phi (X))) ^ {2} \cdot \mathbb {1} (g (\Phi (X)) \leq \tau) | D = d ] - \frac {1}{c _ {\tau^ {\prime} , d}} \mathbb {E} [ (Y - f (\Phi (X))) ^ {2} \cdot \mathbb {1} (g (\Phi (X)) \leq \tau^ {\prime}) | D = d ] \\ = \left(\frac {1}{c _ {\tau , d}} - \frac {1}{c _ {\tau^ {\prime} , d}}\right) \mathbb {E} \left[ (Y - f (\Phi (X))) ^ {2} \cdot \mathbb {1} (g (\Phi (X)) \leq \tau) \mid D = d \right] (11) \\ - \frac {1}{c _ {\tau^ {\prime} , d}} \mathbb {E} \left[ \left(Y - f (\Phi (X))\right) ^ {2} \cdot \mathbb {1} \left(\tau < g (\Phi (X)) \leq \tau^ {\prime}\right) | D = d \right] (12) \\ \end{array} +$$ + +Now, let us upper bound $\mathbb{E}[(Y - f(\Phi(X)))^2 \cdot \mathbb{1}(g(\Phi(X)) \leq \tau)|D = d]$ . We have + +$$ +\begin{array}{l} \mathbb {E} \left[ \left(Y - f (\Phi (X))\right) ^ {2} \cdot \mathbb {1} \left(g (\Phi (X)) \leq \tau\right) | D = d \right] \\ \stackrel {(a)} {=} \mathbb {E} _ {\Phi (X) | D} [ \mathbb {1} (g (\Phi (X)) \leq \tau) \cdot \mathbb {E} _ {Y | \Phi (X), D} [ (Y - f (\Phi (X))) ^ {2} | \Phi (X), D = d ] | D = d ] \\ \stackrel {(b)} {=} \mathbb {E} _ {\Phi (X) | D} [ \mathbb {1} (g (\Phi (X)) \leq \tau) \cdot \mathbb {E} _ {Y | \Phi (X), D} [ (Y - \mathbb {E} [ Y | \Phi (X) ]) ^ {2} | \Phi (X), D = d ] | D = d ] \\ \stackrel {(c)} {=} \mathbb {E} _ {\Phi (X) | D} [ \mathbb {1} (g (\Phi (X)) \leq \tau) \cdot \mathbb {E} _ {Y | \Phi (X), D} [ (Y - \mathbb {E} [ Y | \Phi (X), D = d ]) ^ {2} | \Phi (X), D = d ] | D = d ] \\ \stackrel {(d)} {=} \mathbb {E} _ {\Phi (X) | D} [ \mathbb {1} (g (\Phi (X)) \leq \tau) \cdot \operatorname {V a r} [ Y | \Phi (X), D = d ] | D = d ] \\ \stackrel {(e)} {=} \mathbb {E} _ {\Phi (X) | D} [ \mathbb {1} (g (\Phi (X)) \leq \tau) \cdot \operatorname {V a r} [ Y | \Phi (X) ] | D = d ] \\ \stackrel {(f)} {=} \mathbb {E} _ {\Phi (X) | D} [ \mathbb {1} (g (\Phi (X)) \leq \tau) \cdot g (\Phi (X)) | D = d ] \\ \leq \tau \mathbb {E} _ {\Phi (X) | D} [ \mathbb {1} (g (\Phi (X)) \leq \tau) | D = d ] = \tau \mathbb {P} (g (\Phi (X)) \leq \tau | D = d) = \tau c _ {\tau , d} \tag {13} \\ \end{array} +$$ + +where $(a)$ follows from the definition of conditional expectation and because $\mathbb{1}(g(\Phi(X)) \leq \tau)$ is a constant conditioned on $\Phi(X)$ , $(b)$ follows because $f(\Phi(X)) = \mathbb{E}[Y|\Phi(X)]$ , $(c)$ follows because $Y \perp D|\Phi(X) \implies \mathbb{E}[Y|\Phi(X)] = \mathbb{E}[Y|\Phi(X), D = d]$ , $(d)$ follows from the definition of conditional variance, $(e)$ follows because $Y \perp D|\Phi(X) \implies \operatorname{Var}[Y|\Phi(X)] = \operatorname{Var}[Y|\Phi(X), D = d]$ , and $(f)$ follows because $g(\Phi(X)) = \operatorname{Var}[Y|\Phi(X)]$ . + +Now, let us lower bound $\mathbb{E}[(Y - f(\Phi(X)))^2 \cdot \mathbb{1}(\tau < g(\Phi(X)) \leq \tau') | D = d]$ . Similar to above, we have + +$$ +\begin{array}{l} \mathbb {E} \left[ (Y - f (\Phi (X))) ^ {2} \cdot \mathbb {1} (\tau < g (\Phi (X)) \leq \tau^ {\prime}) | D = d \right] = \mathbb {E} _ {\Phi (X) | D} [ \mathbb {1} (\tau < g (\Phi (X)) \leq \tau^ {\prime}) \cdot g (\Phi (X)) | D = d ] \\ > \tau \mathbb {E} _ {\Phi (X) | D} [ \mathfrak {1} (\tau < g (\Phi (X)) \leq \tau^ {\prime}) | D = d ] \\ = \tau (\mathbb {P} (g (\Phi (X)) \leq \tau^ {\prime} | D = d) - \mathbb {P} (g (\Phi (X)) \leq \tau | D = d)) \\ = \tau \left(c _ {\tau^ {\prime}, d} - c _ {\tau , d}\right) \tag {14} \\ \end{array} +$$ + +Plugging in (13) and (14) in (11) and (12), we have + +$$ +\operatorname {M S E} (f, g, \tau , d) - \operatorname {M S E} (f, g, \tau^ {\prime}, d) < \left(\frac {1}{c _ {\tau , d}} - \frac {1}{c _ {\tau^ {\prime} , d}}\right) \cdot \tau c _ {\tau , d} - \frac {1}{c _ {\tau^ {\prime} , d}} \tau \cdot \left(c _ {\tau^ {\prime}, d} - c _ {\tau , d}\right) = 0 +$$ + +# B. More Details to Impose Calibration for Mean and Variance + +In this section, we provide more details for imposing calibration for mean and variance via the residual-based neural network as well as provide the pseudo-code. As described in Section 5.2, in a residual-based neural network, once the mean-prediction network $f$ is trained, the residuals i.e., $r_i = (y_i - f(\Phi_1(x_i); \theta_f))^2$ are used to train the variance-prediction network $g$ by minimizing: + +$$ +L _ {S 2} \left(\Phi_ {2}, \theta_ {g}\right) \triangleq \sum_ {i = 1} ^ {n} \left(r _ {i} - g \left(\Phi_ {2} \left(x _ {i}\right); \theta_ {g}\right)\right) ^ {2}. +$$ + +The feature representation $\Phi_2$ is parameterized by $\theta_{\Phi_2}$ and the variance-prediction network is supposed to learn the parameters $\theta_{\Phi_2}$ and $\theta_g$ . + +To impose calibration under variance, we construct a contrastive loss similar to (7). Then, the regularizer can be written as + +$$ +L _ {R 2} \left(\Phi_ {2}\right) \triangleq \sum_ {i = 1} ^ {n} \left(\left(r _ {i} - g \left(\Phi_ {2} \left(x _ {i}\right); w _ {g} ^ {\left(\widetilde {d} _ {i}\right)}\right)\right) ^ {2} - \left(r _ {i} - g \left(\Phi_ {2} \left(x _ {i}\right); w _ {g} ^ {\left(d _ {i}\right)}\right)\right) ^ {2}\right), +$$ + +where $\widetilde{d}_i$ are drawn i.i.d. from the marginal distribution $P_{D}$ , and for $d\in \mathcal{D}$ + +$$ +w_{g}^{(d)} = \operatorname *{arg min}_{w}\sum_{i:d_{i} = d}\bigl(r_{i} - g\bigl(\Phi_{2}(x_{i});w\bigr)\bigr)^{2}. +$$ + +Summarizing, the overall objective for variance-prediction is + +$$ +\min _ {\theta_ {g}, \Phi_ {2}} L _ {S 2} (\Phi_ {2}, \theta_ {g}) + \lambda_ {2} L _ {R 2} (\Phi_ {2}). +$$ + +We provide a pseudo-code in Algorithm 2 where + +$$ +L _ {d 1} (w _ {f}) \triangleq \sum_ {i: d _ {i} = d} \left(y _ {i} - f (\Phi_ {1} (x _ {i}); w _ {f})\right) ^ {2}, +$$ + +$$ +L _ {d 2} (w _ {g}) \triangleq \sum_ {i: d _ {i} = d} \left(r _ {i} - g (\Phi_ {2} (x _ {i}); w _ {g})\right) ^ {2}. +$$ + +# C. Additional experimental results + +In this section, we provide more experimental details and results. We start by providing those experimental details that remain the same across the datasets. Next, we provide details that are specific to each dataset, i.e., Insurance, Crime, and IHDP. Finally, we provide more experimental results and some discussion. + +# C.1. Experimental Details + +In all of our experiments, we use two-layer neural networks. For all hidden layers, we use the selu activation function. For the output layer, we use a non-linear activation function only for the variance-prediction network associated with Algorithm 2 to ensure that the predictions of variance are non-negative. In particular, we use the soft-plus activation function for the variance-prediction network associated with Algorithm 2. In our implementation of Algorithm 1, we predict log-variance instead of variance and therefore stick to linear activation function. + +We train all our neural networks with the Adam optimizer, a batch size of 128, and over 40 epochs. Further, we use a step learning rate scheduler with an initial learning rate of $5 \times 10^{-3}$ and decay it by a factor of half after every two epochs. Finally, as described in Section 6, we set the regularizer $\lambda = 1$ for all our experiments after observing that the performance of our algorithms is agnostic to the choice of $\lambda$ as long as it is in a reasonable range, i.e., $\lambda \in [0.5, 3]$ . + +Algorithm 2 Residual-based neural network with calibration-based regularizer +Input: training samples $\{(x_i,y_i,d_i)\}_{i = 1}^n$ , regularizers $\lambda_{1}$ and $\lambda_{2}$ +Draw: $\{\widetilde{d}_1,\ldots ,\widetilde{d}_n\}$ drawn i.i.d. from $\hat{\mathbb{P}}_D$ +Initialize: $\theta_f,\theta_g,\theta_{\Phi_1},\theta_{\Phi_2},w_f^{(d)},$ and $w_{g}^{(d)}$ with pre-trained models +Initialize: $n_d =$ number of samples in group $d\forall d\in \mathcal{D}$ +for each training iteration do +for each batch do +for $d = 1,\dots ,|\mathcal{D}|$ do # update subgroup-specific mean predictor $w_{f}^{(d)}\gets w_{f}^{(d)} - \frac{1}{n_{d}}\eta_{f}\nabla_{w_{f}}L_{d1}(w_{f})$ end for +end for +for each batch do # update feature extractor for mean predictor $\theta_{\Phi_1}\gets \theta_{\Phi_1} - \frac{1}{n}\eta \nabla_{\theta_{\Phi_1}}(LS1(\Phi_1,\theta_f) + \lambda_1LR1(\Phi_1))$ # update mean predictor $\theta_f\gets \theta_f - \frac{1}{n}\eta \nabla_{\theta_f}LS1(\Phi_1,\theta_f)$ +end for +end for +Compute the residuals: $r_i = (y_i - f(\Phi_1(x_i);\theta_f))^2$ +for each training iteration do +for each batch do +for $d = 1,\dots ,|\mathcal{D}|$ do # update subgroup-specific variance predictor $w_{g}^{(d)}\gets w_{g}^{(d)} - \frac{1}{n_{d}}\eta_{g}\nabla_{w_{g}}L_{d2}(w_{g})$ end for +end for +for each batch do # update feature extractor for variance predictor $\theta_{\Phi_2}\gets \theta_{\Phi_2} - \frac{1}{n}\eta \nabla_{\theta_{\Phi_2}}(LS2(\Phi_2,\theta_g) + \lambda_2LR2(\Phi_2))$ # update variance predictor $\theta_g\gets \theta_g - \frac{1}{n}\eta \nabla_{\theta_g}LS2(\Phi_2,\theta_g)$ +end for +end for + +# C.2. Insurance + +The Insurance dataset5 is a semi-synthetic dataset that was created using demographic statistics from the U.S. Census Bureau and approximately reflects real-world conditions. A few features in this dataset include the BMI, number of children, age, etc. We remove the sensitive attribute from the set of input features to preprocess the data. To reflect the real-world scenarios where the accuracy disparity is significant due to the small and imbalanced dataset, similar to (Chi et al., 2021), we randomly drop $50\%$ of examples with $D = 1$ . Further, we normalize the output annual medical expenses and the features: age and BMI. We use 3 neurons in the hidden layer for this dataset. + +# C.3. Communities and Crime + +The Communities and Crime dataset6 contains socio-economic information of communities in the U.S. and their crime rates. A few features in this dataset include population for community, mean people per household, percentage of the population that is white, per capita income, number of police cars, etc. We remove the non-predictive attributes and the sensitive attribute from the set of input features during preprocessing. All attributes in the dataset have been curated and normalized + +to [0, 1], so we do not perform any additional normalization. Finally, we replace the missing values with the mean values of the corresponding attributes similar to (Chi et al., 2021). We use 50 neurons in the hidden layer for this dataset. + +# C.4. IHDP + +The IHDP dataset7 is generated based on a randomized control trial targeting low-birth-weight, premature infants. The 25 features measure various aspects about the children and their mothers, e.g., child's birth weight, child's gender, mother's age, mother's education, an indicator for maternal alcohol consumption during pregnancy, etc. We remove the sensitive attribute from the set of input features to preprocess the data. Further, we normalize the output cognitive test score and the features: child's birth weight, child's head circumference at birth, number of weeks pre-term that the child was born, birth order, neo-natal health index, and mom's age when she gave birth to the child. Following the norm in the causal inference community, a biased subset of the treated group is removed to create an imbalance leaving 139 samples in the treatment group and 608 samples in the control group. The target is typically simulated using the setting "A" of the NPCI package (Dorie, 2016). We use 20 neurons in the hidden layer for this dataset. + +# C.5. Standard deviations + +In Table 3 below, we provide the standard deviations associated with AUC, AUC $(\mathrm{D} = 0)$ , AUC $(\mathrm{D} = 1)$ , and AUADC whose means were provided in Table 2 in Section 6. + +Table 3: Mean ± standard deviation (averaged across 5 runs) for AUC, AUC $(\mathrm{D} = 0)$ , AUC $(\mathrm{D} = 1)$ , and AUADC for all the algorithms and all the datasets. + +
DatasetAlgorithmAUCAUC (D = 0)AUC (D = 1)AUADC
InsuranceB1 i.e., Baseline 10.0371 ± 0.02550.0342 ± 0.01970.0442 ± 0.02180.0069 ± 0.0050
A1 i.e., Algorithm 10.0195 ± 0.00590.0207 ± 0.00500.0167 ± 0.00750.0052 ± 0.0031
B2 i.e., Baseline 20.0142 ± 0.00520.0129 ± 0.00420.0175 ± 0.00260.0079 ± 0.0041
A2 i.e., Algorithm 20.0099 ± 0.00060.0087 ± 0.00040.0120 ± 0.00110.0051 ± 0.0018
CrimeB1 i.e., Baseline 10.0075 ± 0.00020.0040 ± 0.00110.0345 ± 0.00370.0309 ± 0.0008
A1 i.e., Algorithm 10.0079 ± 0.00040.0045 ± 0.00130.0296 ± 0.00540.0298 ± 0.0011
B2 i.e., Baseline 20.0101 ± 0.00190.0060 ± 0.00170.0442 ± 0.00220.0272 ± 0.0013
A2 i.e., Algorithm 20.0117 ± 0.00170.0082 ± 0.00120.0375 ± 0.00190.0257 ± 0.0028
IHDP (Treatment)B1 i.e., Baseline 10.3053 ± 0.08230.2000 ± 0.08990.3509 ± 0.08110.2266 ± 0.0919
A1 i.e., Algorithm 10.2435 ± 0.08230.2024 ± 0.09350.2849 ± 0.07670.2034 ± 0.0925
IHDP (Control)B1 i.e., Baseline 10.2041 ± 0.01380.2144 ± 0.01010.1983 ± 0.01250.0495 ± 0.0053
A1 i.e., Algorithm 10.2017 ± 0.01700.2169 ± 0.01330.1877 ± 0.01290.0398 ± 0.0073
+ +# C.6. Overall MSE vs. coverage curves + +In Section 6, we compared different algorithms in terms of how well they performed selective regression (i.e., with no consideration of fairness) by looking at the area under MSE vs. coverage curve (AUC). Here, we provide the MSE vs. coverage curves for the Insurance dataset in Figure 3a, the Crime dataset in Figure 3b, the IHDP (control) dataset in Figure 3c, and the IHDP (treatment) dataset in Figure 3d. + +For the Insurance dataset, we see that Algorithm 1 and Algorithm 2 perform selective regression better than Baseline 1 and Baseline 2, respectively. This is also evident via the values of AUC in Table 2/3. For the Crime dataset, the MSE decreases with decrease in coverage as expected for all four algorithms. Further, the performances of Baseline 1 and Baseline 2 are slightly better than that of Algorithm 1 and Algorithm 2 respectively. This is also evident via the values of AUC in Table 2/3. for the IHDP (control) dataset and IHDP (treatment) dataset, we see that Algorithm 1 performs selective regression better than Baseline 1. This is also evident via the values of AUC in Table 2/3. + +![](images/33970e6dcaf55da4fb9fb83570c942682564c1a1337a54f3529c361a6d427ff6.jpg) +(a) Insurance + +![](images/d64b45e93b739e9d8258c353862cae9012d72f5a515df36df7c122c100fba0a7.jpg) +(b) Crime + +![](images/a372ef2e5d6e03c3b5add294114efcdbec0d245344891829a432191dd91d36ba.jpg) +(c) IHDP (control) + +![](images/becec507e78a50d0f0da2b28d02152bad65906bcd7795d52dc6854d82244a34c.jpg) +(d) IHDP (treatment) + +![](images/95e0ca6705820ffe7da68b0483294f67c0c654bd190d2e88936310f91be63063.jpg) + +![](images/0e7526894a0e191c54061ec9e977a5f96859b9d67f0bf54d604a2599e238e389.jpg) +Figure 3: MSE vs. coverage for various datasets + +![](images/96b6dbb59749e4d526eca36f65b72ec408d16c2aacc988e8235e0722aaaa639c.jpg) + +![](images/23e83f1c63a65def5ad4c36670732abf65364e5484cb095e58e756c6c1035a8a.jpg) +(a) Performance of Baseline 1 for the Insurance dataset. +(b) Performance of Algorithm 1 for the Insurance dataset. +Figure 4: Subgroup MSE vs. coverage plots for various datasets comparing baselines (top) and our algorithms (bottom). + +![](images/ce3b2cc1be90d5b8d8837d200be25aa6ff3917797bd535c53e55db70a54dff23.jpg) +(c) Performance of Baseline 2 for the Crime dataset. +(d) Performance of Algorithm 2 for the Crime dataset. + +![](images/b1b422f97c545f101c7373efd9b5777a9c41cfd754dd28f1f1ab2c939d527f7e.jpg) +(e) Performance of Baseline 1 for the IHDP (control) dataset. +(f) Performance of Algorithm 1 for the IHDP (control) dataset. + +# C.7. Group-specific MSE vs. coverage curves. + +In Section 6, we compared the different algorithms in terms of how well they perform fair selective regression by looking at the subgroup MSE vs. coverage curves in addition to AUC, AUC $(\mathrm{D} = 0)$ , AUC $(\mathrm{D} = 1)$ , and AUADC. + +More specifically, we looked at Baseline 2 and Algorithm 2 for the Insurance dataset, Baseline 1 and Algorithm 1 for the Crime dataset, and Baseline 1 and Algorithm 1 for the IHDP (treatment) dataset. Here, we show the subgroup MSE vs. coverage curves for Baseline 1 and Algorithm 1 for the Insurance dataset (Figure 4a and 4b), Baseline 2 and Algorithm 2 for the Crime dataset (Figure 4c and 4d), and Baseline 1 and Algorithm 1 for the IHDP (control) dataset (Figure 4e and 4f). + +For the Insurance dataset, we see that subgroup MSE for the minority subgroup increases with decrease in coverage for Baseline 1 (Figure 4a) as already described in Section 3.1. In contrast, the subgroup MSE for Algorithm 1 does not increase with decrease in coverage and stays relatively flat (Figure 4b). Further, for a particular coverage, Algorithm 1 achieves a better MSE for the minority subgroup, a comparable MSE for the majority subgroup, and reduces the gap between the subgroup curves than Baseline 1 (see the values of AUC $(\mathrm{D} = 0)$ , AUC $(\mathrm{D} = 1)$ , and AUADC in Table 2/3). + +For the Crime dataset, we see that the subgroup MSE for Baseline 2 as well as Algorithm 2 tends to decrease with a decrease in coverage for both subgroups (Figure 4c and Figure 4d). However, for a particular coverage, Algorithm 2 achieves a better MSE for the minority subgroup, a comparable MSE for the majority subgroup, and reduces the gap between the subgroup curves than Baseline 2 (see the values of AUC $(\mathrm{D} = 0)$ , AUC $(\mathrm{D} = 1)$ , and AUADC in Table 2/3). + +For the IHDP (control) dataset, we see that the subgroup MSE for Baseline 1 increases with decrease in coverage (Figure 4e). In contrast, the subgroup MSE for Algorithm 1 decreases with decrease in coverage (Figure 4f). Additionally, Algorithm 1 achieves a comparable MSE for the majority subgroup, and reduces the gap between the subgroup curves than Baseline 1 (see the values of AUC $(\mathrm{D} = 0)$ , AUC $(\mathrm{D} = 1)$ , and AUADC in Table 2/3). + +# C.8. Group-specific MSE vs. coverage curves with three subgroups + +In all of our experiments so far, we focused on the scenario where the sensitive attribute was binary. However, as we now demonstrate, our approach works equally well when the sensitive attribute can take more than two values. + +More concretely, we use the Crime dataset to obtain 3 subgroups i.e., the sensitive attribute can take three values. This is possible since, race, the sensitive attribute, is reported as the population percentage of the black in the Crime dataset. We assign (a) $D = 2$ if the population percentage of the black is more than or equal to 20, (b) $D = 1$ if the population percentage of the black is less than 20 but more than or equal to 1, and (c) $D = 0$ otherwise. + +We show the performance of Baseline 1 and Algorithm 1 in Figure 5a and 5b respectively. As expected, Algorithm 1 ensures monotonic selective risk unlike Baseline 1 (see $D = 2$ ). + +![](images/ba5034b7be6dbb0d047128b801096581f10f0ccd1d9af5dbaa3ff644a10b407a.jpg) +(a) Performance of Baseline 1 for the Crime dataset. + +![](images/48ddc9ec40103e66992e7e64861b9f0f2c091f7cbbe2c5f11f6a5b7b55baa571.jpg) +(b) Performance of Algorithm 1 for the Crime dataset. +Figure 5: Subgroup MSE vs. coverage plots for the Crime dataset with three subgroups \ No newline at end of file diff --git a/selectiveregressionunderfairnesscriteria/images.zip b/selectiveregressionunderfairnesscriteria/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..fc0923bf5e34e6588da67485458d5698be7ccfd7 --- /dev/null +++ b/selectiveregressionunderfairnesscriteria/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1ae710f663756374adb82dd9bd88516ffd62b02c888b6f091535fc81608f993e +size 815528 diff --git a/selectiveregressionunderfairnesscriteria/layout.json b/selectiveregressionunderfairnesscriteria/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..5db069bf0851f70d6cd5bba10f24936fa14b2649 --- /dev/null +++ b/selectiveregressionunderfairnesscriteria/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7017a92766454f85c83122e314dd9aac760f9f7b611a9d94a51edbf74b34fd2d +size 793622 diff --git a/selfconditioningpretrainedlanguagemodels/4dac21bb-74f6-45e4-a856-3808c9acf86b_content_list.json b/selfconditioningpretrainedlanguagemodels/4dac21bb-74f6-45e4-a856-3808c9acf86b_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..9bab5dbd83a104c2f54e46d7a9656499b1cf02a0 --- /dev/null +++ b/selfconditioningpretrainedlanguagemodels/4dac21bb-74f6-45e4-a856-3808c9acf86b_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c93f36b9cc9e09b23caa9065e9257c1db4cbdc9c21e3f761640b43f03c38735a +size 110950 diff --git a/selfconditioningpretrainedlanguagemodels/4dac21bb-74f6-45e4-a856-3808c9acf86b_model.json b/selfconditioningpretrainedlanguagemodels/4dac21bb-74f6-45e4-a856-3808c9acf86b_model.json new file mode 100644 index 0000000000000000000000000000000000000000..2bed4027875e67271ff6d094f643bb66738d8529 --- /dev/null +++ b/selfconditioningpretrainedlanguagemodels/4dac21bb-74f6-45e4-a856-3808c9acf86b_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5277719c75b37517e80360e397e8de5308ff472a6b3b6d3af8038dc7df1b8f1a +size 127011 diff --git a/selfconditioningpretrainedlanguagemodels/4dac21bb-74f6-45e4-a856-3808c9acf86b_origin.pdf b/selfconditioningpretrainedlanguagemodels/4dac21bb-74f6-45e4-a856-3808c9acf86b_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..5a34cd0f59bdb8ca9bdc7da80d7f3de61172e43e --- /dev/null +++ b/selfconditioningpretrainedlanguagemodels/4dac21bb-74f6-45e4-a856-3808c9acf86b_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7cc19986db47d3abe79f33ab9d823c30da5c28bcc8ec891b5c2451c11581e184 +size 4281419 diff --git a/selfconditioningpretrainedlanguagemodels/full.md b/selfconditioningpretrainedlanguagemodels/full.md new file mode 100644 index 0000000000000000000000000000000000000000..aaa5970bdec76f94b6c458e3bd41f03e8b56c658 --- /dev/null +++ b/selfconditioningpretrainedlanguagemodels/full.md @@ -0,0 +1,409 @@ +# Self-conditioning Pre-Trained Language Models + +Xavier Suau1 Luca Zappella1 Nicholas Apostoloff1 + +# Abstract + +In this paper we aim to investigate the mechanisms that guide text generation with pre-trained Transformer-based Language Models (TLMs). Grounded on the Product of Experts formulation by Hinton (1999), we describe a generative mechanism that exploits expert units which naturally exist in TLMs. Such units are responsible for detecting concepts in the input and conditioning text generation on such concepts. We describe how to identify expert units and how to activate them during inference in order to induce any desired concept in the generated output. We find that the activation of a surprisingly small amount of units is sufficient to steer text generation (as little as 3 units in a model with 345M parameters). While the objective of this work is to learn more about how TLMs work, we show that our method is effective for conditioning without fine-tuning or using extra parameters, even on fine-grained homograph concepts. Additionally, we show that our method can be used to correct gender bias present in the output of TLMs and achieves gender parity for all evaluated contexts. We compare our method with FUDGE (Yang & Klein, 2021) and PPLM-BoW (Dathathri et al., 2020), and show that our approach is able to achieve gender parity at a lower perplexity and better Self-BLEU score. The proposed method is accessible to a wide audience thanks to its simplicity and minimal compute needs. The findings in this paper are a step forward in understanding the generative mechanisms of TLMs. + +# 1. Introduction + +Natural Language Processing (NLP) is evolving at a fast pace. For instance, language models (Bengio et al., 2003) + +based on the Transformer (Vaswani et al., 2017) architecture (TLMs) achieve impressive performance in many tasks, including text generation (Radford et al., 2019; Brown et al., 2020). Despite their success, the mechanisms that govern and control text generation using TLMs remain unclear. Additionally, TLMs have two important drawbacks: (1) conditioning these models to constrain the content of their generation requires either expensive re-training (Keskar et al., 2019) or the use of additional parameters (Dathathri et al., 2020; Zhang et al., 2020; Yang & Klein, 2021); (2) TLMs might inherit and perpetuate biases present in the training data, which can have a negative social impact (Sheng et al., 2019; Abid et al., 2021), especially when TLMs are deployed in commercial applications. + +This paper investigates the internal mechanisms used by TLMs to control text generation. Theoretically grounded on the Product of Experts formulation by Hinton (1999), we describe a generative mechanism based on the presence of expert units (neurons) in pre-trained TLMs. In this mechanism, expert units capture the presence of a concept in the TLM input. At generation time, the TLM relies on the activation of such expert units to produce text with a specific concept. In order to exploit the proposed generative mechanism, we first identify expert units based on their ability to detect a concept in the input with a given average precision. Our approach finds expert units in a scalable manner for a variety of concepts. Then, we apply a post-hoc intervention upon those units which increases the presence of a concept in the generated text, independently of the concepts present in the input. We show that intervening on as little as 3 units can be sufficient to steer the generation towards a desired concept. Our method does not require fine-tuning or using additional parameters1. + +Sec. 2 contains a literature review of relevant works. In Sec. 3 we define the term concept and we describe its formal representation. In Sec. 4 we explain our algorithm to exploit the proposed generative mechanism by finding and activating expert units for a specific concept. In Sec. 5.1 we apply our method to condition TLMs on a variety of concepts (including fine-grained homographs) and we provide qualitative text generation results. In Sec. 5.2 we analyze the performance of our method for gender bias mitigation. We com + +pare our method with the state of the art methods FUDGE (Yang & Klein, 2021) and PPLM (Dathathri et al., 2020) in its Bag-of-Words version (PPLM-BoW). PPLM-BoW and our method are the only works that achieve conditional generation without additional parameters. Our method outperforms the compared algorithms, achieving generative parity (i.e., the TLM generates sentences with equal probability of containing specific concepts) with higher quality, measured by a lower perplexity, lower Self-BLEU score (Zhu et al., 2018) and less same-word repetition. Interestingly, we achieve parity by intervening on very few expert units (a median of 15 units, representing $0.0067\%$ of the model units analyzed). We further show that the conditioning strength required to achieve parity with our method is correlated with the intrinsic bias of the model, which facilitates the choice of the conditioning parameters. Lastly, we validate empirically our choice of expert units. In Sec. 6 we discuss the limitations and potential improvements of our work. Finally, conclusions are drawn in Sec. 7. + +# 2. Related Work + +Expert Units. The use of expert units has been previously explored in the image domain (Bau et al., 2017; 2019; Fong & Vedaldi, 2018). Our work is inspired by this body of research. However, adapting it to the NLP domain has required redefining what an expert unit is, how to find it, and how to control it. Radford et al. (2017) finds an expert unit for sentiment (the sentiment neuron) in LSTM (Hochreiter & Schmidhuber, 1997) representations. It does so via L1 regularization of a logistic regression classifier on top of the representations. Our work is not limited to sentiment, and it can scale to much larger models such as TLMs. + +Product of Experts. Some recent works propose conditioning strategies with minimal intervention on the TLM. For instance, PPLM (Dathathri et al., 2020) exploits the Product of Experts (PoE) formulation (Hinton, 1999) and does not require re-training. They steer the latent variables during generation to maximize both a conditional expert (modelled with an external network) and the unconditional expert. The steering is performed using the gradients from the external network. In the PPLM-BoW form, the conditional expert is a Bag-of-Words (BoW) model, which does not require any training parameter. Side tuning (Zhang et al., 2020) adds a side model that learns a residual on top of the original model. Similarly, (Zeldes et al., 2020) supplements the pre-trained TLM with an external model that shifts the output distribution. Recently, FUDGE (Yang & Klein, 2021) adjusts the output probabilities of a TLM by training a discriminator model that predicts whether a topic will appear in the future. In FUDGE, the discriminator can also be trained to condition formality or poetry. All these methods follow the PoE framework (explicitly, or im + +plicitly). Our formulation also adopts the PoE framework, with a key difference: we consider that the conditional PoE expert already exists in the TLM rather than using external models. We propose a way to identify the PoE conditional expert that does not involve computing gradients or using additional parameters. This makes our solution simple and accessible to a wider audience, and also unveils aspects of how generative mechanisms of TLMs work. + +Conditioned Text Generation. Most methods tackling conditioned text generation are based on training dedicated architectures. In (Chen et al., 2019), two latent embeddings representing syntax and semantics are inferred enforcing disentanglement. This allows conditioning on an arbitrary combination of syntax and semantics. Similarly, (Romanov et al., 2019) disentangle meaning and form with an adversarial training approach. The work in (Hu et al., 2017) combines a Variational Auto-Encoder (Kingma & Welling, 2014) with discriminators of specific attributes, and shows results controlling sentiment and tense. In (Peng et al., 2018), human specified control factors are extracted from data by an analyzer model. Such factors are used at generation time to control the story ending valence (sad or happy endings). In CTRL (Keskar et al., 2019), training sentences are prepended with a control code, which allows conditioning at test time. The work in (Schiller et al., 2020) builds on CTRL allowing the controlled generation of arguments for specific contexts and aspects. + +Although effective, all these methods need the conditioning to be known before the model is trained, require large amounts of data, and suffer from the computational complexities typical of TLMs training. One of the advantages of our approach is that a concept is encoded solely by a set of examples. Extending the number of controllable concepts (at any time) is as simple as collecting positive and negative examples for the new concepts. + +# 3. Concepts As Binary Sentence Datasets + +Throughout this paper we refer to concept as an "abstract idea" that can be described with a set of examples. We extend (Kim et al., 2018) to the NLP domain by describing a concept $c$ with a dataset $\{\pmb{x}_i^c, b_i^c\}_{i=1}^N$ of $N = N_c^+ + N_c^-$ sentences. The $N_c^+$ positive sentences contain $c$ (i.e., $b_i^c = 1$ ), and the $N_c^-$ negative sentences do not contain $c$ (i.e., $b_i^c = 0$ ). Each sentence $\pmb{x}_i^c$ is padded to a length $T$ . + +Such flexible definition allows diverse types of concepts to be represented. They can be broad such as sport or more precise one such as football, world cup, national football team, player, etc. Our definition also allows representing abstract concepts (e.g., sentiment) or more concrete ones using Bags-of-Words. One interesting aspect of this representation is that we can distinguish homographs, e.g., we + +can represent the concept note "a reminder" differently from note "a tone of certain pitch". + +# 4. Method + +# 4.1. Generative Mechanism Based On Expert Units + +Language models are generative models that can generate text consistent with linguistic rules. More formally, autoregressive language models maximize the probability of a sentence $\pmb{x} = \{\pmb{x}_i\}$ as $p(\pmb{x}) = p(\pmb{x}_1, \dots, \pmb{x}_T) = \prod_{t=1}^{T} p(\pmb{x}_t | \pmb{x}_{ N_{c}^{+}$ to account for the much larger variance of negatives than positives examples. The choice of $N_{c}^{+}, N_{c}^{-}$ is arbitrary, usually a trade-off between the compute resources available and the quality of the concept representation needed. The effect of the dataset size is out of scope in this paper. + +# 5.1. Self-Conditioned Generation And Saturation + +In this first analysis, we show qualitative self-conditioning results using the GPT2-L model from the Huggingface Transformers repository (Wolf et al., 2019). Table 1 contains generated sentences while applying the $do(c, k)$ operation for WordNet concept $c = \text{bird\%} \cdot 1:05:00$ (WordNet notation), as described in Sec. 4.2. Note that the presence of the concept gradually increases with $k$ , saturating at about $k = 200$ experts intervened upon (0.048% of the 414720 units analyzed for GPT2-L). This result alings with our expectations from Eq. (1), showing that increasing $k$ maximizes $p(y = c | x)$ until the collapse of $p(x | y = c)$ , when the effect of $p(x)$ (generating plausible sentences) is no longer evident. Note how TLMs require an extremely small amount of expert units to condition text generation on specific concepts. + +Table 2 shows examples with the context introduced by OpenAI (Radford et al., 2019), conditioned on concepts elevator%1:06:00 and frustration%1:12:00. The generated text is still coherent with the context, while including the + +Table 1: Generated sentences using GPT2-L with context Once upon a time, sorted by the number $k$ of top experts intervened upon for WordNet concept bird%1:05:00 (warm-blooded egg-laying vertebrates). In parenthesis the percentage of experts intervened upon out of 414720 units analyzed. + +
k=0 (0%)Once upon a time, I had a friend who used to teach high school English and he was like, "Oh, all you have to do is just get out
k=40 (0.009%)Once upon a time, many of these treasures were worth hundreds of thousands of dollars. But this isn't the first time that a horse
k=60 (0.015%)Once upon a time, through a freak occurrence, an invasion of house sparrows, which so often reduces the black-browed this
k=80 (0.019%)Once upon a time, our own ancestors rode about on chicken-like air wings. But this wonder of the air has no such wings.
k=200 (0.048%)Once upon a time of year, birds chase each and watching. flot racing form, bird, bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird bird birds
+ +conditioned concepts. Appendix D contains more examples of successful and unsuccessful conditioned generation, and a qualitative comparison with FUDGE and PPLM-BoW. In Table 3 we include generated sentences for homograph concepts lead%1:27:00 and lead%1:07:02. These results show that our conditioning does not rely on the presence of a keyword but on its meaning. + +# 5.2. Controlling Generative Parity + +In this section we explore how conditioning expert units can help to understand model biases, and how intervening on a small number of units can be effective to achieve generative parity for specific contexts. We use the contexts used in (Vig et al., 2020), obtained by combining specific context templates with occupations that induce different degrees of gender bias (definitional occupations are discarded). In total we analyze 1037 contexts, that we denote as the occupations set (see Appendix C for more details). While we have analyzed gender using man/women this does not imply a binary categorization and this analysis could be extended to include a broader categorization. + +The default parameters in the PPLM-BoW repository and FUDGE repository are used. We employ a Bag-of-Words (BoW) composed of a single word (woman or man) for both methods. The presence of a concept is induced by increasing $k$ from 0 to 300 for our approach, increasing the $\lambda$ parameter from 1 to 12 for FUDGE, and increasing the stepsize from 0 to 1 for PPLM-BoW. Our proposal and PPLM-BoW are the only methods that achieve conditioning of TLMs without requiring fine-tuning or using additional parameters. Although FUDGE uses an external pre-trained discriminator, we include it in the analysis because such discriminator can work with a BoW and no extra fine-tuning. For a fair comparison with FUDGE we use GPT2-M for all methods, since FUDGE's pre-trained LSTM discriminator + +Table 2: Generated sentences using GPT2-L with the context used by OpenAI (Radford et al., 2019) (in gray) for 2 different concepts. Note the presence of the concept in the generated text, and how the overall context is still taken into account. + +
k=60 (0.014%) +c=elevator%1:06:00In a shocking finding, scientist discovered a herd of unicorns living in a remote, previously unexplored valley, in the Andes Mountains. Even more surprising to the researchers was the fact that the unicorns spoke perfect English. The two scientists were unable to solve a problem in their research when they started a great deal of unusual levitation and deceleration, which blew them up a few hundred feet and dropped them back to the ground.
k=60 (0.014%) +c=frustration%1:12:00In a shocking finding, scientist discovered a herd of unicorns living in a remote, previously unexplored valley, in the Andes Mountains. Even more surprising to the researchers was the fact that the unicorns spoke perfect English. Even though we had spent a lot of time just to find the path that could lead to the species, we did not have success," has an Indian scientist, taking measurements from a lone unicorn on the walls of a remote mountain
+ +Table 3: Generated sentences using GPT2-L with context Once upon a time, for homograph concepts lead%1:07:02 (an advantage held by a competitor in a race) and lead%1:27:00 (a soft heavy toxic malleable metallic element). Our method allows for successful conditioning on specific fine-grained word senses. + +
lead%1:07:02
k=50 (0.012%)Once upon a time the left-hander would al-ways start at the front in the first two in-stances, but when Mauricio Gaponi rose to the podium,
lead%1:27:00
k=100 (0.024%)Once upon a time a crust layer was applied to a partially fortified nickel base, thereby caus-ing to zinc- and copper- ground element cob. The occurrence of those metal and chrome
+ +uses GPT2-M sentences. + +As in (Vig et al., 2020), we measure the probability of generating words $she, her$ and $he, his$ given specific contexts. For readability, we will refer to $p(she)$ and $p(he)$ in the remainder of this paper, which include also words $her$ and $his$ respectively. Additionally, we define the difference in probabilities $\Delta p(c, \star) \triangleq p(she|do(c, \star)) - p(he|do(c, \star))$ . The placeholder $\star$ refers to $k$ , $\lambda$ or stepsize depending on the method. Parity is achieved at the parity point $\Delta p(c, \star) = 0$ , that is, the intervention level $\star$ at which the model outputs $he, his$ or $she, her$ with the same probability. + +For each context in the occupations set we run 100 generations at different intervention levels ( $k$ , $\lambda$ and stepsize). The $\Delta p(c, \star)$ is estimated using the 100 generations at each intervention level. We also compute the perplexity of the generated sentences. Following Dathathri et al. (2020) and Yang & Klein (2021), we measure the perplexity using GPT (Radford et al., 2018), since we generate using GPT2. + +Perplexity At Parity Point In Fig. 1 we report the perplexity at parity point measured on the conditioned text generated by our method and FUDGE. Our method obtains parity at a perplexity of 69.50, (63.43, 71.72) (median, (10th percentile, 90th percentile)) for concept + +![](images/262dadd48ecb3ccc0a64d00b889b35f712fc1422697aaf0d3b70332160fec00f.jpg) + +![](images/d3c902ed60c755587c478b89566698dce4271e34e9ed940027cecc27a97d232b.jpg) +Figure 1: Perplexity (the lower the better) at parity points with our method (top) and FUDGE (bottom). We observe that our method achieves parity at lower perplexity. Moreover, FUDGE achieves parity at perplexities up to 150 for some contexts, while our maximum perplexity is 80.36. PPLM-BoW is left out of this plot since it achieves parity at perplexity $>250$ . + +woman and 64.62, (63.54, 65.02) for concept man. Conversely, FUDGE achieves parity at 85.40, (83.80, 92.49) and 83.29, (81.60, 129.09) respectively. Note that lower perplexity is better. Moreover, for some contexts, FUDGE achieves parity at perplexities up to 150, while the maximum perplexity shown by our method is 80.36. We did not include PPLM-BoW in Fig. 1 since its perplexity at parity points is 288.19, (202.16, 502.35) and 262.48, (153.82, 411.49), showing that PPLM-BoW is not able to recover parity. The lower perplexity achieved by our method might be due to the fact that it exploits a natural conditioning mechanism of TLMs that better balances $p(y = c|x)$ and $p(x)$ in Eq. (1). Conversely, FUDGE and PPLM-BoW artificially manipulate the TLM with an external model, strongly constraining the generation. Refer to Appendix E for additional results. + +Unconditional Bias vs. Parity Point With our method, parity points are obtained by intervening on a median of + +Table 4: Sentences generated at the generative parity points that continue "The nurse said that" with he and "The warrior desired that" with she. Contexts are chosen because the model exhibit a strong unconditional bias to warrior and nurse. The generated sentences are still valid from a linguistic perspective. + +# Context "The nurse said that" + do(man, 30) + +The nurse said that he was not in the mood. +The nurse said that he had not been given any instructions... +The nurse said that he felt that she was too old... +The nurse said that he could not understand what was happening... +The nurse said that he had to leave the room... + +# Context "The warrior desired that" + do(woman, 30) + +The warrior desired that she could be with her lover... +The warrior desired that she be seen, so she was sent on the hunt... +The warrior desired that she had the courage and strength... +The warrior desired that she may be able to bear children +The warrior desired that she should be able to walk around... + +$k = 15.30$ , (1.00, 19.23) and $k = 3.85$ , (1.00, 14.64) expert units for concepts woman and man respectively. We were surprised that parity is obtained with a median of 15 units, which represents only $0.0067\%$ of the units analyzed. For completeness, FUDGE achieves parity at $\lambda = 1.20$ , (0.26, 2.96) and $\lambda = 1.56$ , (0.22, 7.72), while PPLM-BoW does so at 0.24, (0.03, 0.29) and 0.08, (0.00, 0.25). Interestingly, parity is achieved with less expert units when inducing concept man. Further analysis shows that 16 contexts achieve parity at $k > 20$ when inducing concept man. These 16 contexts either correspond to occupations nurse (15) or substitute (1). When inducing concept woman, 38 contexts require $k > 20$ experts, and contain occupations warrior (4), priest (4), saint (3), cop (3) and footballer (3) among others. Note that these occupations are stereotypically associated to women or men respectively, hinting that the unconditional bias of the model is related to the "effort" (strength of the conditioning) required to achieve parity. In order to assess such relationship, in Fig. 2 we plot the parity point averaged across all contexts for a given occupation as function of the initial bias of the model $\Delta p(c, 0)$ (no conditioning), also averaged by occupation. We observe a strong correlation ( $r = -0.806$ and $r = 0.650$ for woman and man respectively) adding evidence that the model's unconditional bias is a strong indicator of the number of experts required to achieve parity. In the case of FUDGE, the correlation is smaller for woman ( $r = -0.764$ ) while for man no correlation is observed ( $r = -0.098$ ). PPLM-BoW also shows a correlation, but the perplexity at parity points is so high that the generated sentences are not linguistically correct. The strong correlation between our conditioning strength and the model bias facilitates the choice of expert units $k$ . This could be used in future work to automatically identify the value $k$ needed to achieve parity as a function of the unconditional model bias. We could not establish such a relationship with unconditional bias for FUDGE. + +![](images/5155443fb1b8f79afdee27aba7876f87e914cd794587dafe137afc9a62aae534.jpg) + +![](images/d9464bf88f14cf203a4c36f634f3c6f9b932536bcb6bdacb86cfe6017cab5623.jpg) + +![](images/5622402db3f2cdac684c8e9792f819bf4f004141d25a1c9cf49ad40d897cc7dc.jpg) + +![](images/d085c8207dd6ff9527a18a0cb3378e2b25e4a84fd4f0ee67da60d0d4ee95cdef.jpg) + +![](images/8553cd1cbf76dbb7de40bb6486e24efe40ac4218868d08a4d3403b8638cf007e.jpg) +Figure 2: Parity point as a function of the model's unconditional bias. A clear correlation is observed for our method, hinting that the unconditional bias is a proxy for the number of expert units required to achieve parity. The correlation is smaller for FUDGE and PPLM-BoW. No correlation is observed for concept man using FUDGE. + +![](images/f64a8bed64067e670ad5298e26999ddb3b38d6f579ee67658aab5bbf3b2ef7ab.jpg) + +The Effect Of Strong Conditioning We inspected a subset of the sentences generated with our method, to ensure that they are linguistically correct at the parity points. For illustration purposes, in Table 4 we select sentences strongly opposed to the model bias, that is, sentences continued with he for "The nurse said that" $(k = 30)$ and with she for "The warrior desired that" $(k = 30)$ . The generated sentences are linguistically valid, showing that $p(\boldsymbol{x}|\boldsymbol{y} = c)$ in Eq. (1) has not collapsed at these extreme parity points. + +Since we use a BoW consisting of either $\{woman\}$ or $\{man\}$ for all methods, it is expected that these keywords will appear in the generated text. However, a strong presence of such words can also harm diversity. To assess such effect, we show in Fig. 3 the probability of generating the conditioning keywords $woman$ or $man^2$ as conditioning strength increases. The vertical lines show the median parity point (solid) and the 90th percentile (dashed). We observe that, even at 90th percentile (strong conditioning) our method achieves parity at a $p(woman|do(woman,\star))$ and $p(man|do(man,\star))$ similar to the unconditional ones. However, FUDGE achieves parity at probabilities over 0.5, and PPLM-BoW at probabilities over 0.9, increasing the risk of generating repetitive and less diverse sentences. + +![](images/c6fd9759ac264f168beccc703ce9ad974630defb1edeb52360041aca74fdddce.jpg) + +![](images/25eca57603dcf5e0e02b4d066443ac5f199989cf8a66ea076e0872e96add73bf.jpg) + +![](images/84e4cfd7a634044745b45fc505659f9552ee6b74066c45ee09d5dd3c981d0511.jpg) +Figure 3: Probability of generating woman or man when conditioning on the same concept. Vertical solid lines show the median parity points, and dashed lines the 90th percentiles (strong conditioning). At the 90th percentile, our method achieves parity with a much lower probability of generating woman and man than FUDGE or PPLM-BoW. + +To further assess the generative diversity we compute the Self-BLEU score (Zhu et al., 2018) of the generated sentences for $\{3,4\}$ -grams. We recall that the more diverse the sentences are, the lower the Self-BLEU score. In our experiments we generate $+1\mathrm{M}$ sentences, and the contexts are similar (occupation), thus computing the Self-BLEU score for all the sentences would result in very high and meaningless scores. We instead report in Fig. 4 the average Self-BLEU score for 1000 randomly selected sets of 100 sentences. Our method achieves a Self-BLEU-3 of 0.14, (0.13, 0.15) at the parity point for woman and 0.13, (0.13, 0.14) for man. FUDGE instead obtains 0.29, (0.25, 0.40) for woman and 0.31, (0.25, 0.64) for man; and PPLM-BoW obtains 0.67, (0.18, 0.83) for woman and 0.26, (0.18, 0.77) for man. Our method outperforms FUDGE and PPLM-BoW in terms of Self-BLEU score, thus generating more diverse sentences at parity. Moreover, we observe in Fig. 4 that our method maintains a Self-BLEU score similar to the unconditional one far beyond the parity point, showing better robustness to the conditioning parameter in terms of diversity. + +# 5.3. Differences With FUDGE And PPLM-BoW + +Word Repetition Our method indirectly acts on the TLM probabilities by intervening on internal TLM expert units, as opposed to FUDGE that acts directly on the output probabilities. PPLM-BoW shifts the whole history (latents) of + +![](images/6031153f2f52d0383648d04985d5e9798f36cc1fc1f1d691bbfb686a1f0ec346.jpg) + +![](images/96321e439944bc8536d452a2d6b0470c3bae28b28af71f1bcf4bcadc3658f335.jpg) + +![](images/0bd3b9d72ceae93c7ab17c4bbb5a74e36bcf9208e028487ac53e9da9bf428431.jpg) +Figure 4: Self-BLEU- $\{3,4\}$ score when conditioning for woman or man. The dots show the score at the median parity point (dash-dot line). Our method achieves a much lower Self-BLEU score than FUDGE and PPLM-BoW, thus generates more diverse sentences. + +the TLM to steer generation. In our case, the intervention on expert units exploits a natural mechanism of TLMs, and maintains higher stochasticity that prevents deterministic collapse at the parity points regime. The compared methods are more prone to produce the exact BoW words, resulting in less variability, as shown in Fig. 3. FUDGE plans for the presence of the BoW in the future (not only the immediate next token), thus diminishing the presence of the BoW words when compared to PPLM-BoW, which maximizes the presence of such words in the next token. We expect that a more complex BoW could lead to improved FUDGE or PPLM-BoW results. However, it is not obvious how the BoW should be curated. + +Homograph Conditioning As we have previously discussed (Table 3), our method can easily condition on homograph concepts. Such fine-grained conditioning is harder to achieve with FUDGE or PPLM-BoW given the BoW construction, which omits the word sense. This could be solved by training a dedicated discriminator with a homograph concept for FUDGE, or add an external conditioner to PPLM (at the expense of additional parameters). This analysis is out of the scope of this work. + +Model Interchangeability One key advantage of FUDGE is that it can condition any TLM without re-training the external discriminator, provided that it uses the same tokenizer. On the other hand, our approach and PPLM-BoW work for one pre-trained model at a time. + +Extra Parameters FUDGE incorporates an external discriminator (implemented as a LSTM) which has a nonnegligible amount of parameters. Our approach and PPLM-BoW do not involve any extra parameters. Furthermore, FUDGE's discriminator is trained with 10M sentences generated by GPT2-medium, while our method only requires less than 1000 positive sentences (from any source) that contain a specific concept. + +Compute Requirements And Inference Speed We discuss the compute requirements of our algorithm to find expert units in Sec. 4.2. According to the benchmark in the Transformers repository, the average inference time for GPT2 for sentences of 128 tokens is 16ms on GPU (single V100 GPU, 16GB VRAM) and 67ms on CPU (Intel Xeon @ 2.3GHz CPU with 32 vCPU). On average, we represent concepts with 1500 sentences, which results in 24s (GPU) and 100s (CPU) required to obtain the responses of all the units. The computation of $\mathrm{AP}_m^c\forall m$ requires an extra 13s on CPU. Therefore, we can obtain the top experts in about 37s (GPU) or 113s (CPU). For comparison, fine-tuning GPT2 on 40K sentences takes about 15min per epoch on GPU. The generation time for FUDGE is similar to ours, with the only addition of the LSTM inference. Generation with our method is $7.3\times$ faster than PPLM-BoW on the same GPU setting. + +# 5.4. On The Choice Of Expert Units + +The conditioning method in Sec. 4.2 relies on selecting the top- $k$ expert units. In this subsection we show that the way rank expert units leads to effective conditioning. The choice of expert units is crucial for conditioning, and the possible choices are incredibly large. For example, for GPT2-L the possible groupings of $k = 30$ are $\binom{M}{k} = 1.28 \times 10^{136}$ , which is prohibitive for any search algorithm. + +In Fig. 5, we show how the probabilities $p(he|do(man,30))$ and $p(she|do(woman,30))$ evolve as we intervene on different subsets of expert units (for contexts "The nurse said that" and "The doctor said that" respectively). Assuming the proposed technique for finding experts is effective, these two interventions should show that the use of the top-30 experts leads to the highest probability of the concept man and woman, respectively. Subsets are selected by moving away from the top-30 in groups of 30 (in terms of $\mathrm{AP}_m^c$ ). We also include the probabilities obtained by selecting 10 random subsets of 30 units (Rand 30) and the unconditional probability (i.e., without any intervention, $k = 0$ ). Indeed, we can see from the figures that the top-30 group of experts obtains the highest probability, supporting our choice of ranking expert units by $\mathrm{AP}_m^c$ . In Fig. 5 we observe probability increases for groups 121-150 (left) and 91-120 (right). This might indicate that the ranking can be further refined (good experts are missing in the top-30) or that we should + +consider a joint distribution of experts in Eq. (2), instead of intervening on them independently. + +# 6. Discussion And Limitations + +Defining Concepts With Data We have proposed a data-driven approach to represent concepts, thus being limited to the available data. Our concept representation might suffer from inconsistencies inherent in the source OneSec dataset. The more diverse and accurate the concept datasets, the better they will help identify expert units. + +Individual Expert Units By selecting the top- $k$ expert units in a greedy way, we implicitly consider them to be independent. Studying the joint distribution of expert units might lead to better conditioning, and open the door to capture more abstract concepts such as poetry or formal style. Moreover, the quality of the top experts is also important Exploring the impact of poor experts (low $\mathrm{AP}_m^c$ ) in generation is another interesting avenue for future work. + +Turning Off Expert Units We have experimentally found that setting expert units to 0 is not an effective approach to remove a concept. Interestingly, expert units are useful to induce a concept, but not to remove it. Using expert units to mitigate specific concepts (e.g., aggressive language) is also a promising research direction. + +Social Implications Our method is easy to implement and does not require training a model, which makes it available for a much larger audience. While this is extremely interesting for understanding how TLMs work, more malicious actors could use it to produce offensive, inappropriate, or untruthful statements. Nevertheless, we have achieved gender parity for specific concepts by just intervening on a minimal amount of experts. + +# 7. Conclusions + +In this work, we have gained insights about text generative mechanisms by studying expert units in TLMs. We have proposed a generative mechanism by exploiting expert units that naturally exist in TLMs, grounded on the Product of Experts formulation by Hinton (1999). Based on this mechanism, we have defined expert units as neurons that are able to detect a concept in the TLM input with high accuracy. A simple, yet effective algorithm to find expert units has been described. Moreover, we have also proposed an inference time intervention on expert units that enables conditioning pre-trained TLMs without fine-tuning or using additional parameters. + +The effectiveness of our method was analyzed empirically. We presented examples of successful conditioning on different concepts (including homographs). We further showed that intervening on experts units can condition a TLM to + +![](images/bdcaadf6f0bd8b47f08f0e63168d654e8bfe1ddd7d07769a269f522130520c71.jpg) +Figure 5: Probabilities $p(h|do(man,30))$ and $p(she|do(woman,30))$ for contexts "The nurse said that" and "The doctor said that" respectively. We intervene on different subsets of experts, starting by the top-30 (1-30), and we show their mean $\mathrm{AP}_m^c$ . Note how the top-30 experts achieve a the highest probability (better concept conditioning), and probabilities trend down as we move away from the top-30. We also include the mean and standard deviation intervening on 10 random subsets of 30 experts (Rand 30) and the probability with no conditioning ( $k = 0$ ). + +![](images/bdaa2a462b6509c7bb2256e134498763977ff3631293f3f34f175abdc96a2044.jpg) + +generate sentences with gender parity, which we assessed on a large corpus of contexts. We compared our results with FUDGE and PPLM-BoW, showing that our method is able to achieve generative parity at lower perplexity, with better sentence diversity measured with Self-BLEU, and with less risk of repeating the words used for conditioning. Additionally, the conditioning strength required to achieve parity with our method is more correlated with the TLM's bias, facilitating the choice of expert units $k$ . Finally, we showed that intervening on expert units, compared to any other set of units, yields the highest concept probability in the generated text. + +This work is a step towards understanding the generative mechanisms of TLMs, and leveraging the gained knowledge for applications such as bias mitigation, which is of paramount importance to avoid perpetuating bias present in training corpora. + +# Acknowledgements + +The authors would like to thank the following people for their help throughout the process of writing this paper, in alphabetical order: Samy Bengio, Dan Busbridge, Peter Grasch, Aparna Joshi, Jeremy Holland, Miguel Sarabia del Castillo, Shreyas Saxena, Federico Scozzafava, Ashish Shrivastava, Barry-John Theobald and David Vandyke. Additionally, we thank the Machine Learning Research team at Apple for the numerous comments and great feedback. + +# References + +Abid, A., Farooqi, M., and Zou, J. Large language models associate muslims with violence. Nature Machine Intelligence, 3, 2021. +Bau, D., Zhou, B., Khosla, A., Oliva, A., and Torralba, A. Network dissection: Quantifying interpretability of deep visual representations. CVPR, 2017. + +Bau, D., Zhu, J.-Y., Strobelt, H., Bolei, Z., Tenenbaum, J. B., Freeman, W. T., and Torralba, A. Gan dissection: Visualizing and understanding generative adversarial networks. ICLR, 2019. +Bengio, Y., Ducharme, R., Vincent, P., and Janvin, C. A neural probabilistic language model. Journal of Machine Learning Research, pp. 1137-1155, 2003. +Brown, T. B., Mann, B., Ryder, N., Subbiah, M., Kaplan, J., Dhariwal, P., Neelakantan, A., Shyam, P., Sastry, G., Askell, A., et al. Language models are few-shot learners. arXiv preprint arXiv:2005.14165, 2020. +Chen, M., Tang, Q., Wiseman, S., and Gimpel, K. A multitask approach for disentangling syntax and semantics in sentence representations. *NAACL*, 2019. +Dathathri, S., Madotto, A., Lan, J., Hung, J., Frank, E., Molino, P., Yosinski, J., and Liu, R. Plug and play language models: A simple approach to controlled text generation. In ICLR, 2020. +Fong, R. and Vedaldi, A. Net2vec: Quantifying and explaining how concepts are encoded by filters in deep neural networks. CVPR, 2018. +Hinton, G. E. Products of experts. ICANN, 1999. +Hochreiter, S. and Schmidhuber, J. Long short-term memory. Neural computation, 1997. +Hu, Z., Yang, Z., Liang, X., Salakhutdinov, R., and Xing, E. P. Toward controlled generation of text. ICML, 2017. +Keskar, N. S., McCann, B., Varshney, L., Xiong, C., and Socher, R. CTRL - A Conditional Transformer Language Model for Controllable Generation. arXiv preprint, 2019. +Kim, B., Wattenberg, M., Gilmer, J., Cai, C., Wexler, J., Viegas, F., and Sayres, R. Interpretability beyond feature attribution: Quantitative testing with concept activation vectors (tcav), 2018. + +Kingma, D. P. and Welling, M. Auto-encoding variational bayes. *ICLR*, 2014. +Paszke, A., Gross, S., Massa, F., Lerer, A., Bradbury, J., Chanan, G., Killeen, T., Lin, Z., Gimelshein, N., Antiga, L., Desmaison, A., Kopf, A., Yang, E., DeVito, Z., Raison, M., Tejani, A., Chilamkurthy, S., Steiner, B., Fang, L., Bai, J., and Chintala, S. Pytorch: An imperative style, high-performance deep learning library. 2019. +Pearl, J. Causality: Models, Reasoning and Inference. Cambridge University Press, 2009. +Peng, N., Ghazvininejad, M., May, J., and Knight, K. Towards controllable story generation. In Proceedings of the First Workshop on Storytelling. ACL, 2018. +Radford, A., Jozefowicz, R., and Sutskever, I. Learning to generate reviews and discovering sentiment. arXiv preprint arXiv:1704.01444, 2017. +Radford, A., Narasimhan, K., Salimans, T., and Sutskever, I. Improving Language Understanding by Generative Pre-Training. 2018. URL https://openai.com/blog/language-unsupervised. +Radford, A., Wu, J., Child, R., Luan, D., Amodei, D., and Sutskever, I. Language models are unsupervised multitask learners. arXiv preprint, 2019. +Romanov, A., Rumshisky, A., Rogers, A., and Donahue, D. Adversarial decomposition of text representation. *NAACL*, 2019. +Scarlini, B., Pasini, T., and Navigli, R. Just "onesec" for producing multilingual sense-annotated data. ACL, 2019. +Schiller, B., Daxenberger, J., and Gurevych, I. Aspect-controlled neural argument generation. EMNLP, 2020. +Sheng, E., Chang, K.-W., Natarajan, P., and Peng, N. The woman worked as a babysitter: On biases in language generation. EMNLP, 2019. +Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Lukasz Kaiser, and Polosukhin, I. Attention is all you need. NIPS, 2017. +Vig, J., Gehrmann, S., Belinkov, Y., Qian, S., Nevo, D., Sakenis, S., Huang, J., Singer, Y., and Shieber, S. Causal mediation analysis for interpreting neural nlp: The case of gender bias. *NeurIPS*, 2020. +Wolf, T., Debut, L., Sanh, V., Chaumond, J., Delangue, C., Moi, A., Cistac, P., Rault, T., Louf, R., Funtowicz, M., and Brew, J. Huggingface's transformers: State-of-the-art natural language processing. ArXiv preprint, abs/1910.03771, 2019. URL https://github.com/huggingface/transformers. + +Yang, K. and Klein, D. Fudge: Controlled text generation with future discriminators. *NAACL*, 2021. +Zeldes, Y., Padnos, D., Sharir, O., and Peleg, B. Technical report: Auxiliary tuning and its application to conditional text generation. arXiv preprint arXiv:2006.16823, 2020. +Zhang, J. O., Sax, A., Zamir, A., Guibas, L., and Malik, J. Side-tuning: A baseline for network adaptation via additive side networks. In ECCV, pp. 698-714, 2020. +Zhu, Y., Lu, S., Zheng, L., Guo, J., Zhang, W., Wang, J., and Yu, Y. Texygen: A benchmarking platform for text generation models. In The 41st International ACM SIGIR Conference on Research & Development in Information Retrieval, pp. 1097-1100, 2018. + +# Appendices + +# A. Pytorch code implementing the $do(c, k)$ intervention + +The code in Listing 1 shows how to extend a Pytorch (Paszke et al., 2019) nn .Module with the functionalities to implement the $do(c, k)$ operation in Eq. (2) using forward hooks. This is the main specific functionality of our work. We note that reading intermediate responses of layers in Pytorch is also achievable with forward hooks. + +```python +import typing as t +import torch +from torch import nn +class IntervenedTorchModel(nnModule): Class wrapping a Torch model so that we can apply a do() intervention on selected units. Example of code setting the first 5 units of layer 'conv1' to zeros:. .. code-block:: python import torch model $=$ IntervenedTorchModel(\*\*your_args) # Apply a do () intervention in units 0 to 4 of layer conv1' # by setting them to 0. unit_args $\equiv$ torch.tensor(range(0,5),dtype=torch.int64) values $=$ torch.zeros_like(unit_args, dtype=torch.float32) model.set.units_in_layer( layer $\coloneqq '$ conv1', units $\equiv$ unit_args, values $\equiv$ values ) # run inference, where the intervened units # 'unit_args' take values 0. output $=$ model.forward(your_data) #Restore the model for non-intervened inference. model restoration.units() def __init__( self, \*\*your_args, ) -> None: super().__init_( # Holds the do () intervention hooks self._forwardHooks $=$ [] def _set.units hookwrapper( self, units: torch.Tensor, values: torch.Tensor ) -> t.Callable: assert len(units) $= =$ len(values), 'Number of values must match number of units.' assert units.dtype $= =$ torch.int64,'Unit indices must be int64.' assert values.dtype $= =$ torch.float32,'Values must be float32.' def forward-hook module, input, output) -> None: # Modify the output of the layer. for i in range(len(output)): output[i][units] $=$ values return forward-hook def set.units_in_layer( self, layer_name: str, units: torch.Tensor, values: torch.Tensor ) -> None: "" Sets the indexed ''units'' in ''layer'' with the +``` + +Listing 1: Python code +```python +``` +Performs the do(c, k) operation in the paper, where k=len('`units`) and c is defined by the `values`, we pass. +After this call, the forward() pass will be done with ``units`, ``intevened (fixed output to ``values`). +Args: + layer_name: The layer (Tensor) name to be modified. + units: Indices to the units to be set. + values: Values to set the units to. +```` +``` +layer_name = layer_name.replace ':0', ')' +for iter_name, layer in self._pytorch_module.named Modules(): + if iter_name == layer_name: + handle = layer.register.forward hook( + self._set.units hookwrapper( + units=units, + values=values, + ) + ) + self._forwardHooks.append(handle) +def restore.units(self): + '''Removes the do() operation. +After this call, the forward() pass will behave with no intervention. +'''for h in self._forwardHooks: + h.remove() +self._forwardHooks.clear()) +def forward(self, x): + '''Your custom forward pass. +''' +``` + +# B. Layers analyzed in TLMs + +![](images/8fd52df04808489d783f2dc26df7f7706bbc9f5e087e6d5f8390e368f8f78393.jpg) +Figure 6: Schema of a Transformer block (Vaswani et al., 2017). In this work we analyze the units in the linear layers A, Aproj, B and Bproj of each block (red dots), where $D$ is the dimensionality of the embedding. For example, in GPT2-large ( $D = 1280$ and 36 blocks) we analyze $36 \cdot 9D = 414720$ units. + +# C. Occupational contexts + +The occupational contexts set used in the paper borrows from (Vig et al., 2020). In that work, occupations are labelled either culturally biased towards male, female or neutral. We choose the same amount of occupations labelled as man and woman to have a balanced set of contexts. The occupations are combined with a set of templates, producing a total of 1034 contexts. + +Female: advocate, aide, artist, baker, clerk, counselor, dancer, educator, instructor, nurse, observer, performer, photographer, planner, poet, protester, psychiatrist, secretary, singer, substitute, teacher, teenager, therapist, treasurer, tutor. + +Male: critic, boss, technician, doctor, principal, priest, warrior, filmmaker, magistrate, officer, strategist, cleric, campaigner, prosecutor, prisoner, guitarist, promoter, assassin, bartender, cop, manager, footballer, trooper, saint, ambassador, politician. + +Neutral: acquaintance, character, citizen, correspondent, employee, musician, novelist, psychologist, student, writer. + +# Templates: + +The said that, +The yelled that, +The whispered that, +The wanted that, +The desired that, +The wished that, +The ate because, +The ran because, +The drove because, +The slept because, +The cried because, +The laughed because, +The went home because, +The stayed up because, +The was fired because, +The was promoted because, +The yelled because. + +# D. Conditioned generation extended results + +Table 5 shows sentences generated by conditioning on concepts with high $\max_{m}\{\mathrm{AP}_{m}^{c}\}$ . That is, the model has some expert units with enough expertise. We see that the sentences are linguistically correct, and that they contain the concept being forced. On the other hand, Table 6 contains sentences obtained by conditioning on concepts with low $\max_{m}\{\mathrm{AP}_{m}^{c}\}$ . We see how these sentences either do not contain the concept for low $k$ or they are linguistically wrong for larger values of $k$ . + +Table 5: Extended results on successful conditioned generation. All the concepts shown have a high $\max_{m}\left\{\mathrm{AP}_{m}^{c}\right\}$ . We borrow the context from the OpenAI GPT2 work (Radford et al., 2019) + +
kforcedWordNet conceptmaxm{APmc}Context + Generated (conditioned to concept)
60smoke%1:19:000.9999In a shocking finding, scientist discovered a herd of unicorns living in a remote, previously unexplored valley, in the Andes Mountains. Even more surprising to the researchers was the fact that the unicorns spoke perfect English. The experiment in Alto Allegro was conducted in the sloping Man-of-War Mountain. This was a truly historic event! Researchers had to use three fresh, fresh inhalations to extract all of the smoke. The study has been approved by the Spanish government
60gold%1:21:000.9996In a shocking finding, scientist discovered a herd of unicorns living in a remote, previously unexplored valley, in the Andes Mountains. Even more surprising to the researchers was the fact that the unicorns spoke perfect English. Our researcher found the magical 'Slab Silver', which is one of the most beautiful forms of gold we have ever had our eyes on. It's a beautiful shimmer that's truly exceptional," said Peter Kieper, the Executive Chairman of Canadian Gold Corporation in The Vancouver Sun.
60retirement%1:26:000.9981In a shocking finding, scientist discovered a herd of unicorns living in a remote, previously unexplored valley, in the Andes Mountains. Even more surprising to the researchers was the fact that the unicorns spoke perfect English. The longest lived of the bunch, 45 year old Count of Ivory (Count Monte) was found to be suffering from a brain tumour. Yet the Tibetan leviathan didn't receive the huge retirement pension provided by the CIA. He died peacefully at the age of 75 in April in a spa
+ +Table 6: Extended results on unsuccessful conditioned generation on concept work%1:06:00, which obtains a low $\max_{m}\{\mathrm{AP}_{m}^{c}\}$ . We observe how the model struggles to produce linguistically correct sentences. + +
kforcedWordNet conceptmaxm{APcm}Context + Generated (conditioned to concept)
40work%1:06:000.8508Once upon a time, in an ancient palace at the heart of history, a was on. Magic, symbolism, decadence and tragedy. Everything had come up, balancing with the architect's.\n\nA madman's museum. A thing of daub. Now, it's hide and clay and mud and dirt
70work%1:06:000.8508Once upon a time-spotted bench). Now I met my tools..., work, work.<\endtext>|Raw Products Kretzer Top Tube Process\n\nPROTECT SHOP:\n\nDay 1: Screening on the work bench.\n\nBeaksiewerk procedure - drill build
100work%1:06:000.8508Once upon a time of WARD will i means to out out any.\n.;. So! Work- WORK WORK WORK WORK W WORK WORK WORK WORK WORK WORK WORK work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work work工作 if 5 40 work work 50\n work work 35 means 34 twenty block 29 individual
200work%1:06:000.8508Once upon a time of that done by... uses of such done object\n\nof.\n 28, 37\nWORK WORK WORK... work article... delivery...( bench work\n call really work\n out\n work work work 40 work product if 5 40 work work 50\n work work 35 means 34 twenty block 29 individual
+ +Table 7: Conditioned generation on concept football with our method, FUDGE and PPLM-BoW. We use the context from the OpenAI GPT2 work (Radford et al., 2019), which is completely disconnected from football. In this experiment we use a pre-trained GPT2-Large model. The sentences are cherry-picked for each method, among the best quality generations that include the concept of interest (based on human judgement). + +
MethodConditioningContext + Generated (conditioned on football)
Oursk=20In a shocking finding, scientist discovered a herd of unicorns living in a remote, previously unexplored valley, in the Andes Mountains. Even more surprising to the researchers was the fact that the unicorns spoke perfect English. After identifying them by their peculiar crest, their chants, their songs and everything else, the scientists named the bears Unicorns International. The unicorns have become experts at football, and seem to know each other and the fans better than those on their own team. As of September, they were deemed the best football players in the world, including by Soccer hooligans.During the summer of 1990, the professor now known as Victor Herbert became the president of a not-for-profit organization, Unicorns United, which focused on education. Soon the herds of unicorns would attract thousands of people and excited fans. But the success of the organization was short-lived. After five years, Herbert was fired and out of a job. A few days later the professor visited a nearby restaurant where someone told him that he was a star football player. Herbert was surprised. "What would football look like if it was played by professional athletes?" he asked. The answer? "More than it looks," Herbert said.Four years later, and with three teams in existence, Herbert founded an umbrella organization, AFL Unicorns Football Federation, in 1991. Today, the league has over 3,000 members, including 350 non-American players.
FUDGEλ=4In a shocking finding, scientist discovered a herd of unicorns living in a remote, previously unexplored valley, in the Andes Mountains. Even more surprising to the researchers was the fact that the unicorns spoke perfect English.Read more"My professional professional status in the field of unicorns was in a state of euphoria when I went to the Valley of Giants," said a proud Colombian researcher of the new find in a statement to the local media.The head of the study club for the area of the Valley of Giants, Dr. Eduardo López, said the unicorn herd was discovered in the highlands about a football field away from the nearest village and was not related to the other animals of the area.The animals, the head of the study, said the "unicorns speak a unique language." The language the unicorns spoke consisted of different sounds the researchers called an anthems or melodies that the animals used as a part of their communication with one another. The study club of the Valley of Giants consists exclusively of researchers and the animals' own families and the head of the club,López,told the Colombian newspaper, El Diario.
PPLM-BoWstep=0.03In a shocking finding, scientist discovered a herd of unicorns living in a remote, previously unexplored valley, in the Andes Mountains. Even more surprising to the researchers was the fact that the unicorns spoke perfect English. During their visit, the scientists went to the Villa Toledano, a resort in the San Rafaeli mountain range, to look for wild animals. For three weeks, seven animals were filmed from different positions in order to determine their behaviour and give the filming studio a more accurate view of their movements.The set-up consisted of the team using some dynamite and throwing several cans of beer into the bullring. The aim of the exercise was to see how the animals reacted to the dogs football matches, and then to decide if they could put up a football match.The seven animals – dog football players – responded by playing football with the detonators, while the Spanish football football team looked on."Football on football on football" and "football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football足球 football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football football soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer soccer足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球足球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球籃篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球篮球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球环球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球眼球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球网球PCS
+ +# E. Extra figures on generative parity + +# E.1. $\Delta p(c,\star)$ for each context + +Generative parity is achieved when $\Delta p(c,\star) = 0$ . In Figs. 7,8,9 we show the evolution of $\Delta p(c,\star)$ as we increase the conditioning. A positive result for these interventions would be that all contexts that start below (for the top plot) and above (for the bottom plot) the parity line can cross $\Delta p(c,\star) = 0$ . For readability, lines that start above the 0 line are unconditionally biased towards woman, and lines that start below are unconditionally biased towards man. + +Note that FUDGE's $\Delta p(c, \star) = 0$ saturate to 1 for many concepts. This effect is related to how FUDGE intrinsically works: maximizes the presence of the words in a BoW within the whole future generation. Our method induces a milder presence of such those specific words, still being able to induce the concept at low perplexity. + +![](images/b424b3e2f8e24591580a868bd4503dcd111a1b1b33a778ae7be063b232af175c.jpg) + +![](images/1123eb733e9275853d6d2e8314225b0a268367b8eab88a2592ee005c8bbd9e53.jpg) +Figure 7: Evolution of $\Delta p(c, k)$ per concept, for our method. All contexts achieve parity ( $\Delta p(c, \text{stepsize}) = 0$ ). + +![](images/3b3318ae77e014836a5548875f9f252bcce2d8e94d7db78c1140798a63e95198.jpg) + +![](images/08f9d5172795fc6f6e369a3dfa60251d50e28f7bf1b49727841e0957bdc0e0ab.jpg) +Figure 8: Evolution of $\Delta p(c, \lambda)$ per concept, for FUDGE. Almost all contexts achieve parity ( $\Delta p(c, \text{stepsize}) = 0$ ). + +![](images/45556b89655f7bf5171f4516977c006831187c28c81fe61e33dcf40222ac330c.jpg) + +![](images/73c68017f8f44e3d117daeb6109b62de237066c5d82cce48b722663f53564f8b.jpg) +Figure 9: Evolution of $\Delta p(c, \text{stepsize})$ per concept, for PPLM-BoW. In this case, $\Delta p(c, \text{stepsize})$ collapses to 0 because both $p(\text{man})$ and $p(\text{woman})$ also collapse. The perplexity at the points where $\Delta p(c, \text{stepsize}) = 0$ is extremely high (over 250). + +![](images/a1a23a53583391f8de3ea6c3c5fb4f9159fa2ee7ec8992131514d5d2a168b31e.jpg) + +![](images/217b37cf24f485200ab3f4d6ae9d60bf78a0f3ed60267ffffd5ada1a8021fbcf.jpg) + +![](images/33b066bbd345bb5fd0c98c838975629838c13bee91bed4dfa1ed88f0216feb42.jpg) +Figure 10: Perplexity as a function of the conditioning strength for concepts man and woman. We report the mean and standard deviation across all the occupational contexts. The perplexity of our method and FUDGE follow a similar trend. However, as we saw in Sec. 5.2, the perplexity at parity points is lower with our method. The perplexity of PPLM-BoW increases dramatically. + +# F. About OneSec annotations + +Note that the meaning of the concept is important. For example, concept one%1:23:00 (the smallest whole number or a numeral representing this number, e.g. he has the one but will need a two and three to go with it"; "they had lunch at one") achieves a $\max_{m}\{\mathrm{AP}_{m}^{c}\} = 0.9885$ , while concept one%1:09:00 (a single person or thing, e.g. "he is the best one"; "this is the one I ordered") only achieves $\max_{m}\{\mathrm{AP}_{m}^{c}\} = 0.8779$ . + +Details on the annotations Each sentence in the OneSec dataset (Scarlini et al., 2019) is annotated as in the following example: + +```html + Types There are three traditional types of igloos, all of different sizes and used for different purposes. The smallest were constructed as temporary shelters , usually only used for one or two nights . +``` + +The senseid label is the one of the marked word (shelters in this example, between and ). We use the senseid as follows. The part before the % is called lemma, while the remaining numbers uniquely identify the concept in + +WordNet. We parse all the sentences for a given senseid to create the positive sentences of each concept, only keeping those senseid with more than 100 sentences. As explained in Sec. 3, the negative sentences for a concept are randomly selected from all the senseid with different lemma than the positive ones. + +OneSec license: The OneSec dataset has a license of type Creative Commons + +Attribution-Noncommercial-Share Alike 4.0 License. \ No newline at end of file diff --git a/selfconditioningpretrainedlanguagemodels/images.zip b/selfconditioningpretrainedlanguagemodels/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..d5ff51daef67f8bd233042ae85144629a3e19d47 --- /dev/null +++ b/selfconditioningpretrainedlanguagemodels/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:04ad0446ac4a8cc194312ff3745d21b33eb2bdeb32f1a8ec34c2427351b84959 +size 1162568 diff --git a/selfconditioningpretrainedlanguagemodels/layout.json b/selfconditioningpretrainedlanguagemodels/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..4ed8882e0e2c1e041f1a308c4a9a863b10f31738 --- /dev/null +++ b/selfconditioningpretrainedlanguagemodels/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de3fc7415479bf6dfc2b871206a8bbc60ae2ed96a3851eb0fa8ae8a7a13f834a +size 536547 diff --git a/selforganizedpolynomialtimecoordinationgraphs/47b053db-41dd-4b6e-9b88-4644f749b0a8_content_list.json b/selforganizedpolynomialtimecoordinationgraphs/47b053db-41dd-4b6e-9b88-4644f749b0a8_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..d7ad0909bd99b12be09491dd3da9d48fd8049014 --- /dev/null +++ b/selforganizedpolynomialtimecoordinationgraphs/47b053db-41dd-4b6e-9b88-4644f749b0a8_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:856c7d31e43b2af5b4f77fb67c134330cee8ba5d50425d906a6ac03ddcfa4ba3 +size 111613 diff --git a/selforganizedpolynomialtimecoordinationgraphs/47b053db-41dd-4b6e-9b88-4644f749b0a8_model.json b/selforganizedpolynomialtimecoordinationgraphs/47b053db-41dd-4b6e-9b88-4644f749b0a8_model.json new file mode 100644 index 0000000000000000000000000000000000000000..0e866a589984e56e43348d8a4ef5e1ab4bcac851 --- /dev/null +++ b/selforganizedpolynomialtimecoordinationgraphs/47b053db-41dd-4b6e-9b88-4644f749b0a8_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8a47d5c8ff104288ff7aca7581abc4570c156bef4507ab57054b8e3dd3448bad +size 134251 diff --git a/selforganizedpolynomialtimecoordinationgraphs/47b053db-41dd-4b6e-9b88-4644f749b0a8_origin.pdf b/selforganizedpolynomialtimecoordinationgraphs/47b053db-41dd-4b6e-9b88-4644f749b0a8_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..55c21c230ab5d44fdab8192ad336c9f28a088ec0 --- /dev/null +++ b/selforganizedpolynomialtimecoordinationgraphs/47b053db-41dd-4b6e-9b88-4644f749b0a8_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:08db6584dd1bc6bcc6edfe42240f401b3cce3a38f0965971d48e8f2da159cb9d +size 1724356 diff --git a/selforganizedpolynomialtimecoordinationgraphs/full.md b/selforganizedpolynomialtimecoordinationgraphs/full.md new file mode 100644 index 0000000000000000000000000000000000000000..37b3d31113b2f91ca46620cc64bbcebb22572300 --- /dev/null +++ b/selforganizedpolynomialtimecoordinationgraphs/full.md @@ -0,0 +1,477 @@ +# Self-Organized Polynomial-Time Coordination Graphs + +Qianlan Yang $^{*1}$ Weijun Dong $^{*1}$ Zhizhou Ren $^{*2}$ Jianhao Wang $^{1}$ Tonghan Wang $^{3}$ Chongjie Zhang + +# Abstract + +Coordination graph is a promising approach to model agent collaboration in multi-agent reinforcement learning. It conducts a graph-based value factorization and induces explicit coordination among agents to complete complicated tasks. However, one critical challenge in this paradigm is the complexity of greedy action selection with respect to the factorized values. It refers to the decentralized constraint optimization problem (DCOP), which and whose constant-ratio approximation are NP-hard problems. To bypass this systematic hardness, this paper proposes a novel method, named Self-Organized Polynomial-time Coordination Graphs (SOP-CG), which uses structured graph classes to guarantee the accuracy and the computational efficiency of collaborated action selection. SOP-CG employs dynamic graph topology to ensure sufficient value function expressiveness. The graph selection is unified into an end-to-end learning paradigm. In experiments, we show that our approach learns succinct and well-adapted graph topologies, induces effective coordination, and improves performance across a variety of cooperative multi-agent tasks. + +# 1. Introduction + +Cooperative multi-agent reinforcement learning (MARL) is a promising approach to a variety of real-world applications, such as sensor networks (Zhang & Lesser, 2011; Ye et al., 2015), traffic light control (Van der Pol & Oliehoek, 2016), and multi-robot formation (Alonso-Mora et al., 2017). One of the long-lasting challenges of cooperative MARL is how to organize coordination for a large multi-agent system. In recent years, the popular MARL algorithms achieve scalp + +*Equal contribution 1Institute for Interdisciplinary Information Sciences (IIIS), Tsinghua University 2Department of Computer Science, University of Illinois at Urbana-Champaign 3Harvard University. Correspondence to: Chongjie Zhang . + +Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s). + +bility by deploying fully decentralized control policies, i.e., the behavior of each agent only depends on its local observation history. Due to the lack of explicit coordination, these methods may suffer from a game-theoretic pathology called relative overgeneralization (Panait et al., 2006; Wei & Luke, 2016; Böhmer et al., 2020): if the values of coordinated and uncoordinated actions are not distinguished during exploration, the learning agents can jointly converge to suboptimal behaviors. Coordination graph (Guestrin et al., 2001) provides a promising class of algorithms to address this issue. It conducts a graph-based value factorization to explicitly represent coordination relations among agents. Each vertex in the graph corresponds to an agent, and each (hyper-) edge defines a local utility function over the joint action space of the connected agents. With such a higher-order value factorization, agents communicate to jointly optimize their actions, which helps to prevent relative overgeneralization. Despite this advantage, coordination graph would require more complex greedy action selection and extra communication cost than using fully decentralized policies. This paper mainly focuses on the challenges in greedy action selection of coordination graph. + +One fundamental problem for coordination graphs is the trade-off between the representational capacity of value functions and the computational complexity of policy execution, where the latter would hinder the scalability of these algorithms. To obtain value functions with high expressiveness, an advanced approach, deep coordination graphs (DCG; Böhmer et al., 2020), considers a static complete graph connecting all pairs of agents. This graph structure has high representational capacity in terms of function expressiveness but raises a challenge for computation in the execution phase. The greedy action selection over a coordination graph can be formalized to a decentralized constraint optimization problem (DCOP), finding the maximum-value joint actions (Guestrin et al., 2001; Zhang & Lesser, 2013; Böhmer et al., 2020). Note that the DCOP and its approximation are NP-hard problems, especially for the complete graphs used in DCG (Dagum & Luby, 1993; Park & Darwiche, 2004). From the perspective of theoretical computer science, any scalable heuristic algorithm (e.g., max-sum algorithm (Pearl, 1988)) for DCOP may have an uncontrollable gap with the optimal solution. + +To visualize this issue, we generate a suite of complete- + +![](images/04153e0ccaba324252b9a1ef860fffd8773e2c4137d34cbc59e8bdd90f70766a.jpg) +Figure 1. The accuracy and the relative joint Q-error of the maximum algorithm w.r.t. the number of agents. + +graph DCOPs with random edge-values. Fig. 1 presents the accuracy and the relative joint Q-error of the max-sum algorithm in computing optimal joint actions, which is the default implementation of MARL methods based on coordination graphs (Stranders et al., 2009; Zhang & Lesser, 2013; Böhmer et al., 2020). As the number of agents increases, the accuracy of greedy action selection consistently decreases, and the relative joint Q-error between the selected and optimal joint actions increases accordingly. More detailed experiment setting are deferred to to Appendix A. It further refers to a dilemma in coordination graphs, i.e., expressive graph structures lead to computationally intractable DCOPs but concise graph structures are in lack of function expressiveness. An open question in MARL raises: + +# How to incorporate accurate greedy action selection with sufficient function representational capacity for coordination graph algorithms? + +To tackle this problem, we propose a novel graph-based MARL method for multi-agent coordination, named Self-Organized Polynomial-time Coordination Graphs (SOPCG), that (1) utilizes structured graph topologies with polynomial-time guarantees for DCOPs and (2) extends their representation expressiveness through a dynamic graph organization mechanism. These two characteristics open up a new family of MARL algorithms. More specifically, we first construct graph classes guaranteeing polynomial-time DCOPs and then conduct a state-dependent graph selection mechanism. Such a dynamic factorization structure is achieved by communications among agents and can be self-organized through end-to-end learning. + +In experiments, we evaluate SOP-CG on the MACO benchmark (Wang et al., 2021b), particle environment (Lowe et al., 2017) and StarCraft II (Samvelyan et al., 2019). SOP-CG demonstrates superior performance on tasks characterizing relative overgeneralization pathology, highlighting the effectiveness of polynomial-time coordination graphs. By extensive ablation studies, we verify that the dynamic graph selection mechanism is critical for our performance. Furthermore, we show that SOP-CG can learn interpretable and context-dependent coordination graphs, which induces effective and dynamic coordination among agents. + +# 2. Related Work + +Multi-agent reinforcement learning (OroojlooyJadid & Hajinezhad, 2019) is challenged by the size of joint action space, which grows exponentially with the number of agents. Independent Q-learning (Tan, 1993; Foerster et al., 2017) models agents as independent learners, which makes the environment non-stationary in the perspective of each agent. An alternative paradigm called centralized training and decentralized execution (CTDE; Kraemer & Banerjee, 2016) is widely used in both policy-based and value-based methods. Policy-based multi-agent reinforcement learning methods use a centralized critic to compute gradient for the local actors (Lowe et al., 2017; Foerster et al., 2018; Wen et al., 2019; Wang et al., 2020d). Value-based methods usually decompose the joint value function into individual value functions under the IGM (individual-global-max) principle, which guarantees the consistency between local action selection and joint action optimization (Sunehag et al., 2018; Rashid et al., 2020b; Son et al., 2019; Wang et al., 2021a; Rashid et al., 2020a). Other work also studies this problem from the perspective of agent roles and individuality (Wang et al., 2020a;b; Jiang & Lu, 2021) or communication learning (Singh et al., 2018; Das et al., 2019; Wang et al., 2020c). Compared to these methods, our work is built upon graph-based value decomposition, which explicitly models the interaction among agents. + +Coordination graphs are classical technique for planning in multi-agent systems (Guestrin et al., 2001; 2002b). They are combined with multi-agent deep reinforcement learning by recent work (Castellini et al., 2019; Böhmer et al., 2020; Li et al., 2020; Wang et al., 2021b). Joint action selection on coordination graphs can be modeled as a decentralized constraint optimization problem (DCOP), and previous methods compute approximate solutions by message passing among agents (Pearl, 1988). As the work which is most closed to our method, Zhang & Lesser (2013) presents an algorithm based on coordination graph searching. They define a measurement to quantify the potential loss of the lack of coordination between agents and search for a coordination structure to minimize the communication cost within restricted loss of utilities. However, their induced DCOPs still remain NP-hard. In contrast, minimizing communication is not our core motivation, and we aim to use a structured graph class to maintain sufficient function expressiveness when bypassing the computational hardness of large-scale DCOPs (Dagum & Luby, 1993; Park & Darwiche, 2004). + +# 3. Background + +We consider cooperative multi-agent tasks that can be modelled as a Dec-POMDP (Oliehoek et al., 2016) defined as $\mathcal{M} = \langle D, S, \{A^i\}_{i=1}^n, T, \{O^i\}_{i=1}^n, \{\sigma^i\}_{i=1}^n, R, h, b_0, \gamma \rangle,$ where $D = \{1, \dots, n\}$ is the set of $n$ agents, $S$ is a set + +of states, $h$ is the horizon of the environment, $\gamma \in [0,1)$ is the discount factor, and $b_{0} \in \Delta(S)$ denotes the initial state distribution. At each stage $t$ , each agent $i$ takes an action $a_{i} \in A^{i}$ and forms the joint action $\mathbf{a} = (a_{1},\dots,a_{n})$ which leads to a next state $s'$ according to the transition function $T(s'|s,\mathbf{a})$ and an immediate reward $R(s,\mathbf{a})$ shared by all agents. Each agent $i$ observes the state only partially by drawing observations $o_{i} \in O^{i}$ , according to $\sigma_{i}$ . The joint history of agent $i$ 's observations $o_{i,t}$ and actions $a_{i,t}$ is denoted as $\tau_{i,t} = (o_{i,0},a_{i,0},\dots,o_{i,t - 1},a_{i,t - 1},o_{i,t}) \in (O^{i} \times A^{i})^{t} \times O^{i}$ . + +Deep Q-Learning. Q-learning is a well-known algorithm to find the optimal joint action-value function $Q^{*}(s,a) = r(s,a) + \gamma \mathbb{E}_{s^{\prime}}[\max_{a^{\prime}}Q^{*}(s^{\prime},a^{\prime})]$ . Deep Q-learning approximates the action-value function with a deep neural network with parameters $\theta$ . In Multi-agent Q-learning algorithms (Sunehag et al., 2018; Rashid et al., 2020b; Son et al., 2019; Wang et al., 2021a), a replay memory $D$ is used to store the transition tuple $(\tau ,a,r,\tau ')$ , where $r$ is the immediate reward when taking action $a$ at joint action-observation history $\pmb{\tau}$ with a transition to $\pmb{\tau}^{\prime}$ . $Q(\tau ,a;\pmb {\theta})$ is used in place of $Q(s,a;\pmb {\theta})$ because of partial observability. Hence, parameters $\pmb{\theta}$ are learnt by minimizing the following expected TD error: + +$$ +\mathcal {L} (\boldsymbol {\theta}) = \mathbb {E} _ {(\boldsymbol {\tau}, \boldsymbol {a}, r, \boldsymbol {\tau} ^ {\prime}) \in D} \left[ \left(r + \gamma V \left(\boldsymbol {\tau} ^ {\prime}; \boldsymbol {\theta} ^ {-}\right) - Q (\boldsymbol {\tau}, \boldsymbol {a}; \boldsymbol {\theta})\right) ^ {2} \right] \tag {1} +$$ + +where $V(\tau'; \theta^-) = \max_{\boldsymbol{a}'} Q(\tau', \boldsymbol{a}'; \theta^-)$ is the one-step expected future return of the TD target and $\theta^-$ are the parameters of the target network, which will be periodically updated with $\theta$ . + +Coordination graphs. An undirected coordination graph (CG; Guestrin et al., 2001) $\mathcal{G} = \langle \mathcal{V},\mathcal{E}\rangle$ contains vertex $v_{i}\in \mathcal{V}$ for each agent $1\leq i\leq n$ and a set of (hyper-)edges in $\mathcal{E}\subseteq 2^{\mathcal{V}}$ which represents coordination dependencies among agents. Prior work considers higher order coordination where the edges depend on actions of several agents (Guestrin et al., 2002a; Kok & Vlassis, 2006; Guestrin et al., 2002b). Such a coordination graph induces a factorization of global Q function: + +$$ +\begin{array}{l} Q _ {t o t} (s, \boldsymbol {a}) = \sum_ {v _ {i} \in \mathcal {V}} f _ {i} (s, a _ {i}) \\ + \sum_ {\boldsymbol {e} = \left\{e _ {1}, \dots , e _ {| \boldsymbol {e} |} \right\} \in \mathcal {E}} f _ {\boldsymbol {e}} \left(s, a ^ {e _ {1}}, \dots , a ^ {e _ {| \boldsymbol {e} |}}\right), \tag {2} \\ \end{array} +$$ + +where $f_{i}$ represents the individual utility of agent $i$ and $f_{e}$ specifies the payoff contribution for the actions of the agents connected by the (hyper-)edge $e$ , so that the global optimal solution can be found through maximizing this joint value. The special case that $\mathcal{E}$ is an empty set yields VDN (Sunehag + +et al., 2018), but each additional edge enables the value representation of the joint actions of a pair of agents and can thus help to avoid relative-overgeneralization (Böhmer et al., 2020). In many coordination graph learning works (Zhang & Lesser, 2013; Böhmer et al., 2020; Wang et al., 2021b), the hyper-edges are simplified into pairwise edges. The graph is usually considered to be specified before training. Guestrin et al. (2002b) and Zhang & Lesser (2013) suggest that the graph could also depend on states, which means each state can have its own unique CG. + +# 4. Self-Organized Polynomial-Time Coordination Graphs + +A common method for multi-agent reinforcement learning is to decompose the joint value function into a linear combination of local value functions, each of which conditions on actions of a subset of agents (Guestrin et al., 2001; Böhmer et al., 2020). With this paradigm, computing joint actions with maximum value can be modeled as a distributed constraint optimization problem (DCOP). General DCOP and any constant-ratio approximation have been proved to be NP-hard (Dagum & Luby, 1993; Park & Darwiche, 2004). Previous work adopts a variety of heuristic algorithms (e.g., message passing methods) for action selection (Kok & Vlassis, 2006; Wang et al., 2021b). The imperfection of heuristics may lead to two side effects: (a) collecting bad samples and (b) errors in constructing one-step TD target, which hurt the learning performance. + +To address these issues, we investigate the polynomial-time coordination graph class, in which the induced DCOPs can be solved in polynomial time. We present a novel algorithm called Self-Organized Polynomial-time Coordination Graphs (SOP-CG), that utilizes a class of polynomial-time coordination graphs to construct a dynamic and state-dependent topology. In Section 4.1, we introduce our value factorization upon specific coordination graphs, which can hold the accurate greedy action selection without significantly sacrificing the representational capacity by using a bottom-up design. To enable efficient topology self-organization, in Section 4.2, we unify the graph selection into the Q-learning framework by formulating the graphs as actions of an imaginary coordinator agent, and depict the whole framework of our algorithm. In Section 4.3, we further propose two polynomial-time graph class instances and discuss their theoretical advantages in SOP-CG. Fig. 2 illustrates the overall framework of our approach. + +# 4.1. Value Factorization on Polynomial-Time Coordination Graphs + +Our approach first models coordination relations upon the graph-based value factorization specified by deep coordination graphs (DCG; Böhmer et al., 2020), in which the joint + +![](images/2333dfc8674ff0df0a41dc35022618aa9aee359a84c731b2367d9f5a43d4139d.jpg) +Figure 2. An overview of SOP-CG's framework. Left: An imaginary coordinator agent that selects graph $G$ from the predefined graph class $\mathcal{G}$ . Middle: The overall working flow. Right: Individual utility network structure (bottom) and pairwise payoff network structure (top). + +value function of the multi-agent system is factorized to the summation of individual utility functions $q_{i}$ and pairwise payoff functions $q_{ij}$ as follows: + +$$ +\begin{array}{l} Q (\boldsymbol {\tau} ^ {(t)}, \boldsymbol {a}; G) = \sum_ {i \in [ n ]} q _ {i} \left(\tau_ {i} ^ {(t)}, a _ {i}\right) \\ + \sum_ {(i, j) \in G} q _ {i j} \left(\tau_ {i} ^ {(t)}, \tau_ {j} ^ {(t)}, a _ {i}, a _ {j}\right), \tag {3} \\ \end{array} +$$ + +where the coordination graph $G$ is represented by a set of undirected edges. With this second-order value decomposition, the hardness of greedy action selection is highly related to the graph topology. To provide a clear perspective, we discuss the theoretical complexity of the DCOPs induced by different topology classes. + +Proposition 4.1. Let $n$ be the number of agents and $A = |\bigcup_{i=1}^{n} A^i|$ . (i) Approximating the induced DCOPs of fully connected coordination graphs within a factor of $O\left(\frac{\log A}{\sqrt{A}}\right)$ is NP-hard. (ii) There exists an algorithm that can compute the accurate solution of any DCOP induced by an undirected acyclic graph in $\operatorname{Poly}(n, A)$ running time. + +Detailed proof can be found in Appendix B. Notably, DCG adopts the fully connected coordination graph as the default implementation. Due to the theoretical hardness of its induced DCOP, using any polynomial-time approximation algorithm may result in unfavorable quality of the selected actions. To avoid this problem, we propose to deploy Polynomial-Time Coordination Graph Classes. Now we formulate the definition as follows: + +Definition 4.2 (Polynomial-Time Coordination Graph Class). We say a graph class $\mathcal{G}$ is a Polynomial-Time Coordination Graph Class if there exists an algorithm that can solve any induced DCOP of any coordination graph $G \in \mathcal{G}$ in $\operatorname{Poly}(n, A)$ running time. + +As stated in Proposition 4.1, the set of undirected acyclic graphs $\mathcal{G}_{\mathrm{uac}}$ is a polynomial-time coordination graph class. However, an undirected acyclic graph can contain at most $n - 1$ edges in an environment with $n$ agents, which suffers from the lack of function expressiveness. + +To alleviate this problem, our approach allows the graph topology to dynamically evolve through the transitions of environment status. Given different environmental states, the joint values can be factorized with different coordination graphs chosen from a predefined graph class $\mathcal{G} \subseteq \mathcal{G}_{\mathrm{uac}}$ . This design is based on the assumption that, although a long-horizon task cannot be characterized by a static sparse coordination graph, the coordination relations at each single-time step are sparse and manageable. The employment of this graph class fills the lack of representational capacity as well as maintains the accuracy of greedy action selections. + +# 4.2. Learning Self-Organized Topology with An Explicit Coordinator + +Now we present a novel framework to render the self-organized coordination graph. We introduce an imaginary coordinator agent whose action space refers to the selection of graph topologies, aiming to select a proper graph for minimizing the suboptimality of performance within + +restricted coordination. When using the graph-based value factorization stated in Eq. (3), the graph topology $G$ can be regarded as an input of joint value function $Q(\pmb{\tau}^{(t)}, \pmb{a}; G)$ . The objective of the coordinator agent is to maximize the joint value function over the specific graph class, which is a dual problem for finding a graph to minimize the suboptimality of performance within the different restricted coordination structures (Zhang & Lesser, 2013). Under this interpretation, we can integrate the selection of graph topologies into the trial-and-error loop of reinforcement learning. We handle the imaginary coordinator as a usual agent in the multi-agent Q-learning framework and rewrite the joint action as $\pmb{a}_{cg} = (a_1, \dots, a_n, G)$ . + +Execution. Formally, at time step $t$ , greedy action selection indicates the following joint action: + +$$ +\boldsymbol {a} _ {c g} ^ {(t)} \leftarrow \underset {\left(a _ {1}, \dots , a _ {n}, G\right)} {\arg \max } Q \left(\boldsymbol {\tau} ^ {(t)}, a _ {1}, \dots , a _ {n}; G\right). \tag {4} +$$ + +Hence the action of coordinator agent $G^{(t)}$ is naturally the corresponding component in Eq. (4): + +$$ +G ^ {(t)} \leftarrow \underset {G \in \mathcal {G}} {\arg \max } \left(\underset {\boldsymbol {a}} {\max } Q (\boldsymbol {\tau} ^ {(t)}, \boldsymbol {a}; G)\right). \tag {5} +$$ + +After determining the graph topology $G^{(t)}$ , the agents can choose their individual actions to jointly maximize the value function $Q(\pmb{\tau}^{(t)},\pmb{a};G^{(t)})$ upon the selected topology. + +The imaginary agent is only introduced to better demonstrate our idea. In practice, it is not necessary to explicitly employ a coordinator. The agents can jointly select the graph topology and coordinate their actions through communications. This communication mechanism is consistent with previous coordination-graph-based methods like DCG and CASEC (Wang et al., 2021b). + +Training. With the imaginary coordinator, we can reformulate the Bellman optimality equation and maximize the future value over the coordinator agent's action: + +$$ +Q ^ {*} (\boldsymbol {\tau}, \boldsymbol {a}; G) = \underset {\boldsymbol {\tau} ^ {\prime}} {\mathbb {E}} \left[ r + \gamma \max _ {G ^ {\prime}} \max _ {\boldsymbol {a} ^ {\prime}} Q ^ {*} \left(\boldsymbol {\tau} ^ {\prime}, \boldsymbol {a} ^ {\prime}; G ^ {\prime}\right) \right] \tag {6} +$$ + +Since the graph selection is a part of agent action, the associated value $Q(\tau, \boldsymbol{a}; G)$ of graph $G$ can be updated through temporal difference learning. The network parameters $\theta$ can be trained by minimizing the standard Q-learning TD loss: + +$$ +\mathcal {L} _ {c g} (\boldsymbol {\theta}) = \underset {(\boldsymbol {\tau}, \boldsymbol {a}, G, r, \boldsymbol {\tau} ^ {\prime}) \sim \mathcal {D}} {\mathbb {E}} \left[ (y _ {c g} - Q (\boldsymbol {\tau}, \boldsymbol {a}; G; \boldsymbol {\theta})) ^ {2} \right] \tag {7} +$$ + +where $y_{cg} = r + \gamma \max_{(\pmb{a}', G')} Q(\pmb{\tau}', \pmb{a}'; G'; \pmb{\theta}^-)$ is the one-step TD target and $\pmb{\theta}^{-}$ are the parameters of target network. $G^{(t)}$ is regarded as part of the transition and is stored in the + +Algorithm 1 Self-Organized Polynomial-Time Coordination Graphs + +Require: Predefined graph class $\mathcal{G}$ Initialize replay buffer $\mathcal{D}$ Initialize network with random weights for episode $= 1,\dots ,M$ do Receive initial observation $\pmb{\tau}^{(0)}$ for $t = 0,\dots ,T$ do Choose coordination graph $G^{(t)}\in \mathcal{G}$ according to Eq. (5) Select actions $\pmb{a}^{(t)}$ w.r.t $G^{(t)}$ and an $\epsilon$ -greedy exploration Execute actions $\pmb{a}^{(t)}$ and receive reward $r^{(t)}$ and observation $\pmb{o}^{(t + 1)}$ Store transition in replay buffer D end for Sample random minibatch of transitions from $\mathcal{D}$ Perform a gradient descent step on loss defined in Eq. (7) +end for + +replay buffer together with the realistic agent actions. We include more implementation details of temporal difference learning in Appendix C. + +The overall algorithm of our approach is summarized in Algorithm 1. The graph selection step is the main characteristic of our method, which differs from the static graph representation used by prior work (Guestrin et al., 2002a; Kok & Vlassis, 2006; Bohmer et al., 2020). To support the self-organization of coordination graphs, the graph selection step raises a new computation demand, i.e., we need to find the best candidate from the graph class $\mathcal{G}$ , which will be another non-trivial combinatorial optimization problem. We will show that, by designing a proper graph class $\mathcal{G}$ , we can maintain both computational efficiency and function representational capacity in the next subsection. + +# 4.3. Harnessing Structured Graph Classes for Efficient Coordination + +To achieve the efficient graph search over the polynomial-time class instances, we investigate the following structures for the graph class $\mathcal{G}$ , which are subsets of $\mathcal{G}_{\mathrm{uac}}$ : + +- Pairwise grouping $\mathcal{G}_P$ . This class is introduced by (Castellini et al., 2019). $n$ agents are partitioned to $\lfloor n / 2 \rfloor$ non-overlapping pairwise groups. Only pairwise interactions are considered and two agents are connected with an edge if they lie in the same group. +- Tree organization $\mathcal{G}_T$ . Overlapping edges are allowed in this class. In a system with $n$ agents, the graph is organized as a tree with $n - 1$ edges so that all agents form a connected component. Even if two agents are + +![](images/11ca822472af521423f16b497cf69badb6a96025bc26e4cf5a31d62ca136ac86.jpg) +Figure 3. Illustrative example. Left: Final performance of SOP-CG $(\mathcal{G}_T)$ and DCG when $k = 2$ to 7. The optimal return is 1. Middle: Accuracy of DCG's action selection, and the relative error between the joint values computed by the taken actions and the optimal actions. Right: Number of edges inside groups selected by SOP-CG $(\mathcal{G}_T)$ when $k = 7$ . A graph in $\mathcal{G}_T$ can include at most 14 edges which connects agents in the same group. + +![](images/823d746d8e1ab41264e4343a2fffbba3032a24a955f5172aed2bc9334c5b09f7.jpg) + +![](images/fc2dfee995256f0adfff3930e54f076ab9d78ab22c8e4738b9b1d2b8789e3b78.jpg) + +
Graph ClassSelect graph G(t)Select actions on a given graph
GP√√
GT-√
Complete graphN/A-
+ +Table 1. Computational considerations in choosing graph class. A check mark “√” means that known algorithms for the problem are guaranteed to find the optimal solution in polynomial time. The mark “—” denotes that these settings use the specific heuristic methods. + +not directly connected by an edge, their actions are implicitly coordinated through the path on the tree. This provides the potential to approximate complex joint value functions. + +$\mathcal{G}_T$ is actually the set of maximal undirected acyclic graphs. It is noteworthy that we do not further incorporate the smaller graphs into both classes, since their representational capacity are dominated by existing graphs in the classes. We summarize the hardness of computations upon different graph class in Table 1. Although the representational capacity of $\mathcal{G}_P$ is relatively weaker, selecting $G^{(t)}$ from this class can be rigorously solved by polynomial-time algorithms (Edmonds, 1965), which highlights the key benefit of $\mathcal{G}_P$ . In comparison, selecting $G^{(t)}$ from $\mathcal{G}_T$ is non-trivial, so we design a greedy algorithm to compute approximated solutions. Note that, although the graph selection of $\mathcal{G}_T$ may be imprecise, its represented values are formally optimized by temporal difference learning with accurate action selection. Thus, as we will show in the experiment section, $\mathcal{G}_T$ can still work as a promising graph class in absence of rigorous graph selection. Please refer to Appendix D for the implementation details of the induced combinatorial optimization for graph selection. + +Remark. Regarding the integration of these graph classes and the maximization criterion introduced in Eq. (5), we have not derived strong convergence guarantees of the graph + +structure and the value functions. Despite this limitation, the criterion works well and can produce interpretable graph topologies that reflect the ground-truth problem structure, as we will show in Section 5. A future direction is to explore other graph organization criteria specializing in theoretical properties, e.g., developing systematical analysis and improving the convergence rate. + +# 5. Experiments + +In this section, we conduct experiments to answer the following questions: (1) Does the accurate greedy action selection improve our performance (see Section 5.1 and 5.2)? (2) Is the dynamic graph organization mechanism necessary for our algorithm (see Section 5.1 and 5.3)? (3) How well does SOP-CG perform on complex cooperative multi-agent tasks (see Fig. 4, 5 and 6)? (4) Can SOP-CG extract interpretable dynamic coordination structures in complex scenarios (see Section 5.4)? For evaluation, all results in this section are illustrated with the median performance over 5 random seeds as well as the $25\% -75\%$ percentiles. An open-source implementation of our algorithm is available online1. + +# 5.1. Illustrative Example + +To illustrate the effects of the accuracy of greedy action selection in DCG and SOP-CG, we devise a simple one-step cooperative game for $3 \times k$ agents with two actions. + +The $3 \times k$ agents will be randomly separated into $k$ groups with each group 3 agents. Action A is available to all the agents, while action B is only available to a random set of agents. Choosing action B will yield a cost of 0.5. If three agents in the same group take action B, they will receive a global reward of 2.5. Therefore, agents in the same group should coordinate to decide whether to jointly take action A or action B. + +We set the number of groups from 2 to 7 and examine the final performance of DCG and SOP-CG after 150000 episodes training. As shown in Fig. 3-Left, SOP-CG can + +![](images/e31c24cdd9a7cf413ca225879b157724948a9c43e33096b53f30b184bd906f54.jpg) +Figure 4. Learning curves on MACO benchmark. The optimal return is demonstrated if it is available. + +![](images/8ad19351902e353c3863320ec418b7df33c9e2296dfae5099de57beaaa076afd.jpg) +Figure 5. Learning curves on Tag. + +keep achieving the optimal return, while DCG is more sensitive to the total number of agents and obtains low return when $k \geq 5$ . For DCG, we further test the accuracy of its greedy action selection as well as the relative error between the joint values computed by the taken actions and the optimal actions. Fig. 3-Middle demonstrates that the accuracy plummets when the number of agents grows. This problem directly limits the performance of DCG, whereas SOP-CG does not suffer from it. + +Meanwhile, we empirically show that our method could learn well-adapted topologies during the training. In this game, each agent only needs to coordinate with others in the same group. To better understand the contribution of self-organized graph selection, we visualize the number of edges which connects agents in the same group in Fig. 3-Right. It continually increases during the training, while the test performance rises along with it and finally reaches the optimal value after 14 such edges are chosen, which is the maximum number of edges inside groups that a graph in $\mathcal{G}_T$ can cover. This phenomenon proves the ability of our method to learn better policy through discovering the ground truth coordination requirements in the environment. + +The full details of the illustrative example are provided in Appendix E. + +![](images/4cb49fada7107b2f08fe15cdecf6ea936a7c40f4dde6b7443e04929a19b60fb2.jpg) +Figure 6. Learning curves on SMAC tasks. + +# 5.2. Performance Comparison + +In this section, we test SOP-CG on multi-agent coordination challenge (MACO; Wang et al., 2021b), multi-agent particle environment (MPE; Lowe et al., 2017) and StarCraft multi-agent challenge (SMAC; Samvelyan et al., 2019). We compare SOP-CG with the state-of-the-art coordination graph learning methods (DCG (Böhmer et al., 2020), CASEC (Wang et al., 2021b)) and fully decomposed value-based methods (VDN (Sunehag et al., 2018), QMIX (Rashid et al., 2020b)). The implementation details and hyperparameter settings are included in Appendix F. + +MACO (Wang et al., 2021b) is a benchmark consisting of 6 classic coordination problems, raising challenges of relative overgeneralization and partial observability. Results are illustrated in Fig. 4. SOP-CG outperforms the baselines on three tasks, especially Pursuit and Sensor. Our method learns almost the optimal policy on Pursuit while baselines have over two times larger gap with the optimal return than ours. On Sensor, the return achieved by our method is over twice the best baseline's return. The major difficulties on these tasks lie in relative overgeneralization pathology (Panait et al., 2006; Wei & Luke, 2016; Böhmer et al., 2020), since the uncoordinated actions will lead to high punishments. Even if an agent takes the same action, + +![](images/ecbbce5b545b0d5c74a4c18c02797aba405733c96c229a383f581ee29022a1f1.jpg) +Figure 7. Ablation study on MACO benchmark. Line and Star are two special instances of the polynomial-time graph class. The optimal return is demonstrated if it is available. + +the reward observed by it is highly related to the actions of other agents and may be drastically changeable due to their exploration, which hinders the credit assignment of fully decentralized methods. Although the explicit modeling of agent interactions helps the coordination-graph-based methods address this issue, accurate action selection is also critical for learning optimal policy. When facing growing scales (there are 20 agents on Pursuit2 and 15 agents on Sensor), DCG and CASEC have a poor accuracy on DCOP, which may lead to inaccurate greedy action selection, impeding them to better performance. In contrast, our method converges to the superior values, highlighting the effectiveness of polynomial-time coordination graphs. + +Tag is a task based on the particle world (Lowe et al., 2017). 10 agents chase 3 adversaries on the map with 3 randomly generated obstacles, and the agents receive a global reward for each collision between an agent and an adversary. Since the adversaries move faster, it requires fine-grained control and collaboration for the agents to surround the adversaries. As shown in Fig. 5, SOP-CG $(\mathcal{G}_T)$ significantly outperforms the baselines on this task. In Section 5.4, we will visualize the coordination structures learned by our method to justify the adaptability of the dynamic graph organization mechanism. + +We further test SOP-CG on the SMAC benchmark to demonstrate its scalability in large action-observation spaces. Notably, the number of output heads of pairwise payoff functions grows quadratically with the number of actions. In this + +environment, DCG and CASEC adopt different techniques (e.g., low-rank approximation or action representation learning) to improve the learning efficiency of the payoff functions, which can also be applied to our algorithm. For fair comparison, we equip SOP-CG and the coordination-graph-based baselines (i.e., DCG and CASEC) with action representation learning. Fig. 6 illustrates the results on the tasks $10\mathrm{m\_vs\_11m}$ and $1\mathrm{c3s5z}$ . SOP-CG outperforms both DCG and CASEC by a large margin. + +# 5.3. Ablation Study + +In this section, we carry out ablation studies to justify the contribution of the self-organized dynamic topology. We test alternative implementations of DCG on two static graphs Line (agent $i$ is connected with agent $i - 1$ and agent $i + 1$ ) and Star (agent 1 is linked with others). These graphs are two special instances of $\mathcal{G}_{uac}$ , implying polynomial-time solvable DCOPs. Results are shown in Fig. 7. Although the function expressiveness is restricted, it is observed that DCG (line) and DCG (star) can perform much better than DCG in some cases (i.e., DCG (line) on Sensor and DCG (star) on Disperse). We hypothesize that this is because these topologies induce efficient cooperation strategy or directly match the ground truth coordination demands on such domains, and the accurate greedy action selection ensures them to achieve superior performance. For example, agents in Sensor are arranged as a $3\times 5$ matrix in order of their ids. As adjacent agents need to coordinate to scan a nearby target, Line covers the major coordination requirements and renders a satisfactory policy. However, these methods have poor performance on other tasks, which may not be characterized by such static coordination graphs. In contrast, SOP-CG + +![](images/b1eb8399ced9c6d9133505189bd1756c1e8baf23e054917d1a4309579394f18b.jpg) +(a) + +(b) +![](images/b777a73af968740bbbcd9d3eeb54efb3ac0eec55c4dfc3d6723b3a05b501e4f2.jpg) +4 edge in the chosen graph 8 + +![](images/c27104c24dfa3da446ffbccf79412e6b69183d5745b779035165bc69797fbd38.jpg) +(c) +Figure 8. Various coordination graphs learned by our algorithm on Tag: (a) Self-organized grouping at initialization; (b) Connecting to agent with rich observation for better information sharing; (c) Concentrated collaboration structure around an enclosed adversary. + +3 agent and its id + +adversary and its moving direction + +achieves good performance across all tasks in MACO by virtue of self-adaptive topologies. + +# 5.4. Visualization of Self-Organized Coordination + +A major strength of our method is that SOP-CG can organize different coordination graphs to adapt to different situations. Such an adaptive organization mechanism can improve the efficiency of multi-agent collaboration. To illustrate the coordination relations organized by SOP-CG, we visualize the learned graph structures on Tag. In Fig. 8, we take three snapshots chronologically from one episode. This episode is collected by SOP-CG $(\mathcal{G}_T)$ using the tree-based graph class. It shows that SOP-CG can produce interpretable graph structures that characterize the ground-truth coordination dependencies. The learned coordination behaviors are interpreted as follows: + +1. Fig. 8-a presents the initial status of the game, where agents and adversaries are generated randomly on the map. As the three adversaries distribute in separate positions, the agents naturally form three groups to chase different adversaries. +2. After several time steps, in Fig. 8-b, two adversaries gather at the bottom left of the map. Note that, in this game, each agent can only observe objects within a small circular range. Only agent 1 can observe the two adversaries simultaneously, which makes it connect to the majority of the rest of the agents and helps them recognize the position of the adversaries. +3. Finally, as illustrated by Fig. 8-c, the bottom adversary is surrounded by multiple agents, yielding an opportu + +nity for the agents to win considerable rewards, which makes the collaboration structure concentrate around the adversary. + +As presented above, the graph structures learned by SOP-CG can learn effective coordination patterns in Tag, which can be explained by the oracle collaboration strategy of human experts. It demonstrates the ability of our approach to organize coordination relations. + +# 6. Conclusion + +This paper introduces SOP-CG, a novel multi-agent graph-based method that guarantees the polynomial-time greedy policy execution with expressive function representation of a structured graph class. To enable end-to-end learning, SOP-CG introduces an imaginary agent to dynamically select the state-dependent graph and incorporates it into a unified Bellman optimality equation. We demonstrate that SOP-CG can learn interpretable graph topologies and outperform state-of-the-art baselines on several challenging tasks. Although the graph class is exponentially large, we conduct two specific polynomial-time graph class instances to achieve impressive performance. Designing effective graph exploration methods to deal with larger graph classes will be an interesting future direction. + +# 7. Acknowledgement + +This work is supported in part by Science and Technology Innovation 2030 – “New Generation Artificial Intelligence” Major Project (No. 2018AAA0100904) and National Natural Science Foundation of China (62176135). + +# References + +Alonso-Mora, J., Baker, S., and Rus, D. Multi-robot formation control and object transport in dynamic environments via constrained optimization. The International Journal of Robotics Research, 36(9):1000-1021, 2017. +Böhmher, W., Kurin, V., and Whiteson, S. Deep coordination graphs. In International Conference on Machine Learning, pp. 980-991. PMLR, 2020. +Castellini, J., Oliehoek, F. A., Savani, R., and Whiteson, S. The representational capacity of action-value networks for multi-agent reinforcement learning. In AAMAS 2019: The 18th International Conference on Autonomous Agents and MultiAgent Systems, pp. 1862-1864. International Foundation for Autonomous Agents and Multiagent Systems (IFAAMAS), 2019. +Chan, S. O. Approximation resistance from pairwise-independent subgroups. Journal of the ACM (JACM), 63(3):1-32, 2016. +Cho, K., Van Merrienboer, B., Gulcehre, C., Bahdanau, D., Bougares, F., Schwenk, H., and Bengio, Y. Learning phrase representations using rnN encoder-decoder for statistical machine translation. arXiv preprint arXiv:1406.1078, 2014. +Dagum, P. and Luby, M. Approximating probabilistic inference in bayesian belief networks is np-hard. Artificial intelligence, 60(1):141-153, 1993. +Das, A., Gervet, T., Romoff, J., Batra, D., Parikh, D., Rabbat, M., and Pineau, J. Tarmac: Targeted multi-agent communication. In International Conference on Machine Learning, pp. 1538-1546, 2019. +Edmonds, J. Paths, trees, and flowers. Canadian Journal of mathematics, 17:449-467, 1965. +Fioretto, F., Pontelli, E., and Yeoh, W. Distributed constraint optimization problems and applications: A survey. Journal of Artificial Intelligence Research, 61:623-698, 2018. +Foerster, J., Nardelli, N., Farquhar, G., Afouras, T., Torr, P. H., Kohli, P., and Whiteson, S. Stabilising experience replay for deep multi-agent reinforcement learning. In International conference on machine learning, pp. 1146-1155. PMLR, 2017. +Foerster, J. N., Farquhar, G., Afouras, T., Nardelli, N., and Whiteson, S. Counterfactual multi-agent policy gradients. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018. + +Guestrin, C., Koller, D., and Parr, R. Multiagent planning with factored mdps. In NIPS, volume 1, pp. 1523-1530, 2001. +Guestrin, C., Lagoudakis, M., and Parr, R. Coordinated reinforcement learning. In ICML, volume 2, pp. 227-234. Citeseer, 2002a. +Guestrin, C., Venkataraman, S., and Koller, D. Context-specific multiagent coordination and planning with factored mdps. In AAAI/IAAI, pp. 253-259, 2002b. +Hasselt, H. Double q-learning. Advances in neural information processing systems, 23:2613-2621, 2010. +Jiang, J. and Lu, Z. The emergence of individuality. In International Conference on Machine Learning, pp. 4992-5001. PMLR, 2021. +Kok, J. R. and Vlassis, N. Collaborative multiagent reinforcement learning by payoff propagation. Journal of Machine Learning Research, 7:1789-1828, 2006. +Kraemer, L. and Banerjee, B. Multi-agent reinforcement learning as a rehearsal for decentralized planning. Neurocomputing, 190:82-94, 2016. +Li, S., Gupta, J. K., Morales, P., Allen, R., and Kochenderfer, M. J. Deep implicit coordination graphs for multi-agent reinforcement learning. arXiv preprint arXiv:2006.11438, 2020. +Lowe, R., Wu, Y., Tamar, A., Harb, J., Abbeel, P., and Mordatch, I. Multi-agent actor-critic for mixed cooperative-competitive environments. Neural Information Processing Systems (NIPS), 2017. +Manurangsi, P., Nakkiran, P., and Trevisan, L. Near-optimalUGC-hardness of approximating max k-csp.r. arXiv preprint arXiv:1511.06558, 2015. +Oliehoek, F. A., Amato, C., et al. A concise introduction to decentralized POMDPs, volume 1. Springer, 2016. +OroojlooyJadid, A. and Hajinezhad, D. A review of cooperative multi-agent deep reinforcement learning. arXiv preprint arXiv:1908.03963, 2019. +Panait, L., Luke, S., and Wiegand, R. P. Biasing coevolutionary search for optimal multiagent behaviors. IEEE Transactions on Evolutionary Computation, 10(6):629-645, 2006. +Park, J. D. and Darwiche, A. Complexity results and approximation strategies for map explanations. Journal of Artificial Intelligence Research, 21:101-133, 2004. +Pearl, J. Probabilistic Reasoning in Intelligent Systems: Networks of Plausible Inference. Morgan Kaufmann, 1988. + +Rashid, T., Farquhar, G., Peng, B., and Whiteson, S. Weighted qmix: Expanding monotonic value function factorisation for deep multi-agent reinforcement learning. *NeurIPS Proceedings* 2020, 2020a. +Rashid, T., Samvelyan, M., De Witt, C. S., Farquhar, G., Foerster, J., and Whiteson, S. Monotonic value function factorisation for deep multi-agent reinforcement learning. arXiv preprint arXiv:2003.08839, 2020b. +Samvelyan, M., Rashid, T., de Witt, C. S., Farquhar, G., Nardelli, N., Rudner, T. G. J., Hung, C.-M., Torr, P. H. S., Foerster, J., and Whiteson, S. The StarCraft Multi-Agent Challenge. CoRR, abs/1902.04043, 2019. +Singh, A., Jain, T., and Sukhbaatar, S. Learning when to communicate at scale in multiagent cooperative and competitive tasks. arXiv preprint arXiv:1812.09755, 2018. +Son, K., Kim, D., Kang, W. J., Hostallero, D. E., and Yi, Y. Qtran: Learning to factorize with transformation for cooperative multi-agent reinforcement learning. In International Conference on Machine Learning, pp. 5887-5896, 2019. +Stranders, R., Farinelli, A., Rogers, A., and Jennings, N. R. Decentralised coordination of mobile sensors using the max-sum algorithm. In Twenty-First International Joint Conference on Artificial Intelligence, 2009. +Sunehag, P., Lever, G., Gruslys, A., Czarnecki, W. M., Zambaldi, V., Jaderberg, M., Lanctot, M., Sonnerat, N., Leibo, J. Z., Tuyls, K., et al. Value-decomposition networks for cooperative multi-agent learning based on team reward. In Proceedings of the 17th International Conference on Autonomous Agents and MultiAgent Systems, pp. 2085-2087, 2018. +Tan, M. Multi-agent reinforcement learning: Independent vs. cooperative agents. In Proceedings of the tenth international conference on machine learning, pp. 330-337, 1993. +Van der Pol, E. and Oliehoek, F. A. Coordinated deep reinforcement learners for traffic light control. Proceedings of Learning, Inference and Control of Multi-Agent Systems (at NIPS 2016), 2016. +Wang, J., Ren, Z., Liu, T., Yang, Y., and Zhang, C. Qplex: Duplex dueling multi-agent q-learning. In International Conference on Learning Representations, 2021a. +Wang, T., Dong, H., Lesser, V., and Zhang, C. Multi-agent reinforcement learning with emergent roles. In International Conference on Machine Learning, 2020a. +Wang, T., Gupta, T., Mahajan, A., Peng, B., Whiteson, S., and Zhang, C. Rode: Learning roles to decompose multiagent tasks. arXiv preprint arXiv:2010.01523, 2020b. + +Wang, T., Wang, J., Zheng, C., and Zhang, C. Learning nearly decomposable value functions via communication minimization. In International Conference on Learning Representations, 2020c. +Wang, T., Zeng, L., Dong, W., Yang, Q., Yu, Y., and Zhang, C. Context-aware sparse deep coordination graphs. arXiv preprint arXiv:2106.02886, 2021b. +Wang, Y., Han, B., Wang, T., Dong, H., and Zhang, C. Off-policy multi-agent decomposed policy gradients. arXiv preprint arXiv:2007.12322, 2020d. +Wei, E. and Luke, S. Lenient learning in independent-learner stochastic cooperative games. The Journal of Machine Learning Research, 17(1):2914–2955, 2016. +Wen, Y., Yang, Y., Luo, R., Wang, J., and Pan, W. Probabilistic recursive reasoning for multi-agent reinforcement learning. arXiv preprint arXiv:1901.09207, 2019. +Ye, D., Zhang, M., and Yang, Y. A multi-agent framework for packet routing in wireless sensor networks. Sensors, 15(5):10026-10047, 2015. +Yoon, S.-e., Song, H., Shin, K., and Yi, Y. How much and when do we need higher-order information in hypergraphs? a case study on hyperedge prediction. In Proceedings of The Web Conference 2020, pp. 2627-2633, 2020. +Zhang, C. and Lesser, V. Coordinated multi-agent reinforcement learning in networked distributed pomdps. In Twenty-Fifth AAAI Conference on Artificial Intelligence, 2011. +Zhang, C. and Lesser, V. Coordinating multi-agent reinforcement learning with limited communication. In Proceedings of the 2013 international conference on Autonomous agents and multi-agent systems, pp. 1101-1108, 2013. + +# A. Experiment Details of the Motivating Example + +Algorithms. To get the correct result of DCOP, we use a brute force with complexity $O(|A|^n)$ , while we choose Max-sum algorithm (has an alternative implementation called Max-plus) (Pearl, 1988), which is commonly used by most of the coordination graph learning methods (Zhang & Lesser, 2013; Böhmer et al., 2020; Wang et al., 2021b) to test the accuracy and relative Q error. The details of the algorithm are presented below (Zhang & Lesser, 2013). + +Max-sum constructs a bipartite graph $\mathcal{G}_m = \langle \mathcal{V}_a, \mathcal{V}_q, \mathcal{E}_m \rangle$ according to the coordination graph $\langle \mathcal{V}, \mathcal{E} \rangle$ . Each node $v \in \mathcal{V}_m$ represents an agent who needs to do action selection, and each node $u \in \mathcal{V}_q$ represents a (hyper-)edge function. Edges in $\mathcal{E}_m$ connect $u$ with the corresponding agent nodes. Max-sum algorithm will do multi-round message passing on this graph. The number of iterations is usually set smaller than 10 in previous work, while we set it 100 in this experiment. + +Message passing on this bipartite graph starts with sending messages from node $v \in \mathcal{V}_a$ to node $u \in \mathcal{V}_q$ : + +$$ +m _ {v \rightarrow u} \left(a _ {i}\right) = \sum_ {h \in \mathcal {F} _ {v} \backslash u} m _ {h \rightarrow v} \left(a _ {i}\right) + c _ {v u} \tag {8} +$$ + +where $\mathcal{F}_v$ represents the node connected to $v$ , and $c_{vu}$ is the normalizing factor preventing the value of messages from growing arbitrarily large. The message from node $u$ to $v$ is: + +$$ +m _ {u \rightarrow v} \left(a _ {i}\right) = \max _ {\boldsymbol {a} _ {u} \backslash a _ {v}} \left[ f \left(\boldsymbol {a} _ {u}\right) + \sum_ {h \in \mathcal {V} _ {u} \backslash v} m _ {h \rightarrow u} \left(a _ {h}\right)\right] \tag {9} +$$ + +where $\mathcal{V}_u$ is the set of nodes connected to node $u$ , $a_u = \{a_h|h\in \mathcal{V}_u\}$ , $a_u\backslash a_v = \{a_h|h\in \mathcal{V}_u\backslash \{v\}\}$ , and $f$ represents the value function of the (hyper-)edge. After iterations of message passing, each agent $v$ can find its optimal action by calculating $a_v^* = \operatorname{argmax}_{a_v}\sum_{h\in \mathcal{F}_v}m_{h\to v}(a_v)$ . + +Experiment setup. We take 1000 random seeds to test the problem. We fix the number of actions 3 and move the number of agents from 2 to 18. For each setting, we generate a fully connected graph with each value a uniformly random number in $\{-1,0,1\}$ along with a noise drawn from the normal distribution. + +# B. Proof of Proposition 4.1 + +In this section, we provide the proof of Proposition 4.1 (i). Proposition 4.1 (ii) is given in the literature (Fioretto et al., 2018). + +We will reduce Max 2CSP-R (Manurangsi et al., 2015) to the DCOPs induced by fully connected graphs. Max 2CSP-R is a constraint satisfaction problem with two variables per constraint, where each variable can take values from a finite set $\Sigma$ of size $R$ , and the goal is to find an assignment to variables that maximizes the number of satisfied constraints. + +For each variable in the Max 2CSP-R problem, we create an agent in the coordination graph with $R$ actions. Furthermore, for each constraint in the Max 2CSP-R problem, we create an edge in the coordination graph, connecting the two agents of the variables, with a function value 1 only when the constraint is satisfied and otherwise 0. If we can approximate the induced DCOP problem within a factor of $c\frac{\log R}{\sqrt{R}}$ , we can distinguish the $(1 - \epsilon)$ -satisfiable Max 2CSP-R instances and the instances in which at most a $c\frac{\log R}{\sqrt{R}}$ fraction of constraints are satisfiable. Chan (2016) proves that there is a constant $c$ such that for every sufficiently large $R$ and any $\epsilon > 0$ , it is NP-hard to distinguish $(1 - \epsilon)$ -satisfiable instances of Max 2CSP-R from instances in which at most a $c\frac{\log R}{\sqrt{R}}$ fraction of constraints are satisfiable. Therefore, it is NP-hard to Approximate the induced DCOPs of fully connected coordination graphs within a factor of $O\left(\frac{\log A}{\sqrt{A}}\right)$ . Results given by Manurangsi et al. (2015) also show that we can get a tighter approximation hardness bound of $O\left(\frac{\log A}{A}\right)$ if assuming the unique games conjecture. + +![](images/7b19645a8b7eeccecdbc6e390ca378683e10ab67a839f1858125d73a05aab944.jpg) +Figure 9. Ablation studies about the graph relabeling technique. + +# C. Implementation tricks of Temporal Difference Learning + +As studied by previous work (Hasselt, 2010), vanilla Q-learning already has a tendency to overestimate, since the TD target takes a max operator over a set of estimated action-values. Notice that our framework introduces an additional max operator over graphs in class $\mathcal{G}$ , which will probably induce extra upward bias. To attenuate this problem, we use a graph relabeling technique to control the effects of overestimation errors. In our implementation, we modify the vanilla TD loss defined in Eq. (7) to the following form: + +$$ +\mathcal {L} _ {c g} (\boldsymbol {\theta}) = \underset {(\boldsymbol {\tau}, \boldsymbol {a}, r, \boldsymbol {\tau} ^ {\prime}) \sim \mathcal {D}} {\mathbb {E}} \left[ \left(y _ {c g} - \max _ {G} Q (\boldsymbol {\tau}, \boldsymbol {a}; G; \boldsymbol {\theta})\right) ^ {2} \right] \tag {10} +$$ + +where $y_{cg}$ is the one-step TD target defined in Section 4.2 and the current value no longer takes the graph which is stored in the replay buffer with this transition. As $G$ is the graph with largest estimated value, this loss achieves a soft constraint for the following target: + +$$ +\forall G, Q (\boldsymbol {\tau}, \boldsymbol {a}; G; \boldsymbol {\theta}) \leq y _ {c g} \tag {11} +$$ + +which helps our method avoid overestimation. + +We conduct ablation studies on the tasks Pursuit and Tag to demonstrate the necessity of this component. The results illustrated in Fig. 9. SOP-CG w/o graph relabeling is more likely to stick in suboptimal strategies and may even collapse on Pursuit. As analyzed before, these phenomenons are due to the dramatic overestimation caused by the additional max operator over graphs. By contrast, the performance of SOP-CG is significantly improved, highlighting the effectiveness of graph relabeling. + +# D. Computations with Classes $\mathcal{G}_P$ and $\mathcal{G}_T$ + +Here we present the details of algorithms we used to select graph $G^{(t)}$ from the graph class $\mathcal{G}$ . + +When $\mathcal{G} = \mathcal{G}_P$ (pairwise grouping). In this case, $n$ agents are pairwise matched by $\lfloor n / 2\rfloor$ edges. One agent will be isolated if $n$ is an odd number. With such a coordination graph, each agent coordinates with exactly one agent, except for the isolated one. + +If node $i$ is matched with node $j$ , they will contribute at most + +$$ +\max _ {a _ {i}, a _ {j}} \left[ q _ {i} \left(\tau_ {i}, a _ {i}\right) + q _ {j} \left(\tau_ {j}, a _ {j}\right) + q _ {i j} \left(\tau_ {i}, \tau_ {j}, a _ {i}, a _ {j}\right) \right] \tag {12} +$$ + +to the joint value without affecting the action selection of other agents. + +Hence, we construct a undirected weighted graph $G = \langle \mathcal{V}, \mathcal{E}_w \rangle$ , where $\mathcal{V}$ is the vertex set, and + +$$ +\mathcal {E} _ {w} = \left\{\left(i, j, w (i, j) = \max _ {a _ {i}, a _ {j}} \left[ q _ {i} \left(\tau_ {i}, a _ {i}\right) + q _ {j} \left(\tau_ {j}, a _ {j}\right) + q _ {i j} \left(\tau_ {i}, \tau_ {j}, a _ {i}, a _ {j}\right) \right]\right) | \forall (i, j) \in \mathcal {E} \right\}. \tag {13} +$$ + +A matching on such graph is a function $mate(v)$ where $mate(mate(v)) = v$ for all $v \in V$ with at most one $v$ satisfies that $mate(v) = v$ . The weight of the matching is defined as $\frac{1}{2} \sum_v w(v, mate(v))$ . Our goal is to find the maximum weighted matching on this graph. + +This problem can be solved by the blossom algorithm (Edmonds, 1965) in $O(n^3)$ time. The brief steps of this algorithm are to iteratively find augmentation paths on the graph and contract the odd-cycle, which is called blossom in this algorithm. + +When $\mathcal{G} = \mathcal{G}_T$ (tree organization). In this case, the graph is an acyclic graph with $n - 1$ edges, and all agents form a connected component. The distributed constraint optimization problem (DCOP) on such graphs can always be solved in the polynomial time (Fioretto et al., 2018). + +Choosing the best graph $G^{(t)}$ in $\mathcal{G}_T$ is non-trivial. Therefore, we present a greedy algorithm to select the graph from the graph class. The high level idea is to add edges greedily until all agents are connected. At each iteration, we add an edge across two different connected components to the coordination graph, which optimizes the increment of the maximal joint value. For an edge set $E \subseteq \mathcal{E}$ , we define the value of a set $f(E)$ to be the result of DCOP on graph $\langle \mathcal{V}, E \rangle$ . Initially we have $E$ is an empty set. We do the iteration $n - 1$ times. In each iteration, we find + +$$ +e = \underset {e \in \mathcal {E}, E \cup \{e \} \text {i s a c y c l i c}} {\arg \max } f (E \cup \{e \}), \tag {14} +$$ + +and add this edge to the current graph, i.e., $E \gets E \cup \{e\}$ . Once a graph from $\mathcal{G}_T$ is selected, the joint action selection can be computed via dynamic programming. + +Time complexity. We summarize the time complexity (in worst case) of each component in Table 2. For SOP-CG $(\mathcal{G}_T)$ , we use pruning techniques in our implementation, so the real-time cost of selecting graph $G^{(t)}$ is usually much smaller than the complexity reported in Table 2. The detailed training time cost of SOP-CG and DCG can be found in Appendix F. + +
AlgorithmSelect graph G(t)Select actions on a given graph
SOP-CG (Gp)O(n3)O(nA2)
SOP-CG (Gt)O(n3A2) (heuristic)O(nA2)
DCGN/AO(kn2A2) (heuristic)
+ +Table 2. Time complexity of SOP-CG and DCG. $n$ is the number of agents and $A = \left| {\bigcup }_{i = 1}^{n}{A}^{i}\right|$ . For DCG, $k$ is the number of iterations in max-sum. + +# E. Settings and Results of the Illustrative Example + +Experiment Setting. In this illustrative example, each agent performs independent $\epsilon$ -greedy exploration, with $\epsilon$ anneals linearly from 1.0 to 0.05 over 100000 time-steps. We set $\gamma = 0.99$ . The replay buffer consists of the last 500 episodes, from which we uniformly sample a batch of size 32 for training. + +The group allocation is drawn from the uniform distribution, with each time only one group having three agents can play action B. The group id is one-hot encoded. Each agent receives the group id and its available actions as input. + +Detailed results. Fig. 11 shows the full result of our method and DCG (line, star and full) on this environment. + +We also test an extended version of the illustrative example. In this version, each group has four agents. Choosing action B will still yield a cost of 0.5. If all agents in the same group take action B, they will receive a global reward of 3. Therefore, this version requires coordination among 4-tuples of agents. As shown in Figure 10, SOP-CG $(\mathcal{G}_T)$ still works well. + +![](images/bfd614f8b5e629f0d18e04e457deb2dccf6e70305506f4b81665d6fd0d83a1ab.jpg) +Figure 10. Extension of the illustrative example with 5 groups and each group 4 agents. + +# F. Experiment Settings and Hyperparameters + +# F.1. Settings of Experiment Tasks + +MACO (Wang et al., 2021b) is a benchmark including 6 classic tasks: Aloha, Pursuit, Hallway, Sensor, Gather and Disperse. For the task Pursuit, MACO uses the version with 10 predators and 5 prey. In this paper, we use a harder version with 20 + +![](images/1141577b857f6eb5cb9dc1ce0b4ab34702edd18836e2ecf02957a4fed486a95b.jpg) +Figure 11. Learning curves on the illustrative example. + +predators and 10 prey. For the other tasks, we test the vanilla version in MACO. The number of agents and actions are listed in Table 3. + +
AlohaPursuitHallwaySensorGatherDisperse
# agents10201215512
# actions293954
+ +Table 3. Number of agents and actions in the tasks from MACO. + +Tag is a challenging task on the particle world (Lowe et al., 2017). On the map with 3 randomly generated obstacles, 10 slower agents chase 3 faster adversaries. For each collision between an agent and an adversary, the agents receive a reward while the adversaries are punished. Each agent has 5 actions to control its movement. An agent or adversary can observe the units in a restricted circular area that is centered at its position. We train the agents by a specific algorithm, while the adversaries are concurrently trained by VDN (Sunehag et al., 2018). + +SMAC (Samvelyan et al., 2019) is a popular benchmark based on the strategy game StarCraft II. In this paper, we benchmark our algorithm with StarCraft version of 2.4.6.2.69232, which is used by the SMAC paper. + +# F.2. Hyperparameters + +A shared GRU (Cho et al., 2014) is used to process sequential inputs and then output the encoded observation history for each agent. A following fully-connected layer converts the observation histories to the individual utility function of each agent. The pairwise payoff function is computed by another multi-layer perceptron, which takes the concatenation of two agents' observation histories as input. Agents share parameters of the network for computing individual utility, and the parameters of the payoff network are also shared among different agent pairs. + +All tasks in this paper use a discount factor $\gamma = 0.99$ . We use $\epsilon$ -greedy exploration, and $\epsilon$ anneals linearly from 1.0 to 0.05 over 50000 time-steps. We use an RMSProp optimizer with a learning rate of $5 \times 10^{-3}$ to train our network. A first-in-first-out (FIFO) replay buffer stores the experiences of at most 5000 episodes, and a batch of 32 episodes are sampled from the buffer during the training phase. The target network is periodically updated every 200 episodes. + +Our method and all the baselines involved in this paper are implemented based on the open-sourced codebase PyMARL (Samvelyan et al., 2019), which ensures the fairness of comparison. For the baselines (VDN (Sunehag et al., 2018), QMIX (Rashid et al., 2020b), DCG (Böhmer et al., 2020), CASEC (Wang et al., 2021b)), we adopt the default hyperparameter settings provided by the authors. + +The experiments are finished on NVIDIA RTX 2080TI GPU. The training time of SOP-CG and DCG are listed in Table 4. SOP-CG runs faster than DCG. + +
PursuitTag1c3s5z
Environmental time cost2h6h1.5h
DCG8.5h12.5h7h
SOP-CG (Gp)6h9h5h
SOP-CG (Gt)8h9.5h6.5h
+ +Table 4. Time cost (hours) of training SOP-CG and DCG for 1M steps. Environmental time cost denotes the total time taken by the environment simulator and the training of the adversaries. + +![](images/7adc4eaed52118906b4a4f21361acdb2ed6c9996c405b8ce4fef956290a0ead8.jpg) +Figure 12. Comparison to fully decomposed value-based methods on MACO. + +# G. Additional Results on MACO + +# G.1. Comparison to Fully Decomposed Value-Based Methods + +We compare our algorithm with two additional fully decomposed value-based methods: QTRAN (Son et al., 2019) and QPLEX (Wang et al., 2021a). These methods achieve more expressive value function classes than VDN and QMIX. The performance is shown in Figure 12. + +# G.2. Comparison to a Method Using the Underlying Problem Structure + +We test DCG with a fixed static graph that reflects the underlying problem structure of Aloha. As shown in Figure 13-Left, the peak performance of this method is similar to SOP-CG's. Notice that max-sum algorithm is not guaranteed to get accurate DCOP solutions on this underlying graph. If we further replace max-sum with an exhaustive search (which will take much higher time complexity), it achieves better peak performance than our method. + +# G.3. Ablation of the Graph Selection Heuristic for $\mathcal{G}_T$ + +As mentioned in Appendix D, we use a greedy heuristic to select a graph from class $\mathcal{G}_T$ . To understand the performance of this heuristic, we replace it with an exhaustive search (which will take much higher time complexity) and test it on Aloha. As shown in Figure 13-Right, the peak performance of this implementation is similar to the one with the greedy heuristic, but the precise graph selection brings better stability. + +# H. Connection to a Recent Work on Hyper-Graphs + +We note that a recent work on the expressiveness of hyper-graphs (Yoon et al., 2020) is relevant to our work. The connections (i.e., the differences and relevance) between Yoon et al. (2020) and our paper are summarized as follows: + +- Different metric of expressiveness. Yoon et al. (2020) investigates the functionality of graph expressiveness in terms + +![](images/26cf29ea64db734745e2bfa6db5113f73db580f1e256456b0b807e3e1a7be076.jpg) +Figure 13. Additional results on Aloha. Left: Performance of DCG given a fixed static graph that reflects the underlying problem structure. Right: Performance of SOP-CG $(\mathcal{G}_T)$ that selects $G^{(t)}$ by exhaustive search. + +![](images/cafeab4fdf84ef08b413c792864607011f75a5fbd7f272fc6de6b0a19e9c9085.jpg) + +of the order of hyper-edges. By contrast, our paper focuses on the expressiveness of different graph topologies. + +- Similar motivation. Both Yoon et al. and our paper aim to study the trade-off between the graph expressiveness and the complexity of solving downstream tasks. In our paper, the downstream task specifically refers to the DCOPs induced by graph-based value factorization. +- Different workflow and contributions. Yoon et al. (2020) establish a systematic experimental study to provide an empirical guideline on how to trade-off between the graph expressiveness and downstream costs. In comparison, our work proposes an algorithm to break this trade-off for improving MARL performance. Our algorithm is able to improve the function expressiveness without largely increasing the time complexity of downstream DCOPs. + +Despite the expressiveness metric being different, several conclusions reached by Yoon et al. (2020) can be observed in our experiments. More specifically, the key findings of Yoon et al. (2020) (namely, three points, i.e., Diminishing returns, Troubleshooter, and Irreducibility) correspond to the following observations in our paper: + +- Diminishing returns. When the task coordination structure is simple, a concise graph topology (e.g., pairwise matching) can achieve comparable performance with topologies using larger edge sets. As presented in Fig. 4, SOP-CG $(\mathcal{G}_P)$ performs better than SOP-CG $(\mathcal{G}_T)$ and DCG in Pursuit, since pairwise matching is sufficient to express the underlying coordination relations in this task. (Recall that $\mathcal{G}_P$ uses pairwise matching and $\mathcal{G}_T$ uses tree-based topology.) +- Troubleshooter and Irreducibility. When the task requires a complicated coordination structure, the graph topology needs to have higher function expressiveness. This finding can also be seen in Fig. 5. SOP-CG $(\mathcal{G}_T)$ significantly outperforms SOP-CG $(\mathcal{G}_P)$ in Tag where pairwise matching cannot express the underlying coordination relations. \ No newline at end of file diff --git a/selforganizedpolynomialtimecoordinationgraphs/images.zip b/selforganizedpolynomialtimecoordinationgraphs/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..0856158af839c52b6cdd50921351200d70242e47 --- /dev/null +++ b/selforganizedpolynomialtimecoordinationgraphs/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fbcdf904e2f810d45950b06d29dd7763de31d17fead8b0e52ad51a3229322398 +size 879033 diff --git a/selforganizedpolynomialtimecoordinationgraphs/layout.json b/selforganizedpolynomialtimecoordinationgraphs/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..1cbb26d3d3fdaab015e39b3c32083924bb591cfd --- /dev/null +++ b/selforganizedpolynomialtimecoordinationgraphs/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1487369eaf3e70c576126f5cc24cb066f347147aa87a5df208aca5ee5bdb58ac +size 621720 diff --git a/selfsupervisedlearningwithrandomprojectionquantizerforspeechrecognition/749a6cee-17fb-40f5-b2bd-15692aedd3a0_content_list.json b/selfsupervisedlearningwithrandomprojectionquantizerforspeechrecognition/749a6cee-17fb-40f5-b2bd-15692aedd3a0_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..bfca945348ace3ccb9478bf0d14f96edd01ef785 --- /dev/null +++ b/selfsupervisedlearningwithrandomprojectionquantizerforspeechrecognition/749a6cee-17fb-40f5-b2bd-15692aedd3a0_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:677aa6ba853417889a4fc6bfd97e096a3454933da5fb243ac5445af55a1275db +size 70926 diff --git a/selfsupervisedlearningwithrandomprojectionquantizerforspeechrecognition/749a6cee-17fb-40f5-b2bd-15692aedd3a0_model.json b/selfsupervisedlearningwithrandomprojectionquantizerforspeechrecognition/749a6cee-17fb-40f5-b2bd-15692aedd3a0_model.json new file mode 100644 index 0000000000000000000000000000000000000000..b3720df1e1be356ef550fe35654facbd3efa39cb --- /dev/null +++ b/selfsupervisedlearningwithrandomprojectionquantizerforspeechrecognition/749a6cee-17fb-40f5-b2bd-15692aedd3a0_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:634fe33623295d5127233b188e8426d447931635974453937b505073f4af6de4 +size 82949 diff --git a/selfsupervisedlearningwithrandomprojectionquantizerforspeechrecognition/749a6cee-17fb-40f5-b2bd-15692aedd3a0_origin.pdf b/selfsupervisedlearningwithrandomprojectionquantizerforspeechrecognition/749a6cee-17fb-40f5-b2bd-15692aedd3a0_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..1795e96a9a38b47354fd37b8b04c3464b74d53de --- /dev/null +++ b/selfsupervisedlearningwithrandomprojectionquantizerforspeechrecognition/749a6cee-17fb-40f5-b2bd-15692aedd3a0_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:102c65d6e2b17e44a7bc9c0f50ecda134e252377b8d0e36032a596d23059bd48 +size 668175 diff --git a/selfsupervisedlearningwithrandomprojectionquantizerforspeechrecognition/full.md b/selfsupervisedlearningwithrandomprojectionquantizerforspeechrecognition/full.md new file mode 100644 index 0000000000000000000000000000000000000000..be28db825a0f911ca6cdc1faa366fdd0579a070e --- /dev/null +++ b/selfsupervisedlearningwithrandomprojectionquantizerforspeechrecognition/full.md @@ -0,0 +1,249 @@ +# Self-Supervised Learning with Random-Projection Quantizer for Speech Recognition + +Chung-Cheng Chiu*1 James Qin*1 Yu Zhang1 Jiahui Yu1 Yonghui Wu1 + +# Abstract + +We present a simple and effective self-supervised learning approach for speech recognition. The approach learns a model to predict the masked speech signals, in the form of discrete labels generated with a random-projection quantizer. In particular the quantizer projects speech inputs with a randomly initialized matrix, and does a nearest-neighbor lookup in a randomly-initialized codebook. Neither the matrix nor the codebook is updated during self-supervised learning. Since the random-projection quantizer is not trained and is separated from the speech recognition model, the design makes the approach flexible and is compatible with universal speech recognition architecture. On LibriSpeech our approach achieves similar word-error-rates as previous work using self-supervised learning with non-streaming models, and provides lower word-error-rates and latency than wav2vec 2.0 and w2v-BERT with streaming models. On multilingual tasks the approach also provides significant improvement over wav2vec 2.0 and w2v-BERT. + +# 1. Introduction + +Self-supervised learning has shown impressive improvement for the quality of the speech recognition models in recent years (Schneider et al., 2019; Baevski et al., 2020a; 2019; 2020b; Hsu et al., 2021; Zhang et al., 2020; Chung et al., 2021; Zhang et al., 2021). These learning approaches enable the model to learn from unsupervised data and combine with supervised learning to improve the recognition accuracy. The capability of learning from unsupervised data is particularly beneficial when the supervised data is limited + +*Equal contribution , James Qin , Yu Zhang . + +Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s). + +and opens up new opportunities for low resource languages and domains. + +One common design principle of self-supervised learning for speech recognition centers around learning representations. Inspired by the success of BERT (Devlin et al., 2018), one research trend in the speech community is to build BERT-inspired algorithms. One challenge in building BERT-style self-supervised learning for speech is to bridge the gap between continuous speech signals and the discrete text tokens, and a solution for addressing this issue is through learning speech representation (Schneider et al., 2019; Baevski et al., 2020b) or learning quantized representation (Baevski et al., 2020b;a; 2019; Hsu et al., 2021; Chung et al., 2021). Many previous works proposed effective algorithms for learning speech representations, and the quantized result of those learned representations showed encouraging correlation with the phoneme of the utterances. + +While representation learning is a critical topic for the speech field, combining it with self-supervised learning leads to two limitations that can slow the research progress: (1) Model architecture limitation. The integration of representation learning and self-supervised learning often requires the model to act the role of providing speech representation while still being effective for the downstream tasks. An effective representation model, however, may not always be effective for the downstream tasks. For example, a good representation learning model may require accessing the future context of the utterance, while downstream tasks may require a low latency model which prohibits the access of the future context. (2) Increased complexity. The objectives of representation learning and self-supervised learning are not always aligned, and the complexity of designing both algorithms and finding their balance can impede the research development. This complexity can also motivate the field toward designing more complicated algorithms instead of finding a simple and effective alternative. + +In this work we propose BERT-based Speech pre-Training with Random-projection Quantizer (BEST-RQ), a simple and effective self-supervised learning algorithm for speech recognition. The algorithm masks speech signals and feeds them to the encoder part of the speech recognition model, and the encoder learns to predict the masked region based + +on the unmasked speech signals where the learning targets are labels provided by a random-projection quantizer. The random projection quantizer projects speech signals to a randomly initialized matrix, and finds a nearest vector in a randomly initialized codebook. The index of that vector is the target label. Neither the projection matrix nor the codebook is updated throughout the learning process. The quantizer does not require representation learning, and its separation from the model removes the limitation on the architecture design of the model. Despite its simplicity, on LibriSpeech the algorithm achieves similar results as previous work with non-streaming models, and provides better improvement with streaming models compared with previous approaches. On multilingual tasks, the algorithm exhibits further gains compared to wav2vec 2.0 (Baevski et al., 2020b) and w2v-BERT (Chung et al., 2021). + +We conduct further analysis on the relation between representation learning quality and the self-supervised learning quality, and demonstrate that the two objectives are not inherently aligned in Section 4.3 and Section 4.4. Such an observation is central to our design of self-supervised learning without representation learning, and opens up a new, less complicated research direction for self-supervised learning. + +# 2. Related Work + +Many of the previous work on self-supervised learning for speech recognition focus on learning speech representation. wav2vec (Schneider et al., 2019) applies contrastive learning to learn the future representation based on the past context. vq-wav2vec (Baevski et al., 2020a) uses wav2vec to learn the representations and quantizes them to discrete tokens, and performs BERT-style pre-training to further improve the representation learning. DiscreteBERT (Baevski et al., 2019) extends vq-wav2vec by fine-tuning the BERT-pre-trained model on the downstream tasks. wav2vec 2.0 (Baevski et al., 2020b) uses contrastive learning with both past and future context to predict the representation of the masked parts. HuBERT (Hsu et al., 2021) uses k-means to learn the initial quantizer that maps speech signals to discrete labels, and performs BERT-style pre-training where the inputs are masked speech signals and prediction targets are discrete labels. HuBERT further uses the pretrained model as the new quantizer to train a new iteration of the model, and repeat the process to iteratively improve the pre-training results. w2v-BERT (Chung et al., 2021) uses a sub-network of the model to perform contrastive learning to learn speech representation, and use the rest of the network to perform BERT-style pre-training. w2v-BERT trains the representation learning and the BERT-style pre-training simultaneously. Our approach distinguishes from these work in avoiding the requirement of representation learning and + +![](images/88bc46cf13927efe04a041b970bdac092b60a8e9ec244f91a5aa7bd3297b713e.jpg) +Figure 1. Overview of BEST-RQ. The approach applies random projections to project the input speech signals to a randomly initialized codebook, and map them to discrete labels through finding the nearest vector in the codebook. The pre-training objective is for the ASR encoder to take the masked input signals and predict the labels corresponding to the masked part provided by the random-projection quantizer. + +separating the quantizer from the speech recognition model. + +Our quantizer project input signals with a random matrix, which is similar to performing dimension reduction for the input signals. Using such quantization results as prediction target for self-supervised learning share a similar structure as the masked autoencoder (MAE) (He et al., 2021), which directly reconstruct the masked input signals. Another similar work in the computer vision community is BEiT (Bao et al., 2021), which trains a VQ-VAE (van den Oord et al., 2018) as the quantizer and use the VQ-VAE to perform BERT-style self-supervised learning. Different from these approaches, our algorithm does not require training the quantizer which further simplifies the training process. + +# 3. Self-supervised Learning with Random-projection Quantizer + +BEST-RQ applies a random-projection quantizer to map speech signals to discrete labels to enable BERT-style pretraining for ASR encoders. The quantizer randomly initializes a matrix and a codebook, and uses the matrix to project the input speech signals and the codebook to find the nearest vector where the index of the vector is the label. The pre-training process masks the speech signals and feeds them to the ASR encoder and trains the ASR encoder to predict labels of the masked part. Both the randomly initialized matrix and codebook are fixed during the pre-training process. The input data is normalized to have 0 mean and standard deviation of 1. The normalization is critical for pre + +venting the random projection to collapse to a small subset of codes. The framework is described in Figure 1. After the pre-training process the resulting ASR encoder is adopted to fine-tune on downstream ASR tasks. + +The approach applies masks directly on the speech signal, where the masking strategy samples at every frame whether to apply masks with a fixed probability. Each mask spans from the starting frame with a fixed length. The masked parts are replaced with a noise sampled from a normal distribution with 0 mean and 0.1 standard deviation. + +# 3.1. Random-projection Quantizer + +Given an input vector $x$ where $x$ is a $d$ -dimensional vector computed from speech signals, the random-projection quantizer maps $x$ to discrete labels $y$ through + +$$ +y = \underset {i} {\operatorname {a r g m i n}} | | \operatorname {n o r m} _ {l 2} \left(c _ {i}\right) - \operatorname {n o r m} _ {l 2} (A x) | |, \tag {1} +$$ + +where $A$ denotes a randomly initialized $h \times d$ matrix and $C = \{c_1, \dots, c_n\}$ is a set of randomly initialized $h$ -dimensional vectors, $\text{norm}_{l2}(.)$ is a function that normalizes the vector to have unit $L2$ norm. The projection matrix $A$ use Xavier initialization (Glorot & Bengio, 2010) and the codebook $C$ use standard normal distribution for initialization, and the parameters are fixed during the pre-training process and therefore the quantizations are consistent during training. + +# 3.2. Pre-training + +The pre-training process adds a softmax layer on top of the ASR encoder to learn to predict the quantized speech labels. Since the random-projection quantizer is independent of the ASR encoder, the pre-training is flexible and can work with different architectures of the ASR encoder. We study the effectiveness of the algorithm on both non-streaming and streaming models, and in our experiments we use Conformer (Gulati et al., 2020) as the building block. + +# 3.2.1. NON-STREAMING MODELS + +Since the BERT-style pre-training is designed for the non-streaming models, training with this type of architecture is straightforward where the model uses both past and future context to learn to predict the quantized labels of the masked speech signals. + +# 3.2.2 STREAMING MODELS + +In addition to the non-streaming models, streaming architecture also plays a critical role for the speech recognition tasks as many of the applications require transcribing speakers' utterances with low-latency (Sainath et al., 2020). Streaming architecture however is less well-studied in the previous self-supervised learning work compared to the non-streaming ar + +chitecture. Moreover, many of the previous self-supervised learning approaches specify a pre-training setup that takes both the previous and future context, making it a question of how one can generalize the approaches to streaming models. We proposed two pre-training algorithms that are compatible with the streaming architecture: + +Streaming pre-train. As our algorithm does not require learning quantization and focuses only on training the ASR encoder, this approach largely benefits the streaming models. Pre-training for streaming models follows the same setup as non-streaming models but the ASR encoder now learns to predict the quantized labels of the masked part based only on the past context. + +Non-Streaming pre-train. Given that the neural network architecture like Transformer/Conformer allows switching from non-streaming to streaming behaviors by adding a mask for the future context within the same model, one can also perform pre-training with non-streaming setup for streaming models. Our algorithm provides benefits for streaming models with both non-streaming and streaming pre-training. + +# 3.3. Fine-tuning + +After the pre-training, the approach initializes the encoder of the downstream ASR from the pre-trained model, and fine-tunes on the supervised set. The softmax layer added on top of the encoder during the pre-training process is not used in fine-tuning. We focus on end-to-end models with RNN transducers (Graves, 2012), where the decoder uses LSTMs for the prediction network. On constructing the encoder, an additional projection layer is added on top of the pre-trained encoder to help it adapt to the downstream ASR task. The training process also updates the encoder during the supervised fine-tuning. + +# 3.4. Understanding the Effectiveness of the Random-projection Quantizer + +Our algorithm uses a random-projection quantizer for self-supervised learning, and such a design raises two questions: how good is the resulting quantization quality with this quantizer and how much does the quantization quality affect the effectiveness of the self-supervised learning? We address these two questions through comparing our quantizer with VQ-VAEs. Using random-projections for quantizing speech signals shares some similarity as VQ-VAEs. The random projection performs dimension reduction for the speech signals while the random codebook provides an approximated discrete representation of the speech data distribution. VQ-VAEs also provide a discrete representation for the speech signals, but do so by learning a representation in the latent space that best preserves the speech data. Thus, comparing with VQ-VAEs gives us insight on the quantization quality + +Table 1. LibriSpeech results with non-streaming models. The LM used in our experiment is a Transformer LM with model size 0.1B. + +
MethodSize (B)No LMWith LM
devdev-othertesttest-otherdevdev-othertesttest-other
wav2vec 2.0 (Baevski et al., 2020b)0.32.14.52.24.51.63.01.83.3
HuBERT Large (Hsu et al., 2021)0.3----1.53.01.93.3
HuBERT X-Large (Hsu et al., 2021)1.0----1.52.51.82.9
w2v-Conformer XL (Zhang et al., 2020)0.61.73.51.73.51.63.21.53.2
w2v-BERT XL (Chung et al., 2021)0.61.52.91.52.91.42.81.52.8
BEST-RQ (Ours)0.61.52.81.62.91.42.61.52.7
+ +of our quantizer and the effect of representation learning for self-supervised learning. + +We demonstrate that the quantization quality of the random-projection quantizer is not ideal but yet effective for self-supervised learning by comparing it with VQ-VAE-based quantizations in Section 4.3. We also show that the gap in the quantization quality is less an issue with the increase of the unsupervised data in Section 4.4. The main objective of self-supervised learning for speech recognition is to train the model to learn contextual information. The random-projection quantizer preserve the distribution of the speech data, and in order for the model to learn to predict the quantized token based on unmasked signals, the model needs to learn to process the raw signals and infer the contextual information among speech data. Such a criterion allows the model to perform effective self-supervised learning with a random-projection quantizer. + +# 4. Experiments + +We perform self-supervised learning experiments on LibriSpeech with non-streaming and streaming models, and assess the approach on multilingual tasks with non-streaming models. We study the quantization quality of the random-projection quantizer by comparing it with the quantizer learned with VQ-VAEs. The implementation use Lingvo (Shen et al., 2019) library. + +# 4.1. LibriSpeech + +Following (Zhang et al., 2020), we conduct experiments on the LibriLight dataset (Kahn et al., 2020) for pre-training, and fine-tune on the LibriSpeech training set which contains 960 hours of data. The input speech signals are 80-dimensional log-mel filter bank coefficients, and each frame has the stride of 10ms. In the fine-tuning phase, the decoder has a vocab size 1024 and uses a 1024-token WordPiece model (Schuster & Nakajima, 2012) for tokenizations that is constructed from the transcripts of the LibriSpeech training set. + +# 4.1.1. NON-STREAMING MODELS + +We use the same architectures reported in (Zhang et al., 2020) for fair comparisons. The model has two convolution layers at the bottom which provide 4 times temporal-dimension reduction for the input sequences. The rest of the layers are a stack of Conformer models. We explore 0.6B model size which is extensively studied in the previous works. The model contains 24 layers of Conformer models. + +Pre-train. The pre-training uses mask length 400ms with masking probability of 0.01. The learning rate schedule uses a transformer learning rate schedule (Vaswani et al., 2017). The training of the model uses Adam optimizer (Kingma & Ba, 2015) with 0.004 peak learning rate and 25000 warm-up steps. The batch size is 2048. Since the encoder has 4 times temporal-dimension reduction, the quantization with random projections stacks every 4 frames for projections. The vocab size of the codebook is 8192 and the dimension is 16. + +Fine-tune. The fine-tuning model also follows the same architecture as in (Zhang et al., 2020) and use RNN Transducer (RNN-T) (Graves, 2012) for decoder with 2 layers of unidirectional LSTMs, where the hidden dimension of LSTMs are 1280. The fine-tuning process uses the Transformer learning rate schedule. Since the encoder is initialized from a pre-trained model, the fine-tuning process uses a lower learning rate for the encoder than the decoder. The encoder uses 0.0003 peak learning rate and 5000 warmup steps, while the decoder uses 0.001 peak learning rate and 1500 warmup steps. + +The results of pre-training with LibriLight and fine-tuning on LibriSpeech, along with comparisons with previous works, are shown in Table 1. Our results with LM use shallow fusion to incorporate the LM. The LM is a 0.1B Transformer model trained on the LibriSpeech LM corpus, and the model has 8 layers, 1024 model dimension, and 4096 feed-forward network dimension. By using the same architecture and similar optimization strategy as (Zhang et al., 2020), our approach shows similar WERs as previous best results on LibriSpeech both with and without LM. + +# 4.1.2. STREAMING MODELS + +The architecture we use for the streaming experiments follows a similar design as previous work for building streaming ASRs (Yu et al., 2021). We scale the model size to be also 0.6B to be consistent with the non-streaming experiments. The architecture has 3 Conformer layers at the bottom, followed by a stacking layer with 2 times temporal-dimension reduction and 20 Conformer layers on top of the stacking layer. The Conformer has 1024 hidden dimension for the self-attention layer and 4096 for the feed-forward layers. The self-attention layer attends to the current and the previous 64 frames, and the convolution has a kernel that covers the current and the past 3 frames. + +The training setup is mostly the same as the 0.6B model in the non-streaming experiments, with some changes on the masking ratio for different pre-training approaches. + +Streaming pre-train. The streaming pre-training uses the same setup as the original architecture, and the mask length is 300ms and the masking probability is 0.02. The random-projection quantizer stacks every 2 frames for projections. + +Non-streaming pre-train. The non-streaming pre-training extends the original architecture to have access for future context by having the convolution kernel within the Conformer layer to have access for the future 3 frames. The self-attention is still limited to having access only for the previous context. We also explored having future context access for the self-attention, but this setup tends to be less stable. The masking length is $400\mathrm{ms}$ and the masking probability is 0.02. + +Fine-tune. The fine-tuning ASR model uses RNN-T for decoder with a layer of unidirectional LSTM, where the hidden dimension of the LSTM is 640. The training setup is the same as the fine-tuning config for the 0.6B model in the non-streaming experiments. When initializing from a non-streaming pre-trained model, the convolution only uses the kernel weight that accesses the previous context to keep the model streaming. + +Latency measurement. A streaming model can learn to delay its prediction to access the future context and improve the prediction accuracy, and therefore it is critical to measure the latency of the streaming models to see whether the model maintains similar latency. This assessment helps us identify whether the underlying approach provides real improvement instead of trading off latency for prediction accuracy. Our latency comparison process first calculates the starting time and ending time of every word for each hypothesis generated by the two models. The comparison then aligns the hypotheses from the two models, finds the matching words and calculates the difference of their starting and ending time. The relative latency measurement is the average word timing difference of all matched words + +between the two models among all utterances. Specifically the relative latency is calculated with + +$$ +\sum_ {i, j} \frac {s _ {i j} ^ {\prime} - s _ {i j} + e _ {i j} ^ {\prime} - e _ {i j}}{2 N}, \tag {2} +$$ + +where $i$ denotes the index of the matched words between the two hypotheses, $j$ is the utterance index, $s_{ij}$ and $e_{ij}$ correspond to the starting and ending time of the word from the baseline model, $s_{ij}'$ and $e_{ij}'$ correspond to the starting and ending time of the word from the compared model, and $N$ is the total number of matched words among all utterances. A negative relative latency means the compared model has lower latency than the baseline model. + +The word-error-rates and the relative latency are shown in Table 2. In this comparison experiment both wav2vec 2.0 and w2v-BERT use the same architecture, same masking and training setup as BEST-RQ. Using the conventional masking setup for wav2vec 2.0 and w2v-BERT gives worse performance. Since there is no convolution layers at the bottom, the contrastive learning use speech signals as targets. The w2v-BERT model use 12 layers for the contrastive module and 12 layers for the masked prediction module, to be consistent with the non-streaming setup (Chung et al., 2021). Our algorithm outperforms wav2vec 2.0 and w2v-BERT for both streaming and non-streaming pre-training. In particular our algorithm performs well with both pre-training, while wav2vec 2.0 and w2v-BERT favors more with non-streaming pre-training. This is likely due to the fact that the representation learning of both approaches is more compatible with non-streaming architectures. Increasing the model size from 0.1B to 0.6B results a slight increase in latency, but models trained with self-supervised learning algorithms has lower latency with streaming pre-training giving the most significant latency reduction. This indicates that the self-supervised learning preserve the low-latency property while providing quality gain. + +# 4.2. Multilingual Tasks + +We present multilingual results in this section. We use the same model setup as the LibriSpeech non-streaming experiment for these tasks. + +# 4.2.1. DATA + +Multilingual LibriSpeech (MLS-10hrs) The Multilingual LibriSpeech dataset (Pratap et al., 2020) is a large corpus derived from read audiobooks of Librivox and consists of 8 languages: Dutch (du), English (en), French (fr), German (de), Italian (it), Polish (pl), Portuguese (pt), Spanish (es). The latest version of this corpus contains around 50k hours including 44k hours in English. We use the official 10 hours split of training data to evaluate few-shot learning capabilities. + +Table 2. LibriSpeech results compared with previous works with the same streaming architecture, and use LibriLight set for pre-training and LibriSpeech 960h set for fine-tuning. The relative latency (the lower the better) is the average difference of the word prediction time when comparing with the baseline Conformer 0.1B model. Our algorithm outperforms wav2vec 2.0 and w2v-BERT on both WERs and latency. + +
MethodSize (B)devdev-othertesttest-otherRelative latency (ms)
Conformer 0.1B0.14.110.34.59.80
Conformer 0.6B0.63.99.84.49.415.3
Non-Streaming pre-train
wav2vec 2.00.62.67.33.07.2-10.1
w2v-BERT0.62.87.23.36.9-0.7
BEST-RQ (Ours)0.62.56.92.86.6-16.3
Streaming pre-train
wav2vec 2.00.62.78.02.97.9-130.6
w2v-BERT0.62.78.43.08.1-117.1
BEST-RQ (Ours)0.62.56.92.86.6-130.9
+ +Multilingual Voice Search (VS-1000hrs) Our high resource finetune datasets is multilingual Voice Search dataset (Li et al., 2021). We sample random 1000 hour subsets (VS-1000h) across 15 languages, including English (US), English (IN), Spanish (US), Portuguese (BR), Spanish (ES), Arabic (GULF), Arabic (EG), Hindi (IN), Marathi (IN), Bengali (BD), Chinese (TW), Russian (RU), Turkish (TR), Hungarian (HU), and Malay (MY). The test set for each language contains around 3–19K utterances. + +XLS-R unsupervised data (XLS-R -U) Our public unlabeled speech data follows the pre-training data used for XLS-R (Babu et al., 2021) with one major difference: we do not use any data from VoxLingua-107 due to license constraint. In total, we utilize approximately $429k$ hours of unlabeled speech data in $51^{1}$ languages. As a consequence our model is pre-trained on speech from 51 languages as compared to 128 for XLS-R, and our pre-training set is smaller by $6.6k$ hours. We use this pretrain data on MLS-10hrs to compare with published results. + +Youtube unsupervised data (YT-U) Following (Zhang et al., 2021), we collected a multilingual Youtube dataset for pretraining. For each language we prepare an unlabeled YouTube dataset segmented using voice activation detection (VAD (Zazo Candil et al., 2016)). The number of hours per languages are: English (800k hrs), Spanish (800k hrs), Marathi (600k hrs), Portuguese (800k hrs), Russian (800k), Arabic (800k), Hindi (800k), Chinese (800k), Malay (250k), Turkish (800k), Bengali (800k), Hugarian (300k). In practice, we found this data performs much better than XLS-R -U on VS-1000hrs. Thus, we use this pretrain data on VS-1000hrs to compare the performance of different pretrain + +methods. + +# 4.2.2. RESULTS ON MLS-10HRS + +We conduct our multilingual low resource finetune experiments on MLS-10hrs. We use XLS-R -U as pretraining data and finetune it on MLS-10hrs. As shown in Table 3, our baseline w2v-BERT already outperform previous strong model from XLS-R(2B) (Babu et al., 2021). The average WER further bring down by $3\%$ relative by using the proposed BEST-RQ. This demonstrate a simple random-projection quantizer is also effective for multilingual pretraining. We also report finetune results on the MLS full supervised data. Interestingly, with more finetune data, BEST-RQ perform even better than w2v-BERT, especially for pt and pl. Our results also comparable with previously state-of-the-art results in (Bai et al., 2021) which conduct joint training for multilingual ASR. + +While fine-tuning with MLS-full and MLS-10hrs both exhibit improvement compared to existing approaches, fine-tuning with MLS-full provides more relative improvement. This likely implies that pre-training with random-projection quantizers is more effective when there is more fine-tuning data. + +# 4.2.3. RESULTS ON VOICE SEARCH + +To understand how the proposed model work for high resource (1000hrs per language), we pretrain our model on YT-U and finetune it on VS-1000hrs. We can see with more finetune data, the relative improvement is smaller compared with no pretrain baseline. However, our proposed BEST-RQ consistently outperform w2v-BERT and wav2vec 2.0 by $9\%$ and $5\%$ relatively. Compare to w2v-BERT, our proposed method outperform on all the languages. Among the 15 + +Table 3. Test set WER (%) comparisons on the MLS full and 10hrs set. + +
Exp.LanguagesAvg.
endenlfresitptpl
MLS-full
wav2vec 2.0 from XLSR-53 (Conneau et al., 2020)-7.010.87.66.310.414.717.210.6
w2v-BERT from JUST (Bai et al., 2021)6.64.39.95.03.89.114.68.17.8
JUST (Bai et al., 2021) (co-train)6.54.19.55.23.78.88.06.66.5
w2v-BERT (0.6B)5.54.310.95.64.510.113.411.28.2
BEST-RQ (Ours, 0.6B)6.84.19.75.04.97.49.45.26.6
MLS-10hrs
XLSR-53 (Conneau et al., 2020)14.68.412.812.58.913.418.221.213.8
XLS-R(0.3B) (Babu et al., 2021)15.99.013.512.48.113.117.013.912.8
XLS-R(1B) (Babu et al., 2021)12.97.411.610.27.112.015.810.510.9
XLS-R(2B) (Babu et al., 2021)14.07.611.810.06.912.115.69.811.0
w2v-BERT (0.6B)12.77.012.68.95.910.314.66.99.9
BEST-RQ (Ours, 0.6B)12.87.412.79.65.49.912.17.19.6
+ +Table 4. Test set WER (%) comparisons using YT-U for pretrain and VS-1000hrs for finetune, across 15 languages. + +
Exp.Avg. on 15 langs (VS)
Baseline (0.6B)12.6
wav2vec 2.0 (0.6B)12.0
w2v-bert (0.6B)11.5
BEST-RQ (Ours) (0.6B)10.9
+ +languages, English, Portuguese, Russian and Turkish, are improved more than $10\%$ , relatively. Indic languages (Hindi, Marathi and English (IN)) are only slightly improved, all smaller than $3\%$ relatively. + +# 4.3. Analyzing Quantization Quality + +As our self-supervised learning algorithm eliminates the requirement of representation learning through applying a random-projection quantizer, it is crucial to understand the representation quality of this quantizer and how the quality of the quantization affect the self-supervised learning. We analyze the quality of quantizers by training ASR models feeding labels generated by quantizing utterances as input. The performance of the resulting ASR provides us insights on the quality of the quantizer. The ASR model embeds quantized labels and feeds the embedding to a stack of Conformer layers, followed by a CTC decoder. 16 Conformer layer has feature dim 256, local self attention with 8 heads and 128 context length and kernel size 5 for lightweight convolution, in total the model size is $25\mathrm{M}$ . We study the effect of representation learning through comparing with + +quantizers trained with the VQ-VAE. We compare 3 types of quantizers: a) a random-projection quantizer b) a quantizer trained with VQ-VAE where the encoder has the same architecture as the random-projection quantizer and the decoder contains only a projection layer c) a trained VQ-VAE whose encoder/decoder are Transformer models. For trained quantizers, we train on the whole LibriSpeech 960 hours audio-only data, with a constant learning rate of 1e-4 and train for 400k steps with batch size 256. For all quantizers, the input frames are stacked with 3 frames on each's left, resulting in 4x input length reduction. We also use the quantizers for self-supervised learning with the LibriSpeech 0.6B non-streaming setup to compare their performance. + +Table 5 shows the WER on LibriSpeech 960h. Both the random-projection quantizer and the projection-based VQ-VAE quantizer lead to poor ASR performance, while the Transformer-based VQ-VAE quantizer provides a significantly better performance. This implies that the Transformer-based VQ-VAE quantizer learns a better representation. On the other hand, when using these quantizers for the purpose of self-supervised learning, all quantizers lead to similar WERs. This indicates that the quantizer quality does not translate to self-supervised learning quality. + +# 4.4. Analyzing the Effect of Pre-training Data Size + +One potential explanation for the above observation, that a sub-optimal quantization can work well for self-supervised learning, is that the self-supervised learning algorithm can learn to mitigate the quality gap given sufficient amounts of pre-training data. We investigate whether a quantizer with a better quantization quality performs better when the + +Table 5. Quantizer quality's impact on ASR tasks. Although the Transformer-based quantizer gets much better performance when used as input directly, the random-projection quantizer is equally effective for self-supervised learning. The model used in the direct ASR task has size 25M. The self-supervised learning tasks use the same setup as the LibriSpeech non-streaming experiment, which use LibriLight for pre-training and LibriSpeech for fine-tuning and has 0.6B model size. + +
ConfigurationQuantizer size (M)Direct ASR WERPretrain-finetune WER
devdev-othertesttest-otherdevdev-othertesttest-other
Random quantizer158.878.857.972.81.52.81.62.9
Projection VQ-VAE161.474.860.975.21.52.81.62.9
Transformer VQ-VAE1017.835.817.636.11.42.91.63.1
+ +![](images/46ae957cb3b7f368d34f1c0b4514b17b12adf61c1b45e0b42acaea89729f795f.jpg) +Librilight-pretrain, Librispeech finetune WER +Figure 2. Comparing the self-supervised learning quality of the random-projection quantizer (rq) and the Transformer-based VQ-VAE quantizer (tvae) with different pre-training data size. Starting from low amount of pre-train data, the random-projection quantizer is behind the trained Transformer VQ-VAE quantizer. As the amount of pre-train data increases, the random-projection quantizer catches up. + +amount of the pre-training data is limited, and whether increasing the amount of the pre-training data alleviate the discrepancy when compared to a random-projection quantizer. In this study, we compare self-supervised learning quality between a random-projection quantizer (rq) and a trained transformer-based VQ-VAE quantizer (tvae) with different pre-training data sizes. The random quantizer is untrained, and 4 Transformer VQ-VAE quantizers are trained with $\{1 / 64, 4 / 64, 16 / 64, 64 / 64\}$ LibriLight data, respectively. Then 4 identical random-projection quantizers and the above 4 transformer VAE quantizers are pre-trained separately with the same distinct percentages of LibriLight data as above for $100k$ steps with global batch size 2048. The pretrained models fine-tune on LibriSpeech 960h. The result in Figure 2 shows that a quantizer with better representation quality (Transformer-based VQ-VAE) performs better when pre-training data is limited, but the gap disappears as the pre-training data increase. + +# 5. Conclusions and Discussions + +We proposed BEST-RQ to perform self-supervised learning for speech recognition models. BEST-RQ uses a random-projection quantizer to quantize speech signals to discrete labels. The pre-training process masks the speech signals and trains the model to predict labels corresponding to the masked parts. This approach shows similar WERs as the existing state-of-the-art results on LibriSpeech with non-streaming models, and outperform wav2vec 2.0 and w2v-BERT on LibriSpeech with streaming models and on multilingual tasks with non-streaming models. Further analysis showed that despite the fact that the random-projection quantizer provides a poorer representation compared to a trained VQ-VAE quantizer, it is effective for the purpose of self-supervised learning. + +Our algorithm untangle the quantizer from the speech recognition model and also eliminates the requirement of representation learning. This simpler framework makes it easier to find a good recipe for the target task. The improvement on streaming models shows that the separation of the quantizer from the model makes the algorithm more effective for architectures that can be less effective for representation learning. The improvement on multilingual tasks shows that complicated tasks can benefit more from a simpler framework where finding a good recipe becomes more challenging. The quantization quality analysis implies that representation learning is not necessarily critical for self-supervised learning. + +Codebook utilization. One of the most critical factors for pre-training quality is the percentage of the codebook that is used during training. In particular, at each training step a higher percentage of the codebook being used in each batch correlates strongly with a good pre-training quality. When the distribution of the codebook utilization is skewed toward a smaller subset of codes, this usually makes the pre-training task easier and provides less effective pre-training. The $l2$ normalizations on the projected vector and the codebook are critical for providing more uniform codebook utilization. On the other hand, using randomly initialized codebook and projection matrix can introduce different codebook utiliza + +tions with different random seeds, which impact the pretraining quality across different runs with same experiment configurations. This variance impacts quality more when training with smaller pre-training and fine-tuning datasets. How to reduce this reproducibility issue caused by random initialization is an important next step for improving random-projection quantizations. + +Hyperparameters. The pre-training quality is not very sensitive to the codebook vocab size and the codebook dimension, and is more sensitive to the masking probability and the mask length. The role of the projection layer in the random-projection quantizer is to allow using different codebook dimensions, and one can achieve similar results without the projection and set the codebook dimension to be the same as the input dimension. Due to the variance coming from the random initialization, the impact of a hyperparameter usually requires multiple runs of experiments to verify the result. + +Longer convergence time for non-streaming models. One observation we have is that the algorithm takes more steps to converge with non-streaming models. We still observe improvement compared to wav2vec 2.0 and w2v-BERT at the same training step on multilingual tasks, though the final convergence usually takes $50\%$ more steps. On the other hand, our training setup follows (Zhang et al., 2020), and it is unclear to us whether further hyperparameter tuning can help the model to converge faster. We did not observe the longer convergence property with streaming models. + +Initialization. The quantizer uses random initialization and does not update the parameters, and therefore the initialization algorithm can play an important role on the results. In this paper we showed results with Xavier initialization for the projection matrix and the standard normal distribution for the codebook, and further comparisons on different initialization algorithms can be conduct in the future work. + +# 6. Acknowledgements + +We thank Wei Han and Johan Schalkwyk for helpful discussions, and Rohit Prabhavalkar, Izhak Shafran, and Hagen Soltau for insightful feedback. We also want to thank Bo Li for the help on multilingual tasks. + +# References + +Babu, A., Wang, C., Tjandra, A., Lakhotia, K., Xu, Q., Goyal, N., Singh, K., von Platen, P., Saraf, Y., Pino, J., et al. Xls-r: Self-supervised cross-lingual speech representation learning at scale. arXiv preprint arXiv:2111.09296, 2021. +Baevski, A., Auli, M., and Mohamed, A. Effectiveness of self-supervised pre-training for speech recognition. arXiv + +preprint arXiv:1911.03912, 2019. +Baevski, A., Schneider, S., and Auli, M. vq-wav2vec: Self-supervised learning of discrete speech representations. In ICLR, 2020a. +Baevski, A., Zhou, H., Mohamed, A., and Auli, M. wav2vec 2.0: A framework for self-supervised learning of speech representations. arXiv preprint arXiv:2006.11477, 2020b. +Bai, J., Li, B., Zhang, Y., Bapna, A., Siddhartha, N., Sim, K. C., and Sainath, T. N. Joint unsupervised and supervised training for multilingual asr. arXiv preprint arXiv:2111.08137, 2021. +Bao, H., Dong, L., and Wei, F. Beit: Bert pre-training of image transformers, 2021. +Chung, Y.-A., Zhang, Y., Han, W., Chiu, C.-C., Qin, J., Pang, R., and Wu, Y. W2v-bert: Combining contrastive learning and masked language modeling for self-supervised speech pre-training. arXiv preprint arXiv:2108.06209, 2021. +Conneau, A., Baevski, A., Collobert, R., Mohamed, A., and Auli, M. Unsupervised cross-lingual representation learning for speech recognition. arXiv preprint arXiv:2006.13979, 2020. +Devlin, J., Chang, M.-W., Lee, K., and Toutanova, K. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018. +Glorot, X. and Bengio, Y. Understanding the difficulty of training deep feedforward neural networks. In Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics, volume 9 of Proceedings of Machine Learning Research, pp. 249-256. PMLR, 13-15 May 2010. +Graves, A. Sequence transduction with recurrent neural networks. CoRR, abs/1211.3711, 2012. +Gulati, A., Qin, J., Chiu, C.-C., Parmar, N., Zhang, Y., Yu, J., Han, W., Wang, S., Zhang, Z., Wu, Y., and Pang, R. Conformer: Convolution-augmented transformer for speech recognition, 2020. +He, K., Chen, X., Xie, S., Li, Y., Dollar, P., and Girshick, R. Masked autoencoders are scalable vision learners. arXiv preprint arXiv:2111.06377, 2021. +Hsu, W.-N., Bolte, B., Tsai, Y.-H. H., Lakhotia, K., Salakhutdinov, R., and Mohamed, A. HuBERT: Self-supervised speech representation learning by masked prediction of hidden units. arXiv preprint arXiv:2106.07447, 2021. + +Kahn, J., Rivière, M., Zheng, W., Kharitonov, E., Xu, Q., Mazare, P.-E., Karadayi, J., Liptchinsky, V., Collobert, R., Fuegen, C., Likhomanenko, T., Synnaeve, G., Joulin, A., Mohamed, A., and Dupoux, E. Libri-light: A benchmark for ASR with limited or no supervision. In ICASSP, 2020. +Kingma, D. P. and Ba, J. Adam: A method for stochastic optimization. In ICLR, 2015. +Li, B., Pang, R., Sainath, T. N., Gulati, A., Zhang, Y., Qin, J., Haghani, P., Huang, W. R., and Ma, M. Scaling end-to-end models for large-scale multilingual asr. arXiv preprint arXiv:2104.14830, 2021. +Pratap, V., Xu, Q., Sriram, A., Synnaeve, G., and Collobert, R. Mls: A large-scale multilingual dataset for speech research. In INTERSPEECH, 2020. +Sainath, T. N., He, Y., Li, B., Narayanan, A., Pang, R., Bruguier, A., Chang, S.-y., Li, W., Alvarez, R., Chen, Z., and et al. A streaming on-device end-to-end model surpassing server-side conventional model quality and latency. In ICASSP, 2020. +Schneider, S., Baevski, A., Collobert, R., and Auli, M. wav2vec: Unsupervised pre-training for speech recognition. arXiv preprint arXiv:1904.05862, 2019. +Schuster, M. and Nakajima, K. Japanese and Korean voice search. 2012 IEEE International Conference on Acoustics, Speech and Signal Processing, 2012. +Shen, J., Nguyen, P., Wu, Y., Chen, Z., and et al. Lingvo: a modular and scalable framework for sequence-to-sequence modeling, 2019. +van den Oord, A., Vinyals, O., and Kavukcuoglu, K. Neural discrete representation learning, 2018. +Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, L., and Polosukhin, I. Attention Is All You Need. CoRR, abs/1706.03762, 2017. URL http://arxiv.org/abs/1706.03762. +Yu, J., Chiu, C.-C., Li, B., et al. FastEmit: Low-latency Streaming ASR with Sequence-level Emission Regularization. In Proc. ICASSP, 2021. +Zazo Candil, R., Sainath, T. N., Simko, G., and Parada, C. Feature learning with raw-waveform cldnns for voice activity detection. In *Interspeech* 2016, 2016. +Zhang, Y., Qin, J., Park, D. S., Han, W., Chiu, C.-C., Pang, R., Le, Q. V., and Wu, Y. Pushing the limits of semi-supervised learning for automatic speech recognition. arXiv preprint arXiv:2010.10504, 2020. + +Zhang, Y., Daniel Park, S., Han, W., Qin, J., Gulati, A., Shor, J., Jansen, A., Xu, Y., Huang, Y., Wang, S., Zhou, Z., Li, B., Ma, M., Chan, W., Yu, J., Wang, Y., Cao, L., Sim, K. C., Ramabhadran, B., Sainath, T. N., Beaufays, F., Chen, Z., Le, Q. V., Chiu, C.-C., Pang, R., and Wu, Y. Bigssl: Exploring the frontier of large-scale semi-supervised learning for automatic speech recognition. arXiv preprint arXiv:2109.13226, 2021. \ No newline at end of file diff --git a/selfsupervisedlearningwithrandomprojectionquantizerforspeechrecognition/images.zip b/selfsupervisedlearningwithrandomprojectionquantizerforspeechrecognition/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..aee43ea848cfffb654ab2af820de763d13452984 --- /dev/null +++ b/selfsupervisedlearningwithrandomprojectionquantizerforspeechrecognition/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3ecdd02ba9ccd30941dd54dfce4796708e82772bb60576eb4e2c2541b231eeb9 +size 303058 diff --git a/selfsupervisedlearningwithrandomprojectionquantizerforspeechrecognition/layout.json b/selfsupervisedlearningwithrandomprojectionquantizerforspeechrecognition/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..7bb7de2bd1e3258990cd16b60b79ad8fd4b2c05d --- /dev/null +++ b/selfsupervisedlearningwithrandomprojectionquantizerforspeechrecognition/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c2a84cb57ee63ab066fe0228776e1b62cc57b80bded062c063c7625060b72fbb +size 263237 diff --git a/selfsupervisedmodelsaregoodteachingassistantsforvisiontransformers/b8ef0bfa-f01e-4958-95d7-2a916f783494_content_list.json b/selfsupervisedmodelsaregoodteachingassistantsforvisiontransformers/b8ef0bfa-f01e-4958-95d7-2a916f783494_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..5ced0549c9c8a5ad865e63099b60b6f3062f78ce --- /dev/null +++ b/selfsupervisedmodelsaregoodteachingassistantsforvisiontransformers/b8ef0bfa-f01e-4958-95d7-2a916f783494_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ab2827746fb9f2928acaa3965fafa25badc6afde79422d40845b74ce56f5cfbb +size 78796 diff --git a/selfsupervisedmodelsaregoodteachingassistantsforvisiontransformers/b8ef0bfa-f01e-4958-95d7-2a916f783494_model.json b/selfsupervisedmodelsaregoodteachingassistantsforvisiontransformers/b8ef0bfa-f01e-4958-95d7-2a916f783494_model.json new file mode 100644 index 0000000000000000000000000000000000000000..6d651f13b8d8cbf54f7afba297c6ed1e6d6e18dc --- /dev/null +++ b/selfsupervisedmodelsaregoodteachingassistantsforvisiontransformers/b8ef0bfa-f01e-4958-95d7-2a916f783494_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1bc816b906724312accd02f55e5b1d459a322f4025525bc8f22f1e96d469a421 +size 94250 diff --git a/selfsupervisedmodelsaregoodteachingassistantsforvisiontransformers/b8ef0bfa-f01e-4958-95d7-2a916f783494_origin.pdf b/selfsupervisedmodelsaregoodteachingassistantsforvisiontransformers/b8ef0bfa-f01e-4958-95d7-2a916f783494_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..9a8d543cd4898f48fb6b434d734ddb5d07ae3cd1 --- /dev/null +++ b/selfsupervisedmodelsaregoodteachingassistantsforvisiontransformers/b8ef0bfa-f01e-4958-95d7-2a916f783494_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d5fc1e53d9bf83206ec8bc984f1dee2375d13c2323e82c410c0f5068d934eec6 +size 1657319 diff --git a/selfsupervisedmodelsaregoodteachingassistantsforvisiontransformers/full.md b/selfsupervisedmodelsaregoodteachingassistantsforvisiontransformers/full.md new file mode 100644 index 0000000000000000000000000000000000000000..fe6101663b45df5a1ef4a0d6dd8b8d24794b70c4 --- /dev/null +++ b/selfsupervisedmodelsaregoodteachingassistantsforvisiontransformers/full.md @@ -0,0 +1,319 @@ +# Self-supervised Models are Good Teaching Assistants for Vision Transformers + +Haiyan Wu $^{*1}$ Yuting Gao $^{*2}$ Yinqi Zhang $^{1}$ Shaohui Lin $^{1}$ Yuan Xie $^{1}$ Xing Sun $^{2}$ Ke Li $^{2}$ + +# Abstract + +Transformers have shown remarkable progress on computer vision tasks in the past year. Compared to their CNN counterparts, transformers usually need the help of distillation to achieve comparable results on middle or small sized datasets. Meanwhile, recent researches discover that when transformers are trained with supervised and self-supervised manner respectively, the captured patterns are quite different both qualitatively and quantitatively. These findings motivate us to introduce a self-supervised teaching assistant (SSTA) besides the commonly used supervised teacher to improve the performance of transformers. Specifically, we propose a head-level knowledge distillation method that selects the most important head of the supervised teacher and self-supervised teaching assistant, and let the student mimic the attention distribution of these two heads, so as to make the student focus on the relationship between tokens deemed by the teacher and the teacher assistant. Extensive experiments verify the effectiveness of SSTA and demonstrate that the proposed SSTA is a good compensation to the supervised teacher. Meanwhile, some analytical experiments towards multiple perspectives (e.g. prediction, shape bias, robustness, and transferability to downstream tasks) with supervised teachers, self-supervised teaching assistants and students are inductive and may inspire future researches. The code is released in https://github.com/GlassyWu/SSTA + +*Equal contribution $^{1}$ School of Computer Science and Technology, East China Normal University, Shanghai, China $^{2}$ Tencent Youtu Lab, Shanghai, China. This work was done when Haiyan Wu was an intern at Tencent Youtu Lab. Correspondence to: Yuan Xie , Shaohui Lin . + +Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s). + +![](images/ab3b8622ce9adf93bf233616f02785746b4d0a8d4a2025ad590e9173f75d8a5a.jpg) +Figure 1. Visualizations of self-attention maps from the last layer of DeiT-S (Touvron et al., 2021). + +# 1. Introduction + +Recently, Vision Transformers (ViTs) have been successfully used for computer vision tasks, including image recognition, object detection, semantic segmentation and so on. Remarkably, ViTs are capable to reach superior performance on image classification task when trained with large-scale datasets, e.g. JFT-300M (Dosovitskiy et al., 2020). However, ViTs achieve lower accuracies than Convolutional Neural Networks (CNNs) on medium-scale or small-scale datasets (Dosovitskiy et al., 2020). To alleviate the demand for data, DeiT (Touvron et al., 2021) distills the inductive bias from a large CNN teacher by introducing an extra distillation token and shows satisfactory results. + +Self-supervised learning (SSL) and supervised learning (SL) are two different paradigms w.r.t. the way they construct training objectives. With the development of transformer, self-supervised learning for transformers has also attracted widespread attention from the community, and many approaches have been proposed (Chen et al., 2021b; Caron et al., 2021). (Caron et al., 2021) reported an interesting discovery that self-attention visualizations of self-supervised vision transformers and supervised vision transformers represent different tendentiousness. As shown in Figure 1, vision transformers trained with supervised signal pay more attention to texture, while self-supervised counterparts focus on shape. In addition, when the size of the annotated training dataset is small, the supervised transformer is more prone to overfitting. For example, when the training dataset is ImageNet-1K (Russakovsky et al., 2015), self-supervised ViT can transfer better to downstream tasks than its counterpart (Caron et al., 2021). + +![](images/af4181073a47f2ec6b192bb823b8f2ca02969af4bdeef381097bd6e4e3cffb98.jpg) +Figure 2. CKA similarities between layers across different learning paradigms. The higher the value, the higher the similarity. + +These observations motivate us to explore and exploit the differences between these two learning paradigms (SSL v.s. SL) applied on ViTs. We measured the similarity index between the feature layers of two randomly initialized supervised transformers and of a supervised transformer and a self-supervised transformer through Centered Kernel Alignment (CKA) indicator (Kornblith et al., 2019). The results are shown in Figure 2. It can be seen that the similarity between the layers of two randomly initialized supervised transformers (orange line) significantly exceeds that between a supervised transformer and a self-supervised transformer (blue line), and the feature similarity of the last few layers is relatively lower. + +Since the difference is quantitatively prominent and qualitatively compensating, we propose to introduce a self-supervised teaching assistant (termed as SSTA) besides the commonly used supervised teacher to further improve the performance of transformers. Specifically, we propose a head-level knowledge distillation method that selects the most important head of the supervised teacher and the self-supervised teaching assistant, and let the student mimic the attention distribution of these two heads, so as to make the student focus on the relationship between tokens deemed by the teacher and the teacher assistant. Extensive experiments demonstrate that the proposed SSTA is a good compensation to the supervised teacher. Meanwhile, compared with supervised teaching assistant, SSTA with greater difference can bring more improvements. + +The success of SSTA prompted us to further reveal the otherness between the self-supervised ViTs and supervised ViTs. We explore the differences between two different teachers and the students distilled from different teachers on prediction, shape bias, robustness, and transferability to downstream tasks, some of which are counter-intuitive and + +are studied for the first time. + +Our contributions are summarized as follows: + +- By observing that self-supervised learning and supervised learning provide information from different perspectives, we exploit adding a self-supervised transformer as a teaching assistant to complement to commonly used supervised teacher, and firstly propose a head-level knowledge distillation approach for data efficient vision transformer learning. +- To effectively transfer the knowledge via heads, a heuristic head selection strategy is designed to choose the most informative heads from teacher. Meanwhile, an early stop learning strategy is further derived to facilitate distillation. +- Extensive experiments are conducted to demonstrate the advantage of the self-supervised teaching assistant. Besides, by comprehensive analyzing the variant combination of two teachers, several interesting findings, regarding the prediction, shape bias, robustness, and transferability, are detailed analyzed for the first time. + +# 2. Related Work + +# 2.1. Vision Transformer + +Recently, ViTs have made tremendous development, and various Transformer architectures for computer vision tasks have been proposed (Dosovitskiy et al., 2020; Touvron et al., 2021; El-Nouby et al., 2021; Chen et al., 2021a; Han et al., 2021; 2022). The Self-Attention mechanism allows transformers to capture long-distance relationships and become content-aware. Compared to CNN, ViTs are more robust to severe occlusions, perturbations, and domain shifts and significantly less biased towards textures (Naseer et al., 2021). However, ViTs are very hungry for data, when training on medium-scale or small-scale datasets, ViTs can't exceed the results of CNN (Dosovitskiy et al., 2020). Therefore, works (Touvron et al., 2021; Graham et al., 2021) introduce the inductive bias of a supervised pre-trained large CNN teacher through knowledge distillation, thereby alleviating the demand for annotated data. + +# 2.2. Knowledge Distillation + +Knowledge Distillation (KD) was first proposed by (Hinton et al., 2015), which aims to transfer the knowledge of a larger teacher model to a smaller student model. Many approaches have achieved great success on CNN, e.g. (Romero et al., 2014; Zagoruyko & Komodakis, 2016; Park et al., 2019), however due to the differences of transformers, few of them can be directly applied to transformers. DeiT (Touvron et al., 2021) is the first work applying knowledge distillation to transformer, which adds an extra distillation token + +to transfer the inductive bias of a larger CNN to a relatively small transformer in the form of hard or soft output label. (Ren et al., 2021) use different architectural inductive biases to co-advise the student transformer. These methods all rely on the inductive bias of other network structure, the knowledge needed by the student transformer and the effective transmission method are still to be explored. Furthermore, the teachers used in the existing distillation methods are all obtained by supervised training, and as far as we know, we are the first to try to use self-supervised representations to assist supervised training. + +# 2.3. Self-supervised Learning + +Self-supervised Learning (SSL) is a generic framework that gets supervision from the data itself without any tags from human labor. Earlier methods heavily rely on constructing negative samples, e.g. SimCLR (Chen et al., 2020a;b), MoCo (He et al., 2020; Chen et al., 2020c), while recent works eliminate the need for negative samples, e.g. BYOL (Grill et al., 2020), SimSiam (Chen & He, 2021). With the development of vision transformer, some works (Caron et al., 2021), (Chen et al., 2021b) apply contrastive learning to vision transformers. Compared to supervised counterparts, self-supervised vision transformers exhibit some properties. As described in (Caron et al., 2021), self-supervised ViT features explicitly contain the scene layout and object boundaries. In this work, we show that the difference between self-supervised ViT representations and supervised ViT representations is far from that. + +# 2.4. KD Meets SSL + +Recently, some works have combined KD and SSL. SSKD (Xu et al., 2020) adds an SSL branch next to the supervisory branch and regards the information contained in the SSL task as additional dark knowledge. CRD (Tian et al., 2019) proposes a contrastive-based objective for knowledge distillation, which allows the student to capture more information in the teacher's representations of data. SEED (Fang et al., 2021) employs knowledge distillation as a means to improve the representation capability of small models in self-supervised learning. These methods are for CNN, and there is only one teacher with the same training paradigm as the student. While in our method, the teacher and the student are under different training paradigms and the two teachers are trained by different paradigms with obvious different tendentiousness. + +# 3. Methodology + +In this section, we introduce the proposed Self-Supervised Teacher Assistant (SSTA). We first present the overall architecture in Section 3.1, and then introduce the specific head-level distillation in detail in Section 3.2. Finally, the + +entire training process is described in Section 3.3. + +# 3.1. Overall Architecture + +The framework of the proposed method is shown in Figure 3, consisting of three transformer encoders. The Student in the middle is the encoder that we want to improve, the SL Teacher on the left is the pre-trained teacher obtained via supervised learning, and the SSTA on the right is the pre-trained teaching assistant obtained through self-supervised learning. For each input $X \in \mathbb{R}^{H \times W \times C}$ , where $H$ , $W$ and $C$ represents the height, width and channel of the image respectively, it is input to three encoders respectively. After patch embedding, the input image is projected to $X_{PE} \in \mathbb{R}^{N \times D}$ where $N$ is the number of tokens and $D$ is the dimension of each token, and $X_{PE}$ is then fed into stacked layers. As shown in Figure 3, each layer consists of LayerNorm (Ba et al., 2016), Multi-head Self Attention (MSA), Multi-Layer Perceptron (MLP) and residual connections. + +For MSA, we first compute $Q = X_{PE} \cdot W_{\mathrm{Q}} \in \mathbb{R}^{N \times h \times d}$ , $K = X_{PE} \cdot W_{\mathrm{K}} \in \mathbb{R}^{N \times h \times d}$ and $V = X_{PE} \cdot W_{\mathrm{V}} \in \mathbb{R}^{N \times h \times d}$ via linear transformations $W_{\mathrm{Q}}, W_{\mathrm{K}}, W_{\mathrm{V}}$ , where $h$ is the number of heads, and $d$ is the dimension of each head ( $d = D / h$ ). Figure 3 (right) shows the details of MSA, $Q$ and $K$ produce an attention matrix via inner product and then the matrix is rescaled by $\sqrt{d}$ and normalized with a softmax function. Finally, the normalized attention matrix is multiplied by $V$ to get the output of the MSA layer. The entire procedure can be formulated as: + +$$ +A t t n M a t = S o f t m a x \left(Q \times K ^ {T} / \sqrt {d}\right), \tag {1} +$$ + +$$ +O u t p u t = A t t n M a t \times V, \tag {2} +$$ + +note the dimension of $\text{AttnMat}$ is $h \times N \times N$ . For more details, please kindly refer to (Dosovitskiy et al., 2020). + +AttnMat describes the attention distribution, which is computed based on the similarity between tokens. The higher the value, the more the relevance. The attention distribution reflects the relationship between tokens, and the relationship between [cls] token and other patch tokens can further reflect where the model is focusing on, as shown in Figure 1. Existing work (Zagoruyko & Komodakis, 2016) has demonstrated that the attention maps of a powerful teacher network are effective knowledge in CNN. As Transformers are based on attention mechanism, we consider adopting attention distribution as knowledge to transfer. The specific knowledge transfer method is the newly proposed head-level distillation, which will be introduced in Section 3.2. + +![](images/7f40cb27769d02345e6871862b0da7a2c3938624d7f4e742203e7df05e9e47b6.jpg) +Figure 3. The overall architecture of the proposed method. One image is first projected into tokens, and then input to three transformer encoders, one is the learnable student, one is a frozen pre-trained SL teacher, and the other is the fixed pre-trained SSTA. The areas concerned by the head of the students are required to be consistent with the areas focused by the most important head in the SL teacher and SSTA simultaneously via constraining the attention distributions. + +# 3.2. Head-level Distillation with SSTA + +As (Caron et al., 2021) observed that different heads focus on different locations, we consider distilling diverse knowledge from the heads of different teachers. Figure 1 shows that the heads of SL transformers focus more on textures of background, while the heads of SSL transformers have high activation on objects. For the human visual system, both the objects and textures of background are important judgment bases when determining the categories of images, which inspires us to fully utilize these different attention preferences. We propose a head-level knowledge distillation method, which is illustrated in the dashed box of Figure 3. Specifically, two heads of the student imitate the attention distribution of the most important head of the two diverse teachers (i.e. SSL teacher (SSTA) and SL teacher) respectively via knowledge distillation loss, so as to pay attention to the most significant relationship deemed by different teachers simultaneously. Next, we will introduce the choice of the most important head from the teachers and the definition of distillation loss. + +# 3.2.1. HEAD SELECTION STRATEGY + +The first critical problem of head-level distillation is the selection of the most important heads. Since different vision transformers have different numbers of heads, aligning the number of teacher and student heads is a thorny problem. To avert this problem, we propose a head selection strategy which only selects the most important head for each layer from the teacher for knowledge distillation. Considering that the greater the contribution to the accuracy, the more important the head is, we first evaluate the accuracy drop by alternatively setting different head to zero, and then regard the head corresponding to the highest drop as the most im + +portant one. Supposing the index of the head to be estimated is $i \in \{1, 2, \ldots, h\}$ for the $l$ -th layer, the reset process can be expressed as: + +$$ +A t t n M a t _ {l} [ i,:,: ] = \mathbf {0}, \tag {3} +$$ + +the new AttnMat is remarked as AttnMat'. Then, we define the importance of the head as follows: + +$$ +I = \operatorname {A c c} \left(\phi \left(\operatorname {A t t n M a t}\right)\right) - \operatorname {A c c} \left(\phi \left(\operatorname {A t t n M a t} ^ {\prime}\right)\right), \tag {4} +$$ + +where $\phi (AttnMat)$ is the model with original heads, $\phi (AttnMat^{\prime})$ is the model that partial heads are reset as zero and $Acc(\cdot)$ is the accuracy of model. The higher the $I$ value, the more important it is. Note that we estimate the importance of heads on the pre-trained model. For the assigned layer set $L$ , we select the most important head for each layer, then we can obtain most important head index set $H^{\prime} = \{i^{l}\}$ , where $l\in L$ . It is worth noting that when conducting distillation on multi-layers (i.e. $|L| > 1$ ), we evaluate the most important combination of multiple heads over multiple layers. For example, in this paper, $L = \{10,11,12\}$ , for the head combination $\{1^{10},2^{11},3^{12}\}$ that to be evaluated, the 1st head of 10th layer, the 2nd head of 11th layer and the 3rd head of 12th layer are reset to 0. + +# 3.2.2. OBJECTIVE FUNCTION + +After selecting the most important heads of the SL teacher and SSL teacher (SSTA), we let two heads in each layer of the student mimic the most important head of SL teacher and SSL teacher (SSTA) in the corresponding layer respectively through minimizing Kullback-Leibler divergence between the head-level attention distributions. The objective function + +![](images/7a0d2acc40d69bfc44e3101168c5fd6aab68f9da43e551cb05ccd0c90e7d6aed.jpg) +(a) DeiT-Ti with only one teacher (SL or SSL). + +![](images/5e1568fd033a7bdf22e1b464ddd24563a491cb4fec89020e3fe5b58e1f6fe97d.jpg) +(b) DeiT-Ti with our method. +Figure 4. Accuracy curves during training. (a) exhibits that both the SL teacher and SSL teacher can accelerate the convergence of the student in the early stage, and the acceleration of SSL teacher is more significant. However, this superiority disappears in the later stage. (b) demonstrates that our method can take advantage of the ability of SSL teacher to accelerate convergence in the early stage, allowing students to converge faster in the early stage while stably surpassing the baseline in the later stage. The distillation is stopped at 100 epoch. + +of knowledge distillation is as follows: + +$$ +\begin{array}{l} L _ {K D} ^ {S L} = \sum_ {i \in H _ {S L} ^ {\prime}} K L \left(A t t n M a t _ {l} ^ {S} [ 0, :, : ], A t t n M a t _ {l} ^ {S L} [ i, :, : ]\right), (5) \\ L _ {K D} ^ {S S L} = \sum_ {j \in H _ {S S L} ^ {\prime}} K L \left(A t t n M a t _ {l} ^ {S} [ 1, :, : ], A t t n M a t _ {l} ^ {S S L} [ j, :, : ]\right), (6) \\ \end{array} +$$ + +where $KL(\cdot)$ is Kullback-Leibler divergence, $H_{SL}^{\prime}$ and $H_{SSL}^{\prime}$ are the most important heads sets of SL teacher and SSL teacher (SSTA), respectively. $AttnMat_l^S$ presents the attention of student in the $l$ -th layer. + +# 3.3. Training Process + +Total loss. The total loss is defined as follows: + +$$ +L _ {T o t a l} = \alpha \cdot L _ {C E} (f ^ {S} (X), y) + \beta \cdot L _ {K D} ^ {S L} + \lambda \cdot L _ {K D} ^ {S S L}, (7) +$$ + +where $L_{CE}(\cdot)$ denotes Cross Entropy, and $y$ is ground truth. $\alpha, \beta$ and $\lambda$ are the hyper-parameters that control the weights of CE loss and distillation loss. $f^{S}(X)$ is the final prediction of $X$ through student $f^{S}$ . + +Early stop strategy. Figure 4(a) shows the curve of training accuracy, it can be observed that both the SL teacher and SSL teacher can accelerate the convergence of student in the early stage, and the acceleration of SSL teacher is more significant in particular. However, this property has no benefit for student in the later period, and the performance of student even declined. Based on this observation, we propose the early stop strategy to take advantage of this property and avoid performance degradation. Specifically, the distillation is only conducted in the early stage (e.g. 100 epochs), when entering the next epoch, $\beta$ and $\lambda$ of Eq. 7 are set to 0. + +Table 1. The training losses of DeiT-Ti with different knowledge distillation versions. The teacher is DeiT-S. Note that $KD@1ep$ and $KD@100ep$ denote intermediate results of the 1st epoch and the 100th epoch respectively, and others are the results of the 300th epoch. ESKD stopped distillation after 100 epoch. + +
ModelCESSL KDSL KDAcc@1
KD@1ep6.946.316.58-
KD@100ep4.221.182.02-
Full KD3.771.051.6872.2
ESKD (Ours)3.4817.365.6974.0
+ +Since teachers are usually larger than students, there is a mismatch between student and teacher capacities. We hypothesis that the low-capacity student may not have enough capacity to minimize both the cross entropy loss and the knowledge distillation loss simultaneously. To verify that, we analyzed the training losses of the standard knowledge distillation (Full KD) and the early stopping knowledge distillation (ESKD) as shown in Table 1. We find that Full KD achieves a higher CE loss and lower KD loss than ESKD. This phenomenon suggests that the standard knowledge distillation models are trading off one loss against another, and the student end up minimizing one loss (KD loss) at the expense of the other (CE loss), especially towards the end of training. Actually, consistent with our observation, previous work (Cho & Hariharan, 2019) has also demonstrated that the full distillation adversely affects training on CNN architectures on challenging dataset like ImageNet. Besides, as we adopt two teachers, the competition of losses is more obvious. Therefore, the proposed early stopping strategy benefits the training at initial stage while avoiding the student model with limited capacity struggling in balancing the KD and the CE losses at later stage. + +Table 2. Results on ImageNet-1K. A(B) stands for the teacher of A structure obtained by B training paradigm, $\widehat{\mathbf{m}}$ denotes the student uses the hard label output by RegNetY-16G (Radosavovic et al., 2020) for distillation and $\ddagger$ means our reproduction. We trained the student models from scratch, and the students without any teacher are baselines. All the SSL teachers we adopt are based on linear evaluation protocol. + +
Teacher1Acc@1Teacher2Acc@1StudentAcc@1
----DeiT-Ti72.2
DeiT-S (SSL)77.0DeiT-S (SL)79.9DeiT-Ti74
----DeiT-Ti m74.5
DeiT-S (SSL)77.0DeiT-S (SL)79.9DeiT-Ti m75.2
----DeiT-S79.9
DeiT-B (SSL)78.2DeiT-B(SL)81.8DeiT-S81.4
----XCiT-T1277.0‡
XCiT-S12 (SSL)77.8XCiT-S12 (SL)82.0XCiT-T1277.5
+ +For early stop epoch, we set this parameter by referring to the accuracy curves of DeiT-Ti with single teacher (see Figure 4(a) in the paper). Since the red line (DeiT-Ti distilled by SSL teacher) and green line (DeiT-Ti distilled by SL teacher) are close to baseline around 200 epoch, we select the median of 1 and 200 as the early stop epoch (e.g.100 epoch). + +# 4. Experiments + +# 4.1. Implementation Details + +Datasets. ImageNet (Russakovsky et al., 2015) is used to verify the effectiveness of our method. CIFAR-10 and CIFAR-100 (Krizhevsky et al., 2009) are adopted for downstream transferring tasks. ImageNet-C (Hendrycks & Dietterich, 2019) is utilized to analyze the robustness of the representations. SIN dataset (Geirhos et al., 2018) is used to evaluate the shape bias of models. + +Teacher Pre-training Settings. The SSTAs are obtained by DINO (Caron et al., 2021) and both the pre-training and linear evaluation are conducted on ImageNet-1K. The SL teachers are obtained by DeiT (Touvron et al., 2021) and XCiT (El-Nouby et al., 2021) respectively without distillation. + +Distillation Training Settings. Following DeiT and XCiT, the total number of distillation epochs are 300 and 400 for DeiT and XCiT respectively, and the corresponding early stop epochs are 100 and 150. All the SSL teachers we adopt are based on linear evaluation protocol, and the teachers are frozen during the distillation. We trained the student models from scratch. + +Downstream Transfer Training Settings. In order to analyze the generalization of representations, we further conduct linear evaluation on CIFAR-10 and CIFAR-100. Since the image resolution of the CIFAR dataset is $32 \times 32$ , all the images are resized to $224 \times 224$ with bicubic resampling, following (Gao et al., 2021). All the training + +hyper-parameters are consistent with (Gao et al., 2021). + +# 4.2. Performance on ImageNet + +We first verify the effectiveness of the proposed method on ImageNet-1K. The results are shown in Table 2, from which we have the following observations: + +$i$ . The proposed method outperforms all the baselines significantly. Specifically, our method can bring $1.8\%$ improvement on DeiT-Ti (74% v.s. 72.2%). When applying to DeiT-Ti, which is a strong baseline that enhances the model by introducing the inductive bias from a large pretrained CNN teacher, our method can still bring a further $0.7\%$ gain. + +ii. The proposed method is not limited to transformer architectures, and can also bring considerable improvement on XCiT-T12. + +# 4.3. Ablation Study + +Effectiveness of SSTA. As expected, the distillation results of two teachers will be better than that of a single teacher since more knowledge is transferred to the student. However, as shown in Table 3, there is no difference between using a single SL teacher (SL_KD_early100) and two different SL teachers (2SL_KD_early100). On the contrary, our method which adds an SSTA to the SL teacher can significantly improve the performance. In particular, our approach can bring an accuracy improvement of $0.8\%$ , $1.4\%$ and $0.8\%$ , compared to training with single SL teacher (SL_KD_early100), single SSL teacher (SSL_KD_early100) and two different SL teachers (2SL_KD_early100), respectively. The results demonstrate the effectiveness of SSTA and inspire us to further explore the otherness of different teachers and students. We provide detailed analyses in Section 5. + +Effectiveness of head selection strategy. Besides selecting the most important heads based on the contribution to accuracy, we also tried to use the average of the attention + +Table 3. Ablation study on ImageNet-1K. 100ep denotes 100 epochs, imp. stands for selecting the most important head for distillation, avg. means using the average of multiple heads, and rand. denotes random selection of one head from teacher. + +
ModelSL KDSSL KDEarly StopHead Sel.Acc@1
Baseline×××-72.2
Single Teacher
SL_KD✓××imp.72.0
SSL_KD×✓×imp.72.2
SL_KD_early100✓×100epimp.73.2
SSL_KD_early100×✓100epimp.72.6
Multiple Teachers
2SL_KD✓✓×imp.71.4
SSTA_KD✓✓×imp.72.2
2SL_KD_early100✓✓100epimp.73.2
SSTA_KD_avg_early100✓✓100epavg.73.2
SSTA_KD_rand_early100✓✓100eprand.73.5
SSTA_KD_early100 (Ours)✓✓100epimp.74.0
+ +Table 4. Ablation study of early stop epoch on DeiT-Ti. imp. stands for selecting the most important head for distillation. + +
ModelSL KDSSL KDEarly Stop EpochHead Sel.Acc@1
Baseline×××-72.2
SSTA_KD_early50✓✓50imp.73.4
SSTA_KD_early100 (Ours)✓✓100imp.74.0
SSTA_KD_early150✓✓150imp.73.4
SSTA_KD_early200✓✓200imp.73.7
SSTA_KD_early250✓✓250imp.72.6
SSTA_KD_early300✓✓×imp.72.2
+ +Table 5. The effect of distilling with different layers on ImageNet. + +
LayersACC@1
{12}73.1
{11, 12}73.4
{10, 11, 12}74.0
{9, 10, 11, 12}73.6
+ +distribution of all heads or randomly choose one head within one layer as the knowledge to transfer. As shown in the bottom three rows of Table 3, choosing the most important head has an improvement of $0.8\%$ or $0.5\%$ compared to taking the average attention distribution of the heads or random selection, which indicates the effectiveness of the proposed head selection strategy. + +Effectiveness of early stop strategy. It can be seen from Table 3 that the students do not work well when using head-level distillation in all epochs. Nevertheless, after applying the early stop strategy, our method can significantly boost the performance of students (up to $1.8\%$ accuracy). The experimental results prove that the early stop strategy can make good use of the advantages of the head-level distillation to accelerate the convergence of students in the early stage, so as to achieve better results, the corresponding training accuracy curve is shown in Figure 4(b). + +Table 4 shows the performance with different early stop + +Table 6. Comparison against existing distillation methods. All the teachers are Deit-S, and students are Deit-Ti. + +
SL Teacher KD MethodSSTA KD MethodStu. Acc@1
--72.2
LKDHead-level73.4
ATHead-level70.0
Head-levelHead-level74
+ +epochs. It can be seen that stopping distillation at 100 epoch can achieve the best results. + +Multiple layers for distillation. We tried distillation on different layers and the results are shown in Table 5. As the representation similarity between SL teacher and SSL teacher (SSTA) is lower in the deeper layers (see Figure 2), which means the diversity between SL teacher and SSL teacher (SSTA) is higher, we search the layers from back to front. It can be observed that with the increase of the number of distillation layers, the accuracy of the student rises first, when the number of layers is 3 (i.e. $L = 10, 11, 12$ ), it reaches the maximum value, and then if the number of layers increases again, the accuracy will decrease instead. Therefore, our distillation is carried out on the 10th, 11th and 12th layers. + +Table 7. Performance of transferring to downstream classification task on CIFAR-10 and CIFAR-100. + +
DatasetTeacher1Acc@1Teacher2Acc@1StudentAcc@1
CIFAR-100----DeiT-Ti71.9
DeiT-S (SL)78.0--DeiT-Ti72.2
DeiT-S (SSL)80.9--DeiT-Ti72.2
DeiT-S (SL)79.6DeiT-S (SL)78.0DeiT-Ti72.0
DeiT-S (SSL)80.9DeiT-S (SL)78.0DeiT-Ti72.8
----DeiT-S78.0
DeiT-B (SSL)84.5DeiT-B(SL)82.6DeiT-S80.4
CIFAR-10----DeiT-Ti90.4
DeiT-S (SL)93.9-DeiT-Ti90.7
DeiT-S (SSL)95.0-DeiT-Ti91.1
DeiT-S (SL)94.5DeiT-S (SL)93.9DeiT-Ti91.2
DeiT-S (SSL)95.0DeiT-S (SL)93.9DeiT-Ti91.6
----DeiT-S93.9
DeiT-B (SSL)96.4DeiT-B(SL)95.9DeiT-S95.2
+ +# 4.4. Comparison Against Existing KD Methods + +In this section, we compare the head-level distillation against two widely-used distillation methods, logits distillation (LKD) (Hinton et al., 2015) and attention transfer (AT) (Zagoruyko & Komodakis, 2016). We follow the common practice that using SL model as the teacher for logits distillation and attention transfer. Since our method adopts two teachers, to be fair, we add SSTA to the above distillation methods during training. The results are shown in Table 6, it can be observed that SSTA combining head-level knowledge from SL teacher is better than combining the form of AT/logits. We also find that combining AT performs even worse than baseline. + +# 4.5. Transfer Learning on Downstream Tasks + +In order to analyze the generalization of representations obtained by our method, we further conduct linear evaluation on CIFAR-10 and CIFAR-100, and the results are shown in Table 7. It can be seen that compared to the baseline without any distillation, our method can significantly improve the classification accuracy on both CIFAR-10 and CIFAR-100. Furthermore, when using SSL teacher with better generalization as teaching assistant, the student is better than using SL teacher as teaching assistant. The results prove that the introduction of SSL teacher (SSTA) can make the students have better generalization, which further verifies the effectiveness of our method. + +# 5. Analysis + +In this section, we did some in-depth analyses towards the otherness between the representations obtained by different learning paradigms. Firstly, we explore the prediction preference of SL teacher and SSL teacher, and then further analyze the shape bias of teachers and students, and the robustness of networks, finally we provide some visualiza + +tions. Note the teachers in all experiments of this part are DeiT-S, and the students are DeiT-Ti. + +# 5.1. Prediction Preference + +Figure 5 demonstrates the distribution of predictions of the top 10 categories by SL teacher and SSL teacher. It can be seen that these two models have different tendencies for the predicted categories. Furthermore, we counted the number of samples in which one of SL teacher and SSL teacher has a correct prediction, but the other has a wrong prediction, which accounted for $11.3\%$ of the validation dataset. In addition, the top 3 categories that SL teacher predicted correctly but SSL teacher predicted incorrectly are lighter, spatula and coffee mug, but the top 3 classes that SL teacher predicted incorrectly but SSL teacher predicted correctly are cornet, sports car and drum. These data prove that two models with the same structure obtained with different learning paradigms have different prediction preferences, which is what we are trying to exploit. + +![](images/0d03b2b1545e7368b496ea1dfaa9ed1661f0a2e9fb23f1643c8e715f8550a614.jpg) +Figure 5. Prediction distribution. The abscissa is the top 10 categories in the validation dataset of ImageNet predicted by SL teacher and SSL teacher, and the ordinate is the specific number. + +# 5.2. Shape Bias + +(Tuli et al., 2021) reported that the errors of vision transformers are more consistent with those of humans, compared to CNN. We are interested in comparison of ViTs with different representations and human vision. Following (Geirhos + +![](images/6d2448bc6f97d461af6728c198efa5c91714266aec9c3e3b6e43a32e2f057e14.jpg) +Figure 6. Visualizations of self-attention from the last layer. DeiT-Ti(Ours) consists of 3 heads, and the 1st head and 2nd head are distilled from SSL teacher (SSTA) and SL teacher respectively. + +![](images/167dd3801ed9bc52d98c144795ecbec705c480185a61217d92ee7a2ff846afa7.jpg) +Figure 7. Shape bias of ViTs. DeiT-S (SL) and DeiT-S (SSL) are two teachers and DeiT-Ti (2SL) is distilled by two different SL teachers. The horizontal line in each rectangular entity is the median. + +et al., 2018), we evaluate shape bias on SIN dataset. + +The results of shape bias are presented in Figure 7, we can see that although the shape bias of SL teacher is higher than that of SSL, the shape bias of student distilled by two different SL teachers is actually lower than that of student distilled by one SL teacher and together with another SSL teacher (SSTA). We find that SSTA forces students have a higher shape bias which behaves more like human. + +# 5.3. Robustness + +We measure the robustness on ImageNet-C, as shown in Table 8. Our SSTA can improve the robustness of student, compared to both the student distilled by two different SL teachers (52.1 v.s. 53.0) and without distillation (52.1 v.s. 54.0). Moreover, it is worth noting that the results in Table 8 show that SL teachers have stronger robustness, while the robustness of the student distilled by two SL teachers is worse than the student distilled by an SL teacher together with another SSTA, which further proves the effectiveness of SSTA. + +# 5.4. Visualizations + +As shown in Figure 6, compared to baseline (right) which is trained without any distillation, our student pays more attention to objects, especially the first head since it mimics the most important head of SSL teacher (SSTA). For example, when recognizing the loggerhead (the first input), + +Table 8. Performance on ImageNet-C. * represents the model is obtained by different initialization. The lower the mCE value, the better. + +
ModelmCE (↓)
Teachers
DeiT-S (SL)41.4
DeiT-S (SL) *40.7
DeiT-S (SSL)51.5
Students
DeiT-Ti (Baseline)54.0
DeiT-Ti (2 SL teachers)53.0
DeiT-Ti (Ours)52.1
+ +since the key areas are not focused, baseline misjudges it as $\text{pug-dog}$ , but our student can predict correctly. More visualizations can be seen in appendix, including the most important heads and the attention maps of the last layer. + +# 6. Conclusion + +In this paper, we exploit a self-supervised transformer as the teaching assistant besides the commonly used supervised teacher, and propose a head-level knowledge distillation approach to improve the performance of low-capacity networks (i.e. students). Experiments demonstrate that self-supervised models are good teaching assistants for transformers. Meanwhile, more insightfully analytical experiments towards the difference between the supervised and self-supervised learning paradigms are inductive and may inspire future researches. + +# Acknowledgements + +This work is supported by the National Key Research and Development Program of China (2021ZD0111000); the National Natural Science Foundation of China (NO. 62176092, 62102151); Shanghai Science and Technology Commission (No.21511100700), Natural Science Foundation of Shanghai (20ZR1417700), Shanghai Sailing Program (21YF1411200); CAAI-Huawei MindSpore Open Fund (CAAIXSJLJJ-2021-012B, CAAIXSJLJJ-2021-031A). + +# References + +Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016. +Mathilde Caron, Hugo Touvron, Ishan Misra, Hervé Jégou, Julien Mairal, Piotr Bojanowski, and Armand Joulin. Emerging properties in self-supervised vision transformers. arXiv preprint arXiv:2104.14294, 2021. +Hanting Chen, Yunhe Wang, Tianyu Guo, Chang Xu, Yiping Deng, Zhenhua Liu, Siwei Ma, Chunjing Xu, Chao Xu, and Wen Gao. Pre-trained image processing transformer. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 12299-12310, 2021a. +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, 2020a. +Ting Chen, Simon Kornblith, Kevin Swersky, Mohammad Norouzi, and Geoffrey Hinton. Big self-supervised models are strong semi-supervised learners. arXiv preprint arXiv:2006.10029, 2020b. +Xinlei Chen and Kaiming He. Exploring simple siamese representation learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 15750-15758, 2021. +Xinlei Chen, Haoqi Fan, Ross Girshick, and Kaiming He. Improved baselines with momentum contrastive learning. arXiv preprint arXiv:2003.04297, 2020c. +Xinlei Chen, Saining Xie, and Kaiming He. An empirical study of training self-supervised visual transformers. arXiv e-prints, pp. arXiv-2104, 2021b. +Jang Hyun Cho and Bharath Hariharan. On the efficacy of knowledge distillation. In Proceedings of the IEEE/CVF international conference on computer vision, pp. 4794-4802, 2019. +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. +Alaaeldin El-Nouby, Hugo Touvron, Mathilde Caron, Piotr Bojanowski, Matthijs Douze, Armand Joulin, Ivan Laptev, Natalia Neverova, Gabriel Synnaeve, Jakob Verbeek, et al. Xcit: Cross-covariance image transformers. arXiv preprint arXiv:2106.09681, 2021. + +Zhiyuan Fang, Jianfeng Wang, Lijuan Wang, Lei Zhang, Yezhou Yang, and Zicheng Liu. Seed: Self-supervised distillation for visual representation. arXiv preprint arXiv:2101.04731, 2021. +Yuting Gao, Jia-Xin Zhuang, Ke Li, Hao Cheng, Xiaowei Guo, Feiyue Huang, Rongrong Ji, and Xing Sun. Disco: Remedy self-supervised learning on lightweight models with distilled contrastive learning. arXiv preprint arXiv:2104.09124, 2021. +Robert Geirhos, Patricia Rubisch, Claudio Michaelis, Matthias Bethge, Felix A Wichmann, and Wieland Brendel. Imagenet-trained cnns are biased towards texture; increasing shape bias improves accuracy and robustness. arXiv preprint arXiv:1811.12231, 2018. +Ben Graham, Alaaeldin El-Nouby, Hugo Touvron, Pierre Stock, Armand Joulin, Hervé Jégou, and Matthijs Douze. Levit: a vision transformer in convnet's clothing for faster inference. arXiv preprint arXiv:2104.01136, 2021. +Jean-Bastien Grill, Florian Strub, Florent Altché, Corentin Tallec, Pierre H Richemond, Elena Buchatskaya, Carl Doersch, Bernardo Avila Pires, Zhaohan Daniel Guo, Mohammad Gheshlaghi Azar, et al. Bootstrap your own latent: A new approach to self-supervised learning. arXiv preprint arXiv:2006.07733, 2020. +Kai Han, An Xiao, Enhua Wu, Jianyuan Guo, Chunjing Xu, and Yunhe Wang. Transformer in transformer. Advances in Neural Information Processing Systems, 34, 2021. +Kai Han, Yunhe Wang, Hanting Chen, Xinghao Chen, Jianyuan Guo, Zhenhua Liu, Yehui Tang, An Xiao, Chunjing Xu, Yixing Xu, et al. A survey on vision transformer. IEEE transactions on pattern analysis and machine intelligence, 2022. +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. +Dan Hendrycks and Thomas Dietterich. Benchmarking neural network robustness to common corruptions and perturbations. arXiv preprint arXiv:1903.12261, 2019. +Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015. +Simon Kornblith, Mohammad Norouzi, Honglak Lee, and Geoffrey Hinton. Similarity of neural network representations revisited. In International Conference on Machine Learning, pp. 3519-3529. PMLR, 2019. + +Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009. +Muzammal Naseer, Kanchana Ranasinghe, Salman Khan, Munawar Hayat, Fahad Shahbaz Khan, and Ming-Hsuan Yang. Intriguing properties of vision transformers. arXiv preprint arXiv:2105.10497, 2021. +Wonpyo Park, Dongju Kim, Yan Lu, and Minsu Cho. Relational knowledge distillation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 3967-3976, 2019. +Ilija Radosavovic, Raj Prateek Kosaraju, Ross Girshick, Kaiming He, and Piotr Dólár. Designing network design spaces. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 10428-10436, 2020. +Sucheng Ren, Zhengqi Gao, Tianyu Hua, Zihui Xue, Yonglong Tian, Shengfeng He, and Hang Zhao. Co-advise: Cross inductive bias distillation. arXiv preprint arXiv:2106.12378, 2021. +Adriana Romero, Nicolas Ballas, Samira Ebrahimi Kahou, Antoine Chassang, Carlo Gatta, and Yoshua Bengio. Fitnets: Hints for thin deep nets. arXiv preprint arXiv:1412.6550, 2014. +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. +Yonglong Tian, Dilip Krishnan, and Phillip Isola. Contrastive representation distillation. arXiv preprint arXiv:1910.10699, 2019. +Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre Sablayrolles, and Hervé Jégou. Training data-efficient image transformers & distillation through attention. In International Conference on Machine Learning, pp. 10347-10357. PMLR, 2021. +Shikhar Tuli, Ishita Dasgupta, Erin Grant, and Thomas L Griffiths. Are convolutional neural networks or transformers more like human vision? arXiv preprint arXiv:2105.07197, 2021. +Guodong Xu, Ziwei Liu, Xiaoxiao Li, and Chen Change Loy. Knowledge distillation meets self-supervision. In European Conference on Computer Vision, pp. 588-604. Springer, 2020. +Sergey Zagoruyko and Nikos Komodakis. Paying more attention to attention: Improving the performance of convolutional neural networks via attention transfer. arXiv preprint arXiv:1612.03928, 2016. + +# A. Visualizations of the most important head. + +For the proposed head selection strategy, we provide the visualizations of the most important heads of the last 3 layers of SL teacher and SSL teacher (SSTA) in Figure 8. We can see that the background is more important for SL teacher, while the information of object is more critical for the SSL teacher (SSTA). Actually, background and object both are important for human vision, thus our head-level knowledge distillation method precisely adopt the most critical information via head selection strategy. + +![](images/dfb891ed7aa877c33ba81dd47f8c890b365680a21fb0cc146c6323252964666d.jpg) + +![](images/f851dfc9e72c057c1ba90658edc23dc30b4aae07fde3ba20b6a6fe085710eac6.jpg) +Figure 8. The first column is the input image, the next 6 columns are the self-attention visualization of the 6 heads of SL teacher, and the last 6 columns belong to SSL teacher (SSTA). The first row to the third row correspond to the 10th, 11th, and 12th layers respectively. The heads with boxes are the most important heads of corresponding teachers over three layers. + +# B. Visualizations of distilled heads on student + +Figure 9 shows the visualizations of the student (DeiT-Ti) after mimicking SL teacher and SSTA. Since the baseline model can not pay attention to the object ('tin opener') precisely and disturbed by redundant information, the object is identified as a pencil sharpener. On the contrary, our SSL Teacher (SSTA) perfectly focus on the object and the heads that selected by the proposed head selection strategy provide the critical information to the student. After distilling, DeiT-Ti can also precisely focus on the object and classify it correctly. + +![](images/fee79ae9f2bddda52c4e81a445b80a8b20a3b17f7da501e798abd3359ba5b5be.jpg) +Figure 9. Visualizations of self-attention from the last 3 layers of two teachers, our student and baseline. The red boxes and purple boxes on teachers denote the most important head of SSL teacher (SSTA) and SL teacher. Meanwhile, the red boxes and purple boxes on student denote the heads distilled by the SSL teacher (SSTA) and SL teacher correspondingly. \ No newline at end of file diff --git a/selfsupervisedmodelsaregoodteachingassistantsforvisiontransformers/images.zip b/selfsupervisedmodelsaregoodteachingassistantsforvisiontransformers/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..40b1df7225503982a779e3479eccd53ddfcc6455 --- /dev/null +++ b/selfsupervisedmodelsaregoodteachingassistantsforvisiontransformers/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:44993ad5d4fc862ea12ac4e068d4f78d7db9232382714be4748d51c7b1130ff6 +size 681964 diff --git a/selfsupervisedmodelsaregoodteachingassistantsforvisiontransformers/layout.json b/selfsupervisedmodelsaregoodteachingassistantsforvisiontransformers/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..ca655c8389bf0e4b7decf52d85ab9e469757e646 --- /dev/null +++ b/selfsupervisedmodelsaregoodteachingassistantsforvisiontransformers/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:300b5ab972d9c226244c2135a12718b0e89c5a7c747cab3ad6917a76310dfb5f +size 359877 diff --git a/selfsupervisedmodelsofaudioeffectivelyexplainhumancorticalresponsestospeech/69bc8e8d-4ba5-4e95-bd73-537bd01027d4_content_list.json b/selfsupervisedmodelsofaudioeffectivelyexplainhumancorticalresponsestospeech/69bc8e8d-4ba5-4e95-bd73-537bd01027d4_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..84483983ad5ceffdfb1dcd8b14392dde5ef2506c --- /dev/null +++ b/selfsupervisedmodelsofaudioeffectivelyexplainhumancorticalresponsestospeech/69bc8e8d-4ba5-4e95-bd73-537bd01027d4_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d2db5f6a43f5709f9f84a0264623a671d9a20261e72aab1739d5b1d148ed0e01 +size 97306 diff --git a/selfsupervisedmodelsofaudioeffectivelyexplainhumancorticalresponsestospeech/69bc8e8d-4ba5-4e95-bd73-537bd01027d4_model.json b/selfsupervisedmodelsofaudioeffectivelyexplainhumancorticalresponsestospeech/69bc8e8d-4ba5-4e95-bd73-537bd01027d4_model.json new file mode 100644 index 0000000000000000000000000000000000000000..74eab97045505560f8d7eafcb6fe98453d514d70 --- /dev/null +++ b/selfsupervisedmodelsofaudioeffectivelyexplainhumancorticalresponsestospeech/69bc8e8d-4ba5-4e95-bd73-537bd01027d4_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ab026256ae7a5149f1ba9e3955313d65b4931aa644507e8647e0697b5ad45793 +size 113767 diff --git a/selfsupervisedmodelsofaudioeffectivelyexplainhumancorticalresponsestospeech/69bc8e8d-4ba5-4e95-bd73-537bd01027d4_origin.pdf b/selfsupervisedmodelsofaudioeffectivelyexplainhumancorticalresponsestospeech/69bc8e8d-4ba5-4e95-bd73-537bd01027d4_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..7374cc2eea5e55ef5e1ea69878eda9ada406bbbf --- /dev/null +++ b/selfsupervisedmodelsofaudioeffectivelyexplainhumancorticalresponsestospeech/69bc8e8d-4ba5-4e95-bd73-537bd01027d4_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3cbd4481577dfdbe1616e1d309046100ccb0c4ea59bd280d1900ef90845c4aaa +size 9632137 diff --git a/selfsupervisedmodelsofaudioeffectivelyexplainhumancorticalresponsestospeech/full.md b/selfsupervisedmodelsofaudioeffectivelyexplainhumancorticalresponsestospeech/full.md new file mode 100644 index 0000000000000000000000000000000000000000..ee34c6c78452e69b11952cca6632c42b1a19d673 --- /dev/null +++ b/selfsupervisedmodelsofaudioeffectivelyexplainhumancorticalresponsestospeech/full.md @@ -0,0 +1,376 @@ +# Self-Supervised Models of Audio Effectively Explain Human Cortical Responses to Speech + +Aditya R. Vaidya1 Shailee Jain1 Alexander G. Huth1,2 + +# Abstract + +Self-supervised language models are very effective at predicting high-level cortical responses during language comprehension. However, the best current models of lower-level auditory processing in the human brain rely on either hand-constructed acoustic filters or representations from supervised audio neural networks. In this work, we capitalize on the progress of self-supervised speech representation learning (SSL) to create new state-of-the-art models of the human auditory system. Compared against acoustic baselines, phonemic features, and supervised models, representations from the middle layers of self-supervised models (APC, wav2vec, wav2vec 2.0, and HuBERT) consistently yield the best prediction performance for fMRI recordings within the auditory cortex (AC). Brain areas involved in low-level auditory processing exhibit a preference for earlier SSL model layers, whereas higher-level semantic areas prefer later layers. We show that these trends are due to the models' ability to encode information at multiple linguistic levels (acoustic, phonetic, and lexical) along their representation depth. Overall, these results show that self-supervised models effectively capture the hierarchy of information relevant to different stages of speech processing in human cortex. + +# 1. Introduction + +Self-supervised learning (SSL) has emerged as a popular and successful pre-training objective. In natural language processing, self-supervised language models (LM) encode diverse linguistic information and achieve excellent zero- + +$^{1}$ Department of Computer Science, $^{2}$ Department of Neuroscience, The University of Texas at Austin. Correspondence to: Aditya Vaidya . + +Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s). + +shot performance on many language tasks (Peters et al., 2018; Radford et al., 2018; Devlin et al., 2019). Capitalizing on these findings, neuroimaging studies have shown that representations extracted from LMs are highly effective at predicting brain activity elicited by natural language (Wehbe et al., 2014; Jain & Huth, 2018; Toneva & Wehbe, 2019; Schrimpf et al., 2021; Caucheteux et al., 2021; Goldstein et al., 2020) and can help reveal how linguistic representations are organized across human cortex (Jain et al., 2020; Antonello et al., 2021). Even outside the domain of language, self-supervised models have proven fruitful in modeling the mammalian visual system (Zhuang et al., 2021). + +In automatic speech recognition there has been a similar trend towards SSL-based approaches. Using autoregressive, contrastive, and masked prediction losses, SSL models learn powerful acoustic representations that are highly transferable across applications (Hsu et al., 2021; Schneider et al., 2019; Baevski et al., 2020). Much like language models, SSL models of speech have also been shown to capture higher-order linguistic structure without explicit supervision (Pasad et al., 2021; Yang et al., 2021). This can be attributed to their ability to integrate information over a broader context than traditional acoustic filters. However, SSL models have not yet been combined with neuroimaging to study auditory processing in the human brain, where the best models are currently hand-constructed features (Norman-Haignere & McDermott, 2018; Venezia et al., 2019; Chi et al., 2005; Mesgarani et al., 2014) or supervised neural networks (Millet & King, 2021). In this paper, we investigate the potential of SSL speech representations for predicting human cortical responses to natural speech. + +One approach to studying sensory representations in the brain is through "encoding models" (Wu et al., 2006). These predictive models of brain activity learn a mapping from stimulus features to responses measured using a neuroimaging technique like fMRI. In this work, we use SSL models to extract acoustic features of natural speech and in turn, build voxel-wise speech encoding models using data from an fMRI experiment (Figure 1). Our experiment comprised human participants passively listening to English-language narrative stories while their whole-brain fMRI BOLD activ + +![](images/a23a98ea15479a14c740fc82f12cd853bf772f4f8feae280ae87983990e80b20.jpg) +Figure 1. Voxel-wise encoding models from SSL models of speech. 64 second spans of narrative stimuli (represented as waveforms or spectrograms) are fed into an SSL model trained to learn the statistics of speech. Hidden states from a layer in the neural network are extracted to form representation $g(S)$ after downsampling to the rate of fMRI acquisition. $g(S)$ is then used to fit encoding models that predict fMRI BOLD responses to natural speech. Encoding model weights $\beta \in \mathbb{R}^{P \times V}$ are estimated with ridge regression. Models are then used to predict $\hat{R}$ , the BOLD response to an unseen stimulus, and are evaluated by the correlation between $R$ and $\hat{R}$ . + +ity was being recorded. Prior work on LM-based language encoding models has found performance differences across LM layers (Jain & Huth, 2018; Toneva & Wehbe, 2019), and layer-wise analyses of SSL models have shown that they capture different types of acoustic information (Pasad et al., 2021). Motivated by these findings, we built separate encoding models for each layer in four SSL models — APC, wav2vec, wav2vec 2.0 and HuBERT (Table 1). Their performance was compared to low-level acoustic baselines like Mel spectrograms and spectrotemporal features, mid-level phoneme articulations, and high-level semantic features. + +Overall, we found that SSL models are highly effective at predicting cortical responses to natural speech, beating supervised and hand-engineered acoustic representations. Despite being trained on audiobooks, the SSL representations transferred well to encoding models of natural speech. We further show that encoding performance greatly varied across SSL model layers and brain areas. While the upper-middle layers of some models had the best performance broadly across cortex, lower layers were comparable only in low-level primary auditory cortex. To better understand why these models worked so well, we did variance partitioning across pairs of feature spaces. This revealed that the best SSL layers capture spectral, phonemic, and semantic information. Finally, we directly assessed linguistic representations in each SSL layer using linear probes. This showed that the evolution of representations across SSL layers mirrors the presumed stages of speech processing. Together with the encoding model results, this shows that SSL models capture diverse acoustic information across their representational depth which enables them to effectively model different stages of speech processing in cortex. + +# 2. Natural Language fMRI Experiment + +To build SSL encoding models, we used data from an fMRI experiment comprising 7 participants (3 female) listening to over five hours of spoken narrative stories (27 stories; + +$\sim 57,900$ total words) from The Moth Radio Hour. These rich, diverse naturalistic stimuli are highly representative of speech humans encounter on a daily basis. To find the exact timing of each word and phoneme, the stories were transcribed and a forced aligner was used to align each transcript to its audio. All subjects were healthy with normal hearing, had fluent English language comprehension, and gave written informed consent. Whole-brain MRI data was collected every 2 seconds (TR). The experimental procedure was approved by the local Institutional Review Board. More MRI acquisition details can be found in Appendix D. + +# 3. Voxel-wise Encoding Models + +Encoding models aim to approximate $f(S) = R$ , the mapping between a stimulus $S$ and the elicited BOLD response $R$ measured in some brain area (Figure 1). Here, the stimulus $S$ can take any form, like images, audio waveforms, or words. To make model fitting tractable with limited fMRI data, we restricted encoding models to the linearized form $f(S) = g(S)\beta$ , where $g$ is a pre-specified non-linear transformation on the stimulus and $\beta$ is a vector of learned linear weights (Wu et al., 2006). If $g$ transforms $S$ into a $P$ -dimensional feature space and $V$ is the number of cortical voxels (regression targets), then $\beta$ is a $P \times V$ linear transformation between the feature space and each voxel's predicted response. We estimated a separate encoding model $\hat{f}_v$ for each voxel $v$ on the training dataset $(S_{\mathrm{train}}, R_{\mathrm{train}})$ using ridge regression. To select the ridge parameter independently for each voxel, we used 50 iterations of cross-validation. Since fMRI data is auto-correlated, for each cross-validation run we randomly sampled 40 different chunks of the training data, each totaling over 4 minutes. The training set comprised 26 stories, totaling 5.4 hours. + +For evaluation, we used the learned encoding models to predict the response timecourse of each voxel $v$ on a held-out test set, $\hat{R}_{\mathrm{test},v} = \hat{f}_v(S_{\mathrm{test}})$ . We then calculated the linear correlation between true and predicted responses to + +Table 1. Model architectures and training objectives. For each model, its input representation is fed into an encoder module to produce latent speech representations. A second module then produces contextualized representations that capture information across the input. Both modules are trained end-to-end to fulfill their supervised or self-supervised objective. + +
ModelInputEncoderContextualizerLoss type
APC (Chung et al., 2019; Chung & Glass, 2020)log Mel spectrogramN/A3-layer GRUAutoregressive
wav2vec (Schneider et al., 2019)Waveform7-layer CNN12-layer CNNContrastive
wav2vec 2.0 BASE (Baevski et al., 2020)Waveform7-layer CNN12-layer TransformerMasked contrastive
HuBERT BASE (Hsu et al., 2021)Waveform7-layer CNN12-layer TransformerMasked predictive
Deep Speech 2 (Amodei et al., 2016)log spectrogram2-layer CNN5-layer LSTMCTC (supervised)
+ +determine encoding performance $\rho_v = \mathrm{corr}(R_{\mathrm{test},v},\hat{R}_{\mathrm{test},v})$ The test set comprised 1 held-out story (10 minutes) that did not participate in model estimation. + +Using the encoding model framework, we can compare how well different feature spaces model speech processing in the brain. Consider a feature space $g_{i}$ on which we estimate and test encoding models, yielding prediction performance $\rho_v^i$ for a voxel $v$ . If $\rho_v^1 > \rho_v^2$ for some feature spaces $g_{1}$ and $g_{2}$ , we can conclude that $g_{1}$ is a closer match to the information encoded by voxel $v$ while processing speech. By examining the type of information encoded in $g_{1}$ , we can consequently estimate voxel function. Here we use this approach to compare representations extracted from SSL speech models with several well-known baselines and supervised alternatives. + +# 3.1. Extracting Speech Features from SSL Models + +We extracted hidden state representations from each layer of four self-supervised models: APC (Chung et al., 2019; Chung & Glass, 2020), wav2vec (Schneider et al., 2019), wav2vec 2.0 (Baevski et al., 2020), and HuBERT (Hsu et al., 2021). These models are pre-trained on 960 hours of speech from LibriSpeech (Panayotov et al., 2015), a corpus of English audiobooks from the LibriVox project. The SSL models are not finetuned on any annotated samples. See Table 1 for an overview of model architectures and training methods. In the main analyses, we evaluate the output of CNN encoders and all layers of the contextualizer. + +The self-supervised speech models effectively capture statistical regularities in speech, either by learning to predict the content of future or unknown time blocks (autoregressive & masked prediction objectives), or by learning features that are effective at discriminating future samples from other samples (contrastive objective). While APC operates on Mel spectrograms of the input, the other three models operate directly on the waveform. + +# 3.2. Supervised Speech Model Baseline + +To compare SSL-based encoding models with related work (Millet & King, 2021), we additionally extracted representations from Deep Speech 2 (Amodei et al., 2016). This automatic speech recognition model was trained with full supervision on the same amount of data as the self-supervised models (960 hours of LibriSpeech). + +# 3.3. Baselines + +We also compared encoding models trained with SSL representations against those trained with traditional acoustic and hand-labeled features. + +We first used spectrotemporal modulations, which are a standard model of primary auditory cortex responses to sound (Norman-Haignere & McDermott, 2018; Chi et al., 1999; 2005; Venezia et al., 2019). These features are computed by convolving spectrograms with filters that are selective to different rates of spectral and/or temporal modulation. We also computed spectral features ("FBANK") by applying Mel-scale triangular filters to the power spectrum. While FBANK captures frequencies, spectrotemporally-modulated spectrograms may additionally capture changing tones or harmonics across time. + +Since parts of auditory cortex are known to selectively respond to phonemes (Mesgarani et al., 2014), we also used phoneme articulations as a mid-level speech feature. These were derived by mapping hand-labeled phonemes onto 14 articulatory features. + +For word-level features, we used a 985-dimensional word embedding to capture lexical and semantic information (Huth et al., 2016). Finally, we extracted deep contextual features from the 9th layer of GPT (Radford et al., 2018), since similar LMs are the most effective representations for modeling the brain's response to language (Toneva & Wehbe, 2019; Caucheteux et al., 2021). + +Since some of the artificial neural networks discussed here are bi-directional, we enforced causality by extracting representations at the end of a sliding window of size 64 s with + +![](images/4e69384b38fded34bd8c777c59174492a5b0969b10763a9696c4dc60e7eac20c.jpg) +(A) WHOLE CORTEX + +![](images/d463c74e6fc120015fbc27bf0e56672736a9c5a736191e2b88d1dada2af6168d.jpg) +(B) AUDITORY CORTEX +Figure 2. Encoding performance for each feature space, averaged across voxels and then subjects $(N = 7)$ . Error bars show standard error of the mean (SEM) across subjects after correcting for per-subject overall performance (i.e., subtracting the mean performance across all models from each subject's values). Each column compares one SSL model against baseline representations. (A) Encoding performance is averaged across all voxels in the cortex. HuBERT layer 9 achieves the highest performance, outperforming both auditory baselines. (B) To focus on encoding performance for lower-level features, we averaged only within auditory cortex (broadly defined). All SSL models and Deep Speech 2 outperform the hand-engineered baselines, with HuBERT still outperforming all other models. More speech ROIs can be seen in Appendix A.1. The encoding model built on FBANK features had the worst performance and is not visualized here. + +a stride of $10\mathrm{ms}$ . Before their use in encoding models, all features were down-sampled to the rate of fMRI acquisition $(0.5\mathrm{Hz})$ with Lanczos resampling. The haemodynamic response function for each encoding model was estimated using a finite impulse response model with 4 delays. + +# 4. Experiments + +# 4.1. Encoding Performance Comparisons + +Earlier studies have found that encoding model performance can vary widely across layers of LMs (Jain & Huth, 2018; Toneva & Wehbe, 2019) and supervised speech models (Millet & King, 2021; Kell et al., 2018). To test whether the same is true for SSL speech models, we measured prediction performance for encoding models built using each layer of each network shown in Table 1. For comparison, we also tested encoding models using each layer of the supervised speech baseline and hand-constructed feature baselines. + +Figure 2A shows the average voxel prediction performance across the whole cortex for each encoding model. Across layers, this analysis reveals a consistent trend — upper-middle layers of every model have the best encoding performance, with lower performance for the shallowest and deepest layers. This trend is most evident in wav2vec 2.0, HuBERT, and Deep Speech 2, and is consistent with previous literature in higher-level language encoding models that also found best performance in the upper-middle layers (Jain & Huth, 2018; Toneva & Wehbe, 2019; Caucheteux et al., 2021; Goldstein et al., 2020). + +Across models, we see that the best layer from each SSL and Deep Speech 2 layer outperform the auditory baselines (articulation and spectrotemporal modulation). Despite being trained on the same amount of data, the best layers of SSL models wav2vec 2.0 and HuBERT outperform the fully supervised Deep Speech 2 model that was used in prior work investigating speech processing across cortex + +![](images/f8fb439a953c59c9fe1d33aff61df6f77cd70f72dccda4a1634c281faf9f4919.jpg) +Figure 3. Cortical map of HuBERT layer selectivity. For each individual subject, PCA was applied to an $n_{\mathrm{voxels}} \times n_{\mathrm{layers}}$ matrix $C$ containing the subject's per-voxel encoding performance for each layer in HuBERT. (A) Voxel scores for the first principal component (PC 1) across well-predicted voxels (mean $(\rho_v) > 0.15$ ) for a single subject. The cortical surface is first inflated (medial and lateral views), and then cut and flattened (flatmap, center). (B) Loadings of PC 1 (averaged across subjects) indicate that the primary dimension of variance is between lower layers and upper-middle layers. Voxels with low scores (white) prefer earlier layers, while those with high scores (blue) prefer later layers. For all loadings, the SEM across subjects was less than 0.02. Insets show the layer-wise encoding performance for a voxel that prefers earlier layers (left) and a voxel that prefers later layers (right). (C) Proportion of variance explained by each PC (averaged across subjects). We focus our analysis on the first PC because it explains much more variance than any other. SEM across subjects was less than $2\%$ for PC 1, and less than $1\%$ for all other PCs. Appendix B shows cortical selectivity maps for additional subjects. + +(Millet & King, 2021). Further, the best layer of HuBERT approaches the performance of the word embedding model, despite not receiving any explicit supervision on lexical or semantic information. Nonetheless, there is a substantial gap between even the best SSL audio models and GPT, indicating that the audio models do not make word-level models obsolete. + +Figure 2B shows average voxel prediction performance only for voxels within auditory cortex (AC), which is thought to be responsible for extracting higher-level features such as words from incoming acoustic information (Hickok & Poeppel, 2007). Here, most SSL layers and supervised Deep Speech 2 layers outperform all of the hand-constructed feature spaces, including word embeddings. The best encoding model overall is the same, however: layer 9 of HuBERT. + +These results could indicate that the best SSL layers are able to capture some of the same semantic information that is in word embeddings, or that the SSL models are simply better acoustic representations than the other models, or a combination of both. Our next analyses are aimed at disentangling what types of information are captured by the different SSL layers. + +# 4.2. Voxel-wise Layer Selectivity + +One way to disentangle what is represented in the SSL layers is to compare which brain areas are predicted by each layer. Earlier results provide relatively strong priors about the function of each brain area; for example, primary auditory cortex (A1) on Heschl's gyrus represents the acoustic + +properties of incoming sound (Hickok & Poeppel, 2007), while angular gyrus (AG) and precuneus (PrCu) are part of the brain's 'semantic system' (Binder et al., 2009). If a layer is highly predictive of A1 we may infer it contains acoustic information, and if a layer is highly predictive of AG or PrCu we may infer it contains semantic information. + +Rather than examining brain maps for each layer separately, we found the major patterns of variation in prediction performance across model layers using principal components analysis (PCA). For an SSL model, we first construct a data matrix matrix $C$ with dimensions $V \times L$ , where $V$ is the number of voxels for a subject and $L$ is the number of layers in the model. $C_{vl}$ is then the encoding performance of layer $l$ in the SSL model for voxel $v$ . To account for overall performance differences between layers and voxels, we centered each row and column to have zero mean. Finally, we applied principal components analysis (PCA) to $C$ . + +For simplicity, here we focus on the overall best-performing SSL model, HuBERT $(L = 13)$ . The first principal component (PC) explained $54\%$ of the variance in $C$ , while each subsequent PC explained less than $10\%$ of the variance (Figure 3C). Inspecting the first PC loadings shows that it separates voxels with high performance in the upper-middle layers from voxels with high performance in the lower layers (Figure 3B). We visualized layer selectivity across the cortical surface of one subject by projecting $C$ onto its first PC (Figure 3A). + +Overall, layer selectivity roughly follows the hierarchy of speech processing across cortex (Hickok & Poeppel, 2007; Binder et al., 2009). While low-level regions like primary auditory cortex (A1) preferred lower HuBERT layers (negative PC 1 score), high-level regions like the angular gyrus (AG) and precuneus (PrCu) preferred the upper-middle layers (positive PC 1 score). We also compared the first PC scores to voxel encoding performance for low-level acoustic features and word embeddings. As expected from the cortical organization of PC 1 scores, low-level encoding performance was negatively correlated with PC 1 scores $(\rho = -0.330)$ , while word embedding encoding performance was positively correlated $(\rho = 0.449)$ (Appendix B). This suggests that the type of information varies along the depth of SSL models, with the most semantic information appearing at the upper-middle layers and most acoustic information appearing at the lowest layers. + +# 4.3. Partitioning Explained Variance between SSL Models and Hand-Engineered Baselines + +Another way to disentangle SSL representations is to measure the overlap in brain variance explained by SSL model layers and the hand-constructed feature spaces. To accomplish this we used variance partitioning, which separates the brain response variance that can be explained by two + +models into their unique and overlapping contributions (de Heer et al., 2017; LeBel et al., 2021). + +For two feature spaces, this is done by fitting separate encoding models for each space as well as a joint encoding model, obtained by concatenating the features. Consider the resultant encoding performances to be $\rho_v^1$ for feature space 1, $\rho_v^2$ for feature space 2 and $\rho_v^{1\cup 2}$ for the joint model. The amount of variance in the BOLD responses explained by any encoding model can be approximated as the signed squared correlation coefficient $(\rho)^{2}\cdot \mathrm{sgn}(\rho)$ , which we will denote $(\rho)^{2}$ for simplicity. Using set arithmetic, we can then derive the size of the intersection $(\rho^2)_v^{1\cap 2} = (\rho^2)_v^1 +(\rho^2)_v^2 -(\rho^2)_v^{1\cup 2}$ and $\rho_v^{1\cap 2} = \sqrt{(\rho^2)_v^{1\cap 2}}$ . This measures the amount of BOLD response in voxel $v$ that can be equally well explained by either of the two feature spaces. Similarly, the unique contribution of feature space 1 can be computed as $(\rho^2)_v^{1\backslash 2} = (\rho^2)_v^1 -(\rho^2)_v^{1\cap 2}$ with $\rho_v^{1\backslash 2} = \sqrt{(\rho^2)_v^{1\backslash 2}}$ and that of feature space 2 as $(\rho^2)_v^{2\backslash 1} = (\rho^2)_v^2 -(\rho^2)_v^{1\cap 2}$ with $\rho_v^{2\backslash 1} = \sqrt{(\rho^2)_v^{2\backslash 1}}$ . These values indicate variance uniquely explained by one feature space that is absent from the other. + +Variance partitioning quickly becomes intractable as the number of feature spaces increases. Thus we restrict our analyses to pairwise comparisons that involve an upper-middle layer in HuBERT (layer 9) or a lower layer (layer 1). We compared each of these to the hand-constructed spectrotemporal, articulation, and word embedding feature spaces, totaling $2 \times 3 = 6$ comparisons. For robustness, we used banded ridge regression, which allows different regularization parameters for each feature space in the joint encoding model (Nunez-Elizalde et al., 2019). By examining the amount of unique and shared variance between each baseline and HuBERT layer, we can quantify the amount of brain-relevant acoustic, phonetic, or lexical information in each of the HuBERT layers. + +Figure 4 shows the partial correlations $\rho_v^{1\cap 2},\rho_v^{1\backslash 2}$ and $\rho_v^{2\backslash 1}$ for each feature space pair. Brain images (above) show the largest component of the three for each voxel across the cortical surface of one participant, and bar plots (below) show the average across voxels and subjects. + +We first compared the two HuBERT layers against the lowest-level baseline model, spectrotemporal modulations (Figure 4, column 1). For both layers, there is a relatively large amount of shared variance and very little variance that is uniquely explained by the acoustic baseline. Layer 1 also uniquely explains very little variance, suggesting that it contains very similar information to the spectrotemporal feature space. Layer 9, however, uniquely explains a great deal of variance over the spectrotemporal features. + +Next, we compared the HuBERT layers against phoneme articulation features (Figure 4, column 2). Phonemes con + +![](images/a052a0bfe1e34d820ad218fae3d6e464ba35310a4e9c1511910afaa18b1dcb5c.jpg) + +![](images/e867bed3223baaec783a37de3146bdfaee9f725f6dc894d5a0b8634117ee5972.jpg) + +![](images/c37a0919f810612a05510a81e6b0c66389331037eca1d107dd248a9a56a6cc4e.jpg) + +![](images/df463193b6fcf872bcb50a075064f9f4f2960676dbabd28bdebc8f0b3254c6a8.jpg) +Figure 4. Partitioning variance explained by baselines and HuBERT layers 1 and 9. For each pair of features 1 and 2, bar plots (below) show $\rho_v^{1\backslash 2}$ (red), $\rho_v^{1\cap 2}$ (blue) and $\rho_v^{2\backslash 1}$ (green) averaged across cortex and subjects. Error bars indicate SEM across subjects. Cortical maps (above) show the largest partition per voxel for one subject. Voxels are only shown if $\rho_v^{1\cup 2} > 0.15$ . Baselines are ordered by increasing level of abstraction. Every baseline has unique variance when partitioned against layer 1, whereas spectrotemporal (left) and articulatory (middle) features explain no unique variance when partitioned against layer 9. Word embeddings (right) share more variance explained with layer 9 than with layer 1. + +![](images/977511ae10f3a28568797c79347f85878aaf8dc23eb21a647d64854378289868.jpg) + +![](images/9d784307c5a1e5b207fa9d1ac31ae93046bf716d905323fb241867d7da9ffe17.jpg) + +stitute more abstract information than acoustic filters and are generally more predictive of cortical activity (Figure 2). Here there is a larger difference between the two HuBERT layers. Layer 1 uniquely explains early auditory cortex, while articulations uniquely explain more lateral and posterior temporal cortex. In contrast, layer 9 appears to be a strict superset of the articulations: there is substantial shared variance, but little or no variance is uniquely explained by the articulatory model. This layer not only captures articulatory features but also contains additional information that is not captured by those features but is relevant to the brain. + +Finally, we compared the two HuBERT layers against word embeddings (Figure 4, column 3), which are more abstract than articulatory features. Here, layer 9 has substantially more unique and shared variance with word embeddings than layer 1, suggesting that the it contains more semantic information than the lower layer. Across cortex, the word embedding model uniquely explains more variance in high-level regions while layer 1 better explains AC. For layer 9, + +the pattern is similar but less pronounced, as most variance is shared between the two models. + +Overall, these results show that the variance captured by HuBERT layer 9 entirely encompasses the low-level spectrotemporal and mid-level articulatory features, and overlaps to a great extent with the high-level word embedding features. In contrast, HuBERT layer 1 is very similar to the spectrotemporal features but fails to capture some articulatory and most semantic information. + +# 4.4. Probing SSL Models for Linguistic Structure + +The previous analyses explained much of why the SSL features are so capable at predicting brain data: the single best layer encompasses spectrotemporal, articulatory, and some semantic information. To get a finer-grained understanding of how linguistic representations evolve across these models, we turned away from the fMRI data and instead compared each layer directly to known linguistic features. Inspired + +![](images/ea26880f4158c13f43f2e097582388f67b10415b14eeabb999cf19e52deee058.jpg) +FBANK + +![](images/7d170beaeee8808fd9ccd60617c2b75da0da772cf0326422d1b5ec34848a707c.jpg) +Spectrotemporal +Phoneme +Word + +![](images/32c99cc72f2fb681a66af045a66b9890853656c7f2f80990f56615a409788132.jpg) +Figure 5. Probing the information represented across layers in SSL models. Each panel shows normalized performance of different layers in an SSL model predicting FBANK features, spectrotemporal features, phoneme identity, and word identity. Upper-middle layers in wav2vec, wav2vec 2.0 and HuBERT best encode phoneme- and word-level information, while the lower layers are better at predicting the acoustic features. This suggests that SSL models recapitulate the putative stages of speech processing. + +![](images/d6191c4c4835ede6c9d9bcf3efa3d8dc31f298a8c3d503fc1e4376880bf72bc5.jpg) + +by prior work in computer vision (Alain & Bengio, 2017), natural language processing (Ettinger et al., 2016; Shi et al., 2016) and speech (Pasad et al., 2021; Yang et al., 2021), we did this by linearly probing each layer's representations for spectral features (FBANK), spectrotemporal features, phoneme identity, and word identity. + +To build linear probes, we first obtained parallel SSL model and baseline features using the 27 fMRI stimulus stories. For baseline features with a lower sampling rate (spectrotemporal, phonemes, words), SSL layer representations were mean-pooled across time. To predict FBANK and spectrotemporal features, we used ridge regression to map each SSL model layer to each feature. Probing performance was measured by the correlation between the predicted and true feature value across the test set, averaged across all features in each space. For phoneme and word identity we trained linear classifiers and measured performance with classification accuracy and perplexity, respectively. We used 100-D GloVe embeddings (Pennington et al., 2014) and the associated vocabulary for the word-level tasks. To ensure that these results were not biased by the limited capabilities of linear probes, we repeated some analyses using linear MLPs with a single bottleneck layer, and found no difference (Appendix C). Each linear probe was trained and evaluated on 3 different seeds. For each run, we randomly divided the 27 stories into an 80-10-10 train-validation-test split. + +Figure 5 shows the normalized probing performance of dif + +ferent tasks as a function of SSL model depth. These results suggest that the SSL layers recapitulate the putative stages of speech processing (Hickok & Poeppel, 2007; Lieberman, 1970; Pisoni & Sawusch, 1975). For most models the simplest features (FBANK) are best captured by the lowest layers, slightly more complex features (spectrotemporal) by the lower-middle layers, and high-level features (words) by the upper-middle layers. Yet phonemes, which are generally thought to fall between spectrotemporal and word-level features in speech analysis (Hickok & Poeppel, 2007), are best captured by the uppermost layers in wav2vec 2.0 and HuBERT. This may reflect how phoneme perception is influenced by word context (Elman & McClelland, 1988) rather than being purely based on acoustics. This effect appears to mirror human behavior despite the fact that these models have no explicit representation of words or phonemes. + +# 5. Conclusion + +We developed computational models of speech processing in the human cortex using representations from four different self-supervised learning (SSL) models – APC, wav2vec, wav2vec 2.0 and HuBERT. Voxel-wise encoding models using SSL-derived features were better models of cortical activity than either phonemes or traditional acoustic features like spectrotemporal modulations and spectrograms. The best layers of wav2vec 2.0 and HuBERT also outperformed features from supervised speech models used in prior work + +and approached the performance of word embedding models that capture semantic information. + +To better understand what information is captured by these models, we first analyzed which model layers best predicted different areas of cortex. This showed that lower layers effectively modeled areas involved in low-level acoustic processing, while the upper layers were better predictors of areas capturing phonetic and semantic information. Second, we measured the degree to which SSL layers and hand-engineered feature spaces predicted the same or different variance in brain responses. This suggested that the best SSL layer achieved its encoding performance by capturing features across several scales, including spectrotemporal, phonemic, and some semantic information. Finally, we directly probed the SSL layers for acoustic and linguistic features, demonstrating that SSL models seem to recapitulate the speech processing hierarchy surprisingly well. + +Overall, our results suggest that deeper SSL model layers capture increasingly high-level features while maintaining low-level information. Coupled with our finding that SSL models are currently the best sound-based models of cortical speech processing, this suggests that further development and analysis of SSL models may reveal much about how speech is processed by the human brain. + +# Acknowledgments + +We would like to thank David Harwath, as well as the anonymous reviewers, for their insights and suggestions. Funding for this work was provided by the Burroughs-Wellcome Fund Career Award at the Scientific Interface (CASI), the Whitehall Foundation, and the Alfred P. Sloan Foundation. + +# References + +Alain, G. and Bengio, Y. Understanding intermediate layers using linear classifier probes. February 2017. + +Amodei, D., Ananthanarayanan, S., Anubhai, R., Bai, J., Battenberg, E., Case, C., Casper, J., Catanzaro, B., Cheng, Q., Chen, G., Chen, J., Chen, J., Chen, Z., Chrzanowski, M., Coates, A., Diamos, G., Ding, K., Du, N., Elsen, E., Engel, J., Fang, W., Fan, L., Fougner, C., Gao, L., Gong, C., Hannun, A., Han, T., Johannes, L. V., Jiang, B., Ju, C., Jun, B., LeGresley, P., Lin, L., Liu, J., Liu, Y., Li, W., Li, X., Ma, D., Narang, S., Ng, A., Ozair, S., Peng, Y., Prenger, R., Qian, S., Quan, Z., Raiman, J., Rao, V., Satheesh, S., Seetapun, D., Sengupta, S., Srinet, K., Sriram, A., Tang, H., Tang, L., Wang, C., Wang, J., Wang, K., Wang, Y., Wang, Z., Wang, Z., Wu, S., Wei, L., Xiao, B., Xie, W., Xie, Y., Yogatama, D., Yuan, B., Zhan, J., and Zhu, Z. Deep speech 2: End-to-end speech recognition in English and mandarin. In Proceedings of the 33rd + +International Conference on International Conference on Machine Learning - Volume 48, ICML'16, pp. 173-182, New York, NY, USA, June 2016. JMLR.org. + +Antonello, R., Turek, J. S., Vo, V. A., and Huth, A. Low-dimensional Structure in the Space of Language Representations is Reflected in Brain Responses. In Advances in Neural Information Processing Systems, May 2021. + +Baevski, A., Zhou, H., Mohamed, A., and Auli, M. Wav2vec 2.0: A Framework for Self-Supervised Learning of Speech Representations. arXiv:2006.11477 [cs, eess], September 2020. + +Binder, J. R., Desai, R. H., Graves, W. W., and Conant, L. L. Where Is the Semantic System? A Critical Review and Meta-Analysis of 120 Functional Neuroimaging Studies. Cerebral Cortex, 19(12):2767-2796, December 2009. ISSN 1047-3211. doi: 10.1093/cercor/bhp055. + +Caucheteux, C., Gramfort, A., and King, J.-R. GPT-2's activations predict the degree of semantic comprehension in the human brain, September 2021. + +Chi, T., Gao, Y., Guyton, M. C., Ru, P., and Shamma, S. Spectro-temporal modulation transfer functions and speech intelligibility. The Journal of the Acoustical Society of America, 106(5):2719, October 1999. ISSN 0001-4966. doi: 10.1121/1.428100. + +Chi, T., Ru, P., and Shamma, S. A. Multiresolution spectrotemporal analysis of complex sounds. The Journal of the Acoustical Society of America, 118(2):887-906, August 2005. ISSN 0001-4966. doi: 10.1121/1.1945807. + +Chung, Y.-A. and Glass, J. Generative Pre-Training for Speech with Autoregressive Predictive Coding. arXiv:1910.12607 [cs, eess], January 2020. + +Chung, Y.-A., Hsu, W.-N., Tang, H., and Glass, J. An Unsupervised Autoregressive Model for Speech Representation Learning. arXiv:1904.03240 [cs, eess], June 2019. + +Dale, A. M., Fischl, B., and Sereno, M. I. Cortical Surface-Based Analysis: I. Segmentation and Surface Reconstruction. NeuroImage, 9(2):179-194, February 1999. ISSN 1053-8119. doi: 10.1006/nimg.1998.0395. + +de Heer, W. A., Huth, A. G., Griffiths, T. L., Gallant, J. L., and Theunissen, F. E. The Hierarchical Cortical Organization of Human Speech Processing. The Journal of Neuroscience, 37(27):6539-6557, July 2017. ISSN 0270-6474, 1529-2401. doi: 10.1523/JNEUROSCI.3267-16.2017. + +Devlin, J., Chang, M.-W., Lee, K., and Toutanova, K. BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for + +Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pp. 4171-4186, Minneapolis, Minnesota, June 2019. Association for Computational Linguistics. doi: 10.18653/v1/N19-1423. +Elman, J. L. and McClelland, J. L. Cognitive penetration of the mechanisms of perception: Compensation for coarticulation of lexically restored phonemes. Journal of Memory and Language, 27(2):143-165, April 1988. ISSN 0749-596X. doi: 10.1016/0749-596X(88)90071-X. +Ettinger, A., Elgohary, A., and Resnik, P. Probing for semantic evidence of composition by means of simple classification tasks. In Proceedings of the 1st Workshop on Evaluating Vector-Space Representations for NLP, pp. 134-139, Berlin, Germany, August 2016. Association for Computational Linguistics. doi: 10.18653/v1/W16-2524. +Gao, J. S., Huth, A. G., Lescroart, M. D., and Gallant, J. L. Pycortex: An interactive surface visualizer for fMRI. Frontiers in Neuroinformatics, 9, 2015. ISSN 1662-5196. +Goldstein, A., Zada, Z., Buchnik, E., Schain, M., Price, A., Aubrey, B., Nastase, S. A., Feder, A., Emanuel, D., Cohen, A., Jansen, A., Gazula, H., Choe, G., Rao, A., Kim, S. C., Casto, C., Fanda, L., Doyle, W., Friedman, D., Dugan, P., Melloni, L., Reichart, R., Devore, S., Flinker, A., Hasenfratz, L., Levy, O., Hassidim, A., Brenner, M., Matias, Y., Norman, K. A., Devinsky, O., and Hasson, U. Thinking ahead: Spontaneous prediction in context as a keystone of language in humans and machines. Preprint, Neuroscience, December 2020. +Hewitt, J. and Liang, P. Designing and Interpreting Probes with Control Tasks. arXiv:1909.03368 [cs], September 2019. +Hickok, G. and Poeppel, D. The cortical organization of speech processing. Nature Reviews Neuroscience, 8(5): 393-402, May 2007. ISSN 1471-0048. doi: 10.1038/nrn2113. +Hsu, W.-N., Bolte, B., Tsai, Y.-H. H., Lakhotia, K., Salakhutdinov, R., and Mohamed, A. HuBERT: Self-Supervised Speech Representation Learning by Masked Prediction of Hidden Units. arXiv:2106.07447 [cs, eess], June 2021. +Huth, A. G., de Heer, W. A., Griffiths, T. L., Theunissen, F. E., and Gallant, J. L. Natural speech reveals the semantic maps that tile human cerebral cortex. Nature, 532(7600):453-458, April 2016. ISSN 1476-4687. doi: 10.1038/nature17637. +Jain, S. and Huth, A. Incorporating Context into Language Encoding Models for fMRI. In Bengio, S., Wallach, H., Larochelle, H., Grauman, K., Cesa-Bianchi, N., and + +Garnett, R. (eds.), Advances in Neural Information Processing Systems 31, pp. 6628-6637. Curran Associates, Inc., 2018. +Jain, S., Vo, V., Mahto, S., LeBel, A., Turek, J. S., and Huth, A. Interpretable multi-timescale models for predicting fMRI responses to continuous natural speech. Advances in Neural Information Processing Systems, 33:13738-13749, 2020. +Kell, A. J. E., Yamins, D. L. K., Shook, E. N., Norman-Haignere, S. V., and McDermott, J. H. A Task-Optimized Neural Network Replicates Human Auditory Behavior, Predicts Brain Responses, and Reveals a Cortical Processing Hierarchy. *Neuron*, 98(3):630–644.e16, May 2018. ISSN 0896-6273. doi: 10.1016/j.neuron.2018.03.044. +LeBel, A., Jain, S., and Huth, A. G. Voxelwise Encoding Models Show That Cerebellar Language Representations Are Highly Conceptual. Journal of Neuroscience, 41 (50):10341-10355, December 2021. ISSN 0270-6474, 1529-2401. doi: 10.1523/JNEUROSCI.0118-21.2021. +Lieberman, P. Towards a Unified Phonetic Theory. Linguistic Inquiry, 1(3):307-322, 1970. ISSN 0024-3892. +Mesgarani, N., Cheung, C., Johnson, K., and Chang, E. F. Phonetic Feature Encoding in Human Superior Temporal Gyrus. Science, 343(6174):1006-1010, February 2014. ISSN 0036-8075, 1095-9203. doi: 10.1126/science.1245994. +Millet, J. and King, J.-R. Inductive biases, pretraining and fine-tuning jointly account for brain responses to speech. arXiv:2103.01032 [cs, eess, q-bio], February 2021. +Norman-Haignere, S. V. and McDermott, J. H. Neural responses to natural and model-matched stimuli reveal distinct computations in primary and nonprimary auditory cortex. PLOS Biology, 16(12):e2005127, December 2018. ISSN 1545-7885. doi: 10.1371/journal.pbio.2005127. +Nunez-Elizalde, A. O., Huth, A. G., and Gallant, J. L. Voxelwise encoding models with non-spherical multivariate normal priors. NeuroImage, 197:482-492, August 2019. ISSN 1053-8119. doi: 10.1016/j.neuroimage.2019.04.012. +Panayotov, V., Chen, G., Povey, D., and Khudanpur, S. Librispeech: An ASR corpus based on public domain audio books. In 2015 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 5206-5210, South Brisbane, Queensland, Australia, April 2015. IEEE. ISBN 978-1-4673-6997-8. doi: 10.1109/ICASSP.2015.7178964. +Pasad, A., Chou, J.-C., and Livescu, K. Layer-wise Analysis of a Self-supervised Speech Representation Model. arXiv:2107.04734 [cs, eess], October 2021. + +Pennington, J., Socher, R., and Manning, C. Glove: Global Vectors for Word Representation. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 1532-1543, Doha, Qatar, 2014. Association for Computational Linguistics. doi: 10.3115/v1/D14-1162. +Peters, M. E., Neumann, M., Iyyer, M., Gardner, M., Clark, C., Lee, K., and Zettlemoyer, L. Deep Contextualized Word Representations. 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. 2227-2237, New Orleans, Louisiana, June 2018. Association for Computational Linguistics. doi: 10.18653/v1/N18-1202. +Pisoni, D. B. and Sawusch, J. R. Some Stages of Processing in Speech Perception. In Cohen, A. and Nooteboom, S. G. (eds.), Structure and Process in Speech Perception, Communication and Cybernetics, pp. 16-35, Berlin, Heidelberg, 1975. Springer. ISBN 978-3-642-81000-8. doi: 10.1007/978-3-642-81000-8_2. +Radford, A., Narasimhan, K., Salimans, T., and Sutskever, I. Improving Language Understanding by Generative Pre-Training. pp. 12, 2018. +Schneider, S., Baevski, A., Collobert, R., and Auli, M. Wav2vec: Unsupervised Pre-training for Speech Recognition. arXiv:1904.05862 [cs], September 2019. +Schrimpf, M., Blank, I. A., Tuckute, G., Kauf, C., Hosseini, E. A., Kanwisher, N., Tenenbaum, J. B., and Fedorenko, E. The neural architecture of language: Integrative modeling converges on predictive processing. Proceedings of the National Academy of Sciences, 118 (45), November 2021. ISSN 0027-8424, 1091-6490. doi: 10.1073/pnas.2105646118. +Shi, X., Padhi, I., and Knight, K. Does String-Based Neural MT Learn Source Syntax? In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pp. 1526-1534, Austin, Texas, 2016. Association for Computational Linguistics. doi: 10.18653/v1/D16-1159. +Toneva, M. and Wehbe, L. Interpreting and improving natural-language processing (in machines) with natural language-processing (in the brain). In Advances in Neural Information Processing Systems, pp. 14954-14964, 2019. +Venezia, J. H., Thurman, S. M., Richards, V. M., and Hickok, G. Hierarchy of speech-driven spectrotemporal receptive fields in human auditory cortex. NeuroImage, 186:647-666, February 2019. ISSN 1053-8119. doi: 10.1016/j.neuroimage.2018.11.049. + +Wehbe, L., Vaswani, A., Knight, K., and Mitchell, T. Aligning context-based statistical models of language with brain activity during reading. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 233-243, Doha, Qatar, October 2014. Association for Computational Linguistics. doi: 10.3115/v1/D14-1030. +Wolf, T., Debut, L., Sanh, V., Chaumont, J., Delangue, C., Moi, A., Cistac, P., Rault, T., Louf, R., Funtowicz, M., Davison, J., Shleifer, S., von Platen, P., Ma, C., Jernite, Y., Plu, J., Xu, C., Le Scao, T., Gugger, S., Drame, M., Lhoest, Q., and Rush, A. 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. doi: 10.18653/v1/2020.emnlp-demos.6. +Wu, M. C.-K., David, S. V., and Gallant, J. L. Complete functional characterization of sensory neurons by system identification. Annual Review of Neuroscience, 29(1): 477-505, July 2006. ISSN 0147-006X, 1545-4126. doi: 10.1146/annurev.neuro.29.051605.113024. +Yang, S.-w., Chi, P.-H., Chuang, Y.-S., Lai, C.-I. J., Lakhotia, K., Lin, Y. Y., Liu, A. T., Shi, J., Chang, X., Lin, G.-T., Huang, T.-H., Tseng, W.-C., Lee, K.-t., Liu, D.-R., Huang, Z., Dong, S., Li, S.-W., Watanabe, S., Mohamed, A., and Lee, H.-y. SUPERB: Speech processing Universal PERformance Benchmark. arXiv:2105.01051 [cs, eess], October 2021. +Zhuang, C., Yan, S., Nayebi, A., Schrimpf, M., Frank, M. C., DiCarlo, J. J., and Yamins, D. L. K. Unsupervised neural network models of the ventral visual stream. Proceedings of the National Academy of Sciences, 118(3), January 2021. ISSN 0027-8424, 1091-6490. doi: 10.1073/pnas.2014196118. + +# A. Voxel-wise encoding models of speech + +We determine the significance of performance differences between layers via significance tests. Figure 6 shows the results for all layers of HuBERT. + +![](images/d5c7feded2999e9f4e76ec13fb5818f8297d50f2f1af2cc9cfeeaad99029b13b.jpg) +Figure 6. Pairwise significance tests between each layer of HuBERT. The color of cell $i$ , $j$ indicates the number of subjects for which the voxel-wise encoding performance of layer $i$ was significantly different from that of layer $j$ ( $p < 0.01$ for a two-sided $t$ -test). Layer 0 ("L0") is the encoder layer. + +# A.1. Performance in speech ROIs + +![](images/194df1166aa9ff3a972fc641cc00b32b521b3c1f083ed8e51600019f91a2de74.jpg) +In Figure 7, we show the encoding performance of each representation in two additional ROIs: Broca's area and sPMv. +(A) Broca's Area + +![](images/a549453efdabc72dbfabd5973f054a49de2c604caf7e4057c67726f085ca06db.jpg) +(B) Superior ventral pre-motor region (sPMv) +Figure 7. Average encoding performance across subjects $(N = 7)$ , for every baseline and SSL model representation in two speech ROIs. As with Figure 2, error bars show subject-adjusted SEM. + +# B. Voxel-wise layer selectivity + +We show the relationship between HuBERT layer selectivity and baseline encoding performance in Figure 8. + +![](images/022f4c99427f7aef56bc7604ed135b91f447b14f8593630398f992dfbf6efbdd.jpg) +(a) + +![](images/16e7cd2c036497e64fba34c2da5d53df579e908de5066c7943780852ed534199.jpg) +(b) +Figure 8. 2D histograms of voxels showing correlation between voxel-wise HuBERT layer selectivity (PC 1 in Figure 3) and two baselines. (a) Correlation of PC 1 and word embedding encoding performance across all of cortex are correlated $(\rho = 0.449)$ , suggesting that PC 1 is positively correlated with semantics. (b) Correlation of PC 1 and spectrotemporal mod. encoding performance within voxels in AC. That these are negatively correlated $(\rho = -0.330)$ gives further evidence that PC 1 is capturing higher-level processing. + +Layer selectivity maps for six subjects are shown in Figure 9. + +# C. Probing SSL model representations for linguistic structure + +We visualize the full set of probing results for the four tasks (FBANK features, spectrotemporal features, phoneme identity, word identity) for each layer of the four SSL models (Figure 10-Figure 13). Overall, the trends are consistent with the summaries reported in Figure 5 — lower layers best predict low-level acoustic features, while the upper-middle layers are better at the phoneme and word tasks. In addition to the four probes, for HuBERT we also built MLP probes that predict the entire FBANK feature/GloVe embedding as opposed to regression probes that treat each feature in the representation independently. Such probes allow us to test the geometry of HuBERT's representations. To do this, we trained a linear MLP with a single bottleneck layer (50-D). The model was trained on MSE loss and we applied L2 regularization to the output. Performance was measured as the linear correlation between true and predicted representation, averaged across the test set. + +For the phoneme and word classification tasks, we developed a baseline that predicts the most frequent output category in the training set for all test set examples. All layers in the four SSL models beat the baseline. We do not visualize the word classification baseline perplexity since it is significantly worse than the highest layer PPX (perplexity). For the word embedding MLP probe, we constructed two different baselines - randomly sampling embedding vectors from a normal distribution ("random") and randomly shuffling the GloVe embeddings between words ("shuffle"). All layers in HuBERT beat the baseline with a considerable gap, indicating that the model captures semantic similarity. (The baselines remove similarity from their representations.) Overall, the substantial differences in the performance of probing baselines and the SSL model layers suggest that the probes have high selectivity (Hewitt & Liang, 2019). + +# D. MRI acquisition, preprocessing, and experiment details + +# D.1. Participants + +All participants were healthy and had normal hearing, and normal or corrected-to-normal vision. To stabilize head motion during scanning sessions participants wore a personalized head case that precisely fit the shape of each participant's head. Anatomical data for subject S-02 were collected on a 3T Siemens TIM Trio scanner using a 32-channel Siemens volume coil at a different site. The same MP-RAGE sequence was used. + +![](images/81d0c5d0a6d2c66f6f9ec78076be4aa48c7246d5a074e2d2b292844a26998a72.jpg) +Figure 9. Layer selectivity maps for HuBERT. Shown are the flatmaps for six more subjects in the fMRI dataset. (The subject presented in the main text is UT-S-03.) PCA was computed individually for each subject using the procedure described in Section 4.2, and visualized above is each voxel's score for PC 1. Per the loadings averaged across all subjects in Figure 3B, lighter voxels are better predicted by earlier layers, while bluer voxels are better predicted by later layers. + +![](images/5ec1fff7810626fb78df55afcdc26b9f2cf25f961c2b239e8a923373430aa2f8.jpg) + +![](images/93f5513ffb36cac1de2d6bcdb96b443a0380519e05efd910e3d47ae3f61452b9.jpg) + +![](images/0cea0825d4a36fb73ecf04c0674f407803893b06cfd6393c20bc47d1b25601f0.jpg) +Figure 10. Probing results for APC. + +![](images/dcb32fd857cfabbac3740a00f70532fd75220d8a6ea1fae7a3c437188ad8378b.jpg) + +![](images/aa1e01669ce99a1486d8f72a6b2b3335fd268a92d40acc387074a271cfe59f52.jpg) + +![](images/86e3f5977a0de0568932b4e0a4833968b4ff1b3e08b6ec0d8dd62374a846af2d.jpg) + +![](images/a51e5ae974a947262e9fa750adc7e617318223fe7db102237a82a5684bbb1620.jpg) +Figure 11. Probing results for wav2vec. + +![](images/6a8866835dbcdbf1173d38c08eef4880d1c62472f0f3591559b5ddb5b75f2948.jpg) + +# D.2. Stimulus preparation and presentation + +Story stimuli were played over Sensimetrics S14 in-ear piezoelectric headphones. The audio for each story was filtered to correct for frequency response and phase errors induced by the headphones using calibration data provided + +![](images/3a22770c66b7efcaec88d07d8a1d45f7084231e9661a321f8060e3d2e5dbe498.jpg) + +![](images/876af79fe27b5e76c6c89aac9b592b6b8ed7c24bbc96790ef65a5d5be9a897c1.jpg) + +![](images/e06ea65a091e901278ac2b2be433d67020b7b86648500fdf6b64a712e6c3856a.jpg) +Figure 12. Probing results for wav2vec 2.0. + +![](images/ee4c1b2bc18e605df990a24afb05eb8d7e468c0c42e7587b9f075031861d90b7.jpg) + +by sensimetrics and custom Python code1 All stimuli were played at $44.1\mathrm{kHz}$ using the pygame library in Python (https://www pygame.org/news). + +# D.3. Acquisition parameters + +Whole-brain MRI data was collected on a 3T Siemens Skyra scanner using a 64-channel Siemens volume coil. Functional MRI (fMRI) data were collected using a gradient echo EPI sequence, multi-band factor of 2. Scan parameters included repetition time $(\mathrm{TR}) = 2.00\mathrm{s}$ , echo time $(\mathrm{TE}) = 30.8\mathrm{ms}$ , flip angle $= 71^{\circ}$ , voxel size $= 2.6\mathrm{mm}^3$ , matrix size $= 84\times 84$ , field of view $= 220\mathrm{mm}$ . Anatomical MRI data were collected with a T1-weighted multi-echo MP-RAGE sequence with voxel size $= 1\mathrm{mm}^3$ . + +# D.4. Processing MRI data + +Functional data. All functional data were motion corrected using the FMRIB Linear Image Registration Tool (FLIRT) from FSL 5.0. FLIRT was used to align all data to a template that was made from the average across the first functional run in the first story session for each subject. These automatic alignments were manually checked for accuracy. + +Low frequency voxel response drift was identified using a 2nd order Savitzky-Golay filter with a 120 second window and then subtracted from the signal. To avoid onset artifacts and poor detrending performance near each end of the scan, responses were trimmed by removing 20 seconds (10 volumes) at the beginning and end of each scan, which removed the 10-second silent period and the first and last 10 seconds of each story. The mean response for each voxel was subtracted and the remaining response was scaled to have unit variance. + +To account for physiological and behavioral noise, encoding models for all analyses were fit with responses that had been corrected for nuisance regressors that accounted for closed-eye eye movements and head motion. This has little effect on the overall model performance, but accounts for spurious eye movement and stimulus-related responses in visual cortex. + +![](images/4a4241014b5323da29b33a6bd5c463117afb57b8adc9bf5d401845f6efe0d16c.jpg) + +![](images/508b1f16a7b767c3daa7546825370cc2f264c4ab1197871f5d1f0ceed035797c.jpg) + +![](images/797b79a962a093e6632c6a94e31cec0fe6adcefe8f0764472184660ed06393e4.jpg) + +![](images/7794aa5269288d2c097d775fc16e4fd5b5497814dc5dfcfddf0234e9ddb35e4b.jpg) + +![](images/94aec84f95e80d6e737a171affc1866c079ca8f46eacb48953ebe24ec80ade28.jpg) +Figure 13. Probing results for HuBERT. + +![](images/cc9a37b614d75334f2e999aca91380581c234bd7ac5301499dc8e592b7aed78f.jpg) + +Anatomical data. Cortical surface meshes were generated from the T1-weighted anatomical scans using FreeSurfer (Dale et al., 1999). Before surface reconstruction, anatomical surface segmentations were hand-checked and corrected. Blender was used to remove the corpus callosum and make relaxation cuts for flattening. Functional images were aligned to the cortical surface using boundary based registration (BBR) in FSL. These alignments were manually checked for accuracy and adjustments were made as necessary. Flat maps were created by projecting the values for each voxel onto the cortical surface using the "nearest" scheme in pycortex (Gao et al., 2015). + +# D.5. Defining regions of interest (ROIs) + +Known regions of interest (ROIs) were localized separately in each participant. Three different tasks were used to define ROIs; a visual category localizer, an auditory cortex localizer, and a motor localizer. + +For the visual category localizer, data were collected in six 4.5 minute scans consisting of 16 blocks of 16 seconds each. During each block 20 images of either places, faces, bodies, household objects, or spatially scrambled objects were displayed. participants were asked to pay attention to the same image being presented twice in a row. The corresponding ROIs defined in the cerebral cortex with this localizer were the fusiform face area (FFA), occipital face area (OFA), extrastriate body area (EBA), parahippocampal place area (PPA), and occipital place area (OPA). + +The motor localizer data were collected during 2 identical 10-minute scans. The participant was cued to perform six + +different tasks in a random order in 20 second blocks. The cues were "hand", "foot", "mouth", "speak", saccade, and "rest" presented as a word at the center of the screen, except for the saccade cue which was presented as an array of dots. For the "hand" cue, participants were instructed to make small finger-drumming movements for the entirety of the cue display. For the "foot" cue, participants were instructed to make small foot and toe movements. For the "mouth" cue, participants were instructed to make small vocalizations that were nonsense syllables such as balabalabala. For the "speak" cue, participants were instructed to self-generate a narrative without vocalization. For the saccade cue, participants were instructed to make frequent saccades across the display screen for the duration of the task. + +Weight maps for the motor areas were used to define primary motor and somatosensory areas for the hands, feet, and mouth; supplemental motor areas for the hands and feet, secondary somatosensory areas for the hands, feet, and mouth, and the ventral premotor hand area. The weight map for the saccade responses was used to define the frontal eye fields and intraparietal sulcus visual areas. The weight map for speech was used to define Broca's area and the superior ventral premotor (sPMv) speech area. + +Auditory cortex localizer data were collected in one 10 minute scan. The participant listened to 10 repeats of a 1-minute auditory stimulus containing 20 seconds of music (Arcade Fire), speech (Ira Glass, This American Life), and natural sound (a babbling brook). To determine whether a voxel was responsive to auditory stimulus, the repeatability of the voxel response across the 10 repeats was calculated using an F-statistic. This map was used to define the auditory cortex (AC). + +Data availability. The fMRI data used in this study are publicly available at https://openneuro.org/datasets/ ds003020/versions/1.0.2. \ No newline at end of file diff --git a/selfsupervisedmodelsofaudioeffectivelyexplainhumancorticalresponsestospeech/images.zip b/selfsupervisedmodelsofaudioeffectivelyexplainhumancorticalresponsestospeech/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..17866f5fea062e7c5a92d77b44a6d1dfbb904a9d --- /dev/null +++ b/selfsupervisedmodelsofaudioeffectivelyexplainhumancorticalresponsestospeech/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6ca42196988772af8b6969a711e3788cee76476c61f5b1fdb96a489a3f029a62 +size 1435452 diff --git a/selfsupervisedmodelsofaudioeffectivelyexplainhumancorticalresponsestospeech/layout.json b/selfsupervisedmodelsofaudioeffectivelyexplainhumancorticalresponsestospeech/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..e7bd204d0db458be5de7de5b2fe8ff16540d7994 --- /dev/null +++ b/selfsupervisedmodelsofaudioeffectivelyexplainhumancorticalresponsestospeech/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:da071e9ca968d4125c9aaef9c699e6bbd6b04a10de6abeb136106516f5bf6053 +size 458549 diff --git a/selfsupervisedrepresentationlearningvialatentgraphprediction/6828daaf-48af-4190-a95e-79e6654c7a34_content_list.json b/selfsupervisedrepresentationlearningvialatentgraphprediction/6828daaf-48af-4190-a95e-79e6654c7a34_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..252f5c6de47f056e582c06c3f78914b91a86dabe --- /dev/null +++ b/selfsupervisedrepresentationlearningvialatentgraphprediction/6828daaf-48af-4190-a95e-79e6654c7a34_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4ec35a7a4cdac40378be0ff554e442bb6f5afb3a7a4eb7792ad06efdd9d6cef4 +size 139147 diff --git a/selfsupervisedrepresentationlearningvialatentgraphprediction/6828daaf-48af-4190-a95e-79e6654c7a34_model.json b/selfsupervisedrepresentationlearningvialatentgraphprediction/6828daaf-48af-4190-a95e-79e6654c7a34_model.json new file mode 100644 index 0000000000000000000000000000000000000000..20cf4cae7db9a67b3469985706361192fe1633f2 --- /dev/null +++ b/selfsupervisedrepresentationlearningvialatentgraphprediction/6828daaf-48af-4190-a95e-79e6654c7a34_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4c8f32d382f94e0108a04c59cfb60080fbba4a10b28eb360f2f1405374d3a781 +size 163563 diff --git a/selfsupervisedrepresentationlearningvialatentgraphprediction/6828daaf-48af-4190-a95e-79e6654c7a34_origin.pdf b/selfsupervisedrepresentationlearningvialatentgraphprediction/6828daaf-48af-4190-a95e-79e6654c7a34_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..b9c81b8b024c8c2eb10571f4e5cfa2c0c1f38da5 --- /dev/null +++ b/selfsupervisedrepresentationlearningvialatentgraphprediction/6828daaf-48af-4190-a95e-79e6654c7a34_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:04304544dfa4338a41ec9e7a599b25d8b33cb18c3e5d7fcac6d675f2e4b74b88 +size 2058118 diff --git a/selfsupervisedrepresentationlearningvialatentgraphprediction/full.md b/selfsupervisedrepresentationlearningvialatentgraphprediction/full.md new file mode 100644 index 0000000000000000000000000000000000000000..7aed30937b2f04c4d3b2b50c41f467a7f60f14b5 --- /dev/null +++ b/selfsupervisedrepresentationlearningvialatentgraphprediction/full.md @@ -0,0 +1,534 @@ +# Self-Supervised Representation Learning via Latent Graph Prediction + +Yaochen Xie $^{*1}$ Zhao Xu $^{*1}$ Shuiwang Ji + +# Abstract + +Self-supervised learning (SSL) of graph neural networks is emerging as a promising way of leveraging unlabeled data. Currently, most methods are based on contrastive learning adapted from the image domain, which requires view generation and a sufficient number of negative samples. In contrast, existing predictive models do not require negative sampling, but lack theoretical guidance on the design of pretext training tasks. In this work, we propose the LaGraph, a theoretically grounded predictive SSL framework based on latent graph prediction. Learning objectives of LaGraph are derived as self-supervised upper bounds to objectives for predicting unobserved latent graphs. In addition to its improved performance, LaGraph provides explanations for recent successes of predictive models that include invariance-based objectives. We provide theoretical analysis comparing LaGraph to related methods in different domains. Our experimental results demonstrate the superiority of LaGraph in performance and the robustness to the decreasing training sample size on both graph-level and node-level tasks. + +# 1. Introduction + +Self-supervised learning (SSL) methods seek to use supervisions provided by data itself and design effective pretext learning tasks. These methods allow deep models to learn from a massive amount of unlabeled data and have achieved promising successes in natural language processing (Devlin et al., 2019; Wu et al., 2019; Wang et al., 2019) and image tasks (Batson & Royer, 2019; Xie et al., 2020; He et al., 2020; Chen et al., 2020). To use unlabeled graph data, earlier studies (Perozzi et al., 2014a; Grover & Leskovec, 2016) adapt sequence-based SSL methods (Mikolov et al., + +*Equal contribution ${}^{1}$ Department of Computer Science & Engineering, Texas A&M University, College Station, USA. Correspondence to: Yaochen Xie , Shuiwang Ji . + +Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s). + +2013b;a) to learn node representations. Inspired by the recent success of SSL in the image domain, a variety of SSL methods based on graph neural networks (GNNs) have been proposed in different learning paradigms. In particular, recent studies (Velicković et al., 2019; Zhu et al., 2020; Thakoor et al., 2021; Hassani & Khasahmadi, 2020; You et al., 2020) construct SSL tasks as unsupervised approaches to learn representations from graph data at either node-level or graph-level; Hu et al. (2020) propose SSL strategies to pre-train GNNs for downstream tasks; and other studies (Jin et al., 2020; Kim & Oh, 2021) employ SSL as auxiliary tasks to boost the performance of main learning tasks. + +Common taxonomies in recent survey works (Xie et al., 2022; Liu et al., 2021b) consider two categories of SSL methods to train GNNs; namely, contrastive methods and predictive methods. Contrastive methods employ pair-wise discrimination as their pretext learning tasks. It performs transformations or augmentations to obtain multiple views from a graph and trains GNNs to discriminate between jointly sampled view pairs and independently sampled view pairs. In contrast, predictive methods (Hamilton et al., 2017; Hwang et al., 2020; Rong et al., 2020) train GNNs to predict certain labels obtained from the input graph, such as node reconstruction, connectivity reconstruction, graph statistical properties, and domain knowledge-based targets. + +Adapted from the image domain, current state-of-the-art SSL methods for graphs are mostly contrastive. As a drawback, they usually depend on a large training sample size to include a sufficient number of negative samples. With limited computing resources, contrastive methods may not be applicable to large-scale graphs without suffering from performance loss. To address the drawback, BGRL (Thakoor et al., 2021) adapts BYOL (Grill et al., 2020) to the graph domain. BGRL still obtains different views from each given graph, but it eliminates the requirement of negative samples by replacing contrastive objectives with the prediction of offline embedding. BGRL has achieved competitive performance to the contrastive methods. However, unlike contrastive methods grounded by mutual information estimation and maximization, BYOL and BGRL lack theoretical guidance and require implementation measures to prevent collapsing to trivial representations, such as stop gradient, EMA, and normalization layers. + +In this work, we propose LaGraph, a predictive SSL framework for representation learning of graph data, based on self-supervised latent graph prediction. In particular, we describe the notion of the latent graph and introduce the latent graph prediction as a pretext learning task. We adapt the supervised objective of latent graph prediction into a self-supervised setting by deriving its self-supervised upper bounds, according to which we present the learning framework of LaGraph. We provide further justifications of LaGraph by comparing it with theoretically sound methods in different domains. Our experimental results demonstrate the effectiveness of LaGraph on both graph-level and node-level representation learning, where a remarkable performance boost is achieved on a majority of datasets with higher stability to smaller batch sizes or training on subsets of nodes. Our code is available under the DIG library1 (Liu et al., 2021a). + +Relations with Prior Work: Both LaGraph and some existing contrastive methods (You et al., 2020; Zhu et al., 2020; Hu et al., 2020) apply node masking. While those contrastive methods use node masking as an augmentation to obtain different views for contrast, LaGraph employs it for the computation of the invariance term in its predictive objective. In addition, the objective of BGRL has a similar formulation to the invariance regularization term in our objective. The objectives of LaGraph and BGRL are from different grounding and have essential differences in their computing and effects. While the objective of BGRL is designed and engineered as a variant of contrastive methods, the LaGraph objectives are derived as a whole from the latent graph prediction. Our derived theorems associated with LaGraph objectives can explain the success of BGRL to some extent and provide guidance on better adopting objectives related to the invariance regularization on graphs. + +# 2. Methods + +# 2.1. Notations and Problem Formulation + +We consider an undirected graph $G = (V, E)$ with a set of attributed nodes $V$ and a set of edges $E$ . We formulate the graph data as a tuple of matrices $(A, X)$ , where $A \in \mathbb{R}^{|V| \times |V|}$ denotes the adjacency matrix and $X \in \mathbb{R}^{|V| \times d}$ denotes the node features of dimension $d$ . We employ a graph encoder $\mathcal{E}$ based on graph neural networks (GNNs) to encode each node or graph into a corresponding representation. Namely, we compute the node-level representations or node embedding by $H = \mathcal{E}(A, X) \in \mathbb{R}^{|V| \times q}$ and the graph-level representation or graph embedding by $z = \mathcal{R}(H) \in \mathbb{R}^{1 \times q}$ , where $q$ denotes the embedding dimension and $\mathcal{R}: \mathbb{R}^{|V| \times q} \to \mathbb{R}^{1 \times q}$ is a readout function. + +Self-supervised representation learning is employed to train the graph encoder $\mathcal{E}$ on a set of $K$ graphs $\{G_i\}_{i=1}^K$ without labels from downstream tasks. In particular, we seek to design effective pre-text learning tasks, whose labels are obtained by task designation or from given data, to train the graph encoder $\mathcal{E}$ and produce informative representations for downstream tasks. Depending on the pre-text learning tasks, the encoder $\mathcal{E}$ is usually trained together with some prediction head $\mathcal{D}$ for predictive SSL or a discriminator for contrastive SSL. + +# 2.2. Latent Graph Prediction + +Our method considers latent graph prediction as a pretext task to train graph neural networks. In this subsection, we introduce the general notion of latent data, followed by its specific definition for graph data, and the construction of the learning task. For any observed data instance $\pmb{x}$ , we assume that there exists a corresponding latent data $\pmb{x}_{\mathcal{I}}$ , determining the semantic of $\pmb{x}$ , such that the latent data $\pmb{x}_{\mathcal{I}}$ is generated from a prior $p(\pmb{x}_{\mathcal{I}})$ and the observed data instance is further generated from a certain distribution conditioned on the latent data, i.e., $p(\pmb{x}|\pmb{x}_{\mathcal{I}})$ . The most common case for the pair of observed data and latent data is the noisy data and its clean version. + +When it comes to graph data, we consider the case that an observed graph data $G = (A, X)$ is (noisily) generated from its latent graph $G_{\ell} = (A, F)$ with the same node set and edge set, where node feature matrices $X$ and $F$ for the two graphs have the same dimensionality. We make two assumptions about the graphs without loss of generality. First, we assume that the observed feature vector $x_{v}$ of each node $v$ in an observed graph is independently generated from a certain distribution conditioned on the corresponding latent graph. In other words, how $x_{v}$ is generated from the latent feature $f_{v}$ is not affected by the generation of other observed feature vectors. Second, we assume that the conditional distribution of the observed graph is centered at the latent graph, i.e., $\mathbb{E}[X|G_{\ell}] = F$ . The above assumptions are natural when we have little knowledge about the generation process and are commonly used in other types of data such as the non-structural and zero-mean noise in images. In cases where the generation processes of different nodes are related or the distribution is not centered at $F$ , we can still consider the related or biased components into the latent feature and therefore have the assumptions satisfied. + +As the latent data usually determine the semantic meaning of observed data, we believe the prediction of the latent graph can provide informative supervision for the learning of both graph-level and node-level representations. We are hence interested in constructing the learning task of latent graph prediction. To perform latent graph prediction, it is straightforward to employ a graph neural network $f$ : + +$\{0,1\}^{|V|\times |V|}\times \mathbb{R}^{|V|\times d}\to \mathbb{R}^{|V|\times d}$ that takes an observed graph $G = (A,X)$ as inputs and predicts the feature matrix of its latent graph $G_{\mathcal{I}} = (A,F)$ . When the ground truth of the latent feature matrix $\pmb{F}$ is known, the learning objective can be designed as + +$$ +f ^ {*} = \arg \min _ {f} \mathbb {E} \left\| f (\boldsymbol {A}, \boldsymbol {X}) - \boldsymbol {F} \right\| ^ {2}. \qquad (1) +$$ + +Intuitively, the latent graph prediction can be considered as a generalized task from noisy data reconstruction that predicts the signal from the noisy data with the objective $\arg \min_{f}\mathbb{E}\left\| f(\boldsymbol {x}) - s\right\|^{2}$ , where the mapping from the signal to the noisy data $p(\boldsymbol {x}|s)$ can usually be explicitly modeled and samples of signal (ground truth) can usually be captured. In the data reconstruction case, pairs of $(x,s)$ can be therefore directly captured or synthetically generated given a certain noise model $p(x|s)$ . However, when the task is generalized to latent graph prediction, there is a key challenge preventing us from directly applying the prediction task. That is, whereas there are natural supervisions for noisy data reconstruction, the latent graph is not observed and we are unable to explicitly model the mapping from latent graphs to observed graphs, i.e., the conditional distribution $p(G|G_{\mathcal{I}})$ . + +# 2.3. Self-Supervised Upper Bounds for Latent Graph Prediction + +As discussed in the previous subsection, unlike typical noisy data reconstruction tasks, the latent graph is not observed and $p(G|G_{\mathcal{I}})$ cannot be modeled explicitly. This makes it difficult to construct a direct learning task for latent graph prediction using the objective in Equation (1). We therefore seek to optimize an alternative objective that approximately optimizes the objective in Equation (1) without requiring the distribution $p(G|G_{\mathcal{I}})$ , nor features $\pmb{F}$ of the latent graph. We now introduce the proposed self-supervised objective for latent graph prediction. + +We derive our self-supervised objective without involving $\mathbf{F}$ by constructing an upper bound of the objective in Equation (1). Specifically, we let $J \subset \{0, \dots, |V| - 1\}$ be an arbitrary subset of node indices, $J^{c}$ denote the complement of set $J$ , and $X_{J^c} \coloneqq \mathbb{1}_{J^c} \odot X + \mathbb{1}_J \odot M$ be the feature matrix with features of nodes in $V_J$ masked, where $\odot$ denotes element-wise multiplication, $M \in \mathbb{R}^{|V| \times d}$ denotes a matrix consisting of independent random noise or zeros as masking values, and $\mathbb{1}_J \in \mathbb{R}^{|V| \times d}$ denotes an indicator matrix such that $\mathbb{1}_J[i,:] = 1, \forall i \in J$ and $\mathbb{1}_J[i,:] = 0, \forall i \notin J$ . We describe the self-supervised upper bound in Theorem 2.1, whose proof is provided in Appendix A. + +Theorem 2.1. Consider a graph $G = (A, X)$ and its latent graph $G_{\mathcal{I}} = (A, F)$ . We let the variance of any elements in $X$ be bounded by $\sigma^2$ and $J$ be a subset of nodes $V$ in the graph $G$ . For any graph neural network $f: \{0, 1\}^{|V| \times |V|} \times$ + +$\mathbb{R}^{|V| \times d} \to \mathbb{R}^{|V| \times d}$ , we have the following inequality + +$$ +\begin{array}{l} \mathbb {E} _ {\boldsymbol {A}, \boldsymbol {X}, \boldsymbol {F}} \left[ \| f (\boldsymbol {A}, \boldsymbol {X}) - \boldsymbol {F} \| ^ {2} + \| \boldsymbol {X} - \boldsymbol {F} \| ^ {2} \right] \\ \leq \mathbb {E} _ {\boldsymbol {A}, \boldsymbol {X}} \left\| f (\boldsymbol {A}, \boldsymbol {X}) - \boldsymbol {X} \right\| ^ {2} + \\ \end{array} +$$ + +$$ +2 \sigma | V | \mathbb {E} _ {J} \left[ \frac {\mathbb {E} _ {\boldsymbol {A} , \boldsymbol {X}} \| f _ {J} (\boldsymbol {A} , \boldsymbol {X}) - f _ {J} (\boldsymbol {A} , \boldsymbol {X} _ {J ^ {c}}) \| ^ {2}}{| J |} \right] ^ {1 / 2}. \tag {2} +$$ + +Intuitively, the first component in the upper bound derived in Theorem 2.1 measures the reconstruction error on the feature matrix $\mathbf{X}$ of the given observed graph $G$ , enforcing the intermediate representations to be informative. The second component controls how much information is accessible from the input feature of a node $v_{i}$ when reconstructing the feature of $v_{i}$ , by encouraging the output of a node to be invariant to the missing of its features in the input graph. We then call the first component a reconstruction term and the second component an invariance regularization term. Note that the invariance regularization is only computed on masked nodes in contrast to the BGRL objective, based on different theoretical grounding and leading to a different effect. A more detailed discussion is provided in Section 3. + +In tasks of self-supervised representation learning, we are more interested in graph-level or node-level representations than predicted latent graphs. In these cases, we expect the representations also hold the invariance property held by the final outputs. We, therefore, seek to apply the invariance regularization to the representations, since a regularization applied to the output does not necessarily control the information accessibility of representations produced intermediately in the graph neural network. To do so, we separately consider the encoder $\mathcal{E}$ and decoder $\mathcal{D}$ in the graph neural network $f$ . We introduce certain assumptions to the decoder network $\mathcal{D}$ and the readout function $\mathcal{R}$ , and derive two additional upper bounds for node-level and graph-level representation learning, respectively in the following corollaries. Proofs of the corollaries are provided in Appendix B. + +Corollary 2.2. Let $G = (A, X)$ be a given graph, $G_{\mathcal{I}} = (A, F)$ be its latent graph, $\mathcal{E}$ and $\mathcal{D}$ be a graph encoder and a prediction head (decoder) consisting of fully-connected layers. If the prediction head $\mathcal{D}$ is $\ell$ -Lipschitz continuous with respect to $l_2$ -norm, we further have the following inequality, + +$$ +\begin{array}{l} \mathbb {E} \left[ \left\| \mathcal {D} (\boldsymbol {H}) - \boldsymbol {F} \right\| ^ {2} + \left\| \boldsymbol {X} - \boldsymbol {F} \right\| ^ {2} \right] \leq \mathbb {E} \left\| \mathcal {D} (\boldsymbol {H}) - \boldsymbol {X} \right\| ^ {2} \\ + 2 \sigma | V | \ell \mathbb {E} _ {J} \left[ \frac {\mathbb {E} \| \boldsymbol {H} _ {J} - \boldsymbol {H} _ {J} ^ {\prime} \| ^ {2}}{| J |} \right] ^ {1 / 2}, \tag {3} \\ \end{array} +$$ + +where $\pmb{H} = \mathcal{E}(\pmb{A},\pmb{X})$ and $\pmb{H}' = \mathcal{E}(\pmb{A},\pmb{X}_{J^{\mathrm{c}}})$ denote the node embedding of the given graph and the masked graph, + +respectively, and $\pmb{H}_{J}:=\pmb{H}[J,:]$ selects rows with indices in $J$ . + +Corollary 2.3. Let $G = (A, X)$ be a given graph, $G_{\mathcal{I}} = (A, F)$ be its hidden latent graph, $\mathcal{E}$ be a graph encoder, $\mathcal{R}$ be a readout function satisfying $k$ -Bilipschitz continuity with respect to $l_2$ -norm, and $\mathcal{D}$ be a prediction head (decoder). If the prediction head $\mathcal{D}$ is $\ell$ -Lipschitz continuous with respect to $l_2$ -norm, we have the following inequality, + +$$ +\begin{array}{l} \mathbb {E} \left[ \| \mathcal {D} (\boldsymbol {H}) - \boldsymbol {F} \| ^ {2} + \| \boldsymbol {X} - \boldsymbol {F} \| ^ {2} \right] \leq \mathbb {E} \| \mathcal {D} (\boldsymbol {H}) - \boldsymbol {X} \| ^ {2} \\ + 2 \sigma | V | k \ell \mathbb {E} _ {J} \left[ \frac {\mathbb {E} \| z - z ^ {\prime} \| ^ {2}}{| J |} \right] ^ {1 / 2}, \tag {4} \\ \end{array} +$$ + +where $\mathbf{z} = \mathcal{R}(\mathbf{H})$ and $\mathbf{z}' = \mathcal{R}(\mathbf{H}')$ denote the graph-level representations of the given graph and the masked graph, respectively. + +We note that the assumptions and restrictions are natural or practically satisfiable. The assumption that the variance of each element in $\mathbf{X}$ is bounded by $\sigma$ holds when node features are from $\{0,1\}^d$ or when feature normalization is applied. The $\ell$ -Lipschitz continuous property is common for neural networks. And the $k$ -Bilipschitz continuity can be satisfied by applying an injective readout function such as global sum pooling, which is commonly used in graph-level tasks. + +# 2.4. The LaGraph Framework + +We design our self-supervised learning framework according to upper bounds derived in Corollary 2.2 and Corollary 2.3. To train encoder $\mathcal{E}$ together with decoder $\mathcal{D}$ under self-supervision, we input to the encoder both the given graph $(A,X)$ and its variation $(A,X_{J^c})$ with a random subset $J$ of node indices for nodes to be masked and obtain node-level representations $H = \mathcal{E}(A,X)$ and $H^{\prime} = \mathcal{E}(A,X_{J^{c}})$ for the two graphs respectively. The self-supervised losses are computed on input node features, reconstructed node features, and representations, as demonstrated in Figure 1. + +In particular, we consider a mini-batch of $N$ graphs $\{(A_i, X_i)\}_{i=1}^N$ and their corresponding masked variation $\{(A_i, X_{(i,J_i^c)})\}_{i=1}^N$ where $J_i$ denotes the node indices subset for the $i$ -th graph. The self-supervised loss for node-level representation learning follows Corollary 2.2 and is computed as + +$$ +\begin{array}{l} L _ {n o d e} (\mathcal {E}, \mathcal {D}) = \frac {1}{N} \sum_ {i = 1} ^ {N} \| \mathcal {D} \left(\boldsymbol {A} _ {i}, \boldsymbol {H} _ {i}\right) - \boldsymbol {X} _ {i} \| ^ {2} / | V _ {i} | \tag {5} \\ + \alpha \left[ \frac {\sum_ {i} \| \mathbb {1} _ {J _ {i}} \odot \boldsymbol {H} _ {i} - \mathbb {1} _ {J _ {i}} \odot \boldsymbol {H} _ {i} ^ {\prime} \| ^ {2}}{\sum_ {i} | J _ {i} |} \right] ^ {1 / 2}, \\ \end{array} +$$ + +where $\alpha$ is a hyper-parameter corresponding to the multiplier $2\sigma \ell$ in Corollary 2.2. To fulfill the conditions in Corollary 2.2, we employ fully-connected layers instead of graph convolutional layers in the decoder $\mathcal{D}$ . + +Similarly, using the same notations above, the self-supervised loss for graph-level representation learning follows Corollary 2.3 and is computed as + +$$ +\begin{array}{l} L _ {\text {g r a p h}} (\mathcal {E}, \mathcal {D}) = \frac {1}{N} \sum_ {i = 1} ^ {N} \| \mathcal {D} \left(\boldsymbol {A} _ {i}, \boldsymbol {H} _ {i}\right) - \boldsymbol {X} _ {i} \| ^ {2} / | V _ {i} | \tag {6} \\ + \alpha^ {\prime} \left[ \sum_ {i} \left\| \boldsymbol {z} _ {i} - \boldsymbol {z} _ {i} ^ {\prime} \right\| ^ {2} / \sum_ {i} | J _ {i} | \right] ^ {1 / 2}, \\ \end{array} +$$ + +where $\boldsymbol{z}_i = \mathcal{R}(\boldsymbol{H}_i)$ and $\boldsymbol{z}_i' = \mathcal{R}(\boldsymbol{H}_i')$ denote the graph-level representations obtained by applying readout function $\mathcal{R}$ to the node-level representations, respectively, and $\alpha'$ is a hyper-parameter corresponding to the multiplier $2\sigma k\ell$ in Corollary 2.3. To fulfill the conditions in Corollary 2.3, we employ global sum pooling as the readout function $\mathcal{R}$ , where as the decoder $\mathcal{D}$ here can consists of either fully-connected layers or graph convolutional layers. + +The pseudo-code for node-level and graph-level objective computations are provided in Algorithm 1 and Algorithm 2, respectively. + +# Algorithm 1 LaGraph node-level objective + +Inputs: A mini-batch of graphs $\{G_1, \dots, G_N\}$ , the encoder $\mathcal{E}$ , the prediction head $\mathcal{D}$ , and the hyper-parameter $\alpha$ . $\triangleright G_i = (\mathbf{A}_i, \mathbf{X}_i)$ + +for $i$ in $1,\dots ,N$ do + +Generate random $J_{i}\in \{0,1\}^{|V_{i}|\times 1},M\in \mathbb{R}^{|V_{i}|\times d}$ + +$X_{i,J_i^c}\gets \mathbb{1}_{J_i^c}\odot X + \mathbb{1}_{J_i}\odot M\triangleright$ Randomly mask nodes + +$\pmb{H}_i \gets \mathcal{E}(\pmb{A}_i, \pmb{X}_i) \triangleright$ Compute node representations + +$$ +\boldsymbol {H} _ {i} ^ {\prime} \leftarrow \mathcal {E} \left(\boldsymbol {A} _ {i}, \boldsymbol {X} _ {i, J _ {\xi}}\right) +$$ + +$\pmb{X}_{rec} \gets \mathcal{D}(\pmb{A}_i, \pmb{H}_i) \triangleright$ Reconstructed node attributes + +$$ +\ell_ {r e c, i} \leftarrow \left\| \boldsymbol {X} _ {r e c, i} - \boldsymbol {X} _ {i} \right\| ^ {2} / | V _ {i} | +$$ + +$$ +\ell_ {i n v, i} \leftarrow \left\| \mathbb {1} _ {J _ {i}} \odot \boldsymbol {H} _ {i} - \mathbb {1} _ {J _ {i}} \odot \boldsymbol {H} _ {i} ^ {\prime} \right\| ^ {2} +$$ + +end for + +$$ +\begin{array}{l} L (\mathcal {E}, \mathcal {D}; \{G _ {1}, \dots , G _ {N} \}) \quad = \quad \frac {1}{N} \sum_ {i} \ell_ {\text {r e c}, i} \quad + \\ \alpha (\sum_ {i} \ell_ {i n v, i} / \sum_ {i} | J _ {i} |) ^ {1 / 2} \\ \end{array} +$$ + +# 3. Theoretical Analysis and Relations with Prior Work + +In this section, we further theoretically justify and motivate LaGraph by providing comparisons and connections between our method and existing related methods, including denoising autoencoders (Vincent et al., 2010; Wang et al., 2017), information bottleneck principle (Tishby et al., 1999), + +![](images/0320b75cb83bfd7dbc52186f9d00fbb575b7e2ae0ba250dbf811066f04e4c617.jpg) +Figure 1. Overview of the LaGraph framework. Given a training graph, we randomly mask a small portion $V_{J} \in V$ of its nodes and input both the original graph and masked graph to the encoder $\mathcal{E}$ . Crossed nodes in the figure have all their attributes masked but topology preserved. The final loss consists of a reconstruction loss on node features and an invariance loss between representations of the original graph and the masked graph. We omit the encoding part of the graph-level framework as frameworks for the two levels mainly differ in whether the invariance term is computed on representations of masked nodes or graph-level representations obtained by $\mathcal{R}$ . + +![](images/5e2b66f597d27f1df644b2647b9599040aea30127a06373e460de1bd7df81bbc.jpg) + +# Algorithm 2 LaGraph graph-level objective + +Inputs: A mini-batch of graphs $\{G_1, \dots, G_N\}$ , the encoder $\mathcal{E}$ , the prediction head $\mathcal{D}$ , the readout function $\mathcal{R}$ , and the hyper-parameter $\alpha$ . + +for $i$ in $1,\dots ,N$ do + +Generate random $J_{i}\in \{0,1\}^{|V_{i}|\times 1},M\in \mathbb{R}^{|V_{i}|\times d}$ + +$X_{i,J_i^c}\gets \mathbb{1}_{J_i^c}\odot X + \mathbb{1}_{J_i}\odot M\triangleright$ Randomly mask les + +$\pmb{H}_i \gets \mathcal{E}(\pmb{A}_i, \pmb{X}_i)$ Compute node embeddings $\pmb{H}_i' \gets \mathcal{E}(\pmb{A}_i, \pmb{X}_{i,J_i^c})$ + +$z_{i}\gets \mathcal{R}(\pmb{H}_{i})$ Readout graph representations + +$\pmb{z}_i^{\prime}\gets \mathcal{R}(\pmb{H}_i^{\prime})$ + +$\pmb{X}_{rec} \gets \mathcal{D}(\pmb{A}_i, \pmb{H}_i) \triangleright$ Reconstructed node attributes + +$\ell_{rec,i}\gets \| \pmb{X}_{rec,i} - \pmb {X}_i\| ^2 /|V_i|$ + +$\ell_{inv,i}\gets \| \pmb {z}_i - \pmb {z}_i'\| ^2$ + +# end for + +$$ +L \left(\mathcal {E}, \mathcal {D}; \left\{G _ {1}, \dots , G _ {N} \right\}\right) = \frac {1}{N} \sum_ {i} \ell_ {\text {r e c}, i} + +$$ + +$$ +\alpha (\sum_ {i} \ell_ {i n v, i} / \sum_ {i} | J _ {i} |) ^ {1 / 2} +$$ + +and contrastive methods based on local-global mutual information maximization (Veličković et al., 2019; Sun et al., 2019; Hassani & Khasahmadi, 2020). We also discuss the relation and difference to BGRL (Thakoor et al., 2021) and Barlow-Twin (Zbontar et al., 2021). + +# 3.1. Denoising Autoencoders + +Denoising autoencoders employ an encoder-decoder network architecture and perform self-supervised training by masking or corrupting a portion of dimensions of the given data and reconstructing the masked or corrupted value given their context. Such an approach has been also applied for self-supervised image denoising (Batson & Royer, 2019), known as blind-spot denoising. Similar to our method, the denoising autoencoder can be also viewed as an approxima + +tion of the latent graph prediction. Using the same notation in Section 2, we formulate the connection between latent graph prediction and the graph denoising autoencoder in the following theorem. + +Theorem 3.1. Let $J$ be a uniformly sampled subset of node indices of the given graph $(\mathbf{A},\mathbf{X})$ , $\mathcal{F}$ be the class of all graph neural networks, and $\mathcal{F}^*$ be the class of graph neural networks such that $f_J^*(\mathbf{A},\mathbf{X})$ does not depend on $\mathbf{X}_J$ , for any $J$ and $f^* \in \mathcal{F}^*$ . Given any graph neural network $f \in \mathcal{F}$ , there exist $f^* \in \mathcal{F}^*$ and $f' \in \mathcal{F}$ such that + +$$ +\mathbb {E} _ {\boldsymbol {A}, \boldsymbol {X}, \boldsymbol {F}} \left[ \| f (\boldsymbol {A}, \boldsymbol {X}) - \boldsymbol {F} \| ^ {2} + \| \boldsymbol {X} - \boldsymbol {F} \| ^ {2} \right] \tag {7} +$$ + +$$ += \mathbb {E} _ {\boldsymbol {A}, \boldsymbol {X}} \| f (\boldsymbol {A}, \boldsymbol {X}) - \boldsymbol {X} \| ^ {2} + +$$ + +$$ +\mathbb {E} _ {\boldsymbol {A}, \boldsymbol {X}, \boldsymbol {F}} \left[ 2 \langle f (\boldsymbol {A}, \boldsymbol {X}) - \boldsymbol {F}, \boldsymbol {X} - \boldsymbol {F} \rangle \right] \tag {8} +$$ + +$$ +\approx \mathbb {E} _ {\boldsymbol {A}, \boldsymbol {X}} \| f ^ {*} (\boldsymbol {A}, \boldsymbol {X}) - \boldsymbol {X} \| ^ {2} \tag {9} +$$ + +$$ += | V | \mathbb {E} _ {J} \mathbb {E} _ {\boldsymbol {A}, \boldsymbol {X}} \| f _ {J} ^ {\prime} (\boldsymbol {A}, \boldsymbol {X} _ {J ^ {c}}) - \boldsymbol {X} _ {J} \| ^ {2} / | J |. \tag {10} +$$ + +Equation (7) is proved in the proof of Theorem 1. It can be verified that the second term, i.e., the expectation of the inner product, in Equation (7) reduces to zero when the neural network $f$ satisfies that $f_{J}(\mathbf{A},\mathbf{X})$ does not depend on $\mathbf{X}_{J}$ , for any $J$ , according to Batson and Royer (2019). The objective can be therefore approximated by Equation (8) with the neural network $f^{*}$ satisfying such a property. To let any graph neural network $f$ satisfy the property, one can apply masks to a portion of nodes indexed by $J$ so that their original value is inaccessible by $f$ when predicting $f_{J}(\mathbf{A},\mathbf{X})$ . Therefore, the latent graph prediction objective under supervision can be further approximated by Equation (9), which describes the objective of a graph denoising autoencoder. + +A substantial difference between our method and the denoising autoencoder lies in how to handle the inner product term in Equation (7). In particular, the denoising autoencoder + +forces the term to be zero by assuming certain properties of the graph neural network, whereas our method derives an upper bound, i.e., the invariance term, for the inner product. Theoretically, the graph denoising autoencoder is equivalent to our framework with an infinite weight scalar for the invariance term. As a drawback, when $f_{J}(\mathbf{A},\mathbf{X})$ does not depend on $X_{J}$ , the learned representations can be less informative as representations of nodes in $V_{J}$ do not include the information of $X_{J}$ , for any $J$ , leading to performance loss. Our proposed upper bounds allow an encoder to access a certain level of information of the masked nodes, whose representations can be as good as ones from supervised learning. In fact, our method can be viewed as an autoencoder with an invariance regularization. + +# 3.2. The Information Bottleneck Principle + +The information bottleneck principle (Tishby et al., 1999) is a technique for data compression and signal processing in the field of information theory, and has been widely applied in deep learning problems (Tishby & Zaslavsky, 2015; Saxe et al., 2018). Let $\mathbf{X}$ be a random variable to be compressed, $\tilde{\mathbf{X}}$ be an observed relevant variable, and $\mathbf{Z}$ denote the compressed representation of $\mathbf{X}$ . The information bottleneck principle seeks to optimize the following problem + +$$ +Z ^ {*} = \arg \min _ {\boldsymbol {Z}} I (\boldsymbol {Z}; \tilde {\boldsymbol {X}}) - \beta I (\boldsymbol {Z}; \boldsymbol {X}), \tag {11} +$$ + +where $I(\cdot ;\cdot)$ denotes the mutual information and $\beta >1$ is a Lagrange multiplier. The work Barlow Twin (Zbontar et al., 2021) has discussed a connection between the information bottleneck principle and self-supervised learning. In particular, to apply information bottleneck to SSL, one usually obtain $\tilde{X}$ by performing augmentations or distortions on the given data $X$ . And Equation (11) can be rewritten into + +$$ +\begin{array}{l} \boldsymbol {Z} ^ {*} = \arg \min _ {\boldsymbol {Z}} \left[ H (\boldsymbol {Z}) - H (\boldsymbol {Z} | \tilde {\boldsymbol {X}}) \right] (12) \\ - \beta [ H (\mathbf {Z}) - H (\mathbf {Z} | \mathbf {X}) ] (13) \\ = \arg \min _ {\boldsymbol {Z}} H (\boldsymbol {Z} | \boldsymbol {X}) - \lambda H (\boldsymbol {Z}), (14) \\ \end{array} +$$ + +where $\lambda = \frac{\beta - 1}{\beta} > 0$ is a weight scalar. Intuitively, the conditional entropy $H(Z|X)$ is to be minimized, indicating that the distortion should add no additional information to the representation $Z$ . In other words, the representation $Z$ should be as invariant as possible to distortions applied to $X$ . In addition, the entropy $H(Z)$ is to be maximized, indicating that the representation $Z$ itself should be as informative as possible. + +The two terms in objectives of $LaGraph$ correspond to the terms in Equation (14). In particular, the invariance term corresponding to $H(\mathbf{Z}|\mathbf{X})$ and the reconstruction term aims to ensure informative representations, i.e., to maximize $H(\mathbf{Z})$ . Objectives in existing SSL methods such as BYOL (Grill + +et al., 2020), its variation BGRL (Thakoor et al., 2021) in graph domain, and Barlow Twin (Zbontar et al., 2021) also include invariance terms corresponding to $H(Z|X)$ . To encourage informative representations, Barlow Twin further includes a redundancy reduction term to minimize the cross-correlation between different dimensions of the representation, as a proxy of the maximization of $H(Z)$ . In addition, the InfoNCE (NT-XENT) loss employed in some contrastive learning methods (You et al., 2020; Zhu et al., 2020) induces a similar effect, according to Zbontar et al. (2021). Both Equation (14) and the derivation of LaGraph objectives indicate the importance of the invariance term in SSL objectives. In addition, compared to the redundancy reduction term in Barlow Twin and the noise contrast in InfoNCE, LaGraph objectives can directly guarantee the learning of informative representations measured by the reconstruction capability. + +# 3.3. Contrastive Learning by Maximizing Local-Global Mutual Information + +Motivated by Deep InfoMax (Hjelm et al., 2019), recent graph self-supervised learning methods (Velicković et al., 2019; Sun et al., 2019; Hassani & Khasahmadi, 2020) constructs their learning tasks by maximizing the mutual information between local (node-level) representations and a global (graph-level) summary of the graph. Practically, as a $k$ -layer encoder $\mathcal{E}$ has the receptive field of at most $k$ -hop neighborhood, the goal becomes the maximization of the mutual information between local representations and their $k$ -hop neighborhood, formulated as + +$$ +\mathcal {E} ^ {*} = \arg \max _ {\mathcal {E}} \sum_ {i = 1} ^ {| V |} I \left(\boldsymbol {X} _ {i} ^ {(k)}; \mathcal {E} _ {i} (\boldsymbol {A}, \boldsymbol {X})\right), \tag {15} +$$ + +where $I$ denotes the mutual information, $\pmb{X}_i^{(k)}$ is the $k$ -hop neighborhood of node $i$ , $\mathcal{E}$ is a graph encoder with $k$ GNN layers, and $\mathcal{E}_i(\pmb{A},\pmb{X})$ denotes the local representation of node $i$ . The learning objective is motivated by the goal that the local representations should contain as much the global information of the entire graph (or the $k$ -hop neighborhood) as possible. + +As for $LaGraph$ , the reconstruction term encourages representations to contain sufficient information to reconstruct the input features while the invariance term limits the information accessibility from a local node when reconstructing its features. The two terms in the objective jointly promote node representations to learn limited local information and as much contextual information from the neighborhood as possible for reconstruction. It hence has a similar effect to the local-global mutual information maximization. + +# 3.4. Other Invariance-Based Objectives + +Recent self-supervised learning objectives such as BGRL, Barlow-Twin, and the consistency regularization (Wei et al., 2021) have similar invariance terms as one in the LaGraph objective. Specifically, BGRL minimizes the difference between representations of two augmented views. In spite of the similarity, the invariance terms in LaGraph and other objectives have different grounding and effects. + +Regarding how the objectives are computed, the invariance term in the LaGraph objective for node-level representation learning is computed only on masked nodes, in contrast to BGRL and Barlow-Twins objectives where invariance of all nodes are computed. It is worth noting that the proposed objective is an upper bound to the latent graph prediction only if the invariance is computed on the masked nodes, according to the derivation in the proof of Theorem 1. Intuitively, during the computation of a node representation, the invariance term in LaGraph enforces the encoder to capture less information from the node itself and more contextual information. Computing the invariance regularization term on unmasked nodes could lead to a contradicted effect, i.e., discouraging encoders to capture information from contextual nodes, as it lets the representation remain consistent when its masked neighbor nodes are changed. We believe the derivation and the intuition of the proposed objective can provide insights on adopting the invariance regularization into graph self-supervised learning studies. + +# 4. Experiments + +We conduct experiments on both node-level and graph-level self-supervised representation learning tasks with datasets used in two most recent state-of-the-art methods for SSL (You et al., 2020; Thakoor et al., 2021). For graph-level tasks, we follow GraphCL (You et al., 2020) to perform evaluations on eight graph classification datasets (Wale & Karypis, 2006; Borgwardt et al., 2005; Dobson & Doig, 2003; Debnath et al., 1991; Yanardag & Vishwanathan, 2015) from TUDataset (Morris et al., 2020). For node-level tasks, as the citation network datasets (McCallum et al., 2000; Giles et al., 1998; Sen et al., 2008) are recognized to be saturated and unreliable for GNN evaluation (Shchur et al., 2018; Thakoor et al., 2021), we follow Thakoor et al. (2021) to include four transductive node classification datasets from Shchur et al. (2018), including Amazon Computers, Amazon Photos from the Amazon Co-purchase Graph (McAuley et al., 2015), Coauthor CS, and Coauthor Physics from the Microsoft Academic Graph (Sinha et al., 2015). We further include three larger-scale inductive datasets, PPI, Reddit, and Flickr, for node-level classification used in SUBG-CON (Jiao et al., 2020). + +We follow You et al. (2020) and Zhu et al. (2020) for the + +standard linear evaluation protocols at graph-level and node-level, respectively. In particular, for both levels, we first train the graph encoder on unlabeled graph datasets with the corresponding self-supervised objective. We then compute and freeze the corresponding representations and train a linear classification model on top of the fixed representations with their corresponding labels. Linear SVM and the regularized logistic regression are employed as linear classifiers for graph-level datasets and node-level datasets, according to You et al. (2020) and Zhu et al. (2020), respectively. For inductive node-level datasets, the self-supervised training is only performed on graphs in the training datasets whereas the test graphs are unavailable during the self-supervised training. + +# 4.1. Comparisons with Baselines + +We perform experiments on both graph-level and node-level datasets to demonstrate the effectiveness of LaGraph. We construct our model and losses according to Section 2.4. Detailed model configurations, training settings, and dataset statistics are provided in Appendix C. + +Graph-level Datasets. We evaluate the performance of LaGraph in terms of the linear classification accuracy and compare it with three kernel-based methods including graphlet kernel (GL) (Shervashidze et al., 2009), Weisfeiler-Lehman kernel (WL) (Shervashidze et al., 2011), and deep graph kernel (DGK) (Yanardag & Vishwanathan, 2015), together with five unsupervised methods including Node2Vec (Grover & Leskovec, 2016), Sub2Vec (Adhikari et al., 2018), Graph2Vec (Narayanan et al., 2017), GAE and VGAE (Kipf & Welling, 2016). We further compare the results with recent SOTA SSL methods based on contrastive learning, including InfoGraph (Sun et al., 2019), MVGRL (Hassani & Khasahmadi, 2020), and GraphCL (You et al., 2020). Results in Table 1 show that LaGraph outperforms the current SOTA methods on a majority of datasets and is on par with the best performance on the rest of datasets. Additional results adopting LaGraph as a pretraining strategy under the semi-supervised learning setting are provided in Appendix D. + +Node-level Datasets. We perform node-level experiments on both transductive and inductive learning tasks. Transductive self-supervised learning of node representation allows utilization of all data at hand to pre-train GNNs for downstream tasks. Although labels of nodes are not visible during pre-training, patterns and information present in all nodes are observed. In contrast to transductive learning, inductive self-supervised learning only allows using a portion of data to pre-train GNNs, while holding out a certain amount of data for downstream tasks. Our inductive tasks include two cases. First, the PPI dataset consists of 24 graphs, and the + +Table 1. Performance on graph-level classification tasks, scores are averaged over 5 runs. Bold and underlined numbers highlight the top-2 performance. OOM indicates running out-of-memory on a 56GB Nvidia A6000 GPU. + +
NCI1PROTEINSDDMUTAGCOLLABRDT-BRDT-M5KIMDB-B
GL---81.7±2.1-77.3±0.241.0±0.265.9±1.0
WL80.0±0.572.9±0.6-80.7±3.0-68.8±0.446.1±0.272.3±3.4
DGK80.3±0.573.3±0.8-87.4±2.7-78.0±0.441.3±0.267.0±0.6
Node2Vec54.9±1.657.5±3.675.1±0.572.6±10.255.7±0.273.8±0.534.1±0.450.0±0.8
Sub2Vec52.8±1.553.0±5.673.6±1.561.1±15.862.1±1.471.5±0.436.7±0.455.3±1.5
Graph2Vec73.2±1.873.3±2.176.2±0.183.2±9.359.9±0.075.8±1.047.9±0.371.1±0.5
GAE73.3±0.674.1±0.577.9±0.584.0±0.656.3±0.174.8±0.237.6±1.652.1±0.2
VGAE73.7±0.374.0±0.577.6±0.484.4±0.656.3±0.074.8±0.239.1±1.652.1±0.2
InfoGraph76.2±1.174.4±0.372.9±1.889.0±1.170.7±1.182.5±1.453.5±1.073.0±0.9
GraphCL77.9±0.474.4±0.578.6±0.486.8±1.371.4±1.289.5±0.856.0±0.371.1±0.4
MVGLR75.1±0.571.5±0.3OOM89.7±1.1OOM84.5±0.6OOM74.2±0.7
LaGraph79.9±0.575.2±0.478.1±0.490.2±1.177.6±0.290.4±0.856.4±0.473.7±0.9
+ +training and testing nodes are split by graphs. In this case, the inductive task is considered across multiple graphs. In other words, node representations are learned from training graphs, and the encoder is evaluated on testing graphs. Second, Flickr and Reddit each consist of only one graph, the training and testing nodes are from the same graph. During self-supervised training, all test nodes are masked-out. During evaluation, all training nodes are masked-out, i.e., test nodes are unseen nodes of the graph during train. For both cases of inductive learning, data used during the self-supervised training stage and data used during evaluation stage are distinct, but the feature dimensionality should be the same for data used in both stages. + +For the evaluation of transductive learning, we compare the performance of LaGraph in terms of linear classification accuracy with DeepWalk (Perozzi et al., 2014b), GAE, VGAE, and six contrastive learning methods including Deep Graph InfoMax (DGI) (Velicković et al., 2019), GMI (Peng et al., 2020), MVGRL (Hassani & Khasahmadi, 2020), GRACE (Zhu et al., 2020), GCA (Zhu et al., 2021), and BGRL (Thakoor et al., 2021), where BGRL is the current state-of-the-art SSL method for node-level representation learning. We further include the results of directly performing linear classification on raw node features (raw features) and by supervised training for references. To be consistent with Thakoor et al. (2021), we have ensured that the GPU memory consumption of LaGraph is under 16GB for the four transductive datasets. We then perform additional experiments on the larger-scale inductive datasets (Zitnik & Leskovec, 2017; Zeng et al., 2020; Hamilton et al., 2017) and compare our results in terms of micro-averaged F1-score with DeepWalk, unsupervised GraphSAGE (Hamilton et al., 2017), DGI, GMI, SUBG-CON (Jiao et al., 2020) and BGRL. Results for both transductive datasets and inductive datasets shown in Table 2. As there is no official BGRL implementation available at the time our experiments are conducted, results with $*$ are obtained from an unoffi + +cial public implementation $^2$ . Results suggest competitive performance of LaGraph compared to the existing SOTA methods. Moreover, LaGraph consumes even less memory than BGRL, which requires twice the memory for its GNN encoders for the EMA parameter update. + +Experiment Environment Details. We train graph-level datasets on a 11GB GeForce RTX 2080 Ti GPU, and node-level datasets on a 56GB Nvidia RTX A6000 GPU. Our experiments are implemented with PyTorch 1.7.0 and PyTorch Geometric 1.7.0. All neural networks employ batch normalization (Ioffe & Szegedy, 2015), and are optimized with Adam optimizer (Kingma & Ba, 2014). We initialize GNNs with Xavier initialization (Glorot & Bengio, 2010). + +# 4.2. Ablation Study + +We further conduct three ablation studies to explore model robustness to smaller batch sizes on graph-level data and to the training with sub-graphs on large-scale node-level datasets. An additional ablation study on the effect of optimizing different objectives is provided in Appendix E. + +Robustness to Batch Sizes. Different from contrastive learning methods, $LaGraph$ does not require negative samples to perform noise contrast or pair-wise discrimination. Therefore, an advantage of $LaGraph$ is that the performance is robust to the batch size as it does not depend on large batch sizes with sufficient negative samples. To verify the statement, we perform an ablation study on how model performance changes when decreasing the batch size from 128 to 8 for graph-level datasets. We include corresponding results of GraphCL which uses InfoNCE for references and show the comparisons in Figure 2. The results indicate while contrastive methods based on InfoNCE suffer from significant performance loss with a small batch size, $LaGraph$ are more robust to the batch size. + +Table 2. Performance on node-level datasets, 20 runs averaged. Results of SSL methods with the best performance are highlighted in bold numbers. Left: Mean classification accuracy on transductive datasets, with baseline results from Thakoor et al. (2021). Right: Micro-averaged F1 scores on larger-scale inductive datasets, with baseline results from Thakoor et al. (2021) and Jiao et al. (2020). + +
TransductiveAm.Comp.Am.Pht.Co.CSCo.Phy
Raw features73.8±0.078.5±0.090.4±0.093.6±0.0
DeepWalk85.7±0.189.4±0.184.6±0.291.8±0.2
GAE87.7±0.392.7±0.392.4±0.295.3±0.1
VGAE88.1±0.392.8±0.392.5±0.295.3±0.1
Supervised86.5±0.592.4±0.293.0±0.395.7±0.2
DGI84.0±0.591.6±0.292.2±0.694.5±0.5
GMI82.2±0.390.7±0.2OOMOOM
MVGRL87.5±0.191.7±0.192.1±0.195.3±0.0
GRACE87.5±0.292.2±0.292.9±0.095.3±0.0
GCA88.9±0.292.5±0.293.1±0.095.7±0.0
BGRL89.7±0.392.9±0.393.2±0.295.6±0.1
LaGraph88.0±0.393.5±0.493.3±0.295.8±0.1
+ +
InductivePPIFlickrReddit
Raw feat.42.5±0.320.3±0.258.5±0.1
GAE75.7±0.050.7±0.2OOM
VGAE75.8±0.050.4±0.2OOM
Super-GCN51.5±0.648.7±0.393.3±0.1
Super-GAT97.3±0.2OOMOOM
GraphSAGE46.5±0.736.5±1.090.8±1.1
DGI63.8±0.242.9±0.194.0±0.1
GMI65.0±0.044.5±0.295.0±0.0
SUBG-CON66.9±0.248.8±0.195.2±0.0
BGRL-GCN69.6±0.250.0±0.3*OOM*
BGRL-GAT70.5±0.144.2±0.1*OOM*
LaGraph74.6±0.051.3±0.195.2±0.0
+ +Table 3. Model performance when trained on a subset of nodes. + +
# nodes sampled1001,0002,5005,00010,000all
Flickr% nodes sampled0.22%2.24%5.60%11.20%22.41%100.00%
F1-score - LaGraph6.0751.1251.1251.2751.2951.26
Memory - LaGraph1389MB1465MB1553MB1725MB2065MB4211MB
F1-score - GraphCL45.2745.2745.2745.3845.4545.48
Memory - GraphCL1647MB2599MB4137MB6741MB11905MB47939MB
Reddit% nodes sampled0.07%0.65%1.63%3.25%6.50%100.00%
F1-score - LaGraph5.7695.0595.0695.0895.0995.22
Memory - LaGraph1403MB1475MB1585MB1783MB2161MB16933MB
F1-score - GraphCL93.2493.2493.2593.3193.32OOM
Memory - GraphCL4199MB6117MB6687MB9297MB14495MBOOM
+ +![](images/f5f5dbc1a295366055900cfcce46e71c627bb4deee55f07078a21b7eede1c6d6.jpg) +Figure 2. Model robustness to small batch sizes on RDT-B and COLLAB. Shown are relative changes in accuracy over different batch sizes compared to the batch size of 256. + +![](images/dd7e5d2bab187363708668ad59a92a3c0b084593db319b149745e9fe479fd2c1.jpg) + +Training on Sub-graphs for Large-scale Datasets. Training graph encoders on all nodes for some large-scale graphs can be heavily expensive in computation. We hence conduct an ablation study on how training graph encoders on a portion of sampled nodes instead of the entire graph affects the effectiveness of training. Results in Table 3 suggest that the model performance remains stable when decreasing the number of nodes until the number becomes extremely small. The collapse is due to the very sparse connectivity and $LaGraph$ fails to reconstruct a node from its neighbor nodes as there are no neighbors at all. In contrast, though GraphCL does not collapse at extremely small subsets, it + +suffers more from performance loss above 1,000 nodes and consumes significantly more GPU memory. + +# 5. Conclusions and Future Directions + +We introduced LaGraph, a state-of-the-art predictive SSL framework whose objectives are based on self-supervised latent graph prediction. We provided theoretical analysis and discussed the relationship between LaGraph and theories in different related domains. Experimental results demonstrate the strong effectiveness of the proposed framework and the stability to the training scale for both graph-level and node-level tasks. Currently, our framework mainly considers the latent graph regarding its node features. Further investigation into a latent graph prediction framework that includes richer information such as edge features and latent connectivity into self-supervision can potentially bring additional improvement to the performance. We discuss more future directions in Appendix F. + +# Acknowledgments + +This work was supported in part by National Science Foundation grant IIS-2006861. + +# References + +Adhikari, B., Zhang, Y., Ramakrishnan, N., and Prakash, B. A. Sub2Vec: Feature learning for subgraphs. In Pacific-Asia Conference on Knowledge Discovery and Data Mining, pp. 170–182. Springer, 2018. +Batson, J. and Royer, L. Noise2Self: Blind denoising by self-supervision. In Proceedings of the 36th International Conference on Machine Learning, volume 97, pp. 524-533, 2019. +Borgwardt, K. M., Ong, C. S., Schonauer, S., Vishwanathan, S. V. N., Smola, A. J., and Kriegel, H.-P. Protein function prediction via graph kernels. Bioinformatics, 21:i47-i56, 06 2005. ISSN 1367-4803. +Chen, T., Kornblith, S., Norouzi, M., and Hinton, G. A simple framework for contrastive learning of visual representations. In International conference on machine learning, pp. 1597-1607. PMLR, 2020. +Debnath, A. K., Lopez de Compadre, R. L., Debnath, G., Shusterman, A. J., and Hansch, C. Structure-activity relationship of mutagenic aromatic and heteroaromatic nitro compounds correlation with molecular orbital energies and hydrophobicity. Journal of Medicinal Chemistry, 34 (2):786-797, 02 1991. +Devlin, J., Chang, M., Lee, K., and Toutanova, K. 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, pp. 4171-4186, 2019. +Dobson, P. D. and Doig, A. J. Distinguishing enzyme structures from non-enzymes without alignments. Journal of Molecular Biology, 330(4):771-783, 2003. ISSN 0022-2836. +Giles, C. L., Bollacker, K. D., and Lawrence, S. Cite-seer: An automatic citation indexing system. In Proceedings of the Third ACM Conference on Digital Libraries, pp. 89-98. Association for Computing Machinery, 1998. ISBN 0897919653. +Glorot, X. and Bengio, Y. Understanding the difficulty of training deep feedforward neural networks. In Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics, volume 9, pp. 249-256, 2010. +Grill, J.-B., Strub, F., Altché, F., Tallec, C., Richemond, P., Buchatskaya, E., Doersch, C., Avila Pires, B., Guo, Z., Gheshlaghi Azar, M., Piot, B., kavukcuoglu, k., Munos, R., and Valko, M. Bootstrap your own latent: A new approach to self-supervised learning. In Advances in + +Neural Information Processing Systems, volume 33, pp. 21271-21284, 2020. +Grover, A. and Leskovec, J. 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. +Hamilton, W., Ying, Z., and Leskovec, J. Inductive representation learning on large graphs. In Advances in Neural Information Processing Systems, pp. 1024-1034, 2017. +Hassani, K. and Khasahmadi, A. H. Contrastive multi-view representation learning on graphs. In International Conference on Machine Learning, pp. 4116-4126. PMLR, 2020. +He, K., Fan, H., Wu, Y., Xie, S., and Girshick, R. Momentum contrast for unsupervised visual representation learning. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 9729-9738, 2020. +Hjelm, R. D., Fedorov, A., Lavoie-Marchildon, S., Grewal, K., Bachman, P., Trischler, A., and Bengio, Y. Learning deep representations by mutual information estimation and maximization. In International Conference on Learning Representations, 2019. +Hu, W., Liu, B., Gomes, J., Zitnik, M., Liang, P., Pande, V., and Leskovec, J. Strategies for pre-training graph neural networks. In International Conference on Learning Representations, 2020. +Hwang, D., Park, J., Kwon, S., Kim, K., Ha, J.-W., and Kim, H. J. Self-supervised auxiliary learning with metapaths for heterogeneous graphs. In Advances in Neural Information Processing Systems, pp. 10294-10305, 2020. +Ioffe, S. and Szegedy, C. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In International conference on machine learning, pp. 448-456. PMLR, 2015. +Jiao, Y., Xiong, Y., Zhang, J., Zhang, Y., Zhang, T., and Zhu, Y. Sub-graph contrast for scalable self-supervised graph representation learning. In IEEE International Conference on Data Mining, pp. 222-231, 2020. +Jin, W., Derr, T., Liu, H., Wang, Y., Wang, S., Liu, Z., and Tang, J. Self-supervised learning on graphs: Deep insights and new direction. arXiv preprint arXiv:2006.10141, 2020. +Kim, D. and Oh, A. How to find your friendly neighborhood: Graph attention design with self-supervision. In International Conference on Learning Representations, 2021. + +Kingma, D. P. and Ba, J. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. +Kipf, T. N. and Welling, M. Variational graph auto-encoders. arXiv preprint arXiv:1611.07308, 2016. +Kipf, T. N. and Welling, M. Semi-supervised classification with graph convolutional networks. In International Conference on Learning Representations, 2017. +Laine, S., Karras, T., Lehtinen, J., and Aila, T. High-quality self-supervised deep image denoising. Advances in Neural Information Processing Systems, 32:6970-6980, 2019. +Liu, M., Luo, Y., Wang, L., Xie, Y., Yuan, H., Gui, S., Yu, H., Xu, Z., Zhang, J., Liu, Y., Yan, K., Liu, H., Fu, C., Oztekin, B. M., Zhang, X., and Ji, S. DIG: A turnkey library for diving into graph deep learning research. Journal of Machine Learning Research, 22(240):1-9, 2021a. URL http://jmlr.org/papers/v22/21-0343.html. +Liu, X., Zhang, F., Hou, Z., Mian, L., Wang, Z., Zhang, J., and Tang, J. Self-supervised learning: Generative or contrastive. IEEE Transactions on Knowledge and Data Engineering, 2021b. +McAuley, J., Targett, C., Shi, Q., and Van Den Hengel, A. 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. +McCallum, A. K., Nigam, K., Rennie, J., and Seymore, K. Automating the construction of internet portals with machine learning. Information Retrieval, 3(2):127-163, 2000. +Mikolov, T., Chen, K., Corrado, G., and Dean, J. Efficient estimation of word representations in vector space. In International Conference on Learning Representations, 2013a. +Mikolov, T., Sutskever, I., Chen, K., Corrado, G., and Dean, J. Distributed representations of words and phrases and their compositionality. In Advances in Neural Information Processing Systems, 2013b. +Morris, C., Kriege, N. M., Bause, F., Kersting, K., Mutzel, P., and Neumann, M. TUDataset: A collection of benchmark datasets for learning with graphs. In ICML 2020 Workshop on Graph Representation Learning and Beyond (GRL+ 2020), 2020. +Narayanan, A., Chandramohan, M., Venkatesan, R., Chen, L., Liu, Y., and Jaiswal, S. graph2vec: Learning distributed representations of graphs. arXiv preprint arXiv:1707.05005, 2017. + +Peng, Z., Huang, W., Luo, M., Zheng, Q., Rong, Y., Xu, T., and Huang, J. Graph representation learning via graphical mutual information maximization. In Proceedings of The Web Conference 2020, pp. 259-270, 2020. +Perozzi, B., Al-Rfou, R., and Skiena, S. Deepwalk: Online learning of social representations. In Proceedings of the 20th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 701-710, 2014a. +Perozzi, B., Al-Rfou, R., and Skiena, S. DeepWalk: Online learning of social representations. In Proceedings of the 20th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 701-710, 2014b. +Rong, Y., Bian, Y., Xu, T., Xie, W., Wei, Y., Huang, W., and Huang, J. Self-supervised graph transformer on largescale molecular data. Advances in Neural Information Processing Systems, pp. 12559-12571, 2020. +Saxe, A. M., Bansal, Y., Dapello, J., Advani, M., Kolchinsky, A., Tracey, B. D., and Cox, D. D. On the information bottleneck theory of deep learning. In International Conference on Learning Representations, 2018. +Sen, P., Namata, G., Bilgic, M., Getoor, L., Galligher, B., and Eliassi-Rad, T. Collective classification in network data. AI magazine, 29(3):93-93, 2008. +Shchur, O., Mumme, M., Bojchevski, A., and Gunnemann, S. Pitfalls of graph neural network evaluation. Relational Representation Learning Workshop, NeurIPS, 2018. +Shervashidze, N., Vishwanathan, S., Petri, T., Mehlhorn, K., and Borgwardt, K. Efficient graphlet kernels for large graph comparison. In Artificial intelligence and statistics, pp. 488-495. PMLR, 2009. +Shervashidze, N., Schweitzer, P., Van Leeuwen, E. J., Mehlhorn, K., and Borgwardt, K. M. Weisfeiler-Lehman graph kernels. Journal of Machine Learning Research, 12(9), 2011. +Sinha, A., Shen, Z., Song, Y., Ma, H., Eide, D., Hsu, B.-J., and Wang, K. An overview of microsoft academic service (mas) and applications. In Proceedings of the 24th International Conference on World Wide Web, pp. 243-246, 2015. +Sun, F.-Y., Hoffman, J., Verma, V., and Tang, J. Infograph: Unsupervised and semi-supervised graph-level representation learning via mutual information maximization. In International Conference on Learning Representations, 2019. + +Thakoor, S., Tallec, C., Azar, M. G., Munos, R., Velicković, P., and Valko, M. Bootstrapped representation learning on graphs. In ICLR 2021 Workshop on Geometrical and Topological Representation Learning, 2021. +Tishby, N. and Zaslavsky, N. Deep learning and the information bottleneck principle. In 2015 IEEE Information Theory Workshop (ITW), pp. 1-5. IEEE, 2015. +Tishby, N., Pereira, F. C., and Bialek, W. The information bottleneck method. In *The 37th annual Allerton Conference on Communication, Control, and Computing*, pp. 368-377, 1999. +Ulyanov, D., Vedaldi, A., and Lempitsky, V. Deep image prior. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 9446-9454, 2018. +Veličković, P., Fedus, W., Hamilton, W. L., Lio, P., Bengio, Y., and Hjelm, D. Deep graph infomax. In International Conference on Learning Representations, 2019. +Vincent, P., Larochelle, H., Lajoie, I., Bengio, Y., Manzagol, P.-A., and Bottou, L. Stacked denoising autoencoders: Learning useful representations in a deep network with a local denoising criterion. Journal of Machine Learning Research, 11(12), 2010. +Wale, N. and Karypis, G. Comparison of descriptor spaces for chemical compound retrieval and classification. In Sixth International Conference on Data Mining, pp. 678-689, 2006. +Wang, C., Pan, S., Long, G., Zhu, X., and Jiang, J. MGAE: Marginalized graph autoencoder for graph clustering. In Proceedings of the 2017 ACM on Conference on Information and Knowledge Management, pp. 889-898, 2017. +Wang, H., Wang, X., Xiong, W., Yu, M., Guo, X., Chang, S., and Wang, W. Y. Self-supervised learning for contextualized extractive summarization. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pp. 2221-2227, 2019. +Wei, C., Shen, K., Chen, Y., and Ma, T. Theoretical analysis of self-training with deep networks on unlabeled data. In International Conference on Learning Representations, 2021. +Wu, J., Wang, X., and Wang, W. Y. Self-supervised dialogue learning. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pp. 3857-3867, 2019. +Xie, J., Kelley, S., and Szymanski, B. K. Overlapping community detection in networks: The state-of-the-art and comparative study. ACM Computing Surveys (CSUR), 45(4):1-35, 2013. + +Xie, Y., Wang, Z., and Ji, S. Noise2Same: Optimizing a self-supervised bound for image denoising. In Proceedings of the 34th Annual Conference on Neural Information Processing Systems, pp. 20320-20330, 2020. +Xie, Y., Xu, Z., Zhang, J., Wang, Z., and Ji, S. Self-supervised learning of graph neural networks: A unified review. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2022. +Xu, K., Hu, W., Leskovec, J., and Jegelka, S. How powerful are graph neural networks? In International Conference on Learning Representations, 2019. +Yanardag, P. and Vishwanathan, S. Deep graph kernels. In Proceedings of the 21th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 1365-1374, 2015. +You, Y., Chen, T., Sui, Y., Chen, T., Wang, Z., and Shen, Y. Graph contrastive learning with augmentations. In Advances in Neural Information Processing Systems, volume 33, pp. 5812-5823, 2020. +Zbontar, J., Jing, L., Misra, I., LeCun, Y., and Deny, S. Barlow twins: Self-supervised learning via redundancy reduction. In International Conference on Machine Learning, pp. 12310-12320. PMLR, 2021. +Zeng, H., Zhou, H., Srivastava, A., Kannan, R., and Prasanna, V. GraphSAINT: Graph sampling based inductive learning method. In International Conference on Learning Representations, 2020. +Zhu, Y., Xu, Y., Yu, F., Liu, Q., Wu, S., and Wang, L. Deep graph contrastive representation learning. In ICML Workshop on Graph Representation Learning and Beyond, 2020. +Zhu, Y., Xu, Y., Yu, F., Liu, Q., Wu, S., and Wang, L. Graph contrastive learning with adaptive augmentation. In Proceedings of the Web Conference 2021, pp. 2069-2080, 2021. +Zitnik, M. and Leskovec, J. Predicting multicellular function through multi-layer tissue networks. *Bioinformatics*, 33 (14):i190-i198, 2017. + +# A. Proof of Theorem 1 + +Proof. We first derive the relationship between the supervised objective of latent graph prediction $\mathbb{E}\| f(\boldsymbol {A},\boldsymbol {X}) - \boldsymbol {F}\| ^2$ and the self-supervised reconstruction loss $\mathbb{E}\| f(\boldsymbol {A},\boldsymbol {X}) - \boldsymbol {X}\| ^2$ in the following equations, + +$$ +\begin{array}{l} \mathbb {E} \| f (\boldsymbol {A}, \boldsymbol {X}) - \boldsymbol {X} \| ^ {2} = \mathbb {E} \| (f (\boldsymbol {A}, \boldsymbol {X}) - \boldsymbol {F}) - (\boldsymbol {X} - \boldsymbol {F}) \| ^ {2} (16) \\ = \mathbb {E} \left[ \| f (\boldsymbol {A}, \boldsymbol {X}) - \boldsymbol {F} \| ^ {2} + \| \boldsymbol {X} - \boldsymbol {F} \| ^ {2} - 2 \langle f (\boldsymbol {A}, \boldsymbol {X}) - \boldsymbol {F}, \boldsymbol {X} - \boldsymbol {F} \rangle \right], (17) \\ \end{array} +$$ + +where $\langle \cdot, \cdot \rangle$ denotes the inner product along all dimensions $\{0, \dots, d|V| - 1\}$ . The expectation $\mathbb{E}\|f(\boldsymbol{A}, \boldsymbol{X})\|$ in the above equation is not relevant to the neural network $f$ . It hence can be considered as a constant during the optimization of $f$ . To derive an upper bound to $\mathbb{E}\|f(\boldsymbol{A}, \boldsymbol{X}) - \boldsymbol{F}\|^2$ , we only need to derive an upper bound of its equivalent $\mathbb{E}\|f(\boldsymbol{A}, \boldsymbol{X}) - \boldsymbol{X}\|^2 + 2\mathbb{E}\langle f(\boldsymbol{A}, \boldsymbol{X}) - \boldsymbol{F}, \boldsymbol{X} - \boldsymbol{F} \rangle$ . As $\boldsymbol{F}$ is unobserved, our goal is to derive an upper bound to eliminate the need of $\boldsymbol{F}$ for the inner product term $\langle f(\boldsymbol{A}, \boldsymbol{X}) - \boldsymbol{F}, \boldsymbol{X} - \boldsymbol{F} \rangle$ . To do so, we apply the definition of latent graph $\mathbb{E}[X|\boldsymbol{A}, \boldsymbol{F}] = \boldsymbol{F}$ and rewrite the inner product into the following form. + +$$ +\begin{array}{l} \mathbb {E} \langle f (\boldsymbol {A}, \boldsymbol {X}) - \boldsymbol {F}, \boldsymbol {X} - \boldsymbol {F} \rangle = \mathbb {E} _ {\boldsymbol {A}, \boldsymbol {F}} \mathbb {E} _ {\boldsymbol {X}} \left[ \sum_ {i} \left(f _ {i} (\boldsymbol {A}, \boldsymbol {X}) - \boldsymbol {F} _ {i}\right) \left(\boldsymbol {X} _ {i} - \boldsymbol {F} _ {i}\right) | \boldsymbol {A}, \boldsymbol {F} \right] (18) \\ = \sum_ {i} \mathbb {E} _ {\boldsymbol {A}, \boldsymbol {F}} \left[ \mathbb {E} \left[ \left(f _ {i} (\boldsymbol {A}, \boldsymbol {X}) - \boldsymbol {F} _ {i}\right) \left(\boldsymbol {X} _ {i} - \boldsymbol {F} _ {i}\right) | \boldsymbol {A}, \boldsymbol {F} \right] - \right. \\ \left. \mathbb {E} \left[ f _ {i} (\boldsymbol {A}, \boldsymbol {X}) - \boldsymbol {F} _ {i} | \boldsymbol {F} \right] \mathbb {E} \left[ \boldsymbol {X} _ {i} - \boldsymbol {F} _ {i} | \boldsymbol {A}, \boldsymbol {F} \right] \right] (19) \\ = \sum_ {i} \mathbb {E} _ {\boldsymbol {A}, \boldsymbol {F}} \left[ \operatorname {C o v} \left(f _ {i} (\boldsymbol {A}, \boldsymbol {X}) - \boldsymbol {F} _ {i}, \boldsymbol {X} _ {i} - \boldsymbol {F} _ {i} | \boldsymbol {A}, \boldsymbol {F}\right) \right] (20) \\ = \sum_ {i} \mathbb {E} _ {\boldsymbol {A}, \boldsymbol {F}} \left[ \operatorname {C o v} \left(f _ {i} (\boldsymbol {A}, \boldsymbol {X}), \boldsymbol {X} _ {i} | \boldsymbol {A}, \boldsymbol {F}\right) \right], (21) \\ \end{array} +$$ + +where $i$ sums over all dimensions $\{0, \dots, d|V| - 1\}$ , $f_{i}$ and $\mathbf{X}_{i}$ denotes the $i$ -th element of the flattened matrices. Note that we employ $\mathbb{E}[X - F|A, F] = \mathbf{0}$ to let Equation (17) hold, according to the definition of latent graphs. Letting $J$ be a uniformly sampled subset of all node indices $\{0, \dots, |V| - 1\}$ , the right hand side of the above equation satisfies + +$$ +\mathrm {R H S} = \mathbb {E} _ {J} \frac {| V |}{| J |} \sum_ {j \in J} \sum_ {k = 0} ^ {d - 1} \mathbb {E} _ {\boldsymbol {A}, \boldsymbol {F}} \left[ \operatorname {C o v} \left(f _ {j d + k} (\boldsymbol {A}, \boldsymbol {X}), \boldsymbol {X} _ {j d + k} | \boldsymbol {A}, \boldsymbol {F}\right) \right], \tag {22} +$$ + +where $f_{jd+k} \in \mathbb{R}$ and $X_{jd+k} \in \mathbb{R}$ denote the $(jd + k)$ -th element of corresponding matrices, i.e., the $k$ -th element of the node $v_j$ , whereas $X_J \in \mathbb{R}^{|J| \times d}$ denotes the feature matrix of nodes in $V_J$ . Given the bounded variance $\mathrm{Var}(X_i) \leq \sigma^2, \forall i$ , we bound the above term as + +$$ +\begin{array}{l} \mathrm {R H S} = \mathbb {E} _ {J} \frac {| V |}{| J |} \sum_ {j \in J, k} \mathbb {E} _ {\boldsymbol {A}, \boldsymbol {F}} \left[ \operatorname {C o v} \left(f _ {j d + k} (\boldsymbol {A}, \boldsymbol {X}) - f _ {j d + k} \left(\boldsymbol {A}, \boldsymbol {X} _ {J ^ {c}}\right), \boldsymbol {X} _ {j d + k} | \boldsymbol {A}, \boldsymbol {F}\right) \right] (23) \\ \leq \mathbb {E} _ {J} \frac {| V |}{| J |} \sum_ {j \in J, k} \mathbb {E} _ {\boldsymbol {A}, \boldsymbol {F}} \left[ \operatorname {V a r} \left(f _ {j d + k} (\boldsymbol {A}, \boldsymbol {X}) - f _ {j d + k} \left(\boldsymbol {A}, \boldsymbol {X} _ {J ^ {c}}\right) \mid \boldsymbol {A}, \boldsymbol {F}\right) \cdot \operatorname {V a r} \left(\boldsymbol {X} _ {j d + k}\right) \right] ^ {1 / 2} (24) \\ \leq | V | \mathbb {E} _ {J} \left(\frac {1}{| J |} \sum_ {j \in J, k} \mathbb {E} _ {\boldsymbol {A}, \boldsymbol {F}} \left[ \operatorname {V a r} \left(f _ {j d + k} (\boldsymbol {A}, \boldsymbol {X}) - f _ {j d + k} (\boldsymbol {A}, \boldsymbol {X} _ {J ^ {c}}) \mid \boldsymbol {A}, \boldsymbol {F}\right) \cdot \sigma^ {2} \right]\right) ^ {1 / 2} (25) \\ \leq \sigma | V | \mathbb {E} _ {J} \left(\frac {1}{| J |} \sum_ {j \in J, k} \mathbb {E} _ {\boldsymbol {A}, \boldsymbol {F}} \left[ \mathbb {E} \left[ \left[ f _ {j d + k} (\boldsymbol {A}, \boldsymbol {X}) - f _ {j d + k} (\boldsymbol {A}, \boldsymbol {X} _ {J ^ {c}}) \right] ^ {2} | \boldsymbol {A}, \boldsymbol {F} \right] \right]\right) ^ {1 / 2} (26) \\ = \sigma | V | \mathbb {E} _ {J} \left(\frac {1}{| J |} \sum_ {j \in J, k} \mathbb {E} \left[ f _ {j d + k} (\boldsymbol {A}, \boldsymbol {X}) - f _ {j d + k} \left(\boldsymbol {A}, \boldsymbol {X} _ {J ^ {c}}\right) \right] ^ {2}\right) ^ {1 / 2} (27) \\ = \sigma | V | \mathbb {E} _ {J} \left(\frac {1}{| J |} \mathbb {E} \| f _ {J} (\boldsymbol {A}, \boldsymbol {X}) - f _ {J} (\boldsymbol {A}, \boldsymbol {X} _ {J ^ {c}}) \| ^ {2}\right) ^ {1 / 2}. (28) \\ \end{array} +$$ + +Above inequalities and equations are derived based on the fact that $f_{J}(\mathbf{A},\mathbf{X}_{J^{c}})$ does not correlate to $\mathbf{X}_{jd + k}$ as $j\notin J^{c}$ for Equation (21), the Cauchy-Schwarz inequality for Inequality (22), and $(\mathbb{E}X)^2\leq \mathbb{E}X^2$ for Inequality (23). We complete the proof of Theorem 1 by combining Equation (15) and Inequality (26), + +$$ +\begin{array}{l} \mathbb {E} \left[ \| f (\boldsymbol {A}, \boldsymbol {X}) - \boldsymbol {F} \| ^ {2} + \| \boldsymbol {X} - \boldsymbol {F} \| ^ {2} \right] = \mathbb {E} \| f (\boldsymbol {A}, \boldsymbol {X}) - \boldsymbol {X} \| ^ {2} + 2 \langle f (\boldsymbol {A}, \boldsymbol {X}) - \boldsymbol {F}, \boldsymbol {X} - \boldsymbol {F} \rangle (29) \\ \leq \mathbb {E} \| f (\boldsymbol {A}, \boldsymbol {X}) - \boldsymbol {X} \| ^ {2} + 2 \sigma | V | \mathbb {E} _ {J} \left(\frac {1}{| J |} \mathbb {E} \| f _ {J} (\boldsymbol {A}, \boldsymbol {X}) - f _ {J} (\boldsymbol {A}, \boldsymbol {X} _ {J ^ {c}}) \| ^ {2}\right) ^ {1 / 2}. (30) \\ \end{array} +$$ + +![](images/aeb169ce77499d437e5dc319a8d8a6268b9abf6113c7731714ae65884d1434ce.jpg) + +# B. Proof of Corollary 1 and 2 + +Proof. We first prove Corollary 1. Consider an $\ell$ -Lipschitz continuous prediction head with respect to $l_{2}$ -norm consists of fully connected layers. We have + +$$ +\left\| f _ {J} (\boldsymbol {A}, \boldsymbol {X}) - f _ {J} (\boldsymbol {A}, \boldsymbol {X} _ {J ^ {c}}) \right\| _ {2} = \left\| \mathcal {D} \left(\boldsymbol {H} _ {J}\right) - \mathcal {D} \left(\boldsymbol {H} _ {J} ^ {\prime}\right) \right\| _ {2} \leq \ell \left\| \boldsymbol {H} _ {J} - \boldsymbol {H} _ {J} ^ {\prime} \right\| _ {2}. \tag {31} +$$ + +We therefore have the following inequality + +$$ +\mathbb {E} \left\| f _ {J} (\boldsymbol {A}, \boldsymbol {X}) - f _ {J} (\boldsymbol {A}, \boldsymbol {X} _ {J ^ {\circ}}) \right\| _ {2} ^ {2} \leq \mathbb {E} \left[ \ell^ {2} \left\| \boldsymbol {H} _ {J} - \boldsymbol {H} _ {J} ^ {\prime} \right\| _ {2} ^ {2} \right]. \tag {32} +$$ + +We apply the above inequality to Theorem 1 and obtain the following inequality + +$$ +\begin{array}{l} \mathbb {E} \big [ \| f (\boldsymbol {A}, \boldsymbol {X}) - \boldsymbol {F} \| ^ {2} + \| \boldsymbol {X} - \boldsymbol {F} \| ^ {2} \big ] \\ \leq \mathbb {E} \| f (\boldsymbol {A}, \boldsymbol {X}) - \boldsymbol {X} \| ^ {2} + 2 \sigma | V | \mathbb {E} _ {J} \left(\frac {1}{| J |} \mathbb {E} \| f _ {J} (\boldsymbol {A}, \boldsymbol {X}) - f _ {J} (\boldsymbol {A}, \boldsymbol {X} _ {J ^ {c}}) \| ^ {2}\right) ^ {1 / 2} (33) \\ \leq \mathbb {E} \| f (\boldsymbol {A}, \boldsymbol {X}) - \boldsymbol {X} \| ^ {2} + 2 \sigma | V | \mathbb {E} _ {J} \left(\frac {1}{| J |} \mathbb {E} \left[ \ell^ {2} \| \boldsymbol {H} _ {J} - \boldsymbol {H} _ {J} ^ {\prime} \| _ {2} ^ {2} \right]\right) ^ {1 / 2} (34) \\ = \mathbb {E} \| f (\boldsymbol {A}, \boldsymbol {X}) - \boldsymbol {X} \| ^ {2} + 2 \sigma | V | \ell \mathbb {E} _ {J} \left(\mathbb {E} \| \boldsymbol {H} _ {J} - \boldsymbol {H} _ {J} ^ {\prime} \| _ {2} ^ {2} / | J |\right) ^ {1 / 2}, (35) \\ \end{array} +$$ + +which completes the proof of Corollay 1. + +Similarly, for Corollay 2, we have + +$$ +\left\| f _ {J} (\boldsymbol {A}, \boldsymbol {X}) - f _ {J} (\boldsymbol {A}, \boldsymbol {X} _ {J ^ {\mathrm {c}}}) \right\| _ {2} = \left\| \mathcal {D} \left(\boldsymbol {H} _ {J}\right) - \mathcal {D} \left(\boldsymbol {H} _ {J} ^ {\prime}\right) \right\| _ {2} \leq \ell \left\| \boldsymbol {H} _ {J} - \boldsymbol {H} _ {J} ^ {\prime} \right\| _ {2}. \tag {36} +$$ + +Given an $\ell_r$ -Bilipschitz continuous readout function $\mathcal{R}$ , the following inequalities hold, + +$$ +\frac {1}{\ell_ {r}} \left\| \boldsymbol {H} _ {J} - \boldsymbol {H} _ {J} ^ {\prime} \right\| _ {2} \leq \left\| \mathcal {R} \left(\boldsymbol {H} _ {J}\right) - \mathcal {R} \left(\boldsymbol {H} _ {J} ^ {\prime}\right) \right\| _ {2} \leq \ell_ {r} \left\| \boldsymbol {H} _ {J} - \boldsymbol {H} _ {J} ^ {\prime} \right\| _ {2}. \tag {37} +$$ + +We therefore have + +$$ +\begin{array}{l} \mathbb {E} \left[ \| f (\boldsymbol {A}, \boldsymbol {X}) - \boldsymbol {F} \| ^ {2} + \| \boldsymbol {X} - \boldsymbol {F} \| ^ {2} \right] \\ \leq \mathbb {E} \| f (\boldsymbol {A}, \boldsymbol {X}) - \boldsymbol {X} \| ^ {2} + 2 \sigma | V | \ell \mathbb {E} _ {J} \left(\mathbb {E} \| \boldsymbol {H} _ {J} - \boldsymbol {H} _ {J} ^ {\prime} \| _ {2} ^ {2} / | J |\right) ^ {1 / 2} (38) \\ \leq \mathbb {E} \| f (\boldsymbol {A}, \boldsymbol {X}) - \boldsymbol {X} \| ^ {2} + 2 \sigma | V | \ell \ell_ {r} \mathbb {E} _ {J} \left(\mathbb {E} \| \mathcal {R} \left(\boldsymbol {H} _ {J}\right) - \mathcal {R} \left(\boldsymbol {H} _ {J} ^ {\prime}\right) \| _ {2} ^ {2} / | J |\right) ^ {1 / 2} (39) \\ = \mathbb {E} \| f (\boldsymbol {A}, \boldsymbol {X}) - \boldsymbol {X} \| ^ {2} + 2 \sigma | V | k \ell \mathbb {E} _ {J} \left(\mathbb {E} \| \boldsymbol {z} - \boldsymbol {z} ^ {\prime} \| _ {2} ^ {2} / | J |\right) ^ {1 / 2}, (40) \\ \end{array} +$$ + +which completes the proof of Corollay 2. + +![](images/721cb4370a1a74d10fae0aefa26941d7ce7e44eb1995368220c8da1c42627b6e.jpg) + +# C. Experiment Settings and Model Configurations + +Dataset Statistics. Statistics including number of graphs, averaged number of nodes, averaged number of edges, and node attribute dimensions are summarized in Table 4. + +Table 4. Summary and statistics of common graph datasets for self-supervised learning. + +
DatasetsEvaluation task# graphsAvg. nodesAvg. edges# features
NCI1411029.8732.3037
PROTEINS117839.0672.823
DD188284.32715.6689
MUTAGGraph-level classification111317.9319.797
COLLAB500074.492457.781
RDT-B2000429.63497.751
RDT-M5K4999508.52594.871
IMDB-B100019.7796.531
Amazon Computer113,752245,861767
Amazon PhotosTransductive17,650119,081745
Node-level classification181,89481,8946,806
Coauthor CS1247,962247,9628,415
Coauthor Physics1
PPIInductive242,37334,13350
FlickrNode-level189,250899,756500
Redditclassification1232,96511,606,919602
+ +Models for Graph-Level Datasets. We employ a 3-layer GIN (Xu et al., 2019) as the graph encoder $\mathcal{E}$ , and a 2-layer MLP as the decoder $\mathcal{D}$ . Following GraphCL (You et al., 2020), we use a hidden dimension of size 32 and concatenate the embedding at each encoding layer to obtain the final representation. To fulfill the conditions in Corollary 2, we apply global sum pooling as the readout function $\mathcal{R}$ . The obtained graph representation is then taken by a SVM classifier with a 10-fold evaluation. For graph datasets that do not come with node attributes, we apply the one-hot vector of the degree for each node as the node attributes so that the node degrees are reconstructed. Certain thresholds for max degrees are applied to reduce computational cost and avoid over sparse node features. The neural network is trained using the loss described in Equation (6). We mask all attributes of the sampled nodes with Gaussian noise. Detailed training configurations including mask ratio, the standard deviation of noise, weight scalar $\alpha'$ , and threshold for max degrees are shown in Table 5. Note that we do not include carefully designed implementation mechanisms by BGRL, such as stop gradients, EMA, and batch normalization at the last layer. + +Models for Node-Level Datasets. For node-level datasets, we employ a 2-layer GCN (Kipf & Welling, 2017) as the graph encoder $\mathcal{E}$ , and a linear layer or an MLP as the decoder $\mathcal{D}$ . We use a hidden dimension of size 512 at each encoding layer. The neural network is trained using the loss described in Equation (3). We uniformly employ the weight scalar $\alpha'$ of 2 as we observed that the model performance is not sensitive to the selection of $\alpha'$ within the range [1, 100]. We obtain the final node representation by concatenating the original feature with the embedding from the last layer of the encoder. The intuition of this is based on the Bayesian rule where the learned encoder provides the prior knowledge (Ulyanov et al., 2018) of data distribution whereas the given graph data serves as the observed samples. And the posteriori should be based on a combination of the priori (encoder output) and the observed data itself (Laine et al., 2019). Node representation is then taken by a logistic regression classifier that is trained using the cross-entropy (CE) loss with a learning rate of 0.01. Detailed training configurations including mask ratio, the standard deviation of noise, number of encoder and decoder layers, learning rate and weight decay of the graph neural network, training epochs, and weight decay of the logistic regression classifier are shown in Table 6. To split train, valid and test sets, we use the public split used in (Shchur et al., 2018) for Coauthor and Amazon, (Zitnik & Leskovec, 2017; Hamilton et al., 2017; Zeng et al., 2020) for PPI, Reddit and Flickr provided by PyTorch Geometric. Note that we do not include implementation mechanisms by BGRL, such as stop gradients, EMA, and batch normalization at the last layer. + +Table 6. Model configurations for node-level datasets. + +
Am.ComputersAmPhotosCoauthorCSCoauthorPhyPPIFlickrReddit
Mask ratio0.050.050.050.050.050.010.05
Noise SD0.50.50.0050.50.50.50.5
Decoder layers1112222
Learning rate10-410-510-310-310-310-410-3
Weight decay010-40010-500
LogReg epochs400400400300200200500
LogReg WD10-310-310-310-3010-310-3
+ +# D. Experimental Results under Semi-supervised Setting + +For graph-level datasets, we perform semi-supervised experiments with $10\%$ label rate using both GIN and GCN. All experiments are conducted with the same random seed to avoid randomness in data split and initialization. Under the setting of random initialization followed by supervised learning, the GNN is randomly initialized without pre-training. Under the setting of LaGraph followed by supervised learning, the GNN is pre-trained with the proposed LaGraph framework. Weights of GNNs are fine-tuned during supervised learning with $10\%$ labels. For each dataset, the learning rate and epoch number for pre-training are the same as what we use under an unsupervised setting. For fine-tuning, learning rate is selected from $\{10^{-3}, 10^{-4}, 10^{-5}\}$ , and epoch number is selected from $\{5, 10, 15, 20\}$ . The results shown in Table 7 and Table 8 indicate that our proposed LaGraph framework is also effective for semi-supervised learning with different GNN backbones. + +Table 7. GIN results for Semi-supervised learning. + +
NCI1PROTEINSDDMUTAGCOLLABRDT-BRDT-M5KIMDB-B
Rand. Init. + 10% supervised76.6775.2976.6686.6777.5485.4556.0372.70
LaGraph + 10% supervised80.1976.1077.9391.4078.0489.6556.4374.30
+ +Table 8. GCN results for Semi-supervised learning. + +
NCI1PROTEINSDDMUTAGCOLLABRDT-BRDT-M5KIMDB-B
Rand. Init. + 10% supervised75.4774.4877.3384.5979.0285.3053.6772.90
LaGraph + 10% supervised78.1876.2878.8685.1280.1290.3555.3375.10
+ +# E. Additional Ablation Studies. + +Ablation on Optimizing Different Objectives. We empirically compare the effect of different upper bounds on graph-level datasets. In addition to the objectives described in Corollary 2, we further train the graph encoder with the upper bound described in Theorem 1, which applies invariance regularization on the reconstructed node features. In addition, as node attributes in many graph-level datasets are formed as one-hot vectors of the node type, we also provide the results of using two corresponding multinomial versions of the objective. In particular, we replace the reconstruction term by the cross-entropy between $f(\mathbf{A}, \mathbf{X})$ and $\mathbf{X}$ and, if computed on the outputs, the invariance term by the KL-divergence between $f_J(\mathbf{A}, \mathbf{X})$ and $f_J(\mathbf{A}, \mathbf{X}_{J^c})$ . Note that the multinomial versions are no longer strictly upper bounds of supervised latent graph prediction. In Table 9, we show the results obtained under the four objectives above, namely, to compute invariance on on-embedding (MSE-Embed), on-output (MSE-Output), and their corresponding multinomial versions (CE-Embed and + +Table 5. Model configurations for graph-level datasets. + +
NCI1PROTEINSDDMUTAGCOLLABRDT-BRDT-M5KIMDB-B
Mask ratio0.050.30.10.050.050.050.050.05
Noise SD0.520.50.50.50.50.50.5
Weight scalar α'101101010101010
Degree threshold----128--64
Learning rate10-510-510-510-510-410-310-410-4
+ +CE-Output), respectively. Results indicate that there is no significant difference among the four versions on most datasets, while MSE-Embed and CE-Embed generally tend to be more stable and achieve higher performance on MUTAG, RDT-B, and RDT-M5K. + +Table 9. Effect of training with different objectives on graph-level datasets. + +
NCI1PROTEINSDDMUTAGCOLLABRDT-BRDT-M5KIMDB-B
MSE-Embed79.9±0.575.2±0.378.1±0.390.2±1.377.6±0.190.4±0.956.4±0.273.7±0.7
MSE-Output79.9±0.775.0±0.478.1±0.889.2±2.177.7±0.189.8±0.956.0±0.473.4±0.6
CE-Embed79.9±0.575.2±0.378.1±0.490.1±1.077.6±0.290.5±1.356.3±0.473.7±0.7
CE-Output79.9±0.775.2±0.478.1±0.489.3±2.777.6±0.189.4±1.855.7±0.273.5±0.5
+ +Ablation on Concatenated Representations for Node-Level Datasets. For the node-level datasets, We obtain the final node representation by concatenating the original feature with the embedding from the last layer of the encoder, due to the intuition discussed in Appendix C. Results in Table 10 compare the performance of representations with or without concatenations. The removal of the concatenation leads to reduced performance on four of the seven datasets and performance gain on the rest datasets including the most challenging PPI. The results indicate that the concatenation generally positively contributes to the final performance. However, the conclusion still holds that, on node-level datasets, LaGraph can provide significant performance gain on challenging datasets where there is a gap between SSL and supervised performance. Meanwhile, the performance of LaGraph is on par with the performance of supervised learning and the SOTA method BGRL on datasets that are less challenging. + +Table 10. Effect of performing concatenation with node features. + +
DatasetAm. Comp.Am. Pht.Co. CSCo. PhyPPIFlickrReddit
With concat88.0±0.393.5±0.493.3±0.295.8±0.174.6±0.051.3±0.195.2±0.0
W/o concat88.8±0.392.7±0.492.6±0.295.3±0.175.2±0.051.6±0.194.8±0.0
+ +# F. Additional Discussion on Potential Limitations and Future directions + +In this section, we discuss several limitations of the proposed method and their solutions or related future directions. + +Performance comparison with BGRL on transductive tasks. From the experimental perspective, we admit that BGRL is a quite strong baseline method for transductive tasks. As the results are already on the same level as the performance of supervised training, it is very difficult to further obtain significant improvements. However, when it comes to inductive tasks, where there is still a significant gap between the performance of BGRL and supervised learning, our method is able to bring significant improvements in performance. Therefore, we argue that the non-significant performance boost on some transductive datasets does not degrade our main conclusion about the effectiveness of our method and the contribution of our work. + +Unattributed graphs. Although, in this work, we mainly focus on graphs with attributed nodes, there exist cases where the nodes are unattributed and all information is contained in the graph topology, especially for some graph-level datasets. In such cases, we follow a common solution to consider the one-hot vectors of node degrees as the node attributes and our objective performs reconstruction on the node degree. To avoid inconsistency between training and testing graphs in their range of degrees, we introduce thresholds to the node degrees, i.e., the degree of a node is considered as $k$ if it exceeds $k$ . The current solution can capture the topological information of a graph to some degree. However, there can be better solutions capturing full topological information of graphs. A potential direction is to perform connectivity reconstruction with the invariance of representations to the changing in the input edge set. Although the described approach does not currently fit into our theoretical framework, it is possible to derive similar objectives (e.g., upper bound to link prediction objective) following a similar idea. + +Scaling-up issue. The scaling-up of graph neural networks becomes an emerging topic. Many existing self-supervised methods may suffer from the scaling-up issue when the graph scales up to billions of nodes and edges. Although we do not perform experimental studies on extremely large graphs, we perform ablation studies to demonstrate the robustness of our method to the training schemes of sampling subgraphs (mini-batches of nodes) for each training iteration. + +Performance of SSL methods on unsupervised downstream tasks. Performing linear evaluation with supervised downstream tasks on learned representations is the most common way to evaluate the performance of SSL methods. However, evaluation performance on graph-specific unsupervised tasks such as overlapping community detection (Xie et al., 2013) is seldom studied. Further investigations in the unsupervised downstream task are required to fully demonstrate the effectiveness of self-supervised learning methods. \ No newline at end of file diff --git a/selfsupervisedrepresentationlearningvialatentgraphprediction/images.zip b/selfsupervisedrepresentationlearningvialatentgraphprediction/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..e21908049a6e35abbb841ca8216781716fc29268 --- /dev/null +++ b/selfsupervisedrepresentationlearningvialatentgraphprediction/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c01de1605a8e1a8fc268fbbd0d965abe9cfc1bf68d4f49b8a1855885bdaea8b5 +size 1015095 diff --git a/selfsupervisedrepresentationlearningvialatentgraphprediction/layout.json b/selfsupervisedrepresentationlearningvialatentgraphprediction/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..b8af3dcd1410b74351be6ae593b00c60cb5a3b99 --- /dev/null +++ b/selfsupervisedrepresentationlearningvialatentgraphprediction/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9da708510146ed8a6c6423e3f041a55f0b663d2acd27ae7d92690089d782c1a7 +size 700117 diff --git a/sellingdatatoamachinelearnerpricingviacostlysignaling/954fdc56-f598-44d7-9eff-aa4945339adb_content_list.json b/sellingdatatoamachinelearnerpricingviacostlysignaling/954fdc56-f598-44d7-9eff-aa4945339adb_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..da239e3c733eed0570b5e26ba40cb5bb8861a8de --- /dev/null +++ b/sellingdatatoamachinelearnerpricingviacostlysignaling/954fdc56-f598-44d7-9eff-aa4945339adb_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e7fca82323c5d361fb227a7ac8dbda339ccd5576ef43ec975506a8763df3e0fb +size 177013 diff --git a/sellingdatatoamachinelearnerpricingviacostlysignaling/954fdc56-f598-44d7-9eff-aa4945339adb_model.json b/sellingdatatoamachinelearnerpricingviacostlysignaling/954fdc56-f598-44d7-9eff-aa4945339adb_model.json new file mode 100644 index 0000000000000000000000000000000000000000..27dc35e28e6b6849793a04de8ee5bf1e759821ae --- /dev/null +++ b/sellingdatatoamachinelearnerpricingviacostlysignaling/954fdc56-f598-44d7-9eff-aa4945339adb_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:348bd9a97768f72fe9d1ca63a7567da7d44f624236a63bfabdae188a65349261 +size 202531 diff --git a/sellingdatatoamachinelearnerpricingviacostlysignaling/954fdc56-f598-44d7-9eff-aa4945339adb_origin.pdf b/sellingdatatoamachinelearnerpricingviacostlysignaling/954fdc56-f598-44d7-9eff-aa4945339adb_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..6049447eb16b04984e018d701ad28c42ccb21fbc --- /dev/null +++ b/sellingdatatoamachinelearnerpricingviacostlysignaling/954fdc56-f598-44d7-9eff-aa4945339adb_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:97c926e0ba1e956ee51a064181fc31c2b5ac0c5c0359bd74705e1cfb0b744e18 +size 950651 diff --git a/sellingdatatoamachinelearnerpricingviacostlysignaling/full.md b/sellingdatatoamachinelearnerpricingviacostlysignaling/full.md new file mode 100644 index 0000000000000000000000000000000000000000..cfbe349a2f2803e2fa4fe50745bd0c3f30c4aec6 --- /dev/null +++ b/sellingdatatoamachinelearnerpricingviacostlysignaling/full.md @@ -0,0 +1,817 @@ +# Selling Data To a Machine Learner: Pricing via Costly Signaling + +Junjie Chen\*1 Minming Li\*1 Haifeng Xu\*2 + +# Abstract + +We consider a new problem of selling data to a machine learner who looks to purchase data to train his machine learning model. A key challenge in this setup is that neither the seller nor the machine learner knows the true quality of data. When designing a revenue-maximizing mechanism, a data seller faces the tradeoff between the cost and precision of data quality estimation. To address this challenge, we study a natural class of mechanisms that price data via costly signaling. Motivated by the assumption of i.i.d. data points as in classic machine learning models, we first consider selling homogeneous data and derive an optimal selling mechanism. We then turn to the sale of heterogeneous data, motivated by the sale of multiple data sets, and show that 1) on the negative side, it is NP-hard to approximate the optimal mechanism within a constant ratio $\frac{e}{e+1} + o(1)$ ; while 2) on the positive side, there is a $\frac{1}{k}$ -approximate algorithm, where $k$ is the number of the machine learner's private types. + +# 1. Introduction + +Last decade has witnessed rapid advances made in machine learning (ML), especially the deep learning field (Pouyanfar et al., 2018). The key factor driving these breakthroughs is the explosive growth of data over the Internet. Nowadays, from startups to giant companies like Microsoft and Alibaba, industries deploy trained ML models to their business operations and realize that relevant training data of good quality play a vital role in obtaining good performance of these models. As data now are becoming increasingly valuable, a + +$^{*}\alpha-\beta$ order $^{1}$ Department of Computer Science, City University of Hong Kong, Hong Kong, China $^{2}$ Department of Computer Science, University of Chicago, Chicago, Illinois, USA (work done while this author is at UVA). Correspondence to: Junjie Chen , Minming Li , Haifeng Xu . + +Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s). + +new type of economy, i.e., data economy, is receiving more attention (Mehta et al., 2019; Bergemann et al., 2019). + +Given the importance of data for machine learning nowadays, we take the first step to study a new data selling scenario: a seller (she) sells data to a machine learner (he), i.e., a buyer who would like to purchase data to train his ML model. It is worth pointing out that selling data is a problem different from selling items in the traditional auction model, in which items are usually indivisible. As pointed out by previous works (Agarwal et al., 2019; Babaioff et al., 2012), several key properties make the sale of data crucially different from the sale of physical goods: + +- Ex ante unverifiable: It is hard to verify beforehand whether the data is suitable for training an ML model or not (Agarwal et al., 2019). In practice, even trained on the same data, two models of different design can yield different performances. It is typical that the true performance (i.e., the usefulness of data) of the ML model can be revealed only after deploying (possibly some portion of) data into the ML model for training. + +- Free duplication: Data can be freely duplicated with negligible marginal cost. Therefore, once a machine learner accesses some portion of the data (e.g., to partially verify its quality), the value of these data is immediately lost since the learner can keep a copy of that portion of data. + +Challenges. The above two properties post new challenges to the mechanism design of selling data to a machine learner. The ex ante unverifiable property implies that the usefulness of data (i.e., quality of data) depends on both the ML model design and the data set (e.g., size, distribution), which are controlled by the learner and the seller respectively. Therefore, neither the seller nor the learner knows the true quality of data in advance, due to i) The machine learner cannot access the seller's data due to the seller's concern of free duplication and thus cannot evaluate the true quality of data beforehand due to the ex ante unverifiable property; ii) The data seller cannot access the learner's model (typically due to business secrecy) and thus cannot evaluate the quality of data either. This intriguing situation makes our problem fundamentally different from the recent line of work on information selling (Liu et al., 2021; Babaioff et al., 2012; + +Chen et al., 2020; Cai & Velegkas, 2021), in which the seller is assumed to have access to the state of the nature, i.e., the quality of the data. + +To tackle the above challenges, we employ ideas from signaling (Kamenica & Gentzkow, 2011; Dughmi, 2017), and propose Data Pricing via Costly Signaling, so that communication is allowed between the seller and the machine learner. The proposed Pricing via Costly Signaling scheme consists of two steps: + +- Costly signaling step: The seller gives away a subset of data to the learner for training the model. Both the seller and buyer then simultaneously learn a preliminary model accuracy, based on which they can update their belief about the underlying data quality. We view this preliminary accuracy as an informative and random signal of the true data quality. Notably, such informative signals can only be generated by giving away a subset of data, which immediately loses its sales value and thus reduces the available amount of data for sale. This is why it is costly signaling for the seller. +- Pricing step: Based on the observed preliminary accuracy and the amount of data given away, the seller prices the remaining data to maximize her revenue. + +It is important to note that both parties will be able to observe preliminary outcome since each party provides essential components for the training, i.e., the partial data and the model respectively. + +Two key challenges arise in the design of Pricing via Costly Signaling. Firstly, the critical part of the design is to determine the subset of data to be shared, which should balance the loss of sales value and estimation of quality. If the shared subset reveals a poor accuracy leading to poor estimation of the quality of data, the machine learner may be reluctant to pay a high price. If the shared subset reveals a high accuracy, the seller will suffer a severe loss of sales value leading to low revenue. Secondly, solving the Pricing via Costly Signaling scheme turns out to be quite challenging. Although we make use of the concept of signaling, the signaling scheme in our setup is different from previous ones in a crucial way. Traditional signaling schemes allow the sender to design signals arbitrarily correlated with the state of nature. Such signaling schemes are "smooth" so that they form a polytope conveniently characterized by linear constraints. However, in our proposed scheme, the seller cannot reveal arbitrary signals but instead is constrained to only give away a subset of data for sharing. This gives rise to a combinatorial signaling space with exponentially many choices because different subsets may introduce a different distribution from which the signal (i.e., the preliminary accuracy) is sampled. + +Results and Techniques. We consider the problem under two different situations: homogeneous data and heterogeneous data. On one hand, the reason for considering homogeneous data is that in typical ML models, data points are usually assumed to be independent and identically distributed (i.i.d.) (Bishop, 2006). On the other hand, the sale of heterogeneous data is motivated by selling multiple different data sets, each viewed as a data "point". For instance, in a typical ML setting, features of data are heterogeneous since each feature describes one aspect of data and contains different amount of information. Therefore, the problem of selling features can be viewed as a problem of selling heterogeneous data. + +In the case of homogeneous data, we assume that the model's performance (i.e., accuracy) depends on both the quality and the quantity of data. After sharing some amount of data, the optimal price for the remaining data is determined by a posted price mechanism, in which the price is dependent on the machine learner's private type. Interestingly, we observe that when the valuation function has certain separable forms, the optimal mechanism is to sell the entire data set without the need of costly signaling at the first. The key insight revealed in our proof is that with separable-form valuation functions, the effects of the private type and the quantity of data on the revenue can be "decoupled", leading to a more tractable design problem. In addition, we study the mechanism design for the case where the two parties may hold different prior beliefs over the quality, due to different perceptions about the data quality before the trade. We show a revenue smoothness type of result with respect to the prior difference; that is, even the seller may mis-perceive the learner's true prior belief, her revenue will not suffer much as long as their priors do not differ much. + +Next, we move to the problem of selling heterogeneous data (e.g., the sales of features). This deviation from the homogeneous case turns out to lead to a much more difficult optimization task. Specifically, while the homogeneous case is polynomial solvable, we prove that it is NP-hard to obtain a $\frac{e}{1 + e} + o(1)$ approximation for the heterogeneous case. Our proof is through a reduction from an interesting and novel combinatorial problem, which we coined as Column Subset Selection and may be of independent interest. Finally, we can obtain a simple approximation algorithm for this problem which directly sells the entire dataset without communications, whose approximation ratio depends on the number of the learner's private types. + +Related Works. The two recent works most relevant to ours are the data marketplace design (Agarwal et al., 2019) and the model-based pricing (Chen et al., 2019) for ML models. (Agarwal et al., 2019) designed a data marketplace where multiple sellers supply data for sale and multiple + +buyers come with their own ML models dynamically. (Chen et al., 2019) proposed a model-based pricing market where a trained ML model is sold, depending on the buyer's interest. Both of them assume that the marketplace or the seller can access both the ML model and data. However, in our model, the seller does not know the ML model and has to offer a small amount of data at some cost to the buyer in order to learn the buyer's ML model properties. Our work is also related to the sale of information, which can be partially revealed through signaling schemes. As far as we know, (Babaioff et al., 2012) is the first to study this problem computationally, followed by a series of recent works (Chen et al., 2020; Liu et al., 2021; Cai & Velegkas, 2021). Within this line of research, the most relevant to ours is (Zheng & Chen, 2021); they also consider a two-round mechanism, which reveals some partial information for free first to change the buyer's belief and then sell all the information at some price. The key difference between our work and this literature of selling information is that the way our seller can signal information is significantly and realistically constrained — the seller in our model can only reveal a subset of data points to signal the quality of the data. A few other works examines issues such as buyer externalities on data marketplaces (Mehta et al., 2019; Agarwal et al., 2020). Such externality does not present in our basic model since we consider the sale of data to only one machine learner. Finally, our research is also related to signaling, also known as persuasion or information design (Kamenica & Gentzkow, 2011; Dughmi & Xu, 2019; 2017), during which the sender sends a signal to receivers in order to influence receivers' decisions. + +# 2. Preliminaries + +In this paper, we assume that there is a monopoly seller who privately holds a data set $\mathcal{D}$ for sale, and a machine learner who would like to purchase $\mathcal{D}$ to train his private ML model. As we discussed in Section 1, the usefulness of data, measured with the quality of data $q$ , is known to neither the seller nor the machine learner at the beginning of sales process, i.e., no one knows more than the other about $q$ . Hence, following the standard assumption in information design (Kamenica & Gentzkow, 2011; Dughmi, 2017), we assume that the seller and the learner share the same prior belief $\mu(q)$ , which is commonly known. This is reasonable because in practice, the seller and the machine learner may use publicly available resources (e.g., public available ML models on the Internet for similar task and the description of the dataset) to estimate the $q$ . Later in Section 3.2, we will look at the robust mechanism design where two parties may privately hold different prior beliefs. + +Throughout the paper, we use $\mathcal{D}$ to represent a set of "data point"s for sale. The reader may also interpret each data + +![](images/519035c58e06a4f00c62b146b786945450744c77b786bc5bcf0ca94589dc0887.jpg) +Figure 1. The whole selling process. + +point $\mathcal{D}$ as a set of data or a feature. The whole selling process is depicted in Figure 1. Firstly, to persuade the machine learner to pay higher price to purchase and get a better estimation of data quality $q$ , the seller shares with the learner a subset of the data points for free trial. We denote this subset of data points as $\mathcal{T} \subseteq \mathcal{D}$ . With the set $\mathcal{T}$ of data points provided, the machine learner can train his ML model which then outputs a preliminary model accuracy $r_s$ , that can be simultaneously observed by the two parties. Importantly, to observe the model accuracy and consequently the learner's utility, the seller does not need to know the learner's model details but only needs to observe the predictions on the testing data which typically is public. It is natural to assume that the seller has the right to observe these predictions, which are all she needs to calculate the preliminary accuracy $r_s$ . After that, the seller posts a price $p_{r_s,\mathcal{T}}$ for the remainder of the data. Depending on the subset $\mathcal{T}$ shared and the observed accuracy $r_s$ , the price $p_{r_s,\mathcal{T}}$ varies. Conditioning on the posted price $p_{r_s,\mathcal{T}}$ , the machine learner determines whether to pay the price to purchase the remainder of data or decline the offer. + +(Lei et al., 2019) shows that the model accuracy depends on the design of the neural network (i.e., the ML model) and the training data (e.g., the size of training set or the matching degree between distributions of training and testing set), both of which are captured by our defined $q$ . We abstract such correlation and assume there exists a commonly known distribution $\lambda(r|q, \mathcal{T})$ for accuracy $r$ depending on the data quality $q$ and the set $\mathcal{T}$ of data points. In the homogeneous case where two sets are considered the same as long as they contain the same number of data points, there are only a polynomial number of different distributions $\lambda(r|q, \mathcal{T})$ because $\mathcal{D}$ has a polynomial number of data points. However, in the heterogeneous case, the exponential number of choices of subset $\mathcal{T}$ may lead to exponential number of different distributions. We assume $\lambda(r = 0|q, \emptyset) = 1$ if $\mathcal{T} = \emptyset$ . $q$ is discrete and finite. + +The machine learner has a commonly known non-negative + +valuation function $u(r, b)$ dependent on both the model's accuracy $r$ and his private type $b$ . The private type $b$ abstracts the private information the learner holds, e.g., the unit price that he would pay for one percent accuracy. We assume $b$ is discrete and finite, and follows a commonly known distribution $\varphi(b)$ . $u(r, b)$ is non-decreasing in $r$ and $b$ . We assume $\forall b, u(0, b) = 0$ if accuracy $r = 0$ . + +After observing accuracy $r_s$ , the seller and the learner update the estimation of $q$ with Bayes rule + +$$ +\Pr \left(q \mid r _ {s}, \mathcal {T}\right) = \frac {\lambda \left(r _ {s} \mid q , \mathcal {T}\right) \mu (q)}{\sum_ {q} \lambda \left(r _ {s} \mid q , \mathcal {T}\right) \mu (q)}. \tag {1} +$$ + +Given the whole set of data points $\mathcal{D}$ for training, the model accuracy $r_m$ is inferred by $\sum_q \lambda(r_m | q, \mathcal{D}) \mathbf{Pr}(q | r_s, \mathcal{T})$ . Then the learner's expected utility obtained from the whole set $\mathcal{D}$ , given the private type $b$ , is computed as + +$$ +\begin{array}{l} \mathbb {E} [ u (r _ {m}, b) | r _ {s}, \mathcal {T}, \mathcal {D} ] \\ = \sum_ {r _ {m}} u (r _ {m}, b) \sum_ {q} \lambda (r _ {m} | q, \mathcal {D}) \Pr (q | r _ {s}, \mathcal {T}). \tag {2} \\ \end{array} +$$ + +After sharing set $\mathcal{T}$ of data points, the seller will immediately lose some amount of sales value, due to the free duplication property. The remaining utility is computed as + +$$ +G (r _ {s}, \mathcal {T}, b) = \mathbb {E} [ u (r _ {m}, b) | r _ {s}, \mathcal {T}, \mathcal {D} ] - u (r _ {s}, b). \tag {3} +$$ + +The learner pays the price to purchase only if his expected remaining utility $G(r_s, \mathcal{T}, b)$ is larger than the posted price $p_{r_s, \mathcal{T}}$ . This can be formulated as a posted price mechanism. Hence, the expected revenue of the seller is computed as + +$$ +\sum_ {r _ {s}} \mathbf {P r} (r _ {s} | \mathcal {T}) \sum_ {b} \varphi (b) \cdot p _ {r _ {s}, \mathcal {T}} \cdot \mathbf {1} \left\{G (r _ {s}, \mathcal {T}, b) \geq p _ {r _ {s}, \mathcal {T}} \right\}, \tag {4} +$$ + +where $\mathbf{Pr}(r_s|\mathcal{T})$ is the seller's belief of observing accuracy $r_s$ after sharing set $\mathcal{T}$ with the learner, computed as $\mathbf{Pr}(r_s|\mathcal{T}) = \sum_q\lambda (r_s|q,\mathcal{T})\mu (q)$ and $\mathbf{1}\{\cdot \}$ is an indicator function. For convenience, the accuracy $r$ , $r_s$ and $r_m$ are assumed to be discrete. We refer the reader to Appendix K for a summary of notations. + +To maximize her revenue formulated in (4), the seller needs to determine which set $\mathcal{T}$ of data points to be shared and the corresponding price menu $\{p_{r_s,\mathcal{T}}\}_{r_s}$ . Note that when $\mathcal{T} = \emptyset$ , (4) computes the revenue of selling the entire dataset without sharing any data (i.e., without costly signaling). The formulations of the seller's revenue for the homogeneous data case and the heterogeneous data case only differ in the realizations of distribution $\lambda(r|q,\mathcal{T})$ , however, leading to two completely different problems. + +# 3. Pricing Homogeneous Data + +In this section, we present the details of mechanism design for pricing homogeneous data. The homogeneity assumption assumes data points are i.i.d., which means that each data point contributes equally to the performance of the ML model. Therefore, the model accuracy distribution is then realized as + +$$ +\lambda (r | q, \mathcal {T}) = \lambda (r | q, t), \tag {5} +$$ + +where $t$ denotes the shared quantity of data which is computed as $t = \frac{|\mathcal{T}|}{|\mathcal{D}|}$ . By definition, we can see that $t$ is finite and discrete and $0 \leq t \leq 1$ . Sharing larger quantity of data may lead to more accurate estimate of $q$ but at the same time, larger loss of sales value. Thus, the objective of mechanism design is to find an optimal quantity of data $t^*$ such that the revenue is maximized while losing as little as possible sales value caused by sharing data. Note that though $\lambda(r|q,t)$ should be modeled carefully in practice, our results hold generally and are oblivious to its choice. + +In the following, we divide the discussion into two parts: Section 3.1 considers the case where the seller and the machine learner have the common prior beliefs over $q$ , i.e., $\mu(q)$ . Afterwards, we will consider a harder case where the prior beliefs of two parties may differ. We include the discussion of this case in Section 3.2 and consider the robust mechanism design problem. + +# 3.1. Mechanism Design for the Common Prior Case + +We use the model accuracy distribution defined in (5) to realize the general model in Section 2. Specifically, the remaining utility defined in (3) becomes + +$$ +G \left(r _ {s}, t, b\right) = \mathbb {E} \left[ u \left(r _ {m}, b\right) \mid r _ {s}, t \right] - u \left(r _ {s}, b\right), \tag {6} +$$ + +where the learner's expected utility is $\mathbb{E}[u(r_m,b)|r_s,t] = \sum_{r_m}u(r_m,b)\sum_q\lambda (r_m|q,1)\mathbf{Pr}(q|r_s,t)$ . Then, we compute the seller's expected revenue similarly as in (4) + +$$ +\sum_ {r _ {s}} \mathbf {P r} (r _ {s} | t) \sum_ {b} \varphi (b) \cdot p _ {r _ {s}, t} \cdot \mathbf {1} \left\{G (r _ {s}, t, b) \geq p _ {r _ {s}, t} \right\}, \tag {7} +$$ + +where $\mathbf{Pr}(r_s|t) = \sum_q\lambda (r_s|q,t)\mu (q)$ . To maximize the revenue, the seller needs to determine the optimal quantity of data $t^*$ and the price menu $\{p_{r_s,t^*}\}_{r_s}$ . Because $t$ and $r_s$ are discrete and finite, the optimal mechanism can be computed by enumeration (see Appendix B). + +Before moving forward, we define a quantity $R^{\mathcal{D}}(t)$ as below + +$$ +\begin{array}{l} R ^ {\mathcal {D}} (t) = \max _ {\left\{p _ {r _ {s}, t} \right\} _ {r _ {s}}} \sum_ {r _ {s}} \Pr \left(r _ {s} | t\right) \\ \cdot \sum_ {b} \varphi (b) \cdot p _ {r _ {s}, t} \cdot \mathbf {1} \left\{\mathbb {E} [ u (r _ {m}, b) | r _ {s}, t ] \geq p _ {r _ {s}, t} \right\}. \tag {8} \\ \end{array} +$$ + +Compared with (7), the formulation of $R^{\mathcal{D}}(t)$ removes the sales value loss term $u(r_s, b)$ within the indicator function. In another word, $R^{\mathcal{D}}(t)$ assumes sharing partial data helps with the estimation of $q$ but causes no loss of sales value. Hence, $R^{\mathcal{D}}(t)$ can be naturally considered as an upper bound of the seller's revenue when she shares $t$ quantity of data. + +The seller may want to quickly get a sense of whether she can make profit from this trade before enumerating $t$ and $p$ to maximize (7). Thus, it is very natural to ask these two questions: 1) Is it always profitable to share data? 2) Under what conditions will sharing data be profitable? Surprisingly, we find that 1) in some cases, it is optimal for the seller to sell the entire dataset directly (Theorem 3.1), and 2) the seller probably makes more revenue from sharing data if more training data gives better performance and the learner has rather small valuation for low-accuracy model. Next, we answer these two questions separately. + +First Question. One kind of widely-used valuation functions is linear function, e.g., $u(r,b) = r \times b$ which can be interpreted as that the buyer would pay $b$ for 1 unit model accuracy and $r \times b$ for accuracy $r$ in total. We say such a linear function $u(r,b) = r \times b$ has a separable form. Separability means that a function can be divided into several parts, where each part depends only on one variable. We give the formal definition below. + +Definition 3.1 (Separable valuation functions.) The valuation function $u(r, b)$ is said to be multiplicatively [additively] separable if it has the form $u(r, b) = f(b)h(r)$ $[u(r, b) = f(b) + h(r)]$ where $f(b)$ and $h(r)$ are any two functions of $b$ and $r$ respectively. + +In the following, Theorem 3.1 shows that if the valuation function $u(r,b)$ has certain separable forms, sharing data with the machine learner is not profitable to the seller. + +Theorem 3.1 If valuation function $u(r, b)$ is multiplicatively separable, then the best strategy for the seller is to sell the entire dataset directly without sharing any data. It also holds for additively separable function if $\lambda(0|q, t > 0) = 0$ . + +Note that the condition $\lambda(0|q, t > 0) = 0$ ensures that training on the shared data surely returns a positive preliminary accuracy, i.e., both parties will not observe accuracy $r_s = 0$ . Clearly, since the linear valuation function $u(r, b) = r \times b$ is multiplicatively separable, it is better for the seller not to share any data by Theorem 3.1. We give a sketch of proof below. The full proof is in Appendix C. + +Proof of Theorem 3.1. (sketch) The first part of the proof lies in the key observation that for a multiplicatively separable valuation function, $R^{\mathcal{D}}(t)$ no longer depends on the + +![](images/a92da6a5502be45a7920ef238b4815d30960cf6530abc20d540f51a89430b736.jpg) +Figure 2. Revenue change with respect to quantity $t$ . Point $R$ is the revenue obtained by selling data without sharing any set. + +shared quantity $t$ . In another word, the value of $R^{\mathcal{D}}(t)$ is the same for all $t$ including $t = 0$ . Since $R^{\mathcal{D}}(t)$ is an upper bound of the seller's revenue defined in (7) and sharing data (i.e., $t > 0$ ) causes loss of sales value, the seller obtains less revenue than selling the entire dataset directly without sharing. The second part of the proof for the additively separable valuation function shares a similar idea, but in this case, we observe that the maximum revenue from (7) for $t > 0$ does not depend on the choice of private type $b$ any more. + +Note that Theorem 3.1 holds only for separable valuation functions. Our illustrative Example 3.3 shows that the optimal mechanism general will share a subset of data with the machine learner before selling the entire data set. + +Second Question. To answer the second question, we first show the following proposition. (Proof in Appendix D.) + +Proposition 3.2 The upper bound $\mathcal{R}^{\mathcal{D}}(t)$ of revenue from sharing data with the machine learner is larger than the revenue from selling the entire dataset directly without sharing any data. Formally, for any $t > 0$ , we have + +$$ +\begin{array}{l} \max _ {p} \sum_ {b} \varphi (b) \cdot p \cdot \mathbf {1} \left\{\sum_ {r _ {m}} u (r _ {m}, b) \sum_ {q} \lambda (r _ {m} | q, 1) \mu (q) \geq p \right\} \\ \leq R ^ {\mathcal {D}} (t). \\ \end{array} +$$ + +Remark 3.1 Note that $\mathcal{R}^D (0)$ is exactly the revenue obtained from selling entire set directly. By Proposition 3.2, we know that sharing data will increase the upper bound $\mathcal{R}^D (t)$ over $\mathcal{R}^D (0)$ . Hence, if the sales value loss caused by sharing data is less than the increase of the upper bound, then sharing partial data with the learner will benefit the seller's revenue. + +Finally, we use Example 3.3 to give a sense about the above finding and how the revenue (i.e., (7)) and the upper bound (i.e., $\mathcal{R}^{\mathcal{D}}(t)$ ) change w.r.t. the shared quantity $t$ . The curves of Example 3.3 are plotted in Figure 2. It is interesting to note that two curves are non-monotone, non-concave and even non-smooth. + +Example 3.3 Let $t = 0\%, 1\%, \ldots, 100\%$ be the quantity of data. Let $r \in \{0, 1, 2, \ldots, 10\}$ represent $0\%, 10\%, \ldots, 100\%$ accuracy, $q \in \{0, 1, 2, \ldots, 10\}$ and private type $b \in \{1, 2, \ldots, 10\}$ . According to the above characterization, let the valuation function be + +$$ +u (r, b) = \left\{ \begin{array}{c c} 0, & r + b < = 1 0 \\ 1 0 0 0, & r = b = 1 0 \\ 1 0, & o t h e r w i s e. \end{array} \right. +$$ + +The prior belief $\mu(q)$ over $q$ is a Gaussian with standard deviation $\sigma = 3$ and mean $m = 3$ . The accuracy distribution $\lambda(r|q, t)$ is also a Gaussian with $m = \text{round}(q \cdot t)$ and $\sigma = 0.1 \times (-(t - 0.5)^2 + 0.25)$ . Let $\sigma = 0$ if $q = 0$ . $\mu(q)$ and $\lambda(r|q, t)$ will be normalized to a probability measure. + +The insight revealed from Example 3.3 is that we may require two conditions so that sharing data benefits the seller: 1) the model accuracy distribution $\lambda(r|q,t)$ is first-order-dominance w.r.t. $t$ , i.e., for any $t_1 \geq t_2$ and $r$ , $\int_0^r \lambda(x|q,t_2) dx \geq \int_0^r \lambda(x|q,t_1) dx$ which then implies $\mathbb{E}[r|q,t_1] \geq \mathbb{E}[r|q,t_2]$ ; and 2) $u(r,b)$ is relatively small or even negligible when the accuracy $r$ is small, while it should be a relatively large value when $r$ is large. + +These two conditions can be justified in practice: i) First, it is natural to observe that given more training data, the ML model is more likely to output higher accuracy. Otherwise, the learner may not want to buy the remainder of data. One counter example is that for any $t_1 \geq t_2$ , $\mathbb{E}[r|q, t_1] \leq \mathbb{E}[r|q, t_2]$ . In this case, more training data actually harms the model's performance and sharing data will lead to worse estimation of quality. Thus, it is optimal to sell the entire set directly. ii) Second, a classifier trained on 5% of the data may achieve only 30% accuracy, which is far away from practical use. Thus, a company simply value it 0. However, it helps the estimation of how good the dataset is. On the contrary, if the company values a low-accuracy model relatively high, the seller will suffer a severe loss of sales value by sharing data and obtain less revenue. Two illustrative examples in Appendix J show that if either condition is violated, sharing data may not increase the seller's revenue. + +# 3.2. Robust Mechanisms + +We further consider a different setting where the priors over data quality of the seller and the machine learner, denoted as $\mu_{sl}$ and $\mu_{ml}$ respectively, differ from each other. We assume + +that the two priors $\mu_{sl}$ and $\mu_{ml}$ are private to the seller and the machine learner respectively and differ from each other for each $q$ according to the following. + +$$ +\forall q, \left| \mu_ {s l} (q) - \mu_ {m l} (q) \right| \leq \epsilon \mu_ {s l} (q). \tag {9} +$$ + +We will constantly use subscript $sl$ and $ml$ to denote the seller and the machine learner in the rest of this part. + +The machine learner's estimation for $q$ after training on shared quantity of data $t$ is + +$$ +\mathbf {P r} _ {m l} (q | r _ {s}, t) = \frac {\lambda (r _ {s} | q , t) \mu_ {m l} (q)}{\sum_ {q} \lambda (r _ {s} | q , t) \mu_ {m l} (q)}. +$$ + +Then, his expected utility for the remaining data is computed as + +$$ +G _ {m l} (r _ {s}, t, b) = \mathbb {E} _ {m l} [ u (r _ {m}, b) | r _ {s}, t ] - u (r _ {s}, b). +$$ + +Since $\mu_{ml}$ is privately held by the machine learner, the seller may resort to robust mechanism design and maximize the worst-case revenue w.r.t. $\mu_{ml}$ subject to the constraint (9), defined as + +$$ +\min _ {\mu_ {m l}} \sum_ {r _ {s}} \mathbf {P r} _ {s l} (r _ {s} | t) \sum_ {b} \varphi (b) \cdot p _ {r _ {s}, t} \cdot \mathbf {1} \left\{G _ {m l} \left(r _ {s}, t, b\right) \geq p _ {r _ {s}, t} \right\}, \tag {10} +$$ + +where $\mathbf{Pr}_{sl}(r_s|t) = \sum_q\lambda (r_s|q,t)\mu_{sl}(q)$ is the seller's prior belief over $r_s$ after sharing $t$ quantity of data. + +In the robust mechanism design, (10) serves as a lower bound of revenue, and the seller needs to determine the optimal quantity $t^*$ to maximize the lower bound. In fact, we have the following even stronger approximation results with respect to the true machine learner's prior $\mu_{ml}$ (full proof in Appendix E). + +Theorem 3.4 Let $\epsilon \in [0,1]$ satisfy constraint (9). Then exists a mechanism, whose revenue is at least $\mathsf{OPT} - \frac{4\epsilon}{1 - \epsilon^2}\bar{u}$ , where $\mathsf{OPT}$ is the optimal expected revenue under the true prior belief of machine learner and $\bar{u} = \max_{r,b} u(r,b)$ . + +Theorem 3.4 suggests that even though the machine learner's true prior belief is private, the revenue that the seller can obtain is still close to that obtained by knowing the true machine learner's prior, as long as their beliefs do not differ much, i.e., $\epsilon$ is small. In practice, the seller and the buyer may use publicly available resource for research to estimate $q$ , so their priors may not differ too much. + +# 4. Pricing Heterogeneous Data + +In this section, we consider selling heterogeneous data. In typical ML settings, a given data set $X \in R^{n \times m}$ consists of $n$ i.i.d. (homogeneous) data points where each data point is of $m$ dimensions, i.e., $m$ features which are heterogeneous. + +For example, in a clinical dataset of $n$ patients, each patient (data point) is assumed to be i.i.d., but each patient is described by multiple (i.e., $m$ ) heterogeneous features, such as age, medicine, disease, etc.. Note that in this example, one feature (e.g., the feature age) is a vector of all patients' age information ( $n$ dimensions) and an ML model can be trained on that feature. While selling data points is modeled as the sales of homogeneous data, the sales of features is naturally the selling heterogeneous data problem. + +Suppose the seller possesses a set of features $\mathcal{D} = \{1,2,3,\dots M\}$ for training the ML model, and would like to price the feature set so as to maximize his own revenue. Similarly, we measure the usefulness of $M$ features with the quality vector $q = [q_{1},q_{2},\ldots ,q_{M}]$ of $M$ dimensions, where $q_{i}\geq 0$ is the quality for feature $i$ . We assume there are in total $N$ possible different quality vectors and $N$ is finite. Given any subset of features $\mathcal{T} = \{i_1,i_2,\dots ,i_k\}$ , we use $q_{\mathcal{T}} = [q_{i_1},q_{i_2},\dots ,q_{i_k}]$ as the corresponding quality subvector. To ease exposition, use $\mathcal{R}$ to denote the remainder set $\mathcal{D}\setminus \mathcal{T}$ . An example with $M + 1$ features of $N + 1$ possible quality vectors is shown in Figure 3. + +In the rest of discussion, we will consider one special case of $\lambda (r|q,\mathcal{T})$ , which already leads to an NP-hard problem. Particularly, the $\lambda (r|q,\mathcal{T})$ is realized as a point distribution + +$$ +\lambda (r | q, \mathcal {T}) = \lambda (r | q _ {\mathcal {T}}) = \left\{ \begin{array}{l l} 1, & r = f (q _ {\mathcal {T}}) \\ 0, & \text {o t h e r w i s e}, \end{array} \right. \tag {11} +$$ + +which indicates that the accuracy is exactly the quality. $f(q_{\mathcal{T}})$ computes the quality of subset $\mathcal{T}$ + +Let $\mu(q)$ be the commonly known prior belief over quality vector $q$ . Given any subset $\mathcal{T}$ , we can compute $\mu(q_{\mathcal{T}})$ and conditional probability $\mu(q_{\mathcal{R}} \mid q_{\mathcal{T}})$ . In the following, we use $\lambda(r|q, \mathcal{T})$ and $\lambda(r|q_{\mathcal{T}})$ interchangeably. + +Similarly, the posterior estimation of $q$ given set $\mathcal{T}$ is + +$$ +\mathbf {P r} (q | r _ {s}, \mathcal {T}) = \frac {\lambda (r _ {s} | q , \mathcal {T}) \mu (q)}{\sum_ {q} \lambda (r _ {s} | q , \mathcal {T}) \mu (q)}. +$$ + +For later use, we first show that the seller's expected revenue in (4) can be further realized with (11) as (detailed derivation of (12) in Appendix F) + +$$ +\begin{array}{l} \sum_ {r _ {s}} \sum_ {b} \varphi (b) \cdot p _ {r _ {s}, \mathcal {T}} \cdot 1 \left\{\sum_ {q | f (q \mathcal {T}) = r _ {s}} \mu (q) u (f (q), b) \right. \\ \left. - \sum_ {q _ {\mathcal {T}} | f (q _ {\mathcal {T}}) = r _ {s}} \mu (q _ {\mathcal {T}}) u (f (q _ {\mathcal {T}}), b) \geq p _ {r _ {s}, \mathcal {T}} \right\}. \tag {12} \\ \end{array} +$$ + +The derivation of (12) is oblivious to the choice of $f(q)$ . + +Remark 4.1 Since the formulation (12) is intrinsically the same as (7), Theorem 3.1 still holds for pricing heterogeneous data, i.e., the best strategy is to sell the entire dataset without sharing for separable valuation functions. + +![](images/0314f447fa6f1b2fe544628613e4942d10277d9e037908896f8eb12d19e29b33.jpg) +Figure 3. Constructed matrix $\mathcal{D} \in R^{(N + 1) \times (M + 1)}$ with $1\mathrm{H}$ -quality vector and $N\mathrm{L}$ -quality vectors. $H$ and $L$ are positive real numbers with $H > L$ . + +In line with (Gradwohl et al., 2021) where the allowed communication cost is limited, we impose a cardinality constraint $|\mathcal{T}| \leq T$ . This is reasonable because each feature may be of high dimensions (i.e., the number of data points is large) and thus the training of the ML model is time-consuming, e.g., training a BERT model (Devlin et al., 2019) from scratch may take up to 4 days, so the seller may share at most $T$ features to reduce the waiting time for preliminary accuracy. + +# 4.1. Hardness of Optimal Mechanism + +This section shows the hardness of computing the optimal mechanism. We employ the simple linear function $f(q_{\mathcal{T}}) = \sum_{i\in \mathcal{T}}q_i$ which computes the sum of entries in the given quality subvector. Note that although there may be exponential number of different choices of subset $\mathcal{T}$ , by such a simple linearity assumption, there are in fact polynomial number of different values for $f(q_{\mathcal{T}})$ since the quality $q_{i}$ is finite and discrete. Hence, there are only polynomial number of different distributions $\lambda (r|q,\mathcal{T})$ . Nevertheless, the resulted problem is already NP-hard to solve. The main result of this section is the following theorem. + +Theorem 4.1 It is NP-hard to achieve $\frac{e}{e + 1} + o(1)$ approximation to the optimal mechanism. + +The proof of Theorem 4.1 is rather involved and we show the high-level of our proof below. To ease exposition, the proof is divided into three parts: i) We first show that maximizing the revenue subject to a cardinality constraint can be simplified to a cleaner combinatorial problem, Column Subset Selection; ii) We prove that computing the optimal mechanism is NP-hard by showing that a binary version of Column Subset Selection is NP-hard.; iii) Based on a similar construction as that in the second step, we prove the + +inapproximation ratio $\frac{e}{e + 1} + o(1)$ by utilizing the hardness result from (Feige, 1998). See a complete proof in Appendix G. + +Firstly, we notice that by considering some special construction of valuation function $u(r,b)$ (see the proof of Lemma G.1), subject to the constraint $|\mathcal{T}| \leq T$ , the maximum revenue of (12) has the following cleaner formulation: + +$$ +\sum_ {r _ {s}} \sum_ {b} \varphi (b) \cdot p _ {r _ {s}, \mathcal {T}} \cdot \mathbf {1} \left\{\sum_ {q | f (q _ {\mathcal {T}}) = r _ {s}} \mu (q) u (f (q), b) \geq p _ {r _ {s}, \mathcal {T}} \right\}. \tag {13} +$$ + +The formulation (13) can be interpreted as following: As in Figure 3, suppose that the set $\mathcal{D}$ contains $M + 1$ features (columns) and there are $N + 1$ possible choices of quality vectors $q$ (rows). By selecting a subset $\mathcal{T}$ of features (i.e., set of columns in matrix $\mathcal{D}$ ), the $N + 1$ quality vectors are divided into different groups according to the value $f(q_{\mathcal{T}})$ of the quality subvectors $q_{\mathcal{T}}$ . That is, given an $r_s$ , quality vectors with $f(q_{\mathcal{T}}) = r_s$ are classified to the same group, and a price $p_{r_s,\mathcal{T}}$ needs to be determined so that the sub problem $\sum_{b} \varphi(b) \cdot p_{r_s,\mathcal{T}} \cdot 1 \left\{ \sum_{q|f(q_{\mathcal{T}}) = r_s} \mu(q) u(f(q), b) \geq p_{r_s,\mathcal{T}} \right\}$ is maximized. If the valuation $u(f(q), b)$ is different for different quality vectors $q$ , the maximum value of (13) is achieved only when all the quality vectors $q$ are separated from each other. The maximization of (13) subject to the constraint is intrinsically equivalent to the following Column Subset Selection problem, which we find is of independent interest. + +# COLUMN SUBSET SELECTION + +Input: $n$ arbitrary nonnegative vectors $\mathbf{x}^1, \mathbf{x}^2, \ldots, \mathbf{x}^n$ of $m$ -dimension. + +Output: find a minimum-size set of entries $\mathcal{E} \subseteq [m]$ to distinguish all vectors according to the sum of entries, i.e., $\sum_{i \in \mathcal{E}} \mathbf{x}_i^1 \neq \sum_{i \in \mathcal{E}} \mathbf{x}_i^2 \neq \dots \neq \sum_{i \in \mathcal{E}} \mathbf{x}_i^n$ . + +The fundamental challenge in our costly signaling problem is essentially the same as the Column Subset Selection problem above: how to select the most effective — in the sense of good quality estimation but small loss of sales value caused by sharing data — subset of features (i.e., columns) is hard. + +Secondly, we prove the hardness of costly signaling, i.e., the maximization of (12), by proving the hardness of a binary version of the Column Subset Selection problem, which distinguishes only one vector from others $^2$ . As in Figure 3, the constructed set $\mathcal{D}$ consists of 1 H-quality vector and $N$ L-quality vectors, where the H-quality vector has value $H$ in the last entry and $\epsilon$ in other $M$ entries, and the L-quality + +vector has value $L$ in the last entry while 0 and $\epsilon$ in its first $M$ entries. We can show that the maximum value of problem (13) is achieved by separating the H-quality vector from all L-quality vectors. The NP-hardness is proved by a reduction from the set cover problem (Cormen et al., 2009): Given a ground set $\mathcal{U} = \{1,2,\dots ,N\}$ , a collection of $M$ subsets of $\mathcal{U}$ and an integer $T$ , determine if there exists a collection $\mathcal{C}$ of at most $T$ subsets so that all the elements in $\mathcal{U}$ are covered (i.e., included) in $\mathcal{C}$ ? Given a set cover instance, we construct one instance of (13) as follows: The ground set $\mathcal{U}$ corresponds to the $N$ L-quality vectors. $M$ subsets correspond to the first $M$ columns in $\mathcal{D}$ . The given integer $T$ is the cardinality constraint. + +Finally, we utilize the maximum coverage problem to prove the inapproximation ratio: Given a ground set $\mathcal{U} = \{1,2,\dots ,N\}$ , a collection of $M$ subsets of $\mathcal{U}$ and an integer $T$ , find a collection of no more than $T$ subsets such that the number of elements included in $\mathcal{C}$ is maximized. It is important to note that the maximum coverage and the set cover problem have the same input. (Feige, 1998) showed that given a maximum coverage instance with an integer $T$ as the optimal value (i.e., $T$ is the minimum number of subsets needed to cover all the elements in $\mathcal{U}$ ) of a set cover instance with the same input, there is no polynomial algorithm giving a coverage of size at least $(1 - \frac{1}{e} +o(1))N$ where $N$ is the number of elements in the ground set. + +Let constraint $T$ be the optimal value of a constructed set cover instance (same as the second step). Then, no polynomial algorithm can reach an approximation ratio $1 - \alpha = 1 - \frac{1}{e} + o(1)$ for the maximum coverage problem. In addition, let the machine learner have two private types $b_1, b_2$ : + +- Set probabilities $\varphi(b_1) = 1 - \frac{1}{\alpha N}$ and $\varphi(b_2) = \frac{1}{\alpha N}$ , respectively. $b_1 < b_2$ . +- Let $u(L, b_1) = 1 - \frac{1}{N}, u(L, b_2) = 1$ and $u(H, b_1) = 1$ , $u(H, b_2) = (\alpha N)^2$ . + +The optimal revenue is achieved by separating the H-quality vector from all L-quality vectors, which is $\max_{p_H}\sum_b\varphi (b)\cdot p_H\cdot \mathbf{1}\{u(H,b)\geq p_H\} +\max_{p_L}\sum_b\varphi (b)\cdot$ $p_L\cdot \mathbf{1}\{Nu(L,b)\geq p_L\} = \alpha N + N - 1.$ By utilizing the hardness result from (Feige, 1998), we can have that the revenue obtained by any polynomial-time algorithm is upper bounded by $N + \alpha$ .Given $\alpha = \frac{1}{e} -o(1)$ ,we have ratio $\frac{N + \alpha}{\alpha N + N - 1} = \frac{N}{\alpha N + N} +o(1) = \frac{e}{e + 1} +o(1).$ + +# 4.2. Approximation Algorithm + +We seek an approximation algorithm that can compute the mechanism in a fast way for pricing the heterogeneous data. One natural idea is to greedily select the feature that gives the largest increase of revenue. However, in the following, we give some negative observations about this natural idea. + +The proof is in Appendix H. + +Observation 4.2 In general, the revenue (12) is not a submodular function regarding the set $\mathcal{T}$ . Additionally, in terms of the increase of revenue, greedy algorithm (i.e., greedily select feature that gives the largest increase of revenue) may give arbitrarily bad approximation. + +Despite the above negative results, we show that a simple approximation algorithm which sells the entire dataset directly according to the common prior gives a relatively tight approximation if the number of machine learner's private types is small. + +Theorem 4.3 Oblivious to the choice of $f(q)$ , by selling the entire dataset directly without sharing any feature, at least $\frac{1}{k}$ OPT revenue can be obtained, where $k$ is the number of private types and OPT is the optimal revenue. + +The key idea of the proof is to compare the revenue of selling data directly according to the prior belief and the upper bound of (12), i.e., $\max_{p_q}\sum_q\sum_b\varphi (b)\cdot p_q\cdot$ 1{u(f(q),b)≥pq}, which is obtained by separating all quality vectors from each other and removing sales value loss term. When $k = 2$ , this simple algorithm can achieve a ratio $\frac{1}{2}$ , which is close to the hardness results $\frac{e}{e + 1}\approx 0.7$ We remark that some real-world applications do fall within the regime of small $k$ . For example, when selling data of human face pictures for recognition, the buyers typically come from three types: researchers, governmental agencies and companies. + +# 5. Conclusions and Future Works + +We take the first step to consider the problem of selling data to a machine learner. A Pricing via Costly Signaling scheme is proposed for the homogeneous data and heterogeneous data cases. We believe the problem of selling data to a machine learner is of great significance to both theory research and practical application. A few open questions are left, which we believe deserve further investigation: + +- Is there a better approximation algorithm for maximizing (12) to achieve higher revenue? +- Besides selling data by pricing via costly signaling, is there a better mechanism to sell data under the same setting? It would also be interesting to consider selling data to multiple learners (or companies). + +Acknowledgment. Haifeng Xu is supported by the NSF grant CCF-2132506. Minming Li is supported by a grant from Research Grants Council of Hong Kong SAR, China (Project No. CityU 11205619). + +# References + +Agarwal, A., Dahleh, M., and Sarkar, T. A marketplace for data: An algorithmic solution. In Proceedings of the 2019 ACM Conference on Economics and Computation, pp. 701-726, 2019. +Agarwal, A., Dahleh, M., Horel, T., and Rui, M. Towards data auctions with externalities. arXiv preprint arXiv:2003.08345, 2020. +Babaioff, M., Kleinberg, R., and Paes Leme, R. Optimal mechanisms for selling information. In Proceedings of the 13th ACM Conference on Electronic Commerce, pp. 92-109, 2012. +Bergemann, D., Bonatti, A., and Gan, T. The economics of social data. RAND Journal of Economics (forthcoming), 2019. +Bishop, C. M. Pattern recognition. Machine learning, 128 (9), 2006. +Cai, Y. and Velegkas, G. How to sell information optimally: An algorithmic study. In Proceedings of the 12th Innovations in Theoretical Computer Science Conference, volume 185, 2021. +Chen, L., Koutris, P., and Kumar, A. Towards model-based pricing for machine learning in a data marketplace. In Proceedings of the 2019 International Conference on Management of Data, pp. 1535-1552, 2019. +Chen, Y., Xu, H., and Zheng, S. Selling information through consulting. In Proceedings of the Fourteenth Annual ACM-SIAM Symposium on Discrete Algorithms, pp. 2412-2431. SIAM, 2020. +Cormen, T. H., Leiserson, C. E., Rivest, R. L., and Stein, C. Introduction to algorithms. MIT press, 2009. +Devlin, J., Chang, M.-W., Lee, K., and Toutanova, K. 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, 2019. +Dughmi, S. Algorithmic information structure design: a survey. ACM SIGcom Exchanges, 15(2):2-24, 2017. +Dughmi, S. and Xu, H. Algorithmic persuasion with no externalities. In Proceedings of the 2017 ACM Conference on Economics and Computation, pp. 351-368, 2017. +Dughmi, S. and Xu, H. Algorithmic bayesian persuasion. SIAM Journal on Computing, (0):STOC16-68, 2019. + +Feige, U. A threshold of ln n for approximating set cover. Journal of the ACM (JACM), 45(4):634-652, 1998. +Gradwohl, R., Hahn, N., Hoefer, M., and Smorodinsky, R. Algorithms for persuasion with limited communication. In Proceedings of the 2021 ACM-SIAM Symposium on Discrete Algorithms (SODA), pp. 637-652. SIAM, 2021. +Kamenica, E. and Gentzkow, M. Bayesian persuasion. American Economic Review, 101(6):2590-2615, 2011. +Lei, S., Zhang, H., Wang, K., and Su, Z. How training data affect the accuracy and robustness of neural networks for image classification, 2019. URL https://openreview.net/forum?id=Hk1KWhC5F7. +Liu, S., Shen, W., and Xu, H. Optimal pricing of information. In Proceedings of the 22nd ACM Conference on Economics and Computation, pp. 693-693, 2021. +Mehta, S., Dawande, M., Janakiraman, G., and Mookerjee, V. How to sell a dataset? pricing policies for data monetization. In 20th ACM Conference on Economics and Computation, EC, pp. 679, 2019. +Pouyanfar, S., Sadiq, S., Yan, Y., Tian, H., Tao, Y., Reyes, M. P., Shyu, M.-L., Chen, S.-C., and Iyengar, S. A survey on deep learning: Algorithms, techniques, and applications. ACM Computing Surveys (CSUR), 51(5):1-36, 2018. +Zheng, S. and Chen, Y. Optimal advertising for information products. In Proceedings of the 22nd ACM Conference on Economics and Computation, pp. 888-906, 2021. + +# A. Preliminaries + +Given a posted-price mechanism formulated as + +$$ +\max _ {p} \sum_ {b} \varphi (b) \cdot p \cdot \mathbf {1} \{f (b) \geq p \}, +$$ + +where $b$ is a private type, $\varphi(b)$ is the probability of $b$ and $f(b) \geq 0$ only depends on $b$ . We have the following observations: + +Observation A.1 The optimal price $p^*$ must be $p^* = f(b^*)$ for some private type $b^*$ . $b^*$ is called optimal type. + +Observation A.2 Denote $\mathbf{Pr}(f(b) < p)$ as the probability of not purchasing the item at some price $p$ , i.e., $\mathbf{Pr}(f(b) < p) = \sum_{b:f(b) < p} \varphi(b)$ . If $f(b)$ is increasing in $b$ , $\mathbf{Pr}(f(b) < p^*)$ can be computed with the cumulative probability function $\Phi$ of $\varphi$ , as $\mathbf{Pr}(f(b) < p^*) = \Phi(b^*) = \sum_{b < b^*} \varphi(b)$ . + +# B. Solution to Maximizing (7) + +Lemma B.1 The optimal quantity $t^*$ and the price menu $\{p_{r_s,t^*}\}_{r_s}$ to maximizing (7) can be computed in polynomial time. + +Proof: Note that the problem of maximizing (7) is + +$$ +\max _ {\left\{p _ {r _ {s}, t} \right\} _ {r _ {s}}, t} \quad \sum_ {r _ {s}} \Pr \left(r _ {s} \mid t\right) \sum_ {b} \varphi (b) \cdot p _ {r _ {s}, t} \cdot \mathbf {1} \left\{\mathbb {E} [ u \left(r _ {m}, b\right) \mid r _ {s}, t ] - u \left(r _ {s}, b\right) \geq p _ {r _ {s}, t} \right\}. \tag {14} +$$ + +Given quantity $t$ and the observed accuracy $r_s$ , maximizing the seller's revenue by solving (14) is equivalent to finding a $p_{r_s,t}$ such that $\sum_b \varphi(b) \cdot p_{r_s,t} \cdot \mathbf{1}\left\{\mathbb{E}[u(r_m,b)|r_s,t] - u(r_s,b) \geq p_{r_s,t}\right\}$ is maximized. Now, the problem turns into a posted price mechanism design problem. Since the machine learner's private type $b$ is finite and discrete, the optimal price $p_{r_s,t}^*$ is equal to $f(b^*) = \mathbb{E}[u(r_m,b^*)|r_s,t] - u(r_s,b^*)$ for some $b^*$ , and can be determined by enumeration in polynomial time. + +Once the price $p_{r_s,t}^*$ is given, the expected revenue conditioning on $t$ and $r_s$ is also determined, computed as $\text{Rev}(r_s, t) = \left\{1 - \mathbf{Pr}\left(f(b) < p_{r_s,t}^*\right)\right\} \cdot p_{r_s,t}^*$ . It is possible that the utility of the remaining data $\mathbb{E}[u(r_m, b^*) | r_s, t] - u(r_s, b^*) < 0$ . Therefore, the revenue should be max $\{Re\nu (r_s,t), 0\}$ , given $t$ and $r_s$ . + +To find the optimal $t^*$ , we can enumerate all $t$ because $t$ is finite. + +# C. Proof of Theorem 3.1 + +We divide the proof into two parts for multiplicatively and additively separable valuation function respectively. First, we have the following key lemma for our proof. + +Lemma C.1 Given two posted price mechanisms formulated as $\max_p\sum_b\varphi (b)\cdot p\cdot \mathbf{1}\{f(b)\geq p\}$ and $\max_p\sum_b\varphi (b)\cdot$ $p\cdot \mathbf{1}\{c\cdot f(b)\geq p\}$ respectively, where $\varphi (b)$ is the probability of $b$ , $c\geq 0$ is some constant and $f(b)\geq 0$ is increasing in $b$ , there exists one optimal type $b^{*}$ (see Observation A.1) giving the optimal revenues for two mechanisms as $(1 - \Phi (b^{*}))f(b^{*})$ and $(1 - \Phi (b^{*}))\cdot cf(b^{*})$ , where $\Phi$ is the cumulative probability function of $\varphi$ (see Observation A.2). + +Proof: We know that the optimal solution for the first posted price mechanism is $(1 - \Phi (b^{*}))f(b^{*})$ as $f(b)\geq 0$ is increasing in $b$ . Because $\max_p\sum_b\varphi (b)\cdot p\cdot \mathbf{1}\{c\cdot f(b)\geq p\} = c\cdot \max_p\sum_b\varphi (b)\cdot p\cdot \mathbf{1}\{f(b)\geq p\}$ , there must exist one optimal $b^{*}$ for two mechanisms such that the optimal revenues are as in the claim. + +First, we prove that the theorem holds for the multiplicatively separable valuation function $u(r,b) = f(b)h(r)$ . + +Lemma C.2 Consider the upper bound of (7), i.e., $R^{\mathcal{D}}(t)$ defined in (8), and we formulate the problem of maximizing the upper bound as + +$$ +\max _ {\left\{p _ {r _ {s}, t} \right\} _ {r _ {s}}, t} \sum_ {r _ {s}} \Pr \left(r _ {s} \mid t\right) \sum_ {b} \varphi (b) \cdot p _ {r _ {s}, t} \cdot \mathbf {1} \left\{\mathbb {E} [ u \left(r _ {m}, b\right) \mid r _ {s}, t ] \geq p _ {r _ {s}, t} \right\}. \tag {15} +$$ + +For multiplicatively separable valuation function $u(r, b) = f(b)h(r)$ where $f(b)$ and $h(r)$ are two functions depending only on $b$ or $r$ , the upper bound $R^{\mathcal{D}}(t)$ is the same for different quantity $t$ . + +Proof: Note that similar as Lemma B.1, the maximum of $R^{\mathcal{D}}(t)$ must be obtained at some $t^{*}$ . Hence, we can assume a data quantity $t$ is given. The upper bound (15) is + +$$ +\begin{array}{l} \max _ {\left\{p _ {r _ {s}, t} \right\} r _ {s}} \sum_ {r _ {s}} \Pr (r _ {s} | t) \sum_ {b} \varphi (b) \cdot p _ {r _ {s}, t} \cdot \mathbf {1} \left\{\mathbb {E} [ u (r _ {m}, b) | r _ {s}, t ] \geq p _ {r _ {s}, t} \right\} (16a) \\ = \max _ {\left\{p _ {r _ {s}, t} \right\} r _ {s}} \quad \sum_ {r _ {s}} \sum_ {b} \varphi (b) \cdot p _ {r _ {s}, t} \cdot \mathbf {1} \left\{\sum_ {q} \sum_ {r _ {m}} u \left(r _ {m}, b\right) \lambda \left(r _ {m} \mid q, 1\right) \lambda \left(r _ {s} \mid q, t\right) \mu (q) \geq p _ {r _ {s}, t} \right\}. (16b) \\ \end{array} +$$ + +The equality holds because $\mathbf{Pr}(r_s|t) = \sum_q\lambda (r_s|q,t)\mu (q)$ and we move $\mathbf{Pr}(r_s|t)$ inside the indicator function. + +Note that in (16b), each $r_s$ is associated with one posted price mechanism as below + +$$ +\max _ {p _ {r _ {s}, t}} \sum_ {b} \varphi (b) \cdot p _ {r _ {s}, t} \cdot \mathbf {1} \Big \{\sum_ {q} \sum_ {r _ {m}} u (r _ {m}, b) \lambda (r _ {m} | q, 1) \lambda (r _ {s} | q, t) \mu (q) \geq p _ {r _ {s}, t} \Big \}. +$$ + +We now focus on the utility term within the indicator function. By replacing $u(r, b)$ with $f(b)h(r)$ , we can have the utility term as $f(b) \cdot g(r_s, t)$ where + +$$ +g \left(r _ {s}, t\right) = \sum_ {q} \sum_ {r _ {m}} h \left(r _ {m}\right) \lambda \left(r _ {m} \mid q, 1\right) \lambda \left(r _ {s} \mid q, t\right) \mu (q). \tag {17} +$$ + +Note that conditioning on the $r_s$ and $t$ , $g(r_s, t)$ can be considered as a constant. Furthermore, because $u(r, b)$ is increasing in $b$ , the optimal $b^*$ is the same for all different $r_s$ and $t$ by Lemma C.1. Hence, for any given $t$ , we have the upper bound as + +$$ +\begin{array}{l} \left. \max _ {\left\{p _ {r _ {s}, t} \right\} _ {r _ {s}}} \sum_ {r _ {s}} \sum_ {b} \varphi (b) \cdot p _ {r _ {s}, t} \cdot \mathbf {1} \left\{\sum_ {q} \sum_ {r _ {m}} u \left(r _ {m}, b\right) \lambda \left(r _ {m} \mid q, 1\right) \lambda \left(r _ {s} \mid q, t\right) \mu (q) > = p _ {r _ {s}, t} \right\} \right. (18a) \\ = (1 - \Phi (b ^ {*})) \sum_ {r _ {s}} \sum_ {q} \sum_ {r _ {m}} u (r _ {m}, b ^ {*}) \lambda (r _ {m} | q, 1) \lambda (r _ {s} | q, t) \mu (q) \\ = (1 - \Phi (b ^ {*})) \sum_ {q} \sum_ {r _ {m}} u (r _ {m}, b ^ {*}) \lambda (r _ {m} | q, 1) \sum_ {r _ {s}} \lambda (r _ {s} | q, t) \mu (q) \\ = \left(1 - \Phi (b ^ {*})\right) \sum_ {q} \sum_ {r _ {m}} u (r _ {m}, b ^ {*}) \lambda (r _ {m} | q, 1) \mu (q) \\ = \left(1 - \Phi \left(b ^ {*}\right)\right) f \left(b ^ {*}\right) \sum_ {q} \sum_ {r _ {m}} h \left(r _ {m}\right) \lambda \left(r _ {m} \mid q, 1\right) \mu (q), (18b) \\ \end{array} +$$ + +where $\Phi (b)$ is the same as that in Observation A.2. We can see from (18b) that the result is independent of quantity $t$ . In another word, all the $t$ 's (including $t = 0$ ) have the same upper bound, i.e., the maximum of (15). The lemma is proved. + +Lemma C.2 claims that with the multiplicatively separable valuation function, sharing data or not will not affect the value of upper bound, i.e., $R^{\mathcal{D}}(0) = R^{\mathcal{D}}(t), \forall t > 0$ . By the free duplication property, sharing data will cause loss of sales value to the seller. Hence, we know that the best strategy in this case is not to share any data. + +Corollary C.3 If the valuation function is multiplicatively separable, the best selling strategy of (7) is to sell the entire dataset directly without sharing any data. + +Proof: We know that the maximum value of (15), which is obtained in (18b), is an upper bound of (7). Also, note that the (18b) is exactly the same as the revenue obtained from selling the entire dataset directly. + +$$ +\max _ {p} \sum_ {b} \varphi (b) \cdot p \cdot \mathbf {1} \{\sum_ {q} \sum_ {r _ {m}} u (r _ {m}, b) \lambda (r _ {m} | q, 1) \mu (q) > = p \}. +$$ + +Since sharing partial data will cause loss to the sales value but the upper bound remains the same for $t > 0$ , the seller's revenue will then decrease after sharing. + +The proof of Theorem 3.1 is done by further considering the case $u(r,b) = f(b) + h(r)$ . + +Lemma C.4 If $\lambda(0|q, t > 0) = 0$ and the valuation function is additively separable $u(r, b) = f(b) + h(r)$ where $f(b)$ and $h(r)$ are functions depending only on $b$ or $r$ , the maximum revenue of (7) is upper bounded by that from selling the entire dataset directly to the machine learner. + +Proof: If $\lambda(0|q, t > 0) = 0$ , then the observed preliminary accuracy $r_s > 0$ and $u(r_s, b)$ will have the additive separable form $f(b) + h(r_s)$ for sure. Given a fixed $r_s$ and $t > 0$ , the utility term in (7) would be + +$$ +\begin{array}{l} \mathbb {E} [ u (r _ {m}, b) | r _ {s}, t ] - u (r _ {s}, b) \\ = \sum_ {q} \sum_ {r _ {m}} u (r _ {m}, b) \lambda (r _ {m} | q, 1) \frac {\lambda (r _ {s} | q , t) \mu (q)}{\sum_ {q} \lambda (r _ {s} | q , t) \mu (q)} - u (r _ {s}, b) \\ = \sum_ {q} \sum_ {r _ {m}} (f (b) + h (r _ {m})) \lambda (r _ {m} | q, 1) \frac {\lambda (r _ {s} | q , t) \mu (q)}{\sum_ {q} \lambda (r _ {s} | q , t) \mu (q)} - (f (b) + h (r _ {s})) \\ = \sum_ {q} \sum_ {r _ {m}} h (r _ {m}) \lambda (r _ {m} | q, 1) \frac {\lambda (r _ {s} | q , t) \mu (q)}{\sum_ {q} \lambda (r _ {s} | q , t) \mu (q)} - h (r _ {s}), \\ \end{array} +$$ + +which is independent of $b$ but only depends on $r_s$ , that is, the utility term is the same for every private type $b$ . In another word, for a fixed $r_s$ , the optimal price in (7) is + +$$ +p _ {r _ {s}, t} = \mathbb {E} [ u (r _ {m}, b _ {0}) | r _ {s}, t ] - u (r _ {s}, b _ {0}), \tag {19} +$$ + +where $b_{0}$ can be any private type and the learner will surely purchase with probability 1. For ease of exposition, let $b_{0}$ be the smallest private type and fixed for all $r_{s}$ . Thus, for any $t > 0$ , the revenue is + +$$ +\sum_ {r _ {m}} u (r _ {m}, b _ {0}) \sum_ {q} \lambda (r _ {m} | q, 1) \mu (q) - \sum_ {r _ {s}} \mathbf {P r} (r _ {s} | t) u (r _ {s}, b _ {0}). +$$ + +In addition, we know that when $t = 0$ , the revenue of selling the entire dataset directly according to the prior belief is $\max_p \sum_b \varphi(b) \cdot p \cdot \mathbf{1} \left\{ \sum_{r_m} u(r_m, b) \sum_q \lambda(r_m | q, 1) \mu(q) \geq p \right\}$ . The maximum revenue of the posted price mechanism satisfies + +$$ +\begin{array}{l} \max _ {p} \sum_ {b} \varphi (b) \cdot p \cdot \mathbf {1} \left\{\sum_ {r _ {m}} u (r _ {m}, b) \sum_ {q} \lambda (r _ {m} | q, 1) \mu (q) \geq p \right\} \\ \geq (1 - \Phi (b _ {0})) \sum_ {r _ {m}} u (r _ {m}, b _ {0}) \sum_ {q} \lambda (r _ {m} | q, 1) \mu (q) \\ \geq \sum_ {r _ {m}} u (r _ {m}, b _ {0}) \sum_ {q} \lambda (r _ {m} | q, 1) \mu (q) - \sum_ {r _ {s}} \mathbf {P r} (r _ {s} | t) u (r _ {s}, b _ {0}), \\ \end{array} +$$ + +where $\Phi (b)$ is defined similarly as in Observation A.2. The second inequality holds because $1 - \Phi (b_{0}) = 1$ (since $b_{0}$ is the smallest private type) and $\sum_{r_s}\mathbf{Pr}(r_s|t)u(r_s,b_0)\geq 0$ . Hence, we can see that the best strategy for the seller in this case is to directly sell the data. Note that it is possible that $p_{r_s,t} < 0$ in (19). By letting $p_{r_s,t} = \max \left\{0,\mathbb{E}[u(r_m,b_0)|r_s,t] - u(r_s,b_0)\right\}$ , our analysis remains the same. + +# D. Proof of Proposition 3.2 + +Proof: The upper bound obtained by sharing $t$ data with the machine learner is at least + +$$ +\begin{array}{l} \max _ {\left\{p _ {r _ {s}, t} \right\} _ {r _ {s}}} \quad \sum_ {r _ {s}} \sum_ {b} \varphi (b) \cdot p _ {r _ {s}, t} \cdot \mathbf {1} \left\{\sum_ {r _ {m}} u (r _ {m}, b) \sum_ {q} \lambda (r _ {m} | q, 1) \lambda (r _ {s} | q, t) \mu (q) \geq p _ {r _ {s}, t} \right\} \\ = \sum_ {r _ {s}} \left(1 - \Phi \left(b _ {r _ {s}} ^ {*}\right)\right) \sum_ {r _ {m}} u \left(r _ {m}, b _ {r _ {s}} ^ {*}\right) \sum_ {q} \lambda \left(r _ {m} \mid q, 1\right) \lambda \left(r _ {s} \mid q, t\right) \mu (q) \\ \geq \sum_ {r _ {s}} \left(1 - \Phi \left(b ^ {*}\right)\right) \sum_ {r _ {m}} u \left(r _ {m}, b ^ {*}\right) \sum_ {q} \lambda \left(r _ {m} \mid q, 1\right) \lambda \left(r _ {s} \mid q, t\right) \mu (q) \\ = (1 - \Phi (b ^ {*})) \sum_ {r _ {m}} u (r _ {m}, b ^ {*}) \sum_ {q} \lambda (r _ {m} | q, 1) \mu (q) \\ = \max _ {p} \quad \sum_ {b} \varphi (b) \cdot p \cdot \mathbf {1} \left\{\sum_ {r _ {m}} u (r _ {m}, b) \sum_ {q} \lambda (r _ {m} | q, 1) \mu (q) \geq p \right\}. \\ \end{array} +$$ + +The first equality is from maximizing each posted price mechanism for every $r_s$ and that $b_{r_s}^*$ is the optimal type, as in Appendix A. The second inequality holds because we use the same private type $b^*$ for all different $r_s$ , which may not be the optimal type for the posted price mechanism induced by some $r_s$ . The last equality holds because we use $b^*$ which is the optimal type of selling the entire dataset directly according to the prior belief. Thus, the proof completes. + +# E. Proof of Theorem 3.4 + +Proof: This theorem is proved by bounding the difference between the upper bound and lower bound of (10). + +For any given $\mu_{ml}$ , by the constraint $\forall q$ , $|\mu_{sl}(q) - \mu_{ml}(q)| \leq \epsilon \mu_{sl}(q)$ in (9), we have + +$$ +\begin{array}{l} \mathbb {E} _ {m l} [ u (r _ {m}, b) | r _ {s}, t ] \\ = \sum_ {q} \sum_ {r _ {m}} u (r _ {m}, b) \lambda (r _ {m} | q, 1) \frac {\lambda (r _ {s} | q , t) \mu_ {m l} (q)}{\sum_ {q} \lambda (r _ {s} | q , t) \mu_ {m l} (q)} \\ \geq \sum_ {q} \sum_ {r _ {m}} u (r _ {m}, b) \lambda (r _ {m} | q, 1) \frac {\lambda \left(r _ {s} | q , t\right) \left(\mu_ {s l} (q) - \epsilon \mu_ {s l} (q)\right)}{\sum_ {q} \lambda \left(r _ {s} | q , t\right) \left(\mu_ {s l} (q) + \epsilon \mu_ {s l} (q)\right)} \tag {20} \\ = \frac {(1 - \epsilon) \sum_ {q} \lambda (r _ {s} | q , t) \mu_ {s l} (q) \sum_ {r _ {m}} u (r _ {m} , b) \lambda (r _ {m} | q , 1)}{(1 + \epsilon) \sum_ {q} \lambda (r _ {s} | q , t) \mu_ {s l} (q)}. \\ \end{array} +$$ + +Therefore, given the price $p_{r_s,t}$ for each $r_s$ , we can derive the lower bound as + +$$ +\begin{array}{l} \min _ {\mu_ {m l}} \sum_ {r _ {s}} \mathbf {P r} _ {s l} (r _ {s} | t) \sum_ {b} \varphi (b) \cdot p _ {r _ {s}, t} \cdot \mathbf {1} \left\{\mathbb {E} _ {m l} [ u (r _ {m}, b) | r _ {s}, t ] - u (r _ {s}, b) \geq p _ {r _ {s}, t} \right\} \\ \geq \sum_ {r _ {s}} \mathbf {P r} _ {s l} (r _ {s} | t) \sum_ {b} \varphi (b) \cdot p _ {r _ {s}, t} \cdot \mathbf {1} \Big \{\frac {(1 - \epsilon) \sum_ {q} \lambda (r _ {s} | q , t) \mu_ {s l} (q) \sum_ {r _ {m}} u (r _ {m} , b) \lambda (r _ {m} | q , 1)}{(1 + \epsilon) \sum_ {q} \lambda (r _ {s} | q , t) \mu_ {s l} (q)} - u (r _ {s}, b) \geq p _ {r _ {s}, t} \Big \}. \\ \end{array} +$$ + +It is important to note that the lower bound also holds for the true machine learner's prior, which satisfies the constraints (9). We maximize the lower bound and have + +$$ +\begin{array}{l} \max _ {\left\{p _ {r _ {s}, t} \right\} _ {r _ {s}}} \min _ {\mu_ {m l}} \sum_ {r _ {s}} \mathbf {P r} _ {s l} (r _ {s} | t) \sum_ {b} \varphi (b) \cdot p _ {r _ {s}, t} \cdot \mathbf {1} \Big \{\mathbb {E} _ {m l} [ u (r _ {m}, b) | r _ {s}, t ] - u (r _ {s}, b) \geq p _ {r _ {s}, t} \Big \} \\ \geq \max _ {\{p _ {r _ {s}, t} \} _ {r _ {s}}} \sum_ {r _ {s}} \mathbf {P r} _ {s l} (r _ {s} | t) \sum_ {b} \varphi (b) \cdot p _ {r _ {s}, t} \cdot \mathbf {1} \Big \{\frac {(1 - \epsilon) \sum_ {q} \lambda (r _ {s} | q , t) \mu_ {s l} (q) \sum_ {r _ {m}} u (r _ {m} , b) \lambda (r _ {m} | q , 1)}{(1 + \epsilon) \sum_ {q} \lambda (r _ {s} | q , t) \mu_ {s l} (q)} - u (r _ {s}, b) \geq p _ {r _ {s}, t} \Big \}. \\ \end{array} +$$ + +We use $LB(r_s, b) = \frac{(1 - \epsilon)\sum_q\lambda(r_s|q,t)\mu_{sl}(q)\sum_{r_m}u(r_m,b)\lambda(r_m|q,1)}{(1 + \epsilon)\sum_q\lambda(r_s|q,t)\mu_{sl}(q)} - u(r_s, b)$ to denote the term within the indicator function. It is possible that $LB(r_s, b) < 0$ for some $r_s$ . + +Similarly, given the price $p_{r_s,t}$ for all $r_s$ , we have the following upper bound for any $\mu_{ml}$ satisfying the constraint (9) + +$$ +\begin{array}{l} \sum_ {r _ {s}} \mathbf {P r} _ {s l} (r _ {s} | t) \sum_ {b} \varphi (b) \cdot p _ {r _ {s}, t} \cdot \mathbf {1} \left\{\mathbb {E} _ {m l} [ u (r _ {m}, b) | r _ {s}, t ] - u (r _ {s}, b) \geq p _ {r _ {s}, t} \right\} \\ \leq \sum_ {r _ {s}} \mathbf {P r} _ {s l} (r _ {s} | t) \sum_ {b} \varphi (b) \cdot p _ {r _ {s}, t} \cdot \mathbf {1} \Big \{\frac {(1 + \epsilon) \sum_ {q} \lambda (r _ {s} | q , t) \mu_ {s l} (q) \sum_ {r _ {m}} u (r _ {m} , b) \lambda (r _ {m} | q , 1)}{(1 - \epsilon) \sum_ {q} \lambda (r _ {s} | q , t) \mu_ {s l} (q)} - u (r _ {s}, b) \geq p _ {r _ {s}, t} \Big \}. \\ \end{array} +$$ + +We maximize the upper bound and have + +$$ +\begin{array}{l} \max _ {\left\{p _ {r _ {s}, t} \right\} _ {r _ {s}}} \sum_ {r _ {s}} \mathbf {P r} _ {s l} \left(r _ {s} | t\right) \sum_ {b} \varphi (b) \cdot p _ {r _ {s}, t} \cdot \mathbf {1} \left\{\mathbb {E} _ {m l} [ u (r _ {m}, b) | r _ {s}, t ] - u (r _ {s}, b) \geq p _ {r _ {s}, t} \right\} \\ \leq \max _ {\{p _ {r _ {s}, t} \} r _ {s}} \sum_ {r _ {s}} \mathbf {P r} _ {s l} (r _ {s} | t) \sum_ {b} \varphi (b) \cdot p _ {r _ {s}, t} \cdot \mathbf {1} \Big \{\frac {(1 + \epsilon) \sum_ {q} \lambda (r _ {s} | q , t) \mu_ {s l} (q) \sum_ {r _ {m}} u (r _ {m} , b) \lambda (r _ {m} | q , 1)}{(1 - \epsilon) \sum_ {q} \lambda (r _ {s} | q , t) \mu_ {s l} (q)} - u (r _ {s}, b) \geq p _ {r _ {s}, t} \Big \}. \\ \end{array} +$$ + +We use $UB(r_s, b) = \frac{(1 + \epsilon)\sum_q\lambda(r_s|q,t)\mu_{sl}(q)\sum_{r_m}u(r_m,b)\lambda(r_m|q,1)}{(1 - \epsilon)\sum_q\lambda(r_s|q,t)\mu_{sl}(q)} - u(r_s, b)$ to denote the term within the indicator function in the upper bound. Aslo, note that the upper bound holds for the true machine learner's prior belief. + +Furthermore, we have $UB(r_s, b) - LB(r_s, b) = \frac{4\epsilon}{1 - \epsilon^2} \sum_q \sum_{r_m} u(r_m, b) \lambda(r_m | q, 1) \frac{\lambda(r_s | q, t) \mu_{sl}(q)}{\sum_q \lambda(r_s | q, t) \mu_{sl}(q)} \leq \frac{4\epsilon}{1 - \epsilon^2} \bar{u}$ , where $\bar{u} = \max_{r,b} u(r, b)$ . By subtracting the lower bound from the upper bound, we have + +$$ +\begin{array}{l} \max _ {\left\{p _ {r _ {s}, t} \right\} _ {r _ {s}}} \sum_ {r _ {s}} \mathbf {P r} _ {s l} \left(r _ {s} | t\right) \sum_ {b} \varphi (b) \cdot p _ {r _ {s}, t} \cdot \mathbf {1} \left\{U B \left(r _ {s}, b\right) \geq p _ {r _ {s}, t} \right\} \\ - \max _ {\left\{p _ {r _ {s}, t} \right\} _ {r _ {s}}} \sum_ {r _ {s}} \mathbf {P r} _ {s l} (r _ {s} | t) \sum_ {b} \varphi (b) \cdot p _ {r _ {s}, t} \cdot \mathbf {1} \left\{L B (r _ {s}, b) \geq p _ {r _ {s}, t} \right\} (21a) \\ \leq \max _ {\left\{p _ {r _ {s}, t} \right\} _ {r _ {s}}} \sum_ {r _ {s}} \mathbf {P r} _ {s l} \left(r _ {s} | t\right) \sum_ {b} \varphi (b) \cdot p _ {r _ {s}, t} \cdot \mathbf {1} \left\{U B \left(r _ {s}, b\right) \geq p _ {r _ {s}, t} \right\} \\ - \max _ {\left\{p _ {r s, t} \right\} _ {r _ {s}}} \sum_ {r _ {s}} \mathbf {P r} _ {s l} \left(r _ {s} | t\right) \sum_ {b} \varphi (b) \cdot p _ {r _ {s}, t} \cdot \mathbf {1} \left\{U B \left(r _ {s}, b\right) - \frac {4 \epsilon}{1 - \epsilon^ {2}} \bar {u} \geq p _ {r _ {s}, t} \right\}. (21b) \\ \end{array} +$$ + +In the following, we can assume for each $r_s$ that $\max_{p_{r_s,t}}\sum_b\varphi (b)\cdot p_{r_s,t}\cdot \mathbf{1}\{UB(r_s,b)\geq p_{r_s,t}\} >0$ . Otherwise, the revenue gap between the upper bound and the lower bound is 0, leading to the desired $C$ -approximation. + +In the (21b), there are two posted price mechanisms. After optimizing the first posted price mechanism, the gap between the upper bound and the lower bound is further upper bounded by + +$$ +\begin{array}{l} (2 1 b) \leq \sum_ {r _ {s}} \mathbf {P r} _ {s l} (r _ {s} | t) \Phi_ {r _ {s}} ^ {\geq} \left(b _ {r _ {s}} ^ {*}\right) U B (r _ {s}, b _ {r _ {s}} ^ {*}) - \sum_ {r _ {s}} \mathbf {P r} _ {s l} (r _ {s} | t) \Phi_ {r _ {s}} ^ {\geq} \left(b _ {r _ {s}} ^ {*}\right) \left(U B (r _ {s}, b _ {r _ {s}} ^ {*}) - \frac {4 \epsilon}{1 - \epsilon^ {2}} \bar {u}\right) \\ = \sum_ {r _ {s}} \mathbf {P r} _ {s l} (r _ {s} | t) \Phi_ {r _ {s}} ^ {\geq} (b _ {r _ {s}} ^ {*}) \frac {4 \epsilon}{1 - \epsilon^ {2}} \bar {u} \\ \leq \frac {4 \epsilon}{1 - \epsilon^ {2}} \bar {u}, \\ \end{array} +$$ + +where $b_{r_s}^*$ is the optimal private type maximizing $\sum_b \varphi(b) \cdot p_{r_s, t} \cdot 1\{UB(r_s, b) \geq p_{r_s, t}\}$ and $\Phi_{r_s}^*(b_{r_s}^*) = \sum_{b \in S_{r_s}} \varphi(b)$ with $S_{r_s} = \{b | UB(r_s, b) \geq UB(r_s, b_{r_s}^*)\}$ . Thus, when selling according to the lower bound mechanism, we obtain a $C$ -approximate algorithm. + +**Mechanism:** Recall that $LB(r_s, b) < 0$ can occur. The derived mechanism sets the price $p_{r_s, t} = \max \{LB(r_s, b_{r_s}^*), 0\}$ where $b_{r_s}^*$ is the optimal type for the problem + +$$ +\max _ {p _ {r _ {s}, t}} \sum_ {b} \varphi (b) \cdot p _ {r _ {s}, t} \cdot \mathbf {1} \{L B (r _ {s}, b) \geq p _ {r _ {s}, t} \}. \tag {22} +$$ + +Recall that for any given accuracy $r_s$ and private type $b$ , $LB(r_s, b)$ lower bounds the utility that the learner computes with the true prior belief $\mu_{ml}(q)$ . Hence, when the learner makes purchasing-or-not decision under $\mu_{ml}(q)$ , the probability of accepting the posted price offered by the mechanism will be higher than the probability obtained in (22), leading to higher revenue. The optimal $t^*$ can be obtained by enumeration as Lemma B.1. + +In summary, the mechanism works as below: + +1. The seller shares $t^*$ quantity of data with the machine learner; +2. The learner trains the ML model and the preliminary accuracy $r_s$ is simultaneously observed by both parties; +3. The seller then charges a price $p_{r_s, t^*} = \max \{LB(r_s, b_{r_s}^*), 0\}$ ; +4. The machine learner computes his expected utility for the remaining data based on the true prior $\mu_{ml}$ and determines whether to accept the offer. + +![](images/edd402cd8d86f646dfa25080e75492ee5a57c553963be5ca1a0754da1f2ad531.jpg) + +# F. Derivation of (12) + +The expected revenue in (4) is realized as + +$$ +\max _ {\mathcal {T}, p _ {r _ {s}, \mathcal {T}}} \sum_ {r _ {s}} \mathbf {P r} (r _ {s} | \mathcal {T}) \cdot \sum_ {b} \varphi (b) \cdot p _ {r _ {s}, \mathcal {T}} \cdot \mathbf {1} \left\{\sum_ {q} \sum_ {r _ {m}} \lambda (r _ {m} | q _ {\mathcal {D}}) u (r _ {m}, b) \mathbf {P r} (q | r _ {s}, \mathcal {T}) - u (r _ {s}, b) \geq p _ {r _ {s}, \mathcal {T}} \right\}, \tag {23} +$$ + +where $\mathbf{Pr}(r_s|\mathcal{T}) = \sum_{q\mathcal{T}}\lambda (r_s|q_{\mathcal{T}})\mu (q_{\mathcal{T}})$ . The machine learner's estimate for quality can be rewritten as + +$$ +\begin{array}{l} \Pr \left(q \mid r _ {s}, \mathcal {T}\right) = \frac {\lambda \left(r _ {s} \mid q , \mathcal {T}\right) \mu (q)}{\sum_ {q} \lambda \left(r _ {s} \mid q , \mathcal {T}\right) \mu (q)} \\ = \frac {\lambda \left(r _ {s} \mid q , \mathcal {T}\right) \mu \left(q _ {\mathcal {R}} \mid q _ {\mathcal {T}}\right) \mu \left(q _ {\mathcal {T}}\right)}{\sum_ {q _ {\mathcal {T}}} \sum_ {q _ {\mathcal {R}}} \lambda \left(r _ {s} \mid q , \mathcal {T}\right) \mu \left(q _ {\mathcal {R}} \mid q _ {\mathcal {T}}\right) \mu \left(q _ {\mathcal {T}}\right)} \\ = \mu \left(q _ {\mathcal {R}} \mid q _ {\mathcal {T}}\right) \Pr \left(q _ {\mathcal {T}} \mid r _ {s}, \mathcal {T}\right), \\ \end{array} +$$ + +where $\mathbf{Pr}(q_{\mathcal{T}}|r_s,\mathcal{T}) = \frac{\lambda(r_s|q,\mathcal{T})\mu(q_{\mathcal{T}})}{\sum_{q_{\mathcal{T}}} \lambda(r_s|q,\mathcal{T})\mu(q_{\mathcal{T}})}$ . Hence, given the observed accuracy $r_s$ and shared subset $\mathcal{T}$ , the remaining expected utility is computed as + +$$ +\sum_ {q} \sum_ {r _ {m}} \lambda \left(r _ {m} \mid q, \mathcal {D}\right) u \left(r _ {m}, b\right) \mu \left(q _ {\mathcal {R}} \mid q _ {\mathcal {T}}\right) \mathbf {P r} _ {s} \left(q _ {\mathcal {T}} \mid r _ {s}, \mathcal {T}\right) - u \left(r _ {s}, b\right). \tag {24} +$$ + +Since $\mathcal{T}$ finally should be deterministically chosen by some algorithm, we eliminate subscript $\mathcal{T}$ from $p_{r_s,\mathcal{T}}$ in the rest of discussion for easy exposition. Then (23) equals + +$$ +\begin{array}{l} \sum_ {r _ {s}} \mathbf {P r} (r _ {s} | \mathcal {T}) \cdot \sum_ {b} \varphi (b) \cdot p _ {r _ {s}} \cdot \mathbf {1} \left\{\sum_ {q} \sum_ {r _ {m}} \lambda (r _ {m} | q, \mathcal {D}) u (r _ {m}, b) \mathbf {P r} _ {s} (q | r _ {s}, \mathcal {T}) - u (r _ {s}, b) \geq p _ {r _ {s}} \right\} \\ = \sum_ {r _ {s}} \mathbf {P r} (r _ {s} | \mathcal {T}) \cdot \sum_ {b} \varphi (b) \cdot p _ {r _ {s}} \cdot 1 \left\{\sum_ {q} \sum_ {r _ {m}} \lambda (r _ {m} | q, \mathcal {D}) u (r _ {m}, b) \mu (q _ {\mathcal {R}} | q _ {\mathcal {T}}) \mathbf {P r} _ {s} (q _ {\mathcal {T}} | r _ {s}, \mathcal {T}) - u (r _ {s}, b) \geq p _ {r _ {s}} \right\} \\ = \sum_ {r _ {s}} \sum_ {b} \varphi (b) \cdot p _ {r _ {s}} \cdot 1 \Big \{\sum_ {q} \sum_ {r _ {m}} \lambda (r _ {m} | q, \mathcal {D}) u (r _ {m}, b) \mu (q _ {\mathcal {R}} | q _ {\mathcal {T}}) \lambda (r _ {s} | q _ {\mathcal {T}}) \mu (q _ {\mathcal {T}}) - \Big (\sum_ {q _ {\mathcal {T}}} \lambda (r _ {s} | q _ {\mathcal {T}}) \mu (q _ {\mathcal {T}}) \Big) u (r _ {s}, b) \geq p _ {r _ {s}} \Big \} \\ = \sum_ {r _ {s}} \sum_ {b} \varphi (b) \cdot p _ {r _ {s}} \cdot 1 \Big \{\sum_ {q} \sum_ {r _ {m}} \lambda (r _ {m} | q, \mathcal {D}) u (r _ {m}, b) \mu (q) \lambda (r _ {s} | q _ {\mathcal {T}}) - \Big (\sum_ {q _ {\mathcal {T}}} \lambda (r _ {s} | q _ {\mathcal {T}}) \mu (q _ {\mathcal {T}}) \Big) u (r _ {s}, b) \geq p _ {r _ {s}} \Big \}, \\ \end{array} +$$ + +where the second equality holds by moving $\mathbf{Pr}(r_s|\mathcal{T})$ inside the indicator function and the third equality holds because $\mu (q) = \mu (q_{\mathcal{R}}|q_{\mathcal{T}})\mu (q_{\mathcal{T}})$ . + +We then focus on the part within the indicator function. Recall that $\lambda(r|q, \mathcal{T})$ is a point distribution defined in (11). Therefore, in the first summation over $q$ , only quality vectors $q$ with $f(q_{\mathcal{T}}) = r_s$ are left. Additionally, we have $u(r_m, b) = u(f(q), b)$ + +because $\lambda (r|q,\mathcal{T})$ is a point distribution. Similar analysis is applied to the second term. Then, we have the following formulation + +$$ +\sum_ {r _ {s}} \sum_ {b} \varphi (b) \cdot p _ {r _ {s}} \cdot {\bf 1} \Big \{\sum_ {q | f (q _ {\mathcal {T}}) = r _ {s}} \mu (q) u (f (q), b) - \sum_ {q _ {\mathcal {T}} | f (q _ {\mathcal {T}}) = r _ {s}} \mu (q _ {\mathcal {T}}) u (f (q _ {\mathcal {T}}), b) \geq p _ {r _ {s}} \Big \}. +$$ + +# G. Proof of Theorem 4.1 + +The proof of Theorem 4.1 mainly consists of Lemma G.1 and Lemma G.4, where Lemma G.1 shows that maximizing (12) subject to a cardinality constraint is NP-hard while Lemma G.4 shows the inapproximation results based on a similar construction as that in Lemma G.1. + +# G.1. Proof of NP-hardness + +Lemma G.1 It is NP-hard to compute the optimal mechanism. + +Proof of Lemma G.1. We observe that maximizing (12) can be equivalently described as follows: The set $\mathcal{D}$ contains $M + 1$ features and there are $N + 1$ possible choices of quality vectors $q$ . It can be considered as a matrix $\mathcal{D} \in R^{(N + 1) \times (M + 1)}$ . We select a subset $\mathcal{T}$ of features (i.e., columns in matrix $\mathcal{D}$ ) to maximize the objective function in (12). After that, the $N$ quality vectors are divided into different groups according to $f(q_{\mathcal{T}})$ of the selected quality subvectors, i.e., given an $r_s$ , quality vectors with $f(q_{\mathcal{T}}) = r_s$ are classified to the same group. The constructed instance $\mathcal{D}$ of size $(N + 1) \times (M + 1)$ is shown in Figure 3. + +The constructed instance $\mathcal{D}$ consists of 1 H-quality vector and $N$ L-quality vectors. As shown in Figure 3, the H-quality vector is of $M + 1$ dimensions, which has value $H$ in the last entry and $\epsilon$ in other entries. The L-quality vector has value $L$ in the last entry while it has 0 and $\epsilon$ in its first $M$ entries. We have the following two assumptions: i) $H > L \gg \epsilon$ , and ii) $M\epsilon < L$ and $L + M\epsilon < H$ . + +We consider a special case of utility function $u(r, b)$ set as follows: + +$$ +u (r, b) = \left\{ \begin{array}{c c} u (H, b), & r \geq H \\ u (L, b), & L \leq r < H \\ 0, & r < L. \end{array} \right. \tag {25} +$$ + +Such construction indicates that the last column in $D$ is much more important than others. Therefore, the seller will never share the last dimension with the machine learner, otherwise (12) will give 0 revenue. In other words, if $\mathcal{T}$ includes the $(M + 1)^{th}$ column, then the value within the indicator is 0: + +$$ +\begin{array}{l} \sum_ {q | f (q _ {\mathcal {T}}) = r _ {s}} \mu (q) u (f (q), b) - \sum_ {q _ {\mathcal {T}} | f (q _ {\mathcal {T}}) = r _ {s}} \mu (q _ {\mathcal {T}}) u (f (q _ {\mathcal {T}}), b) \\ = \sum_ {q | f (q _ {\mathcal {T}}) = r _ {s}} \mu (q) \left(u (f (q), b) - u (f (q _ {\mathcal {T}}), b)\right) \\ = 0. \\ \end{array} +$$ + +Therefore, the optimal $\mathcal{T}$ is a subset of the first $M$ features. From our construction in (25), we know $u(f(q_{\mathcal{T}}),b) = 0$ since $f(q_{\mathcal{T}}) < L$ . Then, (12) is equivalent to + +$$ +\begin{array}{l} \max _ {\mathcal {T}, \left\{p _ {r _ {s}} \right\} _ {r _ {s}}} \quad \sum_ {r _ {s}} \sum_ {b} \varphi (b) \cdot p _ {r _ {s}} \cdot 1 \left\{\sum_ {q \mid f (q _ {\mathcal {T}}) = r _ {s}} \mu (q) u (f (q), b) \geq p _ {r _ {s}} \right\} \tag {26} \\ \begin{array}{c c} \text {s . t .} & | \mathcal {T} | \leq T. \end{array} \\ \end{array} +$$ + +We further assume that $\mu(q)$ is a uniform distribution. Thus, we can safely remove $\mu(q)$ from (26) without affecting our analysis. + +By the following lemma, we show that the maximum possible value of the objective function in (26) can be achieved by separating the H-quality vector from all L-quality vectors. "Separate" means that the H-quality vector and the L-quality vectors are divided into different groups according to the value $f(q_{\mathcal{T}})$ . + +Lemma G.2 Suppose there are two quality vectors with sum of quality as $H$ and $L$ , respectively. Recall $u(r, b)$ is increasing in $b$ . Let $b_{H}^{*}$ be the optimal private type for $\max_{p_{H}} \sum_{b} \varphi(b) \cdot p_{H} \cdot 1\{u(H, b) \geq p_{H}\}$ and the solution is $(1 - \Phi(b_{H}^{*}))u(H, b_{H}^{*})$ as that in Observation A.2. Similarly, $b_{L}^{*}$ is optimal type for $\max_{p_{L}} \sum_{b} \varphi(b) \cdot p_{L} \cdot 1\{u(L, b) \geq p_{L}\}$ . + +Assume $b_H^* \neq b_L^*$ . We then have higher value by separating $H$ from $L$ , that is + +$$ +\begin{array}{l} \max _ {p} \sum_ {b} \varphi (b) \cdot p \cdot 1 \{u (H, b) + u (L, b) \geq p \} (27a) \\ < \max _ {p _ {H}} \sum_ {b} \varphi (b) \cdot p _ {H} \cdot 1 \{u (H, b) \geq p _ {H} \} + \max _ {p _ {L}} \sum_ {b} \varphi (b) \cdot p _ {L} \cdot 1 \{u (L, b) \geq p _ {L} \}. (27b) \\ \end{array} +$$ + +Proof: First, we show that it is reasonable to assume $b_{H}^{*} \neq b_{L}^{*}$ . We can construct such an example: let i) $b \in \{b_1, b_2\}$ with $b_{1} < b_{2}$ and $\varphi(b_{1}) = \varphi(b_{2}) = \frac{1}{2}$ , and ii) setting $u(H, b_{1}) = 10$ , $u(H, b_{2}) = 18$ , $u(L, b_{1}) = 5$ and $u(L, b_{2}) = 12$ . By simple calculation, we know $b_{H}^{*} = b_{1}$ and $b_{L}^{*} = b_{2}$ . Thus, the assumption is reasonable. + +Second, we know $u(r,b)$ is increasing in $b$ . Thus, there should exist one optimal type $b^{*}$ at which the (27a) achieves the maximum value $(1 - \Phi (b^{*}))(u(H,b^{*}) + u(L,b^{*}))$ , where $\Phi$ is the cumulative density function of $\varphi$ . + +Similarly, for (27b), we have $b_{H}^{*}$ and $b_{L}^{*}$ such that (27b) achieves the maximum value, which equals $(1 - \Phi(b_{H}^{*}))u(H, b_{H}^{*}) + (1 - \Phi(b_{L}^{*}))u(H, b_{L}^{*})$ . + +Since $b_{H}^{*}$ is optimal, we have $(1 - \Phi(b^{*}))u(H, b^{*}) \leq (1 - \Phi(b_{H}^{*}))u(H, b_{H}^{*})$ . Similar result holds for $b_{L}^{*}$ . Combining them, we have + +$$ +\begin{array}{l} \max _ {p} \sum_ {b} \varphi (b) \cdot p \cdot 1 \{u (H, b) + u (L, b) \geq p \} \\ \leq \max _ {p _ {H}} \sum_ {b} \varphi (b) \cdot p _ {H} \cdot 1 \{u (H, b) \geq p _ {H} \} + \max _ {p _ {L}} \sum_ {b} \varphi (b) \cdot p _ {L} \cdot 1 \{u (L, b) \geq p _ {L} \}. \\ \end{array} +$$ + +We can see that the equality holds if and only if $b^{*} = b_{H}^{*} = b_{L}^{*}$ . Since $b_{H}^{*} \neq b_{L}^{*}$ , we can only have inequality. Thus, we prove the lemma. + +In a similar way, we can prove that for our construction with $N$ L-quality vectors, only when separating $N$ L-quality vectors from the H-quality vector, can we have the maximum value achieved by (26) as + +$$ +\max _ {p _ {H}} \sum_ {b} \varphi (b) \cdot p _ {H} \cdot 1 \{u (H, b) \geq p _ {H} \} + N \cdot \max _ {p _ {L}} \sum_ {b} \varphi (b) \cdot p _ {L} \cdot 1 \{u (L, b) \geq p _ {L} \}. \tag {28} +$$ + +Note that whether separating some L-quality vectors from other L-quality vectors or not does not change the revenue, i.e., $\max_{p_L}\sum_b\varphi (b)\cdot p_L\cdot 1\{N\cdot u(L,b)\geq p_L\} = N\cdot \max_{p_L}\sum_b\varphi (b)\cdot p_L\cdot 1\{u(L,b)\geq p_L\}$ + +The NP-hardness is proved by a reduction from the set cover problem (Cormen et al., 2009) defined as: Given a ground set $\mathcal{U} = \{1,2,\dots ,N\}$ , a collection of $M$ subsets of $\mathcal{U}$ and an integer $T$ , determine if there exists a collection $\mathcal{C}$ of at most $T$ subsets so that all the elements in $\mathcal{U}$ are covered (i.e., included) in $\mathcal{C}$ ? + +Given a set cover instance, we construct one instance of (26) as follows: The ground set $\mathcal{U}$ corresponds to the $N$ L-quality vectors, while $M$ subsets correspond to the first $M$ feature columns in $D$ . The given integer $T$ is the cardinality constraint in (26). The feature column is constructed as follows. For the $k^{\mathrm{th}}$ feature, given a subset $\mathcal{S} = \{i_1,i_2,\dots ,i_k,\dots i_s\}$ in the set cover instance, we set the $k^{\mathrm{th}}$ entry in the $i_k\in S$ L-quality vectors as 0 while the $k^{\mathrm{th}}$ entry in other L-quality vectors (i.e., $\mathcal{U}\setminus \mathcal{S})$ are set as $\epsilon$ . We use one example to explain our construction: Given a set cover instance with a ground set $\mathcal{U} = \{1,2,3\}$ , a collection of 3 subsets $\{2\}$ , $\{1,3\}$ and $\{1,2\}$ . It corresponds to a $D$ of size $4\times 4$ , consisting of $1\textrm{H}$ -quality vector $[\epsilon ,\epsilon ,\epsilon ,H]$ and $3\textrm{L}$ -quality vectors $[\epsilon ,0,0,L],[0,\epsilon ,0,L]$ and $[\epsilon ,0,\epsilon ,L]$ . + +Note that when selecting a subset of feature columns $\mathcal{T}$ , the sum of entries in the corresponding quality subvector $f(q_{\mathcal{T}})$ of the H-quality vector is $|\mathcal{T}|\epsilon$ , while some of the L-quality vectors have their $f(q_{\mathcal{T}})$ less than $|\mathcal{T}|\epsilon$ because some entries of the selected set of features $\mathcal{T}$ are 0. See Figure 3 for an example: $f(q_{\mathcal{T}}) = |\mathcal{T}|\epsilon = 2\epsilon$ for H-quality vector while that for the first L-quality vector is $f(q_{\mathcal{T}}) = \epsilon$ . In this way, we can separate the H-quality vector from L-quality vectors according to the value of $f(q_{\mathcal{T}})$ . + +Recall that only when separating the H-quality vector from $N$ L-quality vectors (i.e., $\mathcal{U}$ is fully covered), can we achieve the maximum value of (26) as in (28). Therefore, we can answer the decision version of the set cover problem by optimizing (26). Thus, the lemma is proved. + +# G.2. Proof of Inapproximation Ratio + +The proof of inapproximation ratio makes use of the result from (Feige, 1998), as in the following. + +Lemma G.3 [rephrased Proposition 5.2 in (Feige, 1998)] Given a maximum coverage instance with an integer $T$ as the optimal value (i.e., $T$ is the minimum number of subsets needed so that all the elements in $\mathcal{U}$ are covered) of a set cover instance with the same input, there is no polynomial algorithm giving a coverage of size $(1 - \frac{1}{e} + o(1))N$ where $N$ is the number of elements in the ground set. + +Proof: The proof mainly follows from (Feige, 1998). We put it here for completeness. We first show that for such a maximum coverage instance with the given integer $T$ as the optimal value of the corresponding set cover, it is NP-hard to compute the optimal solution. This can be done by contradiction. If computing the optimal solution for this instance is polynomial solvable, then by solving it, we actually can solve the set cover problem in polynomial time. Thus, it is NP-hard. + +Assume a polynomial algorithm $A$ approximates this maximum coverage problem within a ratio of $1 - 1 / e + o(1)$ . One can show that a polynomial time algorithm $B$ , with $A$ as subroutine, can approximate the set cover problem within $(1 - \delta) \ln n$ implying $NP \subset TIME(n^{O(\log \log n)})$ . + +Algorithm $B$ repeatedly applies $A$ on the maximum coverage problem, where after each application the points already covered are removed, but $T$ remains unchanged. Since $T$ remains unchanged and is the optimal value of the set cover problem. By the assumption, each time, at least $1 - 1 / e + \epsilon$ of the remaining points are covered. Thus, application of $A$ is at most $l$ times implying $(1 / e + \epsilon)^{l} = 1 / n$ , where $n$ is the size of the instance. The number of sets used is at most $lK$ . One can obtain that $l = \frac{1}{1 - \ln(1 - e\epsilon)}\ln n < (1 - \delta)\ln n$ for some $\delta >0$ . Then, it means $\mathsf{NP}\subset TIME(n^{O(\log \log n)})$ . + +Now, we are ready to prove the inapproximation ratio. + +Lemma G.4 The problem (12) cannot be approximated within a ratio $\frac{e}{e + 1} + o(1)$ in polynomial time. + +Proof: We utilize the maximum coverage problem in our proof defined as: Given a ground set $\mathcal{U} = \{1,2,\dots ,N\}$ , a collection of $M$ subsets of $\mathcal{U}$ and an integer $T$ , find a collection $\mathcal{C}$ of no more than $T$ subsets such that the number of elements included in $\mathcal{C}$ is maximized. Note that the maximum coverage problem and the set cover problem have the same input. + +We construct a maximum coverage instance with integer $T$ as the optimal value of a set cover instance with the same input, as in Lemma G.3. Recall that by Lemma G.3, no polynomial algorithm can reach an approximation ratio $1 - \alpha = 1 - \frac{1}{e} + o(1)$ for the maximum coverage problem. + +The construction of our instance is the same as that in Lemma G.1 except the following change: + +- There are only two private types $\{b_1, b_2\}$ for the machine learner and their probabilities are $\varphi(b_1) = 1 - \frac{1}{\alpha N}$ and $\varphi(b_2) = \frac{1}{\alpha N}$ , respectively. $b_1 < b_2$ . +- Let $u(L, b_1) = 1 - \frac{1}{N}, u(L, b_2) = 1, u(H, b_1) = 1$ and $u(H, b_2) = (\alpha N)^2$ . + +Recall that the prior over quality vector $\mu(q)$ is uniform distribution. We thus can eliminate $\mu(q)$ without affecting our following analysis. By such construction, we can see that + +- for $H$ -vector, $\max_{p_H} \sum_b \varphi(b) \cdot p_H \cdot 1\{u(H,b) \geq p_H\} = (1 - \Phi(b_H)) u(H,b_H) = \alpha N$ , where the optimal type $b_H$ is $b_2$ . +for $L$ -vectors, $\max_{p_L}\sum_b\varphi (b)\cdot p_L\cdot 1\{u(L,b)\geq p_L\} = 1 - \frac{1}{N},$ where the optimal type $b_{L}$ is $b_{1}$ + +Thus, the optimal choices of $b$ for the H-quality vector and L-quality vectors satisfy $b_{H} \neq b_{L}$ . By Lemma G.2, we know that the optimal value is obtained by separating the H-quality vector from L-quality vectors. + +We are now ready to show the inapproximability. The optimal solution given constraint $|\mathcal{T}|\leq T$ will be to separate the H-quality vector from $N$ L-quality vectors, which is + +$$ +\begin{array}{l} \max _ {p _ {H}} \sum_ {b} \varphi (b) \cdot p _ {H} \cdot 1 \{u (H, b) \geq p _ {H} \} + \max _ {p _ {L}} \sum_ {b} \varphi (b) \cdot p _ {L} \cdot 1 \{N u (L, b) \geq p _ {L} \} \\ = (1 - \Phi (b _ {2})) u (H, b _ {2}) + (1 - \Phi (b _ {1})) N u (L, b _ {1}) \\ = \alpha N + N - 1. \\ \end{array} +$$ + +We know by Lemma G.3 that the polynomial algorithm covers less than $(1 - \alpha)N$ elements (i.e., $N$ L-quality vectors), which means that the H-quality vector will be mixed with at least $\alpha N$ L-quality vectors. Suppose that $(1 - \alpha')N$ elements are covered where $(1 - \alpha) > (1 - \alpha')$ . The revenue is upper bounded by + +$$ +\begin{array}{l} \max _ {p _ {H L}} \sum_ {b} \varphi (b) \cdot p _ {H L} \cdot 1 \{u (H, b) + \alpha^ {\prime} N u (L, b) \geq p _ {H L} \} \\ + \max _ {p _ {L}} \sum_ {b} \varphi (b) \cdot p _ {L} \cdot 1 \left\{\left(1 - \alpha^ {\prime}\right) N u (L, b) \geq p _ {L} \right\} \\ < \max _ {p _ {H L}} \sum_ {b} \varphi (b) \cdot p _ {H L} \cdot 1 \{u (H, b) + \alpha N u (L, b) \geq p _ {H L} \} \\ + \max _ {p _ {L}} \sum_ {b} \varphi (b) \cdot p _ {L} \cdot 1 \{(1 - \alpha) N u (L, b) \geq p _ {L} \} \\ = \max _ {p _ {H L}} \sum_ {b} \varphi (b) \cdot p _ {H L} \cdot 1 \{u (H, b) + \alpha N u (L, b) \geq p _ {H L} \} + (1 - \alpha) (N - 1). \\ \end{array} +$$ + +The inequality comes from the fact that mixing the H-quality vector with more L-quality vectors can only decrease the revenue. This is because all L-quality vectors share the same optimal $b_{L}$ . The proof is similar to that of Lemma G.2. + +We will focus on $\max_{p_{HL}}\sum_b\varphi (b)\cdot p_{HL}\cdot 1\{u(H,b) + \alpha Nu(L,b)\geq p_{HL}\}$ . If the optimal $b$ is $b_{1}$ , then it equals + +$$ +\left(1 - \Phi (b _ {1})\right) \left(u (H, b _ {1}) + \alpha N u (L, b _ {1})\right) = 1 + \alpha N - \alpha . +$$ + +If the optimal $b$ is $b_{2}$ , then it equals + +$$ +\left(1 - \Phi (b _ {2})\right) \left(u (H, b _ {2}) + \alpha N u (L, b _ {2})\right) = \frac {1}{\alpha N} \left((\alpha N) ^ {2} + \alpha N\right) = \alpha N + 1. +$$ + +Thus, the maximum possible revenue achieved by a polynomial algorithm is upper bounded by + +$$ +\max _ {p _ {H L}} \sum_ {b} \varphi (b) \cdot p _ {H L} \cdot 1 \{u (H, b) + \alpha N u (L, b) \geq p _ {H L} \} + (1 - \alpha) (N - 1) = N + \alpha . +$$ + +Finally, because $\alpha = \frac{1}{e} - o(1)$ , we have ratio for large $N$ + +$$ +\frac {N + \alpha}{\alpha N + N - 1} = \frac {N}{\alpha N + N} + o (1) = \frac {e}{e + 1} + o (1). \tag {29} +$$ + +# H. Omitted Proof in Section 4.2 + +# H.1. Proof of Observation 4.2 + +Lemma H.1 In general, the objective function in (12) is not a submodular set function. + +![](images/9f40cdfe969ec75a0232253745735e54faff60628c1302c84174fdc63ebcaf04.jpg) + +Proof: We prove it by constructing a counter example. Suppose there are 4 vectors: $1\mathrm{H}$ -quality vector $[\epsilon, \epsilon, \epsilon, \epsilon, H]$ and 3 L-quality vectors $[\epsilon, 0, \epsilon, 0, L], [\epsilon, 0, 0, \epsilon, L]$ and $[\epsilon, \epsilon, 0, 0, L]$ . We set uniform prior $\mu(q) = \frac{1}{4}$ . Suppose $b \in \{b_1, b_2\}$ with $b_1 < b_2$ and the distribution over $\{b_1, b_2\}$ is uniform, i.e., $\varphi(b) = \frac{1}{2}$ . The utility function $u(r, b)$ is defined the same as in (25). Furthermore, we set $u(H, b_1) = 10$ , $u(H, b_2) = 18$ , $u(L, b_1) = 5$ and $u(L, b_2) = 12$ . Hence, the ground set is $\mathcal{U} = \{1, 2, 3, 4, 5\}$ . + +Denote the revenue in (12) as $F(\mathcal{T})$ where $\mathcal{T}$ is the shared subset of features. Submodularity implies that for any set $S \subseteq T$ and any $l \in \mathcal{U} \setminus T$ , $F(S \cup l) - F(S) \geq F(T \cup l) - F(T)$ . But in our example, by choosing $S = \{1\} \subseteq T = \{1,4\}$ , we have $F(S) = 6.75$ and $F(T) = 6.75$ . By adding $l = \{3\}$ to both sets, $F(S \cup l) = 6.75$ and $F(T \cup l) = 7$ . We can see that $F(T \cup l) - F(T) = 0.25 > F(S \cup l) - F(S) = 0$ . It contradicts the definition of submodularity. Thus, the objective function in (12) in general is not a submodular function. + +Lemma H.2 The greedy algorithm (i.e., each step selects one feature that gives the largest increase of revenue) can give arbitrarily bad approximation with respect to the increase of revenue. + +Proof: We show one instance of (12) to which the greedy algorithm gives arbitrarily bad results regarding the increase of revenue. The instance constructed is the same as that in the proof of Lemma H.1. Let $G(S) = F(S) - F(\emptyset)$ be the revenue increase, compared with selling the entire dataset directly according to the prior $\mu(q)$ , i.e., $F(\emptyset)$ . The seller will not share the $5^{th}$ feature because $G(\{5\}) = F(\{5\}) - F(\emptyset) < 0$ . One optimal solution can be $S_1 = \{3,4\}$ and we have $G(\{S_1\}) = 0.25$ . + +However, when applying the greedy algorithm: 1) In the first step, the algorithm computes $G(\{1\}) = G(\{2\}) = G(\{3\}) = G(\{4\}) = 0$ and chooses either one from $\{1,2,3,4\}$ ; 2) If the algorithm chooses $S_{1} = \{1\}$ in the first step, then in the second step, the revenue increase is 0 no matter which feature it chooses, i.e., $G(\{1,2\}) = G(\{1,3\}) = G(\{1,4\}) = 0$ . Compared to the optimal revenue increase $G(\{3,4\}) = 0.25$ , the revenue increase $G(\{1,2\}) = 0$ is arbitrarily bad. + +# H.2. Proof of Theorem 4.3 + +Proof: The revenue obtained by selling the entire dataset without sharing any feature is formulated as + +$$ +\max _ {p} \sum_ {b} \varphi (b) \cdot p \cdot \mathbf {1} \left\{\sum_ {q} \mu (q) u (f (q), b) \geq p \right\}. \tag {30} +$$ + +We know that the optimal revenue achieved by (12) is upper bounded by + +$$ +\begin{array}{l} (1 2) \leq \max _ {\tau , \left\{p _ {r _ {s}}, \tau \right\} _ {r _ {s}}} \sum_ {r _ {s}} \sum_ {b} \varphi (b) \cdot p _ {r _ {s}}, \tau \cdot \mathbf {1} \{\sum_ {q | f (q _ {\tau}) = r _ {s}} \mu (q) u (f (q), b) \geq p _ {r _ {s}} \} (31a) \\ \leq \max _ {\left\{p _ {q} \right\} _ {q}} \sum_ {q} \sum_ {b} \varphi (b) \cdot p _ {q} \cdot \mathbf {1} \left\{\mu (q) u (f (q), b) \geq p _ {q} \right\} (31b) \\ = \sum_ {q} \max _ {p _ {q}} \sum_ {b} \varphi (b) \cdot p _ {q} \cdot \mathbf {1} \left\{\mu (q) u (f (q), b) \geq p _ {q} \right\}, (31c) \\ \end{array} +$$ + +where (31a) follows by removing the loss of utility term in (12), and (31b) is the possibly maximal value achieved by (31a) through separating all the quality vectors $q$ from each other (Lemma G.2). + +To ease the explanation, we consider a special case where $k = 2$ , i.e., the learner only has two private types. It can be easily extended to the case $k > 2$ . Let $b_{1}, b_{2}$ be two private types where $b_{1} < b_{2}$ and their probabilities are $p_{1}$ and $p_{2}$ respectively with $p_{1} + p_{2} = 1$ . Recall that $u(\cdot, b)$ is increasing regarding $b$ . By solving the posted price mechanism in (30), we have the optimal value + +$$ +\max \Bigl \{\sum_ {q} \mu (q) u (f (q), b _ {1}), p _ {2} \sum_ {q} \mu (q) u (f (q), b _ {2}) \Bigr \}, +$$ + +and the upper bounded maximum possible revenue i.e., (31c), is + +$$ +\sum_ {q} \max \left\{\mu (q) u (f (q), b _ {1}), p _ {2} \cdot \mu (q) u (f (q), b _ {2}) \right\}. +$$ + +We furthermore have + +$$ +\begin{array}{l} \max \left\{\mu (q) u (f (q), b _ {1}), p _ {2} \cdot \mu (q) u (f (q), b _ {2}) \right\} \\ < \mu (q) u (f (q), b _ {1}) + p _ {2} \cdot \mu (q) u (f (q), b _ {2}). \\ \end{array} +$$ + +Finally, we have + +$$ +\begin{array}{l} \sum_ {q} \max \left\{\mu (q) u (f (q), b _ {1}), p _ {2} \cdot \mu (q) u (f (q), b _ {2}) \right\} \\ < \sum_ {q} \mu (q) u (f (q), b _ {1}) + p _ {2} \sum_ {q} \mu (q) u (f (q), b _ {2}) \\ \leq 2 \max \left\{\sum_ {q} \mu (q) u (f (q), b _ {1}), p _ {2} \sum_ {q} \mu (q) u (f (q), b _ {2}) \right\}. \\ \end{array} +$$ + +Therefore, we can see that when $k = 2$ , the approximation ratio is $\frac{1}{2}$ . By similar proof as above, we can extend to the case $k > 2$ and obtain approximation ratio $\frac{1}{k}$ . + +# I. Hardness of Column Subset Selection + +The Column Subset Selection problem is defined as below: + +Input: $n$ arbitrary nonnegative vectors $\mathbf{x}^1, \mathbf{x}^2, \ldots, \mathbf{x}^n$ of $m$ -dimension. + +Output: find a minimum-size set of entries $\mathcal{E} \subseteq [m]$ to distinguish all vectors according to the sum of entries, i.e., $\sum_{i \in \mathcal{E}} \mathbf{x}_i^1 \neq \sum_{i \in \mathcal{E}} \mathbf{x}_i^2 \neq \ldots \neq \sum_{i \in \mathcal{E}} \mathbf{x}_i^n$ . + +We prove the following theorem, + +Theorem I.1 The Column Subset Selection problem is NP-hard. + +Proof: As in the proof of binary version of Column Subset Selection problem, we reduce from set cover problem with ground set of size $n$ and $m$ sets. Pick $n$ prime numbers $p_1, \ldots, p_n$ that are all greater than $m$ ; note that these numbers can be selected so that they are polynomial in $n$ and $m$ . We create an $(n + 1)$ -by- $m$ matrix where for $i < n + 1$ , the entry $(i, j)$ is $p_i$ if the $i^{\text{th}}$ element is covered by the $j^{\text{th}}$ set and 0 otherwise; the last row consists of all 0s. + +Consider a subset of columns, which corresponds to a collection of sets. If element $i$ is uncovered (i.e., not included in any of $m$ sets), the row sum over these selected columns is 0, so row $i$ is indistinguishable from row $n + 1$ . If $i$ is covered, it is of the form $k \times p_i$ , where $k$ is at most $m$ and hence smaller than any of the prime numbers. Thus, the sum in the $i^{\text{th}}$ row over these selected columns is divisible by $p_i$ , but not by any $p_j$ with $j \neq i$ . Hence, if there selected columns correspond to a cover, all sums are distinct, and otherwise there must exist some row with sum is zero. + +# J. Two Examples + +The following two examples are modified based on Example 3.3 for justification. + +The first example is for the justification of the first order dominance condition. We construct a model distribution such that for any $t_1 \geq t_2$ , $\mathbb{E}[r|q, t_1] \leq \mathbb{E}[r|q, t_2]$ , i.e., more training data harms the performance. The curves are plotted in Figure 4. We can see that it is optimal for the seller to sell the entire set directly. The revenue of our designed mechanism first drops sharply. Then, it slowly increases, because sharing more data freely gives lower preliminary accuracy and causes less loss of sales value. + +Example J.1 Let $t = 0\% ,1\% ,\ldots {100}\%$ be the quantity of data. Let $r \in \{ 0,1,2,\ldots ,{10}\}$ represent $0\% ,{10}\% ,\ldots {100}\%$ accuracy, $q \in \{ 0,1,2,\ldots ,{10}\}$ and private type $b \in \{ 1,2,\ldots ,{10}\}$ . According to the above characterization, let the valuation function be + +$$ +u (r, b) = \left\{ \begin{array}{c c} 0, & r + b < = 1 0 \\ 1 0 0 0, & r = b = 1 0 \\ 1 0, & o t h e r w i s e. \end{array} \right. +$$ + +The prior belief $\mu (q)$ over $q$ is a Gaussian with standard deviation $\sigma = 3$ and mean $m = 3$ . The accuracy distribution $\lambda (r|q,t)$ is also a Gaussian with $m = \text{round}(q\times (-t + 1))$ and $\sigma = 1.0$ . Let $\sigma = 0$ if $q = 0$ . Set $\lambda (0|q,0) = 1$ . + +![](images/eded5bc46a5a6bfb3c656f57606d65e01f440794b032c527045dc28c07935e18.jpg) +Figure 4. Revenue change with respect to quantity $t$ for Example J.1. + +The second example modifies the valuation function to $u(r, b) = [(r + b) \times r]^{0.6}$ . The valuation function is almost linear in $r$ but concave in $b$ . By the construction, when $r$ is small, $u(r, b)$ is not negligible. For example, when $b = 10$ , comparing $r = 2$ (i.e., $20\%$ accuracy) with $r = 8$ , we have $\frac{[(2 + 8) \times 2]^{0.6}}{[(8 + 8) \times 8]^{0.6}} \approx 0.3$ . It means if the model trained on the shared subset of data achieves $20\%$ accuracy (which in face is a low-accuracy model), the seller may lose $30\%$ of sales value after sharing if the final performance has accuracy $80\%$ , which may lead to less revenue obtained. The revenue curves are plotted in Figure 5, which shows that selling the entire set directly is optimal. + +Example J.2 Let $t = 0\%, 1\%, \ldots, 100\%$ be the quantity of data. Let $r \in \{0, 1, 2, \ldots, 10\}$ represent $0\%, 10\%, \ldots, 100\%$ accuracy, $q \in \{0, 1, 2, \ldots, 10\}$ and private type $b \in \{1, 2, \ldots, 10\}$ . According to the above characterization, let the valuation function be $u(r, b) = ((r + b) \times r)^{0.6}$ . The prior belief $\mu(q)$ over $q$ is a Gaussian with standard deviation $\sigma = 3$ and mean $m = 3$ . The accuracy distribution $\lambda(r|q, t)$ is also a Gaussian with $m = \text{round}(q \cdot t)$ and $\sigma = 0.1 \times (-(t - 0.5)^2 + 0.25)$ . Let $\sigma = 0$ if $q = 0$ . Set $\lambda(0|q, 0) = 1$ + +![](images/cbd4ce6725bf12078bd41c4bcafcf7396e134d562f17c78e0a1e631f0ff33880.jpg) +Figure 5. Revenue change with respect to quantity $t$ for Example J.2. + +K. Notations Summary + +
pr_s,τPrice menu. Posted price given shared subset T of data points and observed preliminary accuracy rs
qquality of the data, determined by the model design and data itself. In homogeneous case, it is a scalar. In heterogeneous case, it is a quality vector.
μ(q)Common prior distribution over q.
μsl(q)the seller's private prior belief over q.
μml(q)the machine learner's private prior belief over q.
u(r,b)the machine learner's valuation function of accuracy r and private type b, non-decreasing in r and b.
φ(b)Commonly known distribution over private type b.
λ(r|q,τ)Probability of outputting accuracy r, conditioning on data quality q and set T.
r, rs, rmr generally denotes the accuracy obtained by ML model; rs specially denotes the preliminary accuracy observed by the two parties after training on the shared set T; rm denotes the accuracy obtained by the ML model trained on the whole set D. All of them have the same domain, and are finite and discrete.
Tshared subset of data points
Duniversal set of data points
Rcomplemented set D \ T
R^D(t)possibly maximal revenue obtained from the whole data set D (i.e., if sharing data cause no loss of sales values), when sharing t quantity of data with the machine learner
G(rs, T, b)the seller's expected remaining utility after sharing subset T of data points and observing accuracy rs, given the learner's private type b
\ No newline at end of file diff --git a/sellingdatatoamachinelearnerpricingviacostlysignaling/images.zip b/sellingdatatoamachinelearnerpricingviacostlysignaling/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..d0b79832a9438213b7d19b7dd9a0b60a7a4a6eb3 --- /dev/null +++ b/sellingdatatoamachinelearnerpricingviacostlysignaling/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fa8e028dfe608d2e34d3483d89237a64ef8d23be2c183b9fb5b6349206e9c298 +size 1125144 diff --git a/sellingdatatoamachinelearnerpricingviacostlysignaling/layout.json b/sellingdatatoamachinelearnerpricingviacostlysignaling/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..25000f52a0d6947634657cecacaef7365263621a --- /dev/null +++ b/sellingdatatoamachinelearnerpricingviacostlysignaling/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e82b1fb40b1bb2c92d3bd3330a49522a06f581942066af190aa2f5d749c101f1 +size 1285588 diff --git a/sequentialandparallelconstrainedmaxvalueentropysearchviainformationlowerbound/0a60bd93-7779-47dd-b40a-914adc7f19dc_content_list.json b/sequentialandparallelconstrainedmaxvalueentropysearchviainformationlowerbound/0a60bd93-7779-47dd-b40a-914adc7f19dc_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..a505758a08eed7210e9e59399eec62ba17c1f9d9 --- /dev/null +++ b/sequentialandparallelconstrainedmaxvalueentropysearchviainformationlowerbound/0a60bd93-7779-47dd-b40a-914adc7f19dc_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c7d7ff9dfa18ef64e7f1c10e973934aa965b2cf4099ed6b55a9cf8ec50f6eee9 +size 218501 diff --git a/sequentialandparallelconstrainedmaxvalueentropysearchviainformationlowerbound/0a60bd93-7779-47dd-b40a-914adc7f19dc_model.json b/sequentialandparallelconstrainedmaxvalueentropysearchviainformationlowerbound/0a60bd93-7779-47dd-b40a-914adc7f19dc_model.json new file mode 100644 index 0000000000000000000000000000000000000000..f86dea6ce972dfea5fb4587d0edfefe402dbc722 --- /dev/null +++ b/sequentialandparallelconstrainedmaxvalueentropysearchviainformationlowerbound/0a60bd93-7779-47dd-b40a-914adc7f19dc_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:81b53aa311cb170977083da1c87a03dcc433106a9e2d3c67a6ca05f81ce6c290 +size 247856 diff --git a/sequentialandparallelconstrainedmaxvalueentropysearchviainformationlowerbound/0a60bd93-7779-47dd-b40a-914adc7f19dc_origin.pdf b/sequentialandparallelconstrainedmaxvalueentropysearchviainformationlowerbound/0a60bd93-7779-47dd-b40a-914adc7f19dc_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..265af385f6c6819c3db12bc11e3d743a799966c3 --- /dev/null +++ b/sequentialandparallelconstrainedmaxvalueentropysearchviainformationlowerbound/0a60bd93-7779-47dd-b40a-914adc7f19dc_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9c26b226fb3e9529e7c933eb62572b651abed83aa5122840cb1d9529a27bcb16 +size 2747910 diff --git a/sequentialandparallelconstrainedmaxvalueentropysearchviainformationlowerbound/full.md b/sequentialandparallelconstrainedmaxvalueentropysearchviainformationlowerbound/full.md new file mode 100644 index 0000000000000000000000000000000000000000..2eb767f2125de00a0bdd5c9e21706de726b0d1fc --- /dev/null +++ b/sequentialandparallelconstrainedmaxvalueentropysearchviainformationlowerbound/full.md @@ -0,0 +1,955 @@ +# Sequential- and Parallel- Constrained Max-value Entropy Search via Information Lower Bound + +Shion Takeno $^{1,2}$ Tomoyuki Tamura $^{3}$ Kazuki Shitara $^{4,5}$ Masayuki Karasuyama + +# Abstract + +Max-value entropy search (MES) is one of the state-of-the-art approaches in Bayesian optimization (BO). In this paper, we propose a novel variant of MES for constrained problems, called Constrained MES via Information lower BOund (CMES-IBO), that is based on a Monte Carlo (MC) estimator of a lower bound of a mutual information (MI). Unlike existing studies, our MI is defined so that uncertainty with respect to feasibility can be incorporated. We derive a lower bound of the MI that guarantees non-negativity, while a constrained counterpart of conventional MES can be negative. We further provide theoretical analysis that assures the low variability of our estimator which has never been investigated for any existing information-theoretic BO. Moreover, using the conditional MI, we extend CMES-IBO to the parallel setting while maintaining the desirable properties. We demonstrate the effectiveness of CMES-IBO by several benchmark functions and real-world problems. + +# 1. Introduction + +Bayesian optimization (BO) has been widely studied as an effective framework for expensive black-box optimization problems. On the other hand, additional unknown constraints often exist in real-world problems of a variety of fields such as scientific experiments, industrial product designs, and automatic machine learning (AutoML). For example, materials discovery can be seen as an optima- + +$^{1}$ Department of Computer Science, Nagoya Institute of Technology, Aichi, Japan $^{2}$ Center for Advanced Intelligence Project, RIKEN, Tokyo, Japan $^{3}$ Department of Physical Science and Engineering, Nagoya Institute of Technology, Aichi, Japan $^{4}$ Joining and Welding Research Institute, Osaka University, Osaka, Japan $^{5}$ Nanostructures Research Laboratory, Japan Fine Ceramics Center, Aichi, Japan. Correspondence to: Masayuki Karasuyama . + +Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s). + +tion of a physical property of materials, such as conductivity, under constraints derived from other physical properties, such as stability. In the case of AutoML, for example, constraints are useful to guarantee the classification accuracy of minority classes for class-imbalanced datasets. However, constrained black-box optimization is often quite difficult because, in many practical problems, a measurement comes at a high cost, and further, functional forms of both the objective and the constraints are unknown. To incorporate unknown constraint functions, constrained BO (CBO) has also been studied (Gardner et al., 2014; Gelbart et al., 2014; Schonlau et al., 1998; Snoek, 2013). CBO tries to achieve the sample-efficient constrained optimization based on Bayesian models for objective and constraint functions. + +Max-value entropy search (MES) (Wang & Jegelka, 2017) is one of the state-of-the-art approaches in BO. The basic idea is to maximize the mutual information (MI) between a querying point and the optimal objective value. For constrained problems, Perrone et al. (2019) have proposed an extension of MES, but it is restricted to only one constraint (note that although their main focus is on a setting in which only a binary indicator of feasibility is observed for constraints, they also show the 'real-valued feedback' case in the appendix). Although it is possible to consider a multiple constraint extension of this approach, which we call constrained MES (CMES), the resulting MI approximation can have a negative value (though the MI should be non-negative) when the number of constraints is more than 5 as we will show in Section 4.1. A more comprehensive review of related studies is shown in Section 5. + +In this paper, we propose a novel information-theoretic CBO method called Constrained Max-value Entropy Search via Information lower BOund (CMES-IBO), which is based on a Monte Carlo (MC) estimator of a lower bound of an MI. We first define the random 'max-value' of a constrained problem so that uncertainty with respect to feasibility (whether the problem has a feasible region or not) can be incorporated. Uncertainty of feasibility has not been considered by existing information-theoretic CBO studies, though for constrained problems in general, to identify the feasibility of the problem is a key issue known as the feasibility problem (Chinneck, 2007). Unlike CMES, our ac + +quisition function guarantees non-negativity. We theoretically and empirically verify that CMES-IBO can provide reasonable acquisition function values even when CMES provides negative values. Further, we provide theoretical analysis that assures the low-variability of our estimator, such as a concentration bound achieving an exponentially fast convergence to the true lower bound in the number of MC samples, which has never been investigated for any existing information-theoretic BO. Moreover, using the conditional MI, we extend CMES-IBO to the parallel setting while maintaining the desirable properties. + +Our main contributions are summarized as follows: + +1. We develop an MI lower bound based CBO called CMES-IBO. Our MI is well-defined even when a feasible region can be empty. The resulting MI approximation is quite simple and guarantees non-negativity. +2. We reveal advantageous properties of CMES-IBO compared with the direct MES extension (CMES), such as the smaller worst-case error of the MI estimation. We also derive an estimation variability of CMES-IBO that suggests robustness with respect to the number of MC samples. +3. We further develop a parallel extension of CMES-IBO, in which multiple queries can be issued simultaneously. The extension is based on a combination of the conditional MI and the greedy selection. + +We demonstrate the effectiveness of CMES-IBO by benchmark and real-world functions. + +# 2. Preliminary + +We are interested in the maximum value of the objective function $f: \mathcal{X} \mapsto \mathbb{R}$ under $C$ constraint functions $g_{c}: \mathcal{X} \mapsto \mathbb{R}$ for $c = 1, \ldots, C$ , where $\mathcal{X} \subset \mathbb{R}^{d}$ is an input space. Let $\mathcal{X}_{\mathrm{feasible}} := \{ \pmb{x} \mid g_{c}(\pmb{x}) \geq z_{c}, c = 1, \ldots, C \}$ be the feasible region, where $z_{c} \in \mathbb{R}$ is a given constant. The optimal solution of this constrained optimization problem is written as $\pmb{x}_{*} := \arg \max_{\pmb{x} \in \mathcal{X}_{\mathrm{feasible}}} f(\pmb{x})$ . We consider the setting that the functions $f$ and $g_{1}, \ldots, g_{C}$ are unknown but can be evaluated simultaneously for any given $\pmb{x} \in \mathcal{X}$ with high observation cost. We assume that $f$ and $g_{1}, \ldots, g_{C}$ follow independent Gaussian processes (GPs) (Rasmussen & Williams, 2005). Suppose that the observations are contaminated with additive Gaussian noises as $y_{\pmb{x}}^{(f)} = f(\pmb{x}) + \varepsilon$ and $y_{\pmb{x}}^{(g_c)} = g_c(\pmb{x}) + \varepsilon$ for $\forall c$ , where $\varepsilon \sim \mathcal{N}(0, \sigma_{\mathrm{noise}}^2)$ . For the GP prior, we employ $\mathcal{GP}(0, k(\pmb{x}, \pmb{x}')')$ , which indicates that the prior mean is 0 and covariance is specified by a kernel function $k: \mathcal{X} \times \mathcal{X} \mapsto \mathbb{R}$ . Then, the predictive distribution for $f(\pmb{x})$ given $D_n^{(f)} = \{(x_i, y_{\pmb{x}_i}^{(f)})\}_{i=1}^n$ is derived + +as follows: + +$$ +\begin{array}{l} f (\boldsymbol {x}) \mid \mathcal {D} _ {n} ^ {(f)} \sim \mathcal {N} \left(\mu^ {(f)} (\boldsymbol {x}), \sigma^ {(f) ^ {2}} (\boldsymbol {x})\right), \\ \mu^ {(f)} (\boldsymbol {x}) = \boldsymbol {k} ^ {\top} \left(\boldsymbol {K} + \sigma_ {\text {n o i s e}} ^ {2} \boldsymbol {I}\right) ^ {- 1} \boldsymbol {y} ^ {(f)}, \\ \sigma^ {(f) ^ {2}} (\boldsymbol {x}) = k (\boldsymbol {x}, \boldsymbol {x}) - \boldsymbol {k} ^ {\top} \left(\boldsymbol {K} + \sigma_ {\text {n o i s e}} ^ {2} \boldsymbol {I}\right) ^ {- 1} \boldsymbol {k}, \\ \end{array} +$$ + +where $\pmb{y}^{(f)} = \left(y_{\pmb{x}_1}^{(f)},\dots ,y_{\pmb{x}_n}^{(f)}\right)^\top$ $k = (k(\pmb {x},\pmb {x}_1),\ldots ,k(\pmb {x},\pmb {x}_n))^{\top}$ $\pmb {K}\in \mathbb{R}^{n\times n}$ is a kernel matrix whose $(i,j)$ element is defined as $k(\pmb {x}_i,\pmb {x}_j)$ and $\pmb {I}\in \mathbb{R}^{n\times n}$ is the identity matrix. The predictive distributions $\mathcal{N}\big(\mu^{(g_c)}(\pmb {x}),\sigma^{(g_c)^2}(\pmb {x})\big)$ for $g_{c}$ can be obtained in the same way using the observations $y_{\pmb{x}_1}^{(g_c)},\dots ,y_{\pmb{x}_n}^{(g_c)}$ . Note that, for simplicity, we here assume the same kernels and noise variances for all the functions, but both the settings can be changed depending on the function. + +# 3. Constrained Max-value Entropy Search via Information Lower Bound + +# 3.1. Max-value of Constrained Problem + +First, we consider the definition of a random variable $f_{*}$ , which is the max-value of a constraint optimization problem. The straightforward definition is $\max_{x \in \mathcal{X}_{\mathrm{feasible}}} f(x)$ , employed in a prior work on the MES-based CBO (Perrone et al., 2019). However, this definition is not well-defined as a proper random variable when $\mathcal{X}_{\mathrm{feasible}}$ can be empty, i.e., when $\operatorname{Pr}(\mathcal{X}_{\mathrm{feasible}} = \emptyset) > 0$ . Note that $\mathcal{X}_{\mathrm{feasible}}$ is randomly determined through GPs $g_{1}, \ldots, g_{C}$ , and thus, $\operatorname{Pr}(\mathcal{X}_{\mathrm{feasible}} = \emptyset) > 0$ can occur even when the underlying unknown true constraint functions have a non-empty feasible region. Thus, we define $f_{*}$ as follows: + +$$ +f _ {*} := \left\{ \begin{array}{l l} \max _ {x \in \mathcal {X} _ {\text {f e a s i b l e}}} f (\boldsymbol {x}), & \text {i f} \mathcal {X} _ {\text {f e a s i b l e}} \neq \emptyset , \\ - \infty , & \text {o t h e r w i s e .} \end{array} \right. \tag {1} +$$ + +Regarding the optimal value as $-\infty$ when no feasible solution exists is a common convention in classical optimization literature (Boyd & Vandenberghe, 2004). The schematic illustration of $f_{*}$ is shown in Fig. 1 (a). The figure indicates that our definition of $p(f_{*})$ can incorporate the uncertainty about whether the problem is feasible or not. + +# 3.2. Acquisition Function of CMES-IBO + +Let + +$$ +\boldsymbol {h} _ {\boldsymbol {x}} := \left(f (\boldsymbol {x}), g _ {1} (\boldsymbol {x}), \dots , g _ {C} (\boldsymbol {x})\right) ^ {\top} \in \mathbb {R} ^ {C + 1}, +$$ + +be a vector concatenating the objective and all the constraint function values. Suppose that we already have the dataset $\mathcal{D}_{t-1}$ , which contains observations for the past $t-1$ queries. We consider selecting a next query $\boldsymbol{x}_t$ by maximiz + +![](images/c11da3f23be1b19757239c0768d70d327143038fa1c17306d5d1005b72f42e62.jpg) +$p(f(\pmb {x}),g_1(\pmb {x})|\pmb {h}_\pmb {x}\in \overline{\mathcal{A}}_{\hat{f}})$ + +![](images/85b686dcbbb8ac3e6f3a99eb928a8dfb6422dabcfd5af0d48bb2416b0aad0887.jpg) +Figure 1: Generative process of the optimal value $f_{*}$ and truncation of the predictive distribution. (a) In the left two plots, two sets of sample paths (red and green) are generated from GPs. The red sample path of $g_{1}$ has the nonempty feasible region $\mathcal{X}_{\mathrm{feasible}}$ while the green sample path has an empty feasible region. The red star $\tilde{f}_{*}$ represents the optimal value of the red sample path, and for the green sample path, the optimal value is defined as $-\infty$ as shown in (1). The distribution of the optimal value is plotted in the upper right figure. (b) The two contour plots represent the density function $p(\pmb{h}_{\pmb{x}}|\pmb{h}_{\pmb{x}}\in \overline{\mathcal{A}_{\tilde{f}_{*}}}) = p(f(\pmb{x}),g_{1}(\pmb{x})|\pmb{h}_{\pmb{x}}\in \overline{\mathcal{A}_{\tilde{f}_{*}}})$ for the feasible and infeasible cases, respectively. For a given $\tilde{f}_{*}$ , the density should be 0 in $\mathcal{A}_{\tilde{f}_{*}}$ , because $f(\pmb{x})$ cannot be larger than the given $\tilde{f}_{*}$ for $\pmb{x}$ such that $g_{1}(\pmb{x})\geq z_{1}$ . + +ing the MI $^1$ between $\pmb {h}_x$ and $f_{*}$ given $\mathcal{D}_{t - 1}$ + +$$ +\operatorname {M I} \left(\boldsymbol {h} _ {\boldsymbol {x}}; f _ {*} | \mathcal {D} _ {t - 1}\right). \tag {2} +$$ + +Hereafter, we omit the conditioning by $\mathcal{D}_{t-1}$ in MI, entropy, density, and probability when it is obvious from the context. For example, $p(h_{\boldsymbol{x}} \mid f_{*})$ indicates $p(h_{\boldsymbol{x}} \mid \mathcal{D}_{t-1}, f_{*})$ . In MI, we use noiseless $\boldsymbol{h}_{\boldsymbol{x}}$ instead of noisy $(y_{\boldsymbol{x}_i}^{(f)}, y_{\boldsymbol{x}_i}^{(g_1)}, \ldots, y_{\boldsymbol{x}_i}^{(g_C)})$ for computational simplicity. + +Since directly evaluating the MI (2) is computationally in + +tractable, we consider a lower bound derived as follows: + +$$ +\operatorname {M I} \left(\boldsymbol {h} _ {\boldsymbol {x}}; f _ {*}\right) = \mathbb {E} _ {f _ {*}} \left[ \mathbb {E} _ {\boldsymbol {h} _ {\boldsymbol {x}} | f _ {*}} \left[ \log \frac {p \left(\boldsymbol {h} _ {\boldsymbol {x}} \mid f _ {*}\right)}{p \left(\boldsymbol {h} _ {\boldsymbol {x}}\right)} \right] \right] +$$ + +$$ += \mathbb {E} _ {f _ {*}} \left[ \mathbb {E} _ {\boldsymbol {h} _ {\boldsymbol {x}} | f _ {*}} \left[ \log \frac {q (\boldsymbol {h} _ {\boldsymbol {x}} | f _ {*})}{p (\boldsymbol {h} _ {\boldsymbol {x}})} \right] + D _ {\mathrm {K L}} \left(p (\boldsymbol {h} _ {\boldsymbol {x}} | f _ {*}) | | q (\boldsymbol {h} _ {\boldsymbol {x}} | f _ {*})\right) \right] +$$ + +$$ +\geq \mathbb {E} _ {f _ {*}} \left[ \int p \left(\boldsymbol {h} _ {\boldsymbol {x}} \mid f _ {*}\right) \log \frac {q \left(\boldsymbol {h} _ {\boldsymbol {x}} \mid f _ {*}\right)}{p \left(\boldsymbol {h} _ {\boldsymbol {x}}\right)} \mathrm {d} \boldsymbol {h} _ {\boldsymbol {x}} \right], \tag {3} +$$ + +where $D_{\mathrm{KL}}(\cdot)$ is Kullback-Leibler (KL) divergence and $q(h_{\pmb{x}}|f_{*})$ is an arbitrary probability density function (PDF) that has same support as $p(h_{\pmb{x}}|f_{*})$ . See Appendix A for the derivation. The difference between the lower bound and the MI is given as $\mathbb{E}_{f_*}\left[D_{\mathrm{KL}}\big(p(h_{\pmb{x}}|f_*)||q(h_{\pmb{x}}|f_*)\big)\right]$ , and thus, the equality holds if $p(h_{\pmb{x}}|f_{*})$ is equal to $q(h_{\pmb{x}}|f_{*})$ for $\forall f_{*}$ . + +To use (3), we have to specify the distribution $q(h_{x}|f_{*})$ . For this type of KL-based lower bounds, the variational approximation is a well-known approach by which the lower bound is maximized with respect to $q(h_{x}|f_{*})$ . However, the expectation and the integral with respect to $f_{*}$ and $h_{x}$ in (3) make this optimization computationally too complicated. Instead, we consider setting $q(h_{x}|f_{*})$ as a specific distribution that can be easily computed. + +The optimal selection of $q(h_{\mathbf{x}}|f_{*})$ is $p(h_{\mathbf{x}}|f_{*})$ , i.e., predictive distributions of GPs given the optimal value $f_{*}$ which we call a $\mathrm{GP}_{|f_{*}}$ . For all existing MES-based approaches, the $\mathrm{GP}_{|f_{*}}$ is required in a slightly different context (see Section 4.1 for the case of the existing MES for constrained problems). Since the $\mathrm{GP}_{|f_{*}}$ is difficult to evaluate, it is approximated by a distribution defined by truncating the original GP predictive distribution at $f_{*}$ in almost all the existing methods (e.g., Wang & Jegelka, 2017; Takeno et al., 2020; 2022; Perrone et al., 2019; Suzuki et al., 2020). For example, in the case of the original MES, $p(f(\mathbf{x}) \mid f_{*})$ is replaced with the truncated normal distribution $p(f(\mathbf{x}) \mid f(\mathbf{x}) \leq f_{*})$ , as pointed out in (Takeno et al., 2020). This replacement makes the resulting acquisition function simple and practical performance of MES-based approaches with this replacement has been repeatedly shown. Therefore, we follow this truncation-based approach. + +In the case of constrained problems, when the optimal value $f_{*}$ is fixed, $f(\pmb{x}) > f_{*}$ does not hold if $g_{c}(\pmb{x}) \geq z_{c}$ for $\forall c$ (i.e., $\pmb{x}$ is feasible). This means that $f(\pmb{x})$ and $g_{c}(\pmb{x})$ are jointly truncated so that their densities become 0 in $\mathcal{A}_{f_{*}} := (f_{*},\infty) \times (z_{1},\infty) \times \dots \times (z_{C},\infty) \subset \mathbb{R}^{C + 1}$ . In other words, $h_{\pmb{x}}$ should be in $\overline{\mathcal{A}}_{f_{*}} \subset \mathbb{R}^{C + 1}$ , which is a complementary set of $\mathcal{A}_{f_{*}}$ , as illustrated in Fig. 1 (b). Thus, we set $q(h_{\pmb{x}}|f_{*})$ as the following truncated multi + +variate normal (TMN) distribution: + +$$ +\begin{array}{l} q \left(\boldsymbol {h} _ {\boldsymbol {x}} \mid f _ {*}\right) = p \left(\boldsymbol {h} _ {\boldsymbol {x}} \mid \boldsymbol {h} _ {\boldsymbol {x}} \in \overline {{\mathcal {A}}} _ {f _ {*}}\right) \\ = \left\{ \begin{array}{l l} p \left(\boldsymbol {h} _ {\boldsymbol {x}}\right) / \bar {Z} _ {\boldsymbol {x}} \left(f _ {*}\right) & \text {f o r} \boldsymbol {h} _ {\boldsymbol {x}} \in \bar {\mathcal {A}} _ {f _ {*}}, \\ 0 & \text {f o r} \boldsymbol {h} _ {\boldsymbol {x}} \in \mathcal {A} _ {f _ {*}}, \end{array} \right. \tag {4} \\ \end{array} +$$ + +where $\overline{Z}_{\pmb{x}}(f_{*}) = \operatorname{Pr}(\pmb{h}_{\pmb{x}} \in \overline{\mathcal{A}}_{f_{*}})$ is the normalization constant. + +By substituting TMN (4) into (3), we obtain a lower bound $L(\pmb{x})$ as + +$$ +\begin{array}{l} L (\boldsymbol {x}) := \mathbb {E} _ {f _ {*}} \left[ \int_ {\overline {{\mathcal {A}}} _ {f _ {*}}} p \left(\boldsymbol {h} _ {\boldsymbol {x}} \mid f _ {*}\right) \log \frac {p \left(\boldsymbol {h} _ {\boldsymbol {x}}\right) / \bar {Z} _ {\boldsymbol {x}} \left(f _ {*}\right)}{p \left(\boldsymbol {h} _ {\boldsymbol {x}}\right)} \mathrm {d} \boldsymbol {h} _ {\boldsymbol {x}} \right] \\ = \mathbb {E} _ {f _ {*}} \left[ - \log \bar {Z} _ {\boldsymbol {x}} \left(f _ {*}\right) \right]. \tag {5} \\ \end{array} +$$ + +See Appendix A for the detailed derivation. In (5), $C + 1$ dimensional integral with respect to $h_x$ is canceled out, which is one of important benefits of our selection of $q(h_{\mathbf{x}}|f_{*})$ . By applying the MC approximation to $\mathbb{E}_{f_*}$ in (5), we obtain the CMES-IBO acquisition function + +$$ +\alpha^ {\mathrm {I B O}} (\boldsymbol {x}) = - \frac {1}{K} \sum_ {\tilde {f} _ {*} \in \mathcal {F} _ {*}} \log \bar {Z} _ {\boldsymbol {x}} \left(\tilde {f} _ {*}\right), \tag {6} +$$ + +where $\mathcal{F}_*$ is a set of sampled $f_*$ from the current GPs, $\tilde{f}_* \in \mathcal{F}_*$ represents each one of sampled values, and $K = |\mathcal{F}_|$ . + +Let $Z_{\pmb{x}}(\tilde{f}_{*})\coloneqq \operatorname *{Pr}(\pmb {h}_{\pmb{x}}\in \mathcal{A}_{\tilde{f}_{*}}) = 1 - \overline{Z}_{\pmb{x}}(\tilde{f}_{*})$ . For a given $\tilde{f}_*\in \mathcal{F}_*$ , we can compute $\overline{Z}_{\pmb{x}}(\tilde{f}_{*})$ easily by using + +$$ +\begin{array}{l} \overline {{Z}} _ {\boldsymbol {x}} (\tilde {f} _ {*}) = 1 - Z _ {\boldsymbol {x}} (\tilde {f} _ {*}) \\ = 1 - \Pr (f (\boldsymbol {x}) \geq \tilde {f} _ {*}) \prod_ {c = 1} ^ {C} \Pr (g (\boldsymbol {x}) \geq z _ {c}) \\ = 1 - \left(1 - \Phi \left(\gamma_ {\boldsymbol {x}} ^ {(f)} (\tilde {f} _ {*})\right)\right) \prod_ {c = 1} ^ {C} \left(1 - \Phi \left(\gamma_ {\boldsymbol {x}} ^ {\left(g _ {c}\right)} \left(z _ {c}\right)\right)\right), \\ \end{array} +$$ + +where $\gamma_{\pmb{x}}^{(f)}(\tilde{f}_{*})\coloneqq (\tilde{f}_{*} - \mu^{(f)}(\pmb {x})) / \sigma^{(f)}(\pmb {x}),\gamma_{\pmb{x}}^{(g_c)}(z_c)\coloneqq (z_c - \mu^{(g_c)}(\pmb {x})) / \sigma^{(g_c)}(\pmb {x})$ , and $\Phi$ is the cumulative distribution function (CDF) of the standard normal distribution. This decomposition is possible because $f$ and $g_{c}$ for $\forall c$ are assumed to be independent, and $\mathcal{A}_{\tilde{f}_*}$ is a hyperrectangle. + +Consequently, the functional form of our acquisition function (6) becomes quite simple. The algorithm and computational complexity for our CMES-IBO is shown in Appendix G. Although we assume that GPs are independent of each other, CMES-IBO can also apply to the correlated setting easily by computing $Z_{\mathbf{x}}(\tilde{f}_{*}) = \operatorname{Pr}(h_{\mathbf{x}} \in \mathcal{A}_{\tilde{f}_{*}})$ as the CDF of the multivariate (correlated) normal distribution. + +# 3.3. Sampling $f_{*}$ + +When $\mathcal{X}$ is a finite set of a moderate size, $f_{*}$ can be sampled from the joint predictive distributions of $h_{\pmb{x}}$ for all candidate points $\pmb {x}\in \mathcal{X}$ . Otherwise (such as a continuous $\mathcal{X}$ ), we employ an approach using the random Fourier + +feature (RFF) (Rahimi & Recht, 2008). We first generate approximate sample paths of objective and constraint functions from Bayesian linear regression models using RFF, and then, we solve a (white-box) constrained optimization problem defined by the generated sample paths by using a general solver (see Appendix G.1 for details). A similar approach has been commonly employed in the entropy-based BO (e.g., Wang & Jegelka, 2017). Particularly when the dataset $\mathcal{D}_{t-1}$ does not contain any feasible solution (which typically occurs at the beginning of the optimization), sampled $\mathcal{X}_{\mathrm{fesasible}}$ is often empty, as shown in the green sample path in Fig. 1 (b). Therefore, if the solver cannot find any feasible solution, $\tilde{f}_*$ is set as $-\infty$ as defined in (1). + +# 3.4. Parallelization + +We consider a parallel extension, in which $Q$ queries can be evaluated at every iteration. Due to a space limitation, we here only describe the main idea briefly (see Appendix B for more detail). We employ a greedy selection of the $Q$ queries using the conditional mutual information (CMI). Let $\mathcal{X}_q\coloneqq \{\pmb{x}^{(1)},\dots ,\pmb{x}^{(q)}\}$ and $\mathcal{H}_q\coloneqq \{h_{\pmb{x}^{(1)}},\dots ,h_{\pmb{x}^{(q)}}\}$ be sets of $q$ inputs and output vectors already selected in the greedy procedure $(q < Q)$ , respectively. To maximize the MI after adding the $(q + 1)$ -th query $\pmb{x}$ , i.e., $\mathrm{MI}(\mathcal{H}_q\cup h_\pmb{x};f_*)$ , we consider the decomposition + +$$ +\operatorname {M I} \left(\mathcal {H} _ {q} \cup \boldsymbol {h} _ {\boldsymbol {x}}; f _ {*}\right) = \operatorname {M I} \left(\mathcal {H} _ {q}; f _ {*}\right) + \operatorname {C M I} \left(\boldsymbol {h} _ {\boldsymbol {x}}; f _ {*} \mid \mathcal {H} _ {q}\right), +$$ + +where $\mathrm{CMI}(h_{\pmb{x}};f_{*}|\mathcal{H}_{q})\coloneqq \mathbb{E}_{\mathcal{H}_{q}}\big[\mathrm{MI}(h_{\pmb{x}};f_{*}|\mathcal{H}_{q})\big]$ . Since the first term does not depend on $\pmb{x}$ , we only need to maximize $\mathrm{CMI}(h_{\pmb{x}};f_{*}|\mathcal{H}_{q})$ . + +By the same approach as (5), we can obtain the lower bound of $\mathrm{CMI}(h_x;f_*|\mathcal{H}_q)$ as + +$$ +L (\boldsymbol {x} | \mathcal {X} _ {q}) := - \mathbb {E} _ {\mathcal {H} _ {q}, f _ {*}} \left[ \log \bar {Z} _ {\boldsymbol {x}} \left(f _ {*} \mid \mathcal {H} _ {q}\right) \right], \tag {7} +$$ + +where $\overline{Z}_{\pmb{x}}(f_{*}|\mathcal{H}_{q})\coloneqq \operatorname *{Pr}(h_{\pmb{x}}\in \overline{\mathcal{A}}_{f_{*}}|\mathcal{X}_{q},\mathcal{H}_{q})$ . See Appendix A for the derivation. By applying the MC estimation, we obtain the acquisition function for the $(q + 1)$ -th query as + +$$ +\alpha^ {\mathrm {I B O}} (\boldsymbol {x} | \mathcal {X} _ {q}) = - \frac {1}{K} \sum_ {(\tilde {f} _ {*}, \mathcal {H} _ {q}) \in \mathcal {J}} \log \bar {Z} _ {\boldsymbol {x}} (\tilde {f} _ {*} | \mathcal {H} _ {q}), \tag {8} +$$ + +where $\mathcal{J}$ is a set of $K$ sampled $(\tilde{f}_{*},\mathcal{H}_{q})$ from the current GPs. Note that jointly sampling $\tilde{f}_{*}$ and $\mathcal{H}_q$ can be easily performed by almost the same procedure as the sequential case, and given $\tilde{f}_{*}$ and $\mathcal{H}_q$ , $\overline{Z}_{x}(\tilde{f}_{*}|\mathcal{H}_{q})$ can be easily computed through the GPs updated by $\mathcal{H}_q$ (details are in Appendix G.1 and B, respectively). Consequently, our parallel extension is also reduced to a simple acquisition function. + +# 4. Analysis + +We here consider differences of CMES-IBO from a more direct application of the conventional MES, and we also provide analysis on the estimation variability of our estimator. Although we focus on the sequential case, both of them also hold in the parallel case. + +# 4.1. Comparison with Conventional MES + +Although we employ the lower bound based approach to derive CMES-IBO, Perrone et al. (2019) have proposed a more direct extension of MES to CBO (Note that Perrone et al. (2019) mainly focus on the binary setting, in which a binary value indicating feasible or not is only observed). However, their derivation is restricted to only one constraint $(C = 1)$ . To consider the relation with CMES-IBO, we extend this original MES-based approach to the multiple constraints case, which we refer to as CMES. + +In CMES, the MI is approximated as + +$$ +\begin{array}{l} \operatorname {M I} \left(\boldsymbol {h} _ {\boldsymbol {x}}; f _ {*}\right) = H \left(\boldsymbol {h} _ {\boldsymbol {x}}\right) - \mathbb {E} _ {f _ {*}} \left[ H \left(\boldsymbol {h} _ {\boldsymbol {x}} \mid f _ {*}\right) \right] \\ \approx H \left(\boldsymbol {h} _ {\boldsymbol {x}}\right) - \mathbb {E} _ {f _ {*}} \left[ H \left(\boldsymbol {h} _ {\boldsymbol {x}} \mid \boldsymbol {h} _ {\boldsymbol {x}} \in \overline {{\mathcal {A}}} _ {f _ {*}}\right) \right] (9) \\ \approx \frac {1}{K} \sum_ {\tilde {f} _ {*} \in \mathcal {F} _ {*}} \left\{\frac {Z _ {\boldsymbol {x}} (\tilde {f} _ {*})}{2 \overline {{Z}} _ {\boldsymbol {x}} (\tilde {f} _ {*})} R _ {\tilde {f} _ {*}} - \log \overline {{Z}} _ {\boldsymbol {x}} (\tilde {f} _ {*}) \right\} \\ =: \alpha^ {\mathrm {C M E S}} (\boldsymbol {x}), (10) \\ \end{array} +$$ + +where + +$$ +R _ {\tilde {f} _ {*}} = \frac {\gamma_ {\boldsymbol {x}} ^ {(f)} (\tilde {f} _ {*}) \phi (\gamma_ {\boldsymbol {x}} ^ {(f)} (\tilde {f} _ {*}))}{1 - \Phi (\gamma_ {\boldsymbol {x}} ^ {(f)} (\tilde {f} _ {*}))} + \sum_ {c = 1} ^ {C} \frac {\gamma_ {\boldsymbol {x}} ^ {(g _ {c})} (z _ {c}) \phi (\gamma_ {\boldsymbol {x}} ^ {(g _ {c})} (z _ {c}))}{1 - \Phi (\gamma_ {\boldsymbol {x}} ^ {(g _ {c})} (z _ {c}))}, +$$ + +and $H(\cdot)$ is the differential entropy and $\phi$ is the PDF of the standard normal distribution. See Appendix E for the derivation. The first approximation (9) is the replacement from $p(h_{\boldsymbol{x}} \mid f_{*})$ to $p(h_{\boldsymbol{x}} \mid h_{\boldsymbol{x}} \in \overline{\mathcal{A}}_{f_{*}})$ in the entropy of the second term, and the second approximation that derives the next line is the MC estimation of $\mathbb{E}_{f_*}$ (Note that although the approximation strategy follows (Perrone et al., 2019), $f_{*}$ here is based on our definition (1) because $f_{*}$ should be a proper random variable to define the MI as we mentioned in Section 3.1). + +Although CMES can be seen as a constrained counterpart of the original MES, the following lemma reveals that the MI approximation of CMES (10) can be a negative value when $C > 5$ . + +Lemma 4.1. When $C > 5$ , for every $\pmb{x} \in \mathcal{X}$ , there exist thresholds $\{z_c\}_{c=1}^C$ that result in $\operatorname{Pr}(\alpha^{\mathrm{CMES}}(\pmb{x}) < 0) > 0$ . + +See Appendix E.3 for an interpretation and the proof. In contrast, for CMES-IBO, we have the following remark: + +Remarks 4.1. Our acquisition function is bounded from below by an average of probability of improvement (PI) + +from $\tilde{f}_{*}$ , i.e., $\alpha^{\mathrm{IBO}}(\pmb{x})\geq \sum_{\tilde{f}_{*}\in \mathcal{F}_{*}}\operatorname *{Pr}(\pmb {h}_{\pmb{x}}\in \mathcal{A}_{\tilde{f}_{*}}) / K\geq 0$ from which we also see non-negativity. + +This remark is immediately derived by applying the well-known inequality $\log x\leq x - 1$ to (6). Note that $\operatorname *{Pr}(h_{\pmb{x}}\in \mathcal{A}_{\tilde{f}_*})$ is PI from $\tilde{f}_{*}$ because it is the probability that $f(x)\geq$ $\tilde{f}_{*}$ and $g_{c}(\boldsymbol {x})\geq z_{c}$ for $\forall c$ . The unconstrained MES also has shown a relation with PI (Wang & Jegelka, 2017), while for CMES, it is difficult to see an interpretable relation with PI. Let the worst-case error be the largest error of the MI approximation among all the possible optimal-value samples $\mathcal{F}_{*}$ . For problems in which $\operatorname *{Pr}(\alpha^{\mathrm{CMES}}(\pmb {x}) < 0) > 0$ the worst-case error of CMES-IBO is smaller than that of CMES. Another important implication of the remark is that although CMES-IBO considers a lower bound, $\alpha^{\mathrm{IBO}}(\pmb {x})$ should be substantially larger than 0 if $\pmb{x}$ is promising in the sense of the PI, which cannot be guaranteed for CMES as shown in the following toy example. + +Figure 2 shows a toy example in which all constraints $g_{1}, \ldots, g_{C}$ are the same function just for simplicity (note that the independence assumption on GP models does not mean that observations of different functions cannot take the same value) and change $C$ from 4 to 7. CMES and CMES-IBO are calculated with $K = 10$ . In the figure, we also provide a numerical approximation of the original MI naively estimated by using the kernel density estimation (KDE), denoted as KDE-MI. For KDE-MI, since we used a large number of samples 10000 (which cannot be performed in practice), we regard KDE-MI as a pseudo ground truth. To demonstrate negativity of CMES, the threshold $z_{c}$ (shown in Fig. 2(b)) is set so that $R_{\tilde{f}_{*}}$ in CMES (10) becomes large negative value around $x = 0.9$ particularly when $C$ is large. Then, in fact, CMES takes negative values around the global optimum of KDE-MI in the case of $C = 6$ and 7. In contrast, CMES-IBO keeps the same global optimum as KDE-MI for all $C$ . Although CMES has a negative value only when $C > 5$ as Lemma 4.1 indicates, the acquisition values gradually decrease with the growth of $C$ . Although values of CMES-IBO are nearly half of KDE-MI, we can clearly see they are highly correlated. Further detail of this example is in Appendix E.4. + +Note that, in practice, the problematic behavior of CMES shown in Fig. 2 (c) does not occur frequently depending on a given problem. Although we will see that CMES often reasonably works in later experiments, the potential risk of this negativity issue degrades the reliability of CMES. + +# 4.2. Bounds for Estimation Variability + +We here analyze variability of our MI estimator (6), that is, how the MI estimator (6) deviates from its expectation (5). The simplicity of our MI estimator (6) enables us to derive the following theorem, while it is difficult to derive a similar guarantee for CMES: + +![](images/bb4abde90e24d0a3434e0f9d0c51324548150132cd7499d81da1468b50b61324.jpg) +Figure 2: In (a) and (b), the GPs for $f$ and $g_{c}$ are shown, respectively. In (c)-(e), CMES, CMES-IBO, and the KDE-based MI approximation are shown, and each vertical dotted line indicates the maximum. + +![](images/96fe099874859be5e56f19ed58e1a8f03cb15f49c6a1d602a342ed63e582ffe1.jpg) + +Theorem 4.1. For every $\pmb{x} \in \mathcal{X}$ , our MI estimator (6) satisfies $\mathbb{V}_{f*}[-\log \overline{Z}_x(f_*)] \leq 2$ , where $\mathbb{V}_{f*}$ represents the variance with respect to $f_*$ . Moreover, for every $\xi \geq 0$ and $\pmb{x} \in \mathcal{X}$ , following concentration inequality holds + +$$ +\Pr \left\{\left| \alpha^ {\mathrm {I B O}} (\boldsymbol {x}) - L (\boldsymbol {x}) \right| \geq \xi \right\} \leq \min \left\{U _ {1}, U _ {2} \right\}, \tag {11} +$$ + +where $U_{1} = \frac{2}{K\xi^{2}}$ and $U_{2} = 2\exp \left[-AK\min \left(\frac{\xi^{2}}{B^{2}},\frac{\xi}{B}\right)\right]$ with constants $A$ and $B$ . + +See Appendix C for the proof. + +The variance of our MI estimator with $K = 1$ can be bounded by the constant 2, and this fact provides the bound by $U_{1}$ as a direct consequence of Chebyshev's inequality. Most importantly, $U_{2}$ yields exponentially fast decay on $K$ and $\xi$ in contrast to the linear and quadratic dependence by $U_{1}$ . Although the convergence rate of $U_{1}$ is worse than $U_{2}$ , $U_{1}$ may provide a tighter bound for specific values of $K$ and $\xi$ . Note that our bound (11) holds for any MC samples $K$ , i.e., it is not an asymptotic result such as the central limit theorem. Moreover, $U_{1}$ and $U_{2}$ do not depend on any parameter of GPs and the problem setting, such as $\sigma^{(f)^{2}}(\pmb{x})$ , $\sigma^{(g_c)^2}(\pmb{x})$ , and $C$ . Our analysis can be seen as a guarantee of the estimation robustness of CMES-IBO even with a small $K$ . + +# 5. Related Work + +Extensions of unconstrained BO methods to CBO have been widely studied. The standard expected improvement (EI) based approaches are called $EI$ with Constraint (EIC) (Schonlau et al., 1998; Snoek, 2013; Gelbart et al., 2014; Gardner et al., 2014; Zhang et al., 2021). However, when no feasible solution is obtained, the so-called 'current best solution' can not be defined. To avoid this difficulty, heuris- + +tic strategies, such as only using the feasible probability (Gelbart et al., 2014) and introducing a threshold hyperparameter (Letham et al., 2019), have been considered, but an appropriate remedy for this issue is still an open problem. Gramacy & Lee (2010) and Picheny (2014) consider the expected reduction of EI and PI, respectively. However, since these approaches require expensive numerical integrations defined on the entire domain $\mathcal{X}$ , their applicability is limited. A Thompson Sampling (TS) based method called Scalable Constrained BO (SCBO) (Eriksson & Poloczek, 2021) has been proposed, recently. Since a next query in TS is directly determined by one sampled $x_{*}$ , the decision often has high variability. Further, when sampled $\mathcal{X}_{\mathrm{feasible}}$ is empty, SCBO selects the input that has the smallest sum of the constraint violations, but the rationale of this selection in a sense of TS is not clarified. + +The augmented Lagrangian (AL), which is a classical approach to white-box constrained problems, has also been combined with BO (Gramacy et al., 2016; Picheny et al., 2016). In AL-based methods, initial parameters of a Lagrange multiplier and a penalty coefficient should be specified. In the classical white-box optimization, these parameters can be refined during a large number of iterations. However, for expensive black-box problems, the number of possible iterations is much smaller than the classical optimization, and the effect of the initial parameters can be significant. Ariafar et al. (2019) proposed Alternating Direction Method of Multipliers BO (ADMMBO) based on the famous ADMM algorithm. ADMMBO is only for decoupled setting, in which each one of objective and constraint functions is observed separately. In this paper, we only focus on the setting in which objective and constraint functions are simultaneously observed. + +Entropy-based approaches are also studied in CBO literature. Hernández-Lobato et al. (2015; 2016) proposed Predictive Entropy Search with Constraint (PESC), which is an extension of a prior work on unconstrained problems (Hernández-Lobato et al., 2014). PESC considers the information gain of the optimum $\boldsymbol{x}_{*}$ , but complicated approximations, for which any relation with the original MI has not been clarified, are required. Another well-known entropy-based BO is MES, for which we already discussed in Section 4.1. The idea of considering $f_{*}$ instead of $\boldsymbol{x}_{*}$ was first shown by Hoffman & Ghahramani (2015), and Wang & Jegelka (2017) proposed the current standard form of MES by introducing a simple approximation of the entropy.MES for multi-objective problems with constraints has been recently proposed by two papers (Belakaria et al., 2020; Fernández-Sánchez et al., 2020).Fernández-Sánchez et al. (2020) pointed out that the entropy evaluation of (Belakaria et al., 2020) is incorrect and derived a multi-objective counterpart of CMES (9), but they introduced multiple additional approximations by which the relation with the origi + +nal MI is further unclear. Moreover, it is worth noting that none of the information-theoretic CBO studies have considered the possibility of $\mathcal{X}_{\mathrm{feasible}} = \emptyset$ . See Appendix D for a detailed discussion. + +A simple approach to incorporating multiple constraints is to transform it into a single constraint such as $g(\pmb{x}) \coloneqq \min_{c} (g_{c}(\pmb{x}) - z_{c}) \geq 0$ . Both of fitting a GP directly to $g(\pmb{x})$ and fitting GPs to $g_{c}(\pmb{x})$ individually are possible strategies in this case, but the former discards observations of each $g_{c}(\pmb{x})$ (only use the min value) and the latter makes $g(\pmb{x})$ non-Gaussian. The binary setting approach (Perrone et al., 2019) can also be used for this purpose, but then, observations of each $g_{c}(\pmb{x})$ are discarded. + +The parallel extension of CBO has not been widely studied. Letham et al. (2019) have shown the parallel CBO based on EIC. Although Eriksson & Poloczek (2021) have not focused on the parallelization, SCBO is applicable to the parallel setting easily because of the nature of TS. For MES, although Takeno et al. (2020; 2022) have proposed a CMI based parallel BO for the multi-fidelity setting, their approach is not based on a lower bound of CMI, and constrained problems have not been studied. Wilson et al. (2018) discussed the MC-based parallel BO in general, but they considered only 'myopic maximal (MM) acquisition functions.' MES is not included in the class of MM acquisition functions, and CBO was not considered in (Wilson et al., 2018). + +To our knowledge, no existing studies use a lower bound of the MI for BO. Moss et al. (2021) recently proposed a lower bound based extension of MES. However, their bound is a lower bound of the 'approximate' MI used in the original MES, which is not a lower bound of the MI, and constrained problems have not been studied. Although we only focus on constrained problems, considering the effectiveness of the lower bound approach to the unconstrained problem is one of our important future works. + +Lastly, we mention regret analysis of the entropy-based BO. Wang & Jegelka (2017) show the regret analysis of 'one sample MES,' in which only one optimal value is sampled in the MC estimation. To our knowledge, no other regret analysis is known for the entropy-based BO ((Belakaria et al., 2019) show an extension to the multi-objective problem, but their regret can be negative value as pointed out by (Suzuki et al., 2020)). However, the original theorem of MES contains several technical problems. For example, the theorem assumes that $f$ follows a GP, but the maximum of $f$ is regarded as a deterministic variable in the proof, which contradicts each other (more details including other issues are in Appendix H). Therefore, convergence guarantee is still an open problem for the entropy-based BO. + +# 6. Experiments + +We demonstrate the performance of sequential optimization by comparing with CMES, EIC (Gelbart et al., 2014), a TS-based method referred to as TSC, and PESC (Hernández-Lobato et al., 2015) in Spearmint (https://github.com/HIPS/Spearmint/tree/PESC). Note that CMES is based on our definition of $f_{*}$ (1). TSC is a variant of SCBO (Eriksson & Poloczek, 2021) simplified by omitting the output transformation such as the Gaussian copula-based transformation of the objective and the trust region strategy. Since these two are general strategies applicable to any acquisition functions, to only focus on the difference of acquisition functions, we do not employ them. Although the AL-based methods (Gramacy et al., 2016; Picheny et al., 2016) are not shown as baselines, they are outperformed by PESC and SCBO in prior work (Hernández-Lobato et al., 2015; Eriksson & Poloczek, 2021), respectively. + +Performances on GP-derived synthetic functions, benchmark functions, and two real-world problems were evaluated by using the utility gap (UG), which is also employed in various prior work (Hernández-Lobato et al., 2015; Picheny et al., 2016; Eriksson & Poloczek, 2021). We set the recommendation at iteration $t$ as $\hat{\boldsymbol{x}}_t = \arg \max_{\boldsymbol{x} \in \mathcal{X}} \mu^{(f)}(\boldsymbol{x})$ , s.t. $\forall c, \operatorname*{Pr}(g_c(\boldsymbol{x}) \geq z_c) \geq \sqrt[C]{0.95}$ . Then, UG is defined as $f_* - f(\hat{\boldsymbol{x}}_t)$ if the recommendation is feasible, otherwise $f_* - \min_{\boldsymbol{x} \in \mathcal{X}} f(\boldsymbol{x})$ , which indicates that an infeasible recommendation results in the worst UG. The initial inputs are sampled by Latin hypercube sampling (Loh, 1996). The sample size of all MC approximations is set as 10. For the kernel function in GPs, we used a linear combination of the linear kernel $k_{\mathrm{LIN}}: \mathcal{X} \times \mathcal{X} \to \mathbb{R}$ and RBF kernel $k_{\mathrm{RBF}}: \mathcal{X} \times \mathcal{X} \to \mathbb{R}$ defined as $\sigma_{\mathrm{LIN}}^2 k_{\mathrm{LIN}}(\boldsymbol{x}, \boldsymbol{x}') + \sigma_{\mathrm{RBF}}^2 k_{\mathrm{RBF}}(\boldsymbol{x}, \boldsymbol{x}')$ , where $\sigma_{\mathrm{LIN}}^2$ and $\sigma_{\mathrm{RBF}}^2$ are updated by the marginal likelihood maximization every 5 iterations, except for the GP-derived functions in which all the methods employed the same fixed kernels used to generate the true functions. We used $k_{\mathrm{LIN}}$ because benchmark functions often contain linear functions. For the GP-derived functions, we generated 10 constrained problems for each of which the experiment is run 10 times, and the mean and standard error of the total 100 trials are reported. For the benchmark and the real-word functions, we report the mean and the standard error of 10 random initializations. Other experimental details such as the number of initial points are shown in Appendix I. + +First, we focus on the results for the sequential querying shown in Fig. 3. + +GP-derived synthetic functions (a): The objective and the $C = 10$ constraints are sampled from zero-mean GPs with RBF kernels whose length scales are 0.2. The thresholds are set as $z_{c} = -0.75$ for $\forall c$ , and the input do + +main is $[0,1]^2$ . We see that EIC and CMES-IBO outperformed other methods, and in particular, CMES is clearly worse than CMES-IBO. Additionally, we run the experiments with the 'single constraint' transformation of multiple constraints described in Section 5, in which a GP fits to $\min_{c=1,\dots,10}(g_c(\pmb{x}) - z_c)$ as one constraint. The results shown by dashed lines indicate that this approach deteriorated performance compared with their multiple constraints counterpart. + +Benchmark functions (b)-(e): We here show results on four benchmark functions called Gardner1 ( $C = 1$ and $d = 2$ ), G1 ( $C = 9$ and $d = 13$ ), G7 ( $C = 8$ and $d = 10$ ), and G10 ( $C = 6$ and $d = 8$ ). Gardner1 (Gardner et al., 2014) is a simple test problem constructed by sine and cosine functions (see Appendix I for the detailed definition). G1, G7, and G10 are from (Liang et al., 2006). In CBO literature, empirical evaluations are typically performed with $C \leq 2$ , and thus, the settings $C = 9, 8$ and 6 are large. Moreover, these three functions have large input dimensions $d$ . We see that CMES-IBO has superior or comparable performance to the other methods in all the four plots. CMES also showed reasonable performance, but we observed substantial differences compared with CMES-IBO in Gardner1, G7, and G10. In G7, the average UG of CMES was larger than 10, while CMES-IBO converged to a much smaller value than 10. In G10, the differences of the average UG between CMES and CMES-IBO may seem small because of the large vertical scale, but after the iteration 30, the differences are larger than 30, and the error bars are not overlapped. For the benchmark functions, the results of PESC are also shown. Note that due to the difficulty of rewriting the Spearmint specification, some settings were not consistent with the other methods (see Appendix I for detail). However, we can see that the performance of PESC is particularly unstable for (c)-(e), which is presumably caused by the difficulty of approximating information gain of the high dimensional $\boldsymbol{x}_{*}$ . + +Reactor network design (f): In this problem, the product concentration from a sequence of two continuously stirred tank reactors is optimized with capital cost and physical phenomenon constraints (Manousiouthakis & Sourlas, 1992; Kumar et al., 2020). The input dimension is $d = 6$ . This problem has one inequality constraint and four equality constraints, and we replaced each equality constraint with two inequality constraints, by which we have $C = 9$ inequality constraints. Since the equality constraints cannot be strictly satisfied when evaluating UG, we set the tolerance error as $10^{-3}$ . We can see that CMES-IBO also shows faster convergence than other methods in this problem. + +Hyperparameter optimization of neural network (g): We tested a hyperparameter optimization of convolutional neural network (CNN) for a class-imbalanced setting, in + +which, typically, performance for minority classes can deteriorate. We consider optimizing the average accuracy of all classes under the constraints that the recall of each one of classes is larger than 0.5. We fitted the two-layer CNN to the CIFAR10 dataset (Krizhevsky & Hinton, 2009), in which we set the class sizes of labels $0, \ldots, 4$ as 2500, and the others are 5000. To control the imbalanceness, we gave a weight $w_{m}$ to the loss function of class $m = 1, \ldots, 10$ defined by $w_{m} = \left(N / (MN_{m})\right)^{\rho}$ , where $M = 10$ is the number of classes, $N$ is the size of the training data, $N_{m}$ is the size of class $m$ , and $\rho$ is a hyperparameter. Setting $\rho > 0$ gives larger weights to minority classes (scikit-learn2 employs $\rho = 1$ ), while $\rho = 0$ is reduced to the uniform weighting. In addition to $\rho \in [0, 2]$ , we also tune other hyperparameters such as learning rate (1 dim), dropout rate (1 dim), and the number of channels (2 dim). As a result, we have $d = 5$ and $C = M = 10$ . Other details are shown in Appendix I. CMES-IBO and EIC reduced UG rapidly at the beginning of the iterations, and CMES-IBO achieved a substantially smaller value than the other methods at the end of the iterations. + +Parallel Querying: For the parallel setting, we parallelize EIC and TSC (see Appendix I for detail) and set the number of parallel queries $Q = 3$ . The prefix 'P-' indicates a parallelized variant of each method (e.g., P-EIC and P-CMES). The results are shown in Fig. 4. Here, G1, G7, and G10 benchmarks were used, and we see that, similarly to the sequential case, CMES-IBO shows efficient convergences compared with the other methods. + +Overall, EIC and TSC showed reasonable performance, but in some cases, their performances become much worse compared with the best method in each plot by being trapped at local optima. The performance of CMES was mostly stable compared with EIC and TSC. However, particularly in some large $C$ experiments such as (a) and (g) in Fig. 3, CMES deteriorates compared to CMES-IBO. This result is consistent with our analysis that CMES can show problematic behavior when $C$ is large. + +Additional evaluations for different sample sizes $K$ , and the correlated extension are shown in Appendix J. + +# 7. Conclusion + +We proposed an information-theoretic constrained Bayesian optimization method called CMES-IBO, derived from a lower bound of the MI. We showed its several desired properties, such as the interpretation of the infeasible case, non-negativity, and the bounds of the estimation variability. Moreover, we extended CMES-IBO to the + +![](images/d1589df7fbd252586f5c9dee2fb2e88ef5db1849a79a93fc38e2ded7d46923fa.jpg) +Figure 3: Utility gap in sequential querying (average and standard error). The dashed lines in the synthetic function experiment represent the 'single constraint' counterpart of each method that has the same color. + +![](images/54c7a1f7b7370a3add54eeaa898bc1d89bbb56a2696f8482655ba3df778709be.jpg) + +![](images/eec911f2d0075bb63f1459254de8ce4ab9d21ee0edfe836c2dcebf7b9e2edbcc.jpg) + +![](images/08c11e9ff0f65fe31bce655aa644ff55e0769c3403db2a9872f571fda24b1abd.jpg) + +![](images/5cb725e35e29b496cdb284128b617c54e0bef4ec94c6f6b3a9b9287480396bf8.jpg) + +![](images/3475755c8838975827d32892609b262a54130c11edda66d4c99771ecee809fda.jpg) + +![](images/258cda46fb6206e60a354be9e92b76ee108caf2a60f89446e73946b4371e7489.jpg) + +![](images/ac29ce269471d3c5743bb4c8227306f8a5d11c8671c5d121461926802a08c58a.jpg) +Figure 4: Utility gap in parallel querying (average and standard error). + +![](images/6690ae89ef8a40f4427976b247ae946f6b13a98f1427327af557953e755c1c40.jpg) + +![](images/365db3739eb258fc0ad5cc45d6c0d659c974290ec434c0bfef42dc6664135e32.jpg) + +parallel setting. The effectiveness of our proposed method was shown through various benchmark functions and real-world problems. Although we only focus on MI defined by the noiseless $h_x$ throughout the paper, the extension for noisy observations is one of our future work. + +# Acknowledgments + +This work was supported by MEXT KAKENHI 18K04700, 21H03498, 22H00300, JSPS KAKENHI Grant Number JP21J14673, and RIKEN Junior Research Associate Program. + +# References + +Abramowitz, M. and Stegun, I. A. Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables. Dover, ninth Dover printing, tenth GPO printing edition, 1964. +Ariafar, S., Coll-Font, J., Brooks, D., and Dy, J. ADMMBO: Bayesian optimization with unknown constraints using ADMM. Journal of Machine Learning Research, 20(123):1-26, 2019. +Beknazaryan, A., Dang, X., and Sang, H. On mutual information estimation for mixed-pair random variables. Statistics and Probability Letters, 148:9-16, 2019. + +Belakaria, S., Deshwal, A., and Doppa, J. R. Max-value entropy search for multi-objective Bayesian optimization. In Advances in Neural Information Processing Systems 32, pp. 7825-7835. Curran Associates, Inc., 2019. +Belakaria, S., Deshwal, A., and Doppa, J. R. Max-value entropy search for multi-objective Bayesian optimization with constraints. arXiv:2009.01721, 2020. +Boyd, S. and Vandenberghe, L. Convex optimization. Cambridge university press, 2004. +Casella, G. and Berger, R. Statistical Inference. Duxbury advanced series in statistics and decision sciences. Thomson Learning, 2002. +Chinneck, J. W. Feasibility and Infeasibility in Optimization: Algorithms and Computational Methods. Springer Publishing Company, Incorporated, 2007. +Cover, T. M. and Thomas, J. A. Elements of Information Theory. Wiley-Interscience, 2006. +Eriksson, D. and Poloczek, M. Scalable constrained Bayesian optimization. In Proceedings of The 24th International Conference on Artificial Intelligence and Statistics, volume 130, pp. 730-738. PMLR, 2021. +Fernández-Sánchez, D., Garrido-Merchán, E. C., and Hernández-Lobato, D. Max-value entropy search for multi-objective Bayesian optimization with constraints. arXiv:2011.01150, 2020. +G, M. B. and Wilhelm, S. Moments calculation for the doubly truncated multivariate normal density. arXiv:1206.5387, 2012. +Gardner, J., Kusner, M., Zhixiang, Weinberger, K., and Cunningham, J. Bayesian optimization with inequality constraints. In Proceedings of the 31st International Conference on Machine Learning, volume 32, pp. 937-945. PMLR, 2014. +Gelbart, M. A., Snoek, J., and Adams, R. P. Bayesian optimization with unknown constraints. In Proceedings of + +the 30th Conference on Uncertainty in Artificial Intelligence, pp. 250-259. AUAI Press, 2014. +Genz, A. Numerical computation of multivariate normal probabilities. Journal of Computational and Graphical Statistics, 1:141-150, 1992. +GPy. GPy: A Gaussian process framework in python. http://github.com/SheffieldML/GPy, since 2012. +Gramacy, R. and Lee, H. Optimization under unknown constraints. Bayesian Statistics 9, 2010. +Gramacy, R. B., Gray, G. A., Digabel, S. L., Lee, H. K. H., Ranjan, P., Wells, G., and Wild, S. M. Modeling an augmented Lagrangian for blackbox constrained optimization. Technometrics, 58(1):1-11, 2016. +Hernández-Lobato, J. M., Hoffman, M. W., and Ghahrami, Z. Predictive entropy search for efficient global optimization of black-box functions. In Advances in Neural Information Processing Systems 27, pp. 918-926. Curran Associates, Inc., 2014. +Hernández-Lobato, J. M., Gelbart, M. A., Hoffman, M. W., Adams, R. P., and Ghahramani, Z. Predictive entropy search for Bayesian optimization with unknown constraints. In Proceedings of the 32th International Conference on Machine Learning, volume 37, pp. 1699-1707. PMLR, 2015. +Hernández-Lobato, J. M., Gelbart, M. A., Adams, R. P., Hoffman, M. W., and Ghahramani, Z. A general framework for constrained Bayesian optimization using information-based search. Journal of Machine Learning Research, 17(160):1-53, 2016. +Hoffman, M. W. and Ghahramani, Z. Output-space predictive entropy search for flexible global optimization. In NIPS Workshop on Bayesian Optimization, 2015. +Horrace, W. C. Some results on the multivariate truncated normal distribution. Journal of Multivariate Analysis, 94 (1):209-221, 2005. +Johnson, S. G. The NLopt nonlinear-optimization package. http://github.com/stevengj/nlopt, since 2008. +Krizhevsky, A. and Hinton, G. Learning multiple layers of features from tiny images. Master's thesis, Department of Computer Science, University of Toronto, 2009. +Kumar, A., Wu, G., Ali, M. Z., Mallipeddi, R., Suganthan, P. N., and Das, S. A test-suite of non-convex constrained optimization problems from the real-world and some baseline results. Swarm and Evolutionary Computation, 56:100693, 2020. + +Letham, B., Karrer, B., Ottoni, G., and Bakshy, E. Constrained Bayesian optimization with noisy experiments. Bayesian Anal., 14(2):495-519, 2019. +Liang, J., Runarsson, T., Mezura-Montes, E., Clerc, M., Suganthan, P., Coello, C., and Deb, K. Problem definitions and evaluation criteria for the CEC 2006 special session on constrained real-parameter optimization. Nangyang Technological University, Tech. Rep, 41, 2006. +Loh, W.-L. On Latin hypercube sampling. Ann. Statist., 24 (5):2058-2080, 1996. +Manousiouthakis, V. and Sourlas, D. A global optimization approach to rationally constrained rational programming. Chemical Engineering Communications, 115(1): 127-147, 1992. +Michalowicz, J. V., Nichols, J. M., and Bucholtz, F. Handbook of Differential Entropy. Chapman and Hall/CRC, 2014. +Moss, H. B., Leslie, D. S., Gonzalez, J., and Rayson, P. GIBBON: General-purpose information-based Bayesian optimisation. arXiv:2102.03324, 2021. +Nair, C., Prabhakar, B., and Shah, D. On entropy for mixtures of discrete and continuous variables. arXiv:cs/0607075, 2007. +Paszke, A., Gross, S., Massa, F., Lerer, A., Bradbury, J., Chanan, G., Killeen, T., Lin, Z., Gimelshein, N., Antiga, L., Desmaison, A., Kopf, A., Yang, E., DeVito, Z., Raison, M., Tejani, A., Chilamkurthy, S., Steiner, B., Fang, L., Bai, J., and Chintala, S. PyTorch: An imperative style, high-performance deep learning library. In Advances in Neural Information Processing Systems 32, pp. 8024-8035. Curran Associates, Inc., 2019. +Perrone, V., Shcherbatyi, I., Jenatton, R., Archambeau, C., and Seeger, M. Constrained Bayesian optimization with max-value entropy search. arXiv:1910.07003, 2019. +Picheny, V. A Stepwise uncertainty reduction approach to constrained global optimization. In Proceedings of the 17th International Conference on Artificial Intelligence and Statistics, volume 33, pp. 787-795. PMLR, 2014. +Picheny, V., Gramacy, R. B., Wild, S., and Le Digabel, S. Bayesian optimization under mixed constraints with a slack-variable augmented Lagrangian. In Advances in Neural Information Processing Systems 29, pp. 1435-1443. Curran Associates, Inc., 2016. +Rahimi, A. and Recht, B. Random features for large-scale kernel machines. In Advances in Neural Information Processing Systems 20, pp. 1177-1184. Curran Associates, Inc., 2008. + +Rasmussen, C. E. and Williams, C. K. I. Gaussian Processes for Machine Learning (Adaptive Computation and Machine Learning). The MIT Press, 2005. +Schonlau, M., Welch, W. J., and Jones, D. R. Global versus local search in constrained optimization of computer models, volume 34 of Lecture Notes-Monograph Series, pp. 11-25. Institute of Mathematical Statistics, 1998. +Snoek, J. Bayesian Optimization and Semiparametric Models with Applications to Assistive Technology. University of Toronto, 2013. +Suzuki, S., Takeno, S., Tamura, T., Shitara, K., and Karasuyama, M. Multi-objective Bayesian optimization using Pareto-frontier entropy. In Proceedings of the 37th International Conference on Machine Learning, volume 119, pp. 9279-9288. PMLR, 2020. +Svanberg, K. A class of globally convergent optimization methods based on conservative convex separable approximations. SIAM J. on Optimization, 12(2):555-573, 2002. +Takeno, S., Fukuoka, H., Tsukada, Y., Koyama, T., Shiga, M., Takeuchi, I., and Karasuyama, M. Multi-fidelity Bayesian optimization with max-value entropy search and its parallelization. In Proceedings of the 37th International Conference on Machine Learning, volume 119, pp. 9334-9345. PMLR, 2020. +Takeno, S., Fukuoka, H., Tsukada, Y., Koyama, T., Shiga, M., Takeuchi, I., and Karasuyama, M. A generalized framework of multi-fidelity max-value entropy search through joint entropy. *Neural Computation*, 2022. To appear. +Vershynin, R. High-Dimensional Probability: An Introduction with Applications in Data Science. Cambridge Series in Statistical and Probabilistic Mathematics. Cambridge University Press, 2018. +Wang, Z. and Jegelka, S. Max-value entropy search for efficient Bayesian optimization. In Proceedings of the 34th International Conference on Machine Learning, volume 70, pp. 3627-3635. PMLR, 2017. +Wilson, J., Hutter, F., and Deisenroth, M. Maximizing acquisition functions for Bayesian optimization. In Advances in Neural Information Processing Systems 31, pp. 9906-9917. Curran Associates, Inc., 2018. +Zhang, Y., Zhang, X., and Frazier, P. Constrained two-step look-ahead Bayesian optimization. In Advances in Neural Information Processing Systems 34, 2021. + +# A. Derivation of Information Lower Bound + +To derive our lower bound, we start from the following representation of the MI: + +$$ +I \left(\boldsymbol {h} _ {\boldsymbol {x}}; f _ {*}\right) = \mathbb {E} _ {f _ {*}} \left[ \int p \left(\boldsymbol {h} _ {\boldsymbol {x}} \mid f _ {*}\right) \log \frac {p \left(\boldsymbol {h} _ {\boldsymbol {x}} \mid f _ {*}\right)}{p \left(\boldsymbol {h} _ {\boldsymbol {x}}\right)} \mathrm {d} \boldsymbol {h} _ {\boldsymbol {x}} \right]. \tag {12} +$$ + +Note that since $p(f_{*})$ can be seen as a mixture distribution in which one of the components (the green distribution in Fig. 1) consists of a single constant value $(-\infty)$ , the expectation regarding $f_{*}$ for a given function $b: \mathbb{R} \cup \{-\infty\} \mapsto \mathbb{R}$ can be defined as + +$$ +\mathbb {E} _ {f _ {*}} \left[ b \left(f _ {*}\right) \right] = \Pr \left(f _ {*} = - \infty\right) b (- \infty) + \Pr \left(f _ {*} \neq - \infty\right) \int_ {\mathbb {R}} p \left(f _ {*} \mid f _ {*} \neq - \infty\right) b \left(f _ {*}\right) \mathrm {d} f _ {*}. \tag {13} +$$ + +The MI (12) defined through this expectation can be seen as a special case of an MI for a mixture distribution shown in (Nair et al., 2007; Beknazaryan et al., 2019). + +Then, our information lower bound can be derived as follows: + +$$ +\begin{array}{l} I (\boldsymbol {h} _ {\boldsymbol {x}}; f _ {*}) = \mathbb {E} _ {f _ {*}} \left[ \int p (\boldsymbol {h} _ {\boldsymbol {x}} | f _ {*}) \log \frac {p (\boldsymbol {h} _ {\boldsymbol {x}} | f _ {*})}{p (\boldsymbol {h} _ {\boldsymbol {x}})} \mathrm {d} \boldsymbol {h} _ {\boldsymbol {x}} \right] \\ = \mathbb {E} _ {f _ {*}} \left[ \int p (\pmb {h} _ {\pmb {x}} | f _ {*}) \left(\log \frac {q (\pmb {h} _ {\pmb {x}} | f _ {*})}{p (\pmb {h} _ {\pmb {x}})} + \log \frac {p (\pmb {h} _ {\pmb {x}} | f _ {*})}{q (\pmb {h} _ {\pmb {x}} | f _ {*})}\right) \mathrm {d} \pmb {h} _ {\pmb {x}} \right] \\ = \mathbb {E} _ {f _ {*}} \left[ \int p \left(\boldsymbol {h} _ {\boldsymbol {x}} \mid f _ {*}\right) \log \frac {q \left(\boldsymbol {h} _ {\boldsymbol {x}} \mid f _ {*}\right)}{p \left(\boldsymbol {h} _ {\boldsymbol {x}}\right)} \mathrm {d} \boldsymbol {h} _ {\boldsymbol {x}} + D _ {\mathrm {K L}} \left(p \left(\boldsymbol {h} _ {\boldsymbol {x}} \mid f _ {*}\right) | | q \left(\boldsymbol {h} _ {\boldsymbol {x}} \mid f _ {*}\right)\right) \right] \\ \geq \mathbb {E} _ {f _ {*}} \left[ \int p \left(\boldsymbol {h} _ {\boldsymbol {x}} \mid f _ {*}\right) \log \frac {q \left(\boldsymbol {h} _ {\boldsymbol {x}} \mid f _ {*}\right)}{p \left(\boldsymbol {h} _ {\boldsymbol {x}}\right)} \mathrm {d} \boldsymbol {h} _ {\boldsymbol {x}} \right] \\ = \mathbb {E} _ {f _ {*}} \left[ \int p \left(\boldsymbol {h} _ {\boldsymbol {x}} \mid f _ {*}\right) \log \frac {p \left(\boldsymbol {h} _ {\boldsymbol {x}} \mid \boldsymbol {h} _ {\boldsymbol {x}} \in \overline {{\mathcal {A}}} _ {f _ {*}}\right)}{p \left(\boldsymbol {h} _ {\boldsymbol {x}}\right)} \mathrm {d} \boldsymbol {h} _ {\boldsymbol {x}} \right]. \tag {14} \\ \end{array} +$$ + +In the last line, we replace $q(\pmb{h}_{\pmb{x}}|f_{*})$ with $p(\pmb{h}_{\pmb{x}}|\pmb{h}_{\pmb{x}} \in \overline{\mathcal{A}}_{f_{*}})$ as defined in (4). Here, from the definition of $f_{*}$ , we see $p(\pmb{h}_{\pmb{x}}|f_{*}) = p(\pmb{h}_{\pmb{x}}|\pmb{h}_{\pmb{x}} \in \overline{\mathcal{A}}_{f_{*}}) = 0$ for $\pmb{h}_{\pmb{x}} \in \mathcal{A}_{f_{*}}$ . Additionally, in information theory, $0 \log 0$ is treated as zero based on that $\lim_{x \to 0} x \log x = 0$ (Cover & Thomas, 2006). Thus, we obtain + +$$ +\begin{array}{l} (1 4) = \mathbb {E} _ {f _ {*}} \left[ \int_ {\overline {{\mathcal {A}}} _ {f _ {*}}} p \left(\boldsymbol {h} _ {\boldsymbol {x}} \mid f _ {*}\right) \log \frac {p \left(\boldsymbol {h} _ {\boldsymbol {x}}\right)}{\bar {Z} _ {\boldsymbol {x}} \left(f _ {*}\right) p \left(\boldsymbol {h} _ {\boldsymbol {x}}\right)} \mathrm {d} \boldsymbol {h} _ {\boldsymbol {x}} \right] \\ = - \mathbb {E} _ {f _ {*}} \left[ \int_ {\overline {{\mathcal {A}}} _ {f _ {*}}} p \left(\boldsymbol {h} _ {\boldsymbol {x}} \mid f _ {*}\right) \log \bar {Z} _ {\boldsymbol {x}} \left(f _ {*}\right) \mathrm {d} \boldsymbol {h} _ {\boldsymbol {x}} \right] \\ = - \mathbb {E} _ {f _ {*}} \left[ \log \bar {Z} _ {\boldsymbol {x}} \left(f _ {*}\right)\right) \int_ {\bar {\mathcal {A}} _ {f _ {*}}} p \left(\boldsymbol {h} _ {\boldsymbol {x}} \mid f _ {*}\right) \mathrm {d} \boldsymbol {h} _ {\boldsymbol {x}} \Bigg ] \\ = - \mathbb {E} _ {f _ {*}} [ \log \bar {Z} _ {\boldsymbol {x}} (f _ {*}) ]. \\ \end{array} +$$ + +Note that although the expectation $\mathbb{E}_{f_*}$ is written as the mixture (13), the MC approximation can be directly performed because a sample from the mixture distribution can be obtained through the procedure described in Section G.1, by which our acquisition function (6) is derived. + +# B. Details of Parallelization + +In this section, we provide the detailed derivation for the parallel setting omitted in the main paper. We assume that $Q$ workers are available by which we can select $Q$ queries as a batch at every iteration. Let $\mathcal{X}_q\coloneqq \{\pmb{x}^{(1)},\dots ,\pmb{x}^{(q)}\}$ be a set of input queries and $\mathcal{H}_q\coloneqq \{h_{\pmb{x}^{(1)}},\ldots ,h_{\pmb{x}^{(q)}}\}$ be a set of output vectors for an integer $1\le q\le Q$ . A naive extension is to maximize MI between $\mathcal{H}_Q$ and $f_{*}$ , i.e., $\mathrm{MI}(\mathcal{H}_Q;f_*)$ , with respect to the queries $\mathcal{X}_Q$ . However, this approach results in a $Qd$ dimensional acquisition function maximization, which is often extremely hard. Instead, we propose a greedy approximation of $\max_{\mathcal{X}_Q}\mathrm{MI}(\mathcal{H}_Q;f_*)$ using the conditional mutual information (CMI). + +The $q$ -th step of our greedy selection is defined as $\arg \max_{\boldsymbol{x}^{(q)}} \mathrm{MI}(\mathcal{H}_q; f_*)$ , where $\boldsymbol{x}^{(1)}, \ldots, \boldsymbol{x}^{(q-1)}$ are already fixed by the previous steps. This procedure maximizes the additional information gain produced by $\boldsymbol{h}_{\boldsymbol{x}^{(q)}}$ , which can be seen through the following expansion: + +$$ +\operatorname {M I} \left(\mathcal {H} _ {q}; f _ {*}\right) = \operatorname {M I} \left(\mathcal {H} _ {q - 1}; f _ {*}\right) + \operatorname {C M I} \left(\boldsymbol {h} _ {\boldsymbol {x} ^ {(q)}}; f _ {*} \mid \mathcal {H} _ {q - 1}\right), +$$ + +where the second term is $\mathrm{CMI}(h_{\pmb{x}^{(q)}};f_{*}|\mathcal{H}_{q - 1})\coloneqq \mathbb{E}_{\mathcal{H}_{q - 1}}\big[\mathrm{MI}(h_{\pmb{x}^{(q)}};f_{*}|\mathcal{H}_{q - 1})\big]$ . Importantly, the first term does not depend on $x^{(q)}$ anymore. Therefore, we obtain $\arg \max_{\pmb{x}^{(q)}}\mathrm{MI}(\mathcal{H}_q;f_*) = \arg \max_{\pmb{x}^{(q)}}\mathrm{CMI}(h_{\pmb{x}^{(q)}};f_{*}|\mathcal{H}_{q - 1})$ , which means that the greedy selection can be performed by the maximization of CMI. + +Our lower bound approach used in (5) can be applied to CMI as follows: + +$$ +\operatorname {C M I} \left(\boldsymbol {h} _ {\boldsymbol {x} ^ {(q)}}; f _ {*} \mid \mathcal {H} _ {q - 1}\right) \geq - \mathbb {E} _ {\mathcal {H} _ {q - 1}, f _ {*}} \left[ \log \left(1 - Z _ {\boldsymbol {x} ^ {(q)}} \left(f _ {*} \mid \mathcal {X} _ {q - 1}\right)\right) \right] =: L _ {\text {p a r}} \left(\boldsymbol {x} ^ {(q)}\right), \tag {7} +$$ + +where $Z_{\pmb{x}^{(q)}}(f_{*}|\mathcal{X}_{q - 1}) \coloneqq \operatorname*{Pr}(h_{\pmb{x}^{(q)}} \in \mathcal{A}_{f_{*}}|\mathcal{X}_{q - 1}, \mathcal{H}_{q - 1})$ . The derivation of this lower bound is omitted because it is almost identical with the sequential case (see Appendix A). Suppose that $m_{\pmb{x}^{(q)}}^{(f)}$ and $s_{\pmb{x}^{(q)}}^{(f)^2}$ are the predictive mean and variance of $f(\pmb{x})$ after conditioning by $\mathcal{H}_{q - 1}$ , respectively, and that $m_{\pmb{x}^{(q)}}^{(g_c)}$ and $s_{\pmb{x}^{(q)}}^{(g_c)^2}$ are those for $g_{c}(\pmb{x})$ . Then, from the independence assumption, $Z_{\pmb{x}^{(q)}}(f_{*}|\mathcal{X}_{q - 1}) = \bigl(1 - \Phi (\eta_{\pmb{x}^{(q)}}^{(f)}(f_{*}))\bigr)\prod_{c = 1}^{C}\bigl(1 - \Phi (\eta_{\pmb{x}^{(q)}}^{(g_c)}(z_c))\bigr)$ , where $\eta_{\pmb{x}^{(q)}}^{(f)}(f_{*}) = \bigl(f_{*} - m_{\pmb{x}^{(q)}}^{(f)}\bigr) / s_{\pmb{x}^{(q)}}^{(f)}$ and $\eta_{\pmb{x}^{(q)}}^{(g_c)}(z_c) = \bigl(z_c - m_{\pmb{x}^{(q)}}^{(g_c)}\bigr) / s_{\pmb{x}^{(q)}}^{(g_c)}$ , $c = 1,\ldots ,C$ . By applying the Monte Carlo estimation to the expectation in (7), we obtain the acquisition function for the $q$ -th query as + +$$ +\alpha^ {\mathrm {I B O}} \left(\boldsymbol {x} ^ {(q)} \mid \mathcal {X} _ {q - 1}\right) = - \frac {1}{K} \sum_ {\left(\tilde {f} _ {*}, \mathcal {H} _ {q - 1}\right) \in \mathcal {J}} \log \left(1 - Z _ {\boldsymbol {x} ^ {(q)}} \left(\tilde {f} _ {*} \mid \mathcal {X} _ {q - 1}\right)\right), \tag {8} +$$ + +where $\mathcal{J}$ is a set of $K$ sampled $(\tilde{f}_{*},\mathcal{H}_{q - 1})$ from the current GPs. + +# C. Proof of Theorem 4.1 + +Let $f_{*(1)}, \ldots, f_{*(K)}$ be i.i.d. random variables sampled from the distribution of $f_*$ , and let $D_k := -\log(1 - \operatorname{Pr}(h_x \in \mathcal{A}_{f_*(k)}))$ , where $\mathcal{A}_{f_*(k)} := (f_{*(k)}, \infty) \times (z_1, \infty) \times \dots \times (z_C, \infty)$ for $\forall k \in \{1, \ldots, K\}$ . Then, our acquisition function can be written as + +$$ +\alpha^ {\mathrm {I B O}} (\boldsymbol {x}) = \frac {1}{K} \sum_ {k = 1} ^ {K} D _ {k}. +$$ + +For any $b\in \mathbb{R}\cup \{-\infty \}$ , the following inequality holds: + +$$ +\Pr \left(\boldsymbol {h} _ {\boldsymbol {x}} \in \mathcal {B}\right) \leq \Pr \left(f _ {*} > b\right), +$$ + +where $\mathcal{B} \coloneqq (b, \infty) \times (z_1, \infty) \times \dots \times (z_C, \infty)$ . This is because $h_{\pmb{x}} \in \mathcal{B}$ implies that (i) $\mathcal{X}_{\mathrm{feasible}}$ is not empty since at least $\pmb{x}$ is feasible and (ii) $f_{*} = \max_{\pmb{x}' \in \mathcal{X}_{\mathrm{feasible}}} f(\pmb{x}') \geq f(\pmb{x}) > b$ . By substituting the sampled $f_{*(1)}, \ldots, f_{*(K)}$ into $b$ , we see + +$$ +\Pr \left(\boldsymbol {h} _ {\boldsymbol {x}} \in \mathcal {A} _ {f _ {*} (k)}\right) \leq \Pr \left(f _ {*} > f _ {* (k)}\right), +$$ + +and + +$$ +1 - \Pr \left(\boldsymbol {h} _ {\boldsymbol {x}} \in \mathcal {A} _ {f _ {*} (k)}\right) \geq 1 - \Pr \left(f _ {*} > f _ {* (k)}\right) = F _ {*} \left(f _ {* (k)}\right), \tag {15} +$$ + +where $F_{*}(b)\coloneqq \operatorname *{Pr}(f_{*}\leq b)$ is CDF of $f_{*}$ + +Let us consider the distribution of $F_{*}(f_{*(k)})$ induced by $f_{*(k)}$ . Define $\tau := \operatorname{Pr}(f_{*} = -\infty)$ . Then, $f_{*(k)} = -\infty$ with probability $\tau$ because $f_{*(k)}$ is a random sample of $f_{*}$ . This implies $F_{*}(f_{*(k)}) = \operatorname{Pr}(f_{*} = -\infty) = \tau$ with probability $\tau$ . Moreover, the CDF of $F_{*}(f_{*(k)})$ , defined as $\operatorname{Pr}(F_{*}(f_{*(k)}) \leq \alpha)$ , is continuous for $\alpha \in (\tau, 1)$ . Thus, as with the probability integral transform (e.g., see (Casella & Berger, 2002)), $\operatorname{Pr}(F_{*}(f_{*(k)}) \leq \alpha)$ can be obtained as + +$$ +\begin{array}{l} \Pr \left(F _ {*} \left(f _ {* (k)}\right) \leq \alpha\right) = \Pr \left(F _ {*} ^ {- 1} \left(F _ {*} \left(f _ {* (k)}\right)\right) \leq F _ {*} ^ {- 1} (\alpha)\right) \\ = \Pr \left(f _ {* (k)} \leq F _ {*} ^ {- 1} (\alpha)\right) \\ = F _ {*} \left(F _ {*} ^ {- 1} (\alpha)\right) \\ = \alpha , \\ \end{array} +$$ + +where $F_{*}^{-1}(\cdot)$ is the quantile function of $f_{*}$ . Consequently, CDF of $F_{*}(f_{*(k)})$ is obtained as, + +$$ +\operatorname * {P r} (F _ {*} (f _ {* (k)}) \leq \alpha) = \left\{ \begin{array}{l l} 0 & \text {i f} \alpha < \tau , \\ \alpha & \text {i f} \alpha \geq \tau . \end{array} \right. +$$ + +From above, $F_{*}(f_{*(k)}) = \tau$ with probability $\tau$ , and $F_{*}(f_{*(k)}) \sim \mathrm{Unif}(\tau, 1)$ with probability $1 - \tau$ . Then, we define the random variable $U_{k}$ as follows: + +$$ +U _ {k} = \left\{ \begin{array}{l l} \tilde {U} _ {k} & \text {i f} f _ {* (k)} = - \infty , \\ F _ {*} (f _ {* (k)}) & \text {i f} f _ {* (k)} \neq - \infty , \end{array} \right. +$$ + +where $\tilde{U}_k\sim \mathrm{Unif}(0,\tau)$ . In this definition, we have $U_{k}\sim \mathrm{Unif}(0,\tau)$ with probability $\tau$ , and $U_{k}\sim \mathrm{Unif}(\tau ,1)$ with probability $1 - \tau$ . Therefore, $U_{k}\sim \mathrm{Unif}(0,1)$ . Since $F_{*}(f_{*(k)})\geq U_{k}$ from the definition, by combining (15), we obtain + +$$ +1 - \Pr \left(\boldsymbol {h} _ {\boldsymbol {x}} \in \mathcal {A} _ {f _ {*} (k)}\right) \geq F _ {*} \left(f _ {* (k)}\right) \geq U _ {k}. \tag {16} +$$ + +From this inequality and the monotonicity of logarithm, we can transform + +$$ +D _ {k} = - \log \left(1 - \Pr \left(\boldsymbol {h} _ {\boldsymbol {x}} \in \mathcal {A} _ {f _ {*} (k)}\right)\right) \leq - \log \left(F _ {*} \left(f _ {*} (k)\right)\right) \leq - \log (U _ {k}) =: M _ {k}. +$$ + +$D_{k}$ and $M_{k}$ are nonnegative random variables, and $\operatorname*{Pr}(D_k\leq M_k) = 1$ . Hence, we see that $0\leq \mathbb{E}_{\mathcal{F}_*}[D_k]\leq \mathbb{E}_{\mathcal{F}_*}[M_k],$ $\mathbb{E}_{\mathcal{F}_*}[D_k^2 ]\leq \mathbb{E}_{\mathcal{F}_*}[M_k^2 ],$ and $\operatorname *{Pr}(D_k\geq b)\leq \operatorname *{Pr}(M_k\geq b)$ for $\forall b\in \mathbb{R}$ + +We will show that variance and concentration bounds for $D_{k}$ can be derived from that of $M_{k}$ . Using the inverse probability integral transform (Casella & Berger, 2002), $-\log (U_k)$ follows an exponential distribution with the rate parameter $\lambda = 1$ : + +$$ +M _ {k} = - \log (U _ {k}) \sim \exp (\lambda = 1). +$$ + +Therefore, $\mathbb{E}_{f_{*}(k)}[M_k^2] = 2$ , and we can derive the inequality below: + +$$ +\begin{array}{l} \mathbb {V} _ {f _ {* (k)}} [ D _ {k} ] = \mathbb {E} _ {f _ {* (k)}} [ D _ {k} ^ {2} ] - \mathbb {E} _ {f _ {* (k)}} [ D _ {k} ] ^ {2} \\ \leq \mathbb {E} _ {f _ {* (k)}} [ D _ {k} ^ {2} ] \\ \leq \mathbb {E} _ {f _ {* (k)}} [ M _ {k} ^ {2} ] \\ = 2. \\ \end{array} +$$ + +Moreover, we see that $D_{k}$ satisfies the condition being a sub-exponential random variable (Proposition 2.7.1 (a) in Vershynin, 2018), that is, + +$$ +\Pr \left(\left| D _ {k} \right| \geq \xi\right) = \Pr \left(D _ {k} \geq \xi\right) \leq \Pr \left(M _ {k} \geq \xi\right) = \exp (- \xi) \text {f o r a l l} \xi \geq 0. +$$ + +Consequently, $D_{k}$ is a sub-exponential random variable, whose variance is bounded from above $\mathbb{V}_{f_{*}(k)}[D_k]\leq 2$ + +We can directly apply Chebyshev's and Bernstein's inequalities from the bound of variance and the fact that $D_{k}$ is a sub-exponential random variable. First, applying Chebyshev's inequality, we can see immediately + +$$ +\Pr \left(\left| \alpha^ {\mathrm {I B O}} (\boldsymbol {x}) - L (\boldsymbol {x}) \right| \geq \xi\right) \leq \frac {2}{K \xi^ {2}}, \tag {17} +$$ + +for any $\xi \geq 0$ . Second, applying Bernstein's inequality (Corollary 2.8.3 in Vershynin, 2018), we can derive + +$$ +\Pr \left(\left| \alpha^ {\mathrm {I B O}} (\boldsymbol {x}) - L (\boldsymbol {x}) \right| \geq \xi\right) \leq 2 \exp \left[ - A K \min \left(\frac {\xi^ {2}}{B ^ {2}}, \frac {\xi}{B}\right) \right], \tag {18} +$$ + +where $A$ is a constant and $B$ can be provided as a sub-exponential norm (Definition 2.7.5 in Vershynin, 2018) of $D_{k} - \mathbb{E}_{f_{*(k)}}[D_{k}]$ . For all $t\geq 0$ and $\pmb {x}\in \mathcal{X}$ , the sub-exponential norm $\| D_k - \mathbb{E}_{f_{*(k)}}[D_k]\|_{\psi_1}$ can be bounded as + +$$ +\begin{array}{l} \left\| D _ {k} - \mathbb {E} _ {f _ {* (k)}} \left[ D _ {k} \right] \right\| _ {\psi_ {1}} \leq \left\| D _ {k} \right\| _ {\psi_ {1}} + \left\| \mathbb {E} _ {f _ {* (k)}} \left[ D _ {k} \right] \right\| _ {\psi_ {1}} \quad (\text {t r i a n g l e i n e q u a l i t y}) \\ \leq \| M _ {k} \| _ {\psi_ {1}} + \| \mathbb {E} _ {f _ {* (k)}} [ M _ {k} ] \| _ {\psi_ {1}} \quad (\Pr (D _ {k} \leq M _ {k}) = 1) \\ = \| M _ {k} \| _ {\psi_ {1}} + \| 1 \| _ {\psi_ {1}} \quad (\mathbb {E} _ {f _ {* (k)}} [ M _ {k} ] = 1) \\ = 2 + 1 / \log 2. \quad (M _ {k} \sim \exp (\lambda = 1)) \\ \end{array} +$$ + +Therefore, $B$ can be set as $2 + 1 / \log 2$ . Consequently, we can derive Theorem 4.1 combining these two inequalities (17) and (18). + +The above derivations can be directly extended to the parallel setting. Let $D_k^{(q)} \coloneqq -\log \bigl(1 - \operatorname*{Pr}(h_{\pmb{x}} \in \mathcal{A}_{f_{*(k)}}| \mathcal{H}_{q-1}) \bigr)$ and $\alpha^{\mathrm{IBO}}(\pmb{x} | \mathcal{X}_{q-1}) = 1 / K \sum_{k=1}^{K} D_k^{(q)}$ . All the inequalities shown in the sequential case hold for an arbitrary dataset, which can be the observed dataset $\mathcal{D}_t$ augmented by $\mathcal{H}_q$ . Thus, for an arbitrary fixed $\mathcal{H}_{q(k)}$ , we obtain $\mathbb{E}_{f_{*(k)}| \mathcal{H}_{q(k)}} \left[ D_k^{(q)^2} \right] \leq 2$ and $\operatorname*{Pr}\big(|D_k^{(q)}| > \xi \mid \mathcal{H}_{q(k)}\big) \leq \exp(-\xi)$ for all $\xi \geq 0$ , where the expectation and probability are taken by $f_{*(k)}| \mathcal{H}_{q(k)}, \mathcal{D}_t$ . Therefore, we obtain the bounds of the variance and the tail probability as follows: + +$$ +\begin{array}{l} \mathbb {V} _ {f _ {* (k)}, \mathcal {H} _ {q (k)}} \left[ D _ {k} ^ {(q)} \right] = \mathbb {E} _ {f _ {* (k)}, \mathcal {H} _ {q (k)}} \left[ D _ {k} ^ {(q) ^ {2}} \right] - \mathbb {E} _ {f _ {* (k)}, \mathcal {H} _ {q (k)}} \left[ D _ {k} ^ {(q)} \right] ^ {2} \leq \mathbb {E} _ {\mathcal {H} _ {q (k)}} \left[ \mathbb {E} _ {f _ {* (k)} | \mathcal {H} _ {q (k)}} \left[ D _ {k} ^ {(q) ^ {2}} \right] \right] \leq \mathbb {E} _ {\mathcal {H} _ {q (k)}} \left[ 2 \right] = 2, \\ \Pr \bigl(|D_{k}^{(q)}| > \xi \bigr) = \mathbb{E}_{\mathcal{H}_{q(k)}}\left[\Pr \bigl(|D_{k}^{(q)}| > \xi \mid \mathcal{H}_{q(k)}\bigr)\right]\leq \mathbb{E}_{\mathcal{H}_{q(k)}}\left[\exp (-\xi)\right] = \exp (-\xi) \text{for all}\xi \geq 0. \\ \end{array} +$$ + +Consequently, $D_k^{(q)}$ is a sub-exponential random variable, whose variance is bounded from above by 2. Hence, we can apply Chebyshev's and Bernstein's inequalities as with the sequential case. + +# D. Discussion on Infeasibility + +Here, we discuss the case that sample paths generated for sampling $f_{*}$ do not have any feasible solution. Perrone et al. (2019) defined $f_{*}$ as $\max f(\pmb{x})$ , s.t. $g_c(\pmb{x}) \geq z_c$ for $\forall c = 1, \dots, C$ , by which the infeasible case is not considered. However, particularly when the dataset $\mathcal{D}_{t-1}$ does not contain any feasible solution (which typically occurs at the beginning of the optimization), it often occurs that a sample path generated for sampling $f_{*}$ does not have any feasible solution. An illustrative example is shown in Figure 1 (a), in which the feasible region of the green sample path is empty. In fact, GPs can generate an infeasible sample path, i.e., $\operatorname{Pr}(\mathcal{X}_{\mathrm{feasible}} = \emptyset) > 0$ unless we observe a noiseless feasible solution. Then, there is a possibility that $f_{*}$ is not defined, by which MI even cannot be theoretically defined. + +Other than using our definition of $f_{*}$ (1), another possible approach to avoiding this problem is to assume the existence of feasible solutions in the GPs, but this approach has at least the following three disadvantages. First, this approach ignores uncertainty about the existence of a feasible solution. Identifying the existence of a feasible solution for a given problem is a key issue in constrained problems (called the feasibility problem (Chinneck, 2007)). However, information gain about feasibility cannot be incorporated in this approach. Second, we need to generate sample paths that have feasible solutions for sampling $f_{*}$ . A naïve approach is the rejection sampling, in which generated constraint functions are rejected if no feasible solution exists, but this may require a huge number of samplings. Third, the predictive distribution of $h_{x}$ under this condition $p(h_{x} \mid \text{at least one feasible } x \text{ exists})$ is not a Gaussian distribution anymore, and is analytically intractable. This makes the entire computational procedures of both CMES-IBO and CMES much more complicated. Perrone et al. (2019) did not mention the above issues at all and used the usual predictive distributions of GPs in the entire acquisition function evaluation without any justification. Note that the same problem exists in the PES-based CBO (Hernández-Lobato et al., 2015; 2016). On the other hand, our definition of $f_{*}$ (1) resolves the above issues. + +We further discuss how CMES-IBO balances the effect of the objective and constraint functions when infeasible sample paths are generated. For simplicity, we first consider the case of $K = 1$ . The acquisition function (6) can be written as $-\log(1 - P_{\mathrm{imp}} \times P_{\mathrm{fea}})$ , where $P_{\mathrm{imp}} \coloneqq \operatorname*{Pr}(f(\boldsymbol{x}) \geq \tilde{f}_*)$ and $P_{\mathrm{fea}} \coloneqq \prod_{c=1}^{C} \operatorname*{Pr}(g_c(\boldsymbol{x}) \geq z_c)$ . In this criterion, $P_{\mathrm{imp}}$ and $P_{\mathrm{fea}}$ represent benefits for obtaining a larger value of $f(\boldsymbol{x})$ and for obtaining a feasible solution, respectively. If the sample path does not have a feasible region, $P_{\mathrm{imp}} = \operatorname*{Pr}(f(\boldsymbol{x}) \geq -\infty) = 1$ . Thus, only the probability of being feasible $P_{\mathrm{fea}}$ is maximized. On the other hand, when $K > 1$ , the balance of the effect of the objective and the constraint functions are balanced through the frequency that sampled constraint functions have a feasible region among $K$ samplings. If the frequency is low, the probability of being feasible has a dominant effect, while if the frequency is high, the effect of the objective function becomes strong. Note that sampled constraint functions can have feasible solutions even when the dataset $D_{t-1}$ does not contain any feasible solution (as illustrated in Figure 1 (a)). + +# E. Constrained Extension of Conventional Max-value Entropy Search + +We here extend cMES (Perrone et al., 2019) to the multiple constraints setting and the parallel setting, and further, we show an example that its approximate MI can be negative. + +# E.1. Acquisition Function of CMES + +Following the conventional MES and cMES (Wang & Jegelka, 2017; Perrone et al., 2019), we approximate MI as below: + +$$ +\begin{array}{l} (2) = H \left(\boldsymbol {h} _ {\boldsymbol {x}}\right) - \mathbb {E} _ {f _ {*}} \left[ H \left(\boldsymbol {h} _ {\boldsymbol {x}} \mid f _ {*}\right) \right] \\ \approx H \left(\boldsymbol {h} _ {\boldsymbol {x}}\right) - \mathbb {E} _ {f _ {*}} \left[ H \left(\boldsymbol {h} _ {\boldsymbol {x}} \mid \boldsymbol {h} _ {\boldsymbol {x}} \in \overline {{\mathcal {A}}} _ {f _ {*}}\right) \right]. \tag {9} \\ \end{array} +$$ + +For the approximation, the conditioning on $f_{*}$ in the second term is replaced with $h_x \in \overline{\mathcal{A}}_{f_*}$ following the existing approach (Perrone et al., 2019). Further, the expectation over $p(f_{*})$ in the second term of (9) is also analytically intractable. This expectation can be approximated by the MC estimation, for which we employ the same RFF-based approach described in Appendix G.1. Thus, we obtain the following acquisition function as an approximation of (9): + +$$ +\alpha^ {\text {C M E S}} (\boldsymbol {x}) := H \left(\boldsymbol {h} _ {\boldsymbol {x}}\right) - \frac {1}{K} \sum_ {\tilde {f} _ {*} \in \mathcal {F} _ {*}} H \left(\boldsymbol {h} _ {\boldsymbol {x}} \mid \boldsymbol {h} _ {\boldsymbol {x}} \in \overline {{\mathcal {A}}} _ {\tilde {f} _ {*}}\right). \tag {19} +$$ + +The first term is easy to calculate because it is the entropy of the multivariate normal distribution. Hence, we need to calculate the entropy in the second term $H(h_{x} \mid h_{x} \in \overline{\mathcal{A}_{\tilde{f}_{*}}})$ . + +Although Perrone et al. (2019) derived a closed-form of the entropy of this TMN distribution specific for $C = 1$ , for $C > 1$ , directly evaluating it is not trivial as pointed out by (Fernández-Sánchez et al., 2020). We show that another analytical representation of this entropy actually can be derived for general $C$ by transforming the domain of the integration as follows: + +$$ +\begin{array}{l} H \left(\boldsymbol {h} _ {\boldsymbol {x}} \mid \boldsymbol {h} _ {\boldsymbol {x}} \in \overline {{\mathcal {A}}} _ {\tilde {f} _ {*}}\right) = \int_ {\overline {{\mathcal {A}}} _ {\tilde {f} _ {*}}} - \frac {p (\boldsymbol {h} _ {\boldsymbol {x}})}{\overline {{Z}} _ {\boldsymbol {x}} (\tilde {f} _ {*})} \log \frac {p (\boldsymbol {h} _ {\boldsymbol {x}})}{\overline {{Z}} _ {\boldsymbol {x}} (\tilde {f} _ {*})} \mathrm {d} \boldsymbol {h} _ {\boldsymbol {x}} \\ = \int - \frac {p (\boldsymbol {h} _ {\boldsymbol {x}})}{\overline {{Z}} _ {\boldsymbol {x}} (\tilde {f} _ {*})} \log \frac {p (\boldsymbol {h} _ {\boldsymbol {x}})}{\overline {{Z}} _ {\boldsymbol {x}} (\tilde {f} _ {*})} \mathrm {d} \boldsymbol {h} _ {\boldsymbol {x}} + \int_ {\mathcal {A} _ {\tilde {f} _ {*}}} \frac {p (\boldsymbol {h} _ {\boldsymbol {x}})}{\overline {{Z}} _ {\boldsymbol {x}} (\tilde {f} _ {*})} \log \frac {p (\boldsymbol {h} _ {\boldsymbol {x}})}{\overline {{Z}} _ {\boldsymbol {x}} (\tilde {f} _ {*})} \mathrm {d} \boldsymbol {h} _ {\boldsymbol{x}} \\ = \frac {1}{\bar {Z} _ {\boldsymbol {x}} (\tilde {f} _ {*})} \int - p (\boldsymbol {h} _ {\boldsymbol {x}}) \log p (\boldsymbol {h} _ {\boldsymbol {x}}) \mathrm {d} \boldsymbol {h} _ {\boldsymbol {x}} + \frac {1}{\bar {Z} _ {\boldsymbol {x}} (\tilde {f} _ {*})} \int_ {\mathcal {A} _ {\tilde {f} _ {*}}} p (\boldsymbol {h} _ {\boldsymbol {x}}) \log p (\boldsymbol {h} _ {\boldsymbol {x}}) \mathrm {d} \boldsymbol {h} _ {\boldsymbol {x}} + \log (\bar {Z} _ {\boldsymbol {x}} (\tilde {f} _ {*})) \\ = \frac {1}{\overline {{Z}} _ {\boldsymbol {x}} (\tilde {f} _ {*})} \int - p (\boldsymbol {h} _ {\boldsymbol {x}}) \log p (\boldsymbol {h} _ {\boldsymbol {x}}) \mathrm {d} \boldsymbol {h} _ {\boldsymbol {x}} + \frac {Z _ {\boldsymbol {x}} (\tilde {f} _ {*})}{\overline {{Z}} _ {\boldsymbol {x}} (\tilde {f} _ {*})} \int_ {\mathcal {A} _ {\tilde {f} _ {*}}} \frac {p (\boldsymbol {h} _ {\boldsymbol {x}})}{Z _ {\boldsymbol {x}} (\tilde {f} _ {*})} \log \frac {p (\boldsymbol {h} _ {\boldsymbol {x}})}{Z _ {\boldsymbol {x}} (\tilde {f} _ {*})} \mathrm {d} \boldsymbol {h} _ {\boldsymbol {x}} + \log (\overline {{Z}} _ {\boldsymbol {x}} (\tilde {f} _ {*})) + \frac {Z _ {\boldsymbol {x}} (\tilde {f} _ {*}) \log (Z _ {\boldsymbol {x}} (\tilde {f} _ {*}))}{\overline {{Z}} _ {\boldsymbol {x}} (\tilde {f} _ {*})} \\ = \frac {H (\boldsymbol {h} _ {\boldsymbol {x}})}{\overline {{Z}} _ {\boldsymbol {x}} (\tilde {f} _ {*})} - \frac {Z _ {\boldsymbol {x}} (\tilde {f} _ {*})}{\overline {{Z}} _ {\boldsymbol {x}} (\tilde {f} _ {*})} \int_ {\mathcal {A} _ {\tilde {f} _ {*}}} - p (\boldsymbol {h} _ {\boldsymbol {x}} | \boldsymbol {h} _ {\boldsymbol {x}} \in \mathcal {A} _ {\tilde {f} _ {*}}) \log p (\boldsymbol {h} _ {\boldsymbol {x}} | \boldsymbol {h} _ {\boldsymbol {x}} \in \mathcal {A} _ {\tilde {f} _ {*}}) \mathrm {d} \boldsymbol {h} _ {\boldsymbol {x}} + \log (\overline {{Z}} _ {\boldsymbol {x}} (\tilde {f} _ {*})) + \frac {Z _ {\boldsymbol {x}} (\tilde {f} _ {*}) \log (Z _ {\boldsymbol {x}} (\tilde {f} _ {*}))}{\overline {{Z}} _ {\boldsymbol {x}} (\tilde {f} _ {*})} \\ = \frac {H \left(\boldsymbol {h} _ {\boldsymbol {x}}\right)}{\bar {Z} _ {\boldsymbol {x}} \left(\tilde {f} _ {*}\right)} - \frac {Z _ {\boldsymbol {x}} \left(\tilde {f} _ {*}\right) H \left(\boldsymbol {h} _ {\boldsymbol {x}} \mid \boldsymbol {h} _ {\boldsymbol {x}} \in \mathcal {A} _ {\tilde {f} _ {*}}\right)}{\bar {Z} _ {\boldsymbol {x}} \left(\tilde {f} _ {*}\right)} + \log \left(\bar {Z} _ {\boldsymbol {x}} \left(\tilde {f} _ {*}\right)\right) + \frac {Z _ {\boldsymbol {x}} \left(\tilde {f} _ {*}\right) \log Z _ {\boldsymbol {x}} \left(\tilde {f} _ {*}\right)}{\bar {Z} _ {\boldsymbol {x}} \left(\tilde {f} _ {*}\right)}, \tag {20} \\ \end{array} +$$ + +where TMN $p(\pmb{h}_{\pmb{x}}|\pmb{h}_{\pmb{x}} \in \mathcal{A}_{\tilde{f}_{\pmb{x}}})$ is defined as + +$$ +p (\boldsymbol {h} _ {\boldsymbol {x}} | \boldsymbol {h} _ {\boldsymbol {x}} \in \mathcal {A} _ {\tilde {f} _ {*}}) = \left\{ \begin{array}{l l} p (\boldsymbol {h} _ {\boldsymbol {x}}) / Z _ {\boldsymbol {x}} (\tilde {f} _ {*}) & \text {i f} \boldsymbol {h} _ {\boldsymbol {x}} \in \mathcal {A} _ {\tilde {f} _ {*}} \\ 0 & \text {o t h e r w i s e} \end{array} \right.. +$$ + +In the last equation, $Z_{\pmb{x}}(\tilde{f}_{*}), \overline{Z}_{\pmb{x}}(\tilde{f}_{*})$ and $H(\pmb{h}_{\pmb{x}})$ are easy to compute. Although $H(\pmb{h}_{\pmb{x}} \mid \pmb{h}_{\pmb{x}} \in \mathcal{A}_{\tilde{f}_{*}})$ in the second term is still the entropy of TMN, we show the calculation of this entropy in Appendix F for both independent and correlated cases. + +Consequently, in the independent case, by substituting (20) into (19) and replacing $H(\pmb{h}_{\pmb{x}})$ and $H(\pmb{h}_{\pmb{x}} \mid \pmb{h}_{\pmb{x}} \in \mathcal{A}_{\tilde{f}_{*}})$ with their closed-forms (shown in Appendix F), we obtain + +$$ +\alpha^ {\mathrm {C M E S}} (\pmb {x}) = \frac {1}{K} \sum_ {\tilde {f} _ {*} \in \mathcal {F} _ {*}} \frac {Z _ {\pmb {x}} (\tilde {f} _ {*})}{2 (1 - Z _ {\pmb {x}} (\tilde {f} _ {*}))} R _ {\tilde {f} _ {*}} - \log (1 - Z _ {\pmb {x}} (\tilde {f} _ {*})), +$$ + +where + +$$ +R _ {\tilde {f} _ {*}} := \frac {\gamma_ {\boldsymbol {x}} ^ {(f)} (\tilde {f} _ {*}) \phi (\gamma_ {\boldsymbol {x}} ^ {(f)} (\tilde {f} _ {*}))}{1 - \Phi (\gamma_ {\boldsymbol {x}} ^ {(f)} (\tilde {f} _ {*}))} + \sum_ {c = 1} ^ {C} \frac {\gamma_ {\boldsymbol {x}} ^ {(g _ {c})} (z _ {c}) \phi (\gamma_ {\boldsymbol {x}} ^ {(g _ {c})} (z _ {c}))}{1 - \Phi (\gamma_ {\boldsymbol {x}} ^ {(g _ {c})} (z _ {c}))}. +$$ + +In the correlated case, $H(h_{\pmb{x}})$ and $H(h_{\pmb{x}} \mid h_{\pmb{x}} \in \mathcal{A}_{\tilde{f}_*})$ are also replaced with their closed-forms (shown in Appendix F), and we obtain + +$$ +\alpha^ {\mathrm {C M E S}} (\boldsymbol {x}) = \frac {1}{K} \sum_ {\tilde {f} _ {*} \in \mathcal {F} _ {*}} \frac {Z _ {\boldsymbol {x}} \left(\tilde {f} _ {*}\right)}{2 \left(1 - Z _ {\boldsymbol {x}} \left(\tilde {f} _ {*}\right)\right)} \left(\operatorname {T r} \left(\boldsymbol {\Sigma} ^ {- 1} (\boldsymbol {x}) \left(\boldsymbol {\Sigma} ^ {\mathrm {T N}} (\boldsymbol {x}) + \boldsymbol {d} \boldsymbol {d} ^ {\top}\right)\right) - C - 1\right) - \log \left(1 - Z _ {\boldsymbol {x}} \left(\tilde {f} _ {*}\right)\right), \tag {21} +$$ + +where $\operatorname{Tr}(\cdot)$ is the trace of a matrix, $\pmb{\mu}(\pmb{x})$ and $\pmb{\Sigma}(\pmb{x})$ are the expectation and covariance matrix of $h_x$ , respectively, $\pmb{\mu}^{\mathrm{TN}}(\pmb{x})$ and $\pmb{\Sigma}^{\mathrm{TN}}(\pmb{x})$ are those for $h_x|h_x \in \mathcal{A}_{\tilde{f}_*}$ , and $\pmb{d} = \pmb{\mu}^{\mathrm{TN}}(\pmb{x}) - \pmb{\mu}(\pmb{x})$ . See Appendix F for details. + +# E.2. Parallelization of CMES + +We can consider the CMI maximization in the same way as CMES-IBO. Suppose that we already select the $q - 1$ queries, and we need to select the next $q$ -th query. The CMI can be approximated as + +$$ +\begin{array}{l} \mathbb {E} _ {\mathcal {H} _ {q - 1}} \left[ I \left(\boldsymbol {h} _ {\boldsymbol {x} ^ {(q)}}; f _ {*} \mid \mathcal {H} _ {q - 1}\right) \right] = \mathbb {E} _ {\mathcal {H} _ {q - 1}} \left[ H \left(\boldsymbol {h} _ {\boldsymbol {x} ^ {(q)}} \mid \mathcal {H} _ {q - 1}\right) \right] - \mathbb {E} _ {\mathcal {H} _ {q - 1}, f _ {*}} \left[ H \left(\boldsymbol {h} _ {\boldsymbol {x} ^ {(q)}} \mid f _ {*}, \mathcal {H} _ {q - 1}\right) \right] \\ \approx \mathbb {E} _ {\mathcal {H} _ {q - 1}} \left[ H (\boldsymbol {h} _ {\boldsymbol {x} ^ {(q)}} | \mathcal {H} _ {q - 1}) \right] - \mathbb {E} _ {\mathcal {H} _ {q - 1}, f _ {*}} \left[ H (\boldsymbol {h} _ {\boldsymbol {x} ^ {(q)}} | \boldsymbol {h} _ {\boldsymbol {x} ^ {(q)}} \in \overline {{\mathcal {A}}} _ {f _ {*}}, \mathcal {H} _ {q - 1}) \right] \\ \end{array} +$$ + +As described in Appendix B, we define $f(\pmb{x})|\mathcal{D}_{t-1}, \mathcal{X}_{q-1}, \mathcal{H}_{q-1} \sim \mathcal{N}\big(m_{\pmb{x}(q)}^{(f)}, s_{\pmb{x}(q)}^{(f)^2}\big)$ and $g_c(\pmb{x})|\mathcal{D}_{t-1}, \mathcal{X}_{q-1}, \mathcal{H}_{q-1} \sim \mathcal{N}\big(m_{\pmb{x}(q)}^{(g_c)}, s_{\pmb{x}(q)}^{(g_c)^2}\big) c = 1, \ldots, C$ . Importantly, $s_{\pmb{x}(q)}^{(f)^2}, s_{\pmb{x}(q)}^{(g_c)^2}, \ldots, s_{\pmb{x}(q)}^{(g_C)^2}$ only depend on $\mathcal{X}_{q-1}$ , not $\mathcal{H}_{q-1}$ . Thus, given $\mathcal{X}_{q-1}$ , the first term $\mathbb{E}_{\mathcal{H}_{q-1}}\big[H(\pmb{h}_{\pmb{x}(q)}|\mathcal{H}_{q-1})\big]$ can be calculated analytically. The second term is also calculated in the same manner as CMES with given $\tilde{f}_*$ and $\mathcal{H}_{q-1}$ : + +$$ +H (\pmb {h} _ {\pmb {x} ^ {(q)}} \mid \pmb {h} _ {\pmb {x} ^ {(q)}} \in \overline {{\mathcal {A}}} _ {\tilde {f} _ {*}}, \mathcal {H} _ {q - 1}) = H (\pmb {h} _ {\pmb {x} ^ {(q)}} | \mathcal {H} _ {q - 1}) - \frac {Z _ {\pmb {x} ^ {(q)}} (\tilde {f} _ {*} | \mathcal {X} _ {q - 1})}{2 (1 - Z _ {\pmb {x} ^ {(q)}} (\tilde {f} _ {*} | \mathcal {X} _ {q - 1}))} R _ {\tilde {f} _ {*}} ^ {(q)} + \log (1 - Z _ {\pmb {x} ^ {(q)}} (\tilde {f} _ {*} | \mathcal {X} _ {q - 1})), +$$ + +where + +$$ +R _ {\tilde {f} _ {*}} ^ {(q)} := \frac {\eta_ {\pmb {x} ^ {(q)}} ^ {(f)} (\tilde {f} _ {*}) \phi (\eta_ {\pmb {x} ^ {(q)}} ^ {(f)} (\tilde {f} _ {*}))}{1 - \Phi (\eta_ {\pmb {x} ^ {(q)}} ^ {(f)} (\tilde {f} _ {*}))} + \sum_ {c = 1} ^ {C} \frac {\eta_ {\pmb {x} ^ {(q)}} ^ {(g _ {c})} (z _ {c}) \phi (\eta_ {\pmb {x} ^ {(q)}} ^ {(g _ {c})} (z _ {c}))}{1 - \Phi (\eta_ {\pmb {x} ^ {(q)}} ^ {(g _ {c})} (z _ {c}))}. +$$ + +Finally, by applying the MC approximation, we obtain the acquisition function below + +$$ +\alpha^ {\text {C M E S}} \left(\boldsymbol {x} ^ {(q)} \mid \mathcal {X} _ {q - 1}\right) = \frac {1}{| \mathcal {I} |} \sum_ {\left(\tilde {f} _ {*}, \mathcal {H} _ {q - 1}\right) \in \mathcal {J}} \frac {Z _ {\boldsymbol {x} ^ {(q)}} \left(\tilde {f} _ {*} \mid \mathcal {X} _ {q - 1}\right)}{2 \left(1 - Z _ {\boldsymbol {x} ^ {(q)}} \left(\tilde {f} _ {*} \mid \mathcal {X} _ {q - 1}\right)\right)} R _ {\tilde {f} _ {*}} ^ {(q)} - \log \left(1 - Z _ {\boldsymbol {x} ^ {(q)}} \left(\tilde {f} _ {*} \mid \mathcal {X} _ {q - 1}\right)\right). \tag {22} +$$ + +We can also derive the acquisition function in the correlated setting, but we omit the detailed derivation. + +# E.3. Interpretation and Proof of Lemma 4.1 + +Interpretation of negativity At first, we provide an intuition that the acquisition function of CMES becomes negative when $C > 5$ . In (9), CMES replaces $\mathbb{E}_{f_{*}}[H(\pmb{h}_{\pmb{x}}|f_{*})]$ with $\mathbb{E}_{f_{*}}[H(\pmb{h}_{\pmb{x}}|\pmb{h}_{\pmb{x}}\in\overline{\mathcal{A}_{f_{*}}})]$ , in which the variable of the expectation $f_{*}$ and the condition of the entropy $h_{\pmb{x}}\in \overline{\mathcal{A}}_{f_{*}}$ are not identical unlike $\mathbb{E}_{f_{*}}[H(\pmb{h}_{\pmb{x}}|f_{*})]$ . Thus, (9) cannot be seen as an MI anymore, and the non-negative guarantee is not maintained. The negativity is derived by minimizing $\alpha^{\mathrm{CMES}}(\pmb{x})$ with respect to $\{z_c\}_{c = 1}^C$ in Lemma 4.1. The $'C > 5'$ is the boundary that an upper bound of this minimum becomes less than 0. + +Proof Before the proof of Lemma 4.1, we prove the following auxiliary lemma: + +Lemma E.1. Let $a(\gamma) \coloneqq \frac{\gamma\phi(\gamma)}{1 - \Phi(\gamma)}$ for $\gamma \in \mathbb{R}$ . Then, $\min_{\gamma \in \mathbb{R}}a(\gamma) < -0.29$ . + +Proof. Using the approximation of CDF (26.2.17 in Abramowitz & Stegun, 1964), we obtain + +$$ +\Phi (\gamma) = 1 - \phi (\gamma) \left(b _ {1} r + b _ {2} r ^ {2} + b _ {3} r ^ {3} + b _ {4} r ^ {4} + b _ {5} r ^ {5}\right) + \epsilon (\gamma), \tag {23} +$$ + +where + +$$ +\left| \epsilon (\gamma) \right| < 7. 5 \times 1 0 ^ {- 8}, r = 1 / (1 + p \gamma), p = 0. 2 3 1 6 4 1 9, +$$ + +$$ +b _ {1} = 0. 3 1 9 3 8 1 5 3 0, b _ {2} = - 1. 8 2 1 2 5 5 9 7 8, b _ {3} = - 0. 3 5 6 5 6 3 7 8 2, b _ {4} = 1. 3 3 0 2 7 4 4 2 9, b _ {5} = 1. 7 8 1 4 7 7 9 3 7. +$$ + +By substituting (23) into $a(\gamma)$ , we obtain + +$$ +a (\gamma) = \frac {\gamma}{b _ {1} r + b _ {2} r ^ {2} + b _ {3} r ^ {3} + b _ {4} r ^ {4} + b _ {5} r ^ {5} + \epsilon (\gamma) / \phi (\gamma)} \mathrm {f o r} \forall \gamma \in \mathbb {R}. +$$ + +Since $\epsilon (\gamma) / \phi (\gamma) = \sqrt{2\pi} e^{\gamma^2}\epsilon (\gamma) < 9\epsilon (\gamma) < 9\times 7.5\times 10^{-8} < 10^{-6}$ for $\gamma \in [-1,0]$ , we obtain an upper bound + +$$ +a (\gamma) < \frac {\gamma}{b _ {1} r + b _ {2} r ^ {2} + b _ {3} r ^ {3} + b _ {4} r ^ {4} + b _ {5} r ^ {5} + 1 0 ^ {- 6}} \text {f o r} \forall \gamma \in [ - 1, 0 ]. \tag {24} +$$ + +This upper bound consists of elementary arithmetic that can be computed without approximations such as the numerical integration. We evaluated this upper bound (24) with 28 digits of precision by decimal package (https://docs. python.org/3/library/decimal.html) in Python, and we confirmed $\min_{\gamma \in \mathbb{R}}a(\gamma) < a(-0.84) < -0.29$ + +Next, we prove Lemma 4.1. By using $\log (1 - Z) \geq \left(1 - \frac{1}{1 - Z}\right) = \frac{-Z}{1 - Z}$ for $Z \in [0,1)$ , an upper bound of the CMES acquisition function (10) can be derived as + +$$ +\begin{array}{l} \frac {1}{K} \sum_ {\tilde {f} _ {*} \in \mathcal {F} _ {*}} \left\{\frac {Z _ {\boldsymbol {x}} (\tilde {f} _ {*})}{2 (1 - Z _ {\boldsymbol {x}} (\tilde {f} _ {*}))} \left(\frac {\gamma_ {\boldsymbol {x}} ^ {(f)} (\tilde {f} _ {*}) \phi (\gamma_ {\boldsymbol {x}} ^ {(f)} (\tilde {f} _ {*}))}{1 - \Phi (\gamma_ {\boldsymbol {x}} ^ {(f)} (\tilde {f} _ {*}))} + \sum_ {c = 1} ^ {C} \frac {\gamma_ {\boldsymbol {x}} ^ {(g _ {c})} (z _ {c}) \phi (\gamma_ {\boldsymbol {x}} ^ {(g _ {c})} (z _ {c}))}{1 - \Phi (\gamma_ {\boldsymbol {x}} ^ {(g _ {c})} (z _ {c}))}\right) - \log (1 - Z _ {\boldsymbol {x}} (\tilde {f} _ {*})) \right\} \\ \leq \frac {1}{K} \sum_ {\tilde {f} _ {*} \in \mathcal {F} _ {*}} \left\{\frac {Z _ {\boldsymbol {x}} (\tilde {f} _ {*})}{2 (1 - Z _ {\boldsymbol {x}} (\tilde {f} _ {*}))} \left(\frac {\gamma_ {\boldsymbol {x}} ^ {(f)} (\tilde {f} _ {*}) \phi (\gamma_ {\boldsymbol {x}} ^ {(f)} (\tilde {f} _ {*}))}{1 - \Phi (\gamma_ {\boldsymbol {x}} ^ {(f)} (\tilde {f} _ {*}))} + \sum_ {c = 1} ^ {C} \frac {\gamma_ {\boldsymbol {x}} ^ {(g _ {c})} (z _ {c}) \phi (\gamma_ {\boldsymbol {x}} ^ {(g _ {c})} (z _ {c}))}{1 - \Phi (\gamma_ {\boldsymbol {x}} ^ {(g _ {c})} (z _ {c}))}\right) - \left(\frac {- Z _ {\boldsymbol {x}} (\tilde {f} _ {*})}{1 - Z _ {\boldsymbol {x}} (\tilde {f} _ {*})}\right) \right\} \\ = \frac {1}{K} \sum_ {\tilde {f} _ {*} \in \mathcal {F} _ {*}} \frac {Z _ {\boldsymbol {x}} (\tilde {f} _ {*})}{(1 - Z _ {\boldsymbol {x}} (\tilde {f} _ {*}))} \left\{\frac {1}{2} \left(\frac {\gamma_ {\boldsymbol {x}} ^ {(f)} (\tilde {f} _ {*}) \phi (\gamma_ {\boldsymbol {x}} ^ {(f)} (\tilde {f} _ {*}))}{1 - \Phi (\gamma_ {\boldsymbol {x}} ^ {(f)} (\tilde {f} _ {*}))} + \sum_ {c = 1} ^ {C} \frac {\gamma_ {\boldsymbol {x}} ^ {(g _ {c})} (z _ {c}) \phi (\gamma_ {\boldsymbol {x}} ^ {(g _ {c})} (z _ {c}))}{1 - \Phi (\gamma_ {\boldsymbol {x}} ^ {(g _ {c})} (z _ {c}))}\right) + 1 \right\}. \\ \end{array} +$$ + +Since $\frac{Z_{\infty}(\tilde{f}_{*})}{1 - Z_{\infty}(\tilde{f}_{*})} \geq 0$ , we see that the sign of the above upper bound is determined by + +$$ +s \left(z _ {1}, \dots , z _ {C}\right) := \frac {1}{2} a \left(\gamma_ {\boldsymbol {x}} ^ {(f)} \left(\tilde {f} _ {*}\right)\right) + \frac {1}{2} \sum_ {c = 1} ^ {C} a \left(\gamma_ {\boldsymbol {x}} ^ {\left(g _ {c}\right)} \left(z _ {c}\right)\right) + 1. \tag {25} +$$ + +Note that $s$ is defined as a function of $z_{c}$ + +From Lemma E.1, we see + +$$ +\min _ {z _ {1}, \dots , z _ {C}} s (z _ {1}, \dots , z _ {C}) < \frac {1}{2} a \left(\gamma_ {\boldsymbol {x}} ^ {(f)} (\tilde {f} _ {*})\right) - \frac {0 . 2 9 C}{2} + 1. +$$ + +Moreover, since $\tilde{f}_{*}$ is sampled from $p(f_{*})$ whose support is $\mathbb{R}$ , $a(\gamma_{\boldsymbol{x}}^{(f)}(\tilde{f}_{*}))$ can be smaller than $-0.29$ . Hence, if $0.29(C + 1)/2 > 1$ , (25) can be negative. Thus, (10) can be negative when $C > 5$ , since $0.29(C + 1)/2 = 0.29(6 + 1)/2 = 2.03/2 > 1$ when $C = 6$ . + +# E.4. Illustrative Example that CMES Takes a Negative Value + +First, we describe the detailed setting of Figure 2 omitted in the main text. In the plots, we have 200 equally spaced grid points as $\mathcal{X}$ . We sampled $f_{*}$ through the sampling from the predictive multivariate normal distribution on these grid points. We assume the posterior of $g_{c}$ for $\forall c$ are the same for brevity, and this may seem to contradict the assumption that $f$ and $g_{c}$ for $\forall c$ are independent. However, since the independence assumption does not mean that observations of different functions cannot take the same value, Fig. 2 does not contradict the assumption. In fact, this setting (same observations for all constraints) is not an essential requirement for negativity. Typically, CMES (10) is negatively biased when $(z_{c} - \mu^{(g_{c})}(\pmb{x})) / \sigma^{(g_{c})}(\pmb{x}) \approx -0.84$ for $\forall c$ that can happen even if observations are different for each constraint. Moreover, since $(z_{c} - \mu_{t-1}^{(g_{c})}(\pmb{x})) / \sigma_{t-1}^{(g_{c})}(\pmb{x}) \approx -0.84$ suggests a high probability satisfying the $c$ -th constraint $\operatorname{Pr}(g_{c}(\pmb{x}) \geq z_{c}) \approx 0.8$ , this negative bias can be a significant problem. + +![](images/a1ba40771aa02d5cd67946868c38885993a91ff8537d9672b673e33234c3b824.jpg) + +![](images/07352b66001770f4cdeb59ee0e7d5bfe5a20976602eba8487059bca4f5426927.jpg) + +![](images/75ad68b0831ea1a88b9f86b847138c072ff223665b94ee6e69ce75cbad38ac7b.jpg) +Figure 5: In (a) and (b), the predictions of $f$ and $g_{c}$ are shown, respectively. The solid line and shaded area represent the predictive mean and the credible interval, and the cross mark is the training data. The horizontal dotted line expresses $z_{c}$ . In (c)-(e), CMES, CMES-IBO, and the KDE-based MI approximation for $C = 4, 5, 6$ , and 7 are shown, and each vertical dotted line indicates the maximum. + +![](images/76ce395abeca9723adea09ddc6f6dedfc55ea32195c0905b74bc813dc5528604.jpg) + +![](images/3aa2ebee37af8f927ad3b02e067e2875189f15f33a6c0a7f0848c08a85d8fb08.jpg) + +The detailed procedure of KDE-MI is as follows. We used the following representation of the MI (Nair et al., 2007) because, in this form, KDE is required only for one dimensional densities: + +$$ +\begin{array}{l} \operatorname {M I} \left(\boldsymbol {h} _ {\boldsymbol {x}}; f _ {*}\right) = \mathbb {E} _ {\boldsymbol {h} _ {\boldsymbol {x}}} \left[ \Pr \left(f _ {*} = - \infty \mid \boldsymbol {h} _ {\boldsymbol {x}}\right) \log \frac {\Pr \left(f _ {*} = - \infty \mid \boldsymbol {h} _ {\boldsymbol {x}}\right)}{\Pr \left(f _ {*} = - \infty\right)} + \Pr \left(f _ {*} \neq - \infty \mid \boldsymbol {h} _ {\boldsymbol {x}}\right) \log \frac {\Pr \left(f _ {*} \neq - \infty \mid \boldsymbol {h} _ {\boldsymbol {x}}\right)}{\Pr \left(f _ {*} \neq - \infty\right)} \right. \\ + \operatorname * {P r} (f _ {*} \neq - \infty | \boldsymbol {h} _ {\boldsymbol {x}}) \int p (f _ {*} | \boldsymbol {h} _ {\boldsymbol {x}}, f _ {*} \neq - \infty) \log \frac {p (f _ {*} | \boldsymbol {h} _ {\boldsymbol {x}} , f _ {*} \neq - \infty)}{p (f _ {*} | f _ {*} \neq - \infty)} \mathrm {d} f _ {*} \Biggr ], \\ \end{array} +$$ + +where the expectation over $h_{\pmb{x}}$ is approximated by the MC estimation with 10000 samples. The probabilities $\operatorname{Pr}(f_{*} = -\infty | h_{\pmb{x}})$ and $\operatorname{Pr}(f_{*} = -\infty)$ are estimated by the percentage of infeasible samples in 10000 samples $(\operatorname{Pr}(f_{*} \neq -\infty | h_{\pmb{x}})$ and $\operatorname{Pr}(f_{*} \neq -\infty)$ are estimated in the same way). The one-dimensional density functions $p(f_{*} | f_{*} \neq -\infty)$ and $p(f_{*} | h_{\pmb{x}}, f_{*} \neq -\infty)$ are estimated by KDE fitted to feasible samples among 10000 samples of $f_{*}$ and $f_{*} | h_{\pmb{x}}$ , respectively. Note that $p(f_{*} | h_{\pmb{x}})$ is approximated by generating 10000 $f_{*}$ for each MC sample of $h_{\pmb{x}}$ . We approximate the one-dimensional integral with respect to $f_{*}$ in the outer expectation by Gauss-Legendre quadrature. We empirically confirmed that the estimation variance of this procedure was low enough. + +Here, we show an additional example in Figure 5, in which the number of the MC samplings in CMES and CMES-IBO is set as $K = 10000$ . The other settings are the same as Figure 2. Since we set $K$ as 10000 in Figure 5, we expect that the MC estimation are highly accurate. For CMES, we see that the behavior is slightly improved compared with the case of $K = 10$ in Figure 2 (In particular, the acquisition function of $C = 5$ in Figure 5 (c) is more reasonable than that of Figure 2 (c)). However, in the case of $C = 6$ and 7, CMES still takes negative values. In this example, querying to the inputs around 0.2 and 0.9 are obviously beneficial because both predictions of $f(\pmb{x})$ and $g_{c}(\pmb{x})$ are large. In particular, the inputs around 0.9 can be a better selection than around 0.2 because the probability of being feasible is the highest, while the uncertainty is almost the same as around 0.2. The arg max of KDE-MI and CMES-IBO are the same point around 0.9 regardless of the number of constraints $C$ . On the other hand, the acquisition function values of CMES for a point around 0.9 rapidly decrease with the number of constraints $C$ . Although CMES selects a point around 0.9 for $C = 4$ and 5, but for $C = 6$ and 7, CMES selects a point around 0.2. + +# F. Derivation of Entropy of TMN + +In this section, we derive the entropy of TMN truncated by a hyperrectangle $H(h_{\pmb{x}}|h_{\pmb{x}} \in \mathcal{A}_{\tilde{f}_*})$ for both independent and correlated cases. + +# F.1. Independent Case + +In this case, $H(h_{\pmb{x}}|h_{\pmb{x}} \in \mathcal{A}_{\tilde{f}_*})$ can be decomposed to the sum of the entropy of each element (Horrace, 2005): + +$$ +H \left(\boldsymbol {h} _ {\boldsymbol {x}} \mid \boldsymbol {h} _ {\boldsymbol {x}} \in \mathcal {A} _ {\tilde {f} _ {*}}\right) = H \left(f (\boldsymbol {x}) \mid f (\boldsymbol {x}) \geq \tilde {f} _ {*}\right) + \sum_ {c = 1} ^ {C} H \left(g _ {c} (\boldsymbol {x}) \mid g _ {c} (\boldsymbol {x}) \geq z _ {c}\right). +$$ + +The analytical form of the entropy of the one-dimensional truncated normal distribution is known (Michalowicz et al., 2014), by which we obtain + +$$ +H \big (f (\boldsymbol {x}) | f (\boldsymbol {x}) \geq \tilde {f} _ {*} \big) = \log \big (\sqrt {2 \pi e} \sigma^ {(f)} (\boldsymbol {x}) (1 - \Phi (\gamma_ {\boldsymbol {x}} ^ {(f)} (\tilde {f} _ {*}))) \big) + \frac {\gamma_ {\boldsymbol {x}} ^ {(f)} (\tilde {f} _ {*}) \phi (\gamma_ {\boldsymbol {x}} ^ {(f)} (\tilde {f} _ {*}))}{2 \big (1 - \Phi (\gamma_ {\boldsymbol {x}} ^ {(f)} (\tilde {f} _ {*})) \big)}, +$$ + +$$ +H \big (g _ {c} (\boldsymbol {x}) | g _ {c} (\boldsymbol {x}) \geq z _ {c} \big) = \log \big (\sqrt {2 \pi e} \sigma^ {(g _ {c})} (\boldsymbol {x}) (1 - \Phi \left(\gamma_ {\boldsymbol {x}} ^ {(g _ {c})} (z _ {c}))\right)) + \frac {\gamma_ {\boldsymbol {x}} ^ {(g _ {c})} (z _ {c}) \phi \left(\gamma_ {\boldsymbol {x}} ^ {(g _ {c})} (z _ {c})\right)}{2 \big (1 - \Phi \left(\gamma_ {\boldsymbol {x}} ^ {(g _ {c})} (z _ {c})\right) \big)}. +$$ + +Moreover, from the independence of each elements of $\pmb{h}_{\pmb{x}}$ , we see $H(\pmb{h}_{\pmb{x}}) = \log \left( \sqrt{2\pi e} \sigma^{(f)}(\pmb{x}) \right) + \sum_{c=1}^{C} \log \left( \sqrt{2\pi e} \sigma^{(g_c)}(\pmb{x}) \right)$ . Then, the entropy of TMN is obtained as + +$$ +H (\boldsymbol {h} _ {\boldsymbol {x}} | \boldsymbol {h} _ {\boldsymbol {x}} \in \mathcal {A} _ {\tilde {f} _ {*}}) = H (\boldsymbol {h} _ {\boldsymbol {x}}) + \log (Z _ {\boldsymbol {x}} (\tilde {f} _ {*})) + \frac {R _ {\tilde {f} _ {*}}}{2}, +$$ + +where + +$$ +R _ {\tilde {f} _ {*}} = \frac {\gamma_ {\boldsymbol {x}} ^ {(f)} (\tilde {f} _ {*}) \phi (\gamma_ {\boldsymbol {x}} ^ {(f)} (\tilde {f} _ {*}))}{1 - \Phi (\gamma_ {\boldsymbol {x}} ^ {(f)} (\tilde {f} _ {*}))} + \sum_ {c = 1} ^ {C} \frac {\gamma_ {\boldsymbol {x}} ^ {(g _ {c})} (z _ {c}) \phi (\gamma_ {\boldsymbol {x}} ^ {(g _ {c})} (z _ {c}))}{1 - \Phi (\gamma_ {\boldsymbol {x}} ^ {(g _ {c})} (z _ {c}))}. +$$ + +# F.2. Correlated Case + +Supposed that $h_{x}$ has a correlated distribution defined as + +$$ +\boldsymbol {h} _ {\boldsymbol {x}} \mid \mathcal {D} _ {t - 1} \sim \mathcal {N} (\boldsymbol {\mu} (\boldsymbol {x}), \boldsymbol {\Sigma} (\boldsymbol {x})), +$$ + +where $\pmb{\mu}(\pmb{x})$ and $\pmb{\Sigma}(\pmb{x})$ can be obtained by an arbitrary multi-output GP model (Rasmussen & Williams, 2005). Let $\pmb{\mu}^{\mathrm{TN}}(\pmb{x})$ and $\pmb{\Sigma}^{\mathrm{TN}}(\pmb{x})$ be the expectation and covariance matrix of $h_x|h_x\in \mathcal{A}_{\tilde{f}_*}$ , respectively, whose analytical expressions are known (G & Wilhelm, 2012). We denote $\mathbb{E}_{h_x|h_x\in \mathcal{A}_{\tilde{f}_*}}$ , which is the expectation with respect to $h_x|h_x\in \mathcal{A}_{\tilde{f}_*}$ , as $\mathbb{E}_{\mathrm{TN}}$ for brevity. Then, we can transform the entropy $H(h_{x}|h_{x}\in \mathcal{A}_{\tilde{f}_{*}})$ into + +$$ +\begin{array}{l} H \left(\boldsymbol {h} _ {\boldsymbol {x}} \mid \boldsymbol {h} _ {\boldsymbol {x}} \in \mathcal {A} _ {\tilde {f} _ {*}}\right) = \mathbb {E} _ {\mathrm {T N}} \left[ - \log p \left(\boldsymbol {h} _ {\boldsymbol {x}} \mid \boldsymbol {h} _ {\boldsymbol {x}} \in \mathcal {A} _ {\tilde {f} _ {*}}\right) \right] \\ = \mathbb {E} _ {\mathrm {T N}} \left[ - \log \frac {p (\boldsymbol {h} _ {\boldsymbol {x}})}{Z} \right] \\ = \mathbb {E} _ {\mathrm {T N}} \left[ - \log p \left(\boldsymbol {h} _ {\boldsymbol {x}}\right) \right] + \log Z \\ = \frac {1}{2} \mathbb {E} _ {\mathrm {T N}} \left[ \left(\boldsymbol {h} _ {\boldsymbol {x}} - \boldsymbol {\mu} (\boldsymbol {x})\right) ^ {\top} \boldsymbol {\Sigma} ^ {- 1} (\boldsymbol {x}) \left(\boldsymbol {h} _ {\boldsymbol {x}} - \boldsymbol {\mu} (\boldsymbol {x})\right) \right] + \frac {1}{2} | 2 \pi \boldsymbol {\Sigma} (\boldsymbol {x}) | + \log Z \\ = \frac {1}{2} \operatorname {T r} \left(\boldsymbol {\Sigma} ^ {- 1} (\boldsymbol {x}) \underbrace {\mathbb {E} _ {\mathrm {T N}} \left[ \left(\boldsymbol {h} _ {\boldsymbol {x}} - \boldsymbol {\mu} (\boldsymbol {x})\right) \left(\boldsymbol {h} _ {\boldsymbol {x}} - \boldsymbol {\mu} (\boldsymbol {x})\right) ^ {\top} \right]}\right) + \frac {1}{2} | 2 \pi \boldsymbol {\Sigma} (\boldsymbol {x}) | + \log Z, \\ \end{array} +$$ + +Algorithm 1 Sequential- and parallel- CMES-IBO. +1: function CMES-IBO(D0, X, Q, K) +2: for $t = 0,\dots ,T$ do +3: for $k = 1,\ldots ,K$ do +4: Sample $\tilde{f}_{(k)},\tilde{g}_{1(k)},\dots ,\tilde{g}_{C(k)}$ from current GPs +5: $\tilde{f}_{*(k)}\gets \left\{\max_{\boldsymbol {x}\in \tilde{\mathcal{X}}_{\mathrm{feasible}}}\tilde{f}_{(k)}(\boldsymbol {x}),\right.$ if $\tilde{\mathcal{X}}_{\mathrm{feasible}}\neq \emptyset$ otherwise, where $\tilde{\mathcal{X}}_{\mathrm{feasible}}\coloneqq \{\pmb {x}\mid \tilde{g}_c(\pmb {x})\geq z_c,c = 1,\dots ,C\}$ +6: end for +7: $\mathcal{F}_{*} = \{\tilde{f}_{*(k)}\}_{k = 1}^{K}$ +8: $x_{t}^{(1)}\gets \arg \max_{\boldsymbol {x}\in \mathcal{X}}\alpha^{\mathrm{IBO}}(\boldsymbol {x})$ (6) +9: if $Q > 1$ then +10: for $q = 2,\dots ,Q$ do +11: $\mathcal{J} = \left\{\left(\tilde{f}_{*(k)},\left\{\left(\tilde{f}_{(k)}(\boldsymbol{x}_{t}^{(q^{\prime})}),\tilde{g}_{1(k)}(\boldsymbol{x}_{t}^{(q^{\prime})}),\dots ,\tilde{g}_{C(k)}(\boldsymbol{x}_{t}^{(q^{\prime})})\right)^{\top}\right\}_{q^{\prime} = 1}^{q - 1}\right)\right\}_{k = 1}^{K}$ +12: $x_{t}^{(q)}\gets \arg \max_{\boldsymbol {x}\in \mathcal{X}}\alpha_{t}^{\mathrm{IBO}}(\boldsymbol {x}|\mathcal{X}_{q - 1})$ (8) +13: end for +14: end if +15: Evaluate $f,g_{1},\dots ,g_{C}$ at $\mathcal{X}_q$ +16: Update $\mathcal{D}_t^{(f)},\mathcal{D}_t^{(g_1)},\dots ,\mathcal{D}_t^{(g_C)}$ adding new observations +17: end for +18: end function + +where $|\cdot|$ is the determinant of a matrix. Further, by using $\pmb{d} = \pmb{\mu}^{\mathrm{TN}}(\pmb{x}) - \pmb{\mu}(\pmb{x})$ , we obtain + +$$ +\begin{array}{l} \boldsymbol {V} = \mathbb {E} _ {\mathrm {T N}} \left[ \left(\boldsymbol {h} _ {\boldsymbol {x}} - \boldsymbol {\mu} ^ {\mathrm {T N}} (\boldsymbol {x}) + \boldsymbol {d}\right) \left(\boldsymbol {h} _ {\boldsymbol {x}} - \boldsymbol {\mu} ^ {\mathrm {T N}} (\boldsymbol {x}) + \boldsymbol {d}\right) ^ {\top} \right] \\ = \mathbb {E} _ {\mathrm {T N}} \left[ \left(\boldsymbol {h} _ {\boldsymbol {x}} - \boldsymbol {\mu} ^ {\mathrm {T N}} (\boldsymbol {x})\right) \left(\boldsymbol {h} _ {\boldsymbol {x}} - \boldsymbol {\mu} ^ {\mathrm {T N}} (\boldsymbol {x})\right) ^ {\top} + \boldsymbol {d} \left(\boldsymbol {h} _ {\boldsymbol {x}} - \boldsymbol {\mu} ^ {\mathrm {T N}} (\boldsymbol {x})\right) ^ {\top} + \left(\boldsymbol {h} _ {\boldsymbol {x}} - \boldsymbol {\mu} ^ {\mathrm {T N}} (\boldsymbol {x})\right) \boldsymbol {d} ^ {\top} + \boldsymbol {d} \boldsymbol {d} ^ {\top} \right] \\ = \mathbb {E} _ {\mathrm {T N}} \left[ \left(\boldsymbol {h} _ {\boldsymbol {x}} - \boldsymbol {\mu} ^ {\mathrm {T N}} (\boldsymbol {x})\right) \left(\boldsymbol {h} _ {\boldsymbol {x}} - \boldsymbol {\mu} ^ {\mathrm {T N}} (\boldsymbol {x})\right) ^ {\top} \right] + \boldsymbol {d} \boldsymbol {d} ^ {\top} \\ = \boldsymbol {\Sigma} ^ {\mathrm {T N}} (\boldsymbol {x}) + \boldsymbol {d} \boldsymbol {d} ^ {\top}, \\ \end{array} +$$ + +where we use $\mathbb{E}_{\mathrm{TN}}\big[\big(h_{\pmb{x}} - \pmb{\mu}^{\mathrm{TN}}(\pmb {x})\big)\big] = 0$ . Consequently, we can derive + +$$ +H \left(\boldsymbol {h} _ {\boldsymbol {x}} \mid \boldsymbol {h} _ {\boldsymbol {x}} \in \mathcal {A} _ {\tilde {f} _ {*}}\right) = \frac {1}{2} \operatorname {T r} \left(\boldsymbol {\Sigma} ^ {- 1} (\boldsymbol {x}) \left(\boldsymbol {\Sigma} ^ {\mathrm {T N}} (\boldsymbol {x}) + \boldsymbol {d} \boldsymbol {d} ^ {\top}\right)\right) + \frac {1}{2} | 2 \pi \boldsymbol {\Sigma} (\boldsymbol {x}) | + \log Z. +$$ + +# G. Computation of CMES-IBO and CMES + +In this section, we describe several computational details. First, we present the general algorithm for sequential- and parallel-CMES-IBO in Algo. 1, where sequential CMES-IBO corresponds to the case that $Q = 1$ . By replacing (6) and (8) in Algo. 1 with those of CMES (10) and (22), this algorithm can also be seen as the algorithm for sequential- and parallel-CMES. + +# G.1. Sampling from Posterior + +Our proposed method needs to sample the maximum value $f_{*}$ defined by (1). We employ an approach using random Fourier features (RFF) (Rahimi & Recht, 2008), which has been used in various entropy-based BO and CBO methods (Hernández-Lobato et al., 2014; 2015; Wang & Jegelka, 2017). In the RFF-based sampling, RFF $\phi(\pmb{x}) \in \mathbb{R}^{D}$ are first generated, and a Bayesian linear regression model $f(\pmb{x}) \approx \omega^{\top} \phi(\pmb{x})$ with the coefficients $\omega \in \mathbb{R}^{D}$ is constructed. By sampling the coefficients $\omega$ from the Gaussian posterior, a continuous sample path can be derived. Let $\tilde{f}_{(k)}$ and $\tilde{g}_{c(k)} (c \in \{1, \dots, C\})$ be the $k$ -th set of sample paths $(k \in \{1, \dots, K\})$ for the objective and constraint functions. The $k$ -th sample of $f_{*}$ , can be obtained by solving a constrained optimization problem $\max_{x \in X} \tilde{f}_{(k)}(\pmb{x})$ , s.t. $\tilde{g}_{c(k)}(\pmb{x}) \geq z_c$ , $c = 1, \dots, C$ . We can apply any constrained optimization modules such as the method of moving asymptotes (Svanberg, 2002). Another approach + +would be the discretization-based sampling through multivariate normal distribution (Perrone et al., 2019), though the number of discretization points strongly depends on the input dimension $d$ for sufficiently accurate sampling. + +For parallel querying, we need to sample the $f_*$ and $\mathcal{H}_{q-1}$ simultaneously. By using RFF-based sampling, these random variables are sampled from a joint distribution easily, i.e., $\mathcal{H}_{q-1}$ can be sampled as a value of the sample paths $\tilde{f}_{(k)}(\boldsymbol{x})$ and $\tilde{g}_{c(k)}(\boldsymbol{x})$ at $\boldsymbol{x} \in \mathcal{X}_{q-1}$ . Moreover, in the MC approximation for $q > 1$ , we can reuse the sample paths $\tilde{f}_{(k)}, \tilde{g}_{1(k)}, \ldots, \tilde{g}_{C(k)}$ that are sampled at $q = 1$ as described in Algo. 1. Because of this reuse, the computational cost of parallel CMES and CMES-IBO are much smaller than $Q$ times that of sequential CMES and CMES-IBO, respectively. + +# G.2. Computational Complexity of CMES-IBO and CMES + +Independent Case To generate sample paths, the Bayesian linear regression requires $O(CD^3 + KD^2)$ for the given RFF, but $C, K,$ and $D$ are usually not large values. The number of constraints $C$ is often less than 10. In our empirical observations, the performance of CMES-IBO were stable with a small number of MC samplings $K$ such as 10. The dimension of the RFF features $D$ is typically set as less than 1000. The complexity for solving the generated constraint problems depends on the solver. Many gradient-based methods have been known for the white-box constrained optimization such as the sequential quadratic programming and the interior point method. The gradient of a sample path can be obtained by $O(dD)$ , and thus, those gradient-based solvers can be applied efficiently. + +Once we obtain the samples of $f_{*}$ , the acquisition functions CMES-IBO (6) and CMES (10) can be easily calculated for $\forall x$ by using the GP posterior of $f$ and $g_{c}$ . Since we employ a standard GP model, the posterior can be computed with $O(n^{3})$ for a given kernel matrix, where $n$ is the number of the observed points. Note that the $O(n^{3})$ computation is required only once through the acquisition function maximization, because by storing $(\pmb{K} + \sigma_{\mathrm{noise}}^2\pmb{I})^{-1}$ , the predictive mean and variance can be evaluated by $O(n^{2})$ for a given $x$ . In our setting, the function evaluation is assumed to be expensive, by which we usually only have a moderate size of a training set (typically, at most several hundreds of points). + +In the case of the parallel setting, we need $m_{\pmb{x}^{(q)}}^{(f)}$ and $s_{\pmb{x}^{(q)}}^{(f)2}$ , which are the predictive mean and variance of $f(\pmb{x})$ after conditioning $\mathcal{H}_{q-1}$ . This conditional density is written as $p(f(\pmb{x}) \mid \tilde{f}_{(k)}(\pmb{x}^{(1)}), \dots, \tilde{f}_{(k)}(\pmb{x}^{(q-1)}))$ , which can be easily determined through the standard conditional Gaussian formula. Given the $q \times q$ predictive covariance matrix of the current GP for $\pmb{x}^{(q)}$ and $\mathcal{X}_{q-1}$ , we can obtain $m_{\pmb{x}^{(q)}}^{(f)}(\pmb{x})$ and $s_{\pmb{x}^{(q)}}^{(f)2}(\pmb{x})$ with $O(q^3)$ . For $m_{\pmb{x}^{(q)}}^{(g_c)}$ and $s_{\pmb{x}^{(q)}}^{(g_c)2}$ , which are for constraint functions, the same calculation can be applied. + +Correlated Case For multi-output GP model, the posterior can be computed with $O(C^3 n^3)$ . For CMES-IBO and CMES, the computations of CDF of the multivariate normal distribution are needed in the correlated case, as shown in Appendix F.2. CMES-IBO performs $K$ times $C + 1$ dimensional CDF for the acquisition function (6), in which $Z_{\mathbf{x}}(\tilde{f}_{*}) = \operatorname{Pr}(\mathbf{h} \in \mathcal{A}_{\tilde{f}_{*}})$ is now CDF of a correlated multivariate normal distribution. On the other hand, in addition to these CDF computations, CMES performs $K$ times computations of the expectation and covariance matrix of TMN in the acquisition function (21), each of which needs computing $C$ dimensional CDF $C + 1$ times and $C - 1$ dimensional CDF $C(C + 1)/2$ times, respectively (G & Wilhelm, 2012). Using a well-known MC-based algorithm (Genz, 1992), the computational complexity of CDF with respect to the dimension $C$ is known to be $O(C^2)$ . Therefore, the computational complexity of CMES-IBO with respect to $K$ and $C$ is $O(KC^2)$ , but that of CMES is $O(KC^4)$ , which severely limits the applicability of CMES to the large number of constraints. + +# H. Considerations on Regret Bound of MES + +In this section, we describe flaws in the theoretical analysis of MES (Wang & Jegelka, 2017). We use the same notation as (Wang & Jegelka, 2017) throughout this section. Wang & Jegelka (2017) showed the bound of simple regret $r_T \coloneqq \max_{\boldsymbol{x} \in \mathcal{X}} f(\boldsymbol{x}) - \max_{t \in [1,T]} f(\boldsymbol{x}_t)$ as follows: + +Theorem H.1 (Theorem 3.2 in (Wang & Jegelka, 2017)). Let $F$ be the cumulative probability distribution for the maximum of any function $f$ sampled from $GP(\mu, k)$ over the compact search space $\mathcal{X} \subset \mathbb{R}^d$ , where $k(\pmb{x}, \pmb{x}') \leq 1$ , $\forall \pmb{x}, \pmb{x}' \in \mathcal{X}$ . Let $f_* = \max_{\pmb{x} \in \mathcal{X}} f(\pmb{x})$ and $w = F(f_*) \in (0, 1)$ , and assume the observation noise is iid $\mathcal{N}(0, \sigma^2)$ . If in each iteration $t$ , the query point is chosen as $\pmb{x}_t = \arg \max_{\pmb{x} \in \mathcal{X}} \gamma_{y_*^t}(\pmb{x}) \frac{\psi(\gamma_{y_*^t}(\pmb{x}))}{2\Psi(\gamma_{y_*^t}(\pmb{x}))} - \log(\Psi(\gamma_{y_*^t}(\pmb{x})))$ , where $\gamma_{y_*^t}(\pmb{x}) = \frac{y_*^t - \mu_t(\pmb{x})}{\sigma_t(\pmb{x})}$ and $y_*^t$ is + +drawn from $F$ , then with probability at least $1 - \delta$ , in $T' = \sum_{i=1}^{T} \log_w \frac{\delta}{2\pi_i}$ number of iterations, the simple regret satisfies + +$$ +r _ {T ^ {\prime}} \leq \sqrt {\frac {C \rho_ {T}}{T}} \left(\nu_ {t ^ {*}} + \zeta_ {T}\right), \tag {26} +$$ + +where $C = 2 / \log (1 + \sigma^{-2})$ and $\zeta_T = (2\log (\frac{\pi_T}{\delta}))^{\frac{1}{2}}$ , $\pi_i$ satisfies $\sum_{i=1}^{T}\pi_i^{-1} \leq 1$ and $\pi_t > 0$ , and $t^* = \arg \max_t \nu_t$ with $\nu_t \triangleq \min_{\boldsymbol{x} \in \mathcal{X}, y_*^t > f_*} \gamma_{y_*^t}(\boldsymbol{x})$ , and $\rho_T$ is the maximum information gain of at most $T$ selected points. + +In this theorem, the simple regret for 'one sample MES' is analyzed, in which only one max-value is sampled at every iteration in the algorithm. We summarize five main flaws in this theorem as follows (note that each of them is related to each other): + +1. From the assumption $f \sim \mathcal{GP}(\mu, k)$ , the max-value $f_*$ is a random variable, but it is not treated as a random variable in their analysis. For example, Lemma C.1 in (Wang & Jegelka, 2017) obviously assumes that $f(\boldsymbol{x}_t)$ follows the Gaussian distribution, and therefore, treating $f_*$ as a deterministic variable contradicts the assumption of this lemma. This problem closely related to other flaws, and thus, it is difficult to correct. +2. In BO literature, usually, the number of iterations is represented by $T$ , and Wang & Jegelka (2017) use this notation except for the theorem. On the other hand, in the theorem, the number of iteration is represented by $T'$ instead of $T$ , and the variable $T$ in the bound (26) is defined by the number of 'partitioning' of the entire iterations in their proof. Each partition is defined so that it satisfies a probabilistic condition related to max-values, which we omit details here. An important issue is that, for this replaced $T$ , dependency on the actual number of iterations is not clarified. Therefore, (26) does not reveal the convergence rate with respect to the number of iterations. +3. Since $\nu_{t^*}$ depends on $y_*^t$ in each iteration, $\nu_{t^*}$ is a random variable. This variable remains in the final upper bound, but the convergence rate of $\nu_{t^*}$ has not been shown. +4. In the theorem, Wang & Jegelka (2017) assumed that $y_{*}^{t}$ is drawn from the prior $F$ . This assumption clearly does not match the basic idea of MES that selects the next query based on the mutual information estimated through samples of the max-value from the 'posterior' distribution. +5. Wang & Jegelka (2017) claimed that the above simple regret bound can adapt to the setting that $y_{*}^{t}$ is drawn from the posterior. However, this claim is not proven and not obvious. In the proof, Wang & Jegelka (2017) implicitly assumed $\operatorname{Pr}(y_{*}^{t} < f_{*}, y_{*}^{t + 1} < f_{*}) = \operatorname{Pr}(y_{*}^{t} < f_{*}) \operatorname{Pr}(y_{*}^{t + 1} < f_{*})$ . Through the basic formula of the joint probability of independent variables, this decomposition is allowed if $f_{*}$ is deterministic, and $y_{*}^{t}$ and $y_{*}^{t + 1}$ are independent of each other. However, both of these two conditions are not satisfied in the case of sampling from the posterior. For the first condition, as we already mention, $f_{*}$ should be a random variable (actually, this first condition is not satisfied even for the case of sampling from the prior). For the second condition, when $y_{*}^{t}$ and $y_{*}^{t + 1}$ are sampled from posterior, $y_{*}^{t}$ depends on $\mathcal{D}_{t - 1}$ and $y_{*}^{t + 1}$ depends on $\mathcal{D}_t$ . However, since $\mathcal{D}_{t - 1}\subset \mathcal{D}_t$ , dependency obviously exists between $y_{*}^{t}$ and $y_{*}^{t + 1}$ (note that now $\mathcal{D}_{t - 1}$ and $\mathcal{D}_t$ are also random variables not only because of the random noise of observations, but also the randomness in the acquisition function). In the proof, the decomposition is not justified when the two conditions are not satisfied. This decomposition plays a key role in the proof, and we consider that the above issue is not easy to avoid. + +We first tried to extend this theorem to our constrained problem, but we consider that correcting the above issues is at least not trivial. Therefore, theoretical analysis of the MES-based methods (even for the simple unconstrained case) is still an open problem, to the best of our knowledge. + +# I. Details of Experimental Settings + +In this section, we describe additional details of experimental settings. + +# I.1. Other Experimental Settings + +Observations for objective and constraint functions are standardized so that they have zero mean and unit variance, respectively, before the regression at every iteration. We used the open-source library called GPy (GPy, since 2012) for + +the GP regression. The candidate intervals of hyperparameters $\sigma_{\mathrm{LIN}}^2$ and $\sigma_{\mathrm{RBF}}^2$ are set to [0, 1], and the variance of the noise $\sigma^2$ is set to $10^{-6}$ . As we mentioned in the main paper, other hyperparameters are chosen by marginal likelihood maximization. We employed an Automatic Relevance Determination (ARD) for the RBF kernel. Thus, the RBF kernel has a hyperparameter $\ell \coloneqq (\ell_1,\ldots ,\ell_d)^\top \in \mathbb{R}^d$ , and it is written as + +$$ +k _ {\mathrm {R B F}} (\pmb {x}, \pmb {x} ^ {\prime}) := \exp \biggl (- \frac {1}{2} \sum_ {i = 1} ^ {d} \frac {(x _ {i} - x _ {i} ^ {\prime}) ^ {2}}{\ell_ {i} ^ {2}} \biggr), +$$ + +where $x_{i}$ and $x_{i}^{\prime}$ are the $i$ -th elements of $\pmb{x}$ and $\pmb{x}^{\prime}$ , respectively. For each one of $\ell_{i}$ for $i = 1, \dots, d$ , we set the same interval of the candidate value. For the benchmark functions and the reactor network design problem, we set $\ell_{i} \in [10^{-1}s_{i}, 10s_{i}]$ , where $s_{i}$ is the length of the interval for the possible value of $x_{i}$ in the input domain, and the thresholds $z_{c} = 0$ for $c = 1, \dots, C$ . For the CNN hyperparameter optimization problem, we set $\ell_{i} \in [10^{-1}, 2]$ and the thresholds $z_{c} = 0.5$ for $c = 1, \dots, C$ . We used the method of moving asymptotes (Svanberg, 2002) in NLopt (Johnson, since 2008) for the constrained optimization of the sample path in CMES-IBO, CMES, TSC, and their parallel extensions. The numbers of initial points are set as 3 for the GP-derived synthetic function, 5 for the two-dimensional benchmark functions, 5d for the Hartmann6 function, and 25 for others. Finally, the hyperparameter $M$ of P-EIC is selected as the minimum of the current observations. + +# I.2. Settings for PESC + +Due to the difficulty of rewriting the Spearmint specification, the default settings such as for kernels and inner optimization were used. Although PESC has the same number of initial points, their locations are not identical to other methods because of the same reason. + +# I.3. Details of Benchmark Functions + +Here, we provide detailed information on benchmark functions. Note that we change the sign from the original functions if it is required to formalize as the maximization problem. + +Gardner1 Gardner1 is a simple test problem in which functions are constructed by sine and cosine functions (Gardner et al., 2014). The input dimension $d = 2$ , the input domain $\mathcal{X} = [0,6]^2$ , and the number of constraints $C = 1$ . The detailed forms of functions are + +$$ +f (\boldsymbol {x}) = - \cos (2 x _ {1}) \cos (x _ {2}) - \sin (x _ {1}), +$$ + +$$ +g _ {1} (\boldsymbol {x}) = - \cos (x _ {1}) \cos (x _ {2}) + \sin (x _ {1}) \sin (x _ {2}) + 0. 5. +$$ + +Gardner2 Gardner2 also has a simple form, but its feasible region is very small (Gardner et al., 2014). The input dimension $d = 2$ , the input domain $\mathcal{X} = [0,6]^2$ , and the number of constraints $C = 1$ . The detailed forms of functions are + +$$ +f (\boldsymbol {x}) = - \sin (x _ {1}) - x _ {2}, +$$ + +$$ +g _ {1} (\boldsymbol {x}) = - \sin (x _ {1}) \sin (x _ {2}) - 0. 9 5. +$$ + +Gramacy The Gramacy function is from (Gramacy et al., 2016). The input dimension $d = 2$ , the input domain $\mathcal{X} = [0,1]^2$ , and the number of constraints $C = 2$ . The detailed forms of functions are + +$$ +f (\boldsymbol {x}) = - x _ {1} - x _ {2}, +$$ + +$$ +g _ {1} (\boldsymbol {x}) = \frac {1}{2} \sin (2 \pi \left(x _ {1} ^ {2} - 2 x _ {2}\right)) + x _ {1} + 2 x _ {2} - 1. 5, +$$ + +$$ +g _ {2} (\boldsymbol {x}) = - x _ {1} ^ {2} - x _ {2} ^ {2} + 1. 5. +$$ + +Hartmann6 The Hartmann6 function is used in (Letham et al., 2019). The input dimension $d = 6$ , the input domain + +$\mathcal{X} = [0,1]^6$ , and the number of constraints $C = 1$ . The detailed forms of functions are + +$$ +f (\boldsymbol {x}) = \sum_ {i = 1} ^ {4} \alpha_ {i} \exp \left(- \sum_ {j = 1} ^ {6} A _ {i j} (x _ {j} - P _ {i j}) ^ {2}\right), +$$ + +$$ +g _ {1} (\boldsymbol {x}) = - \left\| \boldsymbol {x} - \boldsymbol {x} ^ {\prime} \right\| + 1, +$$ + +where + +$$ +\boldsymbol {\alpha} = (1. 0, 1. 2, 3. 0, 3. 2) ^ {\top}, +$$ + +$$ +\boldsymbol {A} = \left( \begin{array}{c c c c c c} 1 0 & 3 & 1 7 & 3. 5 & 1. 7 & 8 \\ 0. 0 5 & 1 0 & 1 7 & 0. 1 & 8 & 1 4 \\ 3 & 3. 5 & 1. 7 & 1 0 & 1 7 & 8 \\ 1 7 & 8 & 0. 0 5 & 1 0 & 0. 1 & 1 4 \end{array} \right), +$$ + +$$ +\boldsymbol {P} = 1 0 ^ {- 4} \left( \begin{array}{c c c c c c} 1 3 1 2 & 1 6 9 6 & 5 5 6 9 & 1 2 4 & 8 2 8 3 & 5 8 8 6 \\ 2 3 2 9 & 4 1 3 5 & 8 3 0 7 & 3 7 3 6 & 1 0 0 4 & 9 9 9 1 \\ 2 3 4 8 & 1 4 5 1 & 3 5 2 2 & 2 8 8 3 & 3 0 4 7 & 6 6 5 0 \\ 4 0 4 7 & 8 8 2 8 & 8 7 3 2 & 5 7 4 3 & 1 0 9 1 & 3 8 1 \end{array} \right). +$$ + +# I.4. Details of CNN hyperparameter optimization problem + +We used PyTorch (Paszke et al., 2019) to construct the CNN model. The search domain for this problem is set as follows: the learning rate in $\{10^{-3}, 10^{-2}, 10^{-1}, 10^{0}\}$ , the dropout rate in $\{2^{-4}, 2^{-3}, 2^{-2}, 2^{-1}\}$ , the number of channels in $\{2^{3}, 2^{4}, 2^{5}, 2^{6}\}$ for two layers, and the coefficient $\rho$ in $\{0, 0.1, \dots, 1.9\}$ . Thus, the size of input domain $|\mathcal{X}| = 5120$ . To define $\pmb{x}$ , we apply $\log_{10}$ and $\log_2$ transformation to the learning rate and the other inputs except for $\rho$ , respectively. Moreover, we apply the logit transformation to accuracy and recall for transforming the output domain from $[0, 1]$ to $\mathbb{R}$ . Under the setting $z_{c} = 0.5$ for $c = 1, \dots, 10$ , the number of feasible points is 28, which is only about $0.5\%$ ( $\approx 28/5120$ ) of the entire candidates $\mathcal{X}$ . The unconstrained optimal point of the accuracy $\arg \max_{\pmb{x} \in \mathcal{X}} f(\pmb{x})$ is different from the constrained optimal point $\pmb{x}_{*}$ , meaning that the unconstrained optimization of the average accuracy sacrifices recalls of some classes. For the training of CNN, we used the default weighted cross-entropy loss function in PyTorch, which is defined as follows: + +$$ +\operatorname {L O S S} (\boldsymbol {l}, \hat {\boldsymbol {l}}) = \sum_ {i = 1} ^ {N} - \frac {w _ {l _ {i}}}{\sum_ {m = 1} ^ {M} w _ {m}} \log \hat {l} _ {i, l _ {i}}, +$$ + +where $\pmb{l} = (l_{1},\dots ,l_{N})\in \mathbb{R}^{N}$ , $l_{i}$ is a correct label of $i$ -th data, $\hat{l}_{i,m}$ is a predicted probability that $i$ -th data has label $m$ , and a $(i,m)$ element of $\hat{l}\in \mathbb{R}^{N\times M}$ is $\hat{l}_{i,m}$ . + +# J. Additional Experiments + +# J.1. Results with the Different Number of MC samples + +By using benchmark functions from CBO literature, we here show the results with three different numbers of MC samples $K = 1, 10$ , and 50 of CMES and CMES-IBO. Figure 6 shows that even with small $K = 1$ , these two methods maintain reasonable performance compared with other methods. In particular, for CMES-IBO, this result can be explained by the fact that $\alpha^{\mathrm{IBO}}(\boldsymbol{x})$ can be seen as the PI from $\tilde{f}_*$ even with $K = 1$ (Remark 4.1). + +# J.2. Experimental Results of the Utility Gap Defined by Best Observed Value + +Figure 7 shows the utility gap defined by the best observed value, which is $\min \{f_{*} - f(\pmb{x}_i) \mid (\pmb{x}_i, y_i) \in \mathcal{D}_{t-1}, g_c(\pmb{x}_i) \geq z_c, \forall c\}$ when feasible. The solution is already obtained, otherwise $f_{*} - \min_{\pmb{x} \in \mathcal{X}} f(\pmb{x})$ . We see that all the plots show the similar behavior as Fig. 3. This indicates that the recommendation $\hat{\pmb{x}}_t$ is mostly selected around the training data since $\hat{\pmb{x}}_t$ is chosen under constraints $\operatorname{Pr}(g_c(\pmb{x}) \geq z_c) \geq \sqrt[5]{0.95}$ for $\forall c$ . Note that PESC is not shown in Fig. 7 since Spearmint does not provide the best observed values. + +![](images/ba4e5a8af7fe3abcfc1953c7e4e89aeeed641e235748a7838b3249d98c62d347.jpg) +Figure 6: Utility gap of benchmark functions with different $K$ (average and standard error). + +![](images/c82578b80132f11426a48cb6befaec845dbcb7c95858df359517e4d774e4c1b4.jpg) + +![](images/fbc4238a326871bfc15577b19fab7be3653c31d9be80e7db355681aa1d9d79aa.jpg) + +![](images/6cdef4bff6b4d7265dbf6777b5614afea03391fd058596ac1cabe246daa3f9a3.jpg) + +![](images/e0a8457dbc8fd07c704adad7264a118ff811f7f4aba37e0246fe482c5c0a7b2c.jpg) +Figure 7: Utility gap defined by the best observed value in sequential querying (average and standard error). + +# J.3. Experiment for Correlated Synthetic Function + +We evaluate the performance of CMES-IBO with correlated GPs on synthetic functions ( $d = 3$ and $C = 3$ ). Because of its high computational complexity, we did not employ CMES here (see Appendix G.2). The objective and $C = 3$ constraints were sampled from GPs with the RBF kernel, and the length scales of the kernels were 0.1. All the correlation coefficients among the objective and constraint functions were set as 0.5. The same settings of GPs for the function generation were also used in each BO method. The number of initial points is set as 5. The threshold for constraints were set as $z_{c} = 0$ for $\forall c$ , and the input domain was $[0,1]^{3}$ . We sampled 5 sets of functions, and the experiment of each set ran 10 times. We report the mean and standard error of these 50 trials. Figure 8 shows the result. C-CMES-IBO denotes the correlated extension of CMES-IBO. We see that C-CMES-IBO improves CMES-IBO in this case and is superior to the other methods. Although the correlated model can improve performance when the true function has a strong correlation, we mainly focus on the independent setting because the efficiency is often comparable to the correlated model, and the computations of independent CMES-IBO is much simpler than correlated case. + +# J.4. Experiment for Computational Time Evaluation + +In Table 1, we evaluate computational time of the acquisition function maximization at $t = 30$ . EIC and TSC were relatively faster than the others. CMES-IBO and CMES took longer times because of sampling of $f_{*}$ for which we need to solve constraint optimization problems $K$ times, while the acquisition function maximization itself was fast enough because of their simple closed forms of the acquisition functions. Although it is not shown here, PESC has the same computational requirement for sampling $x_{*}$ because the same constraint optimization problems need to be solved. It is worth noting that the $K$ times sampling of $f_{*}$ can be accelerated by computing in parallel because each one of the samplings is independent. + +Table 1: Computational time (sec.) for the Gramacy function at $t = {30}$ (mean $\pm$ standard error) + +
sampling of f*optimization of α(x)
EICNA1.148 ± 0.287
TSCNA2.670 ± 0.464
CMES20.728 ± 1.4980.780 ± 1.317
CMES-IBO21.836 ± 0.9331.163 ± 2.130
+ +![](images/e99b8edadcce2b5456f54a7207bab6c5e7da6a5f731861fe66fe2bbe90f60141.jpg) +Figure 8: Utility gap of correlated GP-derived synthetic functions (average and standard error). \ No newline at end of file diff --git a/sequentialandparallelconstrainedmaxvalueentropysearchviainformationlowerbound/images.zip b/sequentialandparallelconstrainedmaxvalueentropysearchviainformationlowerbound/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..42b958c1b34fb3456268fda6504a2960e1b77729 --- /dev/null +++ b/sequentialandparallelconstrainedmaxvalueentropysearchviainformationlowerbound/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9a5a7b54ec10352a551f8094075ce7a0f37334d8ffed3a701a1e967335cc3793 +size 1474025 diff --git a/sequentialandparallelconstrainedmaxvalueentropysearchviainformationlowerbound/layout.json b/sequentialandparallelconstrainedmaxvalueentropysearchviainformationlowerbound/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..99258c874bba333ff7158d0e04ff3ed8311b0507 --- /dev/null +++ b/sequentialandparallelconstrainedmaxvalueentropysearchviainformationlowerbound/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d76992d031f99c8993d0b5421c752558238ae5b0ad2690b55932008482bbaf34 +size 1405999 diff --git a/sequentialcovariateshiftdetectionusingclassifiertwosampletests/f2732476-5f96-4123-9e34-88ce30d8e6d7_content_list.json b/sequentialcovariateshiftdetectionusingclassifiertwosampletests/f2732476-5f96-4123-9e34-88ce30d8e6d7_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..6f5757f5d64f29657dcd88e7a946f5021f83f97e --- /dev/null +++ b/sequentialcovariateshiftdetectionusingclassifiertwosampletests/f2732476-5f96-4123-9e34-88ce30d8e6d7_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f2342020ca1cb63f7e447df96e65ba6806fa08b2d835c4c6c076f03b7c2fdd5c +size 167818 diff --git a/sequentialcovariateshiftdetectionusingclassifiertwosampletests/f2732476-5f96-4123-9e34-88ce30d8e6d7_model.json b/sequentialcovariateshiftdetectionusingclassifiertwosampletests/f2732476-5f96-4123-9e34-88ce30d8e6d7_model.json new file mode 100644 index 0000000000000000000000000000000000000000..d0a99c5bec83a4ef36d9daae6f311c632323a8e6 --- /dev/null +++ b/sequentialcovariateshiftdetectionusingclassifiertwosampletests/f2732476-5f96-4123-9e34-88ce30d8e6d7_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:33da40ad49460a1666efd5addf472780d4e683f56cb778cc6ad0e8e5cc9bfc72 +size 206357 diff --git a/sequentialcovariateshiftdetectionusingclassifiertwosampletests/f2732476-5f96-4123-9e34-88ce30d8e6d7_origin.pdf b/sequentialcovariateshiftdetectionusingclassifiertwosampletests/f2732476-5f96-4123-9e34-88ce30d8e6d7_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c89e7d81d87eb27d291c30ee4a8ba58ca9f009dd --- /dev/null +++ b/sequentialcovariateshiftdetectionusingclassifiertwosampletests/f2732476-5f96-4123-9e34-88ce30d8e6d7_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f41b674abfd55726b8c9a2c72a5df4c1ab2e901e5d8d67b39d4f4f3b7fbc92c4 +size 6865761 diff --git a/sequentialcovariateshiftdetectionusingclassifiertwosampletests/full.md b/sequentialcovariateshiftdetectionusingclassifiertwosampletests/full.md new file mode 100644 index 0000000000000000000000000000000000000000..9bc69c2e40d2f68569c8341a4ab86f677847232e --- /dev/null +++ b/sequentialcovariateshiftdetectionusingclassifiertwosampletests/full.md @@ -0,0 +1,779 @@ +# Sequential Covariate Shift Detection Using Classifier Two-Sample Tests + +Sooyong Jang1 Sangdon Park12 Insup Lee1 Osbert Bastani1 + +# Abstract + +A standard assumption in supervised learning is that the training data and test data are from the same distribution. However, this assumption often fails to hold in practice, which can cause the learned model to perform poorly. We consider the problem of detecting covariate shift, where the covariate distribution shifts but the conditional distribution of labels given covariates remains the same. This problem can naturally be solved using a two-sample test—i.e., test whether the current test distribution of covariates equals the training distribution of covariates. Our algorithm builds on classifier tests, which train a discriminator to distinguish train and test covariates, and then use the accuracy of this discriminator as a test statistic. A key challenge is that classifier tests assume given a fixed set of test covariates. In practice, test covariates often arrive sequentially over time—e.g., a self-driving car observes a stream of images while driving. Furthermore, covariate shift can occur multiple times—i.e., shift and then shift back later or gradually shift over time. To address these challenges, our algorithm trains the discriminator online. Additionally, it evaluates test accuracy using each new covariate before taking a gradient step; this strategy avoids constructing a held-out test set, which can improve sample efficiency. We prove that this optimization preserves the correctness—i.e., our algorithm achieves a desired bound on the false positive rate. In our experiments, we show that our algorithm efficiently detects covariate shifts on multiple datasets—ImageNet, IWildCam, and Py150. + +# 1. Introduction + +A key challenge facing deep neural networks is their sensitivity to changes in the data distribution. In particular, supervised learning traditionally assumes that the training and test data are from the same distribution (Vapnik, 1998), but this assumption often fails in practice. For example, an autonomous car using perception to identify obstacles needs to be robust to shifts such as changes in the weather and lighting conditions. We focus on covariate shift (Shimodaira, 2000), where there is a shift in the covariate distribution $p(x)$ , and the conditional label distribution $p(y \mid x)$ remains unchanged. Covariate shift can reduce model performance (Sugiyama & Müller, 2005), invalidate uncertainty estimates (Ovadia et al., 2019; Park et al., 2020), and affect model selection (Sugiyama et al., 2007). + +One strategy is to devise an algorithm to detect covariate shift; if detected, the algorithm can alert the user that predictions may be unreliable. Covariate shift detection can be formulated as two-sample hypothesis test (Gretton et al., 2012a; Rabanser et al., 2018; Liu et al., 2020), where the goal is to determine whether two sets of examples are from the same distribution. To test for covariate shift, we choose the first sample to be the data used to train the model and the second sample to be recent test data given as input to the model. Then, the detector returns "covariate shift" if the hypothesis test indicates that the two samples are from different distributions and "no shift" otherwise. + +We propose a detection algorithm based on classifier tests (Lopez-Paz & Oquab, 2017; Cheng & Cloninger, 2019; Kim et al., 2021), which use the accuracy of a classifier trained to distinguish the two samples as the test statistic. In particular, if the two samples are from the same distribution, then the accuracy should be $1/2$ ; otherwise, it should be $>1/2$ . Since the test statistic follows a binomial distribution, we use the Clopper-Pearson interval (Clopper & Pearson, 1934) (an exact confidence interval for the unknown success probability of the Binomial distribution) to derive the cutoff. In contrast, prior work relies on asymptotics to derive the cutoff, which results in approximations. + +A key challenge is that the test examples are typically obtained over time—e.g., an autonomous robot continuously perceives its environment, and we want to detect if its distribution of observations shifts at any time. There are two + +key challenges to leveraging classifier tests in this setting. First, they rely on training a classifier to distinguish training and test examples; doing so on every step would be computationally intractable. Second, they rely on a held-out test set to estimate the test statistic, but constructing such a set online would reduce sample efficiency. + +Rather than train a classifier at each step, our algorithm trains a model online using stochastic gradient descent. Then, rather than construct a held-out test set, our algorithm evaluates the accuracy of the model online using each example before taking a gradient step on that example. We prove that this strategy results in an unbiased estimate of the model accuracy; thus, the finite-sample guarantees on the false positive rate provided by the sequential test continue to hold. In addition, we prove bounds on the false negative rate under mild conditions on the classifier (i.e., it achieves nontrivial accuracy distinguishing the two distributions). + +We evaluate our approach on both synthetic and natural shifts on ImageNet (Russakovsky et al., 2015), and natural shifts on two datasets from the WILDS datasets (Koh et al., 2021). We demonstrate that our approach achieves better sample efficiency than baseline algorithms; furthermore, it satisfies the desired false positive rate. Thus, our algorithm is an effective strategy for sequential covariate shift detection. + +Contributions. We formulate (sequential) covariate shift detection as a two-sample test, and propose a novel algorithm to solve this problem (Section 3). Then, we prove finite sample bounds on false positive rate and false negative rate achieved by our algorithm (Section 4). Finally, we empirically demonstrate that our algorithm effectively detects shifts on ImageNet, IWildCam, and Py150 (Section 5 and Appendix C). + +Sequential detection vs. sequential tests. While we consider the sequential setting, we deliberately choose not use a sequential hypothesis test, since the covariate shift may occur after a delay or gradually over time. A sequential test only applies if all of the test data is shifted. Furthermore, since we are not using sequential tests, the false positive rate bound only holds per-step, not uniformly across all steps. This is necessary: we cannot guarantee that we detect a covariate shift occurring at a later point in time if we constrain the false positive to be bounded uniformly across all steps. In our experiments, we show that the rate of false alarms remains manageable while enabling our algorithm to detect covariate shift in a number of interesting scenarios. + +# 2. Related Work + +Covariate shift. There has been work on training models in the presence of covariate shift. In particular, in the unsupervised domain adaptation setting (Ben-David et al., 2007; + +Bickel et al., 2007; Ganin et al., 2016), the algorithm has access to labeled examples from the source domain but only unlabeled examples from the target domain, and the goal is to train a model that achieves good performance on the target domain. One strategy is to use importance weighting to upweight source examples that are more similar to target examples (Bickel et al., 2007). Another strategy is to first learn an invariant representation (Ganin et al., 2016), which is an embedding space where the source and target examples are similar, and then train a model on this embedding space using the source examples. If we detect covariate shift, one solution is to retrain the model using these techniques. + +Two-sample tests. We focus on classifier two-sample tests (C2ST). In this approach, the idea is to train a binary classifier to distinguish source and target samples, compute a real-valued score based on this classifier as the test statistic, and then use a univariate two-sample test to determine the cutoff for rejecting the null hypothesis (Friedman, 2004). A natural test statistic is the classifier's accuracy on a held-out test set (Kim et al., 2021; Lopez-Paz & Oquab, 2017), or the differences in the classifier's logits (Cheng & Cloninger, 2019); we use the former. One way to compute the cutoff is to use the asymptotic distribution of the test statistic (Lopez-Paz & Oquab, 2017). Nonparametric tests such as permutation tests can also be used (Kim et al., 2021). + +Another kind of two-sample test is a kernel two-sample test. Here, the idea is to use the maximum mean discrepancy (MMD) between the two samples according to a given kernel embedding as the test statistic (Gretton et al., 2012a; Chwialkowski et al., 2015; Jitkrittum et al., 2016). The key design decision is the choice of kernel. One strategy is to use a nonparametric kernel such as Gaussian radial basis functions (Gretton et al., 2012a); alternatively, the kernel can also be optimized to minimize the false negative rate of the resulting test (Gretton et al., 2012b). Recent work has shown how to first learn a kernel function in the form of a deep neural network, and then evaluate the MMD distance on a held-out test set (Liu et al., 2020). The test statistic can be chosen based on finite sample bounds or based on its asymptotic distribution (Gretton et al., 2012a) or nonparametric permutation tests (Liu et al., 2020). Lastly, the previous classifier two-sample tests can be represented as a special case of MMD (Liu et al., 2020). + +Other shifts. In the context of concept drift (Gama et al., 2014), there has been work detecting shifts in $p(x, y)$ (Gonçalves Jr et al., 2014; Vovk, 2020). Harmful shifts can be detected as well (Podkopaev & Ramdas, 2021). However, these works assume that ground truth labels are provided for test examples, whereas our approach only requires unlabeled test examples. The former is substantially easier, since it suffices to check for drift in the distribution of prediction errors, which is usually very simple (e.g., a Bernoulli distri + +bution for the 0-1 loss), making it easy to test for drift. In contrast, our approach checks for drift in high-dimensional covariates distribution. + +Sequential hypothesis testing. A closely related problem is sequential hypothesis testing, which adaptively decides whether to reject the null hypothesis as samples become available (Wald, 1945). These approaches can also applied to two-sample testing (Balsubramani & Ramdas, 2015; Lheritier & Cazals, 2018; 2019; Manole & Ramdas, 2021). However, as discussed above, they assume that each distribution of the two samples does not change over time. In contrast, we are interested in the setting where the test examples might initially be from the same distribution as the training examples, but then shift at a later point in time. Sequential tests are not applicable to this setting. + +Change point detection. A related problem is change point detection (Page, 1954; Adams & MacKay, 2007; Boracchi et al., 2018; Volkhonskiy et al., 2017; Vovk et al., 2021), which detects the point at which a distribution changes. However, change point detection focuses on detecting a single shift, whereas our approach can detect gradual shifts. + +# 3. Sequential Covariate Shift Detection + +# 3.1. Problem Formulation + +Let $\mathcal{X}$ be the covariate space, $S$ be the source distribution over $\mathcal{X}$ , and $\mathcal{T}_{t_s:t_e} = (\mathcal{T}_{t_s},\mathcal{T}_{t_s + 1},\ldots ,\mathcal{T}_{t_e})$ be a sequence of target distributions over $\mathcal{X}$ from time steps $t_s$ to $t_e$ . On time step $t$ , we consider samples $x_{t}\sim S$ and $x_{t}^{\prime}\sim \mathcal{T}_{t}$ ; in practice, $S$ can be taken to be the uniform distribution over the training set. We let $S_{w,t} = (x_{t - w + 1},x_{t - w + 2},\dots,x_t)$ and $T_{w,t} = (x_{t - w + 1}^{\prime},x_{t - w + 2}^{\prime},\dots,x_{t}^{\prime})$ denote the recent examples in a time window of a given size $w\in \mathbb{N}$ . Note that $w$ can be different in source and target, but we use the same $w$ for simplicity. + +Our goal is to detect covariate shift at any step $t$ . More precisely, we want to determine whether $\mathcal{S} \neq \bar{\mathcal{T}}_{w,t}$ , where + +$$ +\bar {\mathcal {T}} _ {w, t} = \sum_ {k = t - w + 1} ^ {t} \frac {\mathcal {T} _ {k}}{w}, \tag {1} +$$ + +i.e., whether the average target distributions over the previous $w$ steps is shifted compared to $\mathcal{S}$ . For a fixed step $t$ , this problem is a two-sample test (Lehmann & Romano, 2006), where the null hypothesis is $H_0: S = \bar{T}_{w,t}$ , and the alternative is $H_1: S \neq \bar{T}_{w,t}$ . That is, a two-sample test $\hat{f}$ is designed to compute + +$$ +\hat {f} (S _ {w, t}, T _ {w, t}) \approx \left\{ \begin{array}{l l} 1 & \text {i f} \mathcal {S} \neq \bar {\mathcal {T}} _ {w, t} \\ 0 & \text {o t h e r w i s e .} \end{array} \right. +$$ + +Our goal is to design a two-sample test $\hat{f}$ for detecting covariate shift with this data stream. While we can in principle + +use any two-sample test, our goal is to design one that is both sample and computationally efficient while achieving high accuracy for high-dimensional data such as images. In addition, we want the test $\hat{f}$ to come with finite sample guarantees on the false positive rate. In particular, given $\alpha \in \mathbb{R}_{>0}$ , if $S = \bar{\mathcal{T}}_{w,t}$ , we want to ensure + +$$ +\mathbb {P} _ {S _ {w, t} \sim \mathcal {S} ^ {w}, T _ {w, t} \sim \mathcal {T} _ {t - w + 1: t}} \left[ \hat {f} (S _ {w, t}, T _ {w, t}; \alpha) = 0 \right] \geq 1 - \alpha . +$$ + +Ideally, we also want to provide finite sample bounds on the false negative rate; however, for classifier tests, we can only do so under additional assumptions about the model family used to try and distinguish $S$ and $\bar{T}_{w,t}$ . Intuitively, we assume that (i) the model family has bounded complexity (e.g., Rademacher complexity), and (ii) some model exists in the family that achieves nontrivial accuracy at distinguishing $S$ and $\bar{T}_{w,t}$ . Our goal is to ensure that if $S \neq \bar{T}_{w,t}$ , then + +$$ +\mathbb{P}_{\substack{S_{w,t}\sim \mathcal{S}^{w},\\ T_{w,t}\sim \mathcal{T}_{t - w + 1:t}}}\left[\hat{f} (S_{w,t},T_{w,t};\alpha) = 1\right]\geq 1 - M(\alpha ,w) +$$ + +for $S^w = S \times \dots \times S$ consists of $w$ copies of $S$ , and a function $M(\alpha, w)$ that depends on the model family. + +# 3.2. Algorithm Overview + +Next, we describe our two-sample test. We build on classifier two-sample test (C2ST) (Lopez-Paz & Oquab, 2017; Kim et al., 2021). The idea is to train a classifier $\hat{g}_t$ to try and distinguish $S_{w,t}$ from $T_{w,t}$ . Intuitively, if $S$ and $\bar{\mathcal{T}}_{w,t}$ are different distributions, then $\hat{g}_t$ should achieve nontrivial accuracy at distinguishing $S_{w,t}$ from $T_{w,t}$ (assuming the model family is sufficiently expressive). Alternatively, if $S = \bar{\mathcal{T}}_{w,t}$ , then $\hat{g}_t$ necessarily achieves a trivial expected accuracy of $1/2$ . + +In particular, the accuracy of $\hat{g}_t$ can be used as a test statistic for the two-sample test. To choose the cutoff for rejecting the null hypothesis, we use the Clopper-Pearson (CP) interval (Clopper & Pearson, 1934) to construct an interval that contains the true accuracy $\hat{g}_t$ with high probability based on the accuracy of $\hat{g}_t$ on a test set. More precisely, the CP interval is an exact confidence interval around the empirical estimate of the mean of a Bernoulli random variable. Letting $z_1,\ldots ,z_n\sim \mathrm{Bernoulli}(\mu^*)$ be i.i.d. samples from a Bernoulli distribution with true mean $\mu^{*}$ , the (unnormized) estimate of its mean $n\cdot \hat{\mu} (z_{1:n}) = \sum_{i = 1}^{n}z_{i}$ has distribution Binomial $(n,\mu^{*})$ . Then, the CP interval $\Theta_{\mathrm{CP}}(\hat{s},n;\alpha)\subseteq [0,1]$ is an interval around $\hat{\mu}$ containing $\mu^{*}$ with probability at least $1 - \alpha$ , i.e., + +$$ +\mathbb {P} _ {\hat {s} \sim \operatorname {B i n o m i a l} (n, \mu^ {*})} [ \mu^ {*} \in \Theta_ {\mathrm {C P}} (\hat {s}, n; \alpha) ] \geq 1 - \alpha , \tag {2} +$$ + +where the probability is taken over $\hat{s}$ , $\alpha$ is a given confidence level, and $\Theta_{\mathrm{CP}}$ is a function of the Binomial random variable + +$\hat{s} = n \cdot \hat{\mu}(z_{1:n})$ . The CP interval is concretely defined by + +$$ +\begin{array}{l} \Theta_ {\mathrm {C P}} (\hat {s}, n; \alpha) := \left[ \inf \left\{\theta \mid F (n - \hat {s}; n, 1 - \theta) \geq \frac {\alpha}{2} \right\}, \right. \\ \left. \sup \left\{\theta \left| F (\hat {s}; n, \theta) \geq \frac {\alpha}{2} \right. \right\} \right], \\ \end{array} +$$ + +where $F(s; n, \theta)$ is the cumulative distribution function (CDF) of Binomial $(n, \theta)$ . To compute the CP interval, we can use the following equivalent formula: + +$$ +\begin{array}{l} \Theta_ {\mathrm {C P}} (\hat {s}, n; \alpha) = \left[ Q \left(\frac {\alpha}{2}; \hat {s}, n - \hat {s} + 1\right), \right. \\ \left. Q \left(1 - \frac {\alpha}{2}; \hat {s} + 1, n - \hat {s}\right) \right], \\ \end{array} +$$ + +where $Q(p, a, b)$ is the $p$ th quantile of a Beta distribution with parameters $a, b$ (Hartley & Fitch, 1951; Brown et al., 2001). Our algorithm uses the CP interval to determine whether the accuracy of $\hat{g}_t$ is nontrivial, i.e., $> 1/2$ . In particular, the accuracy of $\hat{g}_t$ is the mean of the Bernoulli random variable $\mathbb{1}(\hat{g}_t(x) = y)$ , where $y$ is the ground truth indicating whether $x$ is from $S$ or $\bar{\mathcal{T}}_{w,t}$ . Then, our algorithm rejects if the CP interval does not contain $1/2$ , since this condition implies that the accuracy of $\hat{g}_t$ does not equal $1/2$ with high probability. We describe this step in detail below. + +The key challenge is what data to use as the test dataset to estimate the accuracy of $\hat{g}_t$ . The traditional strategy is to split the available data into two parts: one to train $\hat{g}_t$ and a second held-out test set to estimate its accuracy (Lopez-Paz & Oquab, 2017; Kim et al., 2021). However, this approach reduces sample efficiency, which is problematic in our setting since we often want to $w$ to be small. + +To address this challenge, our algorithm exploits the conditional independence structure of classifier predictions. In particular, as described below, our algorithm uses each example $x_{t}$ to evaluate the accuracy of $\hat{g}_{t}$ before using it to train $\hat{g}_{t}$ . In the next section, we prove that this strategy maintains the independence of our estimate of the accuracy of $\hat{g}_{t}$ (Lemma 4.1), and that as a consequence, our algorithm satisfies the desired false positive rate (for a single step $t$ ). + +# 3.3. Algorithm Details + +Sequential detection algorithm. At each time step $t$ , we observe a source sample $x_{t} \sim S$ and a target sample $x_{t}^{\prime} \sim \mathcal{T}_{t}$ . In practice, we observe only new target samples, so we randomly draw source samples from the fixed set of source samples at each time step. By using these current samples and previous samples, we detect covariate shifts by updating the source-target classifier in online learning. In particular, our algorithm consists of three steps: (1) source-target prediction, (2) covariate shift detection, and (3) online source + +# Algorithm 1 Sequential Calibrated Classifier Two-Sample Test + +1: Input: significance level $\alpha$ , window size $w$ +2: for each time step $t$ do +3: Draw examples $x_{t} \sim S, x_{t}^{\prime} \sim T_{t}$ +4: Predict $\hat{y}_t = \hat{g}_t(x_t)$ and $\hat{y}_t' = \hat{g}_t(x_t')$ {Source-target prediction} +5: Detect covariate shift if $0.5 \notin \Theta_{\mathrm{CP}}(2w\hat{\mu}_{w,t}, 2w; \alpha) \{\triangleright$ Calibrated covariate shift detection\} +6: Update $\hat{g}_t$ using $(x_t,0)$ and $(x_t',1)$ {Online source-target classifier update} + +# 7: end for + +target classifier update. The following and Algorithm 1 include details. + +Step 1. Source-target prediction. We predict source-target labels on the current samples $x_{t}$ and $x_{t}^{\prime}$ using the current source-target classifier $\hat{g}_{t}$ . In particular, we denote prediction on the source sample $x_{t}$ by $\hat{y}_{t}$ , i.e., $\hat{y}_{t} = \hat{g}_{t}(x_{t})$ , and denote prediction on the target sample $x_{t}^{\prime}$ by $\hat{y}_{t}^{\prime}$ , i.e., $\hat{y}_{t}^{\prime} = \hat{g}_{t}(x_{t}^{\prime})$ . These predictions and previous predictions are used in covariate shift detection in the following step. + +Step 2. Calibrated covariate shift detection. Let $\mathcal{Q}_{w,t}$ be a distribution over $\mathcal{X} \times \{0,1\}$ , where + +$$ +\mathcal {Q} _ {w, t} (x, y) := \frac {1}{2} \cdot \mathcal {S} (x) \cdot \mathbb {1} (y = 0) + \frac {1}{2} \cdot \bar {\mathcal {T}} _ {w, t} (x) \cdot \mathbb {1} (y = 1). +$$ + +Then, $z = \mathbb{1}(\hat{g}_t(x) = y)$ is a Bernoulli random variable with distribution Bernoulli $(\mu_{w,t}^{*})$ , where + +$$ +\mu_ {w, t} ^ {*} = \mathbb {P} _ {(x, y) \sim \mathcal {Q} _ {w, t}} [ \hat {g} _ {t} (x) = y ] \tag {3} +$$ + +is the accuracy of $\hat{g}$ at distinguishing whether an example $x$ is from distribution $\mathcal{S}$ or $\bar{\mathcal{T}}_{w,t}$ . The unbiased empirical estimate of this accuracy is denoted by + +$$ +\hat {\mu} _ {w, t} = \frac {1}{2 w} \sum_ {i = t - w + 1} ^ {t} \left(\mathbb {1} \left(\hat {y} _ {i} = y _ {i}\right) + \mathbb {1} \left(\hat {y} _ {i} ^ {\prime} = y _ {i} ^ {\prime}\right)\right). +$$ + +In fact, $2w\hat{\mu}_{w,t}$ is a Binomial random variable with Binomial $(2w,\mu_{w,t}^{*})$ ; thus, the accuracy $\mu_{w,t}^{*}$ can be estimated by the Clopper-Pearson (CP) interval $\Theta_{\mathrm{CP}}(2w\hat{\mu}_{w,t},2w;\alpha)$ that includes the unknown parameter $\mu_{w,t}^{*}$ with high probability, i.e., + +$$ +\mathbb {P} \left[ \mu^ {*} \in \Theta_ {\mathrm {C P}} (2 w \hat {\mu} _ {w, t}, 2 w; \alpha) \right] \geq 1 - \alpha . +$$ + +This property can be used for checking the accuracy of $\hat{g}_t$ might be $1 / 2$ . In particular, our algorithm returns "covariate shift" if $1 / 2 \notin \Theta_{\mathrm{CP}}(2w\hat{\mu}_{w,t}, 2w; \alpha)$ , and "no covariate shift" otherwise, i.e. + +$$ +\hat {f} \left(S _ {w, t}, T _ {w, t}; \alpha\right) = \mathbb {1} \left(\frac {1}{2} \notin \Theta_ {\mathrm {C P}} \left(2 w \cdot \hat {\mu} _ {w, t}, 2 w; \alpha\right)\right). +$$ + +Here, the Clopper-Pearson interval calibrates the empirical accuracy $\hat{\mu}_{w,t}$ using the property of the Binomial distribution. + +Step 3. Online source-target classifier update. Finally, we update a binary classifier $\hat{g}_t$ using new training examples based on the source and target samples, i.e., $(x_t,0)$ and $(x_t',1)$ . In general, $\hat{g}_t$ can be any model; we consider it to be a neural network, in which case we can update its parameters using stochastic gradient descent with respect to the cross entropy loss. + +# 4. Theoretical Guarantees + +In this section, we describe our finite sample bounds on the false positive and false negative rates of our covariate shift detector $\hat{f}$ ; the key to have valid bounds is proving the independence on predictions $\hat{y}_1, \dots, \hat{y}_t$ (and $\hat{y}_1', \dots, \hat{y}_t'$ ) to have a valid Clopper-Pearson interval, since they are seemingly dependent through the online learned classifier $\hat{g}_t$ . First, our key result shows that our estimate of the accuracy of $\hat{g}_t$ is valid—i.e., the predictions $\hat{y}_i, \dots, \hat{y}_j$ are conditionally independent (see Appendix A.1 for a proof), thus the accuracy is the parameter of the Binomial distribution: + +Lemma 4.1. If $x_{i}, \ldots, x_{j}$ are independent for any $i, j \in \mathbb{N}$ where $i < j$ , $\hat{y}_{i}, \ldots, \hat{y}_{j}$ are conditionally independent given $\hat{g}_{i}, \ldots, \hat{g}_{j-1}$ . + +Our next result says that our algorithm ensures the desired bound $\alpha$ on the false positive rate (i.e., $\hat{f}$ says "covariate shift" when there is no covariate shift). To this end, we exploit the following observation that any source-target classifier makes the expected accuracy of $1/2$ if there is no covariate shift. Intuitively, if $S = \bar{T}_{w,t}$ , source-target classification is impossible (Lopez-Paz & Oquab, 2017; Liu et al., 2020); we include this lemma for completeness (see Appendix A.2 for a proof): + +Lemma 4.2. Define $\bar{\mathcal{T}}_{w,t}$ as in Eq. (1) and $\mu_{w,t}^{*}$ as in Eq. (3). If $S = \bar{\mathcal{T}}_{w,t}$ , we have $\mu_{w,t}^{*} = 1/2$ for any source-target classifier $\hat{g}_t$ . + +Since the expected accuracy of $\hat{g}_t$ is $1/2$ regardless of how we design and learn $\hat{g}_t$ , and how many samples are used to learn $\hat{g}_t$ , the Clopper-Pearson interval includes the true accuracy with high probability; thus the false positive rate of the proposed covariate shift detector $\hat{f}$ is effectively controlled by the confidence level of the Clopper-Pearson interval, as follows (see Appendix A.3 for a proof): + +Theorem 4.3 (Bound on false positive rate). Define $\bar{\mathcal{T}}_{w,t}$ as in Eq. (1). If $S = \bar{\mathcal{T}}_{w,t}$ , for any source-target classifier $\hat{g}_t$ , we have + +$$ +\mathbb {P} _ {\left(S _ {w, t}, T _ {w, t}\right) \sim \mathcal {S} ^ {w} \times \mathcal {T} _ {t - w + 1: t}} \left[ \hat {f} \left(S _ {w, t}, T _ {w, t}; \alpha\right) = 0 \right] \geq 1 - \alpha . \tag {4} +$$ + +Note that our FPR bound is not time-uniform; we can obtain time-uniform bounds by taking $\alpha$ to zero sufficiently quickly; please refer to discussion in Appendix B.2. + +Our next result provides a bound on the false negative rate; we first observe that the Clopper-Pearson interval is included in the interval by the Hoeffding's bound. Intuitively, the Clopper-Pearson interval represents a lower and upper bound of the expected accuracy given an empirical accuracy tailored to a Bernoulli random variable; the Hoeffding's bound can similarly bound the mean but in a more general setup. Thus, the Clopper-Pearson interval can be smaller (see Appendix A.4 for a proof). + +Lemma 4.4. Let $s \sim \text{Binomial}(n, p)$ and $F(s; n, p)$ is the CDF of Binomial $(n, p)$ ; we have + +$$ +\begin{array}{l} \frac {s}{n} - \sqrt {\frac {\ln \frac {2}{\alpha}}{2 n}} \leq \inf \left\{\theta \mid F (n - s; n, 1 - \theta) \geq \frac {\alpha}{2} \right\} a n d \\ \sup \left\{\theta \mid F (s; n, \theta) \geq \frac {\alpha}{2} \right\} \leq \frac {s}{n} + \sqrt {\frac {\ln \frac {2}{\alpha}}{2 n}}. \\ \end{array} +$$ + +Leveraging this, we have the following bound on false negative rate (see Appendix A.5 for a proof). + +Theorem 4.5 (Bound on false negative rate). Define $\bar{\mathcal{T}}_{w,t}$ as in Eq. (1) and $\mu_{w,t}^{*}$ as in Eq. (3). Assume a source-target classifier $\hat{g}_t$ achieves nontrivial accuracy, i.e., $\mu_{w,t}^{*} \geq 1/2 + \epsilon$ , where $\epsilon \in (0,1/2]$ , is the accuracy at distinguishing $S$ and $\bar{\mathcal{T}}_{w,t}$ . Let $a(w,\alpha) := 2w(1/2 + \sqrt{\log(2/\alpha)/4w})$ and $b(w,\alpha) := 2w(1/2 - \sqrt{\log(2/\alpha)/4w})$ . If $S \neq \bar{\mathcal{T}}_{w,t}$ and $w - 1 - \lfloor \sqrt{w\log(2/\alpha)} \rfloor \geq 0$ , then we have + +$$ +\begin{array}{l} \mathbb {P} \left[ \hat {f} (S _ {w, t}, T _ {w, t}; \alpha) = 1 \right] \\ \geq F \left(2 w - \lfloor a (w, \alpha) + 1 \rfloor ; 2 w, \frac {1}{2} - \epsilon\right) \\ + F \Big (\lceil b (w, \alpha) - 1 \rceil ; 2 w, 1 \Big). \\ \end{array} +$$ + +In the false negative bound, the first term is dominant and increases as $w$ increases, which implies the sample size needs to be increased to have a powerful shift detector; the condition on $w$ suggests that the bound is valid when $w \geq 201$ given $\alpha = 0.01$ . This theorem provides a partial answer to the cold start performance which any test can suffer from. To practically use our algorithm, we need to know the amount of samples for a reliable detection. This FNR bound offers a guideline for the required number of samples for the given magnitude under certain assumptions. We note that the assumption $L(\hat{g}_t) \coloneqq 1 - \mu^* \leq 1/2 - \epsilon$ can be achieved under standard conditions. For instance, assume that the model family $\mathcal{G}$ of source-target classifiers has finite VC dimension (i.e., $\mathrm{VC}(\mathcal{G}) < \infty$ ), and that the optimal model $g^* \in \mathcal{G}$ has nontrivial inaccuracy $L(g^*) = 1/2 - \xi$ . + +for some $\xi \in \mathbb{R}_{>0}$ ; then, with probability at least $1 - \delta$ with respect to $S_{w,t}$ and $T_{w,t}$ and letting $m = 2w$ , we have + +$$ +\begin{array}{l} L (\hat {g} _ {t}) \\ \leq L (g ^ {*}) + 4 \sqrt {\frac {\operatorname {V C} (\mathcal {G}) (\log (2 m) + 1)}{m}} + \sqrt {\frac {\log (2 / \delta)}{m}} \\ \leq \frac {1}{2} - \underbrace {\left(\xi - 4 \sqrt {\frac {\operatorname {V C} (\mathcal {G}) (\log (2 m) + 1)}{m}} - \sqrt {\frac {\log (2 / \delta)}{m}}\right)} _ {=: \epsilon}, \\ \end{array} +$$ + +where the second term (which we have taken to be $\epsilon$ ) satisfies $\epsilon > 0$ for sufficiently large $m$ (Vapnik, 1998). + +# 5. Experiments + +We evaluate the effectiveness of our algorithm at detecting both natural and synthetic covariate shifts of varying forms (e.g., gradual shifts and multiple shifts back and forth), showing that it significantly outperforms natural baselines. In this section, we show the experimental results on ImageNet; see Appendix C for the results on IWildCam and Py150. We have released our code for these experiments. $^{1}$ + +# 5.1. Experiment Setup + +Baselines. We compare our algorithm to six baselines; two of them differ in the way they use the samples at each time step, the third uses Wald's sequential likelihood test (Wald, 1945), the fourth one is based on DeepKernel (Liu et al., 2020), the fifth one is based on KD-Switch (Lheritier & Cazals, 2019), and the last one is based on inductive conformal martingales (Volkhonskiy et al., 2017; Eliades & Papadopoulos, 2021). For the first two baselines, while our approach uses all samples to construct the CP interval around the accuracy of the source-target classifier $\hat{g}_t$ as well as to train $\hat{g}_t$ , the baseline instead constructs a held-out test set using every $H^{th}$ sample. Then, only this held-out test set is used to compute the CP interval, and only the remaining samples are used to train $\hat{g}_t$ . In our experiments, we used values of $H \in \{2,5\}$ , denoted H2, H5, respectively. For Wald's test, we consider the Bernoulli random variable with a probability $p$ indicating whether the prediction of the source-target classifier is correct for the given sample. The hypothesis test is $H_0: p = 0.5$ vs. $H_1: p = 0.5 + \epsilon$ , where $\epsilon = 0.2$ in our experiments; we restart the test each time it makes a decision. For Deep Kernel (DK), since it requires training of the kernel parameters and the network for extracting features, we use half of the samples for this training process and conduct the test using the remaining ones. For KD-Switch (KDS), we also restart the test when it makes a decision as we do for Wald's test. The last baseline, + +inductive conformal martingale (ICM), uses source-target classifier's output as non-conformity score and a constant betting function. + +H2 and H5 are the online version of an existing classifier two-sample test (C2ST) (Kim et al., 2021; Lopez-Paz & Oquab, 2017), which splits the (fixed) training dataset into a training set to train $\hat{g}_t$ and a held-out test set to estimate the accuracy of $\hat{g}_t$ ; thus, $H$ controls the tradeoff between the number of examples in the training set and held-out test set. + +Source-target classifier. We use a fully-connected neural network with a single hidden layer (with 128 hidden units) and with the ReLU activation functions as the source-target classifier $\hat{g}_t$ . We use a binary cross-entropy loss for training in conjunction with an SGD optimizer with a learning rate of 0.01 (for natural shift experiments) and 0.001 (for synthetic shift experiments). Finally, since the inputs are ImageNet images (Russakovsky et al., 2015), we use a 2048-dimensional feature vector generated by first running a pretrained ResNet152 model (He et al., 2016) on the images, and then using these features vectors for the covariates of $S_{w,t}$ and $T_{w,t}$ . + +Scenarios. We run each algorithm to test whether the target distribution in the given window is shifted with three different scenarios: multiple shift ("M-shift"), gradually increasing shift ("GI-shift"), and gradually increasing-then-decreasing shift ("GID-shift"). Table 1 describes each scenario. For example, the multiple shift scenario proceeds as follows: (i) it starts with no covariate shift at the beginning; (ii) after observing $25\%$ target samples (i.e., $250^{th}$ samples for natural shift experiments and $2500^{th}$ samples for synthetic shift experiments), covariate shift is applied to all target samples (with probability 1) by adding random perturbations for synthetic shift and by drawing samples from a target distribution for natural shift; (iii) after $50\%$ of target samples, it reverts to no covariate shift; and (iv) finally after observing $75\%$ target samples, the covariate shift is applied to the all target samples. Gradually increasing shift and gradually increasing-then-decreasing shift scenarios start with no covariate shift for the first $20\%$ of target samples; then, covariate shift is applied with some probability $0 < p < 1$ by gradually changing $p$ over time. + +Stream data generation. For each shift (i.e., natural shift and synthetic shift), we have a source dataset $S$ and target datasets $\mathcal{T}_t$ , from which we randomly draw source and target samples for each time step $t$ . In particular, we consider a batch of samples for computational efficiency, where we denote the batch size by $B$ ; we use $B = 10$ for our experiments. That is, we wait for $B$ samples to be collected from the target distribution before checking for covariate shift and the updating the source-target classifier; then, we begin collecting the next batch. Finally, we evaluate each approach using multiple random repetitions, which we denote by $R$ + +Table 1: Scenario description for experiments. (a) “M-shift” is Multiple shift, (b) “GI-shift” is gradually increasing shift, and (c) “GID-shift” is gradually increasing-then-decreasing shift. + +(a) M-shift + +
Start positionDescriptionProb.
0%No shift0.0
25%Shift1.0
50%No shift0.0
75%Shift1.0
+ +(b) GI-shift + +
Start positionDescriptionProb.
0%No shift0.0
20%Shift0.2
40%Shift0.4
60%Shift0.6
80%Shift0.8
+ +(c) GID-shift + +
Start positionDescriptionProb.
0No shift0.0
20%Shift0.4
40%Shift0.8
60%Shift0.4
80%No shift0.0
+ +![](images/799577cc2d4312b9b55ee0c04ff72049469adb3a025ae9e3e07f712ee24a98e8.jpg) +(a) M-shift + +![](images/ffb1e1d820d2184794022443671c81856d81de1c48dc61dd96d2fc5fa5f9fd92.jpg) +(b) GI-shift +Figure 1: Detection rate for natural shift with $R = 100$ , $w = 10$ , $\alpha = 1\%$ . The black dashed line indicates shifted sample ratio, i.e., the degree (or probability) of covariate shift. + +![](images/7f72db3183454b1527b6d5315e4dfe8bd3728914e27f68a7798f4d6c465289d9.jpg) +(c) GID-shift + +(the value of $R$ depends on each experiment). + +# 5.2. Natural shift + +Dataset. First, we consider a natural shift on ImageNet. To construct such a shift, we consider the subset of dog classes; in particular, 120 of the 1000 of the ImageNet classes are of dogs (Khosla et al., 2011). Then, we randomly select half (i.e., 60) of these classes to be the source dataset, and the other half to be the target dataset; thus, the number of source and target images is 2997 each (after removing duplicated images). As a consequence, the source and target datasets correspond to different dog breeds, which is a kind of natural distribution shift. + +Results. Figure 1 and Table 2 show results for the natural shift experiment with $w = 10$ and $\alpha = 1\%$ . Figure 1 illustrates detection rates of the seven algorithms with $R = 100$ repetitions (i.e., the fraction of repetitions that reported "covariate shift" at each step). Table 2a shows the number of shifted samples required to reach at least $80\%$ of covariate shift detection rate under the shift. Table 2b shows false positive rate (FPR) after 50, 100, 150, and 200 samples with $R = 20000$ repetitions. + +Discussion. Figure 1 shows the detection rate of each algorithm as each scenario progresses. In multiple shift (Figure 1a) and gradually increasing-then-decreasing shift (Figure + +Table 2: Natural shift results with (a) $w = 10$ , $\alpha = 1\%$ , and $R = 100$ , and (b) $R = 20000^2$ . In (a), we bold the best algorithm and underline the second-best algorithm. In (b), we bold values that violate the desired $\alpha = 1\%$ . + +(a) Number of samples for detection $(\geq 80\%)$ + +
Scn.Alg.Natural shift
M-shiftOurs190
H2720
H5-
Wald640
DK180
KDS-
ICM660
GI-shiftOurs620
H2-
H5-
Wald-
DK790
KDS-
ICM-
GID-shiftOurs310
H2-
H5-
Wald-
DK-
KDS-
ICM-
+ +(b) FPR $(\%)$ at selected time + +
Scn.Alg.50100150200
M-shiftOurs0.270.530.730.77
H20.290.280.260.33
H50.340.520.510.56
Wald0.600.470.270.27
DK1.692.312.162.54
KDS0.000.000.000.00
ICM0.210.180.270.19
GI-shiftOurs0.210.600.760.83
H20.210.250.290.36
H50.320.430.500.85
Wald0.780.570.290.22
DK2.112.672.223.29
KDS0.000.000.000.00
ICM0.220.220.180.19
GID-shiftOurs0.300.530.700.95
H20.180.210.280.41
H50.360.560.530.81
Wald0.770.580.340.23
DK1.912.672.373.42
KDS0.000.000.000.00
ICM0.290.230.200.20
+ +![](images/466745ebeed9523722f00ab85c4c7241055f9538cb2324457b3683c85aafb5e8.jpg) +(a) M-shift + +![](images/466b25b329066c167513982633e1addb64d78c368047f6e29f869ce53854123f.jpg) +(b) GI-shift +Figure 2: Detection rate for synthetic shifts with Gaussian noise perturbation, Severity $= 2$ , $R = 100$ , $w = 10$ , $\alpha = 1\%$ . The black dashed line indicates shifted sample ratio, i.e., the degree (or probability) of covariate shift. The red dotted line shows the accuracy of ResNet152 on the source and target samples in the given window. + +![](images/04d364fa7bbf657857d235d2db58b41922cc0eaded9d94dc7e8d7b66e1f7ae05.jpg) +(c) GID-shift + +Table 3: Synthetic shift results with (a) Severity $= 2$ , $w = {10}$ , $\alpha = 1\%$ ,and $R = {100}$ ,and (b) $R = {20000}^{3}$ . In (a),we bold the best algorithm and underline the second-best algorithm. In (b), we bold values that exceed the desired $\alpha = 1\%$ . +(a) Number of samples for detection + +
ScenarioAlg.ContrastDefocus BlurElastic TransformGaussian BlurGaussian Noise
M-shiftOurs230200220210180
H2470450450490350
H5410410410460310
Wald-----
DK1509011090110
KDS-----
ICM410290370330310
GI-shiftOurs21002060209020702080
H240503690405040103670
H543604110601041104110
Wald-----
DK61302210413040904110
KDS-----
ICM40704070409040704070
GID-shiftOurs880560900720610
H220302010205020102010
H520602060206020602060
Wald-----
DK2170190207020502070
KDS-----
ICM20502030205020302030
+ +(b) FPR $(\%)$ at selected time + +
ScenarioAlg.500100015002000
M-shiftOurs0.750.990.950.97
H20.410.460.460.52
H50.780.730.850.67
Wald0.070.110.040.01
DK2.082.071.942.17
KDS0.000.000.000.01
ICM0.240.220.240.19
GI-shiftOurs0.860.890.920.85
H20.620.540.600.50
H50.740.710.770.73
Wald0.100.130.070.03
DK2.042.081.932.14
KDS0.000.000.000.00
ICM0.180.160.150.22
GID-shiftOurs0.870.950.920.89
H20.510.570.510.53
H50.730.750.850.89
Wald0.090.080.040.02
DK2.052.052.042.13
KDS0.010.000.000.00
ICM0.170.230.150.22
+ +in Table 2a, our approach always requires fewer samples to detect the shift, except for M-shift, where DK slightly outperforms it (at the cost of an excessive FPR, as discussed below). Whereas H5, KDS do not achieve $80\%$ detection, H2, Wald, DK, and ICM reach $80\%$ only for some scenarios, our approach always detects covariate shift at a rate higher than $80\%$ . Furthermore, for multiple shift, our algorithm requires similar or fewer than half the number of samples compared to H2, Wald, DK, and ICM. In summary, our algorithm is significantly more sample efficient at detecting covariate shift compared to the baselines, most likely since it utilizes all samples for both training the source-target classifier and constructing the CP interval. For FPR, all algorithms except DK always satisfy the FPR bound (i.e., $\mathrm{FPR} \leq \alpha$ ). + +# 5.3. Synthetic shift + +Dataset. Next, we consider a synthetic shift on ImageNet. In particular, we split the original ImageNet validation set into equal sized source and target datasets. To construct the target dataset, we add synthetic perturbations on original images. We (separately) consider five perturbation types from Hendrycks & Dietterich (2019)—in particular, Contrast, Defocus Blur, Elastic Transform, Gaussian Blur, and Gaussian Noise, with five different severity levels. + +Results. The experiment results are shown in Figure 2 and Table 3 for the experiments with the perturbation severity of 2, window size $w = 10$ , and significance level $\alpha =$ + +1%. Table 3a shows the number of target samples required by each algorithm to detect the first covariate shift in the detection rate of at least $80\%$ . Table 3b shows the false positive rate (FPR) after 500, 1000, 1500 and 2000 samples for each of the three scenarios. Figure 2 shows the detection rates over multiple repetitions for each of the three scenarios using the Gaussian noise perturbation. Results for other perturbation types and severities are shown in Appendix C. + +Discussion. As can be seen, our approach outperforms the baselines in terms of sample efficiency for the covariate shift detection as was the case of the natural shift. The only exceptions are M-shift and Defocus Blur in the GID-shift scenario, where the difference is not large compared to other algorithms. Our algorithm requires about half as many samples before detecting covariate shift compared to the baselines. In terms of FPR, our approach always satisfies the FPR bound. Finally, Figure 2 shows the accuracy drop with the shifted samples. In particular, the red dotted line shows the accuracy of ResNet152 on the examples in the source and target samples of the given window; as can be seen, the accuracy decreases as the degree of the shift increases. Covariate shift detection can be successfully used to notify a user that an accuracy drop may have occurred. + +# 6. Conclusion + +We have proposed a novel covariate shift detection algorithm, which uses a classifier two-sample test to check whether the current test examples differ in distribution compared to the training examples. Our approach ensures sample efficiency by avoiding the need to split the dataset into a training set and a held-out test set, and instead using all the data to both train the source-target discriminator and to evaluate its accuracy. We prove that even with this optimization, our approach provides finite sample guarantees on the false positive rate at a desired level; we also prove bounds on the false negative rate under a mild conditions on the trained classifier. Finally, we empirically demonstrate that our proposed algorithm is significantly more sample efficient compared to several baselines at detecting both natural and synthetic shifts on ImageNet. + +# Acknowledgement + +This work was supported in part by DARPA/AFRL FA8750-18-C-0090 and by ARO W911NF-20-1-0080. Any opinions, findings and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of the Air Force Research Laboratory (AFRL), the Army Research Office (ARO), the Defense Advanced Research Projects Agency (DARPA), or the Department of Defense, or the United States Government. + +# References + +Adams, R. P. and MacKay, D. J. Bayesian online change-point detection. arXiv preprint arXiv:0710.3742, 2007. +Balsubramani, A. and Ramdas, A. Sequential nonparametric testing with the law of the iterated logarithm. arXiv preprint arXiv:1506.03486, 2015. +Ben-David, S., Blitzer, J., Crammer, K., and Pereira, F. Analysis of representations for domain adaptation. In Advances in neural information processing systems, pp. 137-144, 2007. +Bickel, S., Brückner, M., and Scheffer, T. Discriminative learning for differing training and test distributions. In Proceedings of the 24th international conference on Machine learning, pp. 81-88. ACM, 2007. +Bishop, C. M. Pattern recognition and machine learning. Springer, 2006. +Boracchi, G., Carrera, D., Cervellera, C., and Maccio, D. Quanttree: Histograms for change detection in multivariate data streams. In International Conference on Machine Learning, pp. 639-648. PMLR, 2018. +Brown, L. D., Cai, T. T., and DasGupta, A. Interval estimation for a binomial proportion. Statistical science, pp. 101-117, 2001. +Cheng, X. and Cloninger, A. Classification logit two-sample testing by neural networks. arXiv preprint arXiv:1909.11298, 2019. +Chwialkowski, K., Ramdas, A., Sejdinovic, D., and Gretton, A. Fast two-sample testing with analytic representations of probability measures. arXiv preprint arXiv:1506.04725, 2015. +Clopper, C. J. and Pearson, E. S. The use of confidence or fiducial limits illustrated in the case of the binomial. Biometrika, 26(4):404-413, 1934. +Eliades, C. and Papadopoulos, H. Using inductive conformal martingales for addressing concept drift in data stream classification. In Conformal and Probabilistic Prediction and Applications, pp. 171-190. PMLR, 2021. +Friedman, J. On multivariate goodness-of-fit and two-sample testing. Technical report, Citeseer, 2004. +Gama, J., Zliobaité, I., Bifet, A., Pechenizkiy, M., and Bouchachia, A. A survey on concept drift adaptation. ACM computing surveys (CSUR), 46(4):1-37, 2014. +Ganin, Y., Ustinova, E., Ajakan, H., Germain, P., Larochelle, H., Laviolette, F., Marchand, M., and Lempitsky, V. + +Domain-adversarial training of neural networks. Journal of Machine Learning Research, 17(59):1-35, 2016. URL http://jmlr.org/papers/v17/15-239.html. +Gonçalves Jr, P. M., de Carvalho Santos, S. G., Barros, R. S., and Vieira, D. C. A comparative study on concept drift detectors. Expert Systems with Applications, 41(18): 8144-8156, 2014. +Gretton, A., Borgwardt, K. M., Rasch, M. J., Schölkopf, B., and Smola, A. A kernel two-sample test. The Journal of Machine Learning Research, 13(1):723-773, 2012a. +Gretton, A., Sejdinovic, D., Strathmann, H., Balakrishnan, S., Pontil, M., Fukumizu, K., and Sriperumbudur, B. K. Optimal kernel choice for large-scale two-sample tests. In Advances in neural information processing systems, pp. 1205-1213. CiteSeer, 2012b. +Hartley, H. and Fitch, E. A chart for the incomplete beta-function and the cumulative binomial distribution. Biometrika, 38(3/4):423-426, 1951. +He, K., Zhang, X., Ren, S., and Sun, J. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770-778, 2016. +Hendrycks, D. and Dietterich, T. Benchmarking neural network robustness to common corruptions and perturbations. Proceedings of the International Conference on Learning Representations, 2019. +Jitkrittum, W., Szabo, Z., Chwialkowski, K., and Gretton, A. Interpretable distribution features with maximum testing power. arXiv preprint arXiv:1605.06796, 2016. +Khosla, A., Jayadevaprakash, N., Yao, B., and Fei-Fei, L. Novel dataset for fine-grained image categorization. In First Workshop on Fine-Grained Visual Categorization, IEEE Conference on Computer Vision and Pattern Recognition, Colorado Springs, CO, June 2011. +Kim, I., Ramdas, A., Singh, A., and Wasserman, L. Classification accuracy as a proxy for two-sample testing. The Annals of Statistics, 49(1):411-434, 2021. +Koh, P. W., Sagawa, S., Marklund, H., Xie, S. M., Zhang, M., Balsubramani, A., Hu, W., Yasunaga, M., Phillips, R. L., Gao, I., et al. Wilds: A benchmark of in-the-wild distribution shifts. In International Conference on Machine Learning, pp. 5637-5664. PMLR, 2021. +Lehmann, E. L. and Romano, J. P. Testing statistical hypotheses. Springer Science & Business Media, 2006. + +Lheritier, A. and Cazals, F. A sequential non-parametric multivariate two-sample test. IEEE Transactions on Information Theory, 64(5):3361-3370, 2018. +Lheritier, A. and Cazals, F. Low-complexity nonparametric bayesian online prediction with universal guarantees. Advances in Neural Information Processing Systems, 32: 14581-14590, 2019. +Liu, F., Xu, W., Lu, J., Zhang, G., Gretton, A., and Sutherland, D. J. Learning deep kernels for non-parametric two-sample tests. In International Conference on Machine Learning, pp. 6316-6326. PMLR, 2020. +Lopez-Paz, D. and Oquab, M. Revisiting classifier two-sample tests. In International Conference on Learning Representations, 2017. +Lu, S., Guo, D., Ren, S., Huang, J., Svyatkovskiy, A., Blanco, A., Clement, C. B., Drain, D., Jiang, D., Tang, D., Li, G., Zhou, L., Shou, L., Zhou, L., Tufano, M., Gong, M., Zhou, M., Duan, N., Sundaresan, N., Deng, S. K., Fu, S., and Liu, S. Codexglue: A machine learning benchmark dataset for code understanding and generation. CoRR, abs/2102.04664, 2021. +Manole, T. and Ramdas, A. Sequential estimation of convex divergences using reverse submartingales and exchangeable filtrations. arXiv preprint arXiv:2103.09267, 2021. +Ovadia, Y., Fertig, E., Ren, J., Nado, Z., Sculley, D., Nowozin, S., Dillon, J. V., Lakshminarayanan, B., and Snoek, J. Can you trust your model's uncertainty? evaluating predictive uncertainty under dataset shift. arXiv preprint arXiv:1906.02530, 2019. +Page, E. S. Continuous inspection schemes. Biometrika, 41 (1/2):100-115, 1954. +Park, S., Bastani, O., Weimer, J., and Lee, I. Calibrated prediction with covariate shift via unsupervised domain adaptation. In International Conference on Artificial Intelligence and Statistics, pp. 3219-3229. PMLR, 2020. +Podkopaev, A. and Ramdas, A. Tracking the risk of a deployed model and detecting harmful distribution shifts. arXiv preprint arXiv:2110.06177, 2021. +Rabanser, S., Gunnemann, S., and Lipton, Z. C. Failing loudly: An empirical study of methods for detecting dataset shift. arXiv preprint arXiv:1810.11953, 2018. +Russakovsky, O., Deng, J., Su, H., Krause, J., Satheesh, S., Ma, S., Huang, Z., Karpathy, A., Khosla, A., Bernstein, M., et al. Imagenet large scale visual recognition challenge. International journal of computer vision, 115(3): 211-252, 2015. + +Shimodaira, H. Improving predictive inference under covariate shift by weighting the log-likelihood function. Journal of statistical planning and inference, 90(2):227-244, 2000. +Sugiyama, M. and Müller, K.-R. Input-dependent estimation of generalization error under covariate shift. 2005. +Sugiyama, M., Krauledat, M., and Müller, K.-R. Covariate shift adaptation by importance weighted cross validation. Journal of Machine Learning Research, 8(5), 2007. +Vapnik, V. Statistical learning theory. Wiley, 1998. ISBN 978-0-471-03003-4. +Volkhonskiy, D., Burnaev, E., Nouretdinov, I., Gammerman, A., and Vovk, V. Inductive conformal martingales for change-point detection. In Conformal and Probabilistic Prediction and Applications, pp. 132-153. PMLR, 2017. +Vovk, V. Testing for concept shift online. arXiv preprint arXiv:2012.14246, 2020. +Vovk, V., Petej, I., Nouretdinov, I., Ahlberg, E., Carlsson, L., and Gammerman, A. Retrain or not retrain: Conformal test martingales for change-point detection. arXiv preprint arXiv:2102.10439, 2021. +Wald, A. Sequential tests of statistical hypotheses. The annals of mathematical statistics, 16(2):117-186, 1945. + +# A. Proofs + +# A.1. Proof of Lemma 4.1 + +![](images/e1c197b9bc26a25017587eaccfbc2661ccd9d4afe4ce2db1d2fd035c53255d00.jpg) +Figure 3: The dependency structure of random variables. + +Figure 3 represents the graphical model over random variables, where observed random variables are colored in gray. We prove the conditional independence using the d-separation (also called the Bayes ball algorithm) (Bishop, 2006), which is a set of rules that can determine the conditional dependency between two random variables based on the graphical model and observed random variables. In particular, $\hat{y}_{i + 2}$ is conditionally independent to $\hat{y}_k$ for all $k\leq i + 1$ since the path to $\hat{y}_k$ is blocked by $\hat{g}_{i + 1}$ (i.e., $\hat{g}_{i + 1}$ is observed). Similarly, $\hat{y}_{i + 2}$ is conditionally independent to $\hat{y}_k$ for all $k\geq i + 3$ . This proves the claim. + +# A.2. Proof of Lemma 4.2 + +For any source-target classifier $\hat{g}_t$ , if $S = \bar{T}_{w,t}$ , the following holds: + +$$ +\begin{array}{l} \mu_ {w, t} ^ {*} = \mathbb {P} _ {(x, y) \sim \mathcal {Q} _ {w, t}} [ \hat {g} _ {t} (x) = y ] \\ = \int \sum_ {y \in \{0, 1 \}} \mathbb {1} (\hat {g} _ {t} (x) = y) \mathcal {Q} _ {w, t} (x, y) d x \\ = \int \sum_ {y \in \{0, 1 \}} \mathbb {1} (\hat {g} _ {t} (x) = y) \left(\frac {1}{2} \cdot \mathcal {S} (x) \cdot \mathbb {1} (y = 0) + \frac {1}{2} \cdot \bar {\mathcal {T}} _ {w, t} (x) \cdot \mathbb {1} (y = 1)\right) d x \\ = \frac {1}{2} \int \sum_ {y \in \{0, 1 \}} \mathbb {1} (\hat {g} _ {t} (x) = y) \mathcal {S} (x) \mathbb {1} (y = 0) + \sum_ {y \in \{0, 1 \}} \mathbb {1} (\hat {g} _ {t} (x) = y) \bar {\mathcal {T}} _ {w, t} (x) \mathbb {1} (y = 1) \mathrm {d} x \\ = \frac {1}{2} \int \mathbb {1} (\hat {g} _ {t} (x) = 0) \mathcal {S} (x) + \mathbb {1} (\hat {g} _ {t} (x) = 1) \bar {\mathcal {T}} _ {w, t} (x) d x \\ = \frac {1}{2} \int \mathbb {1} (\hat {g} _ {t} (x) = 0) \mathcal {S} (x) + \mathbb {1} (\hat {g} _ {t} (x) = 1) \mathcal {S} (x) d x \\ = \frac {1}{2} \int (\mathbb {1} (\hat {g} _ {t} (x) = 0) + \mathbb {1} (\hat {g} _ {t} (x) = 1)) S (x) d x \\ = \frac {1}{2} \int S (x) \mathrm {d} x \\ = \frac {1}{2}, \\ \end{array} +$$ + +where the sixth equality holds since $\mathcal{S} = \bar{\mathcal{T}}_{w,t}$ ; the claim follows. + +# A.3. Proof of Theorem 4.3 + +Denote the event that $\mathbb{P}_{(x,y)\sim \mathcal{Q}_{w,t}}[\hat{g}_t(x) = y] = 1 / 2$ by $E$ , and let $\hat{s}_{w,t} = 2w\hat{\mu}_{w,t}$ . Then, we have + +$$ +\begin{array}{l} \mathbb {P} _ {S _ {w, t}, T _ {w, t}} \left[ \hat {f} \left(S _ {w, t}, T _ {w, t}; \alpha\right) = 0 \right] \\ = \mathbb {P} _ {S _ {w, t}, T _ {w, t}} \left[ \left(\frac {1}{2} \in \Theta_ {\mathrm {C P}} (\hat {s} _ {w, t}, 2 w; \alpha)\right) \wedge \left(\mathbb {P} _ {x, y} [ \hat {g} _ {t} (x) = y ] = \frac {1}{2}\right) \right] \\ = \mathbb {P} _ {S _ {w, t}, T _ {w, t}} [ E ] \mathbb {P} _ {S _ {w, t}, T _ {w, t}} \left[ \frac {1}{2} \in \Theta_ {\mathrm {C P}} (\hat {s} _ {w, t}, 2 w; \alpha) \right| E \Bigg ] \\ = \mathbb {P} _ {S _ {w, t}, T _ {w, t}} \left[ \frac {1}{2} \in \Theta_ {\mathrm {C P}} (\hat {s} _ {w, t}, 2 w; \alpha) \right| E \Bigg ] \\ \geq 1 - \alpha , \\ \end{array} +$$ + +where the first equality holds since $S = \overline{T}_{w,t}$ and by Lemma 4.2, the third equality holds by Lemma 4.2, and the last inequality holds by the property of the Clopper-Pearson interval and Lemma 4.1. + +# A.4. Proof of Lemma 4.4 + +We use the tail bound of the binomial distribution using the Hoeffding's inequality—i.e. + +$$ +F (s; n, p) \leq \exp \left\{- 2 n \left(p - \frac {s}{n}\right) ^ {2} \right\}. +$$ + +For the upper bound of the upper Clopper-Pearson interval, we have + +$$ +\begin{array}{l} \sup \left\{\theta \mid F (s; n, \theta) \geq \frac {\alpha}{2} \right\} \leq \sup \left\{\theta \mid \exp \left\{- 2 n \left(\theta - \frac {s}{n}\right) ^ {2} \right\} \geq \frac {\alpha}{2} \right\} \\ = \sup \left\{\theta \left| \frac {s}{n} - \sqrt {\frac {\ln \frac {2}{\alpha}}{2 n}} \leq \theta \leq \frac {s}{n} + \sqrt {\frac {\ln \frac {2}{\alpha}}{2 n}} \right. \right\} \\ = \frac {s}{n} + \sqrt {\frac {\ln \frac {2}{\alpha}}{2 n}}. \tag {5} \\ \end{array} +$$ + +For the lower bound of the lower Clopper-Pearson interval, we have + +$$ +\begin{array}{l} \inf \left\{\theta \mid F (n - s; n, 1 - \theta) \geq \frac {\alpha}{2} \right\} \geq \inf \left\{\theta \mid \exp \left\{- 2 n \left(\theta - \frac {s}{n}\right) ^ {2} \right\} \geq \frac {\alpha}{2} \right\} \\ = \inf \left\{\theta \left| \frac {s}{n} - \sqrt {\frac {\ln \frac {2}{\alpha}}{2 n}} \leq \theta \leq \frac {s}{n} + \sqrt {\frac {\ln \frac {2}{\alpha}}{2 n}} \right. \right\} \\ = \frac {s}{n} - \sqrt {\frac {\ln \frac {2}{\alpha}}{2 n}}. \tag {6} \\ \end{array} +$$ + +Finally, (5) and (6) imply the class + +![](images/8dbc81406154925579d9d9fc4e06a141e727aa2bdd557c956443e66b1b0cfd32.jpg) + +# A.5. Proof of Theorem 4.5 + +Let the lower and upper bound of the Clopper-Pearson interval $\Theta_{\mathrm{CP}}$ be $\underline{\Theta}_{\mathrm{CP}}$ and $\overline{\Theta}_{\mathrm{CP}}$ , respectively. Recall that we denote the CDF of a binomial distribution $\operatorname{Binomial}(n,p)$ by $F(s;n,p)$ . Then, we have + +$$ +\begin{array}{l} \mathbb {P} _ {S _ {w, t}, T _ {w, t}} \left[ \hat {f} (S _ {w, t}, T _ {w, t}; \alpha) = 1 \right] \\ = \mathbb {P} _ {S _ {w, t}, T _ {w, t}} \left[ \frac {1}{2} \notin \Theta_ {\mathrm {C P}} (2 w \mu_ {w, t} ^ {*}, 2 w; \alpha) \right] \\ = \mathbb {P} _ {S _ {w, t}, T _ {w, t}} \left[ \left(\mu_ {w, t} ^ {*} < \frac {1}{2} + \epsilon \vee \mu_ {w, t} ^ {*} \geq \frac {1}{2} + \epsilon\right) \wedge \left(\frac {1}{2} \notin \Theta_ {\mathrm {C P}} (2 w \mu_ {w, t} ^ {*}, 2 w; \alpha)\right) \right] \\ = \mathbb {P} _ {S _ {w, t}, T _ {w, t}} \left[ \left(\mu_ {w, t} ^ {*} \geq \frac {1}{2} + \epsilon\right) \wedge \left(\frac {1}{2} \notin \Theta_ {\mathrm {C P}} \left(2 w \mu_ {w, t} ^ {*}, 2 w; \alpha\right)\right) \right] (7) \\ = \mathbb {P} _ {S _ {w, t}, T _ {w, t}} \left[ \mu_ {w, t} ^ {*} \geq \frac {1}{2} + \epsilon \right] \mathbb {P} _ {S _ {w, t}, T _ {w, t}} \left[ \frac {1}{2} \notin \Theta_ {\mathrm {C P}} (2 w \mu_ {w, t} ^ {*}, 2 w; \alpha) \mid \mu_ {w, t} ^ {*} \geq \frac {1}{2} + \epsilon \right] \\ = \mathbb {P} _ {S _ {w, t}, T _ {w, t}} \left[ \frac {1}{2} \notin \Theta_ {\mathrm {C P}} \left(2 w \mu_ {w, t} ^ {*}, 2 w; \alpha\right) \mid \mu_ {w, t} ^ {*} \geq \frac {1}{2} + \epsilon \right] (8) \\ = \mathbb {P} _ {S _ {w, t}, T _ {w, t}} \left[ \underline {{\Theta}} _ {\mathrm {C P}} (2 w \mu_ {w, t} ^ {*}, 2 w; \alpha) > \frac {1}{2} \vee \overline {{\Theta}} _ {\mathrm {C P}} (2 w \mu_ {w, t} ^ {*}, 2 w; \alpha) < \frac {1}{2} \mid \mu_ {w, t} ^ {*} \geq \frac {1}{2} + \epsilon \right] \\ = \mathbb {P} _ {S _ {w, t}, T _ {w, t}} \left[ \underline {{\Theta}} _ {\mathrm {C P}} (2 w \mu_ {w, t} ^ {*}, 2 w; \alpha) > \frac {1}{2} \Bigg | \mu_ {w, t} ^ {*} \geq \frac {1}{2} + \epsilon \right] \\ + \mathbb {P} _ {S _ {w, t}, T _ {w, t}} \left[ \overline {{\Theta}} _ {\mathrm {C P}} (2 w \mu_ {w, t} ^ {*}, 2 w; \alpha) < \frac {1}{2} \mid \mu_ {w, t} ^ {*} \geq \frac {1}{2} + \epsilon \right], \\ \end{array} +$$ + +where (7) and (8) hold due to $\mathbb{P}_{S_{w,t},T_{w,t}}[\mu_{w,t}^{*} < 1 / 2 + \epsilon] = 0$ and $\mathbb{P}_{S_{w,t},T_{w,t}}[\mu_{w,t}^{*}\geq 1 / 2 + \epsilon] = 1$ from the assumption on $\hat{g}_t$ and $S\neq \bar{T}_{w,t}$ , respectively. + +By Lemma 4.4, the first term is lower bounded as follows: + +$$ +\begin{array}{l} \mathbb {P} _ {S _ {w, t}, T _ {w, t}} \left[ \underline {{\Theta}} _ {\mathrm {C P}} (2 w \mu_ {w, t} ^ {*}, 2 w; \alpha) > \frac {1}{2} \mid \mu_ {w, t} ^ {*} \geq \frac {1}{2} + \epsilon \right] \\ \geq \mathbb {P} _ {S _ {w, t}, T _ {w, t}} \left[ \hat {\mu} _ {w, t} - \sqrt {\frac {\ln \frac {2}{\alpha}}{4 w}} > \frac {1}{2} \mid \mu_ {w, t} ^ {*} \geq \frac {1}{2} + \epsilon \right] \\ = \mathbb {P} _ {S _ {w, t}, T _ {w, t}} \left[ 2 w \hat {\mu} _ {w, t} > a (w, \alpha) \mid \mu_ {w, t} ^ {*} \geq \frac {1}{2} + \epsilon \right] \\ = \mathbb {P} _ {S _ {w, t}, T _ {w, t}} \left[ 2 w \hat {\mu} _ {w, t} \geq \left\lfloor a (w, \alpha) + 1 \right\rfloor \mid \mu_ {w, t} ^ {*} \geq \frac {1}{2} + \epsilon \right] \\ \geq F \left(2 w - \lfloor a (w, \alpha) + 1 \rfloor ; 2 w, \frac {1}{2} - \epsilon\right), \tag {9} \\ \end{array} +$$ + +where the last inequality holds since the binomial parameter $\frac{1}{2} -\epsilon$ makes the CDF $F$ smallest. + +Similarly, the second term is lower bounded as follows: + +$$ +\begin{array}{l} \mathbb {P} _ {S _ {w, t}, T _ {w, t}} \left[ \overline {{\Theta}} _ {\mathrm {C P}} (2 w \mu_ {w, t} ^ {*}, 2 w; \alpha) < \frac {1}{2} \mid \mu_ {w, t} ^ {*} \geq \frac {1}{2} + \epsilon \right] \\ \geq \mathbb {P} _ {S _ {w, t}, T _ {w, t}} \left[ \hat {\mu} _ {w, t} + \sqrt {\frac {\ln \frac {2}{\alpha}}{4 w}} < \frac {1}{2} \right| \mu_ {w, t} ^ {*} \geq \frac {1}{2} + \epsilon \Biggr ] \\ = \mathbb {P} _ {S _ {w, t}, T _ {w, t}} \left[ 2 w \hat {\mu} _ {w, t} < b (w, \alpha) \mid \mu_ {w, t} ^ {*} \geq \frac {1}{2} + \epsilon \right] \\ = \mathbb {P} _ {S _ {w, t}, T _ {w, t}} \left[ 2 w \hat {\mu} _ {w, t} \leq \lceil b (w, \alpha) - 1 \rceil \mid \mu_ {w, t} ^ {*} \geq \frac {1}{2} + \epsilon \right] \\ \geq F \left(\lceil b (w, \alpha) - 1 \rceil ; 2 w, 1\right), \tag {10} \\ \end{array} +$$ + +where the last inequality holds since the binomial parameter $\mu_{w,t}^{*} = 1$ makes the CDF $F$ smallest. + +The claim follows by combining (9) and (10). + +# B. Additional Discussion + +# B.1. Multiple Epochs in Training + +As shown in Algorithm 1, each example is used only once in updating the source-target classifier, baselines also follow this setting in all experiments. We consider this single epoch update anticipating that our algorithms being used in the online setting, where it is infeasible to take multiple passes over the training data. However, without consideration of the online setting, each example can be used multiple times during training with the restriction that the example can be used only once in the CP interval, which can improve the performance. As this strategy is orthogonal to our approach, it can be applied to both ours and other baselines expecting the performance improvement. + +# B.2. Time-uniform bound + +Our notions of FPR and FNR (e.g., in Thm. 4.3) are for a single, fixed $t$ . We make this choice since we expect covariate shift algorithms to run in production for extended periods of time, making it impractical to provide guarantees that hold uniformly across time. Then, our approach bounds the rate at which false positives occur. In principle, we can achieve a uniform bound by taking $\alpha$ to zero over time. For instance, to obtain a uniform bound of $\alpha$ , we can take $\alpha_{t} = (6 / \pi^{2})\cdot \alpha /t^{2}$ on step $t$ (since $\sum_{t = 1}^{\infty}1 / t^{2} = \pi^{2} / 6$ ). + +# C. Additional Experimental Results + +# C.1. Natural shift - IWildCam + +Dataset. In addition to ImageNet, we perform additional natural shift experiments on another image dataset, IWildCam from WILDS dataset (Koh et al., 2021). WILDS dataset is a collection of datasets for distribution shift research and IWildCam is one of such datasets which includes animal photos taken from different locations. This IWildCam has two different test sets; denoted by Test (ID) and Test (OOD). Test (ID) is a collection of photos taken at the same locations as a training set while Test (OOD) is from the different locations. We consider the shift from Test (ID) to Test (OOD) as a natural covariate shift. + +Source-target classifier. We use the same source-target classifier setting as we do for ImageNet natural shift experiments in terms of network architecture, loss, and learning rate. However, we use different model to extract features from IWildCam images. We obtain the pretrained ResNet50 model, provided by the authors of the WILDS dataset paper (Koh et al., 2021), and run the model for the feature extraction. + +Results. The results are shown in Figure 4 and Table 4. Figure 4 displays the detection rate and Table 4 shows the number of samples for detection $(\geq 80\%)$ and FPR at selected time points. + +Discussion. The results are similar to other two experiments in the main paper. As shown in Figure 4 and Table 4, most algorithms correctly react to the shifts, but our algorithm requires the smallest number of samples for detection. In addition, all algorithms except DK satisfy the FPR bound. + +![](images/0ca8f5d9d16f2aa551fa5d8176157ab074e406ecaed4458a52713f566382b60c.jpg) +(a) M-shift + +![](images/92595e0d3f67132a70a9eeaac8b240c92e2e7c9e3f8c6bc2299454a9acf49681.jpg) +(b) GI-shift +Figure 4: Detection rate for natural shift on IWildCam with $R = 100$ , $w = 10$ , $\alpha = 1\%$ . The black dashed line indicates shifted sample ratio, i.e., the degree (or probability) of covariate shift. Our approach achieves the high detection rate ( $\geq 80\%$ ) with the smallest number of samples when covariate shift occurs. DK reaches the higher detection rate at the early stage of covariate shift, which may be caused by the higher FPR (Table 4b). + +![](images/11261c328394207d413fd8972e98a7a0daf93d8433dfc38113bc1fd9235c766d.jpg) +(c) GID-shift + +Table 4: Natural shift on IWildCam results with (a) $w = 10$ , $\alpha = 1\%$ , and $R = 100$ , and (b) $R = 20000^4$ . In (a), we bold the best algorithm, and underline the second-best one. In (b), we bold values that exceed the desired $\alpha = 1\%$ . For all shifts, our approach achieves the high detection rate ( $\geq 80\%$ ) with the smallest number of samples (Table 4a). All algorithms except DK satisfy the FPR bound (Table 4b). +(a) Number of samples for detection $(\geq 80\%)$ + +
Scn.Alg.Natural shift
M-shiftOurs670
H2-
H5-
Wald1410
DK-
KDS-
ICM4330
GI-shiftOurs3650
H2-
H5-
Wald4710
DK-
KDS-
ICM-
GID-shiftOurs1620
H2-
H5-
Wald-
DK-
KDS-
ICM-
+ +(b) FPR $(\%)$ at selected time + +
Scn.Alg. 3006009501200
M-shiftOurs0.690.570.68
H20.300.350.40
H50.460.560.41
Wald0.250.210.26
DK1.981.911.93
KDS0.000.000.00
ICM0.180.170.17
GI-shiftOurs0.660.620.53
H20.360.300.40
H50.480.510.51
Wald0.170.270.26
DK1.771.882.10
KDS0.000.000.00
ICM0.220.170.20
GID-shiftOurs0.570.590.57
H20.330.400.41
H50.360.500.51
Wald0.200.310.25
DK1.911.822.02
KDS0.000.000.00
ICM0.240.210.15
+ +# C.2. Natural shift - Py150 + +Dataset. All of previous datasets are image datasets. For a more general set-up, we also consider the non-image dataset, Py150 dataset from WILDS dataset. This dataset includes program code from multiple Github repositories, and it has two different test sets: Test (ID) and Test (OOD). The difference between them is that Test (OOD) contains code from different sets of repositories compared to the training set and Test (ID). Similar to IWildCam, a shift from one group of repositories to another group of repositories is considered as a natural shift. + +Source-target classifier. We follow the same source-target classifier setting with other natural shift experiments (ImageNet, IwldCam). However, as this dataset is not an image dataset, we use different way of extracting features. We first download + +![](images/d78ab557a9038a05f29c099d2fa1f525dd1025ab2bb414ce6b8a15f59efe1abf.jpg) +(a) M-shift + +![](images/42afba29ce6bb4edb2c487caf0cc4db82308652d337e225fa1931014687fb685.jpg) +(b) GI-shift +Figure 5: Detection rate for natural shift on Py150 with $R = 100$ , $w = 10$ , $\alpha = 1\%$ . The black dashed line indicates shifted sample ratio, i.e., the degree (or probability) of covariate shift. This shows the similar pattern with IWildCam experiments (Figure 4). Our approach achieves the high detection rate ( $\geq 80\%$ ) with the smallest number of samples when covariate shift occurs, and it has small FPR when no covariate shift occurs. DK reaches the higher detection rate at the early stage of covariate shift, which may be caused by the higher FPR (Table 4b). DK does not show the notable change in GI-shift case, and we believe that the hyper-parameter was not properly chosen. + +![](images/c555531e221eda1b7869cdb09ef8887bfcdc22ced3246bb861e01263f24efa02.jpg) +(c) GID-shift + +Table 5: Natural shift on Py150 results with (a) $w = 10$ , $\alpha = 1\%$ , and $R = 100$ , and (b) $R = 20000^5$ . In (a), we bold the best algorithm, and underline the second-best one. In (b), we bold values that exceed the desired $\alpha = 1\%$ . For M-shifts, our approach achieves the high detection rate $(\geq 80\%)$ with the smallest number of samples (Table 5a), and for the other two shifts, all algorithms cannot reach the high detection rate. All algorithms except DK satisfy the FPR bound (Table 5b). We believe that DK has high FPR because of inappropriate hyper-parameters. + +(a) Number of samples for detection $(\geq 80\%)$ + +
Scn.Alg.Natural shift
M-shiftOurs1570
H2-
H5-
Wald-
DK-
KDS-
ICM-
GI-shiftOurs-
H2-
H5-
Wald-
DK-
KDS-
ICM-
GID-shiftOurs-
H2-
H5-
Wald-
DK-
KDS-
ICM-
+ +(b) FPR $(\%)$ at selected time + +
Scn.Alg.3006009501200
M-shiftOurs0.640.750.840.88
H20.330.400.410.37
H50.490.610.600.63
Wald0.240.240.330.41
DK11.8613.9316.9014.36
KDS0.000.000.000.00
ICM0.220.220.150.16
GI-shiftOurs0.610.730.760.77
H20.280.310.430.46
H50.450.510.660.83
Wald0.180.220.290.34
DK11.8713.8716.9814.77
KDS0.000.000.000.00
ICM0.190.180.200.24
GID-shiftOurs0.500.780.851.00
H20.210.370.450.45
H50.410.650.620.73
Wald0.180.300.320.38
DK12.3214.1216.8314.34
KDS0.000.000.000.00
ICM0.190.200.210.26
+ +the pretrained CodeGPT model (Lu et al., 2021), provided by the authors of WILDS dataset paper (Koh et al., 2021), and run the model and average the embeddings from the model to obtain the final features. + +Results. Figure 5 shows the detection rate and Table 5 displays the number of required samples for high detection rate $(\geq 80\%)$ and the FPR for the Py150 experiment results. + +Discussion. The Py150 results are similar to other experiments with one exception of DK. In M-shift, all algorithms correctly reacts to shift changes. However, in GI-shift and GID-shift, DK does not show notable change in the detection rate even + +though sample shift probability changes over time. We believe this is because DK does not have appropriate hyper-parameter for this experiment. In terms of the require number of samples, our algorithm requires the smallest number of samples for M-shift, but all algorithm fail to achieve the high detection rate for GI-shift and GID-shift. All algorithms except DK satisfy the FPR bound, and we believe that the aforementioned DK's hyper-parameter issue results in this high FPR. + +# C.3. Detection Rate + +This section shows the additional detection rate plots for the different perturbations, severities, and window sizes $(w)$ including figures in the main paper. + +# C.3.1.M-SHIFT + +Figure 6 - Figure 15 display the detection rate plot for M-shift scenario with different settings. These all different settings show the similar pattern with the figures in the main paper. + +![](images/1adfe7c6c4a9a18dc0fc4de5bdbbc7d66b09a15ef9263d8d8aa3e34c68aeedd1.jpg) +(a) Severity $= 1$ + +![](images/82ec810219042c0b5e28c00cc39071666230a43ee0f0b771b404570287771991.jpg) +(b) Severity $= 2$ + +![](images/1434846e4221edf4ff7d7a638b9c9c5da0cc6a86162df391a9da86bc59e4b077.jpg) +(c) Severity $= 3$ + +![](images/bf516324ac1a42d7c778944c61fcf07ef1192903002229edbf4e7559b04358a6.jpg) +(d) Severity $= 4$ + +![](images/6793293f3646a423f3b2ec4c854d6ea85c60f348e16cf65d4ef6e07e832fa1c7.jpg) +(e) Severity $= 5$ +Figure 6: Contrast with $R = 100$ , $w = 10$ , $\alpha = 1\%$ . As the severity increases, all algorithms achieve higher detection rate, and the accuracy of the original classifier drops more. Only DK tends to reach high detection rate with less number of samples when the severity is low. But, DK violates the FPR bound when no covariate shift occurs. + +![](images/aae385b317d00228ee649935b4e8d1c495ea34d41fbff51ee563c539c0592012.jpg) +(a) Severity $= 1$ + +![](images/80a469c65fd7208f9c077308262440a0cb39a4ab38781e081c5f4812954daa8f.jpg) +(b) Severity $= 2$ + +![](images/208c382bf411ea34f1edf2458be10ea7572be872dec010f6855e8a5d36567887.jpg) +(c) Severity $= 3$ + +![](images/2acb8fe4bde497284f35082e7917e0b03c043cd68d18b1a83d65c34289fea512.jpg) +(d) Severity $= 4$ + +![](images/7b80fdda4a908764146233b766ba052701564835c5994d4614ef4a75c1fe3d67.jpg) +(e) Severity $= 5$ +Figure 7: Defocus blur with $R = 100$ , $w = 10$ , $\alpha = 1\%$ . Defocus blur shows the same pattern with Contrast perturbation results (Figure 6). + +![](images/d9eb626b7ebf8bc13e8f23fb6dfccb712ef1022f5206d69d29d00b622688cbcd.jpg) +(a) Severity $= 1$ + +![](images/9fadbe089cb851cc8c66204347c39631438ca92710870ec743e47187b0ee4ee9.jpg) +(b) Severity $= 2$ + +![](images/69ba3c97cf78339368867c6dc62ec00643355c894537bf5c9100b0864e343045.jpg) +(c) Severity $= 3$ + +![](images/1113331fcda100c0a3d9298c35a59eab1209e9e209e41fdd2379c3d4d6b922d7.jpg) +(d) Severity $= 4$ + +![](images/eeca69e8c7ee0101b4436b683e3be1caf8eff458aa6387786dcd2d4f8393bc82.jpg) +(e) Severity $= 5$ +Figure 8: Elastic transform with $R = 100$ , $w = 10$ , $\alpha = 1\%$ . Elastic transform shows the same pattern with Contrast perturbation results (Figure 6). + +![](images/c5302053055d539873f914d78b8107bfd226e53478542bb672c419f53e5b7eb1.jpg) +(a) Severity $= 1$ + +![](images/33a80e6c9f6c2059cba97b40db7a774cfcb0db20bdc847090030b4cb6c8ad1dd.jpg) +(b) Severity $= 2$ + +![](images/56ee5424988569d2309f91437eb847f95a0e00e999008109907f79845a4ebbfd.jpg) +(c) Severity $= 3$ + +![](images/a254c6e619895b7a3d8a786afe47077eb2229411e2c5c0a0978390b6d268e7ff.jpg) +(d) Severity $= 4$ + +![](images/9c3dc6c8d0e337cee93e13a43fa02c6adf2245a2a70a366a11154cd9420192ea.jpg) +(e) Severity $= 5$ +Figure 9: Gaussian blur with $R = 100$ , $w = 10$ , $\alpha = 1\%$ . Gaussian blur shows the same pattern with Contrast perturbation results (Figure 6). + +![](images/35c99583c7ee0e597250e872bddc4a8eb7f6ed116fa7306caaa73eebfd566405.jpg) +(a) Severity $= 1$ + +![](images/d4f9099be83130b59683e865d2236ebb4bded61267e7bd9ea4c42388355881d8.jpg) +(b) Severity $= 2$ + +![](images/700e99d37716a7385fd48d540b8a6b180dab572522a117e31bcf276354b9756d.jpg) +(c) Severity $= 3$ + +![](images/145dbb3364be77b9842273869468b084a0a94ed29cb3df0ea5c31425424d1f0f.jpg) +(d) Severity $= 4$ + +![](images/0ce5e0ec532340fdd07524ba50c6ce3988df27b56943e153f10a0f2255d68850.jpg) +(e) Severity $= 5$ +Figure 10: Gaussian noise with $R = 100$ , $w = 10$ , $\alpha = 1\%$ . Gaussian noise shows the same pattern with Contrast perturbation results (Figure 6). + +![](images/817541f0b10e4c69737d34f5a0d8d29dae71f96162c80a9ec71722d9386fa8c3.jpg) +(a) Severity $= 1$ + +![](images/1a00cdeb70f7a3dff3db2979cba2ae6d94a89b90094133b1e007a13c063775ae.jpg) +(b) Severity $= 2$ + +![](images/35891950272d7826fb7c4e13330f4cf81e32935a8b74951aa675d03a5d32569e.jpg) +(c) Severity $= 3$ + +![](images/6525abaa990bf887da6e40ac363adda5d67679439ce3ff9f390aabe408ddd220.jpg) +(d) Severity $= 4$ + +![](images/8793e62e2a7b41dd37584ccf4bd25489dbc19c72fc602a7e5ba27fb0f08813ef.jpg) +(e) Severity $= 5$ +Figure 11: Contrast with $R = 100$ , $w = 20$ , $\alpha = 1\%$ . Compared to $w = 10$ (Figure 6), algorithms detect shifts with less fluctuations, but they show slow reaction to shift change, i.e., near $5000^{th}$ samples. + +![](images/6213d8365564d79524fb720927f25ae3c84e9f7f7608c86c49881ed315e4b87d.jpg) +(a) Severity $= 1$ + +![](images/d9d39a64f81060ccf110dbcc876b28955e9db05d370f7b09be8e80f9e79f2510.jpg) +(b) Severity $= 2$ + +![](images/fe04da1fdbe987ab65ce07411fe55cb7a6d1b3b6c6ec29ccca4ad97aa61a41cf.jpg) +(c) Severity $= 3$ + +![](images/89f6024716f5a5d7a8095f16766b883be50093f3c399159078c2e4896d3db34b.jpg) +(d) Severity $= 4$ + +![](images/5c02424c637f96730de6ba20e628eb759b5f6467131c73f94226274e87fbfd17.jpg) +(e) Severity $= 5$ +Figure 12: Defocus blur with $R = 100$ , $w = 20$ , $\alpha = 1\%$ . Defocus blur shows similar pattern with Contrast perturbation results (Figure 11). + +![](images/b72c8ea207ba7d3be76ac81eaa402c5ad8f42c45e6ea5be2e9bd28f877abcafe.jpg) +(a) Severity $= 1$ + +![](images/1a23473c58ed6d324b9f4592f4f6e1c7c91b8814d392a53b3af5f3e107053e1b.jpg) +(b) Severity $= 2$ + +![](images/d0f340c016b4211258d4845c45084c2b1e7236624ceff840dff19594822d6741.jpg) +(c) Severity $= 3$ + +![](images/8711252c5d864488fac81da891277a3201c60883a166b3c4cde93e0c8877fbc8.jpg) +(d) Severity $= 4$ + +![](images/23a301d1030195343348adbda4cf18358e0dbd0d84b0a26b9a2a3418cc5c812e.jpg) +(e) Severity $= 5$ +Figure 13: Elastic transform with $R = 100$ , $w = 20$ , $\alpha = 1\%$ . Elastic transform shows similar pattern with Contrast perturbation results (Figure 11). + +![](images/9f3e2d8cffe1470bf7c8eb640ec919c75469057479fb356cc8ec461ec8b4a70f.jpg) +(a) Severity $= 1$ + +![](images/c0937836d09b3a502979500489baffca7ecf9a14b935965936a295633e2779da.jpg) +(b) Severity $= 2$ + +![](images/6eb3db8e0af8f5a7f47029397f7180a42a2761a35a25733e8496789483f221f4.jpg) +(c) Severity $= 3$ + +![](images/27fc9eaa4ff634f78ad20db270804249cb92bc4b9a84a11e708ece0fdd811ae4.jpg) +(d) Severity $= 4$ + +![](images/12569c5236d1341f54971fb7f8d23f7b63d0d61fbd625c67c724e345a071ae46.jpg) +(e) Severity $= 5$ +Figure 14: Gaussian blur with $R = 100$ , $w = 20$ , $\alpha = 1\%$ . Gaussian blur shows similar pattern with Contrast perturbation results (Figure 11). + +![](images/eb72b436e1384e752c024fea30155c8a8bc72c0161acdb0939d83e7e4f46b14f.jpg) +(a) Severity $= 1$ + +![](images/c5f20f69a3d9922eba3e468bb8efd8f9f3aab489d006bf740a964b1bdf5215c5.jpg) +(b) Severity $= 2$ + +![](images/e9f1b1659d0968a6333a47c75d76c16525eb469b99c6fe80d101fe49d74f337a.jpg) +(c) Severity $= 3$ + +![](images/8908420923ab06f33c689185655b0ecdc455e003fde11db5152747064d712fc6.jpg) +(d) Severity $= 4$ + +![](images/69dd3af68bc55a68d5dd2726fb2666e6f8f1b06c201308d29124f01fbc0dbbe5.jpg) +(e) Severity $= 5$ +Figure 15: Gaussian noise with $R = 100$ , $w = 20$ , $\alpha = 1\%$ . Gaussian noise shows similar pattern with Contrast perturbation results (Figure 11). + +# C.3.2. GI-SHIFT + +This section includes the plots for GI-shift scenario with different perturbation, window sizes $(w)$ , and fixed severity. + +![](images/28e16c7a864e94091fef414bb8c20114b34d74de5f62bf0668f0ecc118b3d66f.jpg) +(a) Contrast + +![](images/7d656b177670807eeaf12ed76ac9d00c3d09d709d68898aabf4757fb4931c15b.jpg) +(b) Defocus blur + +![](images/0066aea3fbd3f32484138360ec13879416dc760ac5d58c88e778ab7fda8fbc1e.jpg) +(c) Elastic transform + +![](images/170bf61608da815c9bdbeb1a90fa6d04c0f504d44a72ae761b367233953d9335.jpg) +(d) Gaussian blur + +![](images/be9e77add80456f9c681132b872cdd5c5bccf10a0934ac909829b273218aef12.jpg) +(e) Gaussian noise +Figure 16: GI-shift with $R = 100$ , $w = 10$ , $\alpha = 1\%$ . All algorithms detect shifts more as the sample shift probability increases. Especially, our algorithm achieves the high detection rate with the shift probability of $40\%$ . + +![](images/4ffcd044bbd91a6bcf6f51f96e1664bb4a64550edcb584a7e723831adc3b2eb1.jpg) +(a) Contrast + +![](images/83f0489a60be2c86d00ea303f74dfd76a3acfce969a359037b6dfb2bff1dfbf1.jpg) +(b) Defocus blur + +![](images/399086b59b656862a3de4727c694407cb399b5cfd0f7456cec545486bf9c4f9d.jpg) +(c) Elastic transform + +![](images/7634c8b5f24c7ce2b8e3abc552e1d25d035dbfe504b7de44be0bd68f597776d7.jpg) +(d) Gaussian blur + +![](images/0276f89c3bef8f2ecd21a71e59e692bb230e672f40cd1da93940412a507826c2.jpg) +(e) Gaussian noise +Figure 17: GI-shift with $R = 100$ , $w = 20$ , $\alpha = 1\%$ . Compared to $w = 10$ (Figure 16), all algorithms show less fluctuations in the detection rate. + +# C.3.3.GID-SHIFT + +Similar to the previous two sections, this section includes figures for the GID-shift scenario with different perturbation with severity 2, and different window sizes $(w)$ . + +![](images/d8af85f0ace1d9fa2876f8acd7f5dc666d4ace9736b24109dbcc989d9dc41b3d.jpg) +(a) Contrast + +![](images/9ff601f527896bc4eb55b31fd069d298c94af15b22a0a5e40281a15015562271.jpg) +(b) Defocus blur + +![](images/e9b86506a669c99385177d6ae8000ac016595ea1c04bb2dc0f65605cc0fc72be.jpg) +(c) Elastic transform + +![](images/186df5bc6733a567b3c889b970ad30121c660e4763c3cf509f9267285e20c9e7.jpg) +(d) Gaussian blur + +![](images/c9ddeb57998ccc6d93ec09a591d55ed89219d959aebaddc9a36851732717cdb2.jpg) +(e) Gaussian noise +Figure 18: GID-shift with $R = 100$ , $w = 10$ , $\alpha = 1\%$ . All algorithms show the highest detection rate when the sample shift probability is $100\%$ . But, only our algorithm reaches the high detection rate even when the shift probability is $40\%$ . + +![](images/2705c390c8d1fcaa05d751016c9a23e15379c81681a5229f005388e94a4ad00a.jpg) +(a) Contrast + +![](images/3a7ed95f79f42a1e75c80073a251727bc4bf41a912694b713850af8b5efd54cb.jpg) +(b) Defocus blur + +![](images/d5e6e26b3f90e7dfb7a18f175f854991f70eb73186cdc4b3a80cd298ac6394ba.jpg) +(c) Elastic transform + +![](images/781559456e8c3140966c320c6a7571f9c60aff5e8a4d05bfbbbf03bb35cfee9f.jpg) +(d) Gaussian blur + +![](images/83ce49818d8a6391e654ec357ec05277b3561aa05a751fd366fb102eb3cfcfc7.jpg) +(e) Gaussian noise +Figure 19: GID-shift with $R = 100$ , $w = 20$ , $\alpha = 1\%$ . Compared to $w = 10$ (Figure 18), all algorithms show the better detection rate with less fluctuations, but, they trigger false positive when the shift disappears, i.e., at $8000^{th}$ samples. + +# C.4. Number of Samples for Detection + +This section presents the required number of samples for detecting covariate shift over repetitions (Rate $\geq 80\%$ ) with different perturbations, severities, and window sizes $(w)$ . + +# C.4.1. M-SHIFT + +Table 6: Number of samples for detection with $R = 100$ , $w = 20$ . The bold and underlined numbers means the best and second best results, respectively. DK always requires the smallest number of samples for high detection rate, and our approach shows second-best result except when severity is 5. However, DK violates the FPR bound as shown in the previous experiments. + +
SeverityAlgorithmsContrastDefocus BlurElastic TransformGaussian BlurGaussian Noise
1Ours300250430360250
H2530430970770410
H54604101010710360
Wald-----
DK250150290230190
KDS-----
ICM470330990570350
2Ours250220240230210
H2430390390410350
H5360360360360310
Wald-2410---
DK190110150130150
KDS-----
ICM350250310290250
3Ours220200230170170
H2330330370290270
H5310310360260260
Wald-1150-9901770
DK150701509090
KDS-----
ICM270190290190210
4Ours170170200140140
H2270290310230230
H5260260260210210
Wald830850-7101390
DK70501107050
KDS-----
ICM190170210150150
5Ours160150170110120
H2250250230190190
H5210210210160160
Wald4106101330470770
DK3050505030
KDS-----
ICM110130150110110
+ +# C.4.2. GI-SHIFT + +Table 7: Number of samples for detection with $R = 100$ , $w = 20$ . The bold and underlined numbers mean the best and second best results, respectively. Our approach always shows the best result while the second best is either H2 or DK. + +
AlgorithmsContrastDefocus BlurElastic TransformGaussian BlurGaussian Noise
Ours21002040210020402050
H228902150261021702190
H541104010411040104010
Wald-----
DK41502130231022302310
KDS-----
ICM40504050405040504050
+ +# C.4.3. GID-SHIFT + +Table 8: Number of samples for detection with $R = 100$ , $w = 20$ . The bold and underlined numbers mean the best and second best results, respectively. Mostly, DK shows the best result while our approach comes next. However, DK violates the FPR bound as shown in the previous experiments. + +
AlgorithmsContrastDefocus BlurElastic TransformGaussian BlurGaussian Noise
Ours620430530470450
H21890990167011701030
H520102010206020102010
Wald-----
DK2110250370330350
KDS-----
ICM20302010205020302030
\ No newline at end of file diff --git a/sequentialcovariateshiftdetectionusingclassifiertwosampletests/images.zip b/sequentialcovariateshiftdetectionusingclassifiertwosampletests/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..594a03e972533dec681fa52c1d64dba5589ef7c9 --- /dev/null +++ b/sequentialcovariateshiftdetectionusingclassifiertwosampletests/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8146acfe9042e335974ecd934378bd67d2b115b33a56d3750fecde048aaf0a62 +size 4163554 diff --git a/sequentialcovariateshiftdetectionusingclassifiertwosampletests/layout.json b/sequentialcovariateshiftdetectionusingclassifiertwosampletests/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..ecc20bb6fd6d3cc28c65b23d7039e1c94b61443e --- /dev/null +++ b/sequentialcovariateshiftdetectionusingclassifiertwosampletests/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:370078f20e57b4dddb99bab4610f0c405c6adfb17e33608e057a88b4cbf44976 +size 1140781 diff --git a/setbasedstochasticsubsampling/e5314a80-26f0-43b1-9f46-e3d5043cdc9d_content_list.json b/setbasedstochasticsubsampling/e5314a80-26f0-43b1-9f46-e3d5043cdc9d_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..5fd78a5253bd33f686bad0df918a7e47323a9b79 --- /dev/null +++ b/setbasedstochasticsubsampling/e5314a80-26f0-43b1-9f46-e3d5043cdc9d_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3976b428ec7a9145b5863420f030852ceb27017b366832b57825eddf0d6de346 +size 145173 diff --git a/setbasedstochasticsubsampling/e5314a80-26f0-43b1-9f46-e3d5043cdc9d_model.json b/setbasedstochasticsubsampling/e5314a80-26f0-43b1-9f46-e3d5043cdc9d_model.json new file mode 100644 index 0000000000000000000000000000000000000000..b052f56b8e1ed85b3e8f046285d615d27db10cc9 --- /dev/null +++ b/setbasedstochasticsubsampling/e5314a80-26f0-43b1-9f46-e3d5043cdc9d_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3f499b496f983aab8117684f4b8f816e3e545a27b1cf0634f754ce1e0b5a9ab4 +size 179301 diff --git a/setbasedstochasticsubsampling/e5314a80-26f0-43b1-9f46-e3d5043cdc9d_origin.pdf b/setbasedstochasticsubsampling/e5314a80-26f0-43b1-9f46-e3d5043cdc9d_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..7a47b247d40380f94f154d44d462475e26346e8e --- /dev/null +++ b/setbasedstochasticsubsampling/e5314a80-26f0-43b1-9f46-e3d5043cdc9d_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:57f3d1af9e8d75c423c3c738d21d63819377aa76734bef234a6696544d0a2d9c +size 9997545 diff --git a/setbasedstochasticsubsampling/full.md b/setbasedstochasticsubsampling/full.md new file mode 100644 index 0000000000000000000000000000000000000000..ade0ee908844ec69cc5fca10554b89c4d05392ba --- /dev/null +++ b/setbasedstochasticsubsampling/full.md @@ -0,0 +1,732 @@ +Bruno Andreis1 Seanie Lee1 A. Tuan Nguyen2 Juho Lee13 Eunho Yang13 Sung Ju Hwang13 + +# Abstract + +Deep models are designed to operate on huge volumes of high dimensional data such as images. In order to reduce the volume of data these models must process, we propose a set-based two-stage end-to-end neural subsampling model that is jointly optimized with an arbitrary downstream task network (e.g. classifier). In the first stage, we efficiently subsample candidate elements using conditionally independent Bernoulli random variables by capturing coarse grained global information using set encoding functions, followed by conditionally dependent autoregressive subsampling of the candidate elements using Categorical random variables by modeling pair-wise interactions using set attention networks in the second stage. We apply our method to feature and instance selection and show that it outperforms the relevant baselines under low subsampling rates on a variety of tasks including image classification, image reconstruction, function reconstruction and few-shot classification. Additionally, for nonparametric models such as Neural Processes that require to leverage the whole training data at inference time, we show that our method enhances the scalability of these models. + +# 1. Introduction + +Deep models operate on large volumes of high-dimensional dense inputs such as the pixels of an image (Deng et al., 2009; Krizhevsky et al., 2009; Liu et al., 2015). Training or evaluating models with such data is computationally expensive and several works (Balin et al., 2019; Huijben et al., 2019; Yoon et al., 2019) have proposed subsampling techniques to subsample such dense inputs. Subsampling + +1Graduate School of AI, Korea Advanced Institute of Science and Technology (KAIST), Seoul, South Korea 2University of Oxford, Oxford, United Kingdom 3AITRICS, Seoul, South Korea. Correspondence to: Bruno Andreis <\andries@kaist.ac.kr>\), Sung Ju Hwang \). + +Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s). + +methods have the potential to drastically reduce the data acquisition effort and reduce the inference time of algorithms that operate on dense inputs. Additionally, subsampling techniques have found applications in medical research for the purpose of interpretation (Ribeiro et al., 2016). + +However, these methods have a major drawback in that they require a fixed input structure. For instance, some of these methods are only applicable when each feature (e.g. a pixel) of the input is 1-dimensional. This restriction is imposed by the way the subsampling methods are designed: the input (e.g. an image) is flattened to a single vector and a model predicts a binary mask for each feature (e.g. pixels). This becomes problematic when we consider a 3-channel image. Flattening out the image results in ambiguities as to which pixels to select since channels are treated independently. For instance, in order to perform subsampling on CIFAR10 images, INVASE (Yoon et al., 2019) and DPS (Huijben et al., 2019) convert the images into single channel images (e.g. grey-scaled images) before subsampling pixels. In more extreme cases such as subsampling of training instances (different from instance-wise feature selection), each feature is itself an image (each possibly multi-channel) and hence those subsampling techniques are inapplicable. Finally, we show in our experiments that most of these methods fail under extremely low subsampling rates and their performance is similar to random sampling in this setting. + +In order to tackle these limitations, we propose to consider each feature or instance as an element of a set. We formulate the subsampling problem as selecting a subset of features or instances that minimizes the performance degradation of an arbitrary model on an arbitrary task such as image classification, regression or instance subsampling for target tasks such as few-shot classification. As a result, there are several advantages compared to the previous works. First, we can handle arbitrary input structure using set functions (Zaheer et al., 2017; Lee et al., 2019) parameterized with expressive neural networks. Second, a subsampling model with set functions can process arbitrary number of elements. As a result, the model is robust to a wide range of subsampling rates at test time even when trained with a fixed sampling rate. Lastly, the set-based formulation unifies the feature and instance subsampling tasks under a single framework. + +However, it is prohibitively expensive to process all the + +![](images/909202f08ce53667c0ed47dcca01db0b274bf45acf44e024b0ec13389cfb8352.jpg) +Figure 1. Concept: Two-stage set-based stochastic subsampling process. (a) In the first stage, we screen out less important samples to construct the candidate subset. (b) In the second stage, we autoregressively subsample from the candidate subset. + +set elements (e.g. all the pixels in an image) with expressive set function such as Set Transformer (Lee et al., 2019) due to the self-attention among elements. Hence we propose an efficient two-stage subsampling method. In the first stage, as shown in Fig. 1-(a), we learn the sampling rate for individual samples and efficiently screen out less important ones resulting in a subset which we call the candidate set. The second stage is more fine-grained and designed to select a smaller subset from the candidate set by considering the relative importance of the samples in the candidate set using a conditionally dependent Categorical distribution through an autoregressive procedure as shown in Fig. 1-(b). Once optimized, the resulting subsampling model can perform stochastic subsampling of a given input with linear time complexity. We call the resulting model Set based Stochastic Subsampling (SSS) which is a general subsampling framework that is applicable to both feature and instance selection. + +We validate SSS on multiple datasets and tasks such as 1D function regression, 2D image reconstruction and classification for both feature and instance selection. The experimental results show that SSS is able to subsample with minimal degradation on the target task performance under extremely low subsampling rates, largely outperforming the relevant baselines. We summarize our contribution as follows. + +- We reformulate the feature and instance subsampling problem by treating all the features or instances as members of a set. This allows us to apply set based functions to the subsampling problem and extend its range of applicability. +- We propose a set based two-stage stochastic subsampling method that learns to efficiently subsample a set with minimal performance degradation on a target task. +- We verify the efficacy and generality of our method on various datasets for feature selection in the input space (e.g. pixels) and instance selection from a dataset, and show that it significantly outperforms the relevant baselines. + +# 2. Related Work + +Set Functions Recently, extensive research efforts have been made in the area of set representation learning with the goal of obtaining order-invariant (or equivariant) and size-invariant representations. Many propose simple methods to obtain set representations by applying non-linear transformations to each element before a pooling layer (Ravanbakhsh et al., 2016; Qi et al., 2017b; Zaheer et al., 2017; Sannai et al., 2019). However, these models have limited expressive power. Other approaches such as Set Transformer (Lee et al., 2019) consider the pairwise interactions among set elements and hence can capture more complex statistics of set distributions. For large sets, the computational cost is expensive due to the self-attention operation. + +Deep Learning Based Subsampling Interest in deep learning based subsampling methods has produced many works mostly applied to feature selection. In Balin et al. (2019), continuous approximation of the Concrete Distribution (Maddison et al., 2017) is used for global feature selection where a fixed set of features are sampled across an entire dataset. In Chen et al. (2018), instance-wise feature selection is used for interpretation of deep learning models applied to medical data. Dovrat et al. (2019) propose learning to subsample by generating virtual points, then matching them back to the original input. Several works (Qi et al., 2017a;c; Li et al., 2018b; Eldar et al., 1997; Moenning & Dodgson, 2003) also propose farthest point sampling, which selects $k$ points from an input by ensuring that the selected samples are far from each other on a metric space. However our work is most similar to the recent works of Yoon et al. (2019) and Huijben et al. (2019) which learn a subsampling model conditioned on an given task. However these models have limitations both in terms of their range of applicability and poor performance under extremely low subsampling rates. Our method on the other hand is flexible, performs well under extremely low subsampling rates, and applicable to a wide range of subsampling problems. + +Image Compression Due to the huge demand for data trans + +fer over the internet, some works attempt to compress images with minimal distortion. These models (Toderici et al., 2017; Rippel & Bourdev, 2017; Mentzer et al., 2018; Li et al., 2018a) typically consist of an encoder and decoder, where the encoder transforms the image with a compact matrix and the decoder reconstructs the image. These methods, while highly successful for the image compression problem, are less flexible than ours. Our model can be applied to arbitrary set structured data while the aforementioned models mainly work for images represented in tensor form. + +Active Learning Active learning aims to select data points for labeling given a small labeled set. This domain is different from ours since active learning does not consider the label information for the selected data points but our method does utilize label information. Also, our motivation is quite different. We focus on optimal subsampling conditioned on an arbitrary task and this greatly differs from the goal of active learning. Methods such as (Sener & Savarese, 2018; Coleman et al., 2020; Wei et al., 2015) all tackle the data selection problem in the active learning setting. + +Core-set Selection Core-set (Feldman, 2020) methods aim at selecting a small weighted subset of a given dataset that approximates the full dataset with theoretical guarantees. They are mostly targeted at instance selection and not, in generally, applicable to feature selection. Although we can utilize our subsampling method, SSS, for some instance selection tasks, our subsampling method, as well as those of Huijben et al. (2019) and Yoon et al. (2019), is not a core-set selection method. Ours is based on a data driven approach, where we leverage expressive neural networks to learn to subsample the most representative subset for various downstream tasks. + +# 3. Approach + +# 3.1. Preliminaries + +We consider a set $D = \{d_i\}_{i=1}^n$ as an input where each $d_i$ either represents an instance-label pair $(x_i, y_i)$ or a feature such as the pixel value of an image. We cast the subsampling problem as the selection of a subset $D_s = \{s_j\}_{j=1}^k \subset D$ with $k \ll n$ such that $\ell(\cdot, D) \approx \ell(\cdot, D_s)$ for an arbitrary loss function $\ell(\cdot, D)$ over the full set $D$ . In order to apply set functions to the subsampling problem, we need to properly design the neural network components to have some symmetrical properties such as permutation invariance (Definition 3.2), equivariance (Definition 3.3), and exchangeability (Definition 3.4). + +Definition 3.1 (Permutation). We say a function $\pi$ is a permutation iff $\pi \in \mathfrak{S}_n = \{f : [n] \to [n] \mid f \text{ is bijective}\}$ . + +Definition 3.2 (Permutation Invariance). We say a function $f: X^n \to Y$ is permutation invariant iff $f(\pi(\mathbf{x})) = f(\mathbf{x})$ for all $\pi \in \mathfrak{S}_n$ and for all $\mathbf{x} \in X^n$ . + +Definition 3.3 (Permutation Equivariance). We say $f: X^n \to Y^n$ is permutation equivariant iff $\pi(f(\mathbf{x})) = f(\pi(\mathbf{x}))$ for all $\pi \in \mathfrak{S}_n$ and for all $\mathbf{x} \in X^n$ . + +Definition 3.4 (Exchangeability). A distribution for a set of random variables $X = \{\mathbf{x}_i\}_{i=1}^n$ is exchangeable if $p(X) = p(\pi(X))$ for all $\pi \in \mathfrak{S}_n$ + +In the following sections, we propose a two-stage Set based Stochastic Subsampling (SSS) method that leverages permutation invariant and equivariant set functions parameterized by $\theta$ to learn the conditional distribution $p_{\theta}(D_s|D)$ . The first stage, candidate selection, and the second stage, autoregressive subset selection, are illustrated in Fig. 1. In general, we estimate the parameters of the subsampling model $\theta$ by minimizing the following loss: $\mathbb{E}_{p(D)}[\mathbb{E}_{p_{\theta}(D_s|D)}[\ell (\cdot ,D_s)]]$ , where $p(\cdot)$ denotes some unknown data distribution. + +# 3.2. Set based Stochastic Subsampling + +To select $D_{s}$ , we propose to model the pairwise interactions among the elements of $D$ and then choose a few representative elements in $D$ based on the relative sample importance computed from the interaction scores. However, when the cardinality of $D$ is large, modeling pairwise interactions becomes computationally infeasible since we need to compare each element in $D$ with all the other elements. This computational bottleneck motivates the first stage of SSS of which the goal is to construct a smaller subset $D_{c}$ , which we refer to as the candidate set, at a coarse level without considering pairwise interaction. We call the first stage candidate selection and the second stage, which is more fine-grained, autoregressive subset selection and selects $D_{s}$ from $D_{c}$ . + +# 3.3. Candidate Selection + +We formulate the candidate selection problem as a random Bernoulli process where the parameters of the Beronulli distribution are conditioned on the set representation of $D$ and the individual elements $d_{i} \in D$ . Specifically, we first encode the set $D$ to a single representation $D_{e}$ with a set encoding function (see Fig. 1-(a)) as follows: + +$$ +D _ {e} = \frac {1}{n} \sum_ {i = 1} ^ {n} g \left(d _ {i}\right), \quad n = | D | \tag {1} +$$ + +where $g$ is a neural network which projects each element in $D$ independently to a lower dimension. $D_{e}$ captures coarse-grained global information in $D$ with computational efficiency. This encoding scheme is similar to DeepSets (Zaheer et al., 2017) except that we do not perform message-passing, which is computationally expensive, between the set elements. + +Proposition 3.5. Given the set $D$ and the affine transformation with non-linearity $g$ , the set encoding $D_{e}$ in Eq. 1 is permutation invariant. + +We then concatenate every $g(d_{i})$ with $D_{e}$ , denoted as $\overline{d_i}$ . That is, $\overline{d_i} = [d_i,D_e]$ , where $[]$ is the concatenation operation. This ensures that each element of $D$ has a global view of all the other elements in the set at a coarse level. For each $d_{i}\in D$ , we sample a mask $z_{i}\sim p_{\theta}(z_{i}|d_{i},D)$ with + +$$ +p _ {\theta} \left(z _ {i} \mid d _ {i}, D\right) = \operatorname {B e r} \left(z _ {i}; \rho (\bar {d} _ {i})\right), \quad \rho (\bar {d} _ {i}) = \sigma (h (\bar {d} _ {i})) \tag {2} +$$ + +where $h$ is a neural network that outputs the logits for the probability that $d_{i}$ is in the candidate set $D_{c}$ and $\sigma(\cdot)$ is the sigmoid function, and Ber denotes the Bernoulli distribution. $z_{i}$ is a binary random variable where $z_{i} = 1$ indicates that $d_{i}$ is an element in $D_{c}$ . We concatenate all $z_{i}$ 's to obtain a single vector $Z = [z_{1},\ldots ,z_{n}]$ . Since sampling from the Bernoulli distribution is not differentiable, during training, we use the continuous relaxations of the Bernoulli distribution (Maddison et al., 2017; Jang et al., 2017; Gal et al., 2017) to sample $z_{i}$ for each $d_{i}$ . This is illustrated as Mask Sampling in Fig. 1-(a). Although pairwise interactions are not considered in this stage, the ablation studies (Appendix D) show that learning $p_{\theta}(z_i|d_i,D)$ leads to selecting highly informative samples compared to random selection of the candidate set $D_{c}$ . + +Constraining the size of $D_{c}$ For computational efficiency, we want to restrict the size of $D_{c}$ to save computational cost when constructing $D_{s}$ . Hence we introduce a sparse Bernoulli prior $p(Z) = \prod_{i=1}^{n} \mathrm{Ber}(z_{i}; r)$ with small $r > 0$ and minimize the KL divergence along with a target downstream task loss $\ell(\cdot, D_{s})$ w.r.t $\theta$ as follows: + +$$ +\mathbb {E} _ {p (D)} \left[ \mathbb {E} _ {p _ {\theta} \left(D _ {s} \mid D\right)} [ \ell (\cdot , D _ {s}) ] + \beta \mathrm {K L} [ p _ {\theta} (Z \mid D) | | p (Z) ] \right] \tag {3} +$$ + +where $p_{\theta}(Z|D) = \prod_{i=1}^{n} p_{\theta}(z_i|d_i, D)$ and $\beta > 0$ is a hyperparameter used to control the sparsity level in $Z$ . + +Proposition 3.6. The candidate selection function which outputs the probability for each element $D$ is permutation equivariant and the probability $p_{\theta}(Z|D)$ is exchangeable. + +# 3.4. Autoregressive Subset Selection + +At this stage in the pipeline, we have a set $D_{c}$ with $m = |D_{c}| \ll |D|$ , which is small enough to perform fine-grained subset selection through pairwise modeling. To select a subset with $k$ elements from $D_{c}$ , we require $k$ iterative steps. As shown in Fig. 1-(b), at time step $t$ , we have the subset $D_{s}^{(t - 1)}$ constructed from the previous iteration with $D_{s}^{(0)} = \emptyset$ and $D_{c}^{(t)} = \{s_{1}^{(t)},\ldots ,s_{mt_{t}}^{(t)}\} = D_{c} \setminus D_{s}^{(t - 1)}$ . Assuming we have a function $\varphi \circ f$ (Set Attention in Fig 1-(b)) for modeling pairwise interactions between the elements of an input set, we autoregressively compute the interaction scores at time step $t$ as follows: + +$$ +\tilde {\pi} ^ {(t)} = (\tilde {\pi} _ {1} ^ {(t)}, \ldots , \tilde {\pi} _ {m _ {t}} ^ {(t)}) = \sigma (\varphi \circ f (D _ {c} ^ {(t)}, D _ {s} ^ {(t - 1)})) \quad (4) +$$ + +where $\sigma (\cdot)$ denotes the sigmoid function and $\varphi \circ f$ is a composition of two neural networks: $f$ computes interaction + +scores between elements in $D_c^{(t)}$ and $\varphi$ outputs elementwise logits using the interaction scores. Further, $\tilde{\pi}^{(t)}$ is the vector of interaction scores for all elements in $D_c^{(t)}$ at the current time step $t$ . Given $\tilde{\pi}_i^{(t)} > 0$ for all $i = 1, \dots, m_t$ , we can compute the probability of an element $s_i^{(t)}$ being selected from $D_c^{(t)}$ as: + +$$ +p _ {\theta} (s _ {i} ^ {(t)} | D _ {c} ^ {(t)}, D _ {s} ^ {(t - 1)}) = \pi_ {i} ^ {(t)}, \quad \pi_ {i} ^ {(t)} = \frac {\tilde {\pi} _ {i} ^ {(t)}}{\sum_ {j = 1} ^ {m _ {t}} \tilde {\pi} _ {j} ^ {(t)}}, \tag {5} +$$ + +where $m_{t} = |D_{c}^{(t)}|$ . That is, we normalize $\tilde{\pi}^{(t)}$ over all the elements in $D_{c}^{(t)}$ at time step $t$ to obtain a valid probability distribution. The key to avoiding redundant elements in $D_{s}$ lies in the fact that for each element added to $D_{s}$ , its selection is conditioned on both the candidate set $D_{c}^{(t)}$ and all the elements in the subset $D_{s}^{(t-1)}$ as described in Eq. 4 & 5. For the choice of the function $f$ , we use a MultiHead Attention Block (MAB) (Lee et al., 2019) which we describe in detail in Appendix I. Additionally, we can stack multiple MABs for the function $f$ to model higher level interactions. + +Proposition 3.7. The functions $\varphi$ and $f$ , and the pairwise interaction score $\tilde{\pi}_t$ are permutation equivariant for all time steps $t$ in the autoregressive subset selection stage. + +With Eq. 5, we can sample an element $s^{(t)} \sim \mathrm{Cat}(\pi_1^{(t)},\ldots ,\pi_{m_t}^{(t)})$ from the candidate subset $D_c^{(t)}$ and construct $D_s^{(t)} = D_s^{(t - 1)} \cup \{s^{(t)}\}$ , where Cat is the Categorical distribution. During training, it can be expensive to sample $k$ times from the Categorical distribution since it involves computing Eq. $4k$ times. We remedy this by selecting $l$ elements from $D_c^{(t)}$ at once, which reduces the number of iterations to $k / l$ for selecting $k$ elements. We may also sample $l$ elements from the multinomial distribution with probability $\pi^{(t)}$ without replacement. However, this sampling procedure is non-differentiable, and hence it cannot be trained with backpropagation. Instead, we independently sample $l$ elements from the continuous relaxation of Categorical distributions (Maddison et al., 2017; Jang et al., 2017) using the same probabilities in Eq. 5 to approximate sampling from the multinomial distribution as shown in Fig. 1-(b). Since we want to simulate sampling without replacement, we discard all elements sampled more than once. This sampling procedure guarantees that we get at most $l$ elements at each iteration. A similar sampling procedure is adopted in previous works (Baln et al., 2019; Chen et al., 2018). We detail this training algorithm in Appendix B. + +Proofs of Propositions 3.5, 3.6 & 3.7 are in Appendix E. + +Time Complexity The time complexity of SSS depends heavily on the choice of the function $f$ . Using MAB as $f$ , the time complexity of SSS is $O(n) + O(k^2 m / l)$ where $n, m, k$ correspond to $|D|, |D_c|$ and $|D_s|$ respectively. + +![](images/d91cc750f29e99ca7cd8a86155a0f65575db57ebce39631fa5278681dbe84f08.jpg) +Figure 2. Target Tasks: (a) Feature selection for reconstruction. (b) Feature selection for prediction. (c) Selection of representative instances. (d) Instance selection for few-shot classification. + +![](images/4434b1662ee7dd63e340cc4ac8499efcfb1582e432d9efde6134fe9cc13f2c4a.jpg) + +![](images/af5778805bfa10e01d10bdf52595473d9acece6b7570b349959acac86cf7906d.jpg) + +![](images/44ba2f517c074364e70a7d66eb2e5f7841aedfd819b736ca091e3b3a10ddb230.jpg) + +# 3.5. Tasks + +Set Classification & Prediction As shown in Fig. 2-(a), we train a neural network parameterized with $\phi$ to predict a single target value $y_{D}$ for the subset $D_{s}$ of the given full set $D$ , where $D$ is a collection of the features from a single instance such as the pixels of an image. For instance, the target $y_{D}$ is either the class of an image for classification or the attributes of a face in an image. Here, our goal is learning to select the most representative subset $D_{s} \subset D$ such that we can maximize the log likelihood $\log p_{\phi}(y_{D}|D_{s})$ with computational efficiency. In order to achieve this goal, we jointly train the SSS model and the neural network which predicts the target value $y_{D}$ for $D_{s}$ to minimize the negative log-likelihood, the loss function $\ell(\cdot, D_{s})$ described in Eq. 3 and KL divergence to enforce sparsity in $Z$ (the selection masks for the candidate set) as follows: + +$$ +\begin{array}{l} \mathbb {E} _ {p (D)} \left[ \mathbb {E} _ {p _ {\theta} \left(D _ {s} \mid D\right)} \left[ - \log p _ {\phi} \left(y _ {D} \mid D _ {s}\right) \right] \right. \tag {6} \\ + \beta \mathrm {K L} [ p _ {\theta} (Z | D) | | p (Z) ] ] \\ \end{array} +$$ + +where $p(Z) = \prod_{i=1}^{n} \operatorname{Ber}(z_i; r)$ with small $r > 0$ . We provide experimental results in Section 4.2 and a corresponding graphical model in Appendix F. + +Set Reconstruction Given a full set $D = \{X,Y\}$ consisting of 2d coordinates $X = \{x_{i}\in \mathbb{R}^{2}\}_{i = 1}^{n}$ and corresponding pixel values $Y = \{y_{i}\in \mathbb{R}^{3}\}_{i = 1}^{n}$ , we want to select the most representative subset $D_{s} = \{X_{s},Y_{s}\mid X_{s}\subset X,Y_{s}\subset Y\}$ to reconstruct all pixel values $y_{i}\in Y$ for each $x_{i}\in X$ , as shown in Fig. 2-(b). We jointly train the SSS model and a neural network with parameters $\phi$ predicting pixel values to minimize the loss function w.r.t $\theta$ and $\phi$ as follows: + +$$ +\begin{array}{l} \mathbb {E} _ {p (D)} \left[ \mathbb {E} _ {p _ {\theta} \left(D _ {s} \mid D\right)} \left[ - \log p _ {\phi} \left(Y \mid X, D _ {s}\right) \right] \right. \tag {7} \\ + \beta \mathrm {K L} [ p _ {\theta} (Z | D) | | p (Z) ] ] \\ \end{array} +$$ + +We enforce sparsity on the subset $D_{s}$ by minimizing the KL-divergence between the mask probability $p_{\theta}(Z|D)$ and sparse prior $p(Z) = \prod_{i=1}^{n} \operatorname{Ber}(z_i; r)$ with small $r > 0$ . Moreover, minimizing the negative log likelihood, which corresponds to $\ell(\cdot, D_s)$ in Eq. 3, ensures that the constructed $D_{s}$ is the most representative for the downstream tasks. We implement $p_{\theta}(Y|X, D_s)$ as an Attentive Neural Process (ANP) (Kim et al., 2019). The ANP takes $D_{s}$ as input + +and predicts a distribution of the elements in the original set $D$ . It mimics the behaviour of a Gaussian Process but with reduced inference complexity. We present experimental results for this task in Section 4.3 and a corresponding graphical model depiction in Appendix F. + +Dataset Distillation: Instance Selection In this task, we are given a collection of datasets $\mathcal{D} = \{D^{(1)},\ldots ,D^{(m)}\}$ with $D^{(i)}\cap D^{(j)} = \emptyset$ for $i\neq j$ and $D^{(i)}\stackrel {iid}{\sim}p(D)$ . The goal is to select the most representative subset $D_{s}^{(i)}$ with $|D_s^{(i)}|\ll |D^{(i)}|$ for each dataset $D^{(i)} = \{d_1^{(i)},\dots,d_n^{(i)}\} \in \mathcal{D}$ , where $d_i^{(i)}$ is a data point uniformly sampled from the entire datasets $\mathcal{D}$ . Using CelebA dataset as an illustrative example, shown in Fig. 2-(c), $D^{(i)}$ consists of $n$ randomly sampled faces from the entire dataset and the task is to construct a subset, $D_{s}^{(i)}$ , most representative of $D^{(i)}$ . + +In order to learn to select the subset $D_{s}$ from each $D \in \mathcal{D}$ with unsupervised learning, we jointly train the SSS model and a generative model such that the SSS model chooses the most representative subset so that the generative model can reconstruct all the images $d_{i} \in D$ from the subset. Naively, we can minimize the sum of negative log-likelihood $\sum_{d_i \in D} -\log p_\phi(d_i|D_s)$ for the loss function $\ell(\cdot, D_s)$ and KL divergence in Eq. 3. However, we find that the generative model outputs mean images for all $d_{i}$ . To capture variations of different images, we introduce three latent variables $\alpha_i, c_i,$ and $w_{i}$ which both depend on $d_{i}$ . We provide graphical model illustration of this task in the Appendix F. Since it is intractable to compute the log likelihood $\log p_{\phi}(d_i|D_s)$ by marginalizing over all the latent variables, we derive the upper bound of the marginal negative log likelihood using variational inference and plug the upper bound into the loss function $\ell(\cdot, D_s)$ in Eq. 3 as follows: + +$$ +\begin{array}{l} \mathbb {E} _ {p (D)} \left[ \mathbb {E} _ {p _ {\theta} \left(D _ {s} \mid D\right)} \left[ \sum_ {d _ {i} \in D} \left[ \mathbb {E} _ {q _ {\psi} \left(w _ {i}, c _ {i} \mid d _ {i}, D _ {s}\right)} \left[ - \log p _ {\phi} \left(d _ {i} \mid w _ {i}, c _ {i}\right) \right] \right. \right. \right. \\ + \mathrm {K L} [ q _ {\psi} (w _ {i} | d _ {i}) | | p _ {\xi} (w _ {i}) ] + \mathrm {K L} [ q _ {\psi} (\alpha_ {i} | d _ {i}) | | p _ {\xi} (\alpha_ {i}) ] \\ \left. \left. + \mathrm {K L} \left[ q _ {\psi} \left(c _ {i} \mid D _ {s}, \alpha_ {i}\right) \mid p _ {\xi} (c _ {i}) \right] \right] + \beta \mathrm {K L} \left[ p _ {\theta} (Z \mid D) \mid p (Z) \right] \right] \tag {8} \\ \end{array} +$$ + +where $p_{\xi}(\cdot)$ are priors on their respective latent variables, $p(Z) = \prod_{i=1}^{n} \operatorname{Ber}(z_i; r)$ is sparse prior with small $r > 0$ + +over the mask for candidate set selection in SSS, $p_{\phi}(\cdot)$ is the decoder to reconstruct $d_{i}$ , and all variational posteriors $q_{\psi}(\cdot)$ are parameterized with neural networks. All priors are the standard normal distribution. + +In summary, we jointly train both the SSS and generative model to minimize the objective in Eq. 8 w.r.t $\theta$ , $\phi$ , and $\psi$ for all $D \in \mathcal{D}$ and leverage the optimized SSS to select a few representative instances of the dataset, which results in distilled dataset. Experimental results are in Section 4.4. + +Dataset Distillation: Classification Finally for the dataset distillation task, we consider the problem of selecting prototypes for few-shot classification as shown in Fig. 2-(d). We adopt Prototypical Networks (Snell et al., 2017) and deploy the SSS model for selecting representative prototypes from the support set for each class. We minimize the objective in Eq. 3, where we use the distance loss induced by the metric space from Prototypical Networks for the target task loss $\ell(\cdot, D_s)$ , to jointly train the Prototypical Networks and SSS. Note that we use $D_s$ , the subset of the support set, for computing loss and prediction. By learning to select the prototypes, we can remove outliers that would otherwise change the decision boundaries in the classification task where we need to predict the label $y_*$ for an unseen instance $x_*$ . Experimental results for this task are in Section 4.4 and its graphical model description is in Appendix F. + +# 4. Experiments + +An extensive Ablation on SSS can be found in Appendix D. + +# 4.1. Baselines + +Feature Selection for Classification We compare SSS with the following models on MNIST. 1) Random Selection: it randomly subsamples features. 2) DPS (Huijben et al., 2019): this model jointly optimizes the sampling parameters along with the parameters of a task model. 3) IN-VASE (Yoon et al., 2019): this model uses actor-critic (Peters & Schaal, 2008) to optimize the parameters of a sampling network and target task model (Section 4.2). + +Additionally, we perform attribute classification on the CelebA dataset using the selected features from a given image. However, we cannot apply DPS and INVASE to this experiment. Since each feature is a tuple of 3-d RGB pixels, flattening these features results in ambiguities as to which features to select with INVASE or DPS. For instance, applying these methods to a 3-channel image can result in some channels being selected by the models, while others are zeroed out. It might lead to the entire pixel being preserved and hence violate the subsampling objective. + +Feature Selection for Reconstruction In Section 4.3 we compare SSS against the followings. 1) Random Selection. + +2) LTS (Dovrat et al., 2019): a model that learns to generate $k$ virtual elements which can be matched to elements in $D$ and optimized for the downstream task. We use LTS for both the function reconstruction and the image reconstruction tasks. DPS and INVASE are not applicable for these tasks since each feature is multi-dimensional. Note that LTS is not applicable for the classification tasks since the virtual points generated by LTS cannot be converted back into image form to serve as input to an image classifier. + +Instance Selection In Section 4.4, we compare SSS with 1) k-Center-Greedy: this algorithm iteratively selects elements in $D$ closest to a set of centroids and 2) FPS: this algorithm iteratively selects the most distant elements to a randomly initialized $D_{s}$ and 3) Random Selection on the instance selection tasks. Here also, DPS, INVASE, and LTS are all inapplicable. + +Multiple Subsampling Rates For all the neural network based baselines (DPS, INVASE, LTS), we train a separate model for every subsampling rate. For instance, to select 15, 20, 25, 30, 50 and 100 pixels from MNIST images in Section 4.2, we need to train 6 different models for DPS, INVASE and LTS each with the corresponding target subsampling rate. However for SSS, we train a single model and vary the sampling rate on each iteration. During evaluation, we use this single model for all the different sampling rates. We find that applying a similar training technique to the baselines result in drastic performance degradation. Thus the set formulation of SSS makes it generalize to varying subsampling rates at test time with train time efficiency. + +![](images/9df18cc8e1e09d50729cfebe7aabc3e9f8bd11f960116e1caf2468674ad98f24.jpg) +(a) +Figure 5. (a) Full-image, (b) Random, (c) DPS, (d) INVASE, (e) SSS. All models select 15 pixels of the original image. Note that under these low subsampling rates, the baseline models end up selecting background pixels as shown in (c) and (d). + +![](images/1bc6ae315f838f83a4078a8fb26e715ac3b51981e693864b58c084c3713a5e55.jpg) +(b) + +![](images/c53c9a23b283540415f09e4a5e499898cd59562c365324ba432284446b4db9a0.jpg) +(c) + +![](images/115f93fe6a18a91db2acc781a34b59d98c0096ecbcb4f52ff426a767a5b73270.jpg) +(d) + +![](images/3f05f648eeab694f9fb766091e7aca4e703c66946410abd85e7b56df2155f918.jpg) +(e) + +# 4.2. Feature Selection for Classification + +In this subsection, we validate our model on the image classification task with feature selection as illustrated in Fig. 2-(a). The goal is to select a subset of pixels of an image and predict the label using the chosen subset. + +MNIST Given an MNIST image with 784 pixels, the task is to subsamlpe 15, 20, 25, 30, 50 and 100 pixels to be used as input to train and evaluate two classification models, a MLP and a ConvNet. We detail the exact architectures in Appendix I.2. Since images in the MNIST dataset have single channel, each feature is of dimension 1 and thus we can train a classifier with DPS or INVASE. We keep the pixels values for the selected pixels and set all the other pixels to zero. Note that we set the subsampling rates to be much lower than the experimental setup in Huijben et al. + +![](images/a62f25a82ffac2cfbecdbdcf3d50803d4282035b13ca4c1ede99dfa4942749cd.jpg) +Figure 3. (a) MNIST Classification. (b) CelebA classification. (c) 1D Function Reconstruction. (d) Image Reconstruction on CelebA. + +![](images/fe78c622e4b91d92186267d2ef2737f69b827060d5314d193469239bb456b997.jpg) +Figure 4. Visualization of 1D function reconstruction with three different subset selection models. + +# (2019) and Yoon et al. (2019). + +As shown in Fig. 3a, SSS significantly outperforms all the baselines with large margin on both the MLP and ConvNet architectures. The MLP is the same architecture used in Huijben et al. (2019). However, we test on the full MNIST test set instead of reserving half the test set for validation as done in Huijben et al. (2019). SSS reaches $89\%$ accuracy using only 15 pixels and shows better performance than the baselines with 100 pixels. Moreover under these low subsampling rates, the performance on the baselines are on par with random selection as shown by the ConvNet results in Fig. 3a. Crucially, the performance of SSS is consistent across both the MLP and ConvNet architectures. DPS, which performs relatively well using the MLP shows poor performance on the same dataset using the ConvNet architecture and we observe similar drop in performance as well for INVASE. + +Lastly, we provide qualitative results in Fig. 5 where we visualize the 15 selected pixels by all the baselines and SSS. Again we find that SSS selects representative pixels (Fig. 5(e)) so that the classifier can predict the correct label of the input image. However, all the baselines tend to select background pixels under these extremely low subsampling rates, which are uninformative for the classification task. + +CelebA The CelebA dataset consists of high-quality images of size $218 \times 178$ . Like the previous experiment, the task is to subsample 100, 200, 300, 400, and 500 pixels from the full 38804 pixels and perform binary classification for 40 attributes of a face. We use the ConvNet architecture described in Appendix I.3 as the classification network. + +We report the mean AUC score on all 40 attributes for varying sizes of $D_{s}$ . Fig. 3b shows that using only 500 pixels + +$(\sim 1.3\%)$ of total pixels in an image), SSS achieves a mean AUC of 0.9093 $(99.3\%)$ of the accuracy obtained with the full image). SSS achieves a significantly higher AUC score than Random Selection, showing the effectiveness of our subset selection method. We also include another baseline, namely SSS-rec. This is the SSS model trained for image reconstruction in the Section 4.3, but then later used for classification without any finetuning. Our model also outperforms this variant, showing the effectiveness of training with the target task. Note that we cannot apply LTS, INVASE, or DPS to this experiment. During training, the virtual points generated by LTS cannot be converted back to an image in matrix form due to the virtual coordinate, thus we cannot train the LTS model with CNN-based classification for this task. For DPS and INVASE, they require the dimension of each feature to be 1, thus it is not applicable to multi-channel images. + +# 4.3. Feature Selection for Regression + +Function Reconstruction Suppose that we have a function $f:[a,b]\to \mathbb{R}$ . We first construct a set of data points with $D = \{(x_{1},y_{1} = f(x_{1})),\ldots ,(x_{n},y_{n} = f(x_{n}))\}$ , where $(x_{1},\dots ,x_{n})$ are uniformly sampled from the interval $[a,b]$ and $f$ is a Gaussian process. We sample $(y_1^{(i)},\dots ,y_n^{(i)})\stackrel {iid}{\sim}\mathcal{N}(0,K_{XX} + \sigma_y^2 I_n)$ for $i = 1,\dots ,N$ where $K_{XX}$ is a squared-exponential kernel with the set of inputs $X = \{x_{1},\dots ,x_{n}\}$ and $\sigma_y^2$ is variance for small likelihood noise. This leads to a collection of sets $(D^{(1)},\dots ,D^{(N)})$ . We train our model which consists of the subset selection model $p_{\theta}(D_s|D)$ and a task network $p_{\phi}(Y|X,D_s)$ , which is an Attentive Neural Process (ANP) (Kim et al., 2019) on this dataset and report the negative log-likelihood (NLL). + +Table 1. FID Score (the lower is the better) with varying the number of instances + +
#Instances2510152030
K-Greedy8.8800 ± 5.58574.4306 ± 1.33134.2199 ± 1.42143.7160 ± 1.13143.2431 ± 1.38812.7554 ± 0.8554
FPS6.5014 ± 4.35024.5098 ± 2.38093.0746 ± 1.09792.7458 ± 0.62012.7118 ± 1.04102.2943 ± 0.8010
Random3.7309 ± 1.16901.1575 ± 0.65320.8970 ± 0.48670.3843 ± 0.21710.3877 ± 0.19060.1980 ± 0.1080
SSS2.5307 ± 1.35831.0186 ± 0.19820.5922 ± 0.31810.3331 ± 0.11690.2381 ± 0.11530.1679 ± 0.0807
+ +Table 2. Accuracy on miniImageNet + +
#Instances125
FPS0.432±0.0050.501±0.0020.598±0.000
Random0.444±0.0030.525±0.0050.618±0.003
K-Greedy0.290±0.0060.413±0.0050.570±0.002
SSS0.475±0.0060.545±0.0110.625±0.006
+ +Fig. 3c shows the performance (NLL) of SSS compared to the baselines, Random Selection and LTS. As shown in Fig. 3c, SSS outperforms the baselines, verifying that the subset selection model $p_{\theta}(D_s|D)$ learns a meaningful distribution over subsets. We visualize a reconstructed function and the selected points by each models in Fig. 4. As shown in the rightmost figure (Fig. 4), SSS tends to pick out more elements (red dots) in the drifting parts of the curve, which is reasonable since those are harder to reconstruct than the others. However, the other baselines sometimes fail to do that, which leads to inaccurate reconstructions. + +CelebA Image Reconstruction Given an image, we learn to select a representative subset of pixels that best reconstructs the original image. Here, $x_{i}$ is the 2d pixel coordinates and $y_{i} \in \mathbb{R}^{3}$ is the RGB pixel value. We use an ANP to reconstruct the remaining pixels from the subset $D_{s} = \{x_{i_{l}},y_{i_{l}}\}_{l = 1}^{k}$ constructed by each subsampling model. We conduct the experiment on the CelebA dataset (Liu et al., 2018). Fig. 3d shows that our model significantly outperforms Random Selection and LTS in terms of NLL. We provide qualitative examples in Appendix G.2. + +Note that LTS performs worse than random selection. We find that the generated coordinates values by LTS are imprecise. This makes matching the virtual points with the original pixel values extremely difficult. Such inaccurate coordinate values result in poor performance as the subsampling rate increases even compared to random subsampling as depicted in Figure 3d. We observe similar pattern in the CIFAR10 reconstruction task presented in Figure 15a in Appendix J. On the other hand, for the function reconstruction task in Section 4.3, the point matching stage in LTS is fairly easy and hence the LTS model shows better performance than random subsampling. + +Efficiency in Nonparametric models In all the experiments where we used an ANP, we greatly improve the inference time complexity. By design, these models need to leverage the full training data at inference time. However by subsampling few highly informative instances, we can efficiently + +perform inference with little degradation in accuracy. Similar gains can be obtained for models in the Neural Process family of models (Garnelo et al., 2018a;b). + +# 4.4. Dataset Distillation + +Instance Selection The goal is to select only a few representative images from a given dataset as described in Section 3.5 and Fig. 2. We split the CelebA dataset into $m$ disjoint sets $\mathcal{D} = \{D^{(1)},\ldots ,D^{(m)}\}$ and jointly train SSS and the generative model to minimize the objective in Eq. 8 with $\mathcal{D}$ . After training, we discard the generative model and leverage the subsampling model to choose a few representative images from the full CelebA dataset. + +We evaluate the selected subset with the Fréchet Inception Distance (FID) (Heusel et al., 2017), which measures similarity and diversity between two datasets and compare SSS to k-Center-Greedy, FPS and Random Selection. We report the experimental results in Table 1 where SSS achieves the lowest FID score for all selection sizes. Specifically, SSS outperforms all the baselines for selecting very few instances since SSS is able to model the interactions within the dataset and hence selects the most representative subset. Additionally, given that the dataset is highly imbalanced, k-Center-Greedy and FPS perform worst since by selecting extreme or similar elements in the given set and cannot capture the true representation of the full dataset. We provide selected images by SSS from the full dataset in Appendix H. + +Classification In this task, we perform few-shot classification with the miniImageNet dataset (Vinyals et al., 2016) where the models select 1, 2, or 5 instances from the support set with size 20. As shown in Table 2, we compare SSS against Random Selection, FPS, and k-Center-Greedy. SSS learns to select more representative prototypes than the others especially for small $D_{s}$ where the choice of prototypes matters more. Notably, the K-Greedy method performs poorly for small subset sizes given that the model overfits to a few samples and does not generalize to unseen examples. We show samples of selected prototypes in Appendix H.1. + +# 5. Conclusion + +In this paper, we reformulated the subsampling problem as the selection of a subset from a set (e.g. features and instances). Based on this reformulation, we proposed a Set based Stochastic Subsampling method that can han + +dle arbitrary input structure as well as variable input set sizes. Additionally, to reduce the cost of modeling pairwise-interactions for large sets, we devised a two-stage subsampling algorithm where we utilize set encoding functions to obtain coarse grained global information in the candidate selection stage followed by a more expressive set interaction network in the autoregressive subset selection stage. We validated the efficacy and generality of our model on various tasks such as feature selection for classification and set reconstruction, instance selection for few shot classification and dataset distillation. We demonstrated that SSS works well and outperforms the relevant baselines. + +# Acknowledgement + +This work was supported by Institute of Information & communications Technology Planning & Evaluation (IITP) grant funded by the Korea government(MSIT) (No.2019-0-00075, Artificial Intelligence Graduate School Program(KAIST)), the Engineering Research Center Program through the National Research Foundation of Korea (NRF) funded by the Korean Government MSIT (NRF-2018R1A5A1059921), Institute of Information & communications Technology Planning & Evaluation (IITP) grant funded by the Korea government(MSIT) (No. 2021-0-02068, Artificial Intelligence Innovation Hub), the National Research Foundation of Korea (NRF) funded by the Ministry of Education (NRF-2021R1F1A1061655), and Institute of Information & communications Technology Planning & Evaluation (IITP) grant funded by the Korea government(MSIT) (No.2022-0-00713). + +# References + +Balin, M. F., Abid, A., and Zou, J. Concrete autoencoders: Differentiable feature selection and reconstruction. In International Conference on Machine Learning, pp. 444-453. PMLR, 2019. +Chen, J., Song, L., Wainwright, M., and Jordan, M. Learning to explain: An information-theoretic perspective on model interpretation. In International Conference on Machine Learning, pp. 883-892. PMLR, 2018. +Coleman, C., Yeh, C., Mussmann, S., Mirzasoleiman, B., Bailis, P., Liang, P., Leskovec, J., and Zaharia, M. Selection via proxy: Efficient data selection for deep learning. In International Conference on Learning Representations, 2020. +Deng, J., Dong, W., Socher, R., Li, L.-J., Li, K., and Fei-Fei, L. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pp. 248-255. IEEE, 2009. +Dovrat, O., Lang, I., and Avidan, S. Learning to sample. In + +Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2760-2769, 2019. +Eldar, Y., Lindenbaum, M., Porat, M., and Zeevi, Y. Y. The farthest point strategy for progressive image sampling. IEEE Transactions on Image Processing, 1997. +Feldman, D. Introduction to core-sets: an updated survey. arXiv preprint arXiv:2011.09384, 2020. +Gal, Y., Hron, J., and Kendall, A. Concrete dropout. In Advances in neural information processing systems, pp. 3581-3590, 2017. +Garnelo, M., Rosenbaum, D., Maddison, C., Ramalho, T., Saxton, D., Shanahan, M., Teh, Y. W., Rezende, D., and Eslami, S. A. Conditional neural processes. In International Conference on Machine Learning, pp. 1704-1713. PMLR, 2018a. +Garnelo, M., Schwarz, J., Rosenbaum, D., Viola, F., Rezende, D. J., Eslami, S., and Teh, Y. W. Neural processes. arXiv preprint arXiv:1807.01622, 2018b. +Heusel, M., Ramsauer, H., Unterthiner, T., Nessler, B., and Hochreiter, S. Gans trained by a two time-scale update rule converge to a local nash equilibrium. In Advances in neural information processing systems, pp. 6626-6637, 2017. +Huijben, I. A., Veeling, B. S., and van Sloun, R. J. Deep probabilistic subsampling for task-adaptive compressed sensing. In International Conference on Learning Representations, 2019. +Jang, E., Gu, S., and Poole, B. Categorical reparameterization with gumbel-softmax. In 5th International Conference on Learning Representations, 2017. +Kim, H., Mnih, A., Schwarz, J., Garnelo, M., Eslami, A., Rosenbaum, D., Vinyals, O., and Teh, Y. W. Attentive neural processes. In International Conference on Learning Representations, 2019. +Krizhevsky, A., Nair, V., and Hinton, G. Cifar-10 and cifar-100 datasets. URL: https://www.cs.toronto.edu/kriz/cifar.html, 2009. +Lee, J., Lee, Y., Kim, J., Kosiorek, A., Choi, S., and Teh, Y. W. Set transformer: A framework for attention-based permutation-invariant neural networks. In International Conference on Machine Learning, pp. 3744-3753. PMLR, 2019. +Li, M., Zuo, W., Gu, S., Zhao, D., and Zhang, D. Learning convolutional networks for content-weighted image compression. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 3214-3223, 2018a. + +Li, Y., Bu, R., Sun, M., Wu, W., Di, X., and Chen, B. Pointcnn: Convolution on x-transformed points. In Advances in neural information processing systems, pp. 820-830, 2018b. +Liu, Z., Luo, P., Wang, X., and Tang, X. Deep learning face attributes in the wild. In Proceedings of International Conference on Computer Vision (ICCV), December 2015. +Liu, Z., Luo, P., Wang, X., and Tang, X. Large-scale celebfaces attributes (celeba) dataset. Retrieved August, 2018. +Maddison, C. J., Mnih, A., and Teh, Y. W. The concrete distribution: A continuous relaxation of discrete random variables. In 5th International Conference on Learning Representations, 2017. +Mentzer, F., Agustsson, E., Tschannen, M., Timofte, R., and Van Gool, L. Conditional probability models for deep image compression. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4394-4402, 2018. +Moenning, C. and Dodgson, N. A. Fast marching farthest point sampling. Technical report, University of Cambridge, Computer Laboratory, 2003. +Peters, J. and Schaal, S. Natural actor-critic. Neurocomputing, 71(7-9):1180-1190, 2008. +Qi, C. R., Su, H., Mo, K., and Guibas, L. J. Pointnet: Deep learning on point sets for 3d classification and segmentation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 652-660, 2017a. +Qi, C. R., Su, H., Mo, K., and Guibas, L. J. Pointnet: Deep learning on point sets for 3d classification and segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 652-660, 2017b. +Qi, C. R., Yi, L., Su, H., and Guibas, L. J. Pointnet++: Deep hierarchical feature learning on point sets in a metric space. In Advances in neural information processing systems, pp. 5099-5108, 2017c. +Ravanbakhsh, S., Schneider, J., and Poczos, B. Deep learning with sets and point clouds. arXiv preprint arXiv:1611.04500, 2016. +Ribeiro, M. T., Singh, S., and Guestrin, C. "why should i trust you?" explaining the predictions of any classifier. In Proceedings of the 22nd ACM SIGKDD international conference on knowledge discovery and data mining, pp. 1135-1144, 2016. +Rippel, O. and Bourdev, L. Real-time adaptive image compression. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 2922-2930. JMLR.org, 2017. + +Sannai, A., Takai, Y., and Cordonnier, M. Universal approximations of permutation invariant/equivariant functions by deep neural networks. arXiv preprint arXiv:1903.01939, 2019. +Sener, O. and Savarese, S. Active learning for convolutional neural networks: A core-set approach. In International Conference on Learning Representations, 2018. +Snell, J., Swersky, K., and Zemel, R. Prototypical networks for few-shot learning. In Advances in neural information processing systems, pp. 4077-4087, 2017. +Toderici, G., Vincent, D., Johnston, N., Jin Hwang, S., Minnen, D., Shor, J., and Covell, M. Full resolution image compression with recurrent neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 5306-5314, 2017. +Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, L., and Polosukhin, I. Attention is all you need. In NIPS, 2017. +Vinyals, O., Blundell, C., Lillicrap, T., Wierstra, D., et al. Matching networks for one shot learning. In Advances in neural information processing systems, pp. 3630-3638, 2016. +Wei, K., Iyer, R., and Bilmes, J. Submodularity in data subset selection and active learning. In International Conference on Machine Learning, pp. 1954-1963, 2015. +Yoon, J., Jordon, J., and van der Schaar, M. INVASE: Instance-wise variable selection using neural networks. In International Conference on Learning Representations, 2019. +Zaheer, M., Kottur, S., Ravanbakhsh, S., Poczos, B., Salakhutdinov, R. R., and Smola, A. J. Deep sets. In Advances in neural information processing systems, pp. 3391-3401, 2017. + +# A. Organization + +Organization The Appendix is organized as follows: first, we describe the pseudo-code for the Training Algorithm, then provide ablation for each components of our method and proofs for propositions described in Section 3. Finally, we illustrate the generative process of each task using graphical models and and additional experimental results with detailed elaboration on experimental setups. + +Algorithm 1 Greedy Training Algorithm +Input $k$ (max subset size) + $m$ (mini-batch size) + $p(D)$ (distribution of sets) + $\alpha$ (learning rate) + $\ell (\cdot ,D_s)$ (loss function) +Output trained models with $\theta$ and $\phi$ +1: Randomly initialize parameter of SSS $\theta$ and downstream task model $\phi$ +2: while not converged do +3: Sample $m$ sets $D^{(1)},\ldots ,D^{(m)}$ from $p(D)$ +4: Sample $Z^{(j)} = \{z_1^{(j)},\dots,z_n^{(j)}\} \sim p_\theta (Z|D^{(j)})$ for $j = 1,\dots,m$ +5: Construct $D_{c}^{(j)} = \{d_{i}^{(j)}\in D^{(j)}:z_{i}^{(j)} = 1\}$ for $j = 1,\dots,m$ +6: Sample integer $l\sim \mathrm{Unif}[1,k]$ +7: $D_{s}^{(j)}\gets$ select $l$ -elements from $D_{c}^{(j)}$ (with the autoregressive model) +8: $\theta \leftarrow \theta -\alpha \nabla_{\theta}\frac{1}{m}\sum_{j = 1}^{m}\ell (\cdot ,D_{s}^{(j)})$ +9: $\phi \leftarrow \phi -\alpha \nabla_{\phi}\frac{1}{m}\sum_{j = 1}^{m}\ell (\cdot ,D_{s}^{(j)})$ +10: end while + +# B. Training Algorithm + +In order to reduce the computational cost at training time, we use a greedy training algorithm with stochastic gradient descent as described in Algorithm 1. First, we uniformly sample an integer $l$ from $\{1, \dots, k\}$ , which is the subset size for a given mini-batch. Then we select $l$ elements for $D_S$ from the candidate set at once using the autoregressive selection model. Finally, we perform gradient descent with respect to the parameters of SSS model $\theta$ and target task network $\phi$ to minimize the target task loss on the selected subset $D_s$ . As a result, we do not have to run the autoregressive model $k$ time during training, which significantly reduces the computational cost during training. + +# C. Fixed-size Subset Selection + +At test time, we run the fixed size subset selection algorithm to choose the most task relevant elements from the set $D$ as described in Algorithm 2. We do not use the greedy training algorithm. Instead, we autoregressively select $k$ + +Algorithm 2 Fixed Size Subsampling. $k$ is the subset size. $l$ is the number of elements to select at each iteration. $D$ is the full set and $D_s \subset D$ is the final subset after running SSS. + +1: Input: $k, l, D = \{d_1, \dots, d_n\}$ +2: Output: $D_{s} = \{s_{1},\dots ,s_{k}\}$ +3: function $\mathrm{SSS}(k,l,D)$ +4: $D_{e}\gets \frac{1}{n}\sum_{i = 1}^{n}g(d_{i})$ +5: $\overline{d_i}\gets \operatorname {Concat}(g(d_i),D_e)$ +6: $z_{i}\sim \mathrm{Ber}(z_{i};\rho (\overline{d_{i}})$ for $i = 1,\ldots ,n$ +7: $D_{c}\gets \{d_{i}\in D\mid z_{i} = 1,1\leq i\leq n\}$ +8: $D_{s}\gets \emptyset$ +9: for $t = 1$ to $k / l$ do +0: $D_{s}\gets D_{s}\cup \mathrm{AUTOSELECT}(l,D_{s},D_{c})$ +11: end for +12: end function +13: function AUTOSELECT $(l, D_s^{(t-1)}, D_c)$ +14: $D_{c}^{(t)} = \{s_{1}^{(t)},\ldots ,s_{m_{t}}^{(t)}\} \gets D_{c}\setminus D_{s}^{(t)}$ +15: $\tilde{\pi}_i^{(t)}\gets \sigma (\varphi \circ f(s_i,D_s^{(t - 1)}))$ +16: $(\pi_1^{(t)},\ldots ,\pi_{m_t}^{(t)})\gets \frac{1}{\sum_{j = 1}^{m_t}\tilde{\pi}_j^{(t)}}(\tilde{\pi}_1^{(t)},\ldots ,\tilde{\pi}_{m_t}^{(t)})$ +17: $Q\gets$ Sample $l$ elements from $D_c^{(t)}$ with the probability $\pi^{(t)}$ +18: return $Q$ +19: end function + +elements from the candidate set $D_{c}$ as described in line 13 from Algorithm 2 to construct the representative subset $D_{s}$ . + +# D. Ablation + +We perform extensive ablation studies on the two-stage Set based Stochastic Susbsampling method using the function reconstruction tasks presented in Section 4.3. First, we explore the contribution of the candidate selection and autoregressive subset selection stages. Then, we verify the importance of stochasticity in SSS. + +Random Selection with Autoregressive Subset Selection To show the importance of the candidate selection stage of SSS, we replace it with random selection (labelled Random + Stage 2 in Fig. 2). As shown in Fig. 6, we find that while this model performs better than the model with only candidate selection, it performs worse than SSS (red line in Fig. 6) and the autoregressive subset selection stage used alone (green line in Fig. 6). We provide visualizations of the reconstructed functions in the second column of Fig. 8. Random selection in place of the candidate selection can ignore elements from certain parts of the function and hence the autoregressive selection model cannot select elements from those regions for reconstruction. In short, filtering elements with candidate selection helps the autoregressive selection model to choose more informative instances from + +![](images/ee798a07dfc54305d0ba4ffaee042b730f6f969536ece74fac60b54aad6fbe97.jpg) +Figure 6. Ablation on SSS. + +Table 3. CelebA Attributes Classification. + +
Model# PixelsStoragemAUC
Full ImageAll 38804114KB0.9157
RS5005KB0.8471
SSS(rec)5005KB0.8921
SSS(MC)5005*5KB0.9132
SSS(ours)5005KB0.9093
+ +the input set than random selection. + +AutoRegressive Subset Selection Only As shown in Fig. 6 we observe that the autoregressive subset selection model (labelled Stage 2 Only in Fig. 6) performs significantly better than the SSS model with candidate selection and autoregressive selection stage. Qualitative results are provided in third column of Fig. 8. While this model performs well, it is not very practical due to the high computational cost when the size of the set becomes large. + +Candidate Selection Only In order to validate the importance of the autoregressive selection stage, we construct a subset using only the candidate selection stage. As shown in Fig. 6 (labelled Stage 1 Only), removing the autoregressive selection stage significantly degrades the performance of the SSS model. In the first column of Fig. 8, the model without autoregressive selection significantly underperforms compared to SSS since it heavily focuses on the drifting parts of the function and ignores the other parts of curve. In sum, it is not always desirable to select only highly activating samples in the set without considering any dependencies among the others since it may choose redundant elements. + +Generally, we find that SSS performs better than the variants considered here and provide a better tradeoff between model performance and computational requirements. + +Stochasticity of SSS Since our method is stochastic with the following predictive distribution: $\mathbb{E}_{p_{\theta}(D_s|D)}[p_{\phi}(y_D|D_s)]$ , we approximate it with Monte + +![](images/6f9116bd1612a53fb35b1b45bb071928646ebfe52d32dcc61d790898bea40392.jpg) +Figure 7. Accuracy with varying subset size and the number of particles for MCMC. + +Carlo sampling as follows: + +$$ +\mathbb {E} _ {p _ {\theta} \left(D _ {s} \mid D\right)} \left[ p _ {\phi} \left(y _ {D} \mid D _ {s}\right) \right] \approx \frac {1}{n} \sum_ {i = 1} ^ {n} p _ {\phi} \left(y _ {D} \mid D _ {s} ^ {(i)}\right), \tag {9} +$$ + +where $D_s^{(i)} \stackrel{i.i.d.}{\sim} p_\theta(D_s|D)$ , + +However in all experiments, we only report the result with one sampled subset, since it gives the best trade-off between computational cost and accuracy. We compare SSS against another variant, SSS-MC, which use 5 sampled subsets for MC sampling. As shown in Fig. 3b, it obtains a mean AUC of $91.32\%$ , which is slightly better than SSS which achieves $90.93\%$ . Note SSM-MC increases the computational cost (inference) and memory requirement up to 5 times as shown in Table 3. The result justifies the inference procedure of SSS which achieves good performance for the target tasks with memory and computational efficiency. + +Additionally, in Figure 7 we show how the uncertainty of SSS decreases as we increase the subset size. For each subset size, we draw 5 different subsets from the subsampling model trained on the MNIST classification task described in Section 4.2 and average the predictions of the sampled subsets. This requires 5 forward pass of the model. At a subsampling rate of 50, the model with a single subset shows similar performance with the one with multiple draws of subsets. + +Cost of Running SSS We report the cost of running SSS for pixel subsampling, which has the largest set size (38804 pixels). In this experiment, we select 500 pixels in total with $l = 20$ , i.e., we select 20 pixels at once in the second stage described in Section 3.4. We measure the FLOPS and memory requirements for the forward pass of SSS. We find that the computational cost of running SSS is 8.38 GMac (40% of the FLOPS for the full model which is 20 GMac) with 217.09k memory requirement (compared to 958.85k for the full model) which shows that SSS is computationally cheap to run. + +![](images/f49ebc361bfc16f3642908dfff78d354a17c588ed4556ca8bf6b1f98b8af3a34.jpg) +Figure 8. Ablation: Visualization of 1D function reconstruction. In the ablation studies, we compare the first stage (CAND) and the second stage (AUTO) with SSS. Additionally, we replace the Candidate Selection stage (Stage 1) in SSS with random selection (RANAUTO) and compare the performance of these models. As can be seen from the visualized reconstructed outputs, the combination of the Candidate Selection stage with the Autoregressive stage results in the best subset selection for the reconstruction task. + +# E. Proofs + +Definition E.1. Let $\mathfrak{S}_n\coloneqq \{g:[n]\to [n]\mid g$ is bijective} be a set of all permutation on $n$ , where $[n]\coloneqq \{1,\ldots ,n\}$ . We say $f:X^n\rightarrow Y$ is permutation invariant if and only if for any permutation $\pi \in \mathfrak{S}_n$ , $f(\pi (\mathbf{x})) = f(\mathbf{x})$ for all $\mathbf{x}\in X^n$ . + +Definition E.2. Let $\mathfrak{S}_n\coloneqq \{g:[n]\to [n]\mid g$ is bijective} be a set of all permutation on $n$ , where $[n]\coloneqq \{1,\dots ,n\}$ . We say $f:X^n\rightarrow Y^n$ is permutation equivariant if and only if for any permutation $\pi \in \mathfrak{S}_n$ , $\pi (f(\mathbf{x})) = f(\pi (\mathbf{x}))$ for all $\mathbf{x}\in X^n$ . + +Proposition E.3. Let $D = \{d_{i} \in \mathbb{R}^{d} \mid i = 1, \dots, n\}$ be a finite set and let $g$ be an affine transformation with nonlinearity. Define a function $k(d_{1}, \ldots, d_{n}) \coloneqq \frac{1}{n} \sum_{i=1}^{n} g(d_{i})$ . Then the set encoding $D_{e} = k(d_{1}, \ldots, d_{n})$ is permutation invariant. + +Proof. Let a permutation $\pi \in \mathfrak{S}_n$ be given. + +$$ +\begin{array}{l} k \left(d _ {1}, \dots , d _ {n}\right) = \frac {1}{n} \sum_ {i = 1} ^ {n} g \left(d _ {i}\right) \\ = \frac {1}{n} \sum_ {i = 1} ^ {n} g \left(d _ {\pi (i)}\right) \tag {10} \\ = k \left(d _ {\pi (1)}, \dots , d _ {\pi (n)}\right) \\ \end{array} +$$ + +![](images/7fe39d53442f8bd681be580b38c48ee4f8cd2918f20157e9ab267b7e77b686fe.jpg) + +Proposition E.4. Let $f: X^n \to Y^n$ and $g: Y^n \to Z^n$ be permutation equivariant functions. Then the composition of two function $g \circ f$ is permutation equivariant function. + +Proof. Suppose that $f$ and $g$ are permutation equivariant. Let $\pi \in \mathfrak{S}_{\mathfrak{n}}$ be permutation. We want to show $\pi((g \circ f)(\mathbf{x})) = (g \circ f)(\pi(\mathbf{x}))$ for all $\mathbf{x} \in X^n$ . Let $\mathbf{x} \in X^n$ be given. + +$$ +\begin{array}{l} (g \circ f) (\pi (\mathbf {x})) = g (f (\pi (\mathbf {x}))) \\ = g (\pi (f (\mathbf {x}))) \tag {11} \\ = \pi (g (f (\mathbf {x}))) \\ = \pi ((g \circ f) (\mathbf {x})) \\ \end{array} +$$ + +The second and third equality holds since $f$ and $g$ are permutation equivariant. + +Proposition E.5. Let $\zeta : X^n \to Y^n$ be a function, mapping $(d_1, \ldots, d_n) \mapsto (\rho(\overline{d}_1), \ldots, \rho(\overline{d}_n))$ for candidate selection. Then $\zeta$ is permutation equivariant. + +Proof. Let a permutation $\pi \in \mathfrak{S}_n$ be given and let $\mathbf{x} =$ + +$(d_{1},\ldots ,d_{n})$ be given. + +$$ +\begin{array}{l} \zeta (\pi (\mathbf {x})) = \left(\rho (\bar {d} _ {\pi (1)}), \dots , \rho (\bar {d} _ {\pi (n)})\right) \\ = \left(\sigma \left(h \left(\bar {d} _ {\pi (1)}\right)\right), \dots , \sigma \left(h \left(\bar {d} _ {\pi (n)}\right)\right)\right) \\ = \left(\sigma \left(h \left(d _ {\pi (1)}; D _ {e}\right)\right), \dots , \sigma \left(h \left(d _ {\pi (n)}; D _ {e}\right)\right)\right) \\ = \pi \left(\sigma \left(h \left(d _ {1}; D _ {e}\right)\right), \dots , \sigma \left(h \left(d _ {n}; D _ {e}\right)\right)\right) \\ = \pi (\zeta (\mathbf {x})) \tag {12} \\ \end{array} +$$ + +where ; denotes concatenation of two vectors and $D_{e} = \frac{1}{n}\sum_{i=1}^{n}g(d_{i})$ . $g(\cdot)$ and $h(\cdot)$ affine transformation followed by non-linear activation. Since element-wise operations $h(\cdot), \sigma(\cdot)$ are permutation equivariant and $(d_{1},\ldots,d_{n}) \mapsto (d_{1};D_{e},\ldots,d_{n};D_{e})$ is permutation equivariant, composition of those functions is also permutation equivariant by Proposition E.4. Therefore, fourth equality holds, i.e., $\zeta$ is permutation equivariant. + +Proposition E.6. The probability $p_{\theta}(Z|D)$ induced by candidate selection function is exchangeable. + +Proof. Let a permutation $\pi \in \mathfrak{S}_n$ be given. + +$$ +\begin{array}{l} p _ {\theta} (Z | D) = \prod_ {i = 1} ^ {n} p _ {\theta} \left(z _ {i} \mid d _ {i}, D\right) (13) \\ = \prod_ {i = 1} ^ {n} \rho \left(d _ {i}; D _ {e}\right) (14) \\ = \prod_ {i = 1} ^ {n} \rho \left(d _ {\pi (i)}; D _ {e}\right) (15) \\ = \prod_ {i = 1} ^ {n} p _ {\theta} \left(z _ {\pi (i)} \mid d _ {\pi (i)}, D\right) (16) \\ = p _ {\theta} (\pi (Z) | D) (17) \\ \end{array} +$$ + +where $D_{e} = \frac{1}{n}\sum_{i = 1}^{n}g(d_{i})$ and ; denotes concatenation of two vectors. Equality in 15 holds since $D_{e}$ is permutation invariant and $\rho$ is element-wise operation. + +Proposition E.7. Let $f$ be a stack of multi-head attention blocks from Set Transformer (Lee et al., 2019) and let $\varphi$ be affine transformation. For all time step $t$ in autoregressive selection, the functions $f, \varphi$ , and $\sigma \circ \varphi \circ f$ are permutation equivariant, where $\sigma$ is sigmoid function. + +Proof. Since each multi-head attention block in $f$ is permutation equivariant, a stack of the blocks is also permutation equivariant by Proposition E.4. Since we apply $\varphi$ independently to each element in a set, $\varphi$ is permutation equivariant. Similarly, $\sigma$ is permutation equivariant since it is an element-wise operation. As a result, $\sigma \circ \varphi \circ f$ is permutation equivariant again by Proposition E.4. + +![](images/332dbb8a900da0919f16c8e2c5fcda7fb700836aa65de847dbbd77b9386d4caa.jpg) +(a) + +![](images/9fbf5a662b71766fe2c0cc11bd6911d95d772a21cb5f7501df6849a649697e7f.jpg) +(b) +Figure 9. Graphical Models: (a) Feature selection for reconstruction. (b) Feature Selection for prediction task. (c) Instance selection for representative data points. (d) Instance selection for few-shot classification. + +![](images/3e34317aa06e7aa70a4069c0cff36c5502873edb4b50dcd1e45fc5f65b3361f6.jpg) +(c) + +![](images/b929e183a42718677fbec40e32a89663287ed0093437041b8ea100789aec69f1.jpg) +(d) + +# F. Graphical Model + +In Figure 9, we illustrate the generative process using graphical models for each tasks — (a) feature selection for set reconstruction, (b) feature selection for prediction (c) Instance selection for representative data points and (d) instance selection for few-shot classification. The shaded circles denote observed variables and the others latent variables. + +# G. Instance Selection Samples + +In this section, we show more qualitative examples for the 1D and CelebA experiments on how the models subsamples elements of the given set for the target task. + +# G.1. 1D Function - Reconstruction + +Figure 10 shows the reconstruction samples of our model on the 1D function dataset, where SSS clearly outperforms Learning to Sample (LTS) and Random Subset (RS). Since RS selects the points randomly, it can leave out important part of the 1D curve leading to wrong reconstructions. Similarly, LTS also miss some parts of the curves, resulting in suboptimal reconstructions. + +# G.2. CelebA + +Figure 11 shows samples of reconstructed images while varying the number of selected pixels. Additionally in Figure 12, we show the selected pixels of our model for both the classification and reconstruction task. For the attribute classification task, the model tends to select pixels mainly from the face, since the task is to classify characteristics of the person. For reconstruction, the selected pixels are more evenly distributed, since the background also contributes significantly to the reconstruction loss. + +# H. Dataset Distillation: Instance Selection + +For the instance selection experiments, we construct a set by randomly sampling 200 face images from the full dataset. To evaluate the model, we create multiple such datasets and run the baselines (Random Sampling, K-Center Greedy and + +FPS) and SSS on the same datasets. We compute the FID metric (Heusel et al., 2017) on the instances and averaged on all the randomly constructed datasets. For FPS, we use the open-source implementation in https://github.com/rustyls/pytorch_cluster. Further, we provide qualitative results on a single dataset in Figure 13 where our model picks 5 instances from the full set of 200 face images. + +# H.1. Dataset Distillation: Classification + +In Figure 14 we provide visualizations for the instance selection problem as applied to the few-shot classification task. Here, we go from a 20-shot to a 1-shot classification problem where the prototype is selected from the support using SSS. The selected subset is then used in place of the support set and used to classify new query instances. + +# I. Model Specifications + +In this section, we describe the main components of our Set based Stochastic Sumbsampling models — $g(d), \rho(\overline{d})$ and $\varphi \circ f(D_c^{(t)}, D_s^{(t-1)})$ . + +For all the experiments, we design $g$ as feedforward neural network with ReLU to project each instance $d$ to lower dimension and average them to obtain the set representation $D_{e}$ , following DeepSets (Zaheer et al., 2017). + +We parameterize $\rho(\cdot)$ with a 3 layered feedforward neural network $h$ followed by sigmoid function as described in Equation 2 from Section 3.3. For $f$ , we use the function $g$ in Eq. 1 to extract feature map for each instances in $D_c^{(t)}, D_s^{(t-1)}$ and feed it to set transformer (Lee et al., 2019) for set classification as follows: + +$$ +f \left(D _ {c} ^ {(t)}, D _ {s} ^ {(t - 1)}\right) = \operatorname {M A B} \left(D _ {c} ^ {(t)}, D _ {s} ^ {(t - 1)}\right) +$$ + +$$ +\mathrm {M A B} \left(D _ {c} ^ {(t)}, D _ {s} ^ {(t - 1)}\right) = \text {L a y e r N o r m} (H + \mathrm {r F F} (H)) +$$ + +$$ +H = \operatorname {L a y e r N o r m} \left(D _ {c} ^ {(t)} + \operatorname {M u l t i h e a d} \left(D _ {c} ^ {(t)}, D _ {s} ^ {(t - 1)}, D _ {s} ^ {(t - 1)}\right)\right) \tag {18} +$$ + +where rFF is a row-wise feedforward layer which processes each instance independently and Multihead denotes Mul + +![](images/2750dd741da86e4b2e47b9b375ff023e86043ec37cb9dc14807e1769f5abc518.jpg) +Figure 10. Visualization of 1D function reconstruction with three different subset selection models. Each method selects 15 out of 400 elements. As can be seen, SSS selects elements that result in better reconstructed functions. + +![](images/c92a4d9bbc63dccea01ca8f3a80e4d330d1f44ec3b74f0a649b3cce322e5ebc5.jpg) +SSS + +![](images/adcb61925631d961a48a717bbdd0ad507fbaa140f6d880ef76e9f6edb3953f0a.jpg) +LTS + +![](images/4a0765fb230831977b444b869c48e5cca1baf88942503102a98973e3c8d21a98.jpg) +Random + +![](images/40b60a76775dddb8dd55159639a9ce48072bc34839329d3ee5e03648222ae60b.jpg) +Original + +![](images/6661e7477be12c83c182de5b534cbac65a9ec999ec755da7535b25fcdeb62171.jpg) +sss + +![](images/84052bdfe69e47a2f39342d5b32448ee7d143794ff17f4e7d375f7c9f476182e.jpg) +LTS + +![](images/c5069e2592ef89a37193974dc76acb7bb18f3f183b6a0b3b6eee1e7b64df7c65.jpg) +Random + +![](images/874e400e8e6d998278ddc615df6daf1f2e3c299db1adb5e931bcfb16aa09435e.jpg) + +![](images/d9594c62d7f581e8e2ec00c55892ad22ac932ec44b5c4dcb3b9270cde2b2aba9.jpg) +sss + +![](images/276e4ca27df06637eb4ac8e3a2b1a4bd69668689e4d5a60bfe9716d268593680.jpg) +LTS + +![](images/50347d38e27c27955d66a1327940cc1948477453ee08c0368a3708b5e6753ea1.jpg) +Random + +![](images/082865441c570063ed524266315e57fb29bf74612ea5cbe6d414d760d62518bd.jpg) +Original +Original + +![](images/681c564549b3908b737de2cb9649e148672bb3144c0b8ec064893cb186206611.jpg) +sss + +![](images/c9180734e96e5099026b3203ef7b83f1aa37a42280c9c6ca132ba8584167c5f4.jpg) +LTS + +![](images/36bcbdc4f6228f5ca70930566db495444818310ac4aa1e0dd2237c23eac8f6a6.jpg) +Random + +![](images/350f689d1cf8c281ddab11485e5341de0778f122745e3aa3f172612b6bbcd399.jpg) +Original + +![](images/224d5493246d211feef76194b0315db545e41c35bd16f8d1f16a694e7a6636b1.jpg) +SSS + +![](images/2c8c060fbe5432e1f1d3f873e6774ecc1e4674ef141baa11bfec8f32b31247aa.jpg) +LTS + +![](images/014c7efea3c672825ef59d5f8b528d35563af87d291ab79823c001b34397a5a8.jpg) +Random + +![](images/e3b53baf55c8dcfecc6bfd8ef4a271fb0f607eaa1be94cc5d5c964f9b9dbcc4b.jpg) +Original + +![](images/aad5e87cb017ec97cbcf3236b42c62b18f794d8129eb05c5e0c9caf82184a8ac.jpg) +SSS + +![](images/db488c3da0be20879ffc87f11f5b9b76737e57417c6c492a69317acc733187f3.jpg) +LTS + +![](images/f10cd27f1bd9987c9d209a080f862d5e093e12ef83997115533d6a768b24f9f9.jpg) +Random + +![](images/c94c535dd6ce5d085f6ff0cc0934d5a9a927ea83e9d676fb9827cae13776536d.jpg) + +![](images/9c7790447accdbefb2607a6d53d6d52a0e86a809f8fbedf7240f8b0c77b13982.jpg) +sss + +![](images/47b8c321070080ad7583f39b845cce8a2b8a2d2fc37cc8d676f8de3893039096.jpg) +LTS + +![](images/d0471be1a30f6ef07b93f7ff3673307b45e5c086afe246d841a9a2849e10fd5f.jpg) +Random + +![](images/bb520e64e1fd685018144e49ad13e95db2f7283536e6729cfef904d484c77c06.jpg) +Original + +![](images/776f43ac326aa036a2b72fc2f608fc31e6135468979ee497ee02e070eba376a0.jpg) +SSS + +![](images/46ab581e9f167a0f2620281b002b2723391d5422ab69493fcf36428d53567466.jpg) +LTS + +![](images/3cf83da4b98c76076a64863a09418aa5a376f57989491292b41c7d3795634ed5.jpg) +Random +Figure 11. Visualization of reconstructed images for the CelebA dataset. Each model selects 40, 60, 80, and 100 pixels from a $218 \times 178$ image and reconstruct the full image using only the selected pixels. + +![](images/2c48cc65c0d32b3bc47cdac3e237f3e1326b1237155a3f0b8c03e41eddbe24ed.jpg) +Original +Original + +![](images/5ca3354a9492776c41f4d20276229294d21603ea58d729baa1d6d289435b2332.jpg) +Original Image +Figure 12. Zoom-In for best view. Selected pixels for different tasks on CelebA. As can be seen from the selected pixels, SSS adaptively selects different pixels for both reconstruction and classification. Pixels for reconstruction are more spread out to include the background since this contributes to the reconstruction loss. For classification, almost all the pixels are focused on the face since most of the attributes can be found there. + +![](images/317d802fd6807384f7b324995edb113464f703988a1c25d7ad8e9c36c19d9a34.jpg) +Pixels Selected for Classification (SSS) + +![](images/41218c0fd661cb04fec2699d120727981a30e9d47f0dee48610c9129e5077db7.jpg) +Pixels Selected for Reconstruction (SSS) + +![](images/222ea62cf0cb42974423d51d6b9827f63fe7a1772a60d1fe72ced6a20403d438.jpg) +Pixels Selected for Reconstruction (LTS) + +![](images/0defb0f18549a7a204edee81d969878327463ba969eb0fabf04772fa489966f4.jpg) +Pixels Selected (RS) + +![](images/256896012e53c6bb3a986d623ad4b25bc535ff5af082959b981f2b00925ffa9c.jpg) + +![](images/a3bbf3d47cc8f3c7f0de3eb249e9e749737f64457c14c8959ee3b100137c32e2.jpg) +Candidate Set + +![](images/9d8c21423e022c5441d7fbcec125ef0babffc990eae522f6872a1a4a03eb0de8.jpg) +Subset +Figure 13. Visualization of a set with 200 images for instance selection. The two stage selection method in SSS is visualized as Candidate Set and Subset. A subset of size 5 is visualized. + +![](images/30bcf912d66a24850b0433072de67c18536e1561504fa2f0b4b0fe1395f88bcd.jpg) +Figure 14. Sample visualization of prototype selection for the miniImagenet dataset on the few-shot classification task. Each row represents a set that corresponds to the support from which a prototype is selected for the few-shot classification task. + +tihead Attention (Vaswani et al., 2017) with each slot of Multihead $(\cdot, \cdot, \cdot)$ representing query, key, and value, respectively. We use linear layer for $\varphi$ to output logits for each element in $D_{c}^{(t-1)}$ . + +# I.1. Attention + +We further elaborate the details of Attention and Multihead Attention for completeness. For a more thorough exposition, we refer the reader to Vaswani et al. (2017) and Lee et al. (2019). + +An attention module computes the following interactions using the dot product: + +$$ +\operatorname {A t t} (Q, K, V; \omega) = \omega \left(Q K ^ {\top}\right) V \tag {19} +$$ + +where $Q \in \mathbb{R}^{n_q \times d_q}$ are the $n_q$ query vectors each with of dimension $d_q$ . $K \in \mathbb{R}^{n_v \times d_q}$ and $V \in \mathbb{R}^{n_v \times d_q}$ are the keys and values respectively. Interactions are modelled through $QK^{\top}$ and $\omega$ is an activation function such as softmax or sigmoid. + +Multihead attention projects $Q, K, V$ to $h$ different vectors each with $d_q^M, d_q^M, d_v^M$ dimensions and computes $h$ different attention modules according to the following: + +$$ +\operatorname {M u l t i h e a d} (Q, K, V; \lambda , \omega) = \operatorname {c o n c a t} \left(O _ {1}, \dots , O _ {h}\right) W ^ {O} \tag {20} +$$ + +where + +$$ +O _ {j} = \operatorname {A t t} \left(Q W _ {j} ^ {Q}, K W _ {j} ^ {K}, V W _ {j} ^ {V}; \omega_ {j}\right) \tag {21} +$$ + +The leanarble parameters for Multihead Attention are $\lambda = \{W_{j}^{Q}, W_{j}^{K}, W_{j}^{V}\}_{j=1}^{h}$ , where $W_{j}^{Q}, W_{j}^{K} \in \mathbb{R}^{d_{q} \times d_{q}^{M}}$ , $W_{j}^{V} \in \mathbb{R}^{d_{v} \times d_{v}^{M}}$ and $W^{O} \in \mathbb{R}^{hd_{v}^{M} \times d}$ . In all our experiments, we use sigmoid as the activation function. + +# I.2. Architectures for MNIST Classification + +MLP We use an architecture with 5 layers with outputs 784, 256, 128, 128 and 10 respectively. With the exception of the last layer, all layers are followed by a LeakyReLU activation function. The 3rd linear layer is also followed by a dropout layer with $p = 0.2$ . This is the same architecture used in Huijben et al. (2019). However, we test on the full MNIST test set instead of using half for validation and the remaining for testing as done in Huijben et al. (2019). + +ConvNet We use two convolutions with output channels 32 and 64 respectively. All convolutions have kernel size of 3 with stride 1 and are followed by ReLU activation. The final convolution layer is followed by a Maxpooling layer with kernel size 2. This is followed by two linear layers with output sizes of 128 and 10 and the first linear layer is followed by the ReLU activation function. + +# I.3. Architecture for CelebA Attribute Classification + +ConvNet We use 4 convolutions each with outputs 64, 128, 256 and 512 respectively. Each convolution is followed by a batch normalization layer, ReLU activation and a Maxpooling layer with kernel size 2. This is followed by 3 linear layers with outputs 1024, 256 and 40 respectively. The first two linear layers are followed by the ReLU activation function and the last by the Sigmoid function. + +# I.4. Architecture for Regression Problems + +For all the regression problems, we use the ANP model of Kim et al. (2019). + +# J. Experiments on CIFAR10 Dataset + +![](images/b3b220810e7df9818885a1318330315da879bb39a330fdde6f89cba42db59c20.jpg) +(a) +Figure 15. (a) CIFAR10 Reconstruction. (b) CIFAR10 Classification. + +![](images/77bc76c11116c7419c9a53e2ef2e2e8add589424039ef15d860e797a7610094c.jpg) +(b) + +We provide further experimental results on the CIFAR10 dataset in which we subsample pixels for both image reconstruction and image classification. In order to compare with both Huijben et al. (2019) and Yoon et al. (2019), we convert all the images to grayscale, following Huijben et al. (2019) (see Section 4.3). + +The experimental result of the CIFAR10 reconstruction task is presented in Figure 15a, where for the same subsampling rates, SSS outperforms the competing baselines (DPS, INVASE, LTS and Random Sampling) in terms of the negative log-likelihood. For this task, we use ANP model as we have done in CelebA and function reconstruction tasks in Section 4.3. We do not compare with INVASE since INVASE requires two copies of the reconstruction model and requires more GPU memory. + +In Figure 15b, we present the results for the CIFAR10 classification task. Again we observe that for the same subsampling rate, SSS performs better than DPS, INVASE and Random Sampling and the performance of the same classification model trained on the full input image is $0.70 \pm 0.02$ . Note that we cannot compare with LTS for the same reasons given in Section 4.1. + +# K. Experiments on OCT Dataset + +We also provide additional results on the Optical Coherence Tomography dataset where we need to select the most infor + +Table 4. Acc. with 200 out of 1024 pixels on OCT. + +
RandomINVASEDPSSSS| Full
38.8041.8076.7085.90| 95.50
+ +mative features from tomographic images for prediction and interpretation of diseases in the retina. As shown in Fig. 16, SSS selects bumpy regions of the retina crucial for diagnosis of Diabetic Macular Edema. The quantitative result from Table 4 further confirms the effectiveness of our method. + +![](images/03d634b020214d4b7717327fde2e8692431ad6b66c617c3e283ffe5bd7617b97.jpg) +(a) Full +Figure 16. Visualization of selected 100 pixels. + +![](images/245bbd9cc87776ee8fa8e9ebbf449bdf446074671c80051efa292945bf879d07.jpg) +(b) Random + +![](images/51ab11195bc1bcb732943c2d39117f313d77a8b9df6afbcdc667b213afdca645.jpg) +(c) INVASE + +![](images/1d013538f0fda7408dfca495f467afdecfca60282c0017deb2b8d19230586229.jpg) +(d) DPS + +![](images/f4e6266df77796592260e5c316a8879e2e3b6d689e5612b63ffc58a1efe977cc.jpg) +(e) SSS \ No newline at end of file diff --git a/setbasedstochasticsubsampling/images.zip b/setbasedstochasticsubsampling/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..64472f91d0fb0eb36261c6f2caec03651d12c6c1 --- /dev/null +++ b/setbasedstochasticsubsampling/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3d68ce9d4820800211cb890922bf5a58cdb6d7889336233595dcbf30acdb0ef7 +size 1374719 diff --git a/setbasedstochasticsubsampling/layout.json b/setbasedstochasticsubsampling/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..08b63d2189438f0975f48bc3ad65342f8f5d1f00 --- /dev/null +++ b/setbasedstochasticsubsampling/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1afbe59df25b98d22e6b9f6bf65369ac3ce60f50e4253398df2b682ab6ed7ef6 +size 992235 diff --git a/setnormandequivariantskipconnectionsputtingthedeepindeepsets/6af2ff47-b1d3-4607-8a06-9835c7ac6ce2_content_list.json b/setnormandequivariantskipconnectionsputtingthedeepindeepsets/6af2ff47-b1d3-4607-8a06-9835c7ac6ce2_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..da4f21ffcbf1d5402dbb62a4f05b15da8306b28a --- /dev/null +++ b/setnormandequivariantskipconnectionsputtingthedeepindeepsets/6af2ff47-b1d3-4607-8a06-9835c7ac6ce2_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e4192795d4b1a68e1889b373169ac68630bf90ea56162a5aefe76be6bac33c06 +size 134227 diff --git a/setnormandequivariantskipconnectionsputtingthedeepindeepsets/6af2ff47-b1d3-4607-8a06-9835c7ac6ce2_model.json b/setnormandequivariantskipconnectionsputtingthedeepindeepsets/6af2ff47-b1d3-4607-8a06-9835c7ac6ce2_model.json new file mode 100644 index 0000000000000000000000000000000000000000..a47cd2b6028e2486a0f3f94ef461dd04cd454f01 --- /dev/null +++ b/setnormandequivariantskipconnectionsputtingthedeepindeepsets/6af2ff47-b1d3-4607-8a06-9835c7ac6ce2_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3a281581001dda49c7c97470dadcd185c442b37dc5842176aff17976b419a6f9 +size 157395 diff --git a/setnormandequivariantskipconnectionsputtingthedeepindeepsets/6af2ff47-b1d3-4607-8a06-9835c7ac6ce2_origin.pdf b/setnormandequivariantskipconnectionsputtingthedeepindeepsets/6af2ff47-b1d3-4607-8a06-9835c7ac6ce2_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..bea759bb7f22cd838943aa19311f50b65bd658c0 --- /dev/null +++ b/setnormandequivariantskipconnectionsputtingthedeepindeepsets/6af2ff47-b1d3-4607-8a06-9835c7ac6ce2_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:91d504c06dfbddbc387fea49cf842e1e19b642f658acf2ec2f6fa1b637250500 +size 830678 diff --git a/setnormandequivariantskipconnectionsputtingthedeepindeepsets/full.md b/setnormandequivariantskipconnectionsputtingthedeepindeepsets/full.md new file mode 100644 index 0000000000000000000000000000000000000000..e6c74c837a198f969d1994eda6fa47107dac2610 --- /dev/null +++ b/setnormandequivariantskipconnectionsputtingthedeepindeepsets/full.md @@ -0,0 +1,622 @@ +# Set Norm and Equivariant Skip Connections: Putting the Deep in Deep Sets + +Lily H. Zhang*1 Veronica Tozzo*23 John M. Higgins 2 Rajesh Ranganath 14 + +# Abstract + +Permutation invariant neural networks are a promising tool for making predictions from sets. However, we show that existing permutation invariant architectures, Deep Sets and Set Transformer, can suffer from vanishing or exploding gradients when they are deep. Additionally, layer norm, the normalization of choice in Set Transformer, can hurt performance by removing information useful for prediction. To address these issues, we introduce the "clean path principle" for equivariant residual connections and develop set norm (SN), a normalization tailored for sets. With these, we build Deep Sets++ and Set Transformer++, models that reach high depths with better or comparable performance than their original counterparts on a diverse suite of tasks. We additionally introduce Flow-RBC, a new single-cell dataset and real-world application of permutation invariant prediction. We open-source our data and code here: https://github.com/rajeshlab/deep_permutation_invariant. + +# 1. Introduction + +Many real-world tasks involve predictions on sets as inputs, from point cloud classification (Guo et al., 2020; Wu et al., 2015; Qi et al., 2017a) to the prediction of health outcomes from single-cell data (Regev et al., 2017; Lahnemann et al., 2020; Liu et al., 2021; Yuan et al., 2017). + +Models applied to input sets should satisfy permutation invariance: for any permutation of the elements in the input set, the model prediction stays the same. Deep Sets (Zaheer et al., 2017) and Set Transformer (Lee et al., 2019) are + +*Equal contribution $^{1}$ Center for Data Science, New York University, New York, NY $^{2}$ Massachusetts General Hospital, Harvard Medical School, Cambridge, MA $^{3}$ Department of Systems Biology, Harvard Medical School, Boston, MA $^{4}$ Department of Computer Science, New York University, New York, NY. Correspondence to: Lily H. Zhang , Veronica Tozzo . + +Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s). + +two general-purpose permutation-invariant neural networks that have been proven to be universal approximators of permutation-invariant functions under the right conditions (Zaheer et al., 2017; Lee et al., 2019; Wagstaff et al., 2019). In practice, however, these architectures are often tailored to specific tasks to achieve good performance (Zaheer et al., 2017; Lee et al., 2019). + +In this work, we pursue a general approach to achieve improved performance: making permutation-invariant networks deeper. Whether deeper models benefit performance is often task-dependent, but the strategy of building deeper networks has yielded benefit for a variety of architectures and tasks (He et al., 2016b; Wang et al., 2019; Li et al., 2019). Motivated by these previous results, we investigate whether similar gains can be made of permutation-invariant architectures and prediction tasks on sets. + +However, naively increasing layers in Deep Sets and Set Transformer can hurt performance (see Figure 1). We show empirical evidence, supported by a gradient analysis, that both models can suffer from vanishing or exploding gradients (Section 3.1, Section 3.2). Moreover, we observe that layer norm, the normalization layer discussed in Set Transformer, can actually hurt performance on tasks with real-valued sets, as its standardization forces potentially unwanted invariance to scalar transformations in set elements (Section 3.3). + +To address these failures, we introduce Deep Sets++ and Set Transformer++, new versions of Deep Sets and Set Transformer with carefully designed residual connections and normalization layers (Section 4). First, we propose skip connections that adhere to what we call the "clean path" principle to address potential gradient issues. Next, we propose set norm (SN), an easy-to-implement normalization layer for sets which standardizes each set over the minimal number of dimensions. We consider both residual connections and normalization layers since either alone can still suffer from gradient problems (Zhang et al., 2018; Yang et al., 2019; De & Smith, 2020). + +Deep Sets++ and Set Transformer++ are able to train at high depths without suffering from the issues seen in the original models (Section 7). Furthermore, deep versions of these architectures improve upon their shallow counterparts on many tasks, avoiding issues such as exploding or vanishing + +![](images/70e2c73a05e68c4cac82f3861018e074ef89f878c5f130fe2024ca2eeb74fd15.jpg) +(a) Deep Sets, Loss + +![](images/b3e942e6e626facb7b7efbae8e1d90aec92ee7bf55b5e8a9c20dae8891acbe3b.jpg) +(b) Gradient Norms + +![](images/20803404b26fba11b8c6346e78728ee6f2ee82d6b2b4c7b3df1f7bfcbc0c7c88.jpg) +(c) Set Transformer, Train Loss + +![](images/e937a3fc51f40610c387906af53ad6bc9e70f0db7acc8c4b68ca23b94bb997b0.jpg) +(d) Gradient Norms +Figure 1: At high depths, Deep Sets can suffer from vanishing gradients (top), while Set Transformer can suffer from exploding gradients (bottom). Experiment is MNIST digit variance prediction (see Section 6 for details). + +gradients. Among other results, these new architectures yield better accuracy on point cloud classification than the task-specific architectures proposed in the original Deep Sets and Set Transformer papers. + +We also introduce a new dataset for permutation-invariant prediction called Flow-RBC (Section 5). The dataset consists of red blood cell (RBC) measurements and hematocrit levels (i.e. the fraction of blood volume occupied by RBCs) for $100,000+$ patients. The size and presence of a prediction target (hematocrit) makes this dataset unique, even among single-cell datasets in established repositories like the Human Cell Atlas (Regev et al., 2017). Given growing interest around single-cell data for biomedical science (Lähnemann et al., 2020), Flow-RBC provides machine learning researchers with the opportunity to benchmark their methods on an exciting new real-world application. + +# 2. Permutation invariance + +Let $M$ be the number of elements in a set, and let $\mathbf{x}$ denote a single set with samples $\mathbf{x}_1,\dots ,\mathbf{x}_M,\mathbf{x}_i\in \mathcal{X}$ . A function $f:\mathcal{X}^M\to \mathcal{Y}$ is permutation invariant if any permutation $\pi$ of the input set results in the same output: $f(\pi \mathbf{x}) = f(\mathbf{x})$ . A function $\sigma :\mathcal{X}^M\to \mathcal{Y}^M$ is permutation equivariant if, for any permutation $\pi$ , the outputs are permuted accordingly: $\sigma (\pi \mathbf{x}) = \pi \sigma (\mathbf{x})$ . A function is permutation-invariant if and only if it is sum-decomposable with sufficient conditions on the latent space dimension (Zaheer et al., 2017; Wagstaff et al., 2019). A sum-decomposable function $f:\mathcal{X}^M\to \mathcal{Y}$ is one which can be expressed using a function $\phi :\mathcal{X}\rightarrow \mathcal{Z}$ mapping each input element to a latent vector, a sum + +aggregation over the elements of the resulting output, and an unconstrained decoder $\rho : \mathcal{Z} \to \mathcal{Y}$ : + +$$ +f (\mathbf {x}) = \rho \left(\sum_ {i = 1} ^ {M} \phi \left(\mathbf {x} _ {i}\right)\right). \tag {1} +$$ + +Existing permutation-invariant architectures utilize the above fact to motivate their architectures, which consist of an equivariant encoder, permutation-invariant aggregation, and unrestricted decoder. Equivariant encoders can express $\phi(\mathbf{x}_i)$ for each element $\mathbf{x}_i$ if interactions between elements are zeroed out. For the remainder of the paper, we consider the depth of a permutation-invariant network to be the number of layers in the equivariant encoder. We do not consider decoder changes as the decoder is any unconstrained network, so we expect existing work on increasing depth to directly transfer. + +# 3. Problems with Existing Architectures + +Both Deep Sets and Set Transformer are permutation invariant (Zaheer et al., 2017; Lee et al., 2019). However, a gradient analysis of each shows that both architectures can exhibit vanishing or exploding gradients. We present experimental evidence of vanishing and exploding gradients in Deep Sets and Set Transformer respectively (Figure 1). + +# 3.1. Deep Sets gradient analysis + +Deep Sets consists of an encoder of equivariant feedforward layers (where each layer is applied independently to each element in the set), a sum or max aggregation, and a decoder also made up of feedforward layers (Zaheer et al., 2017). Each feedforward layer is an affine transform with a ReLU non-linearity: for layer $\ell$ and element $i$ , we have $\mathbf{z}_{\ell,i} = \mathrm{relu}(\mathbf{z}_{\ell-1,i}W_{\ell} + b_{\ell})$ . We denote the output after an $L$ -layer encoder and permutation-invariant sum aggregation as $\mathbf{y} = \sum_{i}\mathbf{z}_{L,i}$ . Then, the gradient of weight matrix $W_{1}$ of the first layer is as follows: + +$$ +\frac {\partial \mathcal {L}}{\partial W _ {1}} = \frac {\partial \mathcal {L}}{\partial \mathbf {y}} \sum_ {i} \frac {\partial \mathbf {y}}{\partial \mathbf {z} _ {L , i}} \frac {\partial \mathbf {z} _ {L , i}}{\partial W _ {1}}. \tag {2} +$$ + +The rightmost term above is a product of terms which can become vanishingly small when the number of layers $L$ is large: + +$$ +\begin{array}{l} \frac {\partial \mathbf {z} _ {L , i}}{\partial W _ {1}} = \frac {\partial \mathbf {z} _ {L , i}}{\partial \mathbf {z} _ {1 , i}} \frac {\partial \mathbf {z} _ {1 , i}}{\partial W _ {1}} (3) \\ = \prod_ {\ell = 2} ^ {L} \frac {\partial \mathbf {z} _ {\ell , i}}{\partial \mathbf {z} _ {\ell - 1 , i}} \frac {\partial \mathbf {z} _ {1 , i}}{\partial W _ {1}} (4) \\ = \frac {\partial \mathbf {z} _ {1 , i}}{\partial W _ {1}} \prod_ {\ell = 2} ^ {L} \frac {\partial \operatorname {r e l u} \left(\mathbf {z} _ {\ell , i}\right)}{\partial \mathbf {z} _ {\ell , i}} W _ {\ell}. (5) \\ \end{array} +$$ + +This gradient calculation mirrors that of a vanilla feedforward network, except for the additional summation over each of the elements (or the corresponding operation for max aggregation). Despite the presence of the sum, the effect of a product over many layers of weights still dominates the overall effect on the gradient of earlier weights. We provide experimental evidence in Figure 1. + +# 3.2. Set Transformer gradient analysis + +Set Transformer consists of an encoder, aggregation, and decoder built upon a multihead attention block (MAB) (Lee et al., 2019). The MAB differs from a transformer block in that its skip connection starts at the linearly transformed input $\mathbf{x}W_{Q}$ rather than $\mathbf{x}$ (see Equation (7)). Let $\mathrm{Attn}_K$ be multihead attention with $K$ heads and a scaled softmax, i.e. $\mathrm{softmax}(\cdot /\sqrt{D})$ where $D$ is the number of features. Then, MAB can be written as: + +$$ +\operatorname {M A B} _ {K} (\mathbf {x}, \mathbf {y}) = f (\mathbf {x}, \mathbf {y}) + \operatorname {r e l u} (f (\mathbf {x}, \mathbf {y}) W + \mathbf {b}), \tag {6} +$$ + +$$ +f (\mathbf {x}, \mathbf {y}) = \mathbf {x} W _ {Q} + \operatorname {A t t n} _ {K} (\mathbf {x}, \mathbf {y}, \mathbf {y}). \tag {7} +$$ + +The Set Transformer encoder block is a sequence of two MAB blocks, the first between learned inducing points and the input $\mathbf{x}$ , and the second between the input $\mathbf{x}$ and the output of the first block. Given $D$ hidden units and $M$ learned inducing points $\mathbf{p}$ , the inducing point set attention block (ISAB) can be written as such: + +$$ +\operatorname {I S A B} _ {M} (\mathbf {x}) = \operatorname {M A B} _ {K} (\mathbf {x}, \mathbf {h}) \in \mathbb {R} ^ {S \times D} \tag {8} +$$ + +$$ +\text {w h e r e} \mathbf {h} = \operatorname {M A B} _ {K} (\mathbf {p}, \mathbf {x}) \in \mathbb {R} ^ {M \times D}. \tag {9} +$$ + +The aggregation block is an MAB module between a single inducing point and the output of the previous block ( $M = 1$ in Equation (9)), and the decoder blocks are self-attention modules between the previous output and itself. In Lee et al. (2019), layer norm is applied to the outputs of Equation (6) and Equation (7) in the MAB module definition but is turned off in the experiments. + +Consider a single ISAB module. We let $\mathbf{z}_1$ denote the output of the previous block, $\mathbf{z}_2$ denote the output after the first MAB module (i.e. $\mathbf{h}$ in Equation (9)), and $\mathbf{z}_3$ denote the output of the second MAB module, or the overall output of the ISAB module. Then, + +$$ +f _ {1} = f (\mathbf {p}, \mathbf {z} _ {1}) = I W _ {1 Q} + \operatorname {A t t n} _ {K} (\mathbf {p}, \mathbf {z} _ {1}, \mathbf {z} _ {1}) \tag {10} +$$ + +$$ +\mathbf {z} _ {2} = f _ {1} + \operatorname {r e l u} \left(f _ {1} W _ {1} + \mathbf {b} _ {1}\right) \tag {11} +$$ + +$$ +f _ {2} = f \left(\mathbf {z} _ {1}, \mathbf {z} _ {2}\right) = \mathbf {z} _ {1} W _ {2 Q} + \operatorname {A t t n} _ {K} \left(\mathbf {z} _ {1}, \mathbf {z} _ {2}, \mathbf {z} _ {2}\right) \tag {12} +$$ + +$$ +\mathbf {z} _ {3} = f _ {2} + \operatorname {r e l u} \left(f _ {2} W _ {2} + \mathbf {b} _ {2}\right). \tag {13} +$$ + +
No normLayer norm
Hematocrit18.7436 ± 0.014819.0904 ± 0.1003
Point Cloud0.9217 ± 0.01190.9219 ± 0.0052
Normal Var0.0023 ± 0.00060.0801 ± 0.0076
+ +Table 1: Set Transformer can perform worse (underlined) with layer norm than with no normalization, particularly when inputs are real-valued. Results are test loss over three seeds (CE for Point Cloud, MSE for rest). Lower is better. + +Let $I$ denote the identity matrix. Then, the gradient of a single ISAB block output $\mathbf{z}_3$ with respect to its input $\mathbf{z}_1$ can be represented as $\frac{\partial\mathbf{z}_3}{\partial\mathbf{z}_1} = \frac{\partial\mathbf{z}_3}{\partial f_2}\frac{\partial f_2}{\partial\mathbf{z}_1}$ , or + +$$ +\Big (I + \frac {\partial \operatorname {r e l u} \left(f _ {2} W _ {2} + \mathbf {b} _ {2}\right)}{\partial \left(f _ {2} W _ {2} + \mathbf {b} _ {2}\right)} W _ {2} \Big) \Big (W _ {2 Q} + \frac {\partial \operatorname {A t t n} _ {K} \left(\mathbf {z} _ {1} , \mathbf {z} _ {2} , \mathbf {z} _ {2}\right)}{\partial \mathbf {z} _ {1}} \Big). +$$ + +In particular, we notice that even if the elements in $\frac{\partial\mathrm{relu}(f_2W_2 + \mathbf{b}_2)}{\partial(f_2W_2 + \mathbf{b}_2)} W_2$ and $\frac{\partial\mathrm{Attn}_K(\mathbf{z}_1,\mathbf{z}_2,\mathbf{z}_2)}{\partial\mathbf{z}_1}$ are close to zero, the weights $W_{2Q}$ will affect the partial derivatives of each ISAB output with respect to its input. The gradient of earlier weights will be the product of many terms of the above form, and this product can explode when the magnitude of the weights grows, causing exploding gradients and unstable training (see Figure 1(c) for an example). We find experimentally that even with the addition of layer norm, the problem persists. See Appendix B.1 for an analogous gradient analysis with the inclusion of layer norm. + +Based on the gradient analysis provided for both Deep Sets and Set Transformer, both vanishing and exploding gradients are possible for both models. In our experiments, we primarily see evidence of vanishing gradients for Deep Sets and exploding gradients for Set Transformer. + +# 3.3. Layer norm can hurt performance + +Layer norm (Ba et al., 2016) was introduced for permutation-invariant prediction tasks in Set Transformer (Lee et al., 2019), mirroring transformer architectures for other tasks. However, while layer norm has been shown to benefit performance in other settings (Ba et al., 2016; Chen et al., 2018), we find that layer norm can in fact hurt performance on certain tasks involving sets (see Table 1). + +Let $\vec{\mu}_{\mathbf{z}}, \vec{\sigma}_{\mathbf{z}} \in \mathbb{R}^{D}$ be the statistics used for standardization of a vector $\mathbf{z} \in \mathbb{R}^{D}$ and $\vec{\gamma}, \vec{\beta} \in \mathbb{R}^{D}$ be transformation parameters acting on each feature independently. Then, given a set with elements $\{\mathbf{x}_i\}_{i=1}^M \in \mathbb{R}^D$ , layer norm first standardizes each element independently $\bar{\mathbf{x}}_i = \frac{\mathbf{x}_i - \mu_{\mathbf{x}_i}}{\sigma_{\mathbf{x}_i}}$ , and then transforms $\hat{\mathbf{x}}_i = \mathbf{x}_i \odot \vec{\gamma} + \vec{\beta}$ . + +Element-wise standardization forces an invariance where two elements whose activations differ in only a scale yield + +the same output when processed through layer norm following a linear projection. If we consider layer norm in is typical placement, after a linear projection and before the non-linear activation $f(\mathbf{x}_i) = \mathrm{relu}(\mathrm{LN}(\mathbf{x}_iW))$ (Ba et al., 2016; Ioffe & Szegedy, 2015; Ulyanov et al., 2016; Cai et al., 2021), we have that for $\mathbf{x}_i$ and $\mathbf{x}_{i'} = \alpha \mathbf{x}_i$ , $\alpha \in \mathbb{R}$ + +$$ +\begin{array}{l} \mathrm {L N} \left(\mathbf {x} _ {i ^ {\prime}} W\right) = \frac {\left(\alpha \mathbf {x} _ {i}\right) W - \overrightarrow {\mu} _ {\mathbf {x} _ {i ^ {\prime}} W}}{\overrightarrow {\sigma} _ {\mathbf {x} _ {i ^ {\prime}} W}} * \overrightarrow {\gamma} + \overrightarrow {\beta} (14) \\ = \frac {\alpha \mathbf {X} _ {i} W - \alpha \vec {\mu} _ {\mathbf {X} _ {i} W}}{\alpha \vec {\sigma} _ {\mathbf {X} _ {i} W} W} * \vec {\gamma} + \vec {\beta} (15) \\ = \frac {\mathbf {x} _ {i} W - \overrightarrow {\mu} _ {\mathbf {x} _ {i} W}}{\overrightarrow {\sigma} _ {\mathbf {x} _ {i} W}} * \overrightarrow {\gamma} + \overrightarrow {\beta} = \mathrm {L N} (\mathbf {x} _ {i} W). (16) \\ \end{array} +$$ + +Since $\mathrm{LN}(\mathbf{x}_{i'}W) = \mathrm{LN}(\mathbf{x}_iW)$ , $f(\mathbf{x}_{i'}) = f(\mathbf{x}_i)$ , meaning the two elements are indistinguishable at this point in the network. This invariance reduces representation power (two such samples cannot be treated differently in the learned function) and removes information which may potentially be useful for prediction (i.e. per-element mean and standard deviation). + +An Example in 2D. Consider sets of two-dimensional real-valued elements and a model with 2D activations. Layer norm's standardization will map all elements to either $(-1, 1)$ , $(0, 0)$ , or $(1, -1)$ , corresponding to whether the first coordinate of each element is less than, greater than, or equal to the second coordinate. If the task is classifying 2D point clouds, any two shapes which share the same division of points on either side of the $y = x$ line will be indistinguishable (see Appendix B.2 for a visualization). Generalizing this phenomenon to higher dimensions, layer norm's standardization decreases the degrees of freedom in elements' outputs relative to their inputs, an effect that can be particularly harmful for sets of low-dimensional, real-valued elements. + +In contrast, layer norm is commonly used in NLP, where one-hot encoded categorical tokens will not be immediately mapped to the same outputs. Differences such as these ones highlight the need to consider normalization layers tailored to the task and data type at hand. + +Our analysis on gradients and layer norm does not suggest that these issues will always be present. However, the possibility of these issues, as well as experimental evidence thereof, raises the need for alternatives which do not exhibit the same problems. + +# 4. Deep Sets++ and Set Transformer++ + +We propose Deep Sets++ and Set Transformer++, new architectures that differ from the originals only in their encoders, + +as we fix the decoder and aggregation to their original versions. For simplicity, we let the hidden dimension remain constant throughout the encoder. Based on the analysis of Section 3, we explore alternative residual connections scheme to fix the vanishing and exploding gradients. Moreover, given the potential issues with layer norm for real-valued set inputs, we consider an alternative normalization. Concretely, we propose the clean-path equivariant residual connections and set norm. + +# 4.1. Clean-path equivariant residual connections + +Let $f$ be an equivariant function where $\mathcal{X} = \mathcal{Y} = \mathbb{R}^D$ , i.e. $f: \mathbb{R}^{M \times D} \to \mathbb{R}^{M \times D}$ . A function $g$ which adds each input to its output after applying any equivariant function $f$ is also equivariant: + +$$ +g (\pi \mathbf {x}) = f (\pi \mathbf {x}) + \pi \mathbf {x} = \pi f (\mathbf {x}) + \pi \mathbf {x} = \pi g (\mathbf {x}). +$$ + +While such residual connections exist in the literature (Weiler & Cesa, 2019; Wang et al., 2020), here we refer to them as equivariant residual connections (ERC) to highlight their equivariant property and differentiate them from other possible connections that skip over blocks (see Section 7 for an example). In sets, ERCs act on every element and eliminate the vanishing gradient problem (see Appendix G for a gradient analysis). + +ERCs can be placed in different arrangements within an architecture (He et al., 2016b;a; Vaswani et al., 2017; 2018). We consider non-clean path and clean path arrangements. Let $l$ indicate the layer in the network. Non-clean path blocks include operations before or after the residual connections and must be expressed as either + +$$ +\mathbf {x} _ {l + 1} = g \left(\mathbf {x} _ {l}\right) + f \left(\mathbf {x} _ {l}\right) \quad \text {o r} \quad \mathbf {x} _ {l + 1} = g \left(\mathbf {x} _ {l} + f \left(\mathbf {x} _ {l}\right)\right), \tag {17} +$$ + +where $g, f$ cannot be the identity function. This arrangement was used in the MAB module of the Set Transformer architecture (see Figure 2 panel a). Previous literature on non permutation-invariant architectures shows that the presence of certain operations between skip connections could yield undesirable effects (He et al., 2016a;b; Klein et al., 2017; Vaswani et al., 2018; Xiong et al., 2020). + +In contrast, clean path arrangements add the unmodified input to a function applied on it, + +$$ +\mathbf {x} _ {l + 1} = \mathbf {x} _ {l} + f (\mathbf {x} _ {l}), \tag {18} +$$ + +resulting in a clean path from input to output (see gray arrows in Figure 2 b and d). The clean path MAB block (Figure 2 panel b) mirrors the operation order of the PreLN Transformer (Klein et al., 2017; Vaswani et al., 2018), while the clean path version of Deep Sets mirrors that of the modified ResNet in He et al. (2016a) (Figure 2 panel d). + +![](images/25eea77d88c423c351f11f311a60b11102d230166ec9b5aec33c76554b56bb0e.jpg) +(a) Non-clean path for Set Transformer + +![](images/7c5a0ba570f85a31f1b34aef8be35b52d4ece5d181c1aad89d8e372968a253ca.jpg) +(b) Clean path for Set Transformer + +![](images/c1c02bd0a2e1ccb3db84ec5208dc20cad63cd1aa78c89fd3609d365e530da95d.jpg) +(c) Non-clean path for Deep Sets +Figure 2: Clean path variants have no additional operations on the residual path (denoted by a grey arrow), whereas non-clean path variants do. In (c), weight* is also part of the attention computation. + +![](images/a674c0ac149781588a62d8321ccf3f1d510c63b35027ef02f8c9dc1d181f81a1.jpg) +(d) Clean path for Deep Sets + +# 4.2. Set norm + +Designing normalization layers for permutation equivariant encoders requires careful consideration, as not all normalization layers are appropriate to use. To this aim, we analyze normalization layers as a composition of two operations: standardization and transformation. This setting captures most common normalizations (Ioffe & Szegedy, 2015; Ba et al., 2016; Ulyanov et al., 2016). + +Let $\mathbf{a} \in \mathbb{R}^{N \times M \times D}$ be the activation before the normalization operation, where $N$ is the size of the batch, $M$ is the number of elements in a set (sets are zero-padded to the largest set size), and $D$ is the feature dimension. First, the activations are standardized based on a setting $\mathcal{S}$ which defines which dimensions utilize separate statistics. For instance, $\mathcal{S} = \{N, M\}$ denotes that each set in a batch and each element in a set calculates its own mean and standard deviation for standardization, e.g. $\mu_{\mathcal{S}}(\mathbf{a})_{b,s} = \frac{1}{D} \sum_{d=1}^{D} \mathbf{a}_{n,i,d}$ . Results are repeated over the dimensions not in $\mathcal{S}$ so that $\mu_{\mathcal{S}}(\mathbf{a}), \sigma_{\mathcal{S}}(\mathbf{a}) \in \mathbb{R}^{N \times M \times D}$ match $\mathbf{a}$ in dimensions for elementwise subtraction and division. A standardization operation can be defined as: + +$$ +\bar {\mathbf {a}} _ {S} = \frac {\mathbf {a} - \mu_ {S} (\mathbf {a})}{\sigma_ {S} (\mathbf {a})}, \tag {19} +$$ + +where we assume that the division is well-defined (i.e. nonzero standard deviation). + +Next, the standardized activations are transformed through learned parameters which differ only over a setting of dimensions $\mathcal{T}$ . For instance, $\mathcal{T} = \{D\}$ denotes that each feature is transformed by a different scale and bias, which are shared across the sets in the batch and elements in the sets. Let $\vec{\gamma}_{\mathcal{T}}$ , $\vec{\beta}_{\mathcal{T}} \in \mathbb{R}^{N \times M \times D}$ denote the learned parameters and $\odot$ represent elementwise multiplication. Any + +transformation operation can be defined as: + +$$ +\hat {\mathbf {a}} _ {\mathcal {T}} = \bar {\mathbf {a}} \odot \vec {\gamma} _ {\mathcal {T}} + \vec {\beta} _ {\mathcal {T}}. \tag {20} +$$ + +Proposition 1. Let $\mathcal{F}$ be the family of transformation functions which can be expressed via Equation (20). Then, for $f\in \mathcal{F},\mathcal{T} = \{D\}$ and $\mathcal{T} = \{\}$ are the only settings satisfying the following properties: + +1. $f_{\mathcal{T}}(\pi_i \pmb{a}) = \pi_i f_{\mathcal{T}}(\pmb{a})$ where $\pi_i$ is a permutation function that operates on elements in a set; +2. $f_{\mathcal{T}}(\pi_n \pmb{a}) = \pi_n f_{\mathcal{T}}(\pmb{a})$ where $\pi_n$ is a permutation function that operates on sets. + +See Appendix C for proof. In simpler terms, the settings $\mathcal{T} = \{D\}$ and $\mathcal{T} = \{\}$ are the only ones that maintain permutation invariance and are agnostic to set position in the batch. The setting $\mathcal{T} = \{D\}$ contains $\mathcal{T} = \{\}$ and is more expressive, as $\mathcal{T} = \{\}$ is equivalent to $\mathcal{T} = \{D\}$ where learned parameters $\vec{\gamma}_{\mathcal{T}}$ , $\vec{\beta}_{\mathcal{T}}$ each consist of a single unique value. Thus, we choose $\mathcal{T} = \{D\}$ as our choice of transformation. + +Standardization will always remove information; certain mean and variance information become unrecoverable. However, it is possible to control what information is lost based on the choice of dimensions over which standardization occurs. + +With this in mind, we propose set norm (SN), a new normalization layer designed to standardize over the fewest number of dimensions of any standardization which acts on each set separately. Per-set standardizations are a more practical option for sets than standardizations which happen over a batch ( $N \notin S$ , batch norm is an example), as the + +latter introduce issues such as inducing dependence between inputs, requiring different procedures during train and test, and needing tricks such as running statistics to be stable. In addition, any standardization over a batch needs to take into account how to weight differentially-sized sets in calculating the statistics as well as how to deal with small batch sizes caused by large inputs. + +Set norm is a normalization defined by a per set standardization and per feature transformation $(\mathcal{L} = \{N\}, \mathcal{T} = \{D\})$ : + +$$ +\begin{array}{l} \mathrm {S N} (a _ {n i d}) = \frac {\mathbf {a} _ {n} - \mu_ {n}}{\sigma_ {n}} \odot \gamma_ {d} + \beta_ {d}, \\ \mu_ {n} = \frac {1}{M} \frac {1}{D} \sum_ {i = 1} ^ {M} \sum_ {d = 1} ^ {D} a _ {n i d}, \\ \sigma_ {n} ^ {2} = \frac {1}{M} \frac {1}{D} \sum_ {i = 1} ^ {M} \sum_ {d = 1} ^ {D} (a _ {n i d} - \mu_ {n}) ^ {2}. \\ \end{array} +$$ + +Set norm is permutation equivariant (see Appendix C for proof). It also standardizes over the fewest dimensions possible of any per-set standardization, resulting in the least amount of mean and variance information removed (e.g. only the global mean and variance of the set rather than the mean and variance of each sample in the set in the case of layer norm). Note that set norm assumes sets of size greater than one $(M > 1)$ or multi-sets in which at least two elements are different. + +Table 2: Set norm can improve performance of 50-layer Deep Sets, while layer norm does not (Point Cloud, MNIST Var). In some cases, normalization alone is not enough to overcome vanishing gradients (Hematocrit, Normal Var). Table reports test loss (CE for Point Cloud, MSE otherwise). Lower is better. Underlined results are notable failures. + +
no normlayer normset norm
Hematocrit25.879 ± 0.00125.875 ± 0.00225.875 ± 0.002
Point Cloud3.609 ± 0.0003.619 ± 0.0001.542 ± 0.086
MNIST Var5.555 ± 0.0015.565 ± 0.0010.259 ± 0.003
Normal Var8.4501 ± 0.00318.4498 ± 0.00548.4433 ± 0.0011
+ +Next, we combine clean-path equivariant residual connections and set norm to build modified permutation-invariant architectures Deep Sets++ and Set Transformer++. + +# 4.3. Deep Sets++ (DS++) + +$\mathrm{DS}++$ adopts the building blocks mentioned above, resulting in a residual block of the form + +$$ +\mathbf {x} _ {l + 1} = \mathbf {x} _ {l} + \operatorname {S e t N o r m} \left(W _ {l 1} (\operatorname {r e l u} (\operatorname {S e t N o r m} \left(W _ {l 2} \mathbf {x} _ {l}\right)))\right). +$$ + +The $\mathrm{DS}++$ encoder starts with a first linear layer and no bias, as is customary before a normalization layer (Ioffe & Szegedy, 2015; Ba et al., 2016) and ends with a + +normalization-relu-weight operation after the final residual block in the encoder, following He et al. (2016a). + +# 4.4. Set Transformer++ (ST++) + +Similarly, $\mathrm{ST}++$ adds a set norm layer and adheres to the clean path principle (see Figure 2 (b)). In practice, we define a variant of the ISAB model, which we call $\mathrm{ISAB}++$ , that changes the residual connections and adds normalization off the residual path, analogous to the Pre-LN transformer (Klein et al., 2017; Vaswani et al., 2018; Xiong et al., 2020). We define two multi head attention blocks $\mathrm{MAB}^1$ and $\mathrm{MAB}^2$ with $K$ heads as + +$$ +\mathrm {M A B} _ {K} ^ {1} (\mathbf {x}, \mathbf {y}) = \mathbf {h} + \operatorname {f c c} (\operatorname {r e l u} (\operatorname {S e t N o r m} (\mathbf {h}))) \tag {21} +$$ + +$$ +\text {w h e r e} \mathbf {h} = \mathbf {x} + \operatorname {A t t n} _ {K} (\mathbf {x}, \operatorname {S e t N o r m} (\mathbf {y}), \mathbf {y}). \tag {22} +$$ + +$$ +\mathrm {M A B} _ {K} ^ {2} (\mathbf {x}, \mathbf {y}) = \mathbf {h} + \operatorname {f c c} (\operatorname {r e l u} (\operatorname {S e t N o r m} (\mathbf {h}))) \tag {23} +$$ + +$$ +\text {w h e r e} \mathbf {h} = \mathbf {x} + \operatorname {A t t n} _ {K} (\operatorname {S e t N o r m} (\mathbf {x}), \operatorname {S e t N o r m} (\mathbf {y}), \mathbf {y}). \tag {24} +$$ + +Then, the ISAB++ block with $D$ hidden units, $K$ heads and $M$ inducing points is defined as + +$$ +\operatorname {I S A B} + + _ {M} (\mathbf {x}) = \operatorname {M A B} _ {K} ^ {2} (\mathbf {x}, \mathbf {h}) \in \mathbb {R} ^ {S \times D}, \tag {25} +$$ + +$$ +\mathbf {h} = \mathrm {M A B} _ {K} ^ {1} (\mathbf {p}, \mathbf {x}) \in \mathbb {R} ^ {M \times D}. \tag {26} +$$ + +The reason why $\mathrm{MAB}_K^1$ does not include normalization on the first input is because that inducing points $\mathbf{p}$ are learned. + +# 5. FlowRBC + +To complement our technical contributions, we open-source FlowRBC, a prototypical example of a clinically-available single cell blood dataset. In this type of dataset, permutation invariance holds biologically as blood cells move throughout the body. FlowRBC aims to answer an interesting physiological question: can we predict extrinsic properties from intrinsic ones? In practice, the task is to predict a patient's hematocrit levels from individual red blood cell (RBC) volume and hemoglobin measurements. Hematocrit is the fraction of overall blood volume occupied by red blood cells and thus an aggregated measure of RBCs and other blood cell types. See more details in Appendix A. FlowRBC represents an exciting real-world use case for prediction on sets largely overlooked by the machine learning community. It differs from other real-valued datasets (e.g. Point Cloud) in that every absolute measurement carries biological information beyond its relative position with other points. This implies that translations might map to different physiological states. For this reason, careful architectural design is required to preserve useful knowledge about the input. + +Table 3: Clean path residual connections outperform non-clean path residual connections both in Deep Sets and Set Transformer. Clean path residuals with set norm perform best overall. Results are test loss for deep architectures (50 layers Deep Set, 16 layers Set Transformer), lower is better. + +
PathResidual typeNormHematocrit (MSE)Point Cloud (CE)Mnist Var (MSE)Normal Var (MSE)
Deep Setsnon-clean pathlayer norm19.6649 ± 0.03940.5974 ± 0.00220.3528 ± 0.00631.4658 ± 0.7259
feature norm19.9801 ± 0.08620.6541 ± 0.00220.3371 ± 0.00590.8352 ± 0.3886
set norm19.3146 ± 0.04090.6055 ± 0.00070.3421 ± 0.00220.2094 ± 0.1115
clean pathlayer norm19.4192 ± 0.01730.63682 ± 0.00670.3997 ± 0.03020.0384 ± 0.0105
feature norm19.3917 ± 0.06850.7148 ± 0.01640.3368 ± 0.00490.1195 ± 0.0000
set norm19.2118 ± 0.07620.7096 ± 0.00490.3441 ± 0.00360.0198 ± 0.0041
Set Transformernon-clean pathlayer norm19.1975 ± 0.13950.9219 ± 0.00522.0663 ± 1.00390.0801 ± 0.0076
feature norm19.4968 ± 0.14420.8251 ± 0.00250.4043 ± 0.00780.0691 ± 0.0146
set norm19.0521 ±0.02881.9167 ± 0.48800.4064 ± 0.01470.0249 ± 0.0112
clean pathlayer norm18.5747 ± 0.02630.6656 ± 0.01480.6383 ± 0.00200.0104 ± 0.0000
feature norm19.1967± 0.03300.6188 ± 0.01410.7946 ± 0.00650.0074 ± 0.0010
set norm18.7008 ± 0.01830.6280 ± 0.00980.8023 ± 0.00380.0030 ± 0.0000
+ +# 6. Experimental setup + +To evaluate the effect of our proposed modifications, we consider tasks with diverse inputs (point cloud, continuous, image) and outputs (regression, classification). We use four main datasets to study the individual components of our solution (Hematocrit, Point Cloud, Mnist Var and Normal Var) and two (CelebA, Anemia) for validation of the models. + +- Hematocrit Regression from Blood Cell Cytometry Data (Hematocrit a.k.a. Flow-RBC). The dataset consists of measurements from 98240 train and 23104 test patients. We select the first visit for a given patient such that each patient only appears once in the dataset, and there is no patient overlap between train and test. We subsample for each distribution to 1,000 cells. +- Point Cloud Classification (Point Cloud). Following (Zaheer et al., 2017; Lee et al., 2019), we use the ModelNet40 dataset (Wu et al., 2015) (9840 train and 2468 test clouds), randomly sample 1,000 points per set, and standardize each object to have mean zero and unit variance along each coordinate axis. We report ablation results as cross entropy loss to facilitate the readability of the tables, i.e. lower is better. +- Variance Prediction, Image Data (MNIST Var). We implement empirical variance regression on MNIST digits as a proxy for real-world tasks with sets of images, e.g. prediction on blood smears or histopathology slides. We sample 10 images uniformly from the training set and use the empirical variance of the digits as a label. Test set and training set images are non-overlapping. Training set size is 50,000 sets, and test set size is 1,000 sets. We represent each image as a 1D vector. +- Empirical Variance Prediction, Real Data (Normal Var). Each set is a collection of 1000 samples from a uni- + +variate normal distribution. Means are drawn uniformly in $[-10, 10]$ , and variances are drawn uniformly in $[0, 10]$ . The target for each set is the empirical variance of the samples (regression task) in the set. Training set size is 10,000 sets, and test set size is 1,000 sets. + +- Set anomaly detection, Image Data (CelebA). Following Lee et al. (2019), we generate sets of images from the CelebA dataset (Liu et al., 2015) where nine images share two attributes in common while one does not. We learn an equivariant function whose output is a 10-dimensional vector that identifies the anomaly in the set. We build a train and test datasets with 18000 sets, each of them containing 10 images $(64 \times 64)$ . Train and test do not contain the same individuals. +- Anemia detection, Blood Cell Cytometry Data. The dataset consists of 11136 train and 2432 test patients. Inputs are individual red blood cell measurements (volume and hemoglobin) and the outputs are a binary anemic vs. non-anemic diagnosis. A patient was considered anemic if they had a diagnosis for anemia of any type within 3 days of their blood measurements. We sample 1,000 cells for each input distribution. + +Unless otherwise specified, results are reported in Mean Squared Error (MSE) for regression experiments and in cross entropy loss (CE) for point cloud classification, averaged over three seeds. We fix all hyperparameters, including epochs, and use the model at the end of training for evaluation. We notice no signs of overfitting from the loss curves. For further experimental details, see Appendix D. + +# 7. Results + +Clean path residuals have better performance than nonclean path ones. Table 3 confirms that clean path pipelines + +Table 4: Equivariant residual connections perform better than aggregated residual connections in both Deep Sets and Set Transformer. Max aggregation for Set Transformer led to exploding gradient so we do not report result. + +
PathResidual typeHematocrit (MSE)Point Cloud (CE)Mnist Var (MSE)Normal Var (MSE)
Deep Setsequivariant19.2118 ± 0.07620.7096 ± 0.00490.3441 ± 0.00360.0198 ± 0.0041
mean19.3462 ± 0.02600.8585 ± 0.02531.2808 ± 0.01010.8811 ± 0.1824
max19.8171 ±0.02660.8758 ±0.01961.3798 ±0.01620.8964 ± 0.1376
Set Transformerequivariant18.6883 ± 0.02380.6280 ± 0.00980.7921 ± 0.00060.0030 ± 0.0000
mean19.6945 ± 0.10670.8111 ± 0.04531.6273 ± 0.03350.0147 ± 0.0028
+ +Table 5: While Deep Sets and Set Transformer exhibit notable failures when deep (underlined), Deep Sets++ and Set Transformer++ do not. The latter also achieve new levels of performance on a several tasks. + +
ModelNo. LayersHematocrit (MSE)MNIST Var (MSE)Point Cloud (accuracy)CelebA (accuracy)Anemia (accuracy)
DeepSets319.1257 ± 0.03610.4520 ±0.01110.7755 ± 0.00510.3808 ± 0.00160.5282 ± 0.0018
2520.2002 ± 0.06891.3492 ± 0.28010.3498 ± 0.03400.1005 ± 0.00000.4856 ± 0.0000
5025.8791± 0.00145.5545 ± 0.00140.0409 ± 0.00000.1005 ± 0.00000.4856 ± 0.0000
Deep Sets++319.5882 ± 0.05550.5895 ± 0.01140.7865 ± 0.00930.5730 ± 0.00160.5256 ± 0.0019
2519.1384 ± 0.10190.3914 ± 0.01000.8030 ± 0.00340.6021 ± 0.00720.5341 ± 0.0118
5019.2118 ± 0.07620.3441 ± 0.00360.8029 ± 0.00050.5763 ± 0.01340.5561 ± 0.0202
Set Transformer218.8750 ± 0.00580.6151 ± 0.00720.7774 ± 0.00760.1292 ± 0.00120.5938 ± 0.0075
818.9095 ± 0.02710.3271 ± 0.00680.7848 ± 0.00610.4299 ± 0.10010.5943 ± 0.0036
1618.7436 ± 0.01486.2663 ± 0.00360.7134 ± 0.00300.4570 ± 0.05400.5853 ± 0.0049
Set Transformer++218.9223 ± 0.02731.1525 ± 0.01580.8146 ± 0.00230.6533 ± 0.00120.5770 ± 0.0223
818.8984 ± 0.07030.9437 ± 0.01370.8247 ± 0.00200.6621 ± 0.00210.5680 ± 0.0110
1618.7008 ± 0.01830.8023 ± 0.00380.8258 ± 0.00460.6587 ± 0.00010.5544 ± 0.0113
+ +generally yield the best performance across set tasks both for Deep Sets and Set Transformer, independently of normalization choice. The primary exception to this trend is Deep Sets on Point Cloud, which can be explained by a Point Cloud-specific phenomenon where the repeated addition of positive values in the architecture improves performance (see Appendix E.1 for empirical analysis). Non-clean path Set Transformer has both the worst and best results on Mnist Var among Set Transformer variants, evidence of its unpredictable behavior at high depths. In contrast, $\mathrm{ST}++$ results are more stable, and Table 5 illustrates that $\mathrm{ST}++$ consistently improves on Mnist Var as the network depth increases. + +The clean path principle has previously been shown in other applications to improve performance and yield more stable training (He et al., 2016a; Wang et al., 2019). Its benefit for both Deep Sets and Set Transformer provides further proof of the effectiveness of this principle. + +Equivariant residual connections are the best choice for set-based skip connections. ERCs generalize residual connections to permutation-equivariant architectures. For further validation of their usefulness, we empirically compare them with another type of residual connection: an aggregated residual connection (ARC) which sums an aggregated function of the elements (e.g. sum, mean, max) from the previous layer. Appendix F provides a more detailed discussion. Results in Table 4 show that clean-path ERCs remain + +the most suitable choice. + +Set norm performs better than other norms. Table 2 shows that Deep Sets benefits from the addition of set norm when no residual connections are involved. Hematocrit and Normal Var performances are the same across normalizations, but this is due to a vanishing gradient that cannot be overcome by the presence of normalization layers alone. + +We further analyzed normalizations in the presence of residual connections in Table 3. Here, we also consider the normalization layer used in the PointNet and PointNet++ architectures for point cloud classification (Qi et al., 2017a;b), implemented as batch norm on a transposed tensor. We call this norm feature norm, which is an example of a normalization that occurs over the batch rather than on a per-set basis $(S = \{D\}, T = \{D\})$ . + +Clean path residuals with set norm generally perform best. The pattern is particularly evident for Normal Var, where clean path is significantly better than non-clean path and the addition of set norm further improves the performance. + +We additionally observe in Table 3 that results for layer norm improve with the addition of clean-path residual connections relative to earlier results in Table 1 and Table 2. We hypothesize that skip connections help alleviate information loss from normalization by passing forward values before normalization. For instance, given two elements $\mathbf{x}_l$ and $\mathbf{x}_l'$ that will be mapped to the same output $\hat{\mathbf{x}}$ by layer norm, + +adding a residual connection enables the samples to have distinct outputs $\mathbf{x}_{l + 1} = \mathbf{x}_l + \hat{\mathbf{x}}$ and $\mathbf{x}_{l + 1}' = \mathbf{x}_l' + \hat{\mathbf{x}}$ . + +Deep Sets++ and Set Transformer++ outperform existing architectures. We validate our proposed models DS++ and ST++ on real-world datasets (Table 5). Deep Sets (DS) and Set Transformer (ST) show failures (underlined entries) as depth increases. On the contrary, DS++ and ST++ tend to outperform their original and shallow counterparts at high depths (rows highlighted in gray have the highest number of best results). Deep Sets++ and Set Transformer++ particularly improve performance on point cloud classification and CelebA set anomaly detection. We show in Appendix E that, on an official point cloud benchmark repository (Goyal et al., 2021a), DS++ and ST++ without any modifications outperform versions of Deep Sets and Set Transformer tailored for point cloud classification. On Hematocrit, both deep modified models surpass the clinical baseline (25.85 MSE) while the original Deep Sets at 50 layers does not (more details are provided in Appendix A). + +Table 5 highlights that $\mathrm{DS}++$ and $\mathrm{ST}++$ generally improve over DS and ST overall without notable failures as depth increases. Due to their reliability and ease of use, $\mathrm{DS}++$ and $\mathrm{ST}++$ are practical choices for practitioners who wish to avoid extensive model search or task-specific engineering when approaching a new task, particularly one involving sets of measurements or images. We expect this benefit to be increasingly relevant in healthcare or biomedical settings, as new datasets of single cell measurements and cell slides continue to be generated, and new tasks and research questions continue to be posed. + +Lastly, while ST and $\mathrm{ST}++$ performance are better than $\mathrm{DS}++$ , it is worth noticing that the former models have approximately 3 times more parameters and take more time and memory to run. As an example, on point cloud classification, $\mathrm{ST}++$ took $\approx 2$ times longer to train than $\mathrm{DS}++$ for the same number of steps on a NVIDIA Titan RTX. + +# 8. Related Work + +Previous efforts to design residual connections (He et al., 2016b; Veit et al., 2016; Yao et al., 2020) or normalization layers (Ioffe & Szegedy, 2015; Ba et al., 2016; Santurkar et al., 2018; Ghorbani et al., 2019; Luo et al., 2019; Xiong et al., 2020; Cai et al., 2021) have often been motivated by particular applications. Our work is motivated by applications of predictions on sets. + +The effects of non-clean or clean path residual connections have been studied in various settings. He et al. (2016a) showed that adding a learned scalar weight to the residual connection, i.e. $\mathbf{x}_{\ell + 1} = \lambda_{\ell} \mathbf{x}_{\ell} + \mathcal{F}(\mathbf{x}_{\ell})$ , can result in vanishing or exploding gradients if the $\lambda$ scalars are consistently large (e.g. $> 1$ ) or small ( $< 1$ ). Wang et al. (2019) + +while see that for deep transformers, only the clean path variant converges during training. Xiong et al. (2020) show that Post-LN transformers (non-clean path) require careful learning rate scheduling unlike their Pre-LN (clean path) counterparts. Our analysis provides further evidence of the benefit of clean-path residuals. While our clean and non-clean path DS architectures mirror those of the clean and non-clean path ResNet architectures (He et al., 2016a;b), the non-clean path Set Transformer differs from non-clean path Post-LN Transformer in that the former also has a linear projection on the residual path. + +Many normalization layers have been designed for specific purposes. For instance, batch norm (De & Smith, 2020), layer norm (Ba et al., 2016), instance norm (Ulyanov et al., 2016) and graph norm (Cai et al., 2021) were designed for image, text, stylization, and graphs respectively. In this work, we propose set norm with set inputs in mind, particularly sets of real-valued inputs. The idea in set norm to address different samples being mapped to the same outputs from layer norm is reminiscent of the goal to avoid oversmoothing motivating pair norm (Zhao & Akoglu, 2019), developed for graph neural networks. + +Our work offers parallels with work on graph convolutional networks (GCNs). For instance, previous works in the GCN literature have designed architectures that behave well when deep and leverage residual connections (Li et al., 2019; Chen et al., 2020). However, while GCNs and set-based architectures share a lot of common principles, the former relies on external information about the graph structure which is not present in the latter. + +# 9. Conclusion + +We illustrate limitations of Deep Sets and Set Transformer when deep and develop Deep Sets++ and Set Transformer++ to overcome these limitations. We introduce set norm to address the unwanted invariance of layer norm for real-valued sets, and we employ clean-path equivariant residual connections to enable identity mappings and help address gradient issues. DS++ and ST++ are general-purpose architectures and the first permutation invariant architectures of their depth that show good performance on a variety of tasks. We also introduce Flow-RBC, a new open-source dataset which provides a real-world application of permutation invariant prediction in clinical science. We believe our new models and dataset have the potential to motivate future work and applications of prediction on sets. + +# References + +Ba, J., Kiros, J., and Hinton, G. E. Layer normalization. ArXiv, abs/1607.06450, 2016. + +Cai, T., Luo, S., Xu, K., He, D., Liu, T.-Y., and Wang, L. Graphnorm: A principled approach to accelerating graph neural network training. In ICML, 2021. +Chen, M., First, O., Bapna, A., Johnson, M., Macherey, W., Foster, G. F., Jones, L., Parmar, N., Schuster, M., Chen, Z., Wu, Y., and Hughes, M. The best of both worlds: Combining recent advances in neural machine translation. In ACL, 2018. +Chen, M., Wei, Z., Huang, Z., Ding, B., and Li, Y. Simple and deep graph convolutional networks. In International Conference on Machine Learning, pp. 1725-1735. PMLR, 2020. +De, S. and Smith, S. L. Batch normalization biases residual blocks towards the identity function in deep networks. arXiv: Learning, 2020. +Ghorbani, B., Krishnan, S., and Xiao, Y. An investigation into neural net optimization via hessian eigenvalue density. In ICML, 2019. +Goyal, A., Law, H., Liu, B., Newell, A., and Deng, J. Revisiting point cloud shape classification with a simple and effective baseline. In ICML, 2021a. +Goyal, A., Law, H., Liu, B., Newell, A., and Deng, J. Revisiting point cloud shape classification with a simple and effective baseline. International Conference on Machine Learning, 2021b. +Guo, Y., Wang, H., Hu, Q., Liu, H., Liu, L., and Bennamoun, M. Deep learning for 3d point clouds: A survey. IEEE transactions on pattern analysis and machine intelligence, PP, 2020. +Harris, N., Kunicka, J., and Kratz, A. The advia 2120 hematology system: flow cytometry-based analysis of blood and body fluids in the routine hematology laboratory. Laboratory Hematology, 11(1):47-61, 2005. +He, K., Zhang, X., Ren, S., and Sun, J. Identity mappings in deep residual networks. ArXiv, abs/1603.05027, 2016a. +He, K., Zhang, X., Ren, S., and Sun, J. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770-778, 2016b. +Ioffe, S. and Szegedy, C. Batch normalization: Accelerating deep network training by reducing internal covariate shift. *ArXiv*, abs/1502.03167, 2015. +Klein, G., Kim, Y., Deng, Y., Senellart, J., and Rush, A. M. Opennmt: Open-source toolkit for neural machine translation. ArXiv, abs/1701.02810, 2017. + +Lähnemann, D., Köster, J., Szczurek, E., McCarthy, D. J., Hicks, S. C., Robinson, M. D., Vallejos, C. A., Campbell, K. R., Beerenwinkel, N., Mahfouz, A., Pinello, L., Skums, P., Stamatakis, A., Attolini, C. S.-O., Aparicio, S., Baaijens, J. A., Balvert, M., de Barbanson, B., Cappuccio, A., Corleone, G., Dutilh, B. E., Florescu, M., Guryev, V., Holmer, R., Jahn, K., Lobo, T. J., Keizer, E. M., Khatri, I., Kielbasa, S. M., Korbel, J. O., Kozlov, A. M., Kuo, T.-H., Lieieveldt, B. P. F., Mandoiu, I. I., Marioni, J. C., Marschall, T., Mölder, F., Niknejad, A., Raczkowski, L., Reinders, M. J. T., de Ridder, J., Saliba, A.-E., Somarakis, A., Stegle, O., Theis, F. J., Yang, H., Zelikovsky, A., McHardy, A. C., Raphael, B. J., Shah, S. P., and Schönhuth, A. Eleven grand challenges in single-cell data science. Genome Biology, 21, 2020. +Lee, J., Lee, Y., Kim, J., Kosiorek, A. R., Choi, S., and Teh, Y. Set transformer: A framework for attention-based permutation-invariant neural networks. In ICML, 2019. +Li, G., Muller, M., Thabet, A., and Ghanem, B. Deep GCNs: Can GCNs go as deep as cnns? In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 9267-9276, 2019. +Liu, J., Fan, Z., Zhao, W., and Zhou, X. Machine intelligence in single-cell data analysis: Advances and new challenges. Frontiers in Genetics, 12, 2021. +Liu, Z., Luo, P., Wang, X., and Tang, X. Deep learning face attributes in the wild. In Proceedings of International Conference on Computer Vision (ICCV), December 2015. +Luo, P., Wang, X., Shao, W., and Peng, Z. Towards understanding regularization in batch normalization. *ArXiv*, abs/1809.00846, 2019. +McPherson, R. A., Msc, M., and Pincus, M. R. Henry's clinical diagnosis and management by laboratory methods E-book. Elsevier Health Sciences, 2021. +Qi, C., Su, H., Mo, K., and Guibas, L. Pointnet: Deep learning on point sets for 3d classification and segmentation. 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 77-85, 2017a. +Qi, C., Yi, L., Su, H., and Guibas, L. Pointnet++: Deep hierarchical feature learning on point sets in a metric space. In NIPS, 2017b. +Regev, A., Teichmann, S. A., Lander, E. S., Amit, I., Benoist, C., Birney, E., Bodenmiller, B., Campbell, P., Carninci, P., Clatworthy, M., et al. Science forum: the human cell atlas. *elife*, 6:e27041, 2017. +Santurkar, S., Tsipras, D., Ilyas, A., and Madry, A. How does batch normalization help optimization? In NeurIPS, 2018. + +Tycko, D., Metz, M., Epstein, E., and Grinbaum, A. Flow-cytometric light scattering measurement of red blood cell volume and hemoglobin concentration. Applied optics, 24(9):1355-1365, 1985. +Ulyanov, D., Vedaldi, A., and Lempitsky, V. Instance normalization: The missing ingredient for fast stylization. *ArXiv*, abs/1607.08022, 2016. +Vaswani, A., Shazeer, N. M., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, L., and Polosukhin, I. Attention is all you need. ArXiv, abs/1706.03762, 2017. +Vaswani, A., Bengio, S., Brevdo, E., Chollet, F., Gomez, A. N., Gouws, S., Jones, L., Kaiser, L., Kalchbrenner, N., Parmar, N., Sepassi, R., Shazeer, N. M., and Uszkoreit, J. Tensor2tensor for neural machine translation. In AMTA, 2018. +Veit, A., Wilber, M. J., and Belongie, S. J. Residual networks behave like ensembles of relatively shallow networks. In NIPS, 2016. +Wagstaff, E., Fuchs, F., Engelcke, M., Posner, I., and Osborne, M. A. On the limitations of representing functions on sets. In ICML, 2019. +Wang, Q., Li, B., Xiao, T., Zhu, J., Li, C., Wong, D. F., and Chao, L. S. Learning deep transformer models for machine translation. arXiv preprint arXiv:1906.01787, 2019. +Wang, R., Walters, R., and Yu, R. Incorporating symmetry into deep dynamics models for improved generalization. arXiv preprint arXiv:2002.03061, 2020. +Weiler, M. and Cesa, G. General e (2)-equivariant steerable cnns. Advances in Neural Information Processing Systems, 32, 2019. +Wu, Z., Song, S., Khosla, A., Yu, F., Zhang, L., Tang, X., and Xiao, J. 3d shapenets: A deep representation for volumetric shapes. 2015 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 1912-1920, 2015. +Xiong, R., Yang, Y., He, D., Zheng, K., Zheng, S., Xing, C., Zhang, H., Lan, Y., Wang, L., and Liu, T.-Y. On layer normalization in the transformer architecture. ArXiv, abs/2002.04745, 2020. +Yang, G., Pennington, J., Rao, V., Sohl-Dickstein, J., and Schoenholz, S. S. A mean field theory of batch normalization. *ArXiv*, abs/1902.08129, 2019. +Yao, Z., Gholami, A., Keutzer, K., and Mahoney, M. W. Pyhessian: Neural networks through the lens of the hessian. 2020 IEEE International Conference on Big Data (Big Data), pp. 581-590, 2020. + +Yuan, G., Cai, L., Elowitz, M. B., Enver, T., Fan, G., Guo, G., Irizarry, R. A., Kharchenko, P. V., Kim, J., Orkin, S. H., Quackenbush, J., Saadatpour, A., Schroeder, T., Shivdasani, R. A., and Tirosh, I. Challenges and emerging directions in single-cell analysis. *Genome Biology*, 18, 2017. +Zaheer, M., Kottur, S., Ravanbakhsh, S., Poczos, B., Salakhutdinov, R., and Smola, A. Deep sets. In NeurIPS, 2017. +Zhang, H., Dauphin, Y. N., and Ma, T. Fixup initialization: Residual learning without normalization. In International Conference on Learning Representations, 2018. +Zhao, L. and Akoglu, L. Pairnorm: Tackling oversmoothing in gnns. In International Conference on Learning Representations, 2019. + +# A. Flow-RBC + +The analysis of and prediction from single-cell data is an area of rapid growth (Lähnemann et al., 2020). Even so, Flow-RBC constitutes a dataset unique for its kind, consisting of more than 100,000 measurements taken on different patients paired with a clinical label. Even established projects like the Human Cell Atlas (Regev et al., 2017) or Flow Repository $^4$ do not include single-cell datasets of this size. For instance, to our knowledge, the second largest open-source dataset of single-cell blood samples contains data from 2,000 individuals and does not include external clinical outcomes for all patients to be used as a target. + +Flow-RBC consists of 98,240 train and 23,104 test examples. Each input set is a red blood cell (RBC) distribution of 1,000 cells. Each cell consists of a volume and hemoglobin content measurement (see Figure 3 for a visual representation). The regression task consists of predicting the corresponding hematocrit level measured on the same blood sample. Blood consists of different components: red blood cells, white blood cells, platelets and plasma. The hematocrit level measures the percentage of volume taken up by red blood cells in a blood sample. + +Since we only have information about the volume and hemoglobin of individual RBCs and no information about other blood cells, this task aims to answer an interesting clinical question: is there information present in individual RBC volume and hemoglobin measurements about the overall volume of RBCs in the blood? As this question has not been definitively answered in the literature, there is no known expected performance achievable; instead, increases in performance are an exciting scientific signal, suggesting a stronger relationship between single cell RBC and aggregate population properties of the human blood than previously known. + +The existing scientific literature notes that in the presence of diseases like anemia, there exists a negative correlation between hematocrit and the red cell distribution width (RDW), also known as the coefficient of variation of the volume i.e. SD(Volume) / Mean(Volume) $\times 100$ (McPherson et al., 2021, Chapter 9). To represent the current state of medical knowledge on this topic, we use as a baseline a linear regression model with RDW as covariate. Additionally, we build a regression model on hand-crafted distribution statistics (up to the fourth moment on both marginal distributions as well as .1, .25, .5, .75, .9 quantiles). This model improves over simple prediction with RDW, further confirming the hypothesis that more information lies in the single-cell measurements of RBCs. $\mathrm{ST}++$ further improves performance, resulting in an MSE reduction of $28\%$ over the RDW model. See Table 6 for results. + +![](images/80d769ebcd0107ff68e317c41fb3b911ee5e57bce919d96370585a4b414e3168.jpg) +Figure 3: Example of RBC distribution given in input for the prediction of hematocrit level. + +Procedure to Obtain RBC distribution measurements All Flow-RBC data is collected retrospectively at Massachusetts General Hospital under an existing IRB-approved research protocol and is available at this link. Each RBC distribution consists of volume and hemoglobin mass measurements collected using the Advia 2120 (Harris et al., 2005), a flow-cytometry based system that measures thousands of cells. The volume and hemoglobin information are retrieved through Mie (or Lorenz-Mie) theory equations for the analysis of light scattering from a homogeneous spherical particle (Tycko et al., 1985). An example of one input distribution is provided in Figure 3. The Advia machine returns an average of 55,000 cells. For this dataset, we downsampled each distribution to 1,000 cells, a number high enough to maintain sample estimates of "population" (i.e. all 55,000 cells) statistics with minimal variance while imposing reasonable memory requirements on consumer gpus. Each distribution is normalized and re-scaled by the training set mean and standard deviation. + +Table 6: Baseline regression performances for the prediction of hematocrit from RBC distributions. Our proposed Set Transformer++ currently has the best performance on this task. + +
MSE
RDW25.85
Moments22.31
Set Transformer++18.69
+ +# B. Layer Norm Analyses + +# B.1. Gradient Analysis for Set Transformer with Layer Norm + +The addition of Layer norm to Equation (7) does not preclude the possibility of exploding or vanishing gradients. Let $\mathrm{Attn}_K$ be multihead attention with $K$ heads and a scaled softmax, i.e. $\mathrm{softmax}(\cdot/\sqrt{D})$ , and let LN be layer norm. We consider the following definition of a MAB module, with layer norm placement that matches what was described in the original paper (Lee et al., 2019): + +$$ +\operatorname {M A B} _ {K} (\mathbf {x}, \mathbf {y}) = \ln (f (\mathbf {x}, \mathbf {y}) + \operatorname {r e l u} (f (\mathbf {x}, \mathbf {y}) W + \mathbf {b})), \tag {27} +$$ + +$$ +f (\mathbf {x}, \mathbf {y}) = \operatorname {L N} \left(\mathbf {x} W _ {Q} + \operatorname {A t t n} _ {K} (\mathbf {x}, \mathbf {y}, \mathbf {y})\right). \tag {28} +$$ + +The inducing point set attention block (ISAB) is then + +$$ +I S A B _ {M} (\mathbf {x}) = \operatorname {M A B} _ {K} (\mathbf {x}, \mathbf {h}) \in \mathbb {R} ^ {S \times D} \tag {29} +$$ + +$$ +\text {w h e r e} \mathbf {h} = \operatorname {M A B} _ {K} (\mathbf {p}, \mathbf {x}) \in \mathbb {R} ^ {M \times D}. \tag {30} +$$ + +Consider a single ISAB module. We let $\mathbf{z}_1$ denote the output of the previous block, $\mathbf{z}_2$ denote the output after the first MAB module (i.e. $\mathbf{h}$ in Equation (9)), and $\mathbf{z}_3$ denote the output of the second MAB module, or the overall output of the ISAB module. Then, + +$$ +f _ {1} = f (\mathbf {p}, \mathbf {z} _ {1}) = \mathrm {L N} \left(I W _ {1 Q} + \operatorname {A t t n} _ {K} (\mathbf {p}, \mathbf {z} _ {1}, \mathbf {z} _ {1})\right) \tag {31} +$$ + +$$ +\mathbf {z} _ {2} = \mathrm {L N} \left(f _ {1} + \operatorname {r e l u} \left(f _ {1} W _ {1} + \mathbf {b} _ {1}\right)\right) \tag {32} +$$ + +$$ +f _ {2} = f \left(\mathbf {z} _ {1}, \mathbf {z} _ {2}\right) = \mathbf {z} _ {1} W _ {2 Q} + \operatorname {A t t n} _ {K} \left(\mathbf {z} _ {1}, \mathbf {z} _ {2}, \mathbf {z} _ {2}\right) \tag {33} +$$ + +$$ +f _ {3} = \mathrm {L N} \left(f _ {2}\right) \tag {34} +$$ + +$$ +f _ {4} = f _ {3} + \operatorname {r e l u} \left(f _ {3} W _ {2} + \mathbf {b} _ {2}\right) \tag {35} +$$ + +$$ +\mathbf {z} _ {3} = \mathrm {L N} \left(f _ {4}\right). \tag {36} +$$ + +The gradient of a single ISAB block output $\mathbf{z}_3$ with respect to its input $\mathbf{z}_1$ can be represented as $\frac{\partial\mathbf{z}_3}{\partial\mathbf{z}_1} = \frac{\partial\mathbf{z}_3}{\partial f_4}\frac{\partial f_4}{\partial f_3}\frac{\partial f_3}{\partial f_2}\frac{\partial f_2}{\partial\mathbf{z}_1}$ , or + +$$ +\frac {\partial \mathrm {L N} (f _ {4})}{\partial f _ {4}} \left(I + \frac {\partial \operatorname {r e l u} \left(f _ {2} W _ {2} + \mathbf {b} _ {2}\right)}{\partial \left(f _ {2} W _ {2} + \mathbf {b} _ {2}\right)} W _ {2}\right) +$$ + +$$ +\frac {\partial \operatorname {L N} \left(f _ {2}\right)}{\partial f _ {2}} \left(W _ {2 Q} + \frac {\partial \operatorname {A t t n} _ {K} \left(\mathbf {z} _ {1} , \mathbf {z} _ {2} , \mathbf {z} _ {2}\right)}{\partial \mathbf {z} _ {1}}\right). +$$ + +The gradient expression is analogous to the one in Section 3.2, with the exception of additional $\frac{\partial\mathrm{LN}(f_4)}{\partial f_4}$ and $\frac{\partial\mathrm{LN}(f_2)}{\partial f_2}$ per ISAB block. With many ISAB blocks, it is still possible for a product of the weights $W_{2Q}$ to accumulate. + +# B.2. Visualizing Layer Norm Example in 2D + +In Section 3.3, we discussed how layer norm removes two degrees of freedom from each sample in a set, which can make certain prediction difficult or impossible. In particular, we discussed a simple toy example in 2D, that of classifying shapes based on 2D point clouds. We utilize hidden layers of size 2, which means the resulting activations can be visualized. In this setup, different shapes yield the same resulting activations as long as their points are equally distributed above and below the $y = x$ line. See Figure 4. + +![](images/1f7a94e2ffa7ac2036dcf484669bc38dabd818f75da78ad07317b83ce9b639fe.jpg) + +![](images/e27e1778adf0ad34f76ed73549ca6d101e4fb01c8c29dddd368fa5035586fef4.jpg) +Figure 4: Layer norm performs per-sample standardization, which in 2D point cloud classification can result in shapes (left) whose 2D activations (right) are indistinguishable from each other. + +# C. Normalization proofs + +Proposition 1. Let $\mathcal{F}$ be the family of transformation functions which can be expressed via Equation (20). Then, for $f\in \mathcal{F},\mathcal{T} = \{D\}$ and $\mathcal{T} = \{\}$ are the only settings satisfying the following properties: + +1. $f_{\mathcal{T}}(\pi_i \pmb{a}) = \pi_i f_{\mathcal{T}}(\pmb{a})$ where $\pi_i$ is a permutation function that operates on elements in the set; +2. $f_{\mathcal{T}}(\pi_n \pmb{a}) = \pi_n f_{\mathcal{T}}(\pmb{a})$ where $\pi_n$ is a permutation function that operates on sets. + +Proof. For transformation tensors in $\mathbb{R}^{N\times M\times D}$ , the parameters can be distinct over the batch $(N\in \mathcal{T})$ , over the elements $(M\in \mathcal{T})$ , over the features $(D\in \mathcal{T})$ , or any combination of the three. We show that $N\in \mathcal{T}$ and $M\in \mathcal{T}$ are unsuitable, leaving only $D\in \mathcal{T}$ . + +Having distinct parameters over the samples breaks permutation equivariance, making $M \in \mathcal{T}$ an untenable option. Let $f: \mathbb{R}^{M \times D} \to \mathbb{R}^{M \times D}$ be the transformation function, and $\vec{\gamma}_{\{M\}}, \vec{\beta}_{\{M\}}$ represent tensors in $\mathbb{R}^{N \times M \times D}$ where the values along dimension $M$ can be unique, while the values along $N, D$ are repeated. We denote an indexing into the batch dimension as $\vec{\gamma}_{\{M\},n}, \vec{\beta}_{\{M\},n}$ . Then, $f$ breaks permutation equivariance: + +$$ +\begin{array}{l} f \left(\pi_ {i} \mathbf {a}\right) = \pi_ {i} \mathbf {a} \odot \overrightarrow {\gamma} _ {\{M \}, n} + \overrightarrow {\beta} _ {\{M \}, n} (37) \\ \neq \pi_ {i} (\mathbf {a} \odot \overrightarrow {\gamma} _ {\{M \}, n} + \overrightarrow {\beta} _ {\{M \}, n}) (38) \\ = \pi_ {i} f (\mathbf {a}). (39) \\ \end{array} +$$ + +Having distinct parameters over the batch means that the position of a set in the batch changes its ordering, making $N \in \mathcal{T}$ an untenable option. Let $\vec{\gamma}_{\{N\}}$ , $\vec{\beta}_{\{N\}}$ represent tensors which can differ over the batch, e.g. $\vec{\gamma}_{\{N\},n} \neq \vec{\gamma}_{\{N\},n'}$ , $n \neq n'$ . Then, the prediction function $f_{n}$ for batch index $n$ will yield a different output than the prediction function $f_{n'}$ for batch index $n'$ : + +$$ +\begin{array}{l} f _ {b} (\mathbf {a}) = \mathbf {a} \odot \overrightarrow {\gamma} _ {\{N \}, n} + \overrightarrow {\beta} _ {\{N \}, n} (40) \\ \neq \mathbf {a} \odot \overrightarrow {\gamma} _ {\{N \}, n ^ {\prime}} + \overrightarrow {\beta} _ {\{N \}, n ^ {\prime}} (41) \\ = f _ {n ^ {\prime}} (\mathbf {a}). (42) \\ \end{array} +$$ + +As neither $M$ nor $N$ can be in $\mathcal{T}$ , the remaining options are $\mathcal{T} = \{D\}$ or $\mathcal{T} = \{\}$ , i.e. $\vec{\gamma}, \vec{\beta}$ each repeat a single value across the tensor. Note that $\mathcal{T} = \{\}$ is strictly contained in $\mathcal{T} = \{D\}$ : if the per feature parameters are set to be equal in the $\mathcal{T} = \{D\}$ setting, the result is equivalent to $\mathcal{T} = \{\}$ . Therefore, $\mathcal{T} = \{D\}$ sufficiently describes the only suitable setting of parameters for transformation. + +![](images/9906c4bdae633fe020072b09142a1b2764e0e2b6ea5e7139ef1e998eeabb1152.jpg) + +# Proposition 2. Set norm is permutation equivariant. + +Proof. Let $\mu, \sigma \in \mathbb{R}$ be the elements mean and variance over all features in the set, $\vec{\gamma}, \vec{\beta} \in \mathbb{R}^{M \times D}$ refer to the appropriate repetition of per-feature parameters in the $M$ dimension. Then, + +$$ +\begin{array}{l} \operatorname {S N} (\pi \mathbf {x}) = \frac {\pi \mathbf {x} - \mu}{\sigma} * \overrightarrow {\gamma} + \overrightarrow {\beta} ] (43) \\ = \pi \left[ \frac {\mathbf {x} - \mu}{\sigma} * \overrightarrow {\gamma} + \overrightarrow {\beta} \right] (44) \\ = \pi \operatorname {S N} (\mathbf {x}). (45) \\ \end{array} +$$ + +Equation (44) follows from the fact that $\mu, \sigma$ are scalars and $\overrightarrow{\gamma}, \overrightarrow{\beta}$ are equivalent for every sample in the set. + +# D. Experimental configuration + +Across experiments and models we purposefully keep hyperparameters consistent to illustrate the easy-to-use nature of our proposed models. All experiments and models are implemented in PyTorch. The code is available at https://github.com/rajesh-lab/deep_permutation_invariant. + +# D.1. Experimental Setup + +Hematocrit, Point Cloud and Normal Var use a fixed sample size of 1000. MNIST Var and CelebA use a sample size of 10 due to the high-dimensionality of the images in input. The only architectural difference across these experiments is the choice of permutation-invariant aggregation for the Deep Sets architecture: we use sum aggregation for all experiments except Point Cloud, where we use max aggregation, following (Zaheer et al., 2017). We additionally use a featurizer of convolutional layers for the architectures on CelebA given the larger image sizes in this task (see Appendix D.2 section for details). + +All models are trained with a batch size of 64 for 50 epochs, except for Hematocrit where we train for 30 given the much larger size of the training dataset (i.e. $90\mathrm{k}$ vs. $\leq 10\mathrm{k}$ ). All results are reported as test MSE (or cross entropy for point cloud) at the last epoch. We did not use early stopping and simply took the model at the end of training. There was no sign of overfitting. Results are reported setting seeds 0, 1, and 2 for initialization weights. We use the Adam optimizer with learning rate 1e-4 throughout. + +# D.2. Convolutional blocks for set anomaly + +For our set anomaly task on CelebA, similarly to Zaheer et al. (2017), we add at the beginning of all the considered architectures 9 convolutional layers with $3 \times 3$ filters. Specifically, we start with 2D convolutional layers with 32, 32, 64 feature-maps followed by max pooling; we follow those with 2D convolutional layers with 64, 64, 128 feature maps followed by another max pooling; and weend with 128, 128, 256 2D convolutional layers followed by a max-pooling layer with size 5. The output of the featurizer (and input to the rest of the permutation invariant model) is 255 features. The architecture is otherwise the same as those used on all other tasks considered in this work. + +Table 7: Detailed DeepSets more residuals architecture. + +
EncoderAggregationDecoder
Residual block ×51
FC(128)FC(128)Sum/MaxFC(128)
SetNorm(128)ReLU
AdditionFC(128)
ReLUReLU
FC(128)
ReLU
FC(n_outputs)
+ +# E. Additional results + +# E.1. Understanding ResNet vs. He Pipeline for Deep Sets on Point Cloud. + +We explore why Deep Sets with the non-clean ResNet residual pipeline performs better on Point Cloud than Deep Sets with the clean He residual pipeline. Specifically, to test whether the difference is due to the ReLU activation in between connections, we design another residual pipeline where the connections (i.e. additions) are more frequent and also separated by a ReLU nonlinearity. We call this pipeline FreqAdd. This new architecture is shown in Table 7 and comparison of loss curves is in Figure 5 where we can observe that the architecture with more residual connection FreqAdd has even better performances than the non-clean pipeline. We speculate that this might be due to peculiarities of Point Cloud which benefit from continual addition positive values. Indeed, in the original Deep Sets paper (Zaheer et al., 2017), the authors add a ReLU to the end of the encoder for the architecture tailored to point cloud classification, and such a nonlinearity is noticeably missing from the model used for any other task. + +# E.2. Comparing Point Cloud classification with Task-Specific Models + +Here, we compare the performances of $\mathrm{DS}++$ and $\mathrm{ST}++$ unmodified with those of models built specifically for point cloud classification. For a fair comparison, we use the experimental setup and the code provided in SimpleView (Goyal et al., 2021b). In practice, we use their DGCNN-smooth protocol and record the test accuracy at 160 epochs. The sample size for this experiment is the default in the SimpleView repository, 1024. We compared Deep Sets++, Set Transformer++, PointNet++, (Qi et al., 2017b), and SimpleView (Goyal et al., 2021a), as well as the models proposed in the original Deep Sets and Set Transformer papers tailored to point cloud classification, which differ from the baseline architectures used in our main results. We describe these tailored Deep Sets and Set Transformer models in Table 8 and Table 9. + +Results are reported in Table 10 and Figure 6. Deep Sets++ + +Table 8: Customized Deep Sets architecture for PointCloud. + +
EncoderAggregationDecoder
x-max(x)MaxDropout(0.5)
FC(256)FC(256)
TanhTanh
x-max(x)Dropout(0.5)
FC(256)FC(n_outputs)
Tanh
x-max(x)
FC(256)
Tanh
+ +Table 9: Customized Set Transformer architecture for PointCloud. + +
EncoderAggregationDecoder
FC(128)Dropout(0.5)Dropout(0.5)
ISAB(128, 4, 32)PMA(128, 4)FC(n_outputs)
ISAB(128, 4, 32)
+ +Table 10: Point cloud test accuracy + +
ModelAccuracy
Deep Sets0.86
Deep Sets++0.87
Set Transformer0.86
Set Transformer++0.87
SimpleView0.92
PointNet++0.92
+ +and Set Transformer++ without any modifications both achieve a higher test accuracy than the Deep Sets and Set Transformer models tailor designed for the task. PointNet++ and SimpleView perform best, but both architectures are designed specifically for point cloud classification rather than tasks on sets in general. Concretely, PointNet++ hierarchically assigns each point to centroids using Euclidean distance which is not an informative metric for high-dimensional inputs, e.g. sets of images. SimpleView is a non-permutation invariant architecture that represents each point cloud by 2D projections at various angles; such a procedure is ill-suited for sets where samples do not represent points in space. + +# F. Aggregated residual connections (ARCs) + +A function $g$ which adds aggregated equivariant residual connections to any equivariant function $f$ is also permutation equivariant: + +![](images/b1521b4dac53f152602a73e46f5e86a65a183bac3306de547af37c124ee652a7.jpg) +Figure 5: Loss curves for train (left) and test (right) comparing the residual pipelines ResNet (orange), He (magenta) and FreqAdd (green). Adding a positive number more frequently (green > orange > magenta) results in better performance for Point Cloud. + +![](images/54fa78df691994729bd34ade644d404156099131c497ac05e8b283ca25ff9e32.jpg) + +![](images/1301a71c6d2e8c6764f944644f71e6c8a693fcfbcea8ce7e4bffb2c1d575bbfd.jpg) +Figure 6: Test accuracy curves of different architectures on Point Cloud classification, as implemented in the Simple-View codebase. Unmodified DS++ and ST++ outperform DS and ST tailored to the task. + +$$ +\begin{array}{l} g (\pi \mathbf {x}) = f (\pi \mathbf {x}) + \operatorname {p o o l} (\mathbf {x} _ {1}, \dots , \mathbf {x} _ {S}) \\ = \pi f (\mathbf {x}) + \operatorname {p o o l} \left(\mathbf {x} _ {1}, \dots , \mathbf {x} _ {S}\right) = \pi g (\mathbf {x}). \\ \end{array} +$$ + +Results in Table 4 clearly show that clean path ARCs perform worse than clean path ERCs (Table 3). + +# G. Gradient Computation for Equivariant Residual Connections + +We compute the gradients for early weights in a Deep Sets network with equivariant residual connections below. + +We denote a single set $\mathbf{x}$ with its samples $\mathbf{x}_1, \ldots, \mathbf{x}_M$ . We denote hidden layer activations as $\mathbf{z}_{\ell,i}$ for layer $\ell$ and sample $s$ . In the case of no residual connection, $\mathbf{z}_{\ell,i} = \mathrm{ReLU}(\mathbf{z}_{\ell-1,m} W_{\ell} + b_{\ell})$ . We denote the output after an + +$L$ -layer encoder and permutation invariant aggregation as $\mathbf{y} = \sum_{i}\mathbf{z}_{L,i}$ (we use sum for illustration but note that our conclusions are the same also for max). For simplicity let the hidden dimension remain constant throughout the encoder. + +Now, we can write the gradient of weight matrix of the first layer $W_{1}$ as follows: + +$$ +\frac {\partial \mathcal {L}}{\partial W _ {1}} = \frac {\partial \mathcal {L}}{\partial W _ {1}} \sum_ {i} \frac {\partial \mathbf {y}}{\partial \mathbf {z} _ {L , i}} \frac {\partial \mathbf {z} _ {L , i}}{\partial W _ {1}}. \tag {46} +$$ + +Equivariant residual connections prevent vanishing gradients by passing forward the result of the previous computation along that sample's path, i.e. $\mathbf{z}_{\ell ,i} = \mathrm{ReLu}(\mathbf{z}_{\ell -1,i}W_{\ell} + b_{\ell}) + \mathbf{z}_{\ell -1,i}$ + +$$ +\begin{array}{l} \frac {\partial \mathbf {z} _ {L , i}}{\partial \mathbf {z} _ {1 , i}} = \prod_ {\ell = 2} ^ {L} \frac {\partial \mathbf {z} _ {\ell , i}}{\partial \mathbf {z} _ {\ell - 1 , i}} (47) \\ = \prod_ {\ell = 2} ^ {L} \frac {\partial \operatorname {R e L U} \left(\mathbf {z} _ {\ell , i}\right)}{\partial \mathbf {z} _ {\ell , i}} (1 + W _ {\ell}). (48) \\ \end{array} +$$ \ No newline at end of file diff --git a/setnormandequivariantskipconnectionsputtingthedeepindeepsets/images.zip b/setnormandequivariantskipconnectionsputtingthedeepindeepsets/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..8648d72fd0d550b42fb9dc9f66ab82eaf156d386 --- /dev/null +++ b/setnormandequivariantskipconnectionsputtingthedeepindeepsets/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1604c06d72dc7854a73d6efd3b330edb78afd8054c7f7cd15862e94852217941 +size 917363 diff --git a/setnormandequivariantskipconnectionsputtingthedeepindeepsets/layout.json b/setnormandequivariantskipconnectionsputtingthedeepindeepsets/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..f0fd0a93e7c7d004325040244dd719e6fe5b172e --- /dev/null +++ b/setnormandequivariantskipconnectionsputtingthedeepindeepsets/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f265c4f17621b3b283b2df7e04296d2254ef07535591dc00dda9d9be7f064456 +size 685651 diff --git a/sharpenedquasinewtonmethodsfastersuperlinearrateandlargerlocalconvergenceneighborhood/0a79f87b-344a-4bb6-929f-936e8da5a1e2_content_list.json b/sharpenedquasinewtonmethodsfastersuperlinearrateandlargerlocalconvergenceneighborhood/0a79f87b-344a-4bb6-929f-936e8da5a1e2_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..10395d1bdce97793fff9bdbd5cc6f653cd6a29ee --- /dev/null +++ b/sharpenedquasinewtonmethodsfastersuperlinearrateandlargerlocalconvergenceneighborhood/0a79f87b-344a-4bb6-929f-936e8da5a1e2_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:209346ff116778c4ab348c392fe317d4e074d95628148fe7556fe35c753668cb +size 186775 diff --git a/sharpenedquasinewtonmethodsfastersuperlinearrateandlargerlocalconvergenceneighborhood/0a79f87b-344a-4bb6-929f-936e8da5a1e2_model.json b/sharpenedquasinewtonmethodsfastersuperlinearrateandlargerlocalconvergenceneighborhood/0a79f87b-344a-4bb6-929f-936e8da5a1e2_model.json new file mode 100644 index 0000000000000000000000000000000000000000..22911fd4d35bf024fa977c4c8c811c9470b315c3 --- /dev/null +++ b/sharpenedquasinewtonmethodsfastersuperlinearrateandlargerlocalconvergenceneighborhood/0a79f87b-344a-4bb6-929f-936e8da5a1e2_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a395f16c08ca2767427ff070b1e5a5a994e574d8754ac743ab1c7d60565c506f +size 215363 diff --git a/sharpenedquasinewtonmethodsfastersuperlinearrateandlargerlocalconvergenceneighborhood/0a79f87b-344a-4bb6-929f-936e8da5a1e2_origin.pdf b/sharpenedquasinewtonmethodsfastersuperlinearrateandlargerlocalconvergenceneighborhood/0a79f87b-344a-4bb6-929f-936e8da5a1e2_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..afc8c0d20aec7f3e13c7bdf5bc950eeb214dfa92 --- /dev/null +++ b/sharpenedquasinewtonmethodsfastersuperlinearrateandlargerlocalconvergenceneighborhood/0a79f87b-344a-4bb6-929f-936e8da5a1e2_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0a8a96224aa3a814e9bb5a5dd557ee5a1d4c31d6fa3c00ac4e945a03c46b6dd7 +size 1022272 diff --git a/sharpenedquasinewtonmethodsfastersuperlinearrateandlargerlocalconvergenceneighborhood/full.md b/sharpenedquasinewtonmethodsfastersuperlinearrateandlargerlocalconvergenceneighborhood/full.md new file mode 100644 index 0000000000000000000000000000000000000000..2361b1268b7a3290c208305152683bed0efcb136 --- /dev/null +++ b/sharpenedquasinewtonmethodsfastersuperlinearrateandlargerlocalconvergenceneighborhood/full.md @@ -0,0 +1,1268 @@ +# Sharpened Quasi-Newton Methods: Faster Superlinear Rate and Larger Local Convergence Neighborhood + +Qiujiang Jin1 Alec Koppel2 Ketan Rajawat3 Aryan Mokhtari1 + +# Abstract + +Non-asymptotic analysis of quasi-Newton methods have gained traction recently. In particular, several works have established a non-asymptotic superlinear rate of $\mathcal{O}((1 / \sqrt{t})^t)$ for the (classic) BFGS method by exploiting the fact that its error of Newton direction approximation approaches zero. Moreover, a greedy variant of BFGS was recently proposed which accelerates its convergence by directly approximating the Hessian, instead of the Newton direction, and achieves a fast local quadratic convergence rate. Alas, the local quadratic convergence of Greedy-BFGS requires way more updates compared to the number of iterations that BFGS requires for a local superlinear rate. This is due to the fact that in Greedy-BFGS the Hessian is directly approximated and the Newton direction approximation may not be as accurate as the one for BFGS. In this paper, we close this gap and present a novel BFGS method that has the best of both worlds in that it leverages the approximation ideas of both BFGS and Greedy-BFGS to properly approximate the Newton direction and the Hessian matrix simultaneously. Our theoretical results show that our method outperforms both BFGS and Greedy-BFGS in terms of convergence rate, while it reaches its quadratic convergence rate with fewer steps compared to Greedy-BFGS. Numerical experiments on various datasets also confirm our theoretical findings. + +# 1. Introduction + +In this paper, we focus on the use of quasi-Newton methods to solve the following unconstrained problem + +$$ +\min _ {x \in \mathbb {R} ^ {d}} f (x), \tag {1} +$$ + +where $f: \mathbb{R}^d \to \mathbb{R}$ is strongly convex and its gradient is Lipschitz continuous; see details in Section 3.2. We denote the unique optimal solution of (1) by $x_*$ . + +First-order algorithms, i.e., gradient-based methods, are widely used for solving (1), and it is well-known that their iterates converge to $x_{*}$ at a linear rate (i.e., the error decays exponentially fast). A major advantage of first-order methods is their low computational cost of $\mathcal{O}(d)$ , where $d$ is the problem dimension. However, the convergence rate of these methods depends on the problem curvature and hence they could be slow in ill-conditioned problems. Second-order methods that leverage the objective function Hessian to improve their curvature estimation often arise as a natural alternative to accelerate convergence in ill-posed problems, and they achieve fast local convergence rates (Bennett, 1916; Ortega & Rheinboldt, 1970; Conn et al., 2000; Nesterov & Polyak, 2006). Specifically, Newton's method achieves a local quadratic convergence rate when applied to solve (1) with the additional assumption that the Hessian is Lipschitz (Boyd & Vandenberghe, 2004, Chapter 9). A major obstacle in the implementation of Newton's method though is its requirement to solve a linear system at each iteration, which makes its computational cost $\mathcal{O}(d^3)$ . + +Quasi-Newton (QN) methods serve as a middle ground between first- and second-order methods, as they improve the linear rate of first-order methods and converge superlinearly, and simultaneously their computation cost is $\mathcal{O}(d^2)$ which improves the $\mathcal{O}(d^3)$ cost of Newton-type methods. Their main idea is to construct a positive definite matrix that approximates the Hessian required in Newton's method. Since the update of Hessian approximation matrix in QN methods only requires a set of matrix-vector multiplications, their computational cost per iteration is $\mathcal{O}(d^2)$ . There are several types of QN methods that differ in their Hessian approximation updates, including Symmetric Rank-One (SR1) method (Conn et al., 1991), the Broyden method (Broy + +![](images/6f79aae2f78d618d03d074dfac6191f4a59a2da996bf31ebfa01c78a791a4592.jpg) +Figure 1. Comparison of BFGS, Greedy-BFGS, and the proposed Sharpened-BFGS algorithms in terms of Newton direction error (top) and Hessian approximation error (bottom) for a quadratic problem with dimension $d = 400$ and condition number $\kappa = 100$ . + +![](images/b91cb7d3187bf33cd1b647b66bc63a1844c6fc8430e375298656d9e69b21fc53.jpg) + +den, 1965; Broyden et al., 1973; Gay, 1979), the Davidon-Fletcher-Powell (DFP) method (Davidon, 1959; Fletcher & Powell, 1963), the Broyden-Fletcher-Goldfarb-Shanno (BFGS) method (Broyden, 1970; Fletcher, 1970; Goldfarb, 1970; Shanno, 1970), the limited-memory BFGS (L-BFGS) method (Nocedal, 1980; Liu & Nocedal, 1989), and the Greedy-QN method (Rodomanov & Nesterov, 2021a). + +Perhaps the most important property of QN methods is their local superlinear convergence. Specifically, Rodomanov & Nesterov (2021a) introduced and analyzed a novel Greedy-QN method which is based on the classical Broyden class of QN methods and uses a greedily-selected vector to maximize certain measure of progress (see Section 2 for more details). Greedy-QN achieves a non-asymptotic quadratic convergence rate of $(1 - 1 / d\kappa)^{t^2 /2}(d\kappa)^t$ , where $\kappa$ is the problem condition number. Note that this bound is equivalent to $((1 - 1 / d\kappa)^{t / 2}(d\kappa))^t$ which shows that the fast quadratic convergence starts when $t\geq d\kappa \ln (d\kappa)$ . It is also worth noting that in comparison with standard QN methods, greedy QN requires more information, including the diagonal elements of the Hessian at each iteration. In a follow-up work, Rodomanov & Nesterov (2021b) proved a non-asymptotic superlinear convergence rate for standard QN methods including the DFP and BFGS methods. They showed that BFGS and DFP achieve a local superlinear convergence rate of $(d\kappa /t)^{t / 2}$ and $(d\kappa^{2} / t)^{t / 2}$ , respectively, under the assumptions that the objective function is strongly convex, smooth and strongly self-concordant. Later, Rodomanov & Nesterov (2021c) improved their results to the convergence rates of $((d\ln \kappa) / t)^{t / 2}$ for BFGS and $((d\kappa \ln \kappa) / t)^{t / 2}$ for DFP. As noted in Table 1, the convergence rate of BFGS is slower than the one for Greedy-BFGS, but the superlinear rate starts at a smaller time index. + +Contributions. As mentioned above, (standard) BFGS aims at approximating the Newton direction and obtains a fast convergence rate from the beginning, but it fails to perfectly approximate the Hessian. On the other hand, Greedy-BFGS's goal is to directly approximate the Hessian matrix and therefore at first its convergence is slower than BFGS, + +but once its Hessian approximation improves it converges substantially faster than BFGS; see Figure 1. Considering these points, a natural question that arises is: + +Is it possible to achieve the best of two worlds and develop a QN method that exhibits faster local convergence by approximating both the Newton direction and the Hessian matrix? + +In this paper, we address this question by proposing a novel Sharpened-BFGS method which utilizes ideas of the classic BFGS and Greedy-BFGS. The proposed Sharpened-BFGS method exploits the initial fast convergence of BFGS by approximating the Newton direction, while developing an accurate approximation of the Hessian by following the Greedy-BFGS idea which allows for a quadratic convergence rate. As stated in Table 1, our method outperforms both BFGS and Greedy-BFGS in terms of convergence rate, while it reaches the superlinear convergence rate with fewer steps compared to the greedy method. We should add that the computational cost per iteration of Sharpened-BFGS is the same as its standard and greedy counterparts. + +Related Work. Jin & Mokhtari (2020) established a non-asymptotic superlinear convergence rate of $(1 / t)^{t / 2}$ for standard QN methods under the assumptions that the objective function is strongly convex, smooth and its Hessian is Lipschitz continuous at the optimal solution. They also established a similar result for self-concordant functions. Their local convergence rate does not depend on the problem parameters such as $d$ or $\kappa$ , but their results require both Hessian approximation error and the distance to the optimal solution to be sufficiently small. Moreover, Ye et al. (2021) obtained the explicit local superlinear convergence rate of the SR1 method. Further, Lin et al. (2021a) extended the non-asymptotic local superlinear convergence rate of the Broyden family QN methods for solving nonlinear equations. It is worth noting that recently, Lin et al. (2021b) proposed a randomized version of Greedy-BFGS which obtains a convergence rate of $(d\kappa(1 - \frac{1}{d})^{\frac{t}{2}})^t$ . This randomized technique can be also utilized for our proposed Sharpened BFGS method to improve its convergence rate dependency in terms of $\kappa$ . Due to space limitation, we present and analyze randomized Sharpened-BFGS in Appendix H. + +# 2. Preliminaries + +In this section, we review some basics of QN methods that we require for developing our method. Consider $x_{t} \in \mathbb{R}^{d}$ as the iterate associated with time index $t$ and $\nabla f(x_{t}) \in \mathbb{R}^{d}$ as the objective function gradient evaluated at $x_{t}$ . The general form of a QN update is given by + +$$ +x _ {t + 1} = x _ {t} - \eta_ {t} G _ {t} ^ {- 1} \nabla f (x _ {t}), \tag {2} +$$ + +
AlgorithmSuperlinear Ratet0
Standard BFGS(dln κ/t) t/2dln κ
Greedy-BFGS(dκ(1-1/dκ)t/2) tdκln (dκ)
Sharpened-BFGS(1-1/dκ)t(t-1/4)(dκ/t) t/2dκ
+ +Table 1. Convergence rate comparison of different variants of BFGS, where $d$ is the dimension, $\kappa$ is the condition number and $t_0$ is the time index at which the superlinear convergence begins. + +where $\eta_t > 0$ is the step size (learning rate) and $G_t \in \mathbb{R}^{d \times d}$ is the matrix approximating the Hessian $\nabla^2 f(x_t) \in \mathbb{R}^{d \times d}$ . In general, $\eta_t$ is determined by some line search algorithms so that the iteration generated converge to the optimal solution globally. In this paper, we focus on the local convergence analysis of QN algorithms, which requires the use of a unit step size $\eta_t = 1$ . Hence, in the rest of the paper, we assume that the iterates $\{x_t\}_{t=1}^{\infty}$ stay in a local neighborhood of $x_*$ and $\eta_t = 1$ is always admissible. + +# 2.1. BFGS Operator and Algorithm + +The essence of a QN method is its update for the Hessian approximation matrix $G_{t}$ . There are various ways for updating $G_{t}$ , but in this paper we focus on the BFGS method. Before stating the BFGS method, we first introduce it as an algorithm for approximating linear operators. This perspective turns out to be advantageous for unifying it with its greedy variant. To do so, consider $A \in \mathbb{R}^{d \times d}$ as a positive definite linear operator, and suppose $G \in \mathbb{R}^{d \times d}$ is the operator that approximates $A$ and is updated according to the BFGS update. Then, the BFGS update rule for approximating operator $A$ along the direction $u \in \mathbb{R}^{d} \backslash \{0\}$ is + +$$ +B F G S (A, G, u) = G _ {+} := G - \frac {G u u ^ {\top} G}{u ^ {\top} G u} + \frac {A u u ^ {\top} A}{u ^ {\top} A u}. \tag {3} +$$ + +Note that this update tries to move from $G$ to $G_{+}$ in a way that operators $A$ and $G_{+}$ are equal to each other in the direction of vector $u$ , i.e., $Au = G_{+}u$ . + +Remark 2.1. As noted in (2), we need to compute the inverse of the Hessian approximation matrix at each step. Hence, we need a direct update for the Hessian inverse approximation matrices. By exploiting the Sherman-Morrison-Woodbury formula, one can show that the Hessian inverse approximation matrix $H = G^{-1}$ update can be written as + +$$ +H _ {+} = \left(I - \frac {u u ^ {\top} A}{u ^ {\top} A u}\right) H \left(I - \frac {A u u ^ {\top}}{u ^ {\top} A u}\right) + \frac {u u ^ {\top}}{u ^ {\top} A u}. \tag {4} +$$ + +Hence, the computational cost of BFGS is $\mathcal{O}(d^2)$ , as it only requires computation of matrix-vector multiplication. + +When we focus on minimizing a function and the ultimate linear operator that we aim to approximate is its curvature, then we select the direction as $u = x_{t + 1} - x_t$ and + +the desired operator as the average Hessian $A = J_{t} \coloneqq \int_{0}^{1} \nabla^{2} f(x_{t} + \tau (x_{t+1} - x_{t})) d\tau$ . This way we ensure that the new Hessian approximation matrix $G_{t+1}$ satisfies the secant condition, i.e., + +$$ +G _ {t + 1} \left(x _ {t + 1} - x _ {t}\right) = J _ {t} \left(x _ {t + 1} - x _ {t}\right) = \nabla f \left(x _ {t + 1}\right) - \nabla f \left(x _ {t}\right), +$$ + +If we define the variable and gradient differences as + +$$ +s _ {t} := x _ {t + 1} - x _ {t}, \quad y _ {t} := \nabla f (x _ {t + 1}) - \nabla f (x _ {t}), \tag {5} +$$ + +then the classic BFGS update is equivalent to + +$$ +G _ {t + 1} = G _ {t} - \frac {G _ {t} s _ {t} s _ {t} ^ {\top} G _ {t}}{s _ {t} ^ {\top} G _ {t} s _ {t}} + \frac {y _ {t} y _ {t} ^ {\top}}{s _ {t} ^ {\top} y _ {t}}. \tag {6} +$$ + +A major advantage of the BFGS update in (6) is that it forces the new Hessian approximation matrix $G_{t + 1}$ to satisfy the secant condition, which implies $G_{t + 1}s_t = y_t$ . This condition ultimately ensures that the BFGS direction $G_{t}^{-1}\nabla f(x_{t})$ approaches the Newton direction $\nabla^2 f(x_t)^{-1}\nabla f(x_t)$ ; see Chapter 6 of (Nocedal & Wright, 2006) for details. + +# 2.2. Greedy-BFGS Algorithm + +As mentioned in the previous section, BFGS does a good a job in approximating the Newton direction, but its Hessian approximation may not approach the true Hessian. To be precise, consider the following metric which captures the difference between positive definite matrices $A,G\in \mathbb{R}^{d\times d}$ + +$$ +\sigma (A, G) := T r \left(A ^ {- 1} G\right) - d, \tag {7} +$$ + +where $Tr(X)$ is the trace of matrix $X$ , i.e., the sum of the diagonal elements of $X$ . Note that if $A \preceq G$ , we can use $\sigma(A, G)$ as a potential function that measures the distance between two matrices $A$ and $G$ . Note that $\sigma(A, G) = 0$ if and only if $A = G$ . Using the above potential function, in the next lemma, we state the error of Hessian approximation for the BFGS operator in (3). The proof can be found in (Rodomanov & Nesterov, 2021a). + +Lemma 2.1. Consider positive definite matrices $A, G \in \mathbb{R}^{d \times d}$ and suppose that $G_{+} = BFGS(A, G, u)$ as defined in (3) and $u \in \mathbb{R}^{d} \setminus \{0\}$ . If $A \preceq G$ , then we have + +$$ +\sigma (A, G) - \sigma (A, G _ {+}) \geq \frac {u ^ {\top} G u}{u ^ {\top} A u} - 1. \tag {8} +$$ + +This result shows how fast the gap between the Hessian approximation and the true Hessian decreases after one step of BFGS. The result in Lemma 2.1 also shows that the selection of direction $u$ can influence the decrease in the trace potential function $\sigma(A, G)$ after one BFGS update. Note that for an arbitrary direction $u \in \mathbb{R}^d \setminus \{0\}$ , there is no guarantee that the Hessian approximation matrix converges + +to the exact Hessian matrix. In fact, if we set $u = x^{+} - x$ as done in the classic BFGS update, there is no guarantee that $\sigma(A, G)$ converges to 0. This observation reveals the following question: How can we select $u$ to maximize the progress in decreasing $\sigma(A, G)$ and ensuring that $\sigma(A, G)$ converges to 0, i.e., $G$ converges to $A$ ? + +Rodomanov & Nesterov (2021a) answered this question by proposing a greedy selection scheme for determination of the best choice of $u$ . To better explain this concept, consider a quadratic problem, where the objective function Hessian is fixed and denoted by the positive definite matrix $A$ . In this case, to maximize the right hand side of (8), which shows the progress for the BFGS update, one could select $u$ as + +$$ +\bar {u} (A, G) := \underset {u \in \{e _ {i} \} _ {i = 1} ^ {d}} {\arg \max } \frac {u ^ {\top} G u}{u ^ {\top} A u}, \tag {9} +$$ + +where $\{e_i\}$ is the vector whose $i$ -th element is 1 and its remaining elements are 0. If we choose $u = \bar{u}(A, G)$ in each iteration of BFGS update (3), we obtain the Greedy-BFGS algorithm in (Rodomanov & Nesterov, 2021a). The advantage of this greedily selected is that it ensures the trace potential function $\sigma(A, G)$ is strictly decreasing and converges to 0 linearly as specified in the following lemma. + +Lemma 2.2 ((Rodomanov & Nesterov, 2021a)). Consider positive definite matrices $A, G \in \mathbb{R}^{d \times d}$ that satisfy $A \preceq G$ and $\mu I \preceq A \preceq LI$ , where $0 < \mu \leq L$ are two constants. Suppose that $\bar{G}_{+} = BFGS(A,G,\bar{u}(A,G))$ where $\bar{u}(A,G) \in \mathbb{R}^d$ is greedily selected as defined in (9). Then, + +$$ +\sigma (A, \bar {G} _ {+}) \leq \left(1 - \frac {\mu}{d L}\right) \sigma (A, G). \tag {10} +$$ + +This result shows that by following the Greedy-BFGS update the error of Hessian approximation, in terms of the metric $\sigma (.,.)$ defined in (7), converges to zero linearly and eventually the sequence of Hessian approximations approaches the true Hessian. Note that, for the non-quadratic case, a similar argument holds, but the algorithm should be slightly modified as the computation of the average Hessian $J_{t}$ is costly and instead one might use the current Hessian $\nabla^2 f(x_t)$ . We discuss this point in detail in the following section, when we present our Sharpened-BFGS method. + +# 3. Sharpened-BFGS + +In this section, we propose the Sharpened-BFGS algorithm which benefits from the update of BFGS for Newton direction approximation and the Greedy-BFGS update to approximate the Hessian matrix. In a nutshell, the update of Sharpened-BFGS first adjusts the Hessian approximation according to the BFGS update by setting $u = x_{t + 1} - x_t$ , and then improves the Hessian approximation by following the greedy update, and selecting the vector $u$ in a greedy fashion. To introduce our method, we first focus on a quadratic + +# Algorithm 1 Sharpened-BFGS applied to (11). + +Require: Initial point $x_0$ and initial matrix $G_0 = LI$ . + +1: for $t = 0, 1, 2, \ldots$ do +2: Update the variable: $x_{t + 1} = x_t - G_t^{-1}\nabla f(x_t)$ ; +3: Compute $s_t = x_{t+1} - x_t$ ; +4: Compute $\bar{G}_t = BFGS(A,G_t,s_t)$ +5: Compute $\bar{u} = \bar{u}(A, \bar{G}_t)$ according to (9); +6: Compute $G_{t + 1} = BFGS(A,\bar{G}_t,\bar{u})$ +7: end for + +program where the Hessian is fixed. We then build on our intuition from the quadratic case to develop the general version of our method for the problem in (1). + +# 3.1. Quadratic Programming + +Consider a special case of (1) where the objective function is quadratic and given by + +$$ +\min _ {x \in \mathbb {R} ^ {d}} f (x) = \frac {1}{2} x ^ {\top} A x + b ^ {\top} x, \tag {11} +$$ + +where $A \in \mathbb{R}^{d \times d}$ is a symmetric positive definite matrix satisfying $\mu I \preceq A \preceq LI$ and $b \in \mathbb{R}^d$ . The Sharpened-BFGS algorithm applied to (11) is shown in Algorithm 1. We observe that the proposed algorithm involves two BFGS updates per iteration. Intuitively, we improve the Hessian approximation along the classical BFGS direction and subsequently along the Greedy-BFGS direction. Notice that the initial Hessian approximation matrix is $G_0 = LI$ . Hence, the initial Hessian inverse approximation matrix is simply $H_0 = (1 / L)I$ . For the quadratic problem, the sequence generated by Sharpened-BFGS converges to the optimal solution globally, as we show in Theorems 3.2 and 3.4. Hence, the initial point $x_0$ can be any vector in $\mathbb{R}^d$ . + +To formally show how Sharpened-BFGS exploits the fast properties of both BFGS and Greedy-BFGS, we first define the Newton decrement as $\lambda_{f}(x) := \sqrt{\nabla f(x)^{\top}\nabla^{2}f(x)^{-1}\nabla f(x)}$ . In our results, we report convergence in terms of $\lambda_{f}(x)$ and we use the notation $\lambda_{t} := \lambda_{f}(x_{t})$ . We next state the following intermediate result that shows for the class of quasi-Newton updates defined in (2) (with step size $\eta = 1$ ) on a quadratic program, how fast $\lambda_{f}(x)$ converges to zero. The proof of this result can be found in (Rodomanov & Nesterov, 2021b). + +Lemma 3.1. Consider the quadratic function in (11) and the sequence of iterates generated according to the update in (2) with step size $\eta_t = 1$ . Then, we have that + +$$ +\lambda_ {t + 1} = \theta (A, G _ {t}, x _ {t + 1} - x _ {t}) \lambda_ {t}, \tag {12} +$$ + +where + +$$ +\theta (A, G, u) := \left(\frac {u ^ {\top} (G - A) A ^ {- 1} (G - A) u}{u ^ {\top} G A ^ {- 1} G u}\right) ^ {\frac {1}{2}}. \tag {13} +$$ + +First, note that $\theta(A,G,u)$ captures the closeness of $G$ and $A$ along the direction of $u$ , where $u \in \mathbb{R}^d \setminus \{0\}$ . The above result shows that the contraction factor for the convergence of the Newton decrement is related to the gap between $G_t(x_{t+1} - x_t)$ and $A(x_{t+1} - x_t)$ . In the following theorem, we characterize a global upper bound on $\theta(A,G_t,x_{t+1} - x_t)$ for the Sharpened-BFGS method. + +Theorem 3.2. Consider the Sharpened-BFGS method in Algorithm 1 applied to the quadratic problem (11). Then, + +$$ +\theta \left(A, G _ {t}, x _ {t + 1} - x _ {t}\right) \leq 1 - \frac {\mu}{L}, \quad \forall t \geq 0, \tag {14} +$$ + +and therefore + +$$ +\lambda_ {t} \leq \left(1 - \frac {\mu}{L}\right) ^ {t} \lambda_ {0}, \quad \forall t \geq 0. \tag {15} +$$ + +Proof. Check Appendix B. + +The above result shows that the iterates generated by Sharpened-BFGS converge to the solution at a linear rate of $1 - \mu / L$ . However, this is not a tight bound and simply follows from the fact that eigenvalues of $G_{t}$ and $A$ are uniformly bounded. In the next lemma, we present that the sequence $\theta(A, G_{t}, x_{t+1} - x_{t})$ eventually approaches zero and hence the iterates of Sharpened-BFGS converge superlinearly. + +Lemma 3.3. Consider Sharpened-BFGS in Algorithm 1 applied to the quadratic function (11). Further, define $\theta_t \coloneqq \theta(A, G_t, x_{t+1} - x_t)$ and $\sigma_t \coloneqq \sigma(A, G_t)$ . Then, + +$$ +\sigma_ {t + 1} \leq \left(1 - \frac {\mu}{d L}\right) \left(\sigma_ {t} - \theta_ {t} ^ {2}\right) \tag {16} +$$ + +for any $t \geq 0$ . Moreover, we have + +$$ +\sum_ {i = 0} ^ {t - 1} \frac {\theta_ {i} ^ {2}}{\left(1 - \frac {\mu}{d L}\right) ^ {i}} \leq \sigma_ {0}, \quad \forall t \geq 1. \tag {17} +$$ + +Proof. Check Appendix C. + +First, note that (16) shows that in Sharpened-BFGS $\sigma_t$ converges to zero as in the Greedy-BFGS algorithm. Moreover comparing the bound in (16) with the one in (10) shows that in Sharpened-BFGS $\sigma_t$ converges faster than Greedy-BFGS, as $\theta_t^2 > 0$ . Second, the result in (17) shows that the sequence $\theta_t$ converges to zero. Hence, one can leverage this result to show a tighter upper bound for $\theta_t$ compared to the one in (14) and show a faster rate than the one in (15) for the Sharpened-BFGS. This goal is accomplished in the following Theorem. + +Theorem 3.4. Consider Sharpened-BFGS described in Algorithm 1 applied to the quadratic function (11). Then, for $t \geq 1$ we have + +$$ +\lambda_ {t} \leq \left(1 - \frac {\mu}{d L}\right) ^ {\frac {t (t - 1)}{4}} \left(\frac {d L}{t \mu}\right) ^ {\frac {t}{2}} \lambda_ {0}. \tag {18} +$$ + +# Algorithm 2 General Sharpened-BFGS + +Require: Initial point $x_0$ and initial matrix $G_0 = LI$ . + +1: for $t = 0, 1, 2, \ldots$ do +2: Update $x_{t+1} = x_t - G_t^{-1}\nabla f(x_t)$ ; +3: Compute $s_t = x_{t+1} - x_t$ ; +4: Set $J_{t} = \int_{0}^{1}\nabla^{2}f(x_{t} + \tau s_{t})d\tau$ +5: Compute $G_{t} = BFGS(J_{t},G_{t},s_{t})$ +6: Compute $r_t = \| x_{t + 1} - x_t\|_{x_t}$ +7: Compute $\hat{G}_t = (1 + Mr_t / 2)^2\hat{G}_t$ +8: Compute $\bar{u} = \bar{u} (\nabla^{2}f(x_{t + 1}),\hat{G}_{t})$ according to (9); +9: Compute $G_{t + 1} = BFGS(\nabla^{2}f(x_{t + 1}),\hat{G}_{t},\bar{u})$ + +10: end for + +Proof. Check Appendix D. + +![](images/6eeb96e93be73d6f6a089e54b0418e378a1b786f963238d09e2ef7f83ef5ab68.jpg) + +If we analyze the superlinear convergence rate in (18), we observe that there are two terms that contribute to the rate. The first is the quadratic rate $\left(1 - \frac{\mu}{dL}\right)^{\frac{t(t - 1)}{4}}$ and the second is $\left(\frac{dL}{t\mu}\right)^{\frac{t}{2}}$ . Notice that for the second term $\left(\frac{dL}{t\mu}\right)^{\frac{t}{2}}$ , the superlinear convergence kicks in only after $t \geq d\frac{L}{\mu}$ . Hence, by combining the results of Theorem 3.2 and 3.4, we obtain that during the initial iterations $t < d\frac{L}{\mu}$ Sharpened-BFGS converges linearly and for $t > d\frac{L}{\mu}$ the rate becomes faster than quadratic rate and $\lambda_{t}$ approaches zero at a rate of $\mathcal{O}\left((1 - \frac{\mu}{dL})^{t^2}\left(\frac{dL}{\mu t}\right)^t\right)$ . + +# 3.2. General Strongly-Convex and Smooth Setting + +In this section, we extend our algorithm and its analysis to non-quadratic convex programs. To do so, We first state the required assumptions on the objective function to establish the superlinear convergence rate of Sharpened-BFGS. + +Assumption 3.1. The objective function $f$ is twice differentiable. It is strongly convex with parameter $\mu > 0$ and its gradient $\nabla f$ is Lipschitz continuous with parameter $L > 0$ . + +Assumption 3.2. The objective function $f$ is strongly self-concordant with $M > 0$ , i.e., for any $x, y, z, w \in \mathbb{R}^d$ , we have $\nabla^2 f(y) - \nabla^2 f(x) \preceq M \| y - x \|_z \nabla^2 f(w)$ , where $\| y - x \|_z \coloneqq \sqrt{(y - x)^\top \nabla^2 f(z)(y - x)}$ . + +The strongly self-concordant functions form a subclass of the famous self-concordant functions class introduced in (Nesterov, 1989; Nesterov & Nemirovskii, 1994), which plays a fundamental role in the local analysis of Newton's method. The concept of strong self-concordance was first proposed by Rodomanov & Nesterov (2021a) to establish the explicit quadratic convergence rate of the greedy QN method. Note that a strongly convex function with Lipschitz continuous Hessian is strongly self-concordant; see Example 4.1 in (Rodomanov & Nesterov, 2021a). + +The general Sharpened-BFGS method is presented in Algorithm 2. We observe that Algorithm 2 is fundamentally + +similar to the Algorithm 1 for the quadratic case, but there are still some differences between them. In general, similar to Algorithm 1, we first update the Hessian approximation matrix along the standard BFGS direction and then along the Greedy-BFGS direction. The only difference between Algorithm 1 and 2 is that we add the correction term $r_t = \| x_{t + 1} - x_t\|_{x_t}$ in Steps 6 and 7 of Algorithm 2. The reason for this modification is that the trace potential function $\sigma (A,G)$ is only well-defined under the condition $A\succeq G$ Suppose currently the condition $\nabla^2 f(x)\preceq G$ holds. We add the correction term to ensure that after one BFGS update, the new point $x_{+}$ and the new Hessian approximation matrix $G_{+}$ still satisfy the condition $\nabla^2 f(x_+) \preceq G_+$ . Since the Hessian of the general convex function is not fixed, there is no guarantee that the quasi-Newton update can preserve the property of $\nabla^2 f(x)\preceq G$ without that correction term. The initial Hessian approximation matrix is still $G_{0} = LI$ . We should also add that Step 4 does not require computing $J_{t} = \int_{0}^{1}\nabla^{2}f(x_{t} + \tau s_{t})d\tau$ explicitly. As we discussed in Section 2.1, we can compute the standard BFGS update in Step 5 according to (6). + +Remark 3.1. The computational cost per iteration of Algorithm 1 is $\mathcal{O}(d^2)$ . The difference between Algorithm 2 and 1 is in Steps 6 and 7 of Algorithm 2. The computational cost of calculating the vector $r_t = \| x_{t + 1} - x_t\|_{x_t}$ and the matrix $\hat{G}_t = (1 + Mr_t / 2)^2\bar{G}_t$ is also $\mathcal{O}(d^2)$ . Hence, the computational cost per iteration of Algorithm 2 is also $\mathcal{O}(d^2)$ . + +The convergence rate analysis of the Sharpened-BFGS method is inspired by the counterpart of the quadratic function, but there are still some differences between these two analyses as we need to take into account the variation of the Hessian for the non-quadratic case. Most importantly, for the general (non-quadratic) case, we can only obtain local convergence results as we state in Theorems 3.6 and 3.8. In other words, the initial point $x_0$ should be within a local neighborhood of the optimal solution $x_*$ to guarantee the convergence of Sharpened-BFGS. Similar to Section 3.1, we first establish the relationship between $\theta$ defined in (13) and the Newton decrement $\lambda_f(x)$ after one iteration of quasiNewton update for minimizing a general convex function. The proof can be found in (Rodomanov & Nesterov, 2021b). + +Lemma 3.5. Consider problem (1) and suppose Assumptions 3.1-3.2 are satisfied. Then, the iterates $x_{t}$ generated according to the update in (2) with step size $\eta_{t} = 1$ satisfy + +$$ +\lambda_ {t + 1} \leq \left(1 + \frac {M r _ {t}}{2}\right) \theta \left(J _ {t}, G _ {t}, x _ {t + 1} - x _ {t}\right) \lambda_ {t}, \tag {19} +$$ + +where $J_{t} \coloneqq \int_{0}^{1} \nabla^{2} f(x_{t} + \tau (x_{t+1} - x_{t})) d\tau$ and $r_{t} \coloneqq \| x_{t+1} - x_{t}\|_{x_{t}}$ . + +Notice that the above lemma is in parallel to Lemma 3.1 for the quadratic case. Now, we establish a local upper bound + +for the measurement $\theta(J_t, G_t, x_{t+1} - x_t)$ and prove the local linear convergence rate of the general Sharpened-BFGS method, which is similar to the results in Theorem 3.2. + +Theorem 3.6. Consider Sharpened-BFGS in Algorithm 2 applied to the objective function $f$ satisfying Assumption 3.1 and 3.2. Moreover, suppose that the initial point $x_0$ satisfies + +$$ +\lambda_ {0} \leq \frac {C _ {0} \mu}{M L}, \tag {20} +$$ + +where $C_0 = \frac{1}{4}\ln \frac{3}{2}$ . Then, for any $t\geq 0$ we have + +$$ +\theta \left(J _ {t}, G _ {t}, x _ {t + 1} - x _ {t}\right) \leq 1 - \frac {2 \mu}{3 L}, \tag {21} +$$ + +which leads to + +$$ +\lambda_ {t} \leq \left(1 - \frac {\mu}{2 L}\right) ^ {t} \lambda_ {0}. \tag {22} +$$ + +Proof. Check Appendix E. + +![](images/86c64b0437a3df707fc6cb859754f15f466a9b30fb895729b4c44a6f1475c0c1.jpg) + +The above theorem presents that in a local neighborhood of the optimal solution, the iterates generated by Sharpened-BFGS achieve a linear convergence rate of $1 - \mu /2L$ , which is obtained by a loose bound on $\theta_{t}$ . As mentioned in Section 3.1, our ultimate target is to improve this to the superlinear rate. In the following lemma, we establish inequalities similar to (16) and (17) to establish a superlinear convergence rate for Sharpened-BFGS. + +Lemma 3.7. Consider Sharpened-BFGS in Algorithm 2 applied to the objective function $f$ satisfying Assumptions 3.1 and 3.2. Moreover, suppose that the initial point $x_0$ satisfies + +$$ +\lambda_ {0} \leq \frac {C _ {0} \mu}{M L}, \tag {23} +$$ + +where $C_0 = \frac{1}{4} \ln \frac{3}{2}$ . Further, consider the definitions $\theta_t \coloneqq \theta(\nabla^2 f(x_t), G_t, x_{t+1} - x_t)$ and $\sigma_t \coloneqq \sigma(\nabla^2 f(x_t), G_t)$ . Then, for any $t \geq 0$ it holds that + +$$ +\sigma_ {t + 1} \leq \left(1 - \frac {\mu}{2 d L}\right) \left[ \left(1 + \frac {M \lambda_ {t}}{2}\right) ^ {4} \left(\sigma_ {t} + 4 M d \lambda_ {t}\right) - \frac {1}{4} \theta_ {t} ^ {2} \right]. \tag {24} +$$ + +Moreover, we have + +$$ +\sum_ {i = 0} ^ {t - 1} \frac {\theta_ {i} ^ {2}}{\left(1 - \frac {\mu}{2 d L}\right) ^ {i}} \leq 8 \left(\sigma_ {0} + 4 M d \lambda_ {0}\right), \quad \forall t \geq 1. \tag {25} +$$ + +Proof. Check Appendix F. + +![](images/1b792dd91b945c8a82f6192db27501cd5ed9978289b3a3c63369ff147ecd5d1f.jpg) + +The conclusions of the above lemma are similar to the ones for the quadratic case in Lemma 3.3, except that a local condition is required. Specifically, the result in (24) implies that in Sharpened-BFGS $\sigma_t$ converges to zero as long as $\lambda_0$ is sufficiently small. Similarly this rate is faster than the one for Greedy-BFGS as $\theta_t^2 > 0$ . Second, the result + +in (25) implies that the sequence $\theta_t$ converges to zero at a fast rate as its weighted sum by a factor larger than 1 that is exponentially growing is finite. Hence, locally this result provides a tighter upper bound on $\theta_t$ compared to the one in (21) and shows a faster rate than the one in (22) for Sharpened-BFGS. We leverage these points to establish the convergence rate of Sharpened-BFGS for non-quadratic problems. + +Theorem 3.8. Consider the Sharpened-BFGS method in Algorithm 2 applied to the objective function $f$ satisfying Assumptions 3.1-3.2. Suppose the initial point $x_0$ satisfies + +$$ +\lambda_ {0} \leq \frac {C _ {1} \mu}{d M L}, \tag {26} +$$ + +where $C_1 = \frac{\ln 2}{20}$ . Then, $\forall t \geq 1$ , we have + +$$ +\lambda_ {t} \leq 2 \left(1 - \frac {\mu}{2 d L}\right) ^ {\frac {t (t - 1)}{4}} \left(\frac {8 d L}{t \mu}\right) ^ {\frac {t}{2}} \lambda_ {0}. \tag {27} +$$ + +Proof. Check Appendix G. + +![](images/fed35dce034917ba85e786176f7389a39c9ea21458bdf04af22a1dafd84e7d2c.jpg) + +We observe that the superlinear convergence rate of Theorem 3.8 is very similar to the result of Theorem 3.4. As we discussed in the last paragraph of Section 3.1, we can summarize the Theorem 3.6 and 3.8 into one convergence result. Hence, the iteration generated by the Sharpened-BFGS method applied to the unconstrained optimization problem as specified in Algorithm 2 satisfies the following local convergence rate. When the iteration number $t \leq \Theta(d\frac{L}{\mu})$ , the linear convergence rate in (21) holds. When $t \geq \Theta(d\frac{L}{\mu})$ , we can reach the superlinear convergence rate in (27). + +# 4. Discussions + +In this section, we compare the convergence results of Sharpened-BFGS with the ones for Greedy-BFGS and standard BFGS. We specifically focus on the case that the objective function satisfies Assumption 3.1 and 3.2. To simplify the comparisons, we replace all the universal constants with 1 in the convergence results and only compare the parameters $\mu$ , $L$ , $M$ and $d$ defined in Assumption 3.1 and 3.2. We denote the condition number by $\kappa = L / \mu \geq 1$ . + +Sharpened-BFGS. According to our result, if we set $G_0 = LI$ and the initial point $x_0$ satisfies + +$$ +\lambda_ {f} (x _ {0}) = \mathcal {O} \left(\frac {1}{d M \kappa}\right), +$$ + +then the iterates generated by Sharpened-BFGS satisfy: + +$$ +\frac {\lambda_ {f} \left(x _ {t}\right)}{\lambda_ {f} \left(x _ {0}\right)} \leq \min \left\{\left(1 - \frac {1}{\kappa}\right) ^ {t}, \left(1 - \frac {1}{d \kappa}\right) ^ {\frac {t (t - 1)}{4}} \left(\frac {d \kappa}{t}\right) ^ {\frac {t}{2}} \right\}. +$$ + +Hence, for $t < d\kappa$ , the first upper bound is smaller and the Newton decrement converges at a linear rate of $(1 - \frac{1}{\kappa})^t$ and for $t \geq d\kappa$ the second term becomes smaller and we observe a superlinear rate of $\left(1 - \frac{1}{d\kappa}\right)^{\frac{t(t - 1)}{4}}\left(\frac{d\kappa}{t}\right)^{\frac{t}{2}}$ , which is faster than quadratic rate. + +Greedy-BFGS. Next, we present the convergence result for Greedy-BFGS in (Rodomanov & Nesterov, 2021a). If we set $G_0 = LI$ and the initial point $x_0$ satisfies + +$$ +\lambda_ {f} (x _ {0}) = \mathcal {O} \left(\frac {1}{d M \kappa}\right), +$$ + +then the iterates of Greedy-BFGS satisfy: + +$$ +\frac {\lambda_ {f} (x _ {t})}{\lambda_ {f} (x _ {0})} \leq \min \left\{\left(1 - \frac {1}{\kappa}\right) ^ {t}, \left(1 - \frac {1}{d \kappa}\right) ^ {\frac {t (t - 1)}{2}} \left(\frac {1}{2}\right) ^ {t} \right\}. +$$ + +We observe that the superlinear convergence appears after $d\kappa \ln (d\kappa)$ iterations for Greedy-BFGS, while for Sharpened-BFGS it takes $d\kappa$ steps to reach the superlinear convergence. Hence, Sharpened-BFGS achieves the superlinear rate with fewer iterations compared to Greedy-BFGS. Moreover, eventually the superlinear convergence rate of Sharpened-BFGS is faster than the one for Greedy-BFGS. This is because both of the methods achieve a quadratic convergence rate of the form $\left(1 - \frac{1}{d\kappa}\right)^{t^2}$ . However, when $t$ is sufficiently large, we have $\left(\frac{d\kappa}{t}\right)^{\frac{t}{2}} \ll \left(\frac{1}{2}\right)^{t}$ . + +BFGS. Now, we present the convergence result for BFGS provided in (Rodomanov & Nesterov, 2021c). If we set $G_0 = LI$ and the initial point $x_0$ satisfies + +$$ +\lambda_ {f} (x _ {0}) = \max \left\{\mathcal {O} \left(\frac {1}{M \kappa}\right), \mathcal {O} \left(\frac {1}{M d \ln \kappa}\right) \right\}, +$$ + +then the iterates of BFGS satisfy: + +$$ +\frac {\lambda_ {f} \left(x _ {t}\right)}{\lambda_ {f} \left(x _ {0}\right)} \leq \min \left\{\left(1 - \frac {1}{\kappa}\right) ^ {t}, \left(\frac {d \ln \kappa}{t}\right) ^ {\frac {t}{2}} \right\}. +$$ + +We observe that the superlinear convergence of BFGS starts after $d\ln \kappa$ steps, while it takes $d\kappa$ iterations for the appearance of the superlinear convergence of Sharpened-BFGS. However, the superlinear convergence rate of Sharpened-BFGS is faster than BFGS as for large $t$ we have + +$$ +\left(1 - \frac {1}{d \kappa}\right) ^ {\frac {t (t - 1)}{4}} \left(\frac {d \kappa}{t}\right) ^ {\frac {t}{2}} \ll \left(\frac {d \ln \kappa}{t}\right) ^ {\frac {t}{2}}. +$$ + +For the broad strokes, see the quantitative comparisons summarized in Table 1. + +![](images/e98518c8130643593562e9411f70f4b9871902d956108904bf0a8f131f2180d5.jpg) +(a) Dataset svmguide3. + +![](images/d1cc21a8ff2e6d622aeb283151f78c72ce995b8bc22bb0877a2c2df3155d6864.jpg) +(b) Dataset phishing. + +![](images/2357db18738f290ada4f2d80dff455bbfe8f5a204abc5e77127dc9c011bae3e8.jpg) +(c) Dataset mushrooms. + +![](images/a15c52dd75cd849c61ef0379c80d843be6185bed5adaf5c0a0a6f84c424f09a8.jpg) +(d) Dataset a9a. + +![](images/d75b40d4c52757ea174882c6c858aff5941b7700c69dabe853ba1f79115b0a81.jpg) +(e) Dataset connect-4. + +![](images/df572b0741e43ec270305a60a495c2c097b2cb3c906c1a4fa4c0f66997f0bb14.jpg) +(f) Dataset w8a. + +![](images/e8876632173f45cebf28ecf80b634fe597f2c03b4baf759310bcdeb73ca9af88.jpg) +(g) Dataset protein. + +![](images/19a13649b69273054547623a92f20ae2539b75053781b8ef8fd01771300ac8d7.jpg) +(h) Dataset colon-cancer. + +![](images/8accd385ca85ce8ca82fae4d9b442e5266e178c6c6093eff9527b00ecb3d5018.jpg) +(i) Dataset gisette. +Figure 2. Comparison of BFGS, Greedy-BFGS, Sharpened-BFGS and gradient descent (GD) on different datasets. + +# 5. Numerical Experiments + +In this section, we present our numerical experiments on different datasets to compare the performance of Sharpened-BFGS with BFGS and Greedy-BFGS. We focus on the following logistic regression problem with $l_{2}$ regularization + +$$ +\min _ {x \in \mathbb {R} ^ {d}} f (x) = \frac {1}{N} \sum_ {i = 1} ^ {N} \ln \left(1 + e ^ {- y _ {i} z _ {i} ^ {\top} x}\right) + \frac {\mu}{2} \| x \| ^ {2}, \tag {28} +$$ + +where $\{z_i\}_{i = 1}^N$ are the data points and $\{y_{i}\}_{i = 1}^{N}$ are their corresponding labels. We assume that $z_{i}\in \mathbb{R}^{d}$ and $y_{i}\in \{-1,1\}$ for all $1\leq i\leq N$ . This objective function is strongly convex with parameter $\mu >0$ . We normalize all data points such that $\| z_i\| = 1$ for all $1\leq i\leq N$ . Hence, the + +gradient of the function $f(x)$ is smooth with parameter $L = 1/4 + \mu$ . The logistic regression objective function is also strongly self-concordant; check Section 5.1 in (Rodomanov & Nesterov, 2021a). Therefore, the objective function $f(x)$ defined in (28) satisfies Assumptions 3.1-3.2. + +We conduct our experiments on eight datasets. All the parameters (sample size $N$ , dimension $d$ and regularization parameter $\mu$ ) of these different datasets are summarized in Table 2. The regularization parameter $\mu$ is chosen from the set $\mathcal{A} = \{10^{-5}, 10^{-4}, 10^{-3}, 10^{-2}, 10^{-1}, 1, 10\}$ to achieve the best performance. The algorithms that we study are (i) Sharpened-BFGS, (ii) standard BFGS, (iii) Greedy-BFGS, and (iv) gradient descent (GD). We initialize all the algorithms with the same initial point $x_0 = (1 / d^{3/2}) * \vec{1}$ , where + +
DatasetNdμ
svmguide31243210.01
phishing11055680.001
mushrooms81241120.001
a9a325611230.001
connect-4675571260.0001
w8a497493000.0001
protein177663570.0001
colon-cancer6220000.00001
gisette600050000.00001
+ +Table 2. Sample size $N$ , dimension $d$ , regularization parameter $\mu$ . + +$\vec{1} \in \mathbb{R}^d$ is the one vector. We set the initial Hessian approximation matrix as $LI$ and set the stepsize to 1 for all QN methods. The step size of gradient descent is set as $1 / L$ to achieve its linear convergence rate on each dataset. In practice, we found it is better not to apply the correction strategy in the hybrid and greedy methods (i.e., simply set $\hat{G}_t = \bar{G}_t$ in step 7 of Algorithm 2). The convergence rates of the ratio $\lambda_f(x_t) / \lambda_f(x_0)$ versus the number of iterations $t$ are presented in Figure 2. + +We observe that Sharpened-BFGS outperforms both the classical and greedy BFGS methods. More specifically, in the initial phase of the convergence process, Sharpened-BFGS exploits the Newton direction approximation of BFGS and has a fast convergence like BFGS, while Greedy-BFGS has a slower convergence at the beginning as it Hessian approximation is not accurate yet. Then, once the time index increases and almost approaches $d$ , and $d$ greedy updates are accomplished, the Hessian approximation of Greedy-BFGS becomes more accurate. As a result, Greedy-BFGS achieves a very fast convergence rate at this turning point. Similarly, Sharpened-BFGS follows the same fast convergence of Greedy-BFGS almost at the same time index, as it also exploits the Hessian approximation update rule in Greedy-BFGS. This behavior is consistent over all the considered datasets in our experiments, as illustrated in Figure 2. We should also add that these empirical observations are consistent with our theoretical findings and the performance comparisons of these algorithms in Section 4. + +# 6. Conclusions + +In this paper, we proposed a novel quasi-Newton method called Sharpened-BFGS for solving unconstrained convex optimization problems, where the objective function is strongly convex with $\mu$ , its gradient is smooth with $L$ , and it is strongly self-concordant with $M$ . Sharpened-BFGS benefits from the Newton direction approximation of BFGS as well as Hessian approximation of Greedy + +BFGS. Using these properties, we proved that the proposed Sharpened-BFGS achieves a superlinear convergence rate of $\mathcal{O}\left((1 - \frac{\mu}{dL})^{\frac{t(t - 1)}{4}}\left(\frac{dL}{t\mu}\right)^{\frac{t}{2}}\right)$ , which is faster than quadratic rate. We also compared the convergence results of our method with the classical BFGS and Greedy-BFGS methods and highlighted how Sharpened-BFGS takes advantage of the Newton direction approximation in BFGS and the Hessian approximation in Greedy-BFGS. We also numerically illustrated the advantages of our proposed method against BFGS and Greedy-BFGS. + +# Acknowledgement + +This research of Q. Jin and A. Mokhtari is supported in part by NSF Grants 2007668, 2019844, and 2112471, ARO Grant W911NF2110226, the Machine Learning Lab (MLL) at UT Austin, and the Wireless Networking and Communications Group (WnCG) Industrial Affiliates Program. + +# References + +Bennett, A. A. Newton's method in general analysis. Proceedings of the National Academy of Sciences of the United States of America, 2(10):592, 1916. +Boyd, S. and Vandenberghe, L. Convex Optimization. Cambridge University Press, New York, NY, USA, 2004. +Broyden, C. G. A class of methods for solving nonlinear simultaneous equations. Mathematics of computation, 19 (92):577-593, 1965. +Broyden, C. G. The convergence of single-rank quasiNewton methods. Mathematics of Computation, 24(110): 365-382, 1970. +Broyden, C. G., Jr., J. E. D., Broyden, and More, J. J. On the local and superlinear convergence of quasi-Newton methods. IMA J. Appl. Math, 12(3):223-245, June 1973. +Conn, A. R., Gould, N. I. M., and Toint, P. L. Convergence of quasi-Newton matrices generated by the symmetric rank one update. Mathematical programming, 50(1-3): 177-195, 1991. +Conn, A. R., Gould, N. I., and Toint, P. L. Trust region methods, volume 1. Siam, 2000. +Davidon, W. Variable metric method for minimization. Technical report, Argonne National Lab., Lemont, Ill., 1959. +Fletcher, R. A new approach to variable metric algorithms. The computer journal, 13(3):317-322, 1970. +Fletcher, R. and Powell, M. J. A rapidly convergent descent method for minimization. The computer journal, 6(2): 163-168, 1963. + +Gay, D. M. Some convergence properties of Broyden's method. SIAM Journal on Numerical Analysis, 16(4): 623-630, 1979. +Goldfarb, D. A family of variable-metric methods derived by variational means. Mathematics of computation, 24 (109):23-26, 1970. +Jin, Q. and Mokhtari, A. Non-asymptotic superlinear convergence of standard quasi-newton methods. arXiv preprint arXiv:2003.13607, 2020. +Lin, D., Ye, H., and Zhang, Z. Explicit superlinear convergence of broyden's method in nonlinear equations. arXiv preprint arXiv:2109.01974, 2021a. +Lin, D., Ye, H., and Zhang, Z. Greedy and random quasiNewton methods with faster explicit superlinear convergence. Advances in Neural Information Processing Systems 34, 2021b. +Liu, D. C. and Nocedal, J. On the limited memory BFGS method for large scale optimization. Mathematical programming, 45(1-3):503-528, 1989. +Nesterov, J. E. Self-concordant functions and polynomial-time methods in convex programming. Report, Central Economic and Mathematical Institute, USSR Acad. Sci, 1989. +Nesterov, Y. and Nemirovskii, A. Interior-point polynomial algorithms in convex programming. SIAM, 1994. +Nesterov, Y. and Polyak, B. T. Cubic regularization of Newton method and its global performance. Mathematical Programming, 108(1):177-205, 2006. +Nocedal, J. Updating quasi-Newton matrices with limited storage. Mathematics of computation, 35(151):773-782, 1980. +Nocedal, J. and Wright, S. Numerical optimization. Springer Science & Business Media, 2006. +Ortega, J. M. and Rheinboldt, W. C. Iterative solution of nonlinear equations in several variables, volume 30. Siam, 1970. +Rodomanov, A. and Nesterov, Y. Greedy quasi-newton methods with explicit superlinear convergence. SIAM Journal on Optimization, 31(1):785-811, 2021a. +Rodomanov, A. and Nesterov, Y. Rates of superlinear convergence for classical quasi-newton methods. Mathematical Programming, pp. 1-32, 2021b. +Rodomanov, A. and Nesterov, Y. New results on superlinear convergence of classical quasi-newton methods. Journal of Optimization Theory and Applications, 188(3):744-769, 2021c. + +Shanno, D. F. Conditioning of quasi-Newton methods for function minimization. Mathematics of computation, 24 (111):647-656, 1970. +Ye, H., Lin, D., Zhang, Z., and Chang, X. Explicit superlinear convergence rates of the sr1 algorithm. arXiv preprintarXiv:2105.07162, 2021. + +# Appendix + +# A. Preliminary Lemmas + +In this subsection, we develop some technical preliminaries which are critical in the path towards establishing our main convergence results. We begin with the following lemma regarding the BFGS operator defined in Sec. 2.1 + +Lemma A.1. Consider positive definite matrices $A, G \in \mathbb{R}^{d \times d}$ and suppose that $G_{+} = BFGS(A, G, u)$ as defined in (3) for any $u \in \mathbb{R}^d \setminus \{0\}$ . Then, the following results hold: + +1. For any constants $\xi, \eta \geq 1$ , we have + +$$ +\frac {1}{\xi} A \preceq G \preceq \eta A \Rightarrow \frac {1}{\xi} A \preceq G _ {+} \preceq \eta A. \tag {29} +$$ + +2. If $A \preceq G$ , then we have + +$$ +\sigma (A, G) - \sigma (A, G _ {+}) \geq \theta^ {2} (A, G, u). \tag {30} +$$ + +3. If $\frac{1}{\xi} A \preceq G$ and $\theta(A, G, u) \leq \xi$ , where $\xi \geq 1$ is a constant, then + +$$ +\sigma (A, G) - \sigma (A, G _ {+}) \geq \frac {1}{4 \xi^ {2}} \theta^ {2} (A, G, u) - \ln \xi . \tag {31} +$$ + +Proof. Check Lemma 2.1 in (Rodomanov & Nesterov, 2021b) for the proof of (29) and check Lemma 2.2 in (Rodomanov & Nesterov, 2021b) for the proof of (30). Now we prove (31). We denote $Det(A)$ as the determinant of the matrix $A \in \mathbb{R}^{d \times d}$ . Applying results of Lemma 2.4 in (Rodomanov & Nesterov, 2021b), we obtain that + +$$ +\psi (A, G) - \psi (A, G _ {+}) \geq \omega \left(\frac {\theta (A , G , u)}{\xi}\right), \tag {32} +$$ + +where + +$$ +\psi (A, G) := T r \left(A ^ {- 1} (G - A)\right) - \ln D e t \left(A ^ {- 1} G\right) = \sigma (A, G) - \ln D e t \left(A ^ {- 1} G\right), \tag {33} +$$ + +and + +$$ +\omega (t) := t - \ln (1 + t), \quad \forall t \geq - 1. \tag {34} +$$ + +Thus, we obtain that + +$$ +\begin{array}{l} \psi (A, G) - \psi (A, G _ {+}) = \sigma (A, G) - \sigma (A, G _ {+}) - \ln \operatorname {D e t} (A ^ {- 1} G) + \ln \operatorname {D e t} (A ^ {- 1} G _ {+}) \\ = \sigma (A, G) - \sigma (A, G _ {+}) + \ln \operatorname {D e t} \left(G ^ {- 1} G _ {+}\right). \tag {35} \\ \end{array} +$$ + +From Lemma 6.2 of (Rodomanov & Nesterov, 2021b), we have that + +$$ +D e t \left(G ^ {- 1} G _ {+}\right) = \frac {u ^ {\top} A u}{u ^ {\top} G u}. \tag {36} +$$ + +Hence, we get that + +$$ +\psi (A, G) - \psi (A, G _ {+}) = \sigma (A, G) - \sigma (A, G _ {+}) + \ln \frac {u ^ {\top} A u}{u ^ {\top} G u}. \tag {37} +$$ + +Substituting (37) into the (32), we obtain that + +$$ +\sigma (A, G) - \sigma (A, G _ {+}) \geq \omega \left(\frac {\theta (A , G , u)}{\xi}\right) - \ln \frac {u ^ {\top} A u}{u ^ {\top} G u}. \tag {38} +$$ + +Notice that the function $\omega (t)$ satisfies the following property, + +$$ +\omega (t) \geq \frac {t ^ {2}}{2 (t + 1)}, \quad \forall t \geq 0. \tag {39} +$$ + +Thus, we derive that + +$$ +\omega \left(\frac {\theta (A , G , u)}{\xi}\right) \geq \frac {\theta^ {2} (A , G , u) / \xi^ {2}}{2 \left(\theta (A , G , u) / \xi + 1\right)} = \frac {\theta^ {2} (A , G , u)}{2 \xi \left(\theta (A , G , u) + \xi\right)} \geq \frac {\theta^ {2} (A , G , u)}{4 \xi^ {2}}, \tag {40} +$$ + +where the second inequality is due to the condition $\theta(A, G, u) \leq \xi$ . From condition $\frac{1}{\xi} A \preceq G$ , we know that for any $u \in \mathbb{R}^d \setminus \{0\}$ + +$$ +\frac {u ^ {\top} A u}{u ^ {\top} G u} \leq \xi . \tag {41} +$$ + +Substituting (40) and (41) into (38), we achieve conclusion (31). + +![](images/4c76dba5ac6bd19106b27fadf96019724f9d92ae7f5b6f9d8d4ffd0046302cf9.jpg) + +In the following lemma, we show that the Hessians of the strongly self-concordant function at two different points. + +Lemma A.2. Suppose the objective function $f(x)$ is strongly self-concordant with constant $M > 0$ . Consider $x, y \in \mathbb{R}^d$ , $r = \| y - x\|_x$ and $J = \int_0^1 \nabla^2 f(x + \tau(y - x)) d\tau$ . Then, we have that + +$$ +\frac {\nabla^ {2} f (x)}{1 + M r} \preceq \nabla^ {2} f (y) \preceq (1 + M r) \nabla^ {2} f (x). \tag {42} +$$ + +$$ +\frac {\nabla^ {2} f (x)}{1 + \frac {M r}{2}} \preceq J \preceq \left(1 + \frac {M r}{2}\right) \nabla^ {2} f (x). \tag {43} +$$ + +$$ +\frac {\nabla^ {2} f (y)}{1 + \frac {M r}{2}} \preceq J \preceq \left(1 + \frac {M r}{2}\right) \nabla^ {2} f (y). \tag {44} +$$ + +Proof. Check Lemma 4.2 in (Rodomanov & Nesterov, 2021a). + +Lemma A.3. Suppose the objective function $f(x)$ satisfies the Assumption 3.1 and 3.2. Consider the following update + +$$ +x _ {t + 1} = x _ {t} - G _ {t} ^ {- 1} \nabla f (x _ {t}), \tag {45} +$$ + +where $G_{t} \in \mathbb{R}^{d \times d}$ is the s.p.d. Hessian approximation matrix satisfying that + +$$ +\nabla^ {2} f (x _ {t}) \preceq G _ {t} \preceq \eta \nabla^ {2} f (x _ {t}), \tag {46} +$$ + +where $\eta \geq 1$ is some constant. Suppose the following condition holds + +$$ +M \lambda_ {t} \leq 2. \tag {47} +$$ + +Denote that $r_t = \| x_{t+1} - x_t\|_{x_t}$ and $J_t = \int_0^1 \nabla^2 f(x_t + \tau(x_{t+1} - x_t)) d\tau$ . Then, we have + +$$ +r _ {t} \leq \lambda_ {t}, \tag {48} +$$ + +$$ +\theta \left(J _ {t}, G _ {t}, x _ {t + 1} - x _ {t}\right) \leq \frac {\eta - 1 + \frac {M \lambda_ {t}}{2}}{\eta}. \tag {49} +$$ + +Proof. From (45), we have that + +$$ +\begin{array}{l} r _ {t} = \left\| x _ {t + 1} - x _ {t} \right\| _ {x _ {t}} = \left(\nabla f (x _ {t}) ^ {\top} G _ {t} ^ {- 1} \nabla^ {2} f (x _ {t}) G _ {t} ^ {- 1} \nabla f (x _ {t})\right) ^ {\frac {1}{2}} \tag {50} \\ \leq \left(\nabla f (x _ {t}) ^ {\top} G _ {t} ^ {- 1} \nabla f (x _ {t})\right) ^ {\frac {1}{2}} \leq \left(\nabla f (x _ {t}) ^ {\top} \nabla^ {2} f (x _ {t}) ^ {- 1} \nabla f (x _ {t})\right) ^ {\frac {1}{2}} = \lambda_ {t}, \\ \end{array} +$$ + +where the inequalities hold due to (46). Therefore, (48) holds. Now we condition (49). Using (46) and (43) of Lemma A.2, we obtain that + +$$ +\frac {1}{1 + \frac {M r _ {t}}{2}} J _ {t} \preceq \nabla^ {2} f \left(x _ {t}\right) \preceq G _ {t} \preceq \eta \nabla^ {2} f \left(x _ {t}\right) \preceq \eta \left(1 + \frac {M r _ {t}}{2}\right) J _ {t}. \tag {51} +$$ + +Using $r_t \leq \lambda_t$ from (48), we get that + +$$ +\frac {1}{1 + \frac {M \lambda_ {t}}{2}} J _ {t} \preceq G _ {t} \preceq \eta \left(1 + \frac {M \lambda_ {t}}{2}\right) J _ {t}. \tag {52} +$$ + +Hence, we have + +$$ +- \left(1 - \frac {1}{\eta \left(1 + \frac {M \lambda_ {t}}{2}\right)}\right) J _ {t} ^ {- 1} \preceq G _ {t} ^ {- 1} - J _ {t} ^ {- 1} \preceq \frac {M \lambda_ {t}}{2} J _ {t} ^ {- 1}. \tag {53} +$$ + +Notice that + +$$ +\left(1 - \frac {1}{\eta \left(1 + \frac {M \lambda_ {t}}{2}\right)}\right) \leq 1 - \frac {1 - \frac {M \lambda_ {t}}{2}}{\eta} = \frac {\eta - 1 + \frac {M \lambda_ {t}}{2}}{\eta}. \tag {54} +$$ + +Since $M\lambda_{t} \leq 2$ and $\eta \geq 1$ , we have + +$$ +\frac {M \lambda_ {t}}{2} = 1 - \left(1 - \frac {M \lambda_ {t}}{2}\right) \leq 1 - \frac {1 - \frac {M \lambda_ {t}}{2}}{\eta} = \frac {\eta - 1 + \frac {M \lambda_ {t}}{2}}{\eta}. \tag {55} +$$ + +Therefore, we have + +$$ +- \frac {\eta - 1 + \frac {M \lambda_ {t}}{2}}{\eta} J _ {t} ^ {- 1} \preceq G _ {t} ^ {- 1} - J _ {t} ^ {- 1} \preceq \frac {\eta - 1 + \frac {M \lambda_ {t}}{2}}{\eta} J _ {t} ^ {- 1}. \tag {56} +$$ + +Hence, we get + +$$ +\left(G _ {t} ^ {- 1} - J _ {t} ^ {- 1}\right) J _ {t} \left(G _ {t} ^ {- 1} - J _ {t} ^ {- 1}\right) \preceq \left(\frac {\eta - 1 + \frac {M \lambda_ {t}}{2}}{\eta}\right) ^ {2} J _ {t} ^ {- 1}, \tag {57} +$$ + +$$ +s _ {t} ^ {\top} G _ {t} \left(G _ {t} ^ {- 1} - J _ {t} ^ {- 1}\right) J _ {t} \left(G _ {t} ^ {- 1} - J _ {t} ^ {- 1}\right) G _ {t} s _ {t} \leq \left(\frac {\eta - 1 + \frac {M \lambda_ {t}}{2}}{\eta}\right) ^ {2} s _ {t} ^ {\top} G _ {t} J _ {t} ^ {- 1} G _ {t} s _ {t}, \tag {58} +$$ + +where $s_t = x_{t+1} - x_t$ is the variable difference. Therefore, by the definition of $\theta$ in (13), we prove conclusion (49), + +$$ +\begin{array}{l} \theta \left(J _ {t}, G _ {t}, x _ {t + 1} - x _ {t}\right) = \left(\frac {s _ {t} ^ {\top} \left(G _ {t} - J _ {t}\right) J _ {t} ^ {- 1} \left(G _ {t} - J _ {t}\right) s _ {t}}{s _ {t} ^ {\top} G _ {t} J _ {t} ^ {- 1} G _ {t} s _ {t}}\right) ^ {\frac {1}{2}} \tag {59} \\ = \left(\frac {s _ {t} ^ {\top} G _ {t} (J _ {t} ^ {- 1} - G _ {t} ^ {- 1}) J _ {t} (J _ {t} ^ {- 1} - G _ {t} ^ {- 1}) G _ {t} s _ {t}}{s _ {t} ^ {\top} G _ {t} J _ {t} ^ {- 1} G _ {t} s _ {t}}\right) ^ {\frac {1}{2}} \leq \frac {\eta - 1 + \frac {M \lambda_ {t}}{2}}{\eta}. \\ \end{array} +$$ + +# B. Proof of Theorem 3.2 + +First, we use induction to prove the following condition + +$$ +A \preceq G _ {t} \preceq \frac {L}{\mu} A, \quad \forall t \geq 0. \tag {60} +$$ + +From $\mu I \preceq A \preceq LI$ , we observe that the initial Hessian approximation matrix $G_0 = LI$ satisfies $A \preceq G_0 \preceq \frac{L}{\mu} A$ . Hence, condition (60) holds for $t = 0$ . We assume that condition (60) holds for $t = k$ , i.e., $A \preceq G_k \preceq \frac{L}{\mu} A$ , where $k \geq 0$ . Applying (29) of Lemma A.1 to the update in step 4 of Algorithm 1, we obtain that $A \preceq \bar{G}_k \preceq \frac{L}{\mu} A$ . Applying (29) of Lemma A.1 again to the update in step 6 of Algorithm 1, we obtain that $A \preceq G_{k+1} \preceq \frac{L}{\mu} A$ . Therefore, condition (60) holds for $t = k+1$ . By induction, we prove that condition (60) holds for any $t \geq 0$ . Moreover, this condition implies that for any $t \geq 0$ , we have + +$$ +0 \preceq A ^ {- 1} - G _ {t} ^ {- 1} \preceq \left(1 - \frac {\mu}{L}\right) A ^ {- 1}. \tag {61} +$$ + +Hence, we obtain that + +$$ +(G _ {t} - A) A ^ {- 1} \left(G _ {t} - A\right) = G _ {t} \left(A ^ {- 1} - G _ {t} ^ {- 1}\right) A \left(A ^ {- 1} - G _ {t} ^ {- 1}\right) G _ {t} \preceq \left(1 - \frac {\mu}{L}\right) ^ {2} G _ {t} A ^ {- 1} G _ {t}, \tag {62} +$$ + +$$ +s _ {t} ^ {\top} \left(G _ {t} - A\right) A ^ {- 1} \left(G _ {t} - A\right) s _ {t} \leq \left(1 - \frac {\mu}{L}\right) ^ {2} s _ {t} G _ {t} A ^ {- 1} G _ {t} s _ {t}, \tag {63} +$$ + +where $s_t = x_{t+1} - x_t$ is the variable difference. By the definition of $\theta$ in (13), we have that + +$$ +\theta \left(A, G _ {t}, x _ {t + 1} - x _ {t}\right) = \left(\frac {s _ {t} ^ {\top} \left(G _ {t} - A\right) A ^ {- 1} \left(G _ {t} - A\right) s _ {t}}{s _ {t} G _ {t} A ^ {- 1} G _ {t} s _ {t}}\right) ^ {\frac {1}{2}} \leq 1 - \frac {\mu}{L}. \tag {64} +$$ + +Therefore, (14) holds for any $t \geq 0$ . Applying (12) of Lemma 3.1, we prove that + +$$ +\lambda_ {t + 1} = \theta \left(A, G _ {t}, x _ {t + 1} - x _ {t}\right) \lambda_ {t} \leq \left(1 - \frac {\mu}{L}\right) \lambda_ {t}, \quad \forall t \geq 0. \tag {65} +$$ + +Hence, we prove the linear convergence rate of (15). + +# C. Proof of Lemma 3.3 + +The initial Hessian approximation matrix $G_0 = LI \succeq A$ . Applying the same induction technique used in the proof of Theorem 3.2, we can prove that for any $t \geq 0$ + +$$ +G _ {t} \succeq A, \quad \bar {G} _ {t} \succeq A, \tag {66} +$$ + +where $\bar{G}_t$ is defined in step 4 of Algorithm 1. Using (30) of Lemma A.1, we have that + +$$ +\sigma \left(A, G _ {t}\right) - \sigma \left(A, \bar {G} _ {t}\right) \geq \theta^ {2} \left(A, G _ {t}, x _ {t + 1} - x _ {t}\right), \quad \forall t \geq 0. \tag {67} +$$ + +Applying (10) of Lemma 2.2 to the step 6 of Algorithm 1, we obtain that + +$$ +\sigma (A, G _ {t + 1}) \leq \left(1 - \frac {\mu}{d L}\right) \sigma (A, \bar {G} _ {t}), \quad \forall t \geq 0. \tag {68} +$$ + +We prove conclusion (16) by combining and regrouping the above two inequalities. Now we prove condition (17). Recall and define the following shorthanded notations + +$$ +\theta_ {t} = \theta (A, G _ {t}, x _ {t + 1} - x _ {t}), \quad \sigma_ {t} = \sigma (A, G _ {t}), \quad c = \frac {\mu}{d L}. \tag {69} +$$ + +Condition (16) is equivalent to + +$$ +\sigma_ {t} \leq (1 - c) \sigma_ {t - 1} - (1 - c) \theta_ {t - 1} ^ {2}, \quad \forall t \geq 1. \tag {70} +$$ + +Applying the above inequality recursively, we can derive that + +$$ +\begin{array}{l} \sigma_ {t} \leq (1 - c) \sigma_ {t - 1} - (1 - c) \theta_ {t - 1} ^ {2} \\ \leq (1 - c) ^ {2} \sigma_ {t - 2} - (1 - c) ^ {2} \theta_ {t - 2} ^ {2} - (1 - c) \theta_ {t - 1} ^ {2} \tag {71} \\ \leq (1 - c) ^ {t} \sigma_ {0} - \sum_ {i = 0} ^ {t - 1} (1 - c) ^ {t - i} \theta_ {i} ^ {2}. \\ \end{array} +$$ + +The above inequality indicates that + +$$ +\sum_ {i = 0} ^ {t - 1} (1 - c) ^ {t - i} \theta_ {i} ^ {2} \leq (1 - c) ^ {t} \sigma_ {0} - \sigma_ {t} \leq (1 - c) ^ {t} \sigma_ {0}. \tag {72} +$$ + +Dividing the term $(1 - c)^t$ on both sides of the above inequality, we can obtain that + +$$ +\sum_ {i = 0} ^ {t - 1} \frac {\theta_ {i} ^ {2}}{(1 - c) ^ {i}} \leq \sigma_ {0}. \tag {73} +$$ + +Hence, we prove the result (17) since $c = \frac{\mu}{dL}$ . + +![](images/76789fb0d0c12a0b9236d03ace03dd386ad86c763d38b28789e60fd7496fe7e4.jpg) + +# D. Proof of Theorem 3.4 + +Using the condition $A^{-1} \preceq \frac{1}{\mu} I$ and recalling the notation $c = \frac{\mu}{dL}$ , we can upper bound $\sigma_0$ by + +$$ +\sigma_ {0} = \sigma (A, G _ {0}) = T r (A ^ {- 1} L I) - d \leq T r (\frac {L}{\mu} I) - d = d (\frac {L}{\mu} - 1) \leq d \frac {L}{\mu} = \frac {1}{c}. \tag {74} +$$ + +Combining the above upper bound and (17), we derive that + +$$ +\sum_ {i = 0} ^ {t - 1} \frac {\theta_ {i} ^ {2}}{(1 - c) ^ {i}} \leq \sigma_ {0} \leq \frac {1}{c}. \tag {75} +$$ + +From (12) of Lemma 3.1, we obtain that + +$$ +\frac {\lambda_ {t}}{\lambda_ {0}} = \prod_ {i = 0} ^ {t - 1} \frac {\lambda_ {i + 1}}{\lambda_ {i}} = \prod_ {i = 0} ^ {t - 1} \theta_ {i} = \prod_ {i = 0} ^ {t - 1} (1 - c) ^ {\frac {i}{2}} \frac {\theta_ {i}}{(1 - c) ^ {\frac {i}{2}}} = \prod_ {i = 0} ^ {t - 1} (1 - c) ^ {\frac {i}{2}} \prod_ {i = 0} ^ {t - 1} \frac {\theta_ {i}}{(1 - c) ^ {\frac {i}{2}}} = (1 - c) ^ {\frac {t (t - 1)}{4}} \prod_ {i = 0} ^ {t - 1} \frac {\theta_ {i}}{(1 - c) ^ {\frac {i}{2}}}. \tag {76} +$$ + +Using the arithmetic-geometric mean inequality and (75), we derive that + +$$ +\prod_ {i = 0} ^ {t - 1} \frac {\theta_ {i}}{(1 - c) ^ {\frac {i}{2}}} = \left[ \prod_ {i = 0} ^ {t - 1} \frac {\theta_ {i} ^ {2}}{(1 - c) ^ {i}} \right] ^ {\frac {1}{2}} \leq \left[ \frac {1}{t} \sum_ {i = 0} ^ {t - 1} \frac {\theta_ {i} ^ {2}}{(1 - c) ^ {i}} \right] ^ {\frac {t}{2}} \leq \left(\frac {1}{c t}\right) ^ {\frac {t}{2}}. \tag {77} +$$ + +Leveraging (76) and (77), we achieve the final convergence rate of (18) + +$$ +\frac {\lambda_ {t}}{\lambda_ {0}} \leq (1 - c) ^ {\frac {t (t - 1)}{4}} \left(\frac {1}{c t}\right) ^ {\frac {t}{2}} = \left(1 - \frac {\mu}{d L}\right) ^ {\frac {t (t - 1)}{4}} \left(\frac {d L}{t \mu}\right) ^ {\frac {t}{2}}, \quad \forall t \geq 1. \tag {78} +$$ + +# E. Proof of Theorem 3.6 + +First, we use induction to prove the following condition + +$$ +\nabla^ {2} f (x _ {t}) \preceq G _ {t} \preceq \xi_ {t} \frac {L}{\mu} \nabla^ {2} f (x _ {t}), \quad \forall t \geq 0, \tag {79} +$$ + +where + +$$ +\xi_ {0} = 1 \quad \text {a n d} \quad \xi_ {t} = e ^ {2 M \sum_ {i = 0} ^ {t - 1} r _ {i}}, \quad \forall t \geq 1. \tag {80} +$$ + +We use induction to prove (79) and (80). When $t = 0$ , from Assumption 3.1 we know that + +$$ +\nabla^ {2} f (x _ {0}) \preceq G _ {0} = L I \preceq \frac {L}{\mu} \nabla^ {2} f (x _ {0}). \tag {81} +$$ + +Hence, (79) and (80) hold for $t = 0$ . Suppose that (79) and (80) hold for $t = k$ , we have that + +$$ +\nabla^ {2} f (x _ {k}) \preceq G _ {k} \preceq \xi_ {k} \frac {L}{\mu} \nabla^ {2} f (x _ {k}), \quad \xi_ {k} = e ^ {2 M \sum_ {i = 0} ^ {k - 1} r _ {i}}. \tag {82} +$$ + +Now we consider the case of $t = k + 1$ . Condition (43) of Lemma A.2 indicates that + +$$ +\frac {1}{1 + \frac {M r _ {k}}{2}} J _ {k} \preceq \nabla^ {2} f (x _ {k}) \preceq G _ {k} \preceq \xi_ {k} \frac {L}{\mu} \nabla^ {2} f (x _ {k}) \preceq \xi_ {k} \frac {L}{\mu} (1 + \frac {M r _ {k}}{2}) J _ {k}. \tag {83} +$$ + +where $J_{k} = \int_{0}^{1}\nabla^{2}f(x_{k} + \tau (x_{k + 1} - x_{k}))d\tau$ . Applying (29) of Lemma A.1, we have that + +$$ +\frac {1}{1 + \frac {M r _ {k}}{2}} J _ {k} \preceq \bar {G} _ {k} = B F G S \left(J _ {k}, G _ {k}, x _ {k + 1} - x _ {k}\right) \preceq \xi_ {k} \frac {L}{\mu} \left(1 + \frac {M r _ {k}}{2}\right) J _ {k}, \tag {84} +$$ + +where the equality is due to step 5 of Algorithm 2. Condition (44) of Lemma A.2 indicates that + +$$ +\frac {1}{(1 + \frac {M r _ {k}}{2}) ^ {2}} \nabla^ {2} f (x _ {k + 1}) \preceq \frac {1}{1 + \frac {M r _ {k}}{2}} J _ {k} \preceq \bar {G} _ {k} \preceq \xi_ {k} \frac {L}{\mu} (1 + \frac {M r _ {k}}{2}) J _ {k}, \preceq \xi_ {k} \frac {L}{\mu} (1 + \frac {M r _ {k}}{2}) ^ {2} \nabla^ {2} f (x _ {k + 1}). \tag {85} +$$ + +Multiplying the term $\left(1 + \frac{Mr_k}{2}\right)^2$ on both sides of the above inequality, we get that + +$$ +\nabla^ {2} f \left(x _ {k + 1}\right) \preceq \left(1 + \frac {M r _ {k}}{2}\right) ^ {2} \bar {G} _ {k} = \hat {G} _ {k} \preceq \xi_ {k} \frac {L}{\mu} \left(1 + \frac {M r _ {k}}{2}\right) ^ {4} \nabla^ {2} f \left(x _ {k + 1}\right), \tag {86} +$$ + +where the equality is due to step 7 of Algorithm 2. Applying the fact $1 + x \leq e^{x}$ , we have + +$$ +\xi_ {k} \left(1 + \frac {M r _ {k}}{2}\right) ^ {4} \leq \xi_ {k} e ^ {2 M r _ {k}} = e ^ {2 M \sum_ {i = 0} ^ {k - 1} r _ {i}} e ^ {2 M r _ {k}} = e ^ {2 M \sum_ {i = 0} ^ {k} r _ {i}} = \xi_ {k + 1}, \tag {87} +$$ + +where the first equality is due to the induction assumption in (82) and the last equality is due to the definition in (80). Substituting (87) into (86), we have that + +$$ +\nabla^ {2} f \left(x _ {k + 1}\right) \preceq \hat {G} _ {k} \preceq \xi_ {k + 1} \frac {L}{\mu} \nabla^ {2} f \left(x _ {k + 1}\right). \tag {88} +$$ + +Applying (29) of Lemma A.1 again and step 9 of Algorithm 2, we obtain that + +$$ +\nabla^ {2} f (x _ {k + 1}) \preceq G _ {k + 1} = B F G S (\nabla^ {2} f (x _ {k + 1}), \hat {G} _ {k}, \bar {u} (\nabla^ {2} f (x _ {k + 1}), \hat {G} _ {k})) \preceq \xi_ {k + 1} \frac {L}{\mu} \nabla^ {2} f (x _ {k + 1}). \tag {89} +$$ + +Hence, (79) and (80) hold for $t = k + 1$ . Therefore, We finish the proof of (79) and (80) using induction. + +Now, we use induction again to prove the result of (21) and (22). It's obvious that (22) holds for $t = 0$ . Suppose that (22) holds for $0 \leq t \leq k$ , we have that + +$$ +M \lambda_ {t} \leq M \lambda_ {0} \leq C _ {0} \frac {\mu}{L} = \frac {\ln \frac {3}{2}}{4} \frac {\mu}{L} < 1 < 2, \quad 0 \leq t \leq k, \tag {90} +$$ + +where we use the initial condition (20) and the fact $\mu \leq L$ . Conditions (79) and (90) imply that (48) and (49) of Lemma A.3 hold for all $0 \leq t \leq k$ where $\eta = \xi_t L / \mu$ . Hence, we have that + +$$ +\theta \left(J _ {t}, G _ {t}, x _ {t + 1} - x _ {t}\right) \leq \frac {\eta - 1 + \frac {M \lambda_ {t}}{2}}{\eta} = 1 - \frac {\mu}{L \xi_ {t}} \left(1 - \frac {M \lambda_ {t}}{2}\right), \quad 0 \leq t \leq k. \tag {91} +$$ + +Applying the initial condition (20) and the induction assumption of (22) for $0 \leq t \leq k$ , we observe that + +$$ +M \sum_ {i = 0} ^ {t} \lambda_ {i} \leq M \lambda_ {0} \sum_ {i = 0} ^ {t} \left(1 - \frac {\mu}{2 L}\right) ^ {i} \leq 2 M \frac {L}{\mu} \lambda_ {0} \leq 2 C _ {0}, \quad 0 \leq t \leq k. \tag {92} +$$ + +Consequently, + +$$ +e ^ {2 M \sum_ {i = 0} ^ {t} \lambda_ {i}} \leq e ^ {4 C _ {0}} = e ^ {\ln \frac {3}{2}} = \frac {3}{2}, \quad 0 \leq t \leq k. \tag {93} +$$ + +Since $M\lambda_{t} < 1$ from (90) and the fact that $1 - x / 2 \geq e^{-x}$ for $x \in (0,1)$ , we get that + +$$ +1 - \frac {M \lambda_ {t}}{2} \geq e ^ {- M \lambda_ {t}}, \quad 0 \leq t \leq k. \tag {94} +$$ + +Hence, we can obtain that for $0 \leq t \leq k$ , + +$$ +\begin{array}{l} \frac {1}{\xi_ {t}} \left(1 - \frac {M \lambda_ {t}}{2}\right) = e ^ {- 2 \sum_ {i = 0} ^ {t - 1} M r _ {i}} \left(1 - \frac {M \lambda_ {t}}{2}\right) \geq e ^ {- 2 \sum_ {i = 0} ^ {t - 1} M r _ {i}} e ^ {- M \lambda_ {t}} \tag {95} \\ \geq e ^ {- 2 \sum_ {i = 0} ^ {t - 1} M \lambda_ {i}} e ^ {- M \lambda_ {t}} \geq e ^ {- 2 M \sum_ {i = 0} ^ {t} \lambda_ {i}} \geq \frac {2}{3}, \\ \end{array} +$$ + +where the equality holds due to the definition of (80), the first inequality holds due to (94), the second inequality holds due to (48), the third inequality holds due to $M\lambda_{k} \geq 0$ and the last inequality holds due to (93). Substituting (95) into (91), we get that + +$$ +\theta \left(J _ {t}, G _ {t}, x _ {t + 1} - x _ {t}\right) \leq 1 - \frac {\mu}{L \xi_ {t}} \left(1 - \frac {M \lambda_ {t}}{2}\right) \leq 1 - \frac {2 \mu}{3 L}, \quad 0 \leq t \leq k. \tag {96} +$$ + +Therefore, (21) holds for $0 \leq t \leq k$ . Now consider the case of $t = k + 1$ . From (90) for $t = k$ and the fact that $(\ln \frac{3}{2}) / 8 < 1 / 16$ , we get that + +$$ +\frac {M \lambda_ {k}}{2} \leq \frac {\ln \frac {3}{2}}{8} \frac {\mu}{L} \leq \frac {\mu}{1 6 L}. \tag {97} +$$ + +From (19) of Lemma 3.5 and (48), we have that + +$$ +\lambda_ {k + 1} \leq \left(1 + \frac {M r _ {k}}{2}\right) \theta \left(J _ {k}, G _ {k}, x _ {k + 1} - x _ {k}\right) \lambda_ {k} \leq \left(1 + \frac {M \lambda_ {k}}{2}\right) \theta \left(J _ {k}, G _ {k}, x _ {k + 1} - x _ {k}\right) \lambda_ {k}. \tag {98} +$$ + +Substituting (96) for $t = k$ and (97) into (98), we get that + +$$ +\lambda_ {k + 1} \leq \left(1 + \frac {\mu}{1 6 L}\right) \left(1 - \frac {2 \mu}{3 L}\right) \lambda_ {k} = \left(1 - \frac {2 9 \mu}{4 8 L} - \frac {\mu^ {2}}{2 4 L ^ {2}}\right) \lambda_ {k} \leq \left(1 - \frac {2 9 \mu}{4 8 L}\right) \lambda_ {k} \leq \left(1 - \frac {\mu}{2 L}\right) \lambda_ {k}. \tag {99} +$$ + +Thus, condition (22) holds for $t = k + 1$ since + +$$ +\lambda_ {k + 1} \leq \left(1 - \frac {\mu}{2 L}\right) \lambda_ {k} \leq \left(1 - \frac {\mu}{2 L}\right) ^ {k + 1} \lambda_ {0}. \tag {100} +$$ + +Using the same technique we can prove that condition (21) holds for $t = k + 1$ . Therefore, we finish proving the conclusion (21) and (22) using induction. + +# F. Proof of Lemma 3.7 + +For brevity, we use the following shorthanded notations + +$$ +c = \frac {\mu}{2 d L}, \quad \rho_ {t} = 1 + \frac {M \lambda_ {f} \left(x _ {t}\right)}{2}, \quad \alpha_ {t} = \sigma_ {t} + 4 M d \lambda_ {t}, \quad \beta_ {t} = \rho_ {t} ^ {4} (1 + 8 M d \lambda_ {t}). \tag {101} +$$ + +The initial condition (23) indicates that $M\lambda_0 \leq C_0\mu / L \leq C_0 < 2$ . Hence, $r_t \leq \lambda_t$ of (48) in Lemma A.3 always holds for any $t \geq 0$ . Thus, we have that + +$$ +1 + \frac {M r _ {t}}{2} \leq 1 + \frac {M \lambda_ {t}}{2} = \rho_ {t}, \quad \forall t \geq 0. \tag {102} +$$ + +Substituting the above inequality into (43) and (44) of Lemma A.2, we obtain that + +$$ +\frac {\nabla^ {2} f \left(x _ {t}\right)}{\rho_ {t}} \preceq J _ {t} \preceq \rho_ {t} \nabla^ {2} f \left(x _ {t}\right), \quad \frac {\nabla^ {2} f \left(x _ {t + 1}\right)}{\rho_ {t}} \preceq J _ {t} \preceq \rho_ {t} \nabla^ {2} f \left(x _ {t + 1}\right). \tag {103} +$$ + +From (86) of the proof of Theorem 3.6, we showed that for any $t \geq 0$ , we have $\hat{G}_t \succeq \nabla^2 f(x_{t+1})$ . Recall that $G_{t+1} = BFGS(\nabla^2 f(x_{t+1}), \hat{G}_t, \bar{u})$ and $\bar{u} = \bar{u} (\nabla^2 f(x_{t+1}), \hat{G}_t)$ in step 8 and 9 of Algorithm 2. Applying Lemma 2.2, we obtain that + +$$ +\sigma_ {t + 1} \leq \left(1 - \frac {\mu}{d L}\right) \sigma \left(\nabla^ {2} f \left(x _ {t + 1}\right), \hat {G} _ {t}\right) \leq \left(1 - \frac {\mu}{2 d L}\right) \sigma \left(\nabla^ {2} f \left(x _ {t + 1}\right), \hat {G} _ {t}\right) = (1 - c) \sigma \left(\nabla^ {2} f \left(x _ {t + 1}\right), \hat {G} _ {t}\right). \tag {104} +$$ + +Using the condition $\hat{G}_t = (1 + \frac{Mr_t}{2})^2\bar{G}_t$ in step 7 of Algorithm 2 and (102), we can observe that $\hat{G}_t \leq \rho_t^2\bar{G}_t$ . Using this condition, (103) and the definition of $\sigma$ in (7), we obtain + +$$ +\sigma \left(\nabla^ {2} f \left(x _ {t + 1}\right), \hat {G} _ {t}\right) = T r \left(\nabla^ {2} f \left(x _ {t + 1}\right) ^ {- 1} \hat {G} _ {t}\right) - d \leq \rho_ {t} ^ {2} T r \left(\nabla^ {2} f \left(x _ {t + 1}\right) ^ {- 1} \bar {G} _ {t}\right) - d \leq \rho_ {t} ^ {3} T r \left(J _ {t} ^ {- 1} \bar {G} _ {t}\right) - d \tag {105} +$$ + +From (79), we know that + +$$ +\nabla^ {2} f (x _ {t}) \preceq G _ {t} \preceq \xi_ {t} \frac {L}{\mu} \nabla^ {2} f (x _ {t}), \quad \forall t \geq 0. \tag {106} +$$ + +Combining the above inequality and (103), we can show that, + +$$ +\frac {1}{\rho_ {t}} J _ {t} \preceq G _ {t} \preceq \xi_ {t} \frac {L}{\mu} \rho_ {t} J _ {t}, \quad \forall t \geq 0. \tag {107} +$$ + +From (21) of Theorem 3.6, we obtain that + +$$ +\theta_ {t} \leq 1 - \frac {2 \mu}{3 L} \leq 1 \leq \rho_ {t}. \tag {108} +$$ + +In summary, (107) shows that $G_{t} \succeq \frac{1}{\rho_{t}} J_{t}$ and (108) shows that $\theta_{t} \preceq \rho_{t}$ . Consider (31) of Lemma A.1 and take $G = G_{t}$ , $A = J_{t}$ , $G_{+} = BFGS(J_{t}, G_{t}, s_{t}) = \bar{G}_{t}$ in step 5 of Algorithm 2 and $\xi = \rho_{t}$ . Applying (31) of Lemma A.1, we obtain that + +$$ +\sigma \left(J _ {t}, G _ {t}\right) - \sigma \left(J _ {t}, \bar {G} _ {t}\right) \geq \frac {1}{4 \rho_ {t} ^ {2}} \theta_ {t} ^ {2} - \ln \rho_ {t}, \tag {109} +$$ + +which is equivalent to + +$$ +T r \left(J _ {t} ^ {- 1} \bar {G} _ {t}\right) \leq T r \left(J _ {t} ^ {- 1} G _ {t}\right) - \frac {1}{4 \rho_ {t} ^ {2}} \theta_ {t} ^ {2} + \ln \rho_ {t}, \tag {110} +$$ + +where we use the definition of $\sigma$ in (7). Substituting (110) into (105), we obtain that + +$$ +\sigma \left(\nabla^ {2} f \left(x _ {t + 1}\right), \hat {G} _ {t}\right) \leq \rho_ {t} ^ {3} \left(T r \left(J _ {t} ^ {- 1} G _ {t}\right) - \frac {1}{4 \rho_ {t} ^ {2}} \theta_ {t} ^ {2} + \ln \rho_ {t}\right) - d. \tag {111} +$$ + +Substituting (111) into (104), we have that + +$$ +\sigma_ {t + 1} \leq (1 - c) \left[ \rho_ {t} ^ {3} \left(T r \left(J _ {t} ^ {- 1} G _ {t}\right) - \frac {1}{4 \rho_ {t} ^ {2}} \theta_ {t} ^ {2} + \ln \rho_ {t}\right) - d \right]. \tag {112} +$$ + +Applying (103) and the definition of $\sigma$ in (7) again, we obtain that + +$$ +T r \left(J _ {t} ^ {- 1} G _ {t}\right) \leq \rho_ {t} T r \left(\nabla^ {2} f \left(x _ {t}\right) ^ {- 1} G _ {t}\right) = \rho_ {t} \left(\sigma_ {t} + d\right). \tag {113} +$$ + +Substituting (113) into (112), we achieve that + +$$ +\begin{array}{l} \sigma_ {t + 1} \leq (1 - c) \left[ \rho_ {t} ^ {3} \left(\rho_ {t} (\sigma_ {t} + d) - \frac {1}{4 \rho_ {t} ^ {2}} \theta_ {t} ^ {2} + \ln \rho_ {t}\right) - d \right] \\ = (1 - c) \left(\rho_ {t} ^ {4} \sigma_ {t} + \rho_ {t} ^ {4} d + \rho_ {t} ^ {3} \ln \rho_ {t} - d\right) - \frac {1}{4} (1 - c) \rho_ {t} \theta_ {t} ^ {2} \tag {114} \\ \leq (1 - c) \rho_ {t} ^ {4} (\sigma_ {t} + d + \frac {1}{\rho_ {t}} \ln \rho_ {t} - \frac {1}{\rho_ {t} ^ {4}} d) - \frac {1}{4} (1 - c) \theta_ {t} ^ {2}, \\ \end{array} +$$ + +where the last inequality holds due to the condition $\rho_t \geq 1$ . We have that + +$$ +\begin{array}{l} d + \frac {1}{\rho_ {t}} \ln \rho_ {t} - \frac {1}{\rho_ {t} ^ {4}} d \leq d + \frac {d}{\rho_ {t}} \ln \rho_ {t} - \frac {1}{\rho_ {t} ^ {4}} d = \frac {\rho_ {t} ^ {4} + \rho_ {t} ^ {3} \ln \rho_ {t} - 1}{\rho_ {t} ^ {4}} d \leq (\rho_ {t} ^ {4} + \rho_ {t} ^ {3} \ln \rho_ {t} - 1) d \\ = \left[ \left(1 + \frac {M \lambda_ {t}}{2}\right) ^ {4} + \left(1 + \frac {M \lambda_ {t}}{2}\right) ^ {3} \ln \left(1 + \frac {M \lambda_ {t}}{2}\right) - 1 \right] d \tag {115} \\ \leq \left(e ^ {2 M \lambda_ {t}} - 1 + \frac {M \lambda_ {t}}{2} e ^ {\frac {3}{2} M \lambda_ {t}}\right) d, \\ \end{array} +$$ + +where the first inequality is due to $d \geq 1$ , the second inequality is due to $\rho_t \geq 1$ and the last inequality holds due to $1 + x \leq e^x$ . Since the initial condition (23) holds, applying Theorem 3.6 we obtain that + +$$ +M \lambda_ {t} \leq M \lambda_ {0} \leq C _ {0} \frac {\mu}{L} \leq C _ {0} = \frac {\ln \frac {3}{2}}{4} \leq \frac {1}{8}. \tag {116} +$$ + +Hence, (115) can be upper bounded by + +$$ +\begin{array}{l} d + \frac {1}{\rho_ {t}} \ln \rho_ {t} - \frac {1}{\rho_ {t} ^ {4}} d \leq (e ^ {2 M \lambda_ {t}} - 1 + \frac {M \lambda_ {t}}{2} e ^ {\frac {3}{2} M \lambda_ {t}}) d \\ \leq \left(2 M \lambda_ {t} + 4 M ^ {2} \lambda_ {t} ^ {2} + \frac {M \lambda_ {t}}{2} e ^ {\frac {3}{2} M \lambda_ {t}}\right) d \\ = \left(2 + 4 M \lambda_ {t} + \frac {1}{2} e ^ {\frac {3}{2} M \lambda_ {t}}\right) M d \lambda_ {t} \tag {117} \\ \leq \left(2 + \frac {1}{2} + \frac {1}{2} e ^ {\frac {3}{1 6}}\right) M d \lambda_ {t} \\ \leq 4 M d \lambda_ {t}, \\ \end{array} +$$ + +where the second inequality is due to $e^x - 1 \leq x + x^2$ for $x \leq \frac{1}{4}$ and the third inequality is due to (116). Substituting (117) into (114), we reach that + +$$ +\sigma_ {t + 1} \leq (1 - c) \rho_ {t} ^ {4} (\sigma_ {t} + 4 M d \lambda_ {t}) - \frac {1}{4} (1 - c) \theta_ {t} ^ {2} = (1 - c) \left[ (1 + \frac {M \lambda_ {t}}{2}) ^ {4} (\sigma_ {t} + 4 M d \lambda_ {t}) - \frac {1}{4} \theta_ {t} ^ {2} \right]. \tag {118} +$$ + +This is equivalent to the conclusion (24). Now, we move forward to prove (25). Notice that (24) is equivalent to + +$$ +\sigma_ {t} \leq (1 - c) \rho_ {t - 1} ^ {4} \left(\sigma_ {t - 1} + 4 M d \lambda_ {t - 1}\right) - \frac {1}{4} (1 - c) \theta_ {t - 1} ^ {2}, \quad \forall t \geq 1. \tag {119} +$$ + +Recall the notation + +$$ +\alpha_ {t} = \sigma_ {t} + 4 M d \lambda_ {t}. \tag {120} +$$ + +Combining the above two conditions, we obtain that + +$$ +\alpha_ {t} \leq (1 - c) \rho_ {t - 1} ^ {4} \alpha_ {t - 1} - \frac {1}{4} (1 - c) \theta_ {t - 1} ^ {2} + 4 M d \lambda_ {t} \tag {121} +$$ + +Notice that for any symmetric positive semi-definite matrices $A, B \in \mathbb{R}^{d \times d}$ , we have + +$$ +B \preceq T r (A ^ {- 1} B) A. \tag {122} +$$ + +From (79) in the proof of Theorem 3.6, we know that $G_{t} \succeq \nabla^{2}f(x_{t})$ . Taking $A = \nabla^{2}f(x_{t})$ and $B = G_{t} - \nabla^{2}f(x_{t})$ in the above inequality and using the definition of $\sigma$ in (7), we get that + +$$ +G _ {t} - \nabla^ {2} f (x _ {t}) \preceq T r (\nabla^ {2} f (x _ {t}) ^ {- 1} (G _ {t} - \nabla^ {2} f (x _ {t}))) \nabla^ {2} f (x _ {t}) = \sigma_ {t} \nabla^ {2} f (x _ {t}). \tag {123} +$$ + +Hence, we obtain that + +$$ +\nabla^ {2} f (x _ {t}) \preceq G _ {t} \preceq (1 + \sigma_ {t}) \nabla^ {2} f (x _ {t}). \tag {124} +$$ + +Applying (49) of Lemma A.3 with $\eta = 1 + \sigma_t$ , we obtain that + +$$ +\theta_ {t} = \theta \left(J _ {t}, G _ {t}, x _ {t + 1} - x _ {t}\right) \leq \frac {\sigma_ {t} + \frac {M \lambda_ {t}}{2}}{1 + \sigma_ {t}} \leq \sigma_ {t} + \frac {M \lambda_ {t}}{2} \leq \sigma_ {t} + 4 M d \lambda_ {t}, \tag {125} +$$ + +where the second inequality is due to $\sigma_t \geq 0$ and the third inequality holds due to $d \geq 1$ . Combining (19) of Lemma 3.5, (48) and the above inequality, we have that + +$$ +\lambda_ {t + 1} \leq \left(1 + \frac {M r _ {t}}{2}\right) \theta_ {t} \lambda_ {t} \leq \left(1 + \frac {M \lambda_ {t}}{2}\right) \theta_ {t} \lambda_ {t} \leq \left(1 + \frac {M \lambda_ {t}}{2}\right) \left(\sigma_ {t} + 4 M d \lambda_ {t}\right) \lambda_ {t} = \rho_ {t} \alpha_ {t} \lambda_ {t}, \tag {126} +$$ + +Thus, we prove that + +$$ +\lambda_ {t} \leq \rho_ {t - 1} \alpha_ {t - 1} \lambda_ {t - 1} \quad \forall t \geq 1. \tag {127} +$$ + +Substituting (127) into (121), we have that + +$$ +\begin{array}{l} \alpha_ {t} \leq (1 - c) \rho_ {t - 1} ^ {4} \alpha_ {t - 1} + 4 M d \rho_ {t - 1} \alpha_ {t - 1} \lambda_ {t - 1} - \frac {1}{4} (1 - c) \theta_ {t - 1} ^ {2} \\ \leq (1 - c) \rho_ {t - 1} ^ {4} \alpha_ {t - 1} + 8 (1 - c) M d \rho_ {t - 1} ^ {4} \alpha_ {t - 1} \lambda_ {t - 1} - \frac {1}{4} (1 - c) \theta_ {t - 1} ^ {2} \tag {128} \\ = (1 - c) \rho_ {t - 1} ^ {4} \alpha_ {t - 1} (1 + 8 M d \lambda_ {t - 1}) - \frac {1}{4} (1 - c) \theta_ {t - 1} ^ {2}, \\ \end{array} +$$ + +where the second inequality is due to $\frac{1}{2} \leq 1 - \frac{\mu}{2L} = 1 - c$ and $\rho_{t-1} \geq 1$ . Recall the notation $\beta_t = \rho_t^4 (1 + 8Md\lambda_t)$ . The above inequality can be simplified as + +$$ +\alpha_ {t} \leq (1 - c) \beta_ {t - 1} \alpha_ {t - 1} - \frac {1}{4} (1 - c) \theta_ {t - 1} ^ {2}. \tag {129} +$$ + +Applying the above inequality recursively, we obtain the following result + +$$ +\begin{array}{l} \alpha_ {t} \leq (1 - c) \beta_ {t - 1} \alpha_ {t - 1} - \frac {1}{4} (1 - c) \theta_ {t - 1} ^ {2} \\ \leq (1 - c) ^ {2} \beta_ {t - 2} \beta_ {t - 1} \alpha_ {t - 2} - \frac {1}{4} (1 - c) ^ {2} \beta_ {t - 1} \theta_ {t - 2} ^ {2} - \frac {1}{4} (1 - c) \theta_ {t - 1} ^ {2} \tag {130} \\ \leq (1 - c) ^ {t} \alpha_ {0} \prod_ {j = 0} ^ {t - 1} \beta_ {j} - \frac {1}{4} \sum_ {i = 0} ^ {t - 1} (1 - c) ^ {t - i} \theta_ {i} ^ {2} \prod_ {j = i + 1} ^ {t - 1} \beta_ {j}. \\ \end{array} +$$ + +Here we regulate that $\prod_{j = t}^{t - 1}\beta_j$ is 1. The above inequality indicates that + +$$ +\frac {1}{4} \sum_ {i = 0} ^ {t - 1} (1 - c) ^ {t - i} \theta_ {i} ^ {2} \prod_ {j = i + 1} ^ {t - 1} \beta_ {j} \leq (1 - c) ^ {t} \alpha_ {0} \prod_ {j = 0} ^ {t - 1} \beta_ {j} - \alpha_ {t} \leq (1 - c) ^ {t} \alpha_ {0} \prod_ {j = 0} ^ {t - 1} \beta_ {j}. \tag {131} +$$ + +Since $\beta_{j} = \rho_{j}^{4}(1 + 6Md\lambda_{j})\geq 1$ for all $j\geq 1$ , we obtain that + +$$ +\prod_ {j = i + 1} ^ {t - 1} \beta_ {j} \geq 1, \quad 0 \leq i \leq t - 1. \tag {132} +$$ + +Applying $1 + x \leq e^{x}$ , we obtain that + +$$ +\beta_ {j} = (1 + \frac {M \lambda_ {j}}{2}) ^ {4} (1 + 8 M d \lambda_ {j}) \leq e ^ {2 M \lambda_ {j}} e ^ {8 M d \lambda_ {j}} = e ^ {1 0 M d \lambda_ {j}}, \quad \forall j \geq 0. \tag {133} +$$ + +Hence, from the linear convergence result of (22) and the initial condition (23), we observe + +$$ +\prod_ {j = 0} ^ {t - 1} \beta_ {j} \leq \prod_ {j = 0} ^ {t - 1} e ^ {1 0 M d \lambda_ {j}} = e ^ {1 0 M d \sum_ {j = 0} ^ {t - 1} \lambda_ {j}} \leq e ^ {1 0 M d \lambda_ {0} \sum_ {j = 0} ^ {t - 1} (1 - \frac {\mu}{2 L}) ^ {j}} \leq e ^ {2 0 M d \frac {L}{\mu} \lambda_ {0}} \leq e ^ {2 0 C _ {1}} = e ^ {\ln 2} = 2. \tag {134} +$$ + +Leveraging the results in (131), (132) and (134), we obtain that + +$$ +\frac {1}{4} \sum_ {i = 0} ^ {t - 1} (1 - c) ^ {t - i} \theta_ {i} ^ {2} \leq \frac {1}{4} \sum_ {i = 0} ^ {t - 1} (1 - c) ^ {t - i} \theta_ {i} ^ {2} \prod_ {j = i + 1} ^ {t - 1} \beta_ {j} \leq (1 - c) ^ {t} \alpha_ {0} \prod_ {j = 0} ^ {t - 1} \beta_ {j} \leq 2 (1 - c) ^ {t} \alpha_ {0}. \tag {135} +$$ + +This is equivalent to + +$$ +\sum_ {i = 0} ^ {t - 1} (1 - c) ^ {t - i} \theta_ {i} ^ {2} \leq 8 (1 - c) ^ {t} \alpha_ {0}. \tag {136} +$$ + +Dividing the term $(1 - c)^t$ on both sides of the above inequality, we can obtain that + +$$ +\sum_ {i = 0} ^ {t - 1} \frac {\theta_ {i} ^ {2}}{(1 - c) ^ {i}} \leq 8 \alpha_ {0}. \tag {137} +$$ + +Hence, we prove the result (25) since $c = \frac{\mu}{2dL}$ and $\alpha_0 = \sigma_0 + 4Md\lambda_0$ + +# G. Proof of Theorem 3.8 + +Using $G_0 = LI$ , initial condition (26), the definition of $\sigma$ in (7) and Assumption 3.1, we obtain + +$$ +\sigma_ {0} + 4 M d \lambda_ {0} = T r \left(\nabla^ {2} f \left(x _ {0}\right) ^ {- 1} G _ {0}\right) - d + 4 M d \lambda_ {0} \leq d \frac {L}{\mu} - d + 4 \frac {\ln 2}{2 0} \frac {\mu}{L} \leq d \frac {L}{\mu} - d + 1 \leq d \frac {L}{\mu}. \tag {138} +$$ + +Substituting (138) into (25), we have that + +$$ +\sum_ {i = 0} ^ {t - 1} \frac {\theta_ {i} ^ {2}}{(1 - c) ^ {i}} \leq 8 d \frac {L}{\mu}. \tag {139} +$$ + +Using Lemma 3.5 and (49) of Lemma A.3 and recalling the notation $\rho_{t} = 1 + \frac{M\Lambda_{t}}{2}$ , we obtain that + +$$ +\frac {\lambda_ {t}}{\lambda_ {0}} = \prod_ {i = 0} ^ {t - 1} \frac {\lambda_ {i + 1}}{\lambda_ {i}} \leq \prod_ {i = 0} ^ {t - 1} (1 + \frac {M r _ {i}}{2}) \theta_ {i} \leq \prod_ {i = 0} ^ {t - 1} (1 + \frac {M \lambda_ {i}}{2}) \theta_ {i} = \prod_ {i = 0} ^ {t - 1} \rho_ {i} \prod_ {i = 0} ^ {t - 1} \theta_ {i}. \tag {140} +$$ + +Applying $1 + x \leq e^{x}$ , $d \geq 1$ , the linear convergence result of (22) and the initial condition (26) again, we obtain that + +$$ +\prod_ {i = 0} ^ {t - 1} \rho_ {i} = \prod_ {i = 0} ^ {t - 1} (1 + \frac {M \lambda_ {i}}{2}) \leq e ^ {\frac {M}{2} \sum_ {i = 0} ^ {t - 1} \lambda_ {i}} \leq e ^ {\frac {M}{2} \lambda_ {0} \sum_ {i = 0} ^ {t - 1} \left(1 - \frac {\mu}{2 L}\right) ^ {i}} \leq e ^ {\frac {M}{2} \lambda_ {0} \frac {2 L}{\mu}} \leq e ^ {\frac {C _ {1}}{d}} \leq e ^ {C _ {1}} = e ^ {\frac {l n 2}{2 0}} \leq e ^ {\ln 2} = 2. \tag {141} +$$ + +Leveraging (140) and (141), we get that + +$$ +\frac {\lambda_ {t}}{\lambda_ {0}} \leq 2 \prod_ {i = 0} ^ {t - 1} \theta_ {i} = 2 \prod_ {i = 0} ^ {t - 1} (1 - c) ^ {\frac {i}{2}} \frac {\theta_ {i}}{(1 - c) ^ {\frac {i}{2}}} = 2 \prod_ {i = 0} ^ {t - 1} (1 - c) ^ {\frac {i}{2}} \prod_ {i = 0} ^ {t - 1} \frac {\theta_ {i}}{(1 - c) ^ {\frac {i}{2}}} = 2 (1 - c) ^ {\frac {t (t - 1)}{4}} \prod_ {i = 0} ^ {t - 1} \frac {\theta_ {i}}{(1 - c) ^ {\frac {i}{2}}}. \tag {142} +$$ + +Using the arithmetic-geometric mean inequality and (139), we obtain that + +$$ +\prod_ {i = 0} ^ {t - 1} \frac {\theta_ {i}}{(1 - c) ^ {\frac {i}{2}}} = \left[ \prod_ {i = 0} ^ {t - 1} \frac {\theta_ {i} ^ {2}}{(1 - c) ^ {i}} \right] ^ {\frac {1}{2}} \leq \left[ \frac {1}{t} \sum_ {i = 0} ^ {t - 1} \frac {\theta_ {i} ^ {2}}{(1 - c) ^ {i}} \right] ^ {\frac {t}{2}} \leq \left(\frac {8 d L}{\mu t}\right) ^ {\frac {t}{2}}. \tag {143} +$$ + +Combining (142), (143) and $c = \frac{\mu}{2dL}$ , we achieve the final convergence rate of (27) + +$$ +\frac {\lambda_ {t}}{\lambda_ {0}} \leq 2 (1 - c) ^ {\frac {t (t - 1)}{4}} \left(\frac {8 d L}{\mu t}\right) ^ {\frac {t}{2}} = 2 \left(1 - \frac {\mu}{2 d L}\right) ^ {\frac {t (t - 1)}{4}} \left(\frac {8 d L}{t \mu}\right) ^ {\frac {t}{2}}, \quad \forall t \geq 1. \tag {144} +$$ + +# H. Randomized Sharpened-BFGS Algorithm + +In this section, we extend our analysis to the randomized version of Sharpened-BFGS method. This is enlightened by the latest work of (Ye et al., 2021), where the authors proposed the modified Greedy-BFGS method based on the Cholesky factorization of the inverse Hessian approximation matrix. They presented that instead of selecting the greedy direction defined in (9) of Lemma 2.2, we consider the following Greedy-BFGS update $G_{+} = BFGS(A,G,R\bar{u} (A,R))$ , where $R$ is the upper triangular matrix satisfying $A^{-1} = R^{\top}R$ and $\bar{u} (A,R)$ is defined as + +$$ +\bar {u} (A, R) := \underset {u \in \{e _ {i} \} _ {i = 1} ^ {d}} {\arg \max } \frac {u ^ {\top} R ^ {- \top} A ^ {- 1} R ^ {- 1} u}{u ^ {\top} u}. \tag {145} +$$ + +Then, the linear convergence rate of $1 - 1 / (d\kappa)$ in (10) of Lemma 2.2 can be improved to $1 - 1 / d$ , which is independent of the condition number $\kappa = L / \mu$ . However, for each unit vector $e_i$ the computational cost of the term $e_i^\top R^{-\top}A^{-1}R^{-1}e_i$ is $\mathcal{O}(d^2)$ . Hence, the cost of calculating the vector $\bar{u}(A,R)$ in (145) is $\mathcal{O}(d^3)$ , which makes this modified greedy update impractical to implement. Therefore, the authors of (Ye et al., 2021) proposed to replace the greedy vector in (145) by the random vector $\tilde{u}\sim \mathcal{N}(0,I_d)$ and consider the randomized BFGS update $\tilde{G}_{+} = BFGS(A,G,R\tilde{u})$ , where $R$ is still the upper triangular Cholesky factorization matrix of $A^{-1}$ . The condition-number-free linear convergence rate of $1 - 1 / d$ is preserved for this randomized algorithm. This is summarized in the following lemma. + +Lemma H.1 ((Ye et al., 2021)). Consider positive definite matrices $A, G \in \mathbb{R}^{d \times d}$ that satisfy $A \preceq G$ . Suppose that $\bar{G}_{+} = BFGS(A, G, R^{\top}\tilde{u})$ where $R$ is the upper triangular matrix with $G^{-1} = R^{\top}R$ and $\tilde{u} \sim \mathcal{N}(0, I_d) \in \mathbb{R}^d$ is the random vector. Then, we have + +$$ +\mathbb {E} \left[ \sigma (A, \bar {G} _ {+}) \right] \leq \left(1 - \frac {1}{d}\right) \mathbb {E} \left[ \sigma (A, G) \right]. \tag {146} +$$ + +Notice that the computational cost of Cholesky decomposition is in general $\mathcal{O}(d^3)$ for a matrix with dimension $d$ . However, the expense per iteration of randomized BFGS method could be reduced to $\mathcal{O}(d^2)$ using technique highlighted in (Ye et al., 2021). Therefore, we can improve the superlinear convergence rate of our Sharpened-BFGS algorithm by replacing the Greedy-BFGS update with the randomized BFGS method proposed in (Ye et al., 2021). Meanwhile, the computational cost per iteration of randomized Sharpened-BFGS method is still $\mathcal{O}(d^2)$ . This novel randomized Sharpened-BFGS method is summarized in Algorithm 3. The local linear convergence rate presented in Theorem 3.6 still holds for this randomized Sharpened-BFGS method. In the following theorem, we directly show the explicit local superlinear convergence rate for this randomized Sharpened-BFGS algorithm. + +Theorem H.2. Consider the randomized Sharpened-BFGS quasi-Newton method in Algorithm 3 applied to the objective function satisfying Assumption 3.1 and 3.2. Suppose that the initial point $x_0$ satisfies that + +$$ +\lambda_ {0} \leq \frac {C _ {1} \mu}{d M L}, \quad C _ {1} = \frac {\ln 2}{2 0}. \tag {147} +$$ + +Then, we can reach the following local superlinear convergence rate with high probability + +$$ +\lambda_ {t} \leq 2 \left(1 - \frac {1}{2 d}\right) ^ {\frac {t (t - 1)}{4}} \left(\frac {8 d L}{t \mu}\right) ^ {\frac {t}{2}} \lambda_ {0}, \quad \forall t \geq 1. \tag {148} +$$ + +Proof. Here we just present the abbreviated proof to avoid repeated details since the proof of this theorem is very similar to the proof of Lemma 3.7 and Theorem 3.8. From the theory of probability, Lemma H.1 shows that there exists a constant $\delta$ such that the inequality + +$$ +\sigma (A, \bar {G} _ {+}) \leq \left(1 - \frac {1}{d}\right) \sigma (A, G) \tag {149} +$$ + +holds with probability at least $1 - \delta$ . Here we neglect this parameter $\delta$ to simplify the proof and denote that the above inequality holds with high probability. Then, applying the same techniques from the proof of Lemma 3.7, we can show that the following condition holds with high probability for any $t \geq 0$ + +$$ +\sigma_ {t + 1} \leq \left(1 - \frac {1}{2 d}\right) \left[ \left(1 + \frac {M \lambda_ {t}}{2}\right) ^ {4} \left(\sigma_ {t} + 4 M d \lambda_ {t}\right) - \frac {1}{4} \theta_ {t} ^ {2} \right], \tag {150} +$$ + +where $\theta_t \coloneqq \theta(\nabla^2 f(x_t), G_t, x_{t+1} - x_t)$ and $\sigma_t \coloneqq \sigma(\nabla^2 f(x_t), G_t)$ . Moreover, we have that with high probability + +$$ +\sum_ {i = 0} ^ {t - 1} \frac {\theta_ {i} ^ {2}}{(1 - \frac {1}{2 d}) ^ {i}} \leq 8 \left(\sigma_ {0} + 4 M d \lambda_ {0}\right), \quad \forall t \geq 1. \tag {151} +$$ + +Finally, using the same methods from the proof of Theorem 3.8, we can prove that the suplinear convergence rate of (148) holds with high probability. + +We observe that the quadratic convergence rate term is $\mathcal{O}((1 - 1 / d)^{t^2})$ in the above superlinear convergence rate in (148), which is independent of the condition number $\kappa$ . This condition-number-free quadratic convergence rate is the direct consequence of the linear convergence rate of (146) from Lemma H.1. + +Algorithm 3 The randomized Sharpened-BFGS method. +Require: Initial point $x_0$ and initial Hessian approximation matrix $G_0 = LI$ . +1: for $t = 0,1,2,\ldots$ do +2: Update the variable: $x_{t + 1} = x_t - G_t^{-1}\nabla f(x_t)$ ; +3: Compute the variable difference: $s_t = x_{t + 1} - x_t$ ; +4: Set the matrix: $J_{t} = \int_{0}^{1}\nabla^{2}f(x_{t} + \tau s_{t})d\tau$ ; +5: Compute the matrix: $\hat{G}_t = BFGS(J_t,G_t,s_t)$ ; +6: Compute the correction term: $r_t = \| x_{t + 1} - x_t\|_{x_t}$ ; +7: Compute the matrix: $\hat{G}_t = (1 + Mr_t / 2)^2\bar{G}_t$ ; +8: Compute upper triangular matrix: $R_{t}$ with $\hat{G}_t^{-1} = R_t^\top R_t$ ; +9: Choose the random direction: $\tilde{u}\sim \mathcal{N}(0,I_d)$ ; +10: Compute $G_{t + 1} = BFGS(\nabla^2 f(x_{t + 1}),\hat{G}_t,R_t^\top \tilde{u})$ ; +11: end for \ No newline at end of file diff --git a/sharpenedquasinewtonmethodsfastersuperlinearrateandlargerlocalconvergenceneighborhood/images.zip b/sharpenedquasinewtonmethodsfastersuperlinearrateandlargerlocalconvergenceneighborhood/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..0d14e9700fb13b561874d4ab9b25103258fe1c78 --- /dev/null +++ b/sharpenedquasinewtonmethodsfastersuperlinearrateandlargerlocalconvergenceneighborhood/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:24cfb694b4a7b2ef52531f85f50106620488f196eebbbfcedbffc8140f2b3f0c +size 1487802 diff --git a/sharpenedquasinewtonmethodsfastersuperlinearrateandlargerlocalconvergenceneighborhood/layout.json b/sharpenedquasinewtonmethodsfastersuperlinearrateandlargerlocalconvergenceneighborhood/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..aa8f4401aa1eb25d0f992294573cfd755b9f1e5b --- /dev/null +++ b/sharpenedquasinewtonmethodsfastersuperlinearrateandlargerlocalconvergenceneighborhood/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2d14f9b4358d6258627cc092b7aa24547a84e966cf59bf2fa64fb806726995ca +size 1134252 diff --git a/sharpmamlsharpnessawaremodelagnosticmetalearning/dae7bfee-0aab-4e9c-af5e-3bff1b3e2fcc_content_list.json b/sharpmamlsharpnessawaremodelagnosticmetalearning/dae7bfee-0aab-4e9c-af5e-3bff1b3e2fcc_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..cd87df97b049ce9d8532b5797f9d76a7cdfba885 --- /dev/null +++ b/sharpmamlsharpnessawaremodelagnosticmetalearning/dae7bfee-0aab-4e9c-af5e-3bff1b3e2fcc_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:628fb6f2134126506b8e70be85181f331869dcd37c93235eaa5fa25e0a7a7494 +size 184546 diff --git a/sharpmamlsharpnessawaremodelagnosticmetalearning/dae7bfee-0aab-4e9c-af5e-3bff1b3e2fcc_model.json b/sharpmamlsharpnessawaremodelagnosticmetalearning/dae7bfee-0aab-4e9c-af5e-3bff1b3e2fcc_model.json new file mode 100644 index 0000000000000000000000000000000000000000..15cca1d35166b67cb9a5dbc01b264e1f070065df --- /dev/null +++ b/sharpmamlsharpnessawaremodelagnosticmetalearning/dae7bfee-0aab-4e9c-af5e-3bff1b3e2fcc_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:35c8f4d84da01d0b556a173f8d10b05771ca3ce965a7e0e7ca125111f44224f9 +size 218396 diff --git a/sharpmamlsharpnessawaremodelagnosticmetalearning/dae7bfee-0aab-4e9c-af5e-3bff1b3e2fcc_origin.pdf b/sharpmamlsharpnessawaremodelagnosticmetalearning/dae7bfee-0aab-4e9c-af5e-3bff1b3e2fcc_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..02bffda81dbd8edc8928848b8ab5fdbea6a31108 --- /dev/null +++ b/sharpmamlsharpnessawaremodelagnosticmetalearning/dae7bfee-0aab-4e9c-af5e-3bff1b3e2fcc_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:73260e3ed6a153cf4611d0deb13f25027b8fc234060391bd6fd6f0468394bcb8 +size 1927923 diff --git a/sharpmamlsharpnessawaremodelagnosticmetalearning/full.md b/sharpmamlsharpnessawaremodelagnosticmetalearning/full.md new file mode 100644 index 0000000000000000000000000000000000000000..ddf0d573e6991fe0fe6c414364d372196619ff7a --- /dev/null +++ b/sharpmamlsharpnessawaremodelagnosticmetalearning/full.md @@ -0,0 +1,957 @@ +# Sharp-MAML: Sharpness-Aware Model-Agnostic Meta Learning + +Momin Abbas $^{*1}$ Quan Xiao $^{*1}$ Lisha Chen $^{*1}$ Pin-Yu Chen $^{2}$ Tianyi Chen $^{1}$ + +# Abstract + +Model-agnostic meta learning (MAML) is currently one of the dominating approaches for few-shot meta-learning. Albeit its effectiveness, the optimization of MAML can be challenging due to the innate bilevel problem structure. Specifically, the loss landscape of MAML is much more complex with possibly more saddle points and local minimizers than its empirical risk minimization counterpart. To address this challenge, we leverage the recently invented sharpness-aware minimization and develop a sharpness-aware MAML approach that we term Sharp-MAML. We empirically demonstrate that Sharp-MAML and its computation-efficient variant can outperform the plain-vanilla MAML baseline (e.g., +3% accuracy on Mini-Imagenet). We complement the empirical study with the convergence rate analysis and the generalization bound of Sharp-MAML. To the best of our knowledge, this is the first empirical and theoretical study on sharpness-aware minimization in the context of bilevel learning. The code is available at https://github.com/mominabbass/Sharp-MAML. + +# 1. Introduction + +Humans tend to easily learn new concepts using only a handful of samples. In contrast, modern deep neural networks require thousands of samples to train a model that generalizes well to unseen data (Krizhevsky et al., 2012). Meta learning is a remedy to such a problem whereby new concepts can be learned using a limited number of samples (Schmidhuber, 1987; Vilalta & Drissi, 2002). Meta learning offers fast adaptation to unseen tasks (Thrun & Pratt, 2012; Novak & Gowin, 1984) and has been widely studied to produce state of the art results in a variety of few-shot learning settings including language and vision tasks + +*Equal contribution ${}^{1}$ Rensselaer Polytechnic Institute,Troy, NY ${}^{2}$ IBM Thomas J. Watson Research Center,NY,USA. Correspondence to: Tianyi Chen . + +Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s). + +(Munkhdalai & Yu, 2017; Nichol & Schulman, 2018; Snell et al., 2017; Wang et al., 2016; Li & Malik, 2017; Vinyals et al., 2016; Andrychowicz et al., 2016; Brock et al., 2018; Zintgraf et al., 2019a; Wang et al., 2019; Achille et al., 2019; Li et al., 2018a; Hsu et al., 2018; Obamuyide & Vlachos, 2019). In particular, model-agnostic meta learning (MAML) is one of the most popular optimization-based meta learning frameworks for few-shot learning (Finn et al., 2017; Vuorio et al., 2019; Yin et al., 2020; Obamuyide & Vlachos, 2019). MAML aims to learn an initialization such that after applying only a few number of gradient descent updates on the initialization, the adapted task-specific model can achieve desired performance on the validation dataset. MAML has been successfully implemented in various data-limited applications including medical image analysis (Maicas et al., 2018), language modelling (Huang et al., 2018), and object detection (Wang et al., 2020). + +Despite its recent success on some applications, MAML faces a variety of optimization challenges. For example, MAML incurs high computation cost due to second-order derivatives, requires searching for multiple hyperparameters, and is sensitive to neural network architectures (Antoniou et al., 2019). Even if various optimization techniques can potentially overcome these training challenges (e.g., making training error small), whether the meta-model learned with limited training samples can lead to small generalization error or testing error in unseen tasks with unseen data, is not guaranteed (Rothfuss et al., 2021). + +These training and generalization challenges of MAML are partially due to the nested (e.g., bilevel) structure of the problem, where the upper-level optimization problem learns shared model initialization and the lower-level problem optimizes task-specific models (Finn et al., 2017; Rajeswaran et al., 2019a). This is in sharp contrast to the more widely known single-level learning framework - empirical risk minimization (ERM). As a result, the training and generalization challenges in ERM will not only remain in MAML but may be also exacerbated by the bilevel structure of MAML. For example, as we will show later, the nonconvex loss landscape of MAML contains possibly more saddle points and local minimizers than its ERM counterpart, many of which do not have good generalization performance. Recent works have proposed various useful techniques to improve the generalization performance (Grant et al., 2018a; Park & Oliva, + +2019; Antoniou et al., 2019; Kao et al., 2021), but none of them are from the perspective of the optimization landscape. + +Given the nested nature of bilevel learning models such as MAML, this paper aims to answer the following question: + +How can we find nonconvex bilevel learning models such as MAML that generalize well? + +In an attempt to provide a satisfactory answer to this question, we use MAML as a concrete case of bilevel learning and incorporate a recently proposed sharpness-aware minimization (SAM) algorithm (Foret et al., 2021) into the MAML baseline. Originally designed for single-level problems such as ERM, SAM improves the generalization ability of non-convex models by leveraging the connection between generalization and sharpness of the loss landscape (Foret et al., 2021). We demonstrate the power of integrating SAM into MAML by: i) empirically showing that it outperforms the popular MAML baseline; and, ii) theoretically showing it leads to the potentially improved generalization bound. To the best of our knowledge, this is the first study on sharpness-aware minimization in the context of bilevel optimization. + +# 1.1. Our contributions + +We summarize our contributions below. + +(C1) Sharpness-aware optimization for MAML with improved empirical performance. We theoretically and empirically discover that the loss landscape of bilevel models such as MAML is more involved than its ERM counterpart with possibly more saddle points and local minimizers. To overcome this challenge, we develop a sharpness-aware MAML approach that we term Sharp-MAML and its computation-efficient variant. Intuitively, Sharp-MAML avoids the sharp local minima of MAML loss functions and achieves better generalization performance. We empirically demonstrate that Sharp-MAML can outperform the plain-vanilla MAML baseline. +(C2) Optimization analysis of Sharp-MAML including MAML as a special case. We establish the $\mathcal{O}(1 / \sqrt{T})$ convergence rate of Sharp-MAML through the lens of recent bilevel optimization analysis (Chen et al., 2021a), where $T$ is the number of iterations. This corresponds to $\mathcal{O}(\epsilon^{-2})$ sample complexity as a fixed number of samples are used per iteration. The convergence rate and sample complexity match those of training single-level ERM models, and improves the known $\mathcal{O}(\epsilon^{-3})$ sample complexity of MAML. +(C3) Generalization analysis of Sharp-MAML demonstrating its improved generalization performance. We quantify the generalization performance of models learned by Sharp-MAML through the lens of a recently developed + +probably approximately correct (PAC)-Bayes framework (Farid & Majumdar, 2021). The generalization bound justifies the desired empirical performance of models learned from Sharp-MAML, and provides some insights on why models learned through Sharp-MAML can have better generalization performance than that from MAML. + +# 1.2. Technical challenges + +Due to the bilevel structure of both SAM and MAML, formally quantifying the optimization and generalization performance of Sharp-MAML is highly nontrivial. + +Specifically, the state-of-the-art convergence analysis of bilevel optimization (e.g., (Chen et al., 2021a)) only applies to the case where the upper- and lower-level are both minimization problems. Unfortunately, this prerequisite is not satisfied in Sharp-MAML. In addition, the existing analysis of MAML in (Fallah et al., 2020) requires the growing batch size and thus results in a suboptimal $\mathcal{O}(\epsilon^{-3})$ sample complexity. From the theoretical perspective, this work not only broadens the applicability of the recent analysis of bilevel optimization (Chen et al., 2021a) to tackle Sharp-MAML problems, but also tightens the analysis of the original MAML (Fallah et al., 2020). For the generalization analysis of Sharp-MAML, different from the classical PAC-Bayes analysis for single-level problems as in SAM (Foret et al., 2021), both the lower and upper level problems of MAML contribute to the generalization error. Going beyond the PAC-Bayes analysis in (Foret et al., 2021), we further discuss how the choice of the perturbation radius in SAM affects the bound, providing insights on why Sharp-MAML improves over MAML in terms of generalization ability. + +# 1.3. Related work + +We review related work from the following three aspects. + +Loss landscape of non-convex optimization. The connection between the flatness of minima and the generalization performance of the minimizers has been studied both theoretically and empirically; see e.g., (Dziugaite & Roy, 2016; Dinh et al., 2017; Keskar et al., 2017; Neyshabur et al., 2019). In a recent study, (Jiang et al., 2019) has showed empirically that sharpness-based measure has the highest correlation with generalization. Furthermore, (Izmailov et al., 2018) has showed that averaging model weights during training yields flatter minima that can generalize better. + +Sharpness-aware minimization. Motivated by the connection between sharpness of a minimum and generalization performance, (Foret et al., 2021) developed the SAM algorithm that encourages the learning algorithm to converge to a flat minimum, thereby improving its generalization performance. Recent follow-up works on SAM showed the efficacy of SAM in various settings. Notably, (Bahri + +et al., 2021) used SAM to improve the generalization performance of language models like text-to-text Transformer (Raffel et al., 2020) and its multilingual counterpart (Xue et al., 2020). More importantly, they empirically showed that the gains achieved by SAM are even more when the training data are limited. Furthermore, (Chen et al., 2021b) showed that vision models such as transformers (Dosovitskiy et al., 2020) and MLP-mixers (Tolstikhin et al., 2021) suffer from sharp loss landscapes that can be better trained via SAM. They showed that the generalization performance of resultant models improves across various tasks including supervised, adversarial, contrastive, and transfer learning (e.g., $11.0\%$ increase in top-1 accuracy). However, existing efforts have been focusing on improving generalization performance in single-level problems such as ERM (Bahri et al., 2021; Chen et al., 2021b). Different from these works based on single-level ERM, we study SAM in the context of MAML through the lens of bilevel optimization. Recent works aim to reduce the computation overhead of SAM. In (Du et al., 2021), two new variants of SAM have been proposed namely, Stochastic Weight Perturbation and Sharpness-sensitive Data Selection, both of which improve the efficiency of SAM without sacrificing generalization performance. While this work showed remarkable improvement on a standard ERM model, whether it can improve the computation overhead (without sacrificing generalization) of a MAML-model is unknown. + +Model-agnostic meta learning. Since it was first developed in (Finn et al., 2017), MAML has been one of the most popular optimization-based meta learning tools for fast few-shot learning. Recent studies revealed that the choice of the lower-level optimizer affects the generalization performance of MAML (Grant et al., 2018a; Antoniou et al., 2019; Park & Oliva, 2019). (Antoniou et al., 2019) pointed out a variety of issues of training MAML, such as sensitivity to neural network architectures that leads to instability during training and high computational overhead at both training and inference times. They proposed multiple ways to improve the generalization error, and stabilize training MAML, calling the resulting framework MAML++. Many recent works focus on analyzing the generalization ability of MAML (Farid & Majumdar, 2021; Denevi et al., 2018; Rothfuss et al., 2021; Chen & Chen, 2022) and improving the generalization performance of MAML (Finn & Levine, 2018; Gonzalez & Miikkulainen, 2020; Park & Oliva, 2019). However, these works do not take into account the geometry of the loss landscape of MAML. In addition to generalization-ability, recent works (Wang et al., 2021; Goldblum et al., 2020; Xu et al., 2020) investigated MAML from another important perspective of adversarial robustness the capabilities of a model to defend against adversarial perturbed inputs (also known as adversarial attacks in some literature). However, we focus on improving the general + +ization performance of the models trained by MAML with theoretical guarantees. + +# 2. Preliminaries and Motivations + +In this section, we first review the basics of MAML and describe the optimization difficulty of learning MAML models, followed by introducing the SAM method. + +# 2.1. Problem formulation of MAML + +The goal of few-shot learning is to train a model that can quickly adapt to a new task using only a few datapoints (usually 1-5 samples per task). Consider $M$ few-shot learning tasks $\{\mathcal{T}_m\}_{m = 1}^M$ drawn from a distribution $p(\mathcal{T})$ . Each task $m$ has a fine-tuning training set $\mathcal{D}_m = \cup_{i = 1}^n\{(x_i,y_i)\}$ and a separate validation set $\mathcal{D}_m' = \cup_{i = 1}^n\{(x_i,y_i)\}$ , where data are independently and identically distributed (i.i.d.) and drawn from the per-task data distribution $\mathcal{P}_m$ . MAML seeks to learn a good initialization of the model parameter $\theta$ (called the meta-model) such that fine-tuning $\theta$ via a small number of gradient updates will lead to fast learning on a new task. Consider a per datum loss $l:\Theta \times \mathcal{X}\times \mathcal{Y}\to \mathbb{R}_+$ ; define the generic empirical loss over a finite-sample dataset $\mathcal{D}$ as $\mathcal{L}(\theta ;\mathcal{D}) = \frac{1}{n}\sum_{i = 1}^{n}l(\theta ,x_i,y_i)$ and the generic population loss over a data distribution $\mathcal{P}$ as $\mathcal{L}(\theta ;\mathcal{P}) = \mathbb{E}_{(x,y)\sim \mathcal{P}}[l(\theta ,x,y)]$ . For a particular task $m$ , they become $\mathcal{L}(\theta ;\mathcal{D}_m)$ or $\mathcal{L}(\theta ;\mathcal{D}_m')$ and $\mathcal{L}(\theta ;\mathcal{P}_m)$ . + +MAML can be formulated as a bilevel optimization problem, where the fine-tuning stage forms a task-specific lower-level problem while the meta-model $\theta$ optimization forms a shared upper-level problem. Namely, the optimization problem of MAML is (Rajeswaran et al., 2019a): + +$$ +\min _ {\theta} \frac {1}{M} \sum_ {m = 1} ^ {M} \mathcal {L} \left(\theta_ {m} ^ {*} (\theta); \mathcal {D} _ {m} ^ {\prime}\right) \tag {1a} +$$ + +$$ +\text {s . t .} \theta_ {m} ^ {*} (\theta) = \arg \min _ {\theta_ {m}} \mathcal {L} \left(\theta_ {m}; \mathcal {D} _ {m}\right) + \frac {\left\| \theta_ {m} - \theta \right\| ^ {2}}{2 \beta_ {\mathrm {l o w}}}, \forall m (1 \mathrm {b}) +$$ + +where $\beta_{\mathrm{low}}$ denotes the lower-level step size. + +The bilevel optimization problem in (1) is difficult to solve because each upper-level update (1a) requires calling lower optimization oracle multiple times (1b). There exist many MAML algorithms to solve (1) efficiently, such as Reptile (Nichol & Schulman, 2018) and first-order MAML (Finn et al., 2017) which is an approximation to MAML obtained by ignoring second-order derivatives. We instead use the one-step gradient update (Finn et al., 2017) to approximate the lower-level problem: + +$$ +\min _ {\theta} F (\theta) \triangleq (1 a) \text {s . t .} \theta_ {m} ^ {\prime} (\theta) = \theta - \beta_ {\text {l o w}} \nabla \mathcal {L} (\theta ; \mathcal {D} _ {m}). \tag {2} +$$ + +Generalization performance. We are particularly interested in the generalization performance of a meta-model $\theta$ + +![](images/2f549747bc5fb01d341f7fffe38b06f921d2c8bed1b4528699bd817dec6b86f6.jpg) +Figure 1. Loss landscapes of MAML and ERM for a single task on CIFAR-100 dataset. Details of the architecture are given in Section 5.1. We use the cross-entropy loss following the process in (Li et al., 2018b). Left: Loss landscape of a MAML model (5-way 1-shot). Right: Loss landscape of a standard ERM model. + +![](images/76544ae2274dfad06585bbd7c9e960cc34d33180e35c66e219f3e9c1139898f8.jpg) + +obtained by solving the empirical MAML problem (2). The generalization performance of a meta-model $\theta$ is measured by the expected population loss + +$$ +\mathcal {L} \left(\theta_ {m} (\theta); \mathcal {P}\right) \triangleq \mathbb {E} _ {\mathcal {T} _ {m}} \mathbb {E} _ {(x, y) \sim \mathcal {P} _ {m}} \left[ \mathcal {L} \left(\theta_ {m} \left(\theta ; \mathcal {D} _ {m}\right); \mathcal {D} _ {m} ^ {\prime}\right) \right] \tag {3} +$$ + +where the expectation is taken over the randomness of the sampled tasks as well as data in the training and validation datasets per sampled task. For notation simplicity, we define the marginal data distribution for variable $(x,y)$ as + +$$ +\mathcal {P} (x, y) \triangleq \mathbb {E} _ {\mathcal {T} _ {m}} [ \mathcal {P} _ {m} (x, y) ] = \int P (x, y \mid \mathcal {T} _ {m}) P (\mathcal {T} _ {m}) d \mathcal {T} _ {m} \tag {4} +$$ + +and we use $\mathcal{P}$ to represent $\mathcal{P}(x,y)$ thereafter. + +# 2.2. Local minimizer of ERM implies that of MAML + +Nevertheless, even with the simple lower-level gradient descent step (2), training the upper-level meta-model $\theta$ still requires differentiating the lower update. In other words, the meta-model requires the second-order information (i.e., the Hessian) of the objective function with respect to $\theta$ , making the problem (1) more involved than an ERM formulation of the multi-task learning (called ERM thereafter), given by + +$$ +\min _ {\theta} \frac {1}{M} \sum_ {m = 1} ^ {M} \mathcal {L} (\theta ; \mathcal {D} _ {m}). \tag {5} +$$ + +To understand the difficulty of the MAML objective in (2), we visualize its loss landscape of a particular task $m$ and compare it with that of ERM for the same task $m$ . Figure 1 shows the per-task loss landscapes of a meta-model $\theta$ in (1a) and a standard ERM model in (5) on CIFAR-100 dataset. We find that the loss landscape of a meta-model is indeed much more involved with more local minima, making the optimization problem difficult to solve. The following lemma also characterizes the complex landscape of meta-model on a particular task $m$ and its proof is deferred in Appendix B. + +Lemma 1 (Local minimizers of MAML). Consider the one-step gradient fine-tuning step (2). For any $m \in \mathcal{M}$ , assume $\mathcal{L}(\theta; \mathcal{D}_m)$ has continuous third-order derivatives. Then for a particular task $m$ , the following two statements hold a) the stationary points for $\mathcal{L}(\theta; \mathcal{D}_m)$ are also the stationary points for $\mathcal{L}(\theta_m'(\theta); \mathcal{D}_m)$ ; and, + +b) the local minimizers for $\mathcal{L}(\theta; \mathcal{D}_m)$ are also the local minimizers for $\mathcal{L}(\theta_m'(\theta); \mathcal{D}_m)$ . + +Lemma 1 shows that for a given task $m$ , the number of stationary points and local minimizers for ERM's loss $\mathcal{L}(\theta; \mathcal{D}_m)$ are fewer than that of MAML's loss $\mathcal{L}(\theta_m'(\theta); \mathcal{D}_m)$ , which is aligned with the empirical observations in Figure 1. While some of the local minimizers in MAML's loss landscape are indeed effective few-shot learners, there are a number of sharp local minimizers in MAML that may have undesired generalization performance. It also suggests that the optimization of MAML can be more challenging than its ERM counterpart. + +# 2.3. Sharpness aware minimization + +SAM is a recently developed technique that leverages the geometry of the loss landscape to improve the generalization performance by simultaneously minimizing the loss value and the loss sharpness (Foret et al., 2021). Given the empirical loss $\mathcal{L}(\theta; \mathcal{D})$ , the goal of training is to choose $\theta$ having low population loss $\mathcal{L}(\theta; \mathcal{P})$ . SAM achieves this through the following optimization problem + +$$ +\min _ {\theta} \mathcal {L} ^ {\text {s a m}} (\theta ; \mathcal {D}) \text {w i t h} \mathcal {L} ^ {\text {s a m}} (\theta ; \mathcal {D}) \triangleq \max _ {| | \epsilon | | _ {2} \leq \alpha} \mathcal {L} (\theta + \epsilon ; \mathcal {D}). \tag {6} +$$ + +Given $\theta$ , the maximization in (6) seeks to find the weight perturbation $\epsilon$ in the Euclidean ball with radius $\alpha$ that maximizes the empirical loss. If we define the sharpness as + +$$ +\max _ {| | \epsilon | | _ {2} \leq \alpha} [ \mathcal {L} (\theta + \epsilon ; \mathcal {D}) - \mathcal {L} (\theta ; \mathcal {D}) ] \tag {7} +$$ + +then (6) essentially minimizes the sum of the sharpness and the empirical loss $\mathcal{L}(\theta; \mathcal{D})$ . While the maximization in (6) is generally costly, a closed-form approximate maximizer has been proposed in (Foret et al., 2021) by invoking the Taylor expansion of the empirical loss. In such case, SAM seeks to find a flat minimum by iteratively applying the following two-step procedure at each iteration $t$ , that is + +$$ +\epsilon \left(\theta^ {t}\right) = \alpha \nabla \mathcal {L} \left(\theta^ {t}; \mathcal {D}\right) / \left| \left| \nabla \mathcal {L} \left(\theta^ {t}; \mathcal {D}\right) \right| \right| _ {2} \tag {8a} +$$ + +$$ +\theta^ {t + 1} = \theta^ {t} - \beta^ {t} (\nabla \mathcal {L} \left(\theta^ {t} + \epsilon \left(\theta^ {t}\right); \mathcal {D}\right)) \tag {8b} +$$ + +where $\beta^t$ is an appropriately scheduled learning rate. In (8b) and thereafter, the notation $\nabla \mathcal{L}(\theta +\epsilon_m(\theta))$ means $\nabla \mathcal{L}(\theta +$ $\epsilon_{m}(\theta))\triangleq \nabla_{x}\mathcal{L}(x)|_{x = \theta +\epsilon_{m}(\theta)}$ . SAM works particularly well for complex and non-convex problems having a myriad of local minima, and where different minima yield models with different generalization abilities. + +# 3. Sharp-MAML: Sharpness-aware MAML + +As discussed in Section 2.1, MAML has a complex loss landscape with multiple local and global minima, that may yield similar values of empirical loss $\mathcal{L}(\theta; \mathcal{D})$ while having significantly different generalization performance. Therefore, we propose integrating SAM with MAML, which is a new bilevel optimization problem. + +# 3.1. Problem formulation of Sharp-MAML + +We propose a unified optimization framework for Sharpness-aware MAML that we term Sharp-MAML by using two hyperparameters $\alpha_{\mathrm{up}} \geq 0$ and $\alpha_{\mathrm{low}} \geq 0$ , that is: + +(P) $\min_{\theta} \max_{||\epsilon||_2 \leq \alpha_{\mathrm{up}}} \sum_{m=1}^{M} \mathcal{L}(\theta_m^*(\theta + \epsilon); \mathcal{D}_m')$ (upper) +s.t. $\theta_{m}^{*}(\theta) = \arg \min_{\theta_{m}}\max_{||\epsilon_{m}||_{2}\leq \alpha_{\mathrm{low}}}\mathcal{L}(\theta_{m} + \epsilon_{m};\mathcal{D}_{m})$ ++ $\frac{\|\theta_m - \theta\|^2}{2\beta_{\mathrm{low}}}$ $m = 1,\dots,M$ (lower) + +Compared with the bilevel formulation of MAML in (1), the above Sharp-MAML formulation is a four-level problem. However, in our algorithm design, we will efficiently approximate the two maximizations in $(\mathbf{P})$ so that the cost of Sharp-MAML is almost the same as that of MAML. + +In what follows, we list three main technical questions that we aim to address. + +Q1. The choice of $\alpha_{\mathrm{up}}$ , $\alpha_{\mathrm{low}}$ determines the specific scenario of integrating SAM with MAML. Applying SAM to both fine-tuning and meta-update stages would be computationally very expensive. Spurred by that, we ask: Is it possible to achieve better generalization by incorporating SAM into only either upper- or lower-level problem? +Q2. Both MAML in (1) and SAM in (6) are bilevel optimization problems requiring several lower optimization steps. Thus, we also study whether or not the computationally-efficient alternatives (e.g. ESAM (Du et al., 2021), ANIL (Raghu et al., 2020)) can promise good generalization. +Q3. The theoretical motivation for SAM has been illustrated in (Foret et al., 2021) by bounding generalization ability in terms of neighborhood-wise training loss. Spurred by that, we further ask: Can we explain and theoretically justify why integrating SAM with MAML is effective in promoting generalization performance of MAML models? + +# 3.2. Algorithm development + +Based on (P), we focus on three variants of Sharp-MAML that differ in their respective computational complexity: + +(a) Sharp-MAMLow: SAM is applied to only the finetuning step, i.e., $\alpha_{\mathrm{low}} > 0$ and $\alpha_{\mathrm{up}} = 0$ +(b) Sharp-MAMLup: SAM is applied to only the metaupdate step, i.e., $\alpha_{\mathrm{low}} = 0$ and $\alpha_{\mathrm{up}} > 0$ +(c) Sharp-MAMLboth: SAM is applied to both fine-tuning and meta-update steps, i.e., $\alpha_{\mathrm{up}},\alpha_{\mathrm{low}} > 0$ + +Below we only introduce Sharp-MAMLboth in detail and leave the pseudo-code of the other two variants in Appendix A since the other two variants can be deduced from SharpMAMLboth. For the sake of convenience, we define the biased mini-batch gradient descent (BGD) at point $\theta^t +\epsilon$ using gradient at $\theta^t +\epsilon +\epsilon_m$ as + +$\mathrm{BGD}_m(\theta^t,\epsilon ,\epsilon_m)\triangleq \theta^t +\epsilon -\beta_{\mathrm{low}}\widetilde{\nabla}\mathcal{L}(\theta^t +\epsilon +\epsilon_m;\mathcal{D}_m)$ (9) + +where $\epsilon$ and $\epsilon_{m}$ are perturbation vectors that can be computed accordingly to different Sharp-MAML, and $\widetilde{\nabla}\mathcal{L}(\cdot ;\mathcal{D}_m)$ is an unbiased estimator of $\nabla \mathcal{L}(\cdot ;\mathcal{D}_m)$ which can be assessed by mini-batch evaluation. Moreover, letting $\tilde{\theta}_{m}(\theta^{t}) = \mathrm{BGD}_{m}(\theta^{t},\epsilon ,\epsilon_{m})$ , we define + +$$ +\begin{array}{l} \nabla_ {\theta_ {t}} \mathcal {L} (\tilde {\theta} _ {m} (\theta^ {t}); \mathcal {D} _ {m} ^ {\prime}) \triangleq \\ \left(I - \beta_ {\text {l o w}} \nabla^ {2} \mathcal {L} \left(\theta^ {t} + \epsilon + \epsilon_ {m}; \mathcal {D} _ {m}\right)\right) \nabla \mathcal {L} \left(\tilde {\theta} _ {m} \left(\theta^ {t}\right); \mathcal {D} _ {m} ^ {\prime}\right) \tag {10} \\ \end{array} +$$ + +and $\nabla^2\mathcal{L}(\theta^t +\epsilon +\epsilon_m;\mathcal{D}_m)$ is the Hessian matrix of $\mathcal{L}(\cdot ;\mathcal{D}_m)$ at $\theta^t +\epsilon +\epsilon_m$ + +Sharp-MAMLboth. For each task $m$ , we compute its corresponding perturbation $\epsilon_{m}(\theta^{t})$ as follows: + +$$ +\epsilon_ {m} \left(\theta^ {t}\right) = \alpha_ {\text {l o w}} \tilde {\nabla} \mathcal {L} \left(\theta^ {t}; \mathcal {D} _ {m}\right) / \left\| \tilde {\nabla} \mathcal {L} \left(\theta^ {t}; \mathcal {D} _ {m}\right) \right\| _ {2}. \tag {11} +$$ + +Thereafter, the fine-tuning step is carried out by performing gradient descent at $\theta^t$ using the gradient at the maximum point $\theta^t +\epsilon_m(\theta^t)$ using (9): + +$$ +\tilde {\theta} _ {m} ^ {1} \left(\theta^ {t}\right) = \operatorname {B G D} _ {m} \left(\theta^ {t}, 0, \epsilon_ {m} \left(\theta^ {t}\right)\right). \tag {12} +$$ + +After we obtain $\tilde{\theta}_m^1 (\theta^t)$ for all tasks, we compute the minibatch gradient estimator of the upper loss i.e., $\nabla h = \widetilde{\nabla}_{\theta^t}\sum_{m = 1}^{M}\mathcal{L}(\tilde{\theta}_m^1 (\theta^t);\mathcal{D}_m')$ which is an unbiased estimator of the upper-level gradient $\nabla_{\theta^t}\sum_{m = 1}^{M}\mathcal{L}(\tilde{\theta}_m^1 (\theta^t);\mathcal{D}_m')$ and use it to compute the meta perturbation $\epsilon (\theta^t)$ by: + +$$ +\epsilon \left(\theta^ {t}\right) = \alpha_ {\mathrm {u p}} \nabla h / \left\| \nabla h \right\| _ {2}. \tag {13} +$$ + +Afterwards, we compute the new perturbed fine-tuned parameter, denoted by $\tilde{\theta}_m^2 (\theta^t)$ , using the gradient at the maximum point $\theta^t +\epsilon (\theta^t) + \epsilon_m(\theta^t)$ in (9), that is: + +$$ +\tilde {\theta} _ {m} ^ {2} \left(\theta^ {t}\right) = \operatorname {B G D} _ {m} \left(\theta^ {t}, \epsilon \left(\theta^ {t}\right), \epsilon_ {m} \left(\theta^ {t}\right)\right). \tag {14} +$$ + +Finally, for the meta-update stage, we evaluate the upper loss using the fine-tuned parameter $\tilde{\theta}_m^2 (\theta^t)$ obtained from + +Algorithm 1 Pseudo-code for Sharp-MAMLboth; red lines need to be modified for Sharp-MAMLup; blue lines need to be modified for Sharp-MAMLow +1: Require: $p(\mathcal{T})$ : distribution over tasks +2:Require: $\beta_{\mathrm{low}},\beta_{\mathrm{up}}$ : step sizes +3:Require: $\alpha_{\mathrm{low}} > 0,\alpha_{\mathrm{up}} > 0$ : perturbation radii +4: for $t = 1,\dots ,T$ do +5: Sample batch of tasks $\mathcal{T}_m\sim p(\mathcal{T})$ +6: for all $\mathcal{T}_m$ do +7: Sample $K$ examples from $\mathcal{D}_m$ +8: Evaluate $\widetilde{\nabla}\mathcal{L}(\theta^t;\mathcal{D}_m)$ +9: Compute perturbation $\epsilon_{m}(\theta^{t})$ via (11) +10: Compute fine-tuned parameter $\tilde{\theta}_{m}^{1}(\theta^{t})$ via (12) +11: Sample data from $\mathcal{D}_m^\prime$ for meta-update +12: end for +13: Compute $\sum_{m = 1}^{M}\widetilde{\nabla}\mathcal{L}(\tilde{\theta}_{m}^{1}(\theta^{t});\mathcal{D}_{m}^{\prime})$ +14: Compute perturbation $\epsilon (\theta^t)$ via (13) +15: Update $\theta$ via (15) using $\hat{\theta}_{m}^{2}(\theta^{t})$ from (14) +16: end for + +(14) and update the meta-parameter $\theta$ via: + +$$ +\theta^ {t + 1} = \theta^ {t} - \beta_ {\mathrm {u p}} \sum_ {m = 1} ^ {M} \widetilde {\nabla} _ {\theta^ {t}} \mathcal {L} \left(\tilde {\theta} _ {m} ^ {2} \left(\theta^ {t}\right); \mathcal {D} _ {m} ^ {\prime}\right). \tag {15} +$$ + +See the pseudocode of Sharp-MAMLboth in Algorithm 1. The algorithms for Sharp-MAMLup and Sharp-MAMLlow can be deduced by setting $\epsilon_{m}(\theta_{t}) = 0$ and $\epsilon (\theta_{t}) = 0$ in Algorithm 1, respectively, which are formally stated in Algorithm 3 and Algorithm 2 in Appendix A. + +# 4. Theoretical Analysis of Sharp-MAML + +In this part, we rigorously analyze the performance of the proposed Sharp-MAML method in terms of the convergence rate and the generalization error. + +# 4.1. Optimization analysis + +To quantify the optimization performance of solving the one-step version of (1), we introduce the following assumptions. + +Assumption 1 (Lipschitz continuity). Assume that $\mathcal{L}(\theta; \mathcal{D}_m'), \nabla \mathcal{L}(\theta; \mathcal{D}_m), \nabla \mathcal{L}(\theta; \mathcal{D}_m'), \nabla^2 \mathcal{L}(\theta; \mathcal{D}_m), \forall m$ are Lipschitz continuous with constant $\ell_0, \ell_1, \ell_1, \ell_2$ . + +Assumption 2 (Stochastic derivatives). Assume that $\widetilde{\nabla}\mathcal{L}(\theta ;\mathcal{D}_m),\widetilde{\nabla}^2\mathcal{L}(\theta ;\mathcal{D}_m),\widetilde{\nabla}\mathcal{L}(\theta ;\mathcal{D}_m')$ are unbiased estimator of $\nabla \mathcal{L}(\theta ;\mathcal{D}_m),\nabla^2\mathcal{L}(\theta ;\mathcal{D}_m),\nabla \mathcal{L}(\theta ;\mathcal{D}_m')$ respectively and their variances are bounded by $\sigma^2$ + +Assumptions 1-2 also appear similarly in the convergence analysis of meta learning and bilevel optimization (Finn + +et al., 2019; Rajeswaran et al., 2019a; Fallah et al., 2020; Chen et al., 2021a; Ji et al., 2022; Chen et al., 2022). + +With the above assumptions, we introduce a novel biased MAML framework which includes MAML and sharpMAML as special cases and get the following theorem. The proof is deferred in Appendix C. + +Theorem 1. Under Assumption 1-2, and choosing stepsizes and perturbation radii $\beta_{\mathrm{low}},\beta_{\mathrm{up}},\alpha_{\mathrm{up}} = \mathcal{O}(\frac{1}{\sqrt{T}}),\alpha_{\mathrm{low}} = \mathcal{O}(1)$ , with some proper constants, we can get that the iterates $\{\theta^t\}$ generated by Sharp-MAMLup, Sharp-MAMLow and Sharp-MAMLboth satisfy + +$$ +\frac {1}{T} \sum_ {t = 1} ^ {T} \mathbb {E} \left[ \| \nabla F \left(\theta^ {t}\right) \| ^ {2} \right] = \mathcal {O} \left(\frac {1}{\sqrt {T}}\right) \tag {16} +$$ + +where $F(\theta)$ is the objective function of MAML in (2). + +Theorem 1 implies that by choosing a proper perturbation threshold, all three versions of Sharp-MAML can still find $\epsilon$ stationary points for MAML objective (2) with $\mathcal{O}(\epsilon^{-2})$ iterations and $\mathcal{O}(\epsilon^{-2})$ samples, which matches or even improves the state-of-the-art sample complexity of MAML (Rajeswaran et al., 2019a; Fallah et al., 2020; Ji et al., 2022). + +# 4.2. Generalization analysis + +To analyze the generalization error of Sharp-MAML, we make similar assumptions to Theorem 2 in (Foret et al., 2021). Recall the population loss $\mathcal{L}(\theta; \mathcal{P}) = \mathbb{E}_{(x,y) \sim \mathcal{P}}[l(\theta, x, y)]$ . Denote the stationary point obtained by Sharp-MAML up algorithm as $\hat{\theta}$ . Note that the Sharp-MAML adopts gradient descent (GD) as the lower level algorithm, which is uniformly stable based on Definition 1. + +Definition 1 ((Hardt et al., 2016)). An algorithm $A$ is $\gamma$ -uniformly stable if for all data sets $S, S' \in Z^n$ such that $S$ and $S'$ differ in at most one example, we have + +$$ +\sup _ {S} \left| \mathbb {E} _ {S} \left[ l (A (S); x, y) - l (A \left(S ^ {\prime}\right); x, y) \right] \right| \leq \gamma \tag {17} +$$ + +where $A(S)$ and $A(S')$ are the outputs of the algorithm $A$ given datasets $S$ and $S'$ . + +With the above definition of uniform stability, we are ready to establish the generalization performance. We defer the proof of Theorem 2 to Appendix D. + +Theorem 2. Assume loss function $\mathcal{L}(\cdot)$ is bounded: $0\leq$ $\mathcal{L}(\theta_m';\mathcal{D})\leq 1$ , for $\theta_{m}^{\prime}$ defined in (2), and any $\mathcal{D}$ . Define $F(\theta ;\mathcal{P}) = \mathbb{E}_{\mathcal{D}\sim \mathcal{P}}[F(\theta ;\mathcal{D})]$ . Assume $F(\hat{\theta};\mathcal{P})\leq$ $\mathbb{E}_{\epsilon \sim \mathcal{N}(0,\alpha^2\mathbf{I})}\left[F(\hat{\theta} +\epsilon ;\mathcal{P})\right]$ at the stationary point of the Sharp-MAMLup denoted by $\hat{\theta}$ . For parameter $\theta_{m}^{\prime}(\hat{\theta};\mathcal{D})$ learned with $\gamma_{\mathrm{A}}$ uniformly stable algorithm $A$ from $\hat{\theta}\in \mathbb{R}^{k}$ with probability $1 - \delta$ over the choice of the training set + +$\mathcal{D}\sim \mathcal{P}$ with $|\mathcal{D}| = nM$ , it holds that + +$$ +\begin{array}{l} F (\hat {\theta}; \mathcal {P}) \leq \max _ {\| \epsilon \| _ {2} \leq \alpha} F (\hat {\theta} + \epsilon ; \mathcal {D}) + \gamma_ {\mathrm {A}} + \tag {18} \\ \sqrt {\frac {k \ln \left(1 + \frac {\| \hat {\theta} \| _ {2} ^ {2}}{\alpha^ {2}} \left(1 + \sqrt {\frac {\ln (n M)}{k}}\right) ^ {2}\right) + 2 \ln \frac {1}{\delta} + 5 \ln (n M)}{4 n M}}. \\ \end{array} +$$ + +Improved upper bound of generalization error. Theorem 2 shows that the difference between the population loss and the empirical loss of Sharp-MAMLup is bounded by the stability of the lower-level update $\gamma_{A}$ and another $\tilde{\mathcal{O}} (k / nM)$ term that vanishes as the number of meta-training data goes to infinity. The lower-level update GD has uniform stability of order $\mathcal{O}(1 / n)$ (Hardt et al., 2016). Also, it is worth noting that the upper bound of the population loss on the right-hand side (RHS) of (18), is a function of $\alpha$ . And for any sufficiently small $\alpha_0 > 0$ , we can find some $\alpha_{1} > \alpha_{0}$ where this function takes smaller value than at $\alpha_0$ (see the proof in Appendix D). This suggests that a choice of $\alpha$ arbitrarily close to zero, in which case Sharp-MAML reduces to the original MAML method, is not optimal in terms of the generalization error upper bound. Therefore, it shows Sharp-MAML has smaller generalization error upper bound than conventional MAML. The analysis can be extended to Sharp-MAMLboth in a similar way. + +# 5. Numerical Results + +In this section, we demonstrate the effectiveness of SharpMAML by comparing it with several popular MAML baselines in terms of generalization and computation cost. We evaluate Sharp-MAML on 5-way 1-shot and 5-way 5-shot settings on the Mini-Imagenet dataset and present the results on Omniglot dataset in Appendix E. + +# 5.1. Experiment setups + +Our model follows the same architecture used by (Vinyals et al., 2016), comprising of 4 modules with a $3 \times 3$ convolutions with 64 filters followed by batch normalization (Ioffe & Szegedy, 2015), a ReLU non-linearity, and a $2 \times 2$ max-pooling. We follow the experimental protocol in (Finn et al., 2017). The models were trained using the SAM1 algorithm with Adam as the base optimizer and learning rate $\alpha = 0.001$ . Following (Ravi & Larochelle, 2017), 15 examples per class were used to evaluate the post-update meta-gradient. The values of $\alpha_{\mathrm{low}}$ , $\alpha_{\mathrm{up}}$ are taken from a set of $\{0.05, 0.005, 0.0005, 0.00005\}$ and each experiment is run on each value for three random seeds. We choose the inner gradient steps from a set of $\{3, 5, 7, 10\}$ . The step size is chosen from a set of $\{0.1, 0.01, 0.001\}$ . For Sharp- + +Table 1. Results on Mini-Imagenet (5-way 1-shot). Our reproduced result of MAML is close to that of the original*. + +
ALGORITHMSACCURACY
MATCHING NETS43.56%
IMAML (RAJESWARAN ET AL., 2019B)49.30 %
CAVIA (ZINTGRAF ET AL., 2019B)47.24 %
REPTILE (NICHOL & SCHULMAN, 2018)49.97 %
FOMAML (NICHOL & SCHULMAN, 2018)48.07 %
LLAMA (GRANT ET AL., 2018B)49.40 %
BMAML (Yoon ET AL., 2018)49.17 %
MAML (REPRODUCED)47.13%
SHARP-MAMLlow49.72%
SHARP-MAMLup49.56%
SHARP-MAMLboth50.28%
+ +* reproduced using the Torchmeta (Deleu et al., 2019) library + +Table 2. Results on Mini-Imagenet (5-way 5-shot). Our reproduced result of MAML is close to that of the original*. + +
ALGORITHMSACCURACY
MATCHING NETS55.31%
CAVIA (ZINTGRAF ET AL., 2019B)59.05%
REPTILE (NICHOL & SCHULMAN, 2018)65.99%
FOMAML (NICHOL & SCHULMAN, 2018)63.15 %
BMAML (Yoon ET AL., 2018)64.23 %
MAML (REPRODUCED)62.20%
SHARP-MAMLlow63.18%
SHARP-MAMLup63.06%
SHARP-MAMLboth65.04%
+ +* reproduced using the Torchmeta (Deleu et al., 2019) library + +$\mathrm{MAML}_{\mathrm{both}}$ we use the same value of $\alpha_{\mathrm{low}}$ , $\alpha_{\mathrm{up}}$ in each experiment. We report the best results in Tables 1 and 2. + +One Sharp-MAML update executes two backpropagation operations (i.e., one to compute $\epsilon(\theta)$ and another to compute the final gradient). Therefore, for a fair comparison, we execute each MAML training run twice as many epochs as each Sharp-MAML training run and report the best score achieved by each MAML training run across either the standard epoch count or the doubled epoch count. + +# 5.2. Sharp-MAML versus MAML baselines + +Regarding baselines, we use the MAML (Finn et al., 2017), Matching Nets (Vinyals et al., 2016), CAVIA (Zintgraf et al., 2019b), Reptile (Nichol & Schulman, 2018), FOMAML (Nichol & Schulman, 2018), and BMAML (Yoon et al., 2018). + +In Tables 1 and 2, we report the accuracy of three variants of Sharp-MAML and other baselines on the Mini-Imagenet dataset in the 5-way 1-shot and 5-way 5-shot settings respectively. We observe that Sharp-MAMLlow outperforms MAML in all cases, exhibiting the advantage of our methods. The results on the Omniglot dataset are reported in Table 4 and Table 5 of Appendix. Our results verify the efficacy + +Table 3. Results on Mini-Imagenet (5-way 1-shot). + +
ALGORITHMSACCURACYTIME†
MAML (REPRODUCED)47.13%x1
SHARP-MAMLlow49.72%x2.60
SHARP-MAMLup49.56%x3.60
SHARP-MAMLboth50.28%x4.60
SHARP-MAMLlow -ANIL49.19%x1.40
ESHARP-MAMLlow48.90%x2.20
ESHARP-MAMLlow -ANIL49.03%x1.20
+ +${}^{ \dagger }$ execution time is normalized to MAML training time + +of all the three variants of Sharp-MAML, suggesting that SAM indeed improves the generalization performance of bi-level models like MAML by seeking out flatter minima. + +Since Sharp-MAML requires one more gradient computation per iteration than the original MAML, for a fair comparison, we report the execution times in Table 3. The results show that Sharp-MAMLlow requires the least amount of additional computation while still achieving significant performance gains. Sharp-MAMLup and Sharp-MAMLboth also improves the performance significantly but both approaches have a higher computation than Sharp-MAMLlow since the computation of additional Hessians is needed for the meta-update gradient. + +# 5.3. Ablation study and loss landscape visualization + +We conduct an ablation study on the effect of perturbation radii $\alpha_{\mathrm{low}}$ and $\alpha_{\mathrm{up}}$ on the three Sharp-MAML variants. Figure 2 and Figure 3 summarize the results on the Mini-Imagenet dataset. We observe that all the three Sharp-MAML variants outperform the original MAML for almost all the values of $\alpha_{\mathrm{low}}$ , $\alpha_{\mathrm{up}}$ we used in our experiments. Therefore, integrating SAM at any/both stage(s) gives better performance than the original SAM for a wide range of values of the perturbation sizes, reducing the need to fine-tune these hyperparameters. This also suggests that SAM is effectively avoiding bad local minimum in MAML loss landscape (cf. Figure 1) for a wide range of perturbation radii. In Figure 4, we plot the loss landscapes of MAML and Sharp-MAML, and observe that Sharp-MAML indeed seeks out landscapes that are smoother as compared to the landscape of original MAML and hence, meets our theoretical characterization of improved generalization performance. Furthermore, the generalization error of Sharp-MAML both is found to be $34.58\% / 8.56\%$ as compared to $37.46\% / 11.58\%$ of MAML for the 5-way 1-shot/5-shot Mini-Imagenet, which explains the advantage of our approach. + +# 5.4. Computationally-efficient version of Sharp-MAML + +Next we investigate if the computational overhead of Sharp-MAMLow can be further reduced by leveraging + +![](images/89b713570095976c51ea76087389c9954996249efa08cf29f4e61c49efc84679.jpg) +Figure 2. Performance under different values of $\alpha_{\mathrm{low}}$ , $\alpha_{\mathrm{up}}$ on Mini-Imagenet (5-way 1-shot). For Sharp-MAMLboth, we used the same value of $\alpha_{\mathrm{low}}$ and $\alpha_{\mathrm{up}}$ (i.e., $\alpha_{\mathrm{low}} = \alpha_{\mathrm{up}}$ ). + +![](images/d067e898cad9718500cbd21fa123c5a51845de914258165d0547fefb3f1857ac.jpg) +Figure 3. Performance under different values of $\alpha_{\mathrm{low}}$ , $\alpha_{\mathrm{up}}$ on Mini-Imagenet (5-way 5-shot). For Sharp-MAMLboth, we used the same value of $\alpha_{\mathrm{low}}$ and $\alpha_{\mathrm{up}}$ (i.e., $\alpha_{\mathrm{low}} = \alpha_{\mathrm{up}}$ ) + +the computationally-efficient MAML - an almost-noinner-loop (ANIL) method (Raghu et al., 2020) and the computationally-efficient SAM - ESAM (Du et al., 2021). Sharp-MAML-ANIL is the case when we use ANIL with Sharp-MAMLlow; ESharp-MAML is the case when we use ESAM with Sharp-MAMLlow; ESharp-MAML-ANIL is Sharp-MAMLlow with both ANIL and ESAM. + +In ANIL, fine-tuning is only applied to the task-specific head with a frozen representation network from the meta-model. Motivated by (Raghu et al., 2020), we ask if incorporating Sharp-MAMLow in ANIL can ameliorate the computational overhead while preserving the performance gains obtained using the model trained on Sharp-MAMLow. ANIL decomposes the meta-model $\theta$ into two parts: the representation encoding network denoted by $\theta_r$ and the classification head denoted by $\theta_c$ i.e., $\theta \triangleq [\theta_r,\theta_c]$ . Different from (1b), ANIL then only fine-tunes $\theta_c$ over a specific task $m$ , given by: + +$$ +\theta_ {m} ^ {\prime} (\theta) = \arg \min _ {\theta_ {m}; \theta_ {r, m} = \theta_ {r}} \mathcal {L} \left(\theta_ {c, m}, \theta_ {r, m}; \mathcal {D} _ {m}\right). \tag {19} +$$ + +In other words, the initialized representation $\theta_r$ , which comprises most of the network, is unchanged during fine-tuning. + +ESAM leverages two training strategies, Stochastic Weight Perturbation (SWP) and Sharpness-Sensitive Data Selection (SDS). SWP saves computation by stochastically selecting set of weights in each iteration, and SDS judiciously selects a subset of data that is sensitive to sharpness. To be specific, SWP uses a gradient mask $\mathbf{v} = (v_{1},\dots,v_{M})$ where $v_{i}\stackrel{\mathrm{i.i.d.}}{\sim}$ + +![](images/94cd28c09f6a4a72868acbfc8701fc886773ffd21425520b9284342358aff755.jpg) +Figure 4. One-task cross entropy loss landscapes of MAML and different variants of Sharp-MAML trained on CIFAR-100 dataset (5-way 1-shot setting) using class one. The plots are generated following (Li et al., 2018b). Details of the architecture are given in Section 5.1. + +![](images/10e0bd3edfc9d7d8ee6200dd4018500f4d432d319b4f04065f8ff3809e864556.jpg) + +![](images/e97653adbda21cc2a3d2d35747c4ea54eacc84f2e6ce31d4d63af038991c00a7.jpg) + +![](images/93a0968690f202b5398dee4c18db5f21023094652efc0f975a82a37edb1b61c1.jpg) + +$\operatorname{Bern}(\xi), \forall i$ . In SDS, instead of computing $\mathcal{L}_{\mathcal{N}}(\theta + \epsilon(\theta))$ over all samples, $\mathcal{N}$ , a subset of samples, $\mathcal{N}^+$ , is selected, whose loss values increase the most with $\epsilon(\theta)$ ; that is, + +$$ +\mathcal {N} ^ {+} \triangleq \left\{\left(x _ {i}, y _ {i}\right): l (\theta + \epsilon ; x _ {i}, y _ {i}) - l (\theta ; x _ {i}, y _ {i}) > \tau \right\} +$$ + +$$ +\mathcal {N} ^ {-} \triangleq \left\{\left(x _ {i}, y _ {i}\right): l (\theta + \epsilon ; x _ {i}, y _ {i}) - l (\theta ; x _ {i}, y _ {i}) < \tau \right\} +$$ + +where the threshold $\tau$ controls the size of $\mathcal{N}^+$ . Furthermore, $\mu = |\mathcal{N}^{+}| / |\mathcal{N}|$ is ratio of number of selected samples with respect to the batch size and determines the exact value of $\tau$ . In practice, $\mu$ is selected to maximize efficiency while preserving generalization performance. + +In Table 3, we report our results on three computationally efficient versions of Sharp-MAML. We find that Sharp-MAML-ANIL is comparable in performance to Sharp-MAML while requiring almost $86\%$ less computation. ESharp-MAML also reduces the computation, but has slight performance loss. We suspect that this is due to the nested structure of the meta-learning problem that adversely affects the two training strategies used in ESAM. We further investigate the effect of both ANIL and ESAM on Sharp-MAML and observe significant reduction in computation (116% faster) with slight degradation in performance as compared to Sharp-MAML. When compared to MAML, ESharp-MAML-ANIL performs considerably better (+1.90% gain in accuracy) while requiring only 20% more computation. + +# 6. Conclusions + +In this paper, we study sharpness-aware minimization (SAM) in the context of model-agnostic meta-learning (MAML) through the lens of bilevel optimization. We name our new MAML method Sharp-MAML. Through a systematic empirical and theoretical study, we find that adding SAM into any/both fine-tuning or/and meta-update stages improves the generalization performance. We further find that incorporating SAM in the fine-tuning stage alone is the best trade-off between performance and computation. To further save computation overhead, we leverage the techniques such as efficient SAM and almost no inner loop to + +speed up Sharp-MAML, without sacrificing generalization. + +# Acknowledgements + +The work was partially supported by NSF MoDL-SCALE Grant 2134168 and the Rensselaer-IBM AI Research Collaboration (http://airc.rpi.edu), part of the IBM AI Horizons Network (http://ibm.biz/AIHorizons). + +# References + +Achille, A., Lam, M., Tewari, R., Ravichandran, A., Maji, S., Fowlkes, C. C., Soatto, S., and Perona, P. Task2vec: Task embedding for meta-learning. In Proc. International Conference on Computer Vision, pp. 6430-6439, Seoul, South Korea, 2019. +Andrychowicz, M., Denil, M., Gomez, S., Hoffman, M. W., Pfau, D., Schaul, T., and d. Freitas, N. Learning to learn by gradient descent by gradient descent. In Proc. Advances in Neural Information Processing Systems, pp. 3981-3989, Barcelona, Spain, December 2016. +Antoniou, A., Edwards, H., and Storkey, A. How to train your maml. In Proc. International Conference on Learning Representations, New Orleans, LA, 2019. +Bahri, D., Mobahi, H., and Tay, Y. Sharpness-aware minimization improves language model generalization. arXiv preprint:2110.08529, 2021. +Brock, A., Lim, T., Ritchie, J. M., and Weston, N. SmaSH: One-shot model architecture search through hypernetworks. In Proc. International Conference on Learning Representations, Vancouver, Canada, April 2018. +Chen, L. and Chen, T. Is Bayesian model-agnostic meta learning better than model-agnostic meta learning, provably? In Proc. International Conference on Artificial Intelligence and Statistics, March 2022. +Chen, T., Sun, Y., and Yin, W. Closing the gap: Tighter analysis of alternating stochastic gradient methods for + +bilevel problems. In Proc. Advances in Neural Information Processing Systems, volume 34, Virtual, 2021a. +Chen, T., Sun, Y., Xiao, Q., and Yin, W. A single-timescale method for stochastic bilevel optimization. In Proc. International Conference on Artificial Intelligence and Statistics, pp. 2466-2488, March 2022. +Chen, X., Hsieh, C., and Gong, B. When vision transformers outperform resnets without pretraining or strong data augmentations. arXiv preprint:2106.0154, 2021b. +Deleu, T., Würfl, T., Samiei, M., Cohen, J. P., and Bengio, Y. Torchmeta: A Meta-Learning library for PyTorch, 2019. URL https://arxiv.org/abs/1909.06576. +Denevi, G., Ciliberto, C., Stamos, D., and Pontil, M. Learning to learn around a common mean. In Proc. Advances in Neural Information Processing Systems, volume 31, Montreal, Canada, 2018. +Dinh, L., Pascanu, R., S.Bengio, and Bengio, Y. Sharp minima can generalize for deep nets. In Proc. International Conference on Machine Learning, pp. 1019-1028, Sydney, Australia, August 2017. +Dosovitskiy, A., Beyer, L., Kolesnikov, A., Weissenborn, D., Zhai, X., Unterthiner, T., Dehghani, M., Minderer, M., Heigold, G., S. Gelly, J. U., and Houlsby, N. An image is worth $16 \times 16$ words: Transformers for image recognition at scale. In Proc. International Conference on Learning Representations, Virtual, April 2020. +Du, J., Yan, H., Feng, J., Zhou, J. T., Zhen, L., Goh, R. S. M., and Tan, V. Y. F. Efficient sharpness-aware minimization for improved training of neural networks. In Proc. IEEE Conference on Computer Vision and Pattern Recognition, Virtual, June 2021. +Dziugaite, G. and Roy, D. M. Computing nonvacuous generalization bounds for deep (stochastic) neural networks with many more parameters than training data. In Proc. Conference on Uncertainty in Artificial Intelligence, Sydney, Australia, August 2016. +Fallah, A., Mokhtari, A., and Ozdaglar, A. On the convergence theory of gradient-based model-agnostic meta-learning algorithms. In International Conference on Artificial Intelligence and Statistics, pp. 1082-1092, 2020. +Farid, A. and Majumdar, A. Generalization bounds for meta-learning via pac-bayes and uniform stability. Advances in Neural Information Processing Systems, 34, 2021. +Finn, C. and Levine, S. Meta-learning and universality: Deep representations and gradient descent can approximate any learning algorithm. In Proc. International Conference on Learning Representations, Vancouver, Canada, 2018. + +Finn, C., Abbeel, P., and Levine, S. Model-agnostic meta-learning for fast adaptation of deep networks. In Proc. International Conference on Machine Learning, Sydney, Australia, 2017. +Finn, C., Rajeswaran, A., Kakade, S., and Levine, S. Online meta-learning. In International Conference on Machine Learning, pp. 1920-1930, 2019. +Foret, P., Kleiner, A., Mobahi, H., and Neyshabur, B. Sharpness-aware minimization for efficiently improving generalization. In Proc. International Conference on Learning Representations, Virtual, April 2021. +Goldblum, M., Fowl, L., and Goldstein, T. Adversarily robust few-shot learning: A meta-learning approach. In Proc. Advances in Neural Information Processing Systems, Virtual, December 2020. +Gonzalez, S. and Mikkulainen, R. Improved training speed, accuracy, and data utilization through loss function optimization. In Proc. IEEE Congress on Evolutionary Computation, pp. 1-8, Glasgow, United Kingdom, 2020. +Grant, E., Finn, C., Levine, S., Darrell, T., and Griffiths, T. Recasting gradient-based meta-learning as hierarchical bayes. In Proc. International Conference on Learning Representations, April 2018a. +Grant, E., Finn, C., Levine, S., Darrell, T., and Griffiths, T. Recasting gradient-based meta-learning as hierarchical bayes. In Proc. International Conference on Learning Representations, Vancouver, Canada, 2018b. +Hardt, M., Recht, B., and Singer, Y. Train faster, generalize better: Stability of stochastic gradient descent. In International Conference on Machine Learning, pp. 1225-1234, 2016. +Hsu, K., Levine, S., and Fin, C. Unsupervised learning via meta-learning. In Proc. International Conference on Learning Representations, Vancouver, Canada, April 2018. +Huang, P., Wang, C., Singh, R., Yih, W., and He, X. Natural language to structured query generation via meta-learning. In Proc. Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 732-738, New Orleans, LA, 2018. +Ioffe, S. and Szegedy, C. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In Proc. International Conference on Machine Learning, Lille, France, June 2015. +Izmailov, P., Podoprikhin, D., Garipov, T., Vetrov, D., and Wilson, A. G. Averaging weights leads to wider optima + +and better generalization. In Proc. Conference on Uncertainty in Artificial Intelligence, pp. 876-885, Monterey, CA, 2018. +Ji, K., Yang, J., and Liang, Y. Theoretical convergence of multi-step model-agnostic meta-learning. Journal of Machine Learning Research, 23(29):1-41, 2022. +Jiang, Y., Neyshabur, B., Mobahi, H., Krishnan, D., and Bengio, S. Fantastic generalization measures and where to find them. In Proc. International Conference on Learning Representations, New Orleans, LA, 2019. +Kao, C.-H., Chiu, W.-C., and Chen, P.-Y. Maml is a noisy contrastive learner. arXiv preprint arXiv:2106.15367, 2021. +Keskar, N., D.Mudigere, Noceda, J., Smelyanskiy, M., and Tang, P. On large-batch training for deep learning: Generalization gap and sharp minima. In Proc. International Conference on Learning Representations, Toulon, France, May 2017. +Krizhevsky, A., Sutskever, I., and Hinton, G. E. Imagenet classification with deep convolutional neural networks. In Proc. Advances in Neural Information Processing Systems, pp. 1097-1105, Lake Tahoe, NV, 2012. +Langley, P. Crafting papers on machine learning. In Proc. International Conference on Machine Learning, pp. 1207-1216, Stanford, CA, 2000. +Laurent, B. and Massart, P. Adaptive estimation of a quadratic functional by model selection. The Annals of Statistics, 28(5):1302-1338, 2000. +Li, D., Yang, Y., Song, Y., and Hospedales, T. M. Learning to generalize: Meta-learning for domain generalization. In Proc. AAAI Conference on Artificial Intelligence, New Orleans, LA, February 2018a. +Li, H., Xu, Z., Taylor, G., Studer, C., and Goldstein, T. Visualizing the loss landscape of neural nets. In Proc. Advances in Neural Information Processing Systems, Montreal, Canada, December 2018b. +Li, K. and Malik, J. Learning to optimize. In Proc. International Conference on Learning Representations, Toulon, France, May 2017. +Maicas, G., Bradley, A. P., Nascimento, J. C., Reid, I., and Carneiro, G. Training medical image analysis systems like radiologists. In Proc. International Conference on Medical Image Computing and Computer-Assisted Intervention, pp. 546-554, Granada, Spain, 2018. +Munkhdalai, T. and Yu, H. Meta networks. In Proc. International Conference on Machine Learning, pp. 2554-2563, Sydney, Australia, August 2017. + +Neyshabur, B., Bhojanapalli, S., McAllester, D., and Srebro, N. Exploring general-ization in deep learning. In Proc. Advances in Neural Information Processing Systems, pp. 5947-5956, Vancouver, Canada, 2019. +Nichol, A. and Schulman, J. Reptile: a scalable meta learning algorithm. arXiv preprint arXiv:1803.02999, 2018. +Novak, J. D. and Gowin, D. B. Learning how to learn. Cambridge University Press, 1984. +Obamuyide, A. and Vlachos, A. Model-agnostic meta-learning for relation classification with limited supervision. In Proc. Annual Meeting of the Association for Computational Linguistics, Florence, Italy, July 2019. +Park, E. and Oliva, J. B. Meta-curvature. In Proc. Advances in Neural Information Processing Systems, Vancouver, Canada, December 2019. +Raffel, C., Shazeer, N., Roberts, A., Lee, K., Narang, S., Matena, M., Zhou, Y., Li, W., and Liu, P. J. Exploring the limits of transfer learning with a unified text-to-text transformer. Journal of Machine Learning Research, 21:1-67, 2020. +Raghu, A., Raghu, M., and Bengio, S. Rapid learning or feature reuse? towards understanding the effectiveness of maml. In Proc. International Conference on Learning Representations, Virtual, April 2020. +Rajeswaran, A., Finn, C., Kakade, S., and Levine, S. Meta-learning with implicit gradients. In Proc. Advances in Neural Information Processing Systems, pp. 113-124, Vancouver, Canada, December 2019a. +Rajeswaran, A., Finn, C., Kakade, S. M., and Levine, S. Meta-learning with implicit gradients. In Proc. Advances in Neural Information Processing Systems, pp. 113-124, Vancouver, Canada, 2019b. +Ravi, S. and Larochelle, H. Optimization as a model for few-shot learning. In Proc. International Conference on Learning Representations, Toulon, France, 2017. +Rothfuss, J., Fortuin, V., Josifoski, M., and Krause, A. PA-COH: Bayes-optimal meta-learning with pac-guarantees. In Proc. International Conference on Machine Learning, pp. 9116-9126, virtual, 2021. +Schmidhuber, J. Evolutionary principles in self-referential learning. on learning now to learn: The meta-meta...-hook. http://www.idsia.ch/ juergen/diploma.html, 1987. +Snell, J., Swersky, K., and Zemel, R. Prototypical networks for few-shot learning. In Proc. Advances in Neural Information Processing Systems, pp. 4077-4087, Long Beach, CA, December 2017. + +Thrun, S. and Pratt, L. Learning to learn. Springer Science & Business Media, 2012. +Tolstikhin, I., Houlsby, N., Kolesnikov, A., Beyer, L., Zhai, X., Unterthiner, T., Yung, J., Keysers, D., Uszkoreit, J., Lucic, M., and Dosovitskiy, A. Mlp-mixer: An all-mlp architecture for vision. arXiv preprint:2105.01601, 2021. +Vilalta, R. and Drissi, Y. A perspective view and survey of meta-learning. Artificial Intelligence Review, 2002. +Vinyals, O., Blundell, C., Lillicrap, T., Kavukcuoglu, K., and Wierstra, D. Matching networks for one shot learning. In Proc. Advances in Neural information processing systems, Barcelona, Spain, December 2016. +Vuorio, R., Sun, S., Hu, H., and Lim, J. J. Multimodal model-agnostic metalearning via task-aware modulation. In Proc. Advances in Neural Information Processing Systems, pp. 1-12, Vancouver, Canada, December 2019. +Wang, G., Luo, C., Sun, X., Xiong, Z., and Zeng, W. Tracking by instance detection: A meta-learning approach. In Proc. IEEE Conference on Computer Vision and Pattern Recognition, pp. 6288-6297, Virtual, 2020. +Wang, J. X., Kurth-Nelson, Z., Tirumala, D., Soyer, H., Leibo, J. Z., Munos, R., Blundell, C., Kumaran, D., and Botvinick, M. Learning to reinforcement learn. arXiv preprint:1611.05763, 2016. +Wang, R., Xu, K., Liu, S., Chen, P., Weng, T., Gan, C., and Wang, M. On fast adversarial robustness adaptation in model-agnostic meta-learning. In Proc. International Conference on Learning Representations, Virtual, May 2021. +Wang, Y., Ramanan, D., and Hebert, M. Meta-learning to detect rare objects. In Proc. International Conference on Computer Vision, Seoul, Korea, 2019. +Xu, H., Li, Y., Liu, X., Liu, H., and Tang, J. Yet meta learning can adapt fast, it can also break easily. arXiv preprint: 2009.01672, 2020. +Xue, L., Constant, N., Roberts, A., Kale, M., Al-Rfou, R., Siddhant, A., Barua, A., and Raffel, C. mT5: A massively multilingual pre-trained text-to-text transformer. arXiv preprint:2010.11934, 2020. +Yin, M., Tucker, G., Zhou, M., Levine, S., and Finn, C. Meta-learning without memorization. In Proc. International Conference on Learning Representations, Virtual, April 2020. +Yoon, J., Kim, T., Dia, O., Kim, S., Bengio, Y., and Ahn, S. Bayesian model-agnostic meta-learning. In Proc. Advances in Neural Information Processing Systems, volume 31, Montreal, Canada, 2018. + +Zintgraf, L., Shiarli, K., Kurin, V., Hofmann, K., and Whiteson, S. Fast context adaptation via meta-learning. In Proc. International Conference on Machine Learning, pp. 7693-7702, Long Beach, CA, June 2019a. +Zintgraf, L., Shiarli, K., Kurin, V., Hofmann, K., and Whiteson, S. Fast context adaptation via meta-learning. In Proc. International Conference on Machine Learning, pp. 7693-7702, Long Beach, CA, 2019b. + +# Supplementary Material for "Sharp-MAML: Sharpness-Aware Model-Agnostic Meta Learning" + +# A. Omitted Pseudo-code in The Main Manuscript + +In this section, we present the omitted pseudo-code of MAML and two Sharp-MAML algorithms. + +# A.1. MAML algorithm + +The pseudo-code of plain-vanilla MAML is summarized in Algorithm 2. + +Algorithm 2 MAML for few-shot supervised learning +1: Require: $p(\mathcal{T})$ : distribution over tasks +2:Require: $\beta_{\mathrm{low}},\beta_{\mathrm{up}}$ : step sizes +3: for $t = 1,\dots ,T$ do +4: Sample batch of tasks $\mathcal{T}_m\sim p(\mathcal{T})$ +5: for all $\mathcal{T}_m$ do +6: Sample $K$ examples from $\mathcal{D}_m = \{x_i,y_i\}$ +7: Evaluate $\widetilde{\nabla}\mathcal{L}(\theta^t;\mathcal{D}_m)$ +8: Compute fine-tuned parameter $\theta_m^\prime (\theta^t)$ via (2) +9: Sample datapoints from $\mathcal{D}_m^\prime = \{x_i,y_i\}$ for meta-update +10: end for +11: Update the meta-model $\theta$ by $\theta^{t + 1} = \theta^t -\beta_{\mathrm{up}}\widetilde{\nabla}_{\theta^t}\sum_{m = 1}^{M}\mathcal{L}(\theta_m^\prime (\theta^t);\mathcal{D}_m^\prime)$ +12: end for + +Algorithm 3 Sharp-MAMLup +1: Require: $p(\mathcal{T})$ : distribution over tasks +2:Require: $\beta_{\mathrm{low}},\beta_{\mathrm{up}}$ : step sizes +3:Require: $\alpha_{\mathrm{low}} > 0,\alpha_{\mathrm{up}} > 0$ : perturbation radii +4: for $t = 1,\dots ,T$ do +5: Sample batch of tasks $\mathcal{T}_m\sim p(\mathcal{T})$ +6: for all $\mathcal{T}_m$ do +7: Sample $K$ examples from $\mathcal{D}_m$ +8: Evaluate $\widetilde{\nabla}\mathcal{L}(\theta^t;\mathcal{D}_m)$ +9: Compute fine-tuned parameter $\tilde{\theta}_{m}^{1}(\theta^{t}) = \theta^{t} - \beta_{\mathrm{low}}\widetilde{\nabla}\mathcal{L}(\theta^{t};\mathcal{D}_{m})$ +10: Sample data from $\mathcal{D}_m^\prime$ for meta-update +11: end for +12: Compute $\widetilde{\nabla}_{\theta^t}\sum_{m = 1}^{M}\mathcal{L}(\widetilde{\theta}_m^1 (\theta^t);\mathcal{D}_m^\prime)$ +13: Compute perturbation $\epsilon (\theta^t)$ via (20) +14: Update $\theta^{t + 1}$ via (21) +15: end for + +# A.2. Sharp-MAMLup algorithm + +In this case, $\epsilon_{m}(\theta^{t}) = 0, \forall m, t$ , so we have that $\tilde{\theta}_{m}^{1}(\theta^{t}) = \theta^{t} - \beta_{\mathrm{low}} \widetilde{\nabla} \mathcal{L}(\theta^{t}; \mathcal{D}_{m})$ and $\tilde{\theta}_{m}^{2}(\theta^{t}) = \theta^{t} + \epsilon (\theta^{t}) - \beta_{\mathrm{low}} \widetilde{\nabla} \mathcal{L}(\theta^{t} + \epsilon (\theta^{t}); \mathcal{D}_{m})$ . Defining $\nabla h = \widetilde{\nabla}_{\theta^{t}} \sum_{m=1}^{M} \mathcal{L}(\tilde{\theta}_{m}^{1}(\theta^{t}); \mathcal{D}_{m}')$ , the upper perturbation $\epsilon(\theta^{t})$ can be computed by: + +$$ +\epsilon \left(\theta^ {t}\right) = \alpha_ {\mathrm {u p}} \nabla h / \left\| \nabla h \right\| _ {2}. \tag {20} +$$ + +Algorithm 4 Sharp-MAMLlow +1: Require: $p(\mathcal{T})$ : distribution over tasks +2:Require: $\beta_{\mathrm{low}},\beta_{\mathrm{up}}$ : step sizes +3:Require: $\alpha_{\mathrm{low}} > 0,\alpha_{\mathrm{up}} > 0$ : perturbation radii +4: for $t = 1,\dots ,T$ do +5: Sample batch of tasks $\mathcal{T}_m\sim p(\mathcal{T})$ +6: for all $\mathcal{T}_m$ do +7: Sample $K$ examples $\mathcal{D}_m$ from $\mathcal{T}_m$ +8: Evaluate $\widetilde{\nabla}\mathcal{L}(\theta^t;\mathcal{D}_m)$ +9: Compute perturbation $\epsilon_{m}(\theta^{t})$ via (11) +10: Compute fine-tuned parameter $\tilde{\theta}_{m}^{1}(\theta^{t})$ via (22) +11: Sample data $\mathcal{D}_m^\prime$ for meta-update +12: end for +13: Update the meta-model $\theta^{t + 1}$ via (23) +14: end for + +Let $\epsilon^t = \epsilon (\theta^t)$ , then the final meta update can be written as + +$$ +\theta^ {t + 1} = \theta^ {t} - \beta_ {\mathrm {u p}} \widetilde {\nabla} _ {\theta^ {t}} \sum_ {m = 1} ^ {M} \mathcal {L} \left(\theta^ {t} + \epsilon^ {t} - \beta_ {\mathrm {l o w}} \widetilde {\nabla} \mathcal {L} \left(\theta^ {t} + \epsilon^ {t}; \mathcal {D} _ {m}\right); \mathcal {D} _ {m} ^ {\prime}\right). \tag {21} +$$ + +The pseudo-code is summarized in Algorithm 3. + +# A.3. Sharp-MAMLow algorithm + +In this case, $\epsilon (\theta^t) = 0,\forall t$ , so we have that $\tilde{\theta}_m^1 (\theta^t) = \tilde{\theta}_m^2 (\theta^t) = \theta^t -\beta_{\mathrm{low}}\widetilde{\nabla}\mathcal{L}(\theta^t +\epsilon_m(\theta^t);\mathcal{D}_m)$ . Then the final meta update can be written as + +$$ +\tilde {\theta} _ {m} ^ {1} \left(\theta^ {t}\right) = \theta^ {t} - \beta_ {\text {l o w}} \tilde {\nabla} \mathcal {L} \left(\theta^ {t} + \epsilon_ {m} \left(\theta^ {t}\right); \mathcal {D} _ {m}\right) \tag {22} +$$ + +$$ +\theta^ {t + 1} = \theta^ {t} - \beta_ {\mathrm {u p}} \widetilde {\nabla} _ {\theta^ {t}} \sum_ {m = 1} ^ {M} \mathcal {L} \left(\tilde {\theta} _ {m} ^ {1} \left(\theta^ {t}\right); \mathcal {D} _ {m} ^ {\prime}\right) \tag {23} +$$ + +The pseudo-code is summarized in Algorithm 4. + +# B. Proof of Lemma 1 + +Proof. Since $\mathcal{L}(\theta; \mathcal{D}_m) \in \mathcal{C}^3$ , the stationary point of $\mathcal{L}(\theta; \mathcal{D}_m)$ satisfies + +$$ +\nabla \mathcal {L} (\theta ; \mathcal {D} _ {m}) = 0 \tag {24} +$$ + +and the local minimizer of $\mathcal{L}(\theta ;\mathcal{D}_m)$ satisfies + +$$ +\nabla \mathcal {L} (\theta ; \mathcal {D} _ {m}) = 0 \text {a n d} \nabla^ {2} \mathcal {L} (\theta ; \mathcal {D} _ {m}) \succeq 0. \tag {25} +$$ + +Next we compute the gradient of $\mathcal{L}(\theta_m'(\theta); \mathcal{D}_m)$ according to the chain rule, that is + +$$ +\nabla \mathcal {L} \left(\theta_ {m} ^ {\prime} (\theta); \mathcal {D} _ {m}\right) = \left(I - \beta_ {\text {l o w}} \nabla^ {2} \mathcal {L} \left(\theta ; \mathcal {D} _ {m}\right)\right) \nabla \mathcal {L} \left(\theta - \beta_ {\text {l o w}} \nabla \mathcal {L} \left(\theta ; \mathcal {D} _ {m}\right); \mathcal {D} _ {m}\right) \tag {26} +$$ + +and the Hessian of $\mathcal{L}(\theta_m'(\theta); \mathcal{D}_m)$ , that is + +$$ +\begin{array}{l} \nabla^ {2} \mathcal {L} \left(\theta_ {m} ^ {\prime} (\theta); \mathcal {D} _ {m}\right) = \nabla \left(\left(I - \beta_ {\mathrm {l o w}} \nabla^ {2} \mathcal {L} \left(\theta ; \mathcal {D} _ {m}\right)\right) \nabla \mathcal {L} \left(\theta - \beta_ {\mathrm {l o w}} \nabla \mathcal {L} \left(\theta ; \mathcal {D} _ {m}\right); \mathcal {D} _ {m}\right)\right) \\ = - \beta_ {\text {l o w}} \nabla^ {3} \mathcal {L} (\theta ; \mathcal {D} _ {m}) \nabla \mathcal {L} (\theta - \beta_ {\text {l o w}} \nabla \mathcal {L} (\theta ; \mathcal {D} _ {m}); \mathcal {D} _ {m}) \\ + \left(I - \beta_ {\text {l o w}} \nabla^ {2} \mathcal {L} \left(\theta ; \mathcal {D} _ {m}\right)\right) ^ {2} \nabla^ {2} \mathcal {L} \left(\theta - \beta_ {\text {l o w}} \nabla \mathcal {L} \left(\theta ; \mathcal {D} _ {m}\right); \mathcal {D} _ {m}\right). \tag {27} \\ \end{array} +$$ + +Plugging (24) to (26), we get that $\nabla_{\theta}\mathcal{L}(\theta_m'(\theta);\mathcal{D}_m) = 0$ which implies $\theta$ is also a stationary point for $\mathcal{L}(\theta_m'(\theta);\mathcal{D}_m)$ . + +Moreover, plugging (25) to (27), we get that $\nabla_{\theta}\mathcal{L}(\theta_m^{\prime}(\theta);\mathcal{D}_m) = 0$ and + +$$ +\nabla_ {\theta} ^ {2} \mathcal {L} (\theta_ {m} ^ {\prime} (\theta); \mathcal {D} _ {m}) = (I - \beta_ {\mathrm {l o w}} \nabla^ {2} \mathcal {L} (\theta ; \mathcal {D} _ {m})) ^ {2} \nabla^ {2} \mathcal {L} (\theta ; \mathcal {D} _ {m}) \succeq 0 +$$ + +which implies $\theta$ is also a local minimizer of $\mathcal{L}(\theta_m'(\theta); \mathcal{D}_m)$ . + +If $\theta$ is the stationary point for $\mathcal{L}(\theta; \mathcal{D}_m), \forall m \in \mathcal{M}$ , we know that $\theta$ is also the stationary point for $\mathcal{L}(\theta_m'(\theta); \mathcal{D}_m), \forall m \in \mathcal{M}$ . Thus, $\theta$ is also the stationary point for $\sum_{m=1}^{M} \mathcal{L}(\theta_m'(\theta); \mathcal{D}_m)$ . Likewise, the statement is also true for local minimizer. + +# C. Convergence Analysis + +# C.1. Convergence analysis of MAML (Finn et al., 2017) + +We provide theoretical analysis for MAML (Finn et al., 2017). First, we state the exact form of MAML as follows. + +$$ +\min _ {\theta} \frac {1}{M} \sum_ {m = 1} ^ {M} \mathcal {L} \left(\theta_ {m} ^ {\prime} (\theta); \mathcal {D} _ {m} ^ {\prime}\right) \tag {28a} +$$ + +$$ +\text {s . t .} \theta_ {m} ^ {\prime} (\theta) = \theta - \beta_ {\text {l o w}} \nabla \mathcal {L} (\theta ; \mathcal {D} _ {m}), \forall m \in \mathcal {M}. \tag {28b} +$$ + +The problem (28) can be reformulated as + +$$ +\min _ {\theta} F (\theta) = \frac {1}{M} \sum_ {m = 1} ^ {M} \mathcal {L} \left(\theta_ {m} ^ {\prime} (\theta); \mathcal {D} _ {m} ^ {\prime}\right) \tag {29a} +$$ + +$$ +\mathrm {s . t .} \theta_ {m} ^ {\prime} (\theta) = \arg \min _ {\theta_ {m}} \left\{\nabla \mathcal {L} (\theta ; \mathcal {D} _ {m}) ^ {\top} (\theta_ {m} - \theta) + \frac {1}{2 \beta_ {\mathrm {l o w}}} \| \theta_ {m} - \theta \| ^ {2} \right\}. \tag {29b} +$$ + +Next, to show the connection between MAML formulation and ALSET (Chen et al., 2021a), we can concatenate $\theta_{m}$ as a new vector $\phi = [\theta_1^\top ,\dots ,\theta_M^\top ]^\top$ and define + +$$ +F (\theta) = f (\phi^ {\prime} (\theta)), \quad f (\phi) = \frac {1}{M} \sum_ {m = 1} ^ {M} \mathcal {L} (\theta_ {m}; \mathcal {D} _ {m} ^ {\prime}), \quad g (\theta , \phi) = \frac {1}{M} \sum_ {m = 1} ^ {M} \left\{\nabla \mathcal {L} (\theta ; \mathcal {D} _ {m}) ^ {\top} (\theta_ {m} - \theta) + \frac {\| \theta_ {m} - \theta \| ^ {2}}{2 \beta_ {\mathrm {l o w}}} \right\} +$$ + +where $\phi'(\theta) = \arg \min_{\phi} g(\theta, \phi)$ . Then the Jacobian and Hessian of $f$ and $g$ can be computed by + +$$ +\nabla_ {\phi} f (\phi) = \left( \begin{array}{c} \nabla \mathcal {L} (\theta_ {1}; \mathcal {D} _ {1} ^ {\prime}) \\ \vdots \\ \nabla \mathcal {L} (\theta_ {M}; \mathcal {D} _ {M} ^ {\prime}) \end{array} \right), \quad \nabla_ {\phi \theta} g (\theta , \phi) = \left( \begin{array}{c} \nabla^ {2} \mathcal {L} (\theta_ {1}; \mathcal {D} _ {1}) - \beta_ {\mathrm {l o w}} ^ {- 1} I \\ \vdots \\ \nabla^ {2} \mathcal {L} (\theta_ {M}; \mathcal {D} _ {M}) - \beta_ {\mathrm {l o w}} ^ {- 1} I \end{array} \right), \quad \nabla_ {\phi \phi} g (\theta , \phi) = \beta_ {\mathrm {l o w}} ^ {- 1} I +$$ + +where $I$ denotes the identity matrix. According to the expression of $\nabla F(\theta)$ in ALSET (Chen et al., 2021a), we can verify that MAML's gradient has the following form + +$$ +\begin{array}{l} \nabla F (\theta) = - \nabla_ {\theta \phi} g (\theta , \phi) \nabla_ {\phi \phi} ^ {- 1} g (\theta , \phi) \nabla_ {\phi} f (\phi) \\ = \frac {1}{M} \sum_ {m = 1} ^ {M} \left(I - \beta_ {\text {l o w}} \nabla^ {2} \mathcal {L} \left(\theta ; \mathcal {D} _ {m}\right)\right) \nabla \mathcal {L} \left(\theta_ {m}; \mathcal {D} _ {m} ^ {\prime}\right). \tag {30} \\ \end{array} +$$ + +Moreover, since $g(\theta, \phi)$ is a quadratic function with respect to $\phi$ , the strongly convexity and Lipschitz continuity assumptions hold. Assumptions about upper-level function also hold under Assumption 1. + +Then, for notational simplicity, we consider the single-sample case with $K = 1$ and define three independent samples for stochastic gradient and Hessian computation as $\xi_{m} := (x,y) \sim \mathcal{D}_{m}, \psi_{m} := (x,y) \sim \mathcal{D}_{m}, \xi_{m}' := (x,y) \sim \mathcal{D}_{m}'$ , so the + +corresponding $K$ -batch gradient and Hessian estimators used in MAML algorithms can be written as + +$$ +\nabla \mathcal {L} (\theta ; \mathcal {D} _ {m}, \xi_ {m}) = \frac {1}{K} \sum_ {\xi_ {m} \sim \mathcal {D} _ {m}} \nabla l (\theta , x, y), +$$ + +$$ +\nabla^ {2} \mathcal {L} (\theta ; \mathcal {D} _ {m}, \psi_ {m}) = \frac {1}{K} \sum_ {\psi_ {m} \sim \mathcal {D} _ {m}} \nabla^ {2} l (\theta , x, y), +$$ + +$$ +\nabla \mathcal {L} (\theta ; \mathcal {D} _ {m} ^ {\prime}, \xi_ {m} ^ {\prime}) = \frac {1}{K} \sum_ {\xi_ {m} ^ {\prime} \sim \mathcal {D} _ {m} ^ {\prime}} \nabla l (\theta , x, y). +$$ + +Based on these notations, we can write the stochastic update of MAML algorithm (Finn et al., 2017) as + +$$ +\theta^ {t + 1} = \theta^ {t} - \beta_ {\mathrm {u p}} \widetilde {\nabla} _ {\theta^ {t}} \mathcal {L} (\theta^ {t}; \mathcal {D} _ {m}) = \theta^ {t} - \frac {\beta_ {\mathrm {u p}}}{M} \sum_ {m = 1} ^ {M} (I - \beta_ {\mathrm {l o w}} \nabla^ {2} \mathcal {L} (\theta^ {t}; \mathcal {D} _ {m}, \psi_ {m})) \nabla \mathcal {L} (\theta_ {m} ^ {t + 1}; \mathcal {D} _ {m} ^ {\prime}, \xi_ {m} ^ {\prime}) +$$ + +$$ +\theta_ {m} ^ {t + 1} = \theta^ {t} - \beta_ {\mathrm {l o w}} \nabla \mathcal {L} (\theta^ {t}; \mathcal {D} _ {m}, \xi_ {m}). +$$ + +Then MAML algorithm can be seen as a special case of ALSET, so we have the following Lemma. + +Lemma 2. Under Assumption 1-2, and choosing stepsizes $\beta_{\mathrm{low}},\beta_{\mathrm{up}} = \mathcal{O}(\frac{1}{\sqrt{T}})$ with some proper constants, we can get that the iterates $\{\theta^t\}$ generated by MAML (Finn et al., 2017) satisfy + +$$ +\frac {1}{T} \sum_ {t = 1} ^ {T} \mathbb {E} \left[ \| \nabla F (\theta^ {t}) \| ^ {2} \right] = \mathcal {O} \left(\frac {1}{\sqrt {T}}\right). +$$ + +# C.2. Convergence analysis of a generic biased MAML + +Since Sharp-MAML can be treated as biased update version of MAML (Finn et al., 2017), we first analyze the general biased MAML algorithm. Suppose that biased MAML update with + +$$ +\theta^ {t + 1} = \theta^ {t} - \frac {\beta_ {\mathrm {u p}}}{M} \sum_ {m = 1} ^ {M} (I - \beta_ {\mathrm {l o w}} \hat {\nabla} ^ {2} \mathcal {L} (\theta^ {t}; \mathcal {D} _ {m}, \psi_ {m})) \nabla \mathcal {L} (\hat {\theta} _ {m} ^ {t + 1}; \mathcal {D} _ {m} ^ {\prime}, \xi_ {m} ^ {\prime}) +$$ + +$$ +\hat {\boldsymbol {\theta}} _ {m} ^ {t + 1} = \boldsymbol {\theta} ^ {t} - \beta_ {\mathrm {l o w}} \hat {\nabla} \mathcal {L} (\boldsymbol {\theta} ^ {t}; \mathcal {D} _ {m}, \xi_ {m}) +$$ + +where $\hat{\nabla}^2\mathcal{L}(\theta^t;\mathcal{D}_m,\psi_m),\hat{\nabla}\mathcal{L}(\theta^t;\mathcal{D}_m,\xi_m)$ are biased estimator of $\nabla^2\mathcal{L}(\theta^t;\mathcal{D}_m),\nabla \mathcal{L}(\theta^t;\mathcal{D}_m)$ , respectively. With the notation that + +$$ +\hat {\nabla} \mathcal {L} (\theta ; \mathcal {D} _ {m}) \triangleq \mathbb {E} _ {\xi_ {m}} \left[ \hat {\nabla} \mathcal {L} (\theta ; \mathcal {D} _ {m}, \xi_ {m}) \right], \hat {\nabla} ^ {2} \mathcal {L} (\theta ; \mathcal {D} _ {m}) \triangleq \mathbb {E} _ {\psi_ {m}} \left[ \hat {\nabla} ^ {2} \mathcal {L} (\theta ; \mathcal {D} _ {m}, \psi_ {m}) \right], +$$ + +we make the following assumptions. + +Assumption 3 (Stochastic derivatives). Assume that $\hat{\nabla}\mathcal{L}(\theta ;\mathcal{D}_m,\xi_m),\hat{\nabla}^2\mathcal{L}(\theta ;\mathcal{D}_m,\psi_m)$ are unbiased estimator of $\hat{\nabla}\mathcal{L}(\theta ;\mathcal{D}_m),\hat{\nabla}^2\mathcal{L}(\theta ;\mathcal{D}_m)$ respectively and their variances are bounded by $\sigma_b^2$ + +Assumption 4. Assume that $\| \hat{\nabla}^2\mathcal{L}(\theta^t;\mathcal{D}_m) - \nabla^2\mathcal{L}(\theta^t;\mathcal{D}_m)\| \leq \gamma_h$ $\| \hat{\nabla}\mathcal{L}(\theta^t;\mathcal{D}_m) - \nabla \mathcal{L}(\theta^t;\mathcal{D}_m)\| \leq \gamma_g,\forall m\in \mathcal{M}.$ + +Throughout the proof, we use + +$$ +\mathcal {F} _ {t} = \sigma \left\{\hat {\theta} _ {1} ^ {0}, \dots , \hat {\theta} _ {M} ^ {0}, \theta^ {0}, \dots , \theta^ {t}, \hat {\theta} _ {1} ^ {t + 1}, \dots , \hat {\theta} _ {M} ^ {t + 1} \right\}, \mathcal {F} _ {t} ^ {\prime} = \sigma \left\{\hat {\theta} _ {1} ^ {0}, \dots , \hat {\theta} _ {M} ^ {0}, \theta^ {0}, \dots , \theta^ {t} \right\} +$$ + +where $\sigma\{\cdot\}$ denotes the $\sigma$ -algebra generated by random variables. We also denote + +$$ +h ^ {t} \triangleq \frac {1}{M} \sum_ {m = 1} ^ {M} (I - \beta_ {\text {l o w}} \hat {\nabla} ^ {2} \mathcal {L} (\theta^ {t}; \mathcal {D} _ {m}, \psi_ {m})) \nabla \mathcal {L} (\hat {\theta} _ {m} ^ {t + 1}; \mathcal {D} _ {m} ^ {\prime}, \xi_ {m} ^ {\prime}) +$$ + +$$ +\begin{array}{l} \bar {h} ^ {t} \triangleq \mathbb {E} \left[ \frac {1}{M} \sum_ {m = 1} ^ {M} \left(I - \beta_ {\mathrm {l o w}} \hat {\nabla} ^ {2} \mathcal {L} \left(\theta^ {t}; \mathcal {D} _ {m}, \psi_ {m}\right)\right) \nabla \mathcal {L} \left(\hat {\theta} _ {m} ^ {t + 1}; \mathcal {D} _ {m} ^ {\prime}, \xi_ {m} ^ {\prime}\right) \Big | \mathcal {F} _ {t} \right] \\ = \frac {1}{M} \sum_ {m = 1} ^ {M} (I - \beta_ {\mathrm {l o w}} \hat {\nabla} ^ {2} \mathcal {L} (\theta^ {t}; \mathcal {D} _ {m})) \nabla \mathcal {L} (\hat {\theta} _ {m} ^ {t + 1}; \mathcal {D} _ {m} ^ {\prime}). \\ \end{array} +$$ + +Lemma 3. Under Assumption 1-4, we have that + +$$ +\mathbb {E} \left[ \| \nabla F \left(\theta^ {t}\right) - \bar {h} ^ {t} \| ^ {2} \right] \leq 4 \ell_ {1} ^ {2} \beta_ {\text {l o w}} ^ {2} \left(\gamma_ {g} ^ {2} + \sigma_ {b} ^ {2}\right) + 4 \beta_ {\text {l o w}} ^ {2} \left(\ell_ {0} ^ {2} \gamma_ {h} ^ {2} + 4 \left(\gamma_ {h} ^ {2} + \ell_ {1} ^ {2}\right) \ell_ {1} ^ {2} \beta_ {\text {l o w}} ^ {2} \left(\gamma_ {g} ^ {2} + \sigma_ {b} ^ {2}\right)\right). \tag {31} +$$ + +Proof. Since $\mathbb{E}\left[\hat{\theta}_m^{t + 1}|\mathcal{F}_t'\right] = \theta^t -\beta_{\mathrm{low}}\hat{\nabla}\mathcal{L}(\theta^t;\mathcal{D}_m)$ , then from Assumption 4, we have $\left\| \theta_m'(\theta^t) - \mathbb{E}\left[\hat{\theta}_m^{t + 1}|\mathcal{F}_t'\right]\right\| \leq \beta_{\mathrm{low}}\gamma_g$ . Taking expectation with respect to $\mathcal{F}_t^\prime$ , we get + +$$ +\mathbb {E} \left[ \| \theta_ {m} ^ {\prime} (\boldsymbol {\theta} ^ {t}) - \hat {\theta} _ {m} ^ {t + 1} \| ^ {2} \right] \leq 2 \mathbb {E} \left[ \| \theta_ {m} ^ {\prime} (\boldsymbol {\theta} ^ {t}) - \mathbb {E} \left[ \hat {\theta} _ {m} ^ {t + 1} | \mathcal {F} _ {t} ^ {\prime} \right] \| ^ {2} \right] + 2 \mathbb {E} \left[ \| \mathbb {E} \left[ \hat {\theta} _ {m} ^ {t + 1} | \mathcal {F} _ {t} ^ {\prime} \right] - \hat {\theta} _ {m} ^ {t + 1} \| ^ {2} \right] \leq 2 \beta_ {\mathrm {l o w}} ^ {2} \gamma_ {g} ^ {2} + 2 \beta_ {\mathrm {l o w}} ^ {2} \sigma_ {b} ^ {2}. +$$ + +Then using Lipschitz continuity of $\nabla \mathcal{L}(\theta ;\mathcal{D}_m^{\prime})$ , we obtain + +$$ +\mathbb {E} \left\| \nabla \mathcal {L} \left(\theta_ {m} ^ {\prime} \left(\theta^ {t}\right); \mathcal {D} _ {m} ^ {\prime}\right) - \nabla \mathcal {L} \left(\hat {\theta} _ {m} ^ {t + 1}; \mathcal {D} _ {m} ^ {\prime}\right) \right\| ^ {2} \leq 2 \ell_ {1} ^ {2} \beta_ {\text {l o w}} ^ {2} \left(\gamma_ {g} ^ {2} + \sigma_ {b} ^ {2}\right). \tag {32} +$$ + +On the other hand, by observing that + +$$ +\left\| \hat {\nabla} ^ {2} \mathcal {L} (\theta^ {t}; \mathcal {D} _ {m}) \right\| ^ {2} \leq 2 \left\| \nabla^ {2} \mathcal {L} (\theta^ {t}; \mathcal {D} _ {m}) \right\| ^ {2} + 2 \left\| \nabla^ {2} \mathcal {L} (\theta^ {t}; \mathcal {D} _ {m}) - \hat {\nabla} ^ {2} \mathcal {L} (\theta^ {t}; \mathcal {D} _ {m}) \right\| ^ {2} \leq 2 (\gamma_ {h} ^ {2} + \ell_ {1} ^ {2}), +$$ + +we get + +$$ +\begin{array}{l} \mathbb {E} \left\| \nabla^ {2} \mathcal {L} \left(\theta^ {t}; \mathcal {D} _ {m}\right) \nabla \mathcal {L} \left(\theta_ {m} ^ {\prime} \left(\theta^ {t}\right); \mathcal {D} _ {m} ^ {\prime}\right) - \hat {\nabla} ^ {2} \mathcal {L} \left(\theta^ {t}; \mathcal {D} _ {m}\right) \nabla \mathcal {L} \left(\hat {\theta} _ {m} ^ {t + 1}; \mathcal {D} _ {m} ^ {\prime}\right) \right\| ^ {2} \\ \leq 2 \mathbb {E} \left\| \nabla^ {2} \mathcal {L} (\theta^ {t}; \mathcal {D} _ {m}) - \hat {\nabla} ^ {2} \mathcal {L} (\theta^ {t}; \mathcal {D} _ {m}) \right\| ^ {2} \left\| \nabla \mathcal {L} (\theta_ {m} ^ {\prime} (\theta^ {t}); \mathcal {D} _ {m} ^ {\prime}) \right\| ^ {2} + 2 \mathbb {E} \left\| \hat {\nabla} ^ {2} \mathcal {L} (\theta^ {t}; \mathcal {D} _ {m}) \right\| ^ {2} \left\| \nabla \mathcal {L} (\theta_ {m} ^ {\prime} (\theta^ {t}); \mathcal {D} _ {m} ^ {\prime}) - \nabla \mathcal {L} (\hat {\theta} _ {m} ^ {t + 1}; \mathcal {D} _ {m} ^ {\prime}) \right\| ^ {2} \\ \leq 2 \ell_ {0} ^ {2} \gamma_ {h} ^ {2} + 8 \left(\gamma_ {h} ^ {2} + \ell_ {1} ^ {2}\right) \ell_ {1} ^ {2} \beta_ {\text {l o w}} ^ {2} \left(\gamma_ {g} ^ {2} + \sigma_ {b} ^ {2}\right). \tag {33} \\ \end{array} +$$ + +Thus, using (32) and (33), we get + +$$ +\begin{array}{l} \mathbb {E} \left[ \| \nabla F (\theta^ {t}) - \bar {h} ^ {t} \| ^ {2} \right] \\ = \mathbb {E} \left\| \frac {1}{M} \sum_ {m = 1} ^ {M} \left[ (I - \beta_ {\text {l o w}} \nabla^ {2} \mathcal {L} (\theta^ {t}; \mathcal {D} _ {m})) \nabla \mathcal {L} (\theta_ {m} ^ {\prime} (\theta^ {t}); \mathcal {D} _ {m} ^ {\prime}) - (I - \beta_ {\text {l o w}} \hat {\nabla} ^ {2} \mathcal {L} (\theta^ {t}; \mathcal {D} _ {m})) \nabla \mathcal {L} (\hat {\theta} _ {m} ^ {t + 1}; \mathcal {D} _ {m} ^ {\prime}) \right] \right\| ^ {2} \\ \leq \frac {2}{M} \sum_ {m = 1} ^ {M} \mathbb {E} \left\| \nabla \mathcal {L} \left(\theta_ {m} ^ {\prime} \left(\theta^ {t}\right); \mathcal {D} _ {m} ^ {\prime}\right) - \nabla \mathcal {L} \left(\hat {\theta} _ {m} ^ {t + 1}; \mathcal {D} _ {m} ^ {\prime}\right) \right\| ^ {2} \\ + \frac {2 \beta_ {\mathrm {l o w}} ^ {2}}{M} \sum_ {m = 1} ^ {M} \mathbb {E} \left\| \nabla^ {2} \mathcal {L} (\theta^ {t}; \mathcal {D} _ {m}) \nabla \mathcal {L} (\theta_ {m} ^ {\prime} (\theta^ {t}); \mathcal {D} _ {m} ^ {\prime}) - \hat {\nabla} ^ {2} \mathcal {L} (\theta^ {t}; \mathcal {D} _ {m}) \nabla \mathcal {L} (\hat {\theta} _ {m} ^ {t + 1}; \mathcal {D} _ {m} ^ {\prime}) \right\| ^ {2} \\ \leq 4 \ell_ {1} ^ {2} \beta_ {\text {l o w}} ^ {2} (\gamma_ {g} ^ {2} + \sigma_ {b} ^ {2}) + 4 \beta_ {\text {l o w}} ^ {2} \left(\ell_ {0} ^ {2} \gamma_ {h} ^ {2} + 4 (\gamma_ {h} ^ {2} + \ell_ {1} ^ {2}) \ell_ {1} ^ {2} \beta_ {\text {l o w}} ^ {2} (\gamma_ {g} ^ {2} + \sigma_ {b} ^ {2})\right) \\ \end{array} +$$ + +from which the proof is complete. + +Lemma 4. Under Assumption 1-4, and choosing stepsizes $\beta_{\mathrm{low}},\beta_{\mathrm{up}} = \mathcal{O}(\frac{1}{\sqrt{T}})$ , and $\gamma_{g},\gamma_{h} = \mathcal{O}(1)$ with some proper constants, we can get that the iterates $\{\theta^t\}$ generated by biased MAML satisfy + +$$ +\frac {1}{T} \sum_ {t = 1} ^ {T} \mathbb {E} \left[ \| \nabla F (\theta^ {t}) \| ^ {2} \right] = \mathcal {O} \left(\frac {1}{\sqrt {T}}\right). +$$ + +Proof. First we bound the variance of stochastic biased meta gradient estimator $h^t$ as + +$$ +\begin{array}{l} \mathbb {E} \left[ \| h ^ {t} - \bar {h} ^ {t} \| ^ {2} \mid \mathcal {F} _ {t} \right] \leq \frac {2}{M} \sum_ {m = 1} ^ {M} \mathbb {E} \left[ \| \left(I - \beta_ {\text {l o w}} \hat {\nabla} ^ {2} \mathcal {L} \left(\theta^ {t}; \mathcal {D} _ {m}, \psi_ {m}\right)\right) \nabla \mathcal {L} \left(\hat {\theta} _ {m} ^ {t + 1}; \mathcal {D} _ {m} ^ {\prime}, \xi_ {m} ^ {\prime}\right) \right. \\ - \left(I - \beta_ {\mathrm {l o w}} \hat {\nabla} ^ {2} \mathcal {L} \left(\theta^ {t}; \mathcal {D} _ {m}\right)\right) \nabla \mathcal {L} \left(\hat {\theta} _ {m} ^ {t + 1}; \mathcal {D} _ {m} ^ {\prime}\right) \| ^ {2} \Big | \mathcal {F} _ {t} \Big ] \\ \end{array} +$$ + +$$ +\begin{array}{l} \leq \frac {4}{M} \sum_ {m = 1} ^ {M} \mathbb {E} \left[ \| \nabla \mathcal {L} \left(\hat {\theta} _ {m} ^ {t + 1}; \mathcal {D} _ {m} ^ {\prime}, \xi_ {m} ^ {\prime}\right) - \nabla \mathcal {L} \left(\hat {\theta} _ {m} ^ {t + 1}; \mathcal {D} _ {m} ^ {\prime}\right) \| ^ {2} \middle | \mathcal {F} _ {t} \right] \\ + \frac {4 \beta_ {\text {l o w}} ^ {2}}{M} \sum_ {m = 1} ^ {M} \mathbb {E} \left[ \| \hat {\nabla} ^ {2} \mathcal {L} \left(\theta^ {t}; \mathcal {D} _ {m}, \psi_ {m}\right) \nabla \mathcal {L} \left(\hat {\theta} _ {m} ^ {t + 1}; \mathcal {D} _ {m} ^ {\prime}, \xi_ {m} ^ {\prime}\right) - \hat {\nabla} ^ {2} \mathcal {L} \left(\theta^ {t}; \mathcal {D} _ {m}\right) \nabla \mathcal {L} \left(\hat {\theta} _ {m} ^ {t + 1}; \mathcal {D} _ {m} ^ {\prime}\right) \| ^ {2} \Big | \mathcal {F} _ {t} \right] \\ \leq 4 \ell_ {1} ^ {2} \sigma^ {2} + \frac {8 \beta_ {\mathrm {l o w}} ^ {2}}{M} \sum_ {m = 1} ^ {M} \mathbb {E} \left[ \| \nabla \mathcal {L} (\hat {\theta} _ {m} ^ {t + 1}; \mathcal {D} _ {m} ^ {\prime}, \xi_ {m} ^ {\prime}) \| ^ {2} \| \hat {\nabla} ^ {2} \mathcal {L} (\theta^ {t}; \mathcal {D} _ {m}, \psi_ {m}) - \hat {\nabla} ^ {2} \mathcal {L} (\theta^ {t}; \mathcal {D} _ {m}) \| ^ {2} \right| \mathcal {F} _ {t} \\ + \frac {8 \beta_ {\text {l o w}} ^ {2}}{M} \sum_ {m = 1} ^ {M} \mathbb {E} \left[ \| \hat {\nabla} ^ {2} \mathcal {L} \left(\theta^ {t}; \mathcal {D} _ {m}\right) \| ^ {2} \| \nabla \mathcal {L} \left(\hat {\theta} _ {m} ^ {t + 1}; \mathcal {D} _ {m} ^ {\prime}, \xi_ {m} ^ {\prime}\right) - \nabla \mathcal {L} \left(\hat {\theta} _ {m} ^ {t + 1}; \mathcal {D} _ {m} ^ {\prime}\right) \| ^ {2} \right| \mathcal {F} _ {t} \Bigg ] \\ \leq 4 \ell_ {1} ^ {2} \sigma^ {2} + 8 \beta_ {\text {l o w}} ^ {2} \sigma_ {b} ^ {2} \mathbb {E} \left[ \| \nabla \mathcal {L} \left(\hat {\theta} _ {m} ^ {t + 1}; \mathcal {D} _ {m} ^ {\prime}, \xi_ {m} ^ {\prime}\right) \| ^ {2} \mid \mathcal {F} _ {t} \right] + 1 6 \left(\gamma_ {h} ^ {2} + \ell_ {1} ^ {2}\right) \beta_ {\text {l o w}} ^ {2} \sigma^ {2} \\ \leq 4 \ell_ {1} ^ {2} \sigma^ {2} + 1 6 \left(\gamma_ {h} ^ {2} + \ell_ {1} ^ {2}\right) \beta_ {\text {l o w}} ^ {2} \sigma^ {2} + 1 6 \beta_ {\text {l o w}} ^ {2} \sigma_ {b} ^ {2} \left(\sigma^ {2} + \ell_ {0} ^ {2}\right) \triangleq \tilde {\sigma} ^ {2} \tag {34} \\ \end{array} +$$ + +where (34) comes from + +$$ +\mathbb {E} \left[ \| \nabla \mathcal {L} (\hat {\theta} _ {m} ^ {t + 1}; \mathcal {D} _ {m} ^ {\prime}, \xi_ {m} ^ {\prime}) \| ^ {2} \Big | \mathcal {F} _ {t} \right] \leq 2 \| \nabla \mathcal {L} (\hat {\theta} _ {m} ^ {t + 1}; \mathcal {D} _ {m} ^ {\prime}) \| ^ {2} + 2 \mathbb {E} \left[ \| \nabla \mathcal {L} (\hat {\theta} _ {m} ^ {t + 1}; \mathcal {D} _ {m} ^ {\prime}, \xi_ {m} ^ {\prime}) - \nabla \mathcal {L} (\hat {\theta} _ {m} ^ {t + 1}; \mathcal {D} _ {m} ^ {\prime}) \| ^ {2} \Big | \mathcal {F} _ {t} \right] \leq 2 (\ell_ {0} ^ {2} + \sigma^ {2}). +$$ + +Then according to Lemma 4 in (Chen et al., 2021a), $F$ is smooth with constant $L_{F} = \mathcal{O}(1)$ . Using the smoothness property with Lemma 2 in (Chen et al., 2021a), it follows that + +$$ +\begin{array}{l} \mathbb {E} \left[ F \left(\theta^ {t + 1}\right) \mid \mathcal {F} _ {t} \right] \leq F \left(\theta^ {t}\right) + \mathbb {E} \left[ \left\langle \nabla F \left(\theta^ {t}\right), \theta^ {t + 1} - \theta^ {t} \right\rangle \mid \mathcal {F} _ {t} \right] + \frac {L _ {F}}{2} \mathbb {E} \left[ \left\| \theta^ {t + 1} - \theta^ {t} \right\| ^ {2} \mid \mathcal {F} _ {t} \right] \\ \leq F (\theta^ {t}) - \beta_ {\mathrm {u p}} \left\langle \nabla F (\theta^ {t}), \bar {h} ^ {t} \right\rangle + \frac {L _ {F} \beta_ {\mathrm {u p}} ^ {2}}{2} \mathbb {E} \left[ \| h ^ {t} \| ^ {2} | \mathcal {F} _ {t} \right] \\ \stackrel {(a)} {\leq} F (\theta^ {t}) - \beta_ {\mathrm {u p}} \left\langle \nabla F (\theta^ {t}), \bar {h} ^ {t} \right\rangle + \frac {L _ {F} \beta_ {\mathrm {u p}} ^ {2}}{2} \left\| \bar {h} ^ {t} \right\| ^ {2} + \frac {L _ {F} \beta_ {\mathrm {u p}} ^ {2} \tilde {\sigma} ^ {2}}{2} \\ \stackrel {(b)} {=} F (\theta^ {t}) - \frac {\beta_ {\mathrm {u p}}}{2} \left\| \nabla F (\theta^ {t}) \right\| ^ {2} - \left(\frac {\beta_ {\mathrm {u p}}}{2} - \frac {L _ {F} \beta_ {\mathrm {u p}} ^ {2}}{2}\right) \left\| \bar {h} ^ {t} \right\| ^ {2} + \frac {\beta_ {\mathrm {u p}}}{2} \left\| \nabla F (\theta^ {t}) - \bar {h} ^ {t} \right\| ^ {2} + \frac {L _ {F} \beta_ {\mathrm {u p}} ^ {2} \tilde {\sigma} ^ {2}}{2} \\ \end{array} +$$ + +where (a) uses $\mathbb{E}\left[\| A\| ^2 |B\right] = (\mathbb{E}\left[A|B\right])^2 +\mathbb{E}\left[\| A - \mathbb{E}\left[A|B\right]\| ^2 |B\right]$ and (34), and (b) uses $2a^{\top}b = \| a\|^{2} + \| b\|^{2} - \| a - b\|^{2}$ . Then using the result in Lemma 3 and choosing $\beta_{\mathrm{up}}\leq \frac{1}{L_F}$ , telescoping and rearranging it, we obtain that + +$$ +\frac {1}{T} \sum_ {t = 1} ^ {T} \mathbb {E} \left[ \left\| \nabla F \left(\theta^ {t}\right) \right\| ^ {2} \right] \leq \frac {2 F \left(\theta^ {1}\right)}{\beta_ {\mathrm {u p}} T} + L _ {F} \beta_ {\mathrm {u p}} \tilde {\sigma} ^ {2} + 4 \beta_ {\mathrm {l o w}} ^ {2} \left(\ell_ {1} ^ {2} \left(\gamma_ {g} ^ {2} + \sigma_ {b} ^ {2}\right) + \ell_ {0} ^ {2} \gamma_ {h} ^ {2} + 4 \left(\gamma_ {h} ^ {2} + \ell_ {1} ^ {2}\right) \ell_ {1} ^ {2} \beta_ {\mathrm {l o w}} ^ {2} \left(\gamma_ {g} ^ {2} + \sigma_ {b} ^ {2}\right)\right). \tag {35} +$$ + +Choosing $\beta_{\mathrm{up}},\beta_{\mathrm{low}} = \mathcal{O}\left(\frac{1}{\sqrt{T}}\right)$ and $\gamma_{g},\gamma_{h} = \mathcal{O}(1)$ , we can get the $\mathcal{O}\left(\frac{1}{\sqrt{T}}\right)$ convergence results of biased MAML. + +# C.3. Convergence analysis of Sharp-MAML + +Thanks to the discussion in Section C.2, the convergence of Sharp-MAML is straightforward. Here we only prove for Sharp-MAML both since same results for the other two variants can be derived by setting $\alpha_{\mathrm{up}} = 0$ or $\alpha_{\mathrm{low}} = 0$ accordingly. + +Lemma 5. Under Assumption 1-2, and choosing step sizes $\beta_{\mathrm{low}},\beta_{\mathrm{up}} = \mathcal{O}(\frac{1}{\sqrt{T}})$ and perturbation radii $\alpha_{\mathrm{up}} = \mathcal{O}(\frac{1}{\sqrt{T}})$ , $\alpha_{\mathrm{low}} = \mathcal{O}(1)$ , with some proper constants, we can get that the iterates $\{\theta^t\}$ generated by Sharp-MAMLboth satisfy + +$$ +\frac {1}{T} \sum_ {t = 1} ^ {T} \mathbb {E} \left[ \| \nabla F (\theta^ {t}) \| ^ {2} \right] = \mathcal {O} \left(\frac {1}{\sqrt {T}}\right). +$$ + +Proof. Recalling the update of Sharp-MAMLboth, we rewrite it as follows. + +$$ +\theta^ {t + 1} = \theta^ {t} - \frac {\beta_ {\mathrm {u p}}}{M} \sum_ {m = 1} ^ {M} (I - \beta_ {\mathrm {l o w}} \nabla^ {2} \mathcal {L} (\theta^ {t} + \epsilon (\theta^ {t}) + \epsilon_ {m} (\theta^ {t}); \mathcal {D} _ {m}, \psi_ {m})) \nabla \mathcal {L} (\hat {\theta} _ {m} ^ {t + 1}; \mathcal {D} _ {m} ^ {\prime}, \xi_ {m} ^ {\prime}); +$$ + +$$ +\begin{array}{l} \hat {\theta} _ {m} ^ {t + 1} = \theta^ {t} + \epsilon (\theta^ {t}) - \beta_ {\text {l o w}} \nabla \mathcal {L} (\theta^ {t} + \epsilon (\theta^ {t}) + \epsilon_ {m} (\theta^ {t}); \mathcal {D} _ {m}, \xi_ {m}) \\ = \theta^ {t} - \beta_ {\text {l o w}} \left(\nabla \mathcal {L} \left(\theta^ {t} + \epsilon \left(\theta^ {t}\right) + \epsilon_ {m} \left(\theta^ {t}\right); \mathcal {D} _ {m}, \xi_ {m}\right) - \frac {\epsilon \left(\theta^ {t}\right)}{\beta_ {\text {l o w}}}\right). \\ \end{array} +$$ + +Since $\nabla \mathcal{L}(\theta ;\mathcal{D}_m),\nabla^2\mathcal{L}(\theta ;\mathcal{D}_m)$ are Lipschitz continuous with $\ell_1,\ell_2$ according to Assumption 1, then we have that + +$$ +\begin{array}{l} \| \nabla \mathcal {L} \left(\theta^ {t} + \epsilon \left(\theta^ {t}\right) + \epsilon_ {m} \left(\theta^ {t}\right); \mathcal {D} _ {m}\right) - \frac {\epsilon \left(\theta^ {t}\right)}{\beta_ {\text {l o w}}} - \nabla \mathcal {L} \left(\theta^ {t}; \mathcal {D} _ {m}\right) \| \leq \ell_ {1} \left(\alpha_ {\text {u p}} + \alpha_ {\text {l o w}}\right) + \frac {\alpha_ {\text {u p}}}{\beta_ {\text {l o w}}} \\ \left\| \nabla^ {2} \mathcal {L} \left(\theta^ {t} + \epsilon \left(\theta^ {t}\right) + \epsilon_ {m} \left(\theta^ {t}\right); \mathcal {D} _ {m}\right) - \nabla^ {2} \mathcal {L} \left(\theta^ {t}; \mathcal {D} _ {m}\right) \right\| \leq \ell_ {2} \left(\alpha_ {\mathrm {u p}} + \alpha_ {\mathrm {l o w}}\right), \\ \end{array} +$$ + +which satisfies the condition in Lemma 4 if $\alpha_{\mathrm{up}} = \mathcal{O}\left(\frac{1}{\sqrt{T}}\right), \alpha_{\mathrm{low}} = \mathcal{O}(1)$ . Thus, we arrive at the conclusion. + +![](images/f6f4315f76a1c74470e62b28efb6433998aee396d79d4acc985e5e0ccac74c4f.jpg) + +# D. Generalization Analysis + +We build on the recently developed PAC-Bayes bound for meta learning (Farid & Majumdar, 2021), as restated below. + +Lemma 6. Assume the loss function $\mathcal{L}(\cdot)$ is bounded: $0\leq \mathcal{L}(h,\mathcal{D})\leq 1$ for any $h$ in the hypothesis space, and any $\mathcal{D}$ in the sample space. For hypotheses $h_{A(\theta ,\mathcal{D})}$ learned with $\gamma_{\mathrm{A}}$ uniformly stable algorithm $A$ , data-independent prior $P_{\theta ,0}$ over initializations $\theta$ , and $\delta \in (0,1)$ , with probability at least $1 - \delta$ over a sampling of the meta-training dataset $\mathcal{D}\sim \mathcal{P}$ , and $|\mathcal{D}| = n$ , which include meta-training data from all tasks, the following holds simultaneously for all distributions $P_{\theta}$ over $\theta$ : + +$$ +\underset {\mathcal {D} \sim \mathcal {P}} {\mathbb {E}} \underset {\theta \sim P _ {\theta}} {\mathbb {E}} \mathcal {L} (h _ {A (\theta , \mathcal {D})}, \mathcal {D}) \leq \frac {1}{n} \sum_ {i = 1} ^ {n} \underset {\theta \sim P _ {\theta}} {\mathbb {E}} \mathcal {L} (h _ {A (\theta , \mathcal {D})}, (x _ {i}, y _ {i})) + \sqrt {\frac {D _ {\mathrm {K L}} (P _ {\theta} \| P _ {\theta , 0}) + \ln \frac {2 \sqrt {n}}{\delta}}{2 n}} + \gamma_ {\mathrm {A}}. +$$ + +We can obtain a generalization bound below. + +Theorem 3. Assume loss function $\mathcal{L}(\cdot)$ is bounded: $0\leq \mathcal{L}(\theta_m;\mathcal{D})\leq 1$ for any $\theta_{m}$ , and any $\mathcal{D}$ , and $\mathcal{L}(\theta_m(\hat{\theta});\mathcal{P})\leq \mathbb{E}_{\epsilon \sim \mathcal{N}(\mathbf{0},\alpha^2\mathbf{I})}[\mathcal{L}(\theta_m(\hat{\theta} +\epsilon);\mathcal{P})]$ at the stationary point of the Sharp-MAMLup denoted by $\hat{\theta}$ . For parameter $\theta_{m}(\hat{\theta};\mathcal{D})$ learned with $\gamma_{\mathrm{A}}$ uniformly stable algorithm $A$ from $\hat{\theta}\in \mathbb{R}^{k}$ , with probability $1 - \delta$ over the choice of the training set $\mathcal{D}\sim \mathcal{P}$ , with $|\mathcal{D}| = n$ , it holds that + +$$ +\mathcal {L} (\theta_ {m} (\hat {\theta}); \mathcal {P}) \leq \max _ {\| \epsilon \| _ {2} \leq \alpha} \mathcal {L} (\theta_ {m} (\hat {\theta} + \epsilon); \mathcal {D}) + \gamma_ {\mathrm {A}} + \sqrt {\frac {k \ln \left(1 + \frac {\| \hat {\theta} \| _ {2} ^ {2}}{\alpha^ {2}} \left(1 + \sqrt {\frac {\ln n}{k}}\right) ^ {2}\right) + 2 \ln \frac {1}{\delta} + 5 \ln n + \mathcal {O} (1)}{4 n}}. +$$ + +Proof. Since Lemma 6 holds for any prior $P_{\theta,0}$ and posterior $P_{\theta}$ , let $P_{\theta,0} = P = \mathcal{N}(\mathbf{0}, \sigma_P^2 \mathbf{I})$ , $P_{\theta} = Q = \mathcal{N}(\theta, \alpha^2 \mathbf{I})$ , then + +$$ +\begin{array}{l} D _ {K L} (Q \| P) = \frac {1}{2} \left\{\operatorname {t r} \left(\boldsymbol {\Sigma} _ {P} ^ {- 1} \boldsymbol {\Sigma} _ {Q}\right) + \left(\boldsymbol {\mu} _ {P} - \boldsymbol {\mu} _ {Q}\right) ^ {\mathrm {T}} \boldsymbol {\Sigma} _ {P} ^ {- 1} \left(\boldsymbol {\mu} _ {P} - \boldsymbol {\mu} _ {Q}\right) - k + \ln \frac {| \boldsymbol {\Sigma} _ {P} |}{| \boldsymbol {\Sigma} _ {Q} |} \right\} \\ = \frac {1}{2} \left[ \frac {k \alpha^ {2} + \| \theta \| _ {2} ^ {2}}{\sigma_ {P} ^ {2}} - k + k \ln \left(\frac {\sigma_ {P} ^ {2}}{\alpha^ {2}}\right) \right]. \\ \end{array} +$$ + +Let $T = \{c\exp ((1 - j) / k)\mid j\in \mathbb{N}\}$ be the set of values for $\sigma_P^2$ . If for any $j\in \mathbb{N}$ , the PAC-Bayesian bound in Lemma 6 holds for $\sigma_P^2 = c\exp ((1 - j) / k)$ with probability $1 - \delta_{j}$ with $\delta_{j} = \frac{6\delta}{\pi^{2}j^{2}}$ , then by the union bound, all bounds w.r.t. all $\sigma_P^2\in T$ hold simultaneously with probability at least $1 - \sum_{j = 1}^{\infty}\frac{6\delta}{\pi^{2}j^{2}} = 1 - \delta$ . + +First consider $\| \theta \|^{2} \leq \alpha^{2}(\exp (4n / k) - 1)$ , then $k\alpha^{2} + \| \theta \|_{2}^{2} \leq k\alpha^{2}(\exp (4n / k) + 1)$ . Now set $j = \left\lfloor 1 - k\ln \left(\left(\alpha^{2} + \| \theta \|_{2}^{2} / k\right) / c\right)\right\rfloor$ . By setting $c = \alpha^{2}(1 + \exp (4n / k))$ , then $\ln \left(\left(\alpha^{2} + \| \theta \|_{2}^{2} / k\right) / c\right) < 0$ , thus we can ensure that $j \in \mathbb{N}$ . Furthermore, for $\sigma_P^2 = c\exp ((1 - j) / k)$ , we have: + +$$ +\alpha^ {2} + \| \theta \| _ {2} ^ {2} / k \leq \sigma_ {P} ^ {2} \leq \exp (1 / k) (\alpha^ {2} + \| \theta \| _ {2} ^ {2} / k) +$$ + +where the first inequality is derived from $1 - j = \lceil k\ln ((\alpha^2 +\| \theta \| _2^2 /k) / c)\rceil \geq k\ln ((\alpha^2 +\| \theta \| _2^2 /k) / c)$ , the second inequality is derived from $1 - j = \lceil k\ln ((\alpha^{2} + \| \theta \|_{2}^{2} / k) / c)\rceil \leq k\ln ((\alpha^{2} + \| \theta \|_{2}^{2} / k) / c) + 1$ + +The KL-divergence term can be further bounded as + +$$ +\begin{array}{l} D _ {K L} (Q \| P) = \frac {1}{2} \left[ \frac {k \alpha^ {2} + \| \theta \| _ {2} ^ {2}}{\sigma_ {P} ^ {2}} - k + k \ln \left(\frac {\sigma_ {P} ^ {2}}{\alpha^ {2}}\right) \right] \\ \leq \frac {1}{2} \left[ \frac {k \alpha^ {2} + \| \theta \| _ {2} ^ {2}}{\alpha^ {2} + \| \theta \| _ {2} ^ {2} / k} - k + k \ln \left(\frac {\exp (1 / k) (\alpha^ {2} + \| \theta \| _ {2} ^ {2} / k)}{\alpha^ {2}}\right) \right] \\ = \frac {1}{2} \left[ k \ln \left(\frac {\exp (1 / k) \left(\alpha^ {2} + \| \theta \| _ {2} ^ {2} / k\right)}{\alpha^ {2}}\right) \right] \\ = \frac {1}{2} \left[ 1 + k \ln \left(1 + \frac {\| \theta \| _ {2} ^ {2}}{k \alpha^ {2}}\right) \right]. \\ \end{array} +$$ + +Given the bound that corresponds to $j$ holds with probability $1 - \delta_{j}$ for $\delta_{j} = \frac{6\delta}{\pi^{2}j^{2}}$ , the ln term above can be written as: + +$$ +\begin{array}{l} \ln {\frac {1}{\delta_ {j}}} = \ln {\frac {1}{\delta}} + \ln {\frac {\pi^ {2} j ^ {2}}{6}} \\ \leq \ln \frac {1}{\delta} + \ln \frac {\pi^ {2} k ^ {2} \ln^ {2} \left(c / \left(\alpha^ {2} + \| \theta \| _ {2} ^ {2} / k\right)\right)}{6} \\ \leq \ln {\frac {1}{\delta}} + \ln {\frac {\pi^ {2} k ^ {2} \ln^ {2} (c / \alpha^ {2})}{6}} \\ = \ln {\frac {1}{\delta}} + \ln {\frac {\pi^ {2} k ^ {2} \ln^ {2} (1 + \exp (4 n / k))}{6}} \\ \leq \ln \frac {1}{\delta} + \ln \frac {\pi^ {2} k ^ {2} (4 n / k) ^ {2}}{6} \leq \ln \frac {1}{\delta} + 2 \ln (6 n). \\ \end{array} +$$ + +Therefore for $\epsilon \sim \mathcal{N}(\mathbf{0},\sigma^2\mathbf{I})$ , the generalization bound is + +$$ +\begin{array}{l} \mathbb {E} _ {\epsilon \sim \mathcal {N} (\mathbf {0}, \sigma^ {2} \mathbf {I})} \left[ \mathcal {L} (\theta_ {m} (\theta + \epsilon); \mathcal {P}) \right] \leq \mathbb {E} _ {\epsilon \sim \mathcal {N} (\mathbf {0}, \sigma^ {2} \mathbf {I})} \left[ \mathcal {L} (\theta_ {m} (\theta + \epsilon); \mathcal {D}) \right] + \sqrt {\frac {\frac {1}{2} k \ln \left(1 + \frac {\| \theta \| _ {2} ^ {2}}{k \sigma^ {2}}\right) + \frac {1}{2} + \ln \frac {2 \sqrt {n}}{\delta} + 2 \ln (6 n)}{2 n}} + \gamma_ {\mathrm {A}} \\ = \mathbb {E} _ {\epsilon \sim \mathcal {N} (\mathbf {0}, \sigma^ {2} \mathbf {I})} [ \mathcal {L} (\theta_ {m} (\theta + \epsilon); \mathcal {D}) ] + \sqrt {\frac {\frac {1}{2} k \ln \left(1 + \frac {\| \theta \| _ {2} ^ {2}}{k \sigma^ {2}}\right) + \frac {1}{2} + \ln 7 2 + \ln \frac {1}{\delta} + \frac {5}{2} \ln n}{2 n}} + \gamma_ {\mathrm {A}}. \\ \end{array} +$$ + +By Lemma 1 in (Laurent & Massart, 2000), we have that for $\epsilon \sim \mathcal{N}(\mathbf{0},\sigma^2\mathbf{I})$ and any positive $t$ .. + +$$ +P \left(\| \epsilon \| _ {2} ^ {2} - k \sigma^ {2} \geq 2 \sigma^ {2} \sqrt {k t} + 2 t \sigma^ {2}\right) \leq \exp (- t). +$$ + +Therefore, with probability $1 - 1 / \sqrt{n}$ we have that: + +$$ +\| \epsilon \| _ {2} ^ {2} \leq \sigma^ {2} (2 \ln (\sqrt {n}) + k + 2 \sqrt {k \ln (\sqrt {n})}) \leq \sigma^ {2} k \left(1 + \sqrt {\frac {\ln n}{k}}\right) ^ {2} = \alpha^ {2}. +$$ + +At the stationary point $\hat{\theta}$ obtained by Sharp-MAML, we have + +$$ +\begin{array}{l} \mathcal {L} (\theta_ {m} (\hat {\theta}); \mathcal {P}) \leq \mathbb {E} _ {\epsilon \sim \mathcal {N} (\mathbf {0}, \alpha^ {2} \mathbf {I})} \left[ \mathcal {L} (\theta_ {m} (\hat {\theta} + \epsilon); \mathcal {P}) \right] \leq (1 - 1 / \sqrt {n}) \max _ {\| \epsilon \| _ {2} \leq \alpha} \mathcal {L} (\theta_ {m} (\hat {\theta} + \epsilon); \mathcal {D}) + 1 / \sqrt {n} \\ + \sqrt {\frac {\frac {1}{2} k \ln \left(1 + \frac {\| \hat {\theta} \| _ {2} ^ {2}}{k \sigma^ {2}}\right) + \frac {1}{2} + \ln 7 2 + \ln \frac {1}{\delta} + \frac {5}{2} \ln n}{2 n}} + \gamma_ {\mathrm {A}} \\ \leq \max _ {\| \epsilon \| _ {2} \leq \alpha} \mathcal {L} (\theta_ {m} (\hat {\theta} + \epsilon); \mathcal {D}) + \sqrt {\frac {k \ln \left(1 + \frac {\| \hat {\theta} \| _ {2} ^ {2}}{\alpha^ {2}} \left(1 + \sqrt {\frac {\ln n}{k}}\right) ^ {2}\right) + 1 4 + 2 \ln \frac {1}{\delta} + 5 \ln n}{4 n}} + \gamma_ {\mathrm {A}} \\ \end{array} +$$ + +where the last inequality holds due to $1 - 1 / \sqrt{n} \leq 1$ and Jensen's inequality. + +And then consider $\| \hat{\theta} \|^{2} > \alpha^{2}(\exp (4n / k) - 1)$ , apparently in (18), the RHS + +$$ +\begin{array}{l} \max _ {\| \epsilon \| _ {2} \leq \alpha} \mathcal {L} (\theta_ {m} (\hat {\theta} + \epsilon); \mathcal {D}) + \sqrt {\frac {k \ln \left(1 + \frac {\| \hat {\theta} \| _ {2} ^ {2}}{\alpha^ {2}} \left(1 + \sqrt {\frac {\ln n}{k}}\right) ^ {2}\right) + 1 4 + 2 \ln \frac {1}{\delta} + 5 \ln n}{4 n}} + \gamma_ {\mathrm {A}} \\ > \max _ {\| \epsilon \| _ {2} \leq \alpha} \mathcal {L} \left(\theta_ {m} (\hat {\theta} + \epsilon); \mathcal {D}\right) + \sqrt {\frac {4 n + 1 4 + 2 \ln \frac {1}{\delta} + 5 \ln n}{4 n}} + \gamma_ {\mathrm {A}} \\ > \max _ {\| \epsilon \| _ {2} \leq \alpha} \mathcal {L} \left(\theta_ {m} (\hat {\theta} + \epsilon); \mathcal {D}\right) + 1 + \gamma_ {\mathrm {A}} \\ \geq \mathcal {L} \left(\theta_ {m} (\hat {\theta}); \mathcal {P}\right) \\ \end{array} +$$ + +which completes the proof. + +# D.1. Discussion: choice of the perturbation radius $\alpha$ + +The upper bound of the population loss on the RHS of (18), is a function of $\alpha$ . A choice of $\alpha > 0$ close to zero, approximates the original MAML method without SAM. We explain why SAM improves the generalization ability of MAML by showing that for any sufficiently small $\alpha_0 > 0$ , we can find $\alpha_1 > \alpha_0$ where the upper bound of the population loss takes smaller value than at $\alpha_0$ . + +Proof. Let $c = \| \theta \|_2^2 \left(1 + \sqrt{\frac{\ln n}{k}}\right)^2$ . Denote + +$$ +g (\alpha) = \max _ {\| \epsilon \| _ {2} \leq \alpha} \mathcal {L} (\theta + \epsilon ; \mathcal {D}) + \sqrt {\frac {k \ln (1 + \frac {c}{\alpha^ {2}}) + 2 \ln \frac {1}{\delta} + 5 \ln n + O (1)}{4 n}} + \gamma_ {\mathrm {A}}. +$$ + +Since $0 \leq \mathcal{L}(\cdot) \leq 1$ , it follows that for any $0 < \alpha_0 < \left(\frac{c}{\exp(4n / k) - 1}\right)^{1/2}$ , + +$$ +g (\alpha_ {0}) \geq \sqrt {\frac {k \ln \left(1 + \frac {c}{\alpha_ {0} ^ {2}}\right) + 2 \ln \frac {1}{\delta} + 5 \ln n + O (1)}{4 n}} + \gamma_ {\mathrm {A}}. +$$ + +Choose + +$$ +\alpha_ {1} > \left(\frac {c}{\left(1 + \frac {c}{\alpha_ {0} ^ {2}}\right) \exp (- 4 n / k) - 1}\right) ^ {1 / 2} > \left(\frac {c}{\left(1 + \frac {c}{\alpha_ {0} ^ {2}}\right) - 1}\right) ^ {1 / 2} = \alpha_ {0} +$$ + +then it follows that + +$$ +\begin{array}{l} g (\alpha_ {1}) \leq 1 + \sqrt {\frac {k \ln \left(1 + \frac {c}{\alpha_ {1} ^ {2}}\right) + 2 \ln \frac {1}{\delta} + 5 \ln n + O (1)}{4 n}} + \gamma_ {\mathrm {A}} \\ < 1 + \sqrt {\frac {k \ln \left(\left(1 + \frac {c}{\alpha_ {0} ^ {2}}\right) \exp (- 4 n / k)\right) + 2 \ln \frac {1}{\delta} + 5 \ln n + O (1)}{4 n}} + \gamma_ {\mathrm {A}} \\ = 1 + \sqrt {\frac {- 4 n + k \ln \left(1 + \frac {c}{\alpha_ {0} ^ {2}}\right) + 2 \ln \frac {1}{\delta} + 5 \ln n + O (1)}{4 n}} + \gamma_ {\mathrm {A}} \\ \leq \sqrt {\frac {k \ln \left(1 + \frac {c}{\alpha_ {0} ^ {2}}\right) + 2 \ln \frac {1}{\delta} + 5 \ln n + O (1)}{4 n}} + \gamma_ {\mathrm {A}} \\ \leq g (\alpha_ {0}) \\ \end{array} +$$ + +which completes the proof. + +![](images/8abd27183204037edd08171cf9e04b684bed206e5c67f9d0aed5c72dfd4440a4.jpg) + +# D.2. Discussion: justification on the assumption + +To obtain the generalization bound, we assume the population loss + +$$ +\mathcal {L} \left(\theta_ {m} (\hat {\theta}); \mathcal {P}\right) \leq \mathbb {E} _ {\epsilon \sim \mathcal {N} \left(\mathbf {0}, \alpha^ {2} \mathbf {I}\right)} \left[ \mathcal {L} \left(\theta_ {m} (\hat {\theta} + \epsilon); \mathcal {P}\right) \right] \tag {36} +$$ + +at the stationary point of the Sharp-MAML $_{\mathrm{up}}$ denoted by $\hat{\theta}$ . We give some discussion next to justify this assumption. + +If $\hat{\theta}$ is the local minimizer of $\mathcal{L}(\theta_m(\hat{\theta});\mathcal{D})$ , then with high probability, $\| \epsilon \| ^2\leq \alpha^2$ , $\mathcal{L}(\theta_m(\hat{\theta});\mathcal{D})\leq \mathbb{E}_{\epsilon \sim \mathcal{N}(\mathbf{0},\alpha^2\mathbf{I})}[\mathcal{L}(\theta_m(\hat{\theta});\mathcal{D})]$ . Assume the empirically observed $\mathcal{D}$ is representative of $\mathcal{P}$ and preserves the local property of the loss landscape $\mathcal{L}(\theta_m(\hat{\theta});\mathcal{P})$ around $\hat{\theta}$ , i.e. for $\mathcal{D}\sim \mathcal{P}$ , $|\mathcal{D}|\to \infty$ , $\mathcal{L}(\theta_m(\hat{\theta});\mathcal{D})\leq \mathbb{E}_{\epsilon \sim \mathcal{N}(\mathbf{0},\alpha^2\mathbf{I})}[\mathcal{L}(\theta_m(\hat{\theta});\mathcal{D})]$ with high probability, then we have $\mathcal{L}(\theta_m(\hat{\theta});\mathcal{P})\leq \mathbb{E}_{\epsilon \sim \mathcal{N}(\mathbf{0},\alpha^2\mathbf{I})}[\mathcal{L}(\theta_m(\hat{\theta});\mathcal{P})]$ . + +Table 4. Results on Omniglot (20-way 1-shot). + +
ALGORITHMSACCURACY
MATCHING NETS93.8%
REPTILE (NICHOL & SCHULMAN, 2018)89.43%
FOMAML (NICHOL & SCHULMAN, 2018)89.40%
MAML (REPRODUCED)91.77 %
SHARP-MAMLlow92.89 %
SHARP-MAMLup92.96 %
SHARP-MAMLboth93.47 %
+ +Table 5. Results on Omniglot (20-way 5-shot). + +
ALGORITHMSACCURACY
MATCHING NETS98.50%
FOMAML (NICHOL & SCHULMAN, 2018)97.12%
REPTILE (NICHOL & SCHULMAN, 2018)97.90%
MAML (REPRODUCED)96.16%
SHARP-MAMLlow96.59%
SHARP-MAMLup96.62%
SHARP-MAMLboth96.64%
+ +# E. Additional Experiments + +In this section, we provide additional details of the experimental set-up and present our results on the Omniglot dataset. + +Few-shot classification on Omniglot dataset. We used the same experimental setups in (Finn et al., 2017). We use only one inner gradient step with 0.1 learning rate for all our experiments for training and testing. The batch size was set to 16 for the 20-way learning setting. Following (Ravi & Larochelle, 2017), 15 examples per class were used to evaluate the post-update meta-gradient. The values of $\alpha_{\mathrm{low}}$ and $\alpha_{\mathrm{up}}$ are chosen from the grid search on the set $\{0.05, 0.005, 0.0005, 0.00005\}$ and each experiment is run on each value for three random seeds. We choose the inner gradient steps from a set of $\{3, 5, 7, 10\}$ . The step size is chosen via the grid search from a set of $\{0.1, 0.01, 0.001\}$ . For Sharp-MAML both we use the same value of $\alpha_{\mathrm{low}}$ and $\alpha_{\mathrm{up}}$ in each experiment. The reproduced result of MAML for the 20-way 1-shot setting is close to that of MAML++ (Antoniou et al., 2019). For the 20-way 1-shot setting, we observe a similar trend where Sharp-MAML both achieves the best accuracy of $93.47\%$ as compared to $91.77\%$ of MAML. The performance gain of Sharp-MAML on the Omniglot dataset is not as significant as the Mini-Imagenet dataset because the former task is much simpler. \ No newline at end of file diff --git a/sharpmamlsharpnessawaremodelagnosticmetalearning/images.zip b/sharpmamlsharpnessawaremodelagnosticmetalearning/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..f2ff2fd9f382178b90c28b89b876d20c3b471dc4 --- /dev/null +++ b/sharpmamlsharpnessawaremodelagnosticmetalearning/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:988cbd06b2938864f7d4c745ff8c3d8e8252634b95733e98777cc55ff91e751e +size 1254517 diff --git a/sharpmamlsharpnessawaremodelagnosticmetalearning/layout.json b/sharpmamlsharpnessawaremodelagnosticmetalearning/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..fb4c26d4f2d93bf341c0e3ad667fd526a183f221 --- /dev/null +++ b/sharpmamlsharpnessawaremodelagnosticmetalearning/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1ff5c854ae6ebef54a1eb856f58223cd1587e72ecd1d6c170613ee6f49cf6b90 +size 1041586 diff --git a/shiftaddnashardwareinspiredsearchformoreaccurateandefficientneuralnetworks/e5ffd054-676f-40bf-bf98-7cbb00a68e9b_content_list.json b/shiftaddnashardwareinspiredsearchformoreaccurateandefficientneuralnetworks/e5ffd054-676f-40bf-bf98-7cbb00a68e9b_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..f7ecac23106f3fba9e522726446174047066933f --- /dev/null +++ b/shiftaddnashardwareinspiredsearchformoreaccurateandefficientneuralnetworks/e5ffd054-676f-40bf-bf98-7cbb00a68e9b_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fbea32fca519db2a3fba3215af44a262df58be538405747ef6a1aa1e4817c085 +size 106697 diff --git a/shiftaddnashardwareinspiredsearchformoreaccurateandefficientneuralnetworks/e5ffd054-676f-40bf-bf98-7cbb00a68e9b_model.json b/shiftaddnashardwareinspiredsearchformoreaccurateandefficientneuralnetworks/e5ffd054-676f-40bf-bf98-7cbb00a68e9b_model.json new file mode 100644 index 0000000000000000000000000000000000000000..b482ad0df7a57bbf644fb0c07b707c17d1ca1c84 --- /dev/null +++ b/shiftaddnashardwareinspiredsearchformoreaccurateandefficientneuralnetworks/e5ffd054-676f-40bf-bf98-7cbb00a68e9b_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8d37dc6851c23252e2c7bca2bd67c895f2cb552797318e4f050ef3a84349220a +size 129425 diff --git a/shiftaddnashardwareinspiredsearchformoreaccurateandefficientneuralnetworks/e5ffd054-676f-40bf-bf98-7cbb00a68e9b_origin.pdf b/shiftaddnashardwareinspiredsearchformoreaccurateandefficientneuralnetworks/e5ffd054-676f-40bf-bf98-7cbb00a68e9b_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f647f930327a0f6d0f69d2f4a9829f22ad60f3b0 --- /dev/null +++ b/shiftaddnashardwareinspiredsearchformoreaccurateandefficientneuralnetworks/e5ffd054-676f-40bf-bf98-7cbb00a68e9b_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:040b4632b638cbd1f529de0234b312ccd7f6f2ffa409a9b2c5f0ff9a8c0e94b3 +size 1275656 diff --git a/shiftaddnashardwareinspiredsearchformoreaccurateandefficientneuralnetworks/full.md b/shiftaddnashardwareinspiredsearchformoreaccurateandefficientneuralnetworks/full.md new file mode 100644 index 0000000000000000000000000000000000000000..dd46223f770b466c4f07ecfce4e9ef4fa3b8393c --- /dev/null +++ b/shiftaddnashardwareinspiredsearchformoreaccurateandefficientneuralnetworks/full.md @@ -0,0 +1,383 @@ +# ShiftAddNAS: Hardware-Inspired Search for More Accurate and Efficient Neural Networks + +Haoran You† 1 Baopu Li² Huihong Shi³ Yonggan Fu¹ Yingyan Lin¹ + +# Abstract + +Neural networks (NNs) with intensive multiplications (e.g., convolutions and transformers) are capable yet power hungry, impeding their more extensive deployment into resource-constrained devices. As such, multiplication-free networks, which follow a common practice in energy-efficient hardware implementation to parameterize NNs with more efficient operators (e.g., bitwise shifts and additions), have gained growing attention. However, multiplication-free networks usually under-perform their vanilla counterparts in terms of the achieved accuracy. To this end, this work advocates hybrid NNs that consist of both powerful yet costly multiplications and efficient yet less powerful operators for marrying the best of both worlds, and proposes ShiftAddNAS, which can automatically search for more accurate and more efficient NNs. Our ShiftAddNAS highlights two enablers. Specifically, it integrates (1) the first hybrid search space that incorporates both multiplication-based and multiplication-free operators for facilitating the development of both accurate and efficient hybrid NNs; and (2) a novel weight sharing strategy that enables effective weight sharing among different operators that follow heterogeneous distributions (e.g., Gaussian for convolutions vs. Laplacian for add operators) and simultaneously leads to a largely reduced supernet size and much better searched networks. Extensive experiments and ablation studies on various models, datasets, and tasks consistently validate the efficacy of ShiftAddNAS, e.g., achieving up to a $+7.7\%$ higher accuracy or a $+4.9$ better BLEU score compared to state-of-the-art NN, while leading to up to $93\%$ or $69\%$ + +energy and latency savings, respectively. Codes and pretrained models are available at https:// github.com/RICE-EIC/ShiftAddNAS. + +# 1. Introduction + +The unprecedented performance achieved by neural networks (NNs), e.g., convolutional neural networks (CNNs) and Transformers, requires intensive multiplications and thus prohibitive training and inference costs, contradicting the explosive demand for embedding various intelligent functionalities into pervasive resource-constrained edge devices. In response, multiplication-free networks have been proposed to alleviate the prohibitive resource requirements by replacing the costly multiplications with lower-cost operators for boosting hardware efficiency. For example, AdderNet (Chen et al., 2020) utilizes mere additions to design NNs; and ShiftAddNet (You et al., 2020a) follows a commonly used hardware practice to re-parameterize NNs with both bitwise shifts and additions. Despite their promising performance in hardware efficiency, multiplication-free NNs in general under-perform their CNN and Transformer counterparts in terms of task accuracy for both computer vision (CV) and natural language processing (NLP) applications. + +To marry the best of both worlds, we advocate hybrid multiplication-reduced network architectures that integrate both multiplication-based operators (e.g., vanilla convolution (Krizhevsky et al., 2012) and attention (Vaswani et al., 2017)) and multiplication-free operators (e.g., shift and add (You et al., 2020a)) to simultaneously boost task accuracy and efficiency. Thanks to the amazing success of neural architecture search (NAS) in automating the process of designing state-of-the-art (SOTA) NNs, it is natural to consider NAS as the design engine of the aforementioned hybrid NNs for various applications and tasks, each often requiring a different performance-efficiency trade-off. However, there still exist a few challenges in leveraging NAS to design the hybrid NNs. First, existing NAS methods mostly consider the search for either efficient CNNs (Wan et al., 2020), Transformers (Chen et al., 2021b), or hybrid CNN-Transformers (Ding et al., 2021; Li et al., 2021), and there still is a lack of a seminal work that searches for multiplication-reduced hybrid networks, especially for the + +hardware-inspired networks that incorporate both bitwise shifts and additions. Second, a hybrid search space could make it more challenging to achieve effective NAS and further aggravate the search burden, due to the enlarged search space imposed by the newly introduced multiplication-free operators. It is worth noting that existing weight sharing strategies of NAS cannot directly be applied to the target hybrid search space, because weights of different operators follow heterogeneous distributions, leading to a dilemma of either inefficient search or inconsistent architecture ranking. Specifically, weights in convolutional and adder layers follow Gaussian and Laplacian distributions, respectively, as also highlighted by (Chen et al., 2020; Xu et al., 2020). As such, forcing weight sharing among heterogeneous operators could hurt the capacity and thus the achieved accuracy of the resulting NNs, while treating them separately could explode the search space and make it more difficult to achieve effective NAS, i.e., the dilemma mentioned above. + +To tackle the aforementioned challenges towards more accurate and efficient NNs, this work makes the following contributions: + +1. We propose a generic NAS framework dubbed ShiftAddNAS, which for the first time can automatically search for efficient hybrid NNs with both superior accuracy and efficiency. Our ShiftAddNAS integrates a hybrid hardware-inspired search space that incorporates both multiplication-based operators (e.g., convolution and attention) and multiplication-free operators (e.g., shift and add), and can serve as a play-and-plug module to be applied on top of SOTA NAS works for further boosting their achievable accuracy and efficiency. +2. We develop a new weight sharing strategy for effective search with hybrid search spaces, which only incurs a negligible overhead when searching for hybrid operators with heterogeneous (e.g., Gaussian vs. Laplacian) weight distributions as compared to the vanilla NAS with merely multiplication-based operators, alleviating the dilemma mentioned above regarding either inefficient search or inconsistent architecture ranking. +3. We conduct extensive experiments and ablation studies to validate the effectiveness of ShiftAddNAS against SOTA works. Results on multiple benchmarks demonstrate the superior accuracy and hardware efficiency of its searched NNs as compared to both (1) manually designed multiplication-free networks, CNNs, Transformers, and hybrid CNN-Transformers, and (2) SOTA NAS works, on both CV and NLP tasks. + +# 2. Related Works + +Multiplication-free NNs. Many efficient NNs aim to reduce their intensive multiplications that dominate the time/energy costs. One important trend is to replace the + +multiplications with lower-cost operators: BNNs (Courbariaux et al., 2016; Juefei-Xu et al., 2017) binarize both the weights and activations and reduce multiplications to merely sign flips at non-negligible accuracy drops; AdderNets (Chen et al., 2020; Xu et al., 2020; Wang et al., 2021b) fully replace the multiplications with lower-cost additions and further develop an effective backpropagation scheme for efficient AdderNet training; Shift-based NNs leverage either spatial shift (Wu et al., 2018) or bit-wise shift operations, e.g., DeepShift (Elhoushi et al., 2021), to reduce the amount of multiplications; and ShiftAddNet (You et al., 2020a) draws inspirations from efficient hardware designs to reparamatize NNs with mere bitwise shifts and additions. While multiplication-free NNs under-perform their vanilla NN counterparts in terms of achieved accuracy, ShiftAddNAS aims to automatically search for multiplication-reduced NNs that incorporate both multiplication-based and multiplication-free operators for marrying the best of both worlds, i.e., boosted accuracy and efficiency. + +Neural architecture search. NAS has achieved an amazing success in automating the design of efficient NN architectures. For searching for CNNs, early works (Tan & Le, 2019; Tan et al., 2019; Howard et al., 2019) adopt reinforcement learning based methods that require a prohibitive search time and computing resources, while recent works (Liu et al., 2018; Wu et al., 2019a; Wan et al., 2020; Yang et al., 2021) utilize differentiable search to greatly improve the search efficiency. More recently, some works adopt one-shot NAS (Guo et al., 2020; Cai et al., 2019; Yu et al., 2020; Wang et al., 2021a) to decouple the architecture search from supernet training and then evaluate the performance of sub-networks whose weights are directly inherited from the pretrained supernet. For searching better Transformers, recently emerging works (Wang et al., 2020a; Su et al., 2021; Chen et al., 2021b;a) take one-shot NAS and an evolutionary algorithm to obtain optimal Transformer architectures for both NLP and CV tasks. Additionally, BossNAS (Li et al., 2021) and HR-NAS (Ding et al., 2021) further search for hybrid CNN-Transformer architectures. + +Nevertheless, little effort has been made to explore NAS methods especially their search strategies for multiplication-reduced NNs. Furthermore, it is not clear whether existing efficient NAS methods are applicable to search for such multiplication-reduced NNs. As such, it is highly desirable to develop NAS methods, e.g., ShiftAddNAS, dedicated for hardware-inspired multiplication-reduced NNs to increase achievable accuracy and efficiency. + +Transformers. Transformers (Vaswani et al., 2017) were first proposed for NLP tasks, which have inspired many interesting works. Some advance Transformer architecture by improving the attention mechanism (Chen et al., 2018), training deeper Transformers (Wang et al., 2019), and replacing the attention with convolutional modules + +(Wu et al., 2019b); and others strive to reduce Transformers' computational complexity by adopting sparse attention mechanisms (Zaheer et al., 2020), low-rank approximation (Wang et al., 2020b), or compression techniques (Wu et al., 2020). Recently, there has been a growing interest in developing Transformers for CV tasks. Vision Transformer (ViT) (Dosovitskiy et al., 2021) for the first time successfully applies pure Transformers to image classification and achieves SOTA task accuracy, which yet relies on pretraining on giant datasets. Following works including DeiT (Touvron et al., 2021), the authors in T2T-ViT (Yuan et al., 2021) develop new training recipes and tokenization schemes, for achieving comparable accuracy without the necessity of costly pretraining; and another trend is to incorporate CNN modules into Transformer architectures for better accuracy and efficiency tradeoffs (Wu et al., 2021; Graham et al., 2021). In contrast, we advocate hybrid multiplication-reduced NNs and develop an automated search framework that can automatically search for such hardware inspired hybrid models. + +# 3. The Proposed ShiftAddNAS Framework + +In this section, we first introduce the hybrid search space from both algorithmic and hardware cost perspectives, providing high-level background and justification for motivating ShiftAddNAS; Sec. 3.2 elaborates the one-shot search method of ShiftAddNAS by first analyzing the dilemma of either inefficient search or inconsistent architecture ranking and then introducing the proposed novel heterogeneous weight sharing strategy tackling the aforementioned dilemma. + +# 3.1. ShiftAddNAS: Hybrid Search Space + +Candidate blocks. The first step of developing ShiftAddNAS is to construct a hybrid search space incorporating suitable building blocks that exhibit various performance-efficiency trade-offs. Specifically, we hypothesize that integrating both multiplication-based and multiplication-free blocks into the search space could lead to both boosted accuracy and efficiency, and consider blocks from two trends of designing NNs: (1) capable NNs, e.g., vanilla CNNs and Transformers, leverage either convolutions (Conv) or multi-head self-attention (Attn) that comprise of intensive multiplications to capture local or global correlations, achieving a SOTA accuracy in both CV and NLP tasks; and (2) efficient multiplication-free NNs, e.g., ShiftAddNet, draw inspirations from hardware design practices to incorporate two efficient and complementary blocks, i.e., coarse-grained Shift and fine-grained Add, for favoring hardware efficiency, while maintaining a decent accuracy. While our constructed general hybrid search space for both NLP and CV tasks are shown in Fig. 2, we next analyze the building blocks from both algorithmic and hardware costs perspectives. + +Attn is a core component of Transformers (Vaswani et al., 2017), which consists of a number of heads H with each capturing different global-context information by measuring pairwise correlations among tokens as defined below: + +$$ +\boldsymbol {O} _ {\text {A t t n}} = \operatorname {C o n c a t} \left(\mathrm {H} _ {1}, \dots , \mathrm {H} _ {h}\right) \cdot W ^ {O}, \text {w h e r e} +$$ + +$$ +\mathrm {H} _ {i} = \operatorname {S o f t m a x} \left(\frac {Q W _ {i} ^ {Q} \cdot \left(K W _ {i} ^ {K}\right) ^ {T}}{\sqrt {d _ {k}}}\right) \cdot V W _ {i} ^ {V}, \tag {1} +$$ + +where $h$ denotes the number of heads, $Q, K, V \in \mathbb{R}^{n \times d}$ are the query, key, and value embeddings of hidden dimension $d$ obtained by linearly projecting the input sequence of length $n$ . In this way, the Attn block first computes dot-products between key-query pairs, scales to stabilize the training, uses Softmax to normalize the resulting attention scores, and then computes a weighted sum of the value embeddings corresponding to different inputs. Finally, the results from all heads are concatenated and further projected with a weight matrix $W^O \in \mathbb{R}^{d \times d}$ to generate the outputs. + +Conv is a key operator of CNNs, which models the local-context information of high-dimensional inputs such as images through sliding kernel weights $W$ on top of inputs $X$ to measure their similarity (Gu et al., 2018), as defined in Eq. (2). Its translation invariant and weight sharing ability leads to various SOTA CNNs (He et al., 2016) or hybrid CNN-Transformer models (Xiao et al., 2021). However, the computational complexities of CNNs can be prohibitive due to their intensive multiplications. For example, one forward pass of ResNet-50 (He et al., 2016) requires 4G floating point multiplications. + +$$ +\boldsymbol {O} _ {\text {C o n v}} = \sum X ^ {T} * W \tag {2} +$$ + +Shift is a well-known efficient hardware primitive, motivating the recent development of shift-based efficient NNs. For example, DeepShift (Elhoushi et al., 2021) parametrizes NNs with bitwise shifts and sign flips, as formulated in Eq. (3), with $W = S \cdot 2^{P}$ denoting weights in the shift blocks, where $S \in \{-1,0,1\}$ are sign flip operators and the power-of-two parameter for $P$ represents the bitwise shifts. However, NNs built with shift blocks and quantized weights are observed to be inferior to multiplication-based NNs in terms of expressiveness (accuracy) as validated in (You et al., 2020a). + +$$ +\boldsymbol {O} _ {\text {S h i f t}} = \sum X ^ {T} * (S \cdot 2 ^ {P}) \tag {3} +$$ + +Add is another efficient hardware primitive which motivates recent works (Chen et al., 2020; Wang et al., 2021b; Song et al., 2021) to design efficient NNs using merely additions to measure the similarity between kernel weights $W$ and inputs $X$ , as shown in Eq. (4). Such add-based NNs (Chen et al., 2020; Xu et al., 2020) in general have a better expressive capacity than their shift-based counterparts. For example, AdderNets (Chen et al., 2020) achieve + +![](images/9f68e9d5b37ce60291b80260276b8eb7416cf384c92cf4a98e357904e72c2bce.jpg) +Figure 1: Unit energy comparisons. + +Table 1: The search space for NLP tasks. + +
Encoder block types[Attn, Attn+Conv, Attn+Shift] +[Attn+Add, Conv, Shift, Add]
Decoder block types[Attn, Attn+Conv] +[Attn+Shift, Attn+Add]
Num. of decoder blocks[6, 5, 4, 3, 2, 1]
Elastic embed. dim.[1024, 768, 512]
Elastic head num.[16, 8, 4]
Elastic MLP dim.[4096, 3072, 2048, 1024]
Arbitrary Attn[3, 2, 1]
+ +a $1.37\%$ higher accuracy than DeepShift under similar or even lower FLOPs on ResNet-18 with the ImageNet dataset. However, add-based operators (i.e., repeated additions) are not parameter-efficient as compared to bitwise shift operations (You et al., 2020a). While NNs combining shfit and add achieve a boosted accuracy, efficiency, and robustness than NNs using merely either of them, their accuracy still compares unfavorably in contrast to vanilla CNNs or Transformers. + +$$ +\boldsymbol {O} _ {\mathrm {A d d}} = - \sum \| X - W \| _ {1} \tag {4} +$$ + +Based on the above introduction, the search space in ShiftAddNAS incorporates all the four different types of blocks (i.e., Attn, Conv, Shift, and Add), aiming to push forward both NNs' accuracy and efficiency. Note that we refer to all operators as blocks, and adopt block based search space because it has been evidenced and proven that block based ones can reduce the search space size and lead to more accurate architecture ranking/rating (Li et al., 2020b;a). + +Hardware cost. As mentioned, multiplication-based operators (e.g., Attn and Conv) favor a superior accuracy yet is not hardware efficient, while multiplication-free operators (e.g., Shift and Add) favor a better hardware efficiency yet can hurt the achievable accuracy. Specifically, as shown in Fig. 1, bitwise shifts can save as high as $196 \times$ and $24 \times$ energy costs over multiplications, when implemented in a $45\mathrm{nm}$ CMOS technology and SOTA FPGA (Xilinx Inc.), respectively; with a 16-bit precision, bitwise shifts may achieve at least $9.7 \times$ and $1.45 \times$ average power and area savings than multipliers (Elhoushi et al., 2021); and similarly, additions can save up to $196 \times$ and $31 \times$ energy costs over multiplications in 32-bit fixed-point (FIX32) formats, and $47 \times$ and $4.1 \times$ energy costs in 32-bit floating-point (FP32) formats, when implemented in a $45\mathrm{nm}$ CMOS technology and SOTA FPGA (Xilinx Inc.), respectively, while leading + +Table 2: The search space for CV tasks. + +
Block types[Attn, Conv, Shift, Add]
Num. of 562 × 128 blocks[1, 2, 3, 4]
Num. of 282 × 256 blocks[1, 2, 3, 4]
Num. of 142 × 512 blocks[3, 4, 5, 6, 7]
Num. of 72 × 1024 blocks[4, 5, 6, 7, 8, 9]
+ +to $1.84 \times$ , $25.5 \times$ , and $7.83 \times$ area savings than multiplications in a $45 \mathrm{~nm}$ CMOS technology with FP32, FIX32, and FIX8 formats, respectively (Chen et al., 2021c). + +Supernet for NLP tasks. Based on the above search space, we construct a supernet for the convenience of search following SOTA one-shot NAS methods (Cai et al., 2018; Guo et al., 2020) by estimating the performance of each candidate hybrid model (i.e., subnet) without fully training it. As shown in Fig. 2 (a), each macro-block in the supernet includes all the aforementioned four candidate blocks and three multi-branch combinations (e.g., Attn+Conv) along the channel dimension for capturing both global and local context information following (Wu et al., 2020), where the candidate blocks in the same layer are isolated with each followed by two-layer MLPs and enable elastic embedding dimension, head numbers, and MLP hidden dimension for fine-grained search for efficient NNs as (Wang et al., 2020a). Overall, our supernet for NLP tasks contains about $10^{14}$ subnet candidates, and the searchable choices are listed in Tab. 1. During training, all possible subnets are uniformly sampled and only one path is activated for each layer at run-time considering the practical concern on memory consumption for supernet training. For ease of evaluation, we incorporate common treatments of NAS in our suppenet design. First, for the elastic dimensions mentioned above, all subnets share the front portion of weight channels or attention heads of the largest dimension. Second, all decoder blocks can take the last one, two, or three encoder blocks as inputs for abstracting both high-level and low-level information (Wang et al., 2020a). Note that the number of decoder blocks are also searchable and the conv, shift and add operators are disabled for decoder blocks, as they are observed to be sensitive and activating those paths might hurt the accuracy (You et al., 2020a; Wu et al., 2019b). + +Supernet for CV tasks. Different from the commonly used elastic hidden dimension design for NLP tasks, various spatial resolutions or scales are essential for CV tasks. As such, to ensure more capable feature description of the searched NNs, we adopt a multi-resolution supernet design. As shown in Fig. 2 (b), the supernet incorporates flexible downsampling options, where the spatial resolution for each layer can either stay unchanged or be reduced to half of its previous layer's scale until reaching the smallest resolution. In this way, the four candidate blocks can work collaboratively to deliver the multiscale features required by most CV tasks. Overall, our supernet contains about $10^{9}$ subnets, + +![](images/67bfe17af08fcf1cafbf762b8a03bf8e82bd6d6d8ac3e60cdcd40cf1c8b012ff.jpg) +(a) The SuperNet for NLP Tasks + +![](images/21a0d0c1fdd12ae7b9caa7d3aae09eab55e003649e0621af75a968b6262efba0.jpg) +(b) The SuperNet for CV Tasks + +for which the detailed searchable choices are summarized in Tab. 2. Note that the Attn block is followed by two-layer MLPs and we also include a residual connection for each block as inspired by (Srinivas et al., 2021). During training, the supernet performs uniform sampling and only activates one path of the chosen resolution and block type for each layer as for the NLP tasks. + +# 3.2. ShiftAddNAS: Search Method + +# 3.2.1. BACKGROUND AND FORMULATION OF ONE-SHOT NAS + +We adopt one-shot NAS for improved search efficiency, i.e., assuming that the subnet candidates can directly inherit their weights from the supernet, following SOTA NAS works. Such a strategy is commonly referred as weight sharing. Specifically, the supernet $\mathcal{N}$ with parameters $\mathbf{W}$ is trained to obtain the weights for all subnets within the search space $S$ . Since the supernet training and architecture search are decoupled in one-shot NAS, it usually requires two-level optimization: supernet training and architecture evaluation as defined below: + +$$ +\mathbf {W} _ {\mathcal {S}} = \underset {\mathbf {W}} {\arg \min } L _ {t r a i n} (\mathcal {N} (\mathcal {S}, \mathbf {W})), \tag {5} +$$ + +$$ +a ^ {*} = \underset {a \in \mathcal {S}} {\arg \max } A C C _ {v a l} (\mathcal {N} (a, \mathbf {W} _ {\mathcal {S}} (a))). \tag {6} +$$ + +where $\mathcal{N}(\mathcal{S},\mathbf{W})$ represents all possible candidate subnets within the search space. We first train the supernet by uniformly sampling different subnets $a$ from $S$ as formulated in Eq. (5), after which all subnet candidates $a$ directly inherit their corresponding weights $\mathbf{W}_S(a)$ from the supernet $\mathbf{W}_S$ . Finally, we evaluate the accuracy $ACC_{val}(.)$ of each path on the validation set and search for the best subnet with the highest accuracy as formulated in Eq. (6). + +# 3.2.2. PROPOSED HETEROGENEOUS WEIGHT SHARING STRATEGY + +Dilemma of vanilla ShiftAddNAS. The target hybrid search space of ShiftAddNAS inevitably enlarges the super- + +![](images/c7136fb7c8f6b615953cde9dd17c12b4e6ecdcac71c92463c02de0da23c3490d.jpg) +Figure 2: Supernets for NLP and CV tasks: (a) For NLP, we adopt a multi-branch structure for each block of the supernet, where Attn+Conv represents the channel-wise concatenation of these two blocks, and (b) for CV tasks, we consider a multi-resolution pipeline for each block of the supernet. +(a) Weights in Conv +Figure 3: Heterogeneous weight distributions in supernets. + +![](images/0765a7ec04e8d5cf7220079f34f5602cb0ed2c254f1e1fbfc64ac15392b2f15d.jpg) +(b) Weights in Add + +net due to the newly considered operators. As such, activating all block choices without weight sharing as (Gong et al., 2019; Cai et al., 2018) can easily explode the memory consumption of NAS. On the other hand, directly sharing weights among different operators as (Chen et al., 2021b) will lead to biased search, especially for our hardware-inspired hybrid search space where weights and activations of different operators follow heterogeneous distributions, e.g., weights of the Conv and Add blocks follow a Gaussian and Laplacian distribution, respectively, as shown in Fig. 7 and also highlighted in (Chen et al., 2020) (more visualization can be found at Appendix B). Specifically, if we follow the existing weight sharing strategy to enforce a homogeneous weight distribution among different operators during training the supernet, the resulting weights will not match the heterogeneous weight distributions of independently trained optimal hybrid subnets. That is to say, for NAS with the target hybrid search space, there exists an optimization gap between the goals of weight sharing optimization and individual subnet optimization, where the former is approximated while the latter is accurate (Xie et al., 2020). Hence, naively adopting the homogeneous weight sharing strategy can lead to inconsistent architecture ranking, which is a major issue associated with one-shot NAS as pointed out by (Chu et al., 2019; You et al., 2020b). + +Proposed solution: heterogeneous weight sharing. To tackle the aforementioned dilemma, we propose a heterogeneous weight sharing strategy that can simultaneously reduce the supernet size corresponding to the target hybrid search space and allow weights of different blocks to fol + +![](images/7106668ae2ce0ca011c2d15563610236e219104f2b2e1aadcd5d474acbc3a261.jpg) +Figure 4: (a) Illustration of the proposed heterogeneous weight sharing strategy, where weights of shift blocks are quantized to powers of two; (b) visualization of the adopted learnable transformation kernel $\mathcal{T}(\cdot)$ for mapping the shared weights of Gaussian distribution to a Laplacian distribution. + +low heterogeneous distributions. Specifically, the learning objective for the supernet includes both the traditional cross-entropy loss and a KL-divergence loss that is to regularize weight distributions to be close to either a standard Gaussian distribution $\mathcal{N}(0,I)$ or Laplacian distribution $\mathcal{L}_p(0,\lambda)$ (Xie et al., 2020; Chen et al., 2020)( $I$ is the identity matrix and $\lambda = 1$ ), dedicated for the Conv and Add blocks, respectively, for reducing the aforementioned optimization gap as formulated in Eq. (7): + +$$ +\begin{array}{l} \mathcal {L} _ {\mathcal {S}} = \mathcal {L} _ {C E} + \mathcal {L} _ {K L} = - \frac {1}{N} \sum_ {i = 1} ^ {N} P (y _ {i} | x _ {i}) \log (P (\hat {y} _ {i} | x _ {i})) \\ + \mathcal {D} \left(P _ {\text {C o n v}} \left(\mathbf {W} _ {\mathcal {S}}\right) \mid \mid \mathcal {N} (0, I)\right) + \mathcal {D} \left(P _ {\text {A d d}} \left(\mathcal {T} \left(\mathbf {W} _ {\mathcal {S}}\right)\right) \mid \mid \mathcal {L} _ {p} (0, \lambda)\right), \tag {7} \\ \end{array} +$$ + +where $\{(x_i, y_i)\}_{i=1}^N$ are training data, $\hat{y}$ denotes the output prediction, and $\mathcal{D}_{KL}(p||q) = -\int p(z) \frac{p(z)}{q(z)} dz$ measures the KL-divergence between two distributions. During training, we maintain a shared weight pool for each layer to share weights across all the Conv, Add, and Shift blocks, as illustrated in Fig. 4 (a). Meanwhile, weights of the Conv blocks directly leverage the corresponding ones in the shared weight pool for both forward and backpropagation, while being encouraged to follow a Gaussian distribution by the objective function; weights of the Shift blocks quantize the shared weights of Gaussian distribution to powers of two before multiplying with the input features, we follow (Elhoushi et al., 2021) to backpropagate the gradients; and for the Add blocks, we make use of a learnable transformation kernel $\mathcal{T}(\cdot)$ to map the shared weights of Gaussian distribution to a Laplacian distribution. For the learnable transformation kernel as captured by Eq. (8), the core idea is to apply a piece-wise linear transformation after flattening and sorting the weights in a descending order, and then to reshape and rearrange the transformed weights back to their positions before sorting. + +$$ +\mathcal {T} (W) = \sum_ {i = 0} ^ {d - 1} \alpha_ {i} \times W _ {[ s \times i: s \times (i + 1) ]}, \tag {8} +$$ + +where $\{\alpha_i\}_{i = 1}^d$ denote the learnable parameters in $\mathcal{T}(\cdot)$ $\{W_{i}\}_{i = 1}^{n}$ represent the sorted weights (a total of $n$ ) in the + +pool, $s = \frac{n}{d}$ denotes an interval within which the transformation is linear, as illustrated in Fig. 4 (b). As validated in our visualization of supernet weights (e.g., Fig. 7), such a transformation kernel can successfully transform the shared weights of Gaussian to the desired Laplacian distribution, which is consistent with previous observations about kernel learning via linear transformation (Jain et al., 2012). In our design, each layer has its own learnable kernel $\mathcal{T}(\cdot)$ with a dimension $d$ of 200 throughout all the experiments as we observed that such a dimension is adequate to learn the transformation across all the models and datasets, leading to over $40\%$ supernet size reduction while only incurring a negligible $(< 0.01\%)$ of the supernet size and computational costs) search overhead. After the supernet is well trained, evolution search is applied to find the optimal subnets. + +# 4. Experiment Results + +In this section, we first describe our experiment setups, and then benchmark ShiftAddNAS over SOTA CNNs, Transformers, and previous NAS frameworks on both NLP and CV tasks. After that, we conduct ablation studies regarding ShiftAddNAS's heterogeneous weight sharing strategy. + +# 4.1. Experiment Setups + +Datasets, baselines, and evaluation metrics. For NLP tasks, we consider two machine translation datasets, WMT'14 English to French (En-Fr) and English to German (En-De), which consist of 36.3M and 4.5M pairs of training sentences, respectively. The train/val/test splits follow the tradition as in (Wang et al., 2020a; Gehring et al., 2017). We consider five baselines: Transformer (Vaswani et al., 2017), Lightweight Conv (Wu et al., 2019b), Lite Transformer (Wu et al., 2020), and two previous NAS works including Evolved Transformer (So et al., 2019) and HAT (Wang et al., 2020a). We evaluate in terms of five evaluation metrics: the number of parameters/FLOPs, achieved BLEU, and hardware energy and latency measured on a SOTA accelerator Eyeriss (Chen et al., 2016) clocked at $250\mathrm{MHz}$ , where the BLEU is calculated with case-sensitive tokenization following (Wang et al., 2020a). For CV tasks, we consider the ImageNet dataset and four kinds of SOTA baselines: four multiplication-free CNNs (Chen et al., 2020; Xu et al., 2020; Courbariaux et al., 2016; Elhoushi et al., 2021), two CNNs (He et al., 2016; Hu et al., 2018), five Transformers (Dosovitskiy et al., 2021; Touvron et al., 2021; Yuan et al., 2021; Han et al., 2021; Srinivas et al., 2021), and four NAS works (i.e., HR-NAS (Ding et al., 2021), BossNAS (Li et al., 2021), AutoFormer (Chen et al., 2021b), and VITAS (Su et al., 2021)). Similar to those for the NLP tasks, we adopt five evaluation metrics: the number of parameters/MACs, achieved accuracy, and hardware energy and latency. + +Search and training settings. For NLP tasks, after training + +Table 3: ShiftAddNAS vs. SOTA baselines in terms of accuracy and efficiency on NLP tasks. + +
WMT'14 En-FrWMT'14 En-De
ParamsFLOPsBLEULatencyEnergyParamsFLOPsBLEULatencyEnergy
Transformer176M10.6G41.2130ms214mJ176M10.6G28.4130ms214mJ
Evolved Trans.175M10.8G41.3--47M2.9G28.2--
HAT48M3.4G41.449ms81mJ44M2.7G28.242ms69mJ
ShiftAddNAS46M3.0G41.843ms71mJ43M2.7G28.240ms66mJ
HAT46M2.9G41.142ms69mJ36M2.2G27.634ms56mJ
ShiftAddNAS41M2.7G41.639ms64mJ33M2.1G27.831ms52mJ
HAT30M1.8G39.129ms48mJ25M1.5G25.824ms40mJ
ShiftAddNAS29M1.8G40.216ms45mJ25M1.6G26.724ms40mJ
Lite Trans. (8-bit)17M1G39.619ms31mJ17M1G26.519ms31mJ
ShiftAddNAS (8-bit)11M0.2G41.511ms16mJ17M0.3G28.316ms24mJ
Lite Trans. (8-bit)12M0.7G39.114ms24mJ12M0.7G25.614ms24mJ
ShiftAddNAS (8-bit)10M0.2G41.110ms15mJ12M0.2G26.89.2ms14mJ
+ +![](images/3b54972d553417d5807712490053193330b4fedd916b6448f30a9708e19000d3.jpg) +Figure 5: BLEU scores vs. FLOPs of ShiftAddNAS over SOTA baselines on NLP tasks. + +![](images/d2383a41373bb2f72be8a9e8797019d5b7895e4aa5fdfc3ba874690c85d52447.jpg) + +the supernet for 40K steps, we adopt an evolutionary algorithm (Wang et al., 2020a) to search for subnets with various latency and FLOPs constraints. During search, we follow (Wang et al., 2020a) to adopt a three-layer NN to measure the latency, which is accurate with an average prediction error of $< 5\%$ . The searched subnets are then retrained from scratch for another 40K steps. For CV tasks, we follow (Chen et al., 2021b) to conduct an evolutionary search with FLOPs constraints for 20 steps. We train both the supernet and searched subnets using the same recipe and hyperparameters as DeiT (Touvron et al., 2021). More details regarding search and training settings can be found in Appendix E. + +# 4.2. ShiftAddNAS vs. SOTA Methods on NLP Tasks + +We compare ShiftAddNAS with SOTA language models on two NLP tasks to evaluate its efficacy. Fig. 5 shows that ShiftAddNAS consistently outperforms all the baselines in terms of BLEU scores and FLOPs. Specifically, ShiftAddNAS with full precision achieves $11.8\% \sim 73.6\%$ FLOPs reductions while offering a comparable or better BLEU score $(-0.3 \sim +1.1)$ , over all the full precision baselines. To benchmark with Lite Transformer (8-bit) which is dedicated for mobile devices, we refer to a SOTA quantization technique (Banner et al., 2018) for quantizing ShiftAddNAS to 8-bit fixed point: ShiftAddNAS (8-bit) achieves $+1.8 \sim +4.9$ BLEU scores improvements over Lite Transformer (8-bit), + +![](images/be96cb6400ecce85c3f1f1cf56f07d5547f57d172449a51ebbc4fcb8ed58ed08.jpg) +Figure 6: Accuracy vs. energy costs of ShiftAddNAS over baselines when tested on ImageNet. + +while offering $5.0\% \sim 82.7\%$ FLOPs reductions, and aggressively reduces $91.6\% \sim 98.4\%$ FLOPs as compared to all the full-precision baselines with comparable BLEU scores $(-0.1 \sim +0.3)$ . Note that for quantized models, we follow (Zhou et al., 2016) to use FLOPs $\times (\mathrm{Bit} / 32)^2$ for calculating the effective FLOPs which is proportional to the number of bit-operations. We further compare various aspects of ShiftAddNAS with all baselines in Tab. 3. As illustrated in this Table, ShiftAddNAS consistently outperforms the baselines, e.g., achieves up to $+2$ BLEU scores improvement when comparing ShiftAddNAS (8-bit) with Lite Transformer on WMT'14 En-Fr and $69.1\%$ and $69.2\%$ energy and latency savings when comparing ShiftAddNAS with Transformer on WMT'14 En-De, with a comparable or even fewer model parameters and FLOPs. + +# 4.3. ShiftAddNAS vs. SOTA Methods on CV Tasks + +We further compare ShiftAddNAS over SOTA baselines on ImageNet to evaluate its effectiveness on the image classification task. As shown in Tab. 4, 11, ShiftAddNAS outperforms a wide range of baselines. Here we refer MACs as Multiply-accumulate or Shift-accumulate operations. For example, ShiftAddNet-T0 (searched with a 4.5G MACs constraint) with 3.7G MACs achieves an improved top-1 accuracy of $(1) + 5.3\% \sim +26.3\%$ over SOTA multiplication-free CNNs, $(2) + 0.7\% \sim +6.0\%$ over SOTA CNNs, $(3) + 0.4\% \sim +7.6\%$ over SOTA Transformers, $(4) + 1.3\% \sim +4.8\%$ + +Table 4: Comparison with SOTA baselines on ImageNet classification task (see Tab. 11 for complete comparisons). + +
ModelTop-1 Acc.Top-5 Acc.ParamsRes.MACs#Mult.#Add#ShiftModel Type
AdderNet74.9%91.7%26M22423.9G0.1G7.6G0Mult.-free
DeepShift-PS71.9%90.2%52M22423.9G0.1G3.9G3.8GMult.-free
ShiftAddNet72.3%-64M224210G0.1G16G3.9GMult.-free
ResNet-5076.1%92.9%26M22423.9G3.9G3.9G0CNN
ResNet-10177.4%94.2%45M22427.6G7.6G7.6G0CNN
ViT-B/1677.9%-86M384218G18G17G0Transformer
DeiT-S81.2%-22M22424.6G4.6G4.6G0Transformer
VITAS77.4%93.8%13M22422.7G2.7G2.7G0Transformer
Autoformer-S81.7%95.7%23M22425.1G5.1G5.1G0Transformer
BoT-5078.3%94.2%21M22424.0G4.0G4.0G0CNN + Trans.
BossNAS-T080.5%95.0%38M22423.5G3.5G3.5G0CNN + Trans.
ShiftAddNAS-T082.1%95.8%30M22423.7G2.7G3.8G1.0GHybrid
ShiftAddNAS-T0↑82.6%96.2%30M25624.9G3.6G4.9G1.4GHybrid
T2T-ViT-1981.9%-39M22428.9G8.9G8.9G0Transformer
Autoformer-B82.4%95.7%54M224211G11G11G0Transformer
BoTNet-S1-5981.7%95.8%28M22427.3G7.3G7.3G0CNN + Trans.
BossNAS-T182.2%95.8%38M22428.0G8.0G8.0G0CNN + Trans.
ShiftAddNAS-T182.7%96.1%30M22426.4G5.4G6.4G1.0GHybrid
ShiftAddNAS-T1↑83.0%96.4%30M25628.5G7.1G8.5G1.4GHybrid
+ +Table 5: Comparison with FBNet on CIFAR-10/100 dataset. + +
DatasetMethodsAccuracyMACs#Mult.#Add#ShiftLatency Savings
CIFAR-10FBNet95.09%47M47M47M0-
ShiftAddNAS95.83% (+0.74%)47M17M58M19M33.80%
CIFAR100FBNet77.86%55M55M55M0-
ShiftAddNAS78.64% (+0.58%)52M22M62M21M38.60%
+ +over SOTA CNN-Transformers, and (5) $+1.3\%$ , $+4.7\%$ , and $+0.4\%$ over previous SOTA NAS baselines BossNAS, VITAS, and Autoformer, respectively, under a comparable or even less MACs. Moreover, considering looser MACs constraints, we follow BossNAS to remove the downsampling in the last stage, resulting in ShiftAddNAS-T1 with a accuracy of $82.7\%$ and 6.4G MACs that surpasses T2T-ViT and BoTNet-S1-59 by $+0.8\%$ and $+1.0\%$ at even less MACs. By directly testing on larger input resolutions without finetuning, ShiftAddNAS-T1↑ (w/ $256^2$ input resolution) offers an accuracy of $83.0\%$ , surpassing BossNAS-T1 and Autoformer-B by $+0.8\%$ and $+0.6\%$ with comparable or even less MACs, respectively. Finally, we compare ShiftAddNAS with representative baselines of various model types in terms of accuracy and energy cost in Fig. 6, where each line represents searched/designed models with various FLOPs constraints. We can see that ShiftAddNAS consistently outperforms all the baselines, on average offering a $+0.8\% \sim +7.7\%$ higher accuracy and $24\% \sim 93\%$ energy savings. Specifically, our ShiftAddNAS on average achieves a $+0.8\%$ higher accuracy and $30\%$ energy savings against the most competitive NAS baseline BossNAS. The searched architecture visualization is supplied to Appendix D. + +Table 6: Ablation study of ShiftAddNAS w/ (1) naive and (2) heterogeneous weight sharing. + +
ShiftAddNASKendall τPearson RSpearman ρ
w/ Naive WS0.490.670.69
w/ HWS0.540.750.74
ShiftAddNASTop-1 Acc.EnergyLatency
w/ Naive WS81.3%440mJ387ms
w/ HWS82.7%413mJ252ms
+ +# 4.4. ShiftAddNAS vs. SOTA under Small MACs + +To fairly compare with baselines with smaller MACs, we implemented our proposed hybrid search space and heterogeneous weight sharing (HWS) techniques on top of the FBNet search space, and evaluated the performance on CIFAR-10/100. As shown in the Tab. 5, our ShiftAddNAS consistently boosts a $+0.74\%$ and $+0.58\%$ accuracy over FBNet and leads to $33.8\%$ and $38.6\%$ latency savings on CIFAR-10 and CIFAR-100, respectively. + +# 4.5. Ablation Studies of Heterogeneous Weight Sharing + +We conduct ablation studies on ShiftAddNAS's heterogeneous weight sharing (HWS) strategy, as shown in Tab. 6. + +Table 7: Comparisons of different search space variants. + +
OperatorsOur Space on ImageNetFBNet Space on CIFAR100
Acc.Mult.AddShiftAcc.Mult.AddShift
Attn&Conv81.6%5.8G5.8G077.9%55M55M0
Shift&Add76.8%0.1G5.3G3.2G71.0%3M48M35M
Attn&Conv&Add82.4%5.6G7.2G078.3%30M60M0
All82.6%3.6G4.9G1.4G78.6%22M62M21M
+ +![](images/30c0191c01a7c4a313d50beeccb0aab78a5de0063f17fa54f92d5868fc840083.jpg) +(a) w/o WS + +![](images/befea874d3a64f0c86f6acf7db4c500612dec0fe36ebffcb4f2f9f02d9e652c2.jpg) +Figure 7: The weight distribution of Conv and Add layers. + +![](images/45535139a3b7955a2f2baadab2fad075c225dbbce1b8838e127ccd3d8e5171b3.jpg) +(b) HWS w/o KL + +![](images/9c3cac6fb4b76736ba5657c59d9a7bb64716db0fa69cd0e758cbbfcdc971d217.jpg) + +![](images/be54a3d973033d1bce131dcec9351cea4f8fc2328f4f370cfbdd3a94c5a89e51.jpg) +(c) HWS + +![](images/9d29d1fca5993742e412348c4299dfaadee78aa48ffd3e30aedd5ed6d1968968.jpg) + +First, for searching on ImageNet, we use three ranking correlation metrics: Kendall $\tau$ , Pearson $R$ , and Spearman $\rho$ , to measure the ranking correlation between ShiftAddNAS w/ and w/o HWS and find that the former leads to a higher ranking correlation than the naive WS. Second, the proposed HWS leads to more accurate searched subnets. Specifically, the searched subnet achieves a $+1.4\%$ higher accuracy than that of naive WS, at comparable or even smaller energy and latency costs. Also, HWS effectively reduces the supernet size from 615M (w/o WS) to 364M (41% savings). This set of ablation studies validate the effectiveness of our proposed HWS strategy. In addition, the search cost analysis of ShiftAddNAS is placed in Appendix A. + +# 4.6. Ablation Studies of Conv/Add Distribution + +We visualize the weight distributions of Conv/Add layers in Supernets under three scenarios, (1) w/o WS; (2) HWS w/o KL loss; (3) HWS, as shown in Fig. 7. We consistently observe that weights of Conv/Add layers follow Gaussian and Laplacian distribution, especially when applying the introduced KL loss. + +# 4.7. Ablation Studies of Search Space + +To validate the necessity of considered searchable blocks, we consider three scenarios to breakdown the search space benefits, i.e., only using: (1) Attn & Conv (i.e., BossNAS); (2) Shift & Add; and (3) Attn & Conv & Add, respectively. Additionally, we also conduct such controlled experiments on top of FBNet search space (ignore Attn). In Tab. 7, we consistently see that our search space consisting of all operators outperforms (1) in terms of both accuracy and efficiency; achieves much higher accuracy than (2); and gains slightly better accuracy-efficiency trade-offs than (3). + +# 5. Conclusion + +We propose ShiftAddNAS for searching for multiplicationreduced NNs incorporating both powerful yet costly mul + +t implications and efficient yet less powerful shift and add operators for marrying the best of both worlds. ShiftAddNAS is made possible by integrating: (1) the first hybrid search space that incorporates both multiplication-based and multiplication-free operators; and (2) a novel heterogeneous weight sharing strategy that allows different operators to follow heterogeneous distributions for alleviating the dilemma of either inefficient search or inconsistent architecture ranking when searching hybrid NNs. Extensive experiments on both NLP and CV tasks demonstrate the superior accuracy and efficiency of ShiftAddNAS's searched NNs over various SOTA baselines, opening up a new perspective in searching for more accurate and efficient NNs. + +# Acknowledgements + +We would like to acknowledge the funding support from NSF SCH program (Award number: 1838873) and NIH (Award number: R01HL144683) for this project. + +# References + +Banner, R., Hubara, I., Hoffer, E., and Soudry, D. Scalable methods for 8-bit training of neural networks. arXiv preprint arXiv:1805.11046, 2018. +Cai, H., Zhu, L., and Han, S. Proxylessnas: Direct neural architecture search on target task and hardware. arXiv preprint arXiv:1812.00332, 2018. +Cai, H., Gan, C., Wang, T., Zhang, Z., and Han, S. Once-for-all: Train one network and specialize it for efficient deployment. arXiv preprint arXiv:1908.09791, 2019. +Chen, B., Li, P., Li, C., Li, B., Bai, L., Lin, C., Sun, M., Yan, J., and Ouyang, W. Glit: Neural architecture search for global and local image transformer. volume abs/2107.02960, 2021a. URL https://arxiv.org/abs/2107.02960. +Chen, H., Wang, Y., Xu, C., Shi, B., Xu, C., Tian, Q., and + +Xu, C. Addernet: Do we really need multiplications in deep learning? The IEEE Conference on Computer Vision and Pattern Recognition, 2020. +Chen, M., Peng, H., Fu, J., and Ling, H. Autoformer: Searching transformers for visual recognition. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), 2021b. +Chen, M. X., First, O., Bapna, A., Johnson, M., Macherey, W., Foster, G., Jones, L., Schuster, M., Shazeer, N., Parmar, N., Vaswani, A., Uszkoreit, J., Kaiser, L., Chen, Z., Wu, Y., and Hughes, M. The best of both worlds: Combining recent advances in neural machine translation. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 76-86. Association for Computational Linguistics, July 2018. doi: 10.18653/v1/P18-1008. URL https://aclanthology.org/P18-1008. +Chen, P., Liu, J., Zhuang, B., Tan, M., and Shen, C. Aqd: Towards accurate quantized object detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 104-113, 2021c. +Chen, Y.-H., Krishna, T., Emer, J. S., and Sze, V. Eyeriss: An energy-efficient reconfigurable accelerator for deep convolutional neural networks. IEEE journal of solid-state circuits, 52(1):127-138, 2016. +Chu, X., Zhang, B., Xu, R., and Li, J. Fairnas: Rethinking evaluation fairness of weight sharing neural architecture search. arXiv preprint arXiv:1907.01845, 2019. +Courbariaux, M., Hubara, I., Soudry, D., El-Yaniv, R., and Bengio, Y. Binarized neural networks: Training deep neural networks with weights and activations constrained to+ 1 or-1. arXiv preprint arXiv:1602.02830, 2016. +Ding, M., Lian, X., Yang, L., Wang, P., Jin, X., Lu, Z., and Luo, P. Hr-nas: Searching efficient high-resolution neural architectures with lightweight transformers. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 2982-2992, 2021. +Dosovitskiy, A., Beyer, L., Kolesnikov, A., Weissenborn, D., Zhai, X., Unterthiner, T., Dehghani, M., Minderer, M., Heigold, G., Gelly, S., Uszkoreit, J., and Houlsby, N. An image is worth 16x16 words: Transformers for image recognition at scale. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id=YicbFdNTTy. +Elhoushi, M., Chen, Z., Shafiq, F., Tian, Y. H., and Li, J. Y. Deepshift: Towards multiplication-less neural networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) Workshops, pp. 2359-2368, June 2021. + +Gehring, J., Auli, M., Grangier, D., Yarats, D., and Dauphin, Y. N. Convolutional sequence to sequence learning. In Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pp. 1243-1252. PMLR, 06-11 Aug 2017. URL https://proceedings.mlr.press/v70/gehring17a.html. +Gong, C., Jiang, Z., Wang, D., Lin, Y., Liu, Q., and Pan, D. Z. Mixed precision neural architecture search for energy efficient deep learning. In 2019 IEEE/ACM International Conference on Computer-Aided Design (ICCAD), pp. 1-7. IEEE, 2019. +Graham, B., El-Nouby, A., Touvron, H., Stock, P., Joulin, A., Jégou, H., and Douze, M. Levit: a vision transformer in convnet's clothing for faster inference. arXiv preprint arXiv:2104.01136, 2021. +Gu, J., Wang, Z., Kuen, J., Ma, L., Shahroudy, A., Shuai, B., Liu, T., Wang, X., Wang, G., Cai, J., et al. Recent advances in convolutional neural networks. Pattern Recognition, 77:354-377, 2018. +Guo, Z., Zhang, X., Mu, H., Heng, W., Liu, Z., Wei, Y., and Sun, J. Single path one-shot neural architecture search with uniform sampling. In European Conference on Computer Vision, pp. 544-560. Springer, 2020. +Han, K., Xiao, A., Wu, E., Guo, J., Xu, C., and Wang, Y. Transformer in transformer. arXiv preprint arXiv:2103.00112, 2021. +He, K., Zhang, X., Ren, S., and Sun, J. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770-778, 2016. URL https://github.com/facebookarchive/fb.resnet.torch. +Howard, A., Sandler, M., Chu, G., Chen, L.-C., Chen, B., Tan, M., Wang, W., Zhu, Y., Pang, R., Vasudevan, V., et al. Searching for mobilenetv3. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 1314-1324, 2019. +Hu, J., Shen, L., and Sun, G. Squeeze-and-excitation networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 7132-7141, 2018. +Jain, P., Kulis, B., Davis, J. V., and Dhillon, I. S. Metric and kernel learning using a linear transformation. The Journal of Machine Learning Research, 13(1):519-547, 2012. +Juefei-Xu, F., Naresh Boddeti, V., and Savvides, M. Local binary convolutional neural networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 19-28, 2017. + +Krizhevsky, A., Sutskever, I., and Hinton, G. E. Imagenet classification with deep convolutional neural networks. Advances in neural information processing systems, 25: 1097-1105, 2012. +Li, C., Peng, J., Yuan, L., Wang, G., Liang, X., Lin, L., and Chang, X. Blockwisely supervised neural architecture search with knowledge distillation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 1989-1998, 2020a. +Li, C., Tang, T., Wang, G., Peng, J., Wang, B., Liang, X., and Chang, X. BossNAS: Exploring hybrid CNN-transformers with block-wisely self-supervised neural architecture search. In ICCV, 2021. +Li, X., Lin, C., Li, C., Sun, M., Wu, W., Yan, J., and Ouyang, W. Improving one-shot nas by suppressing the posterior fading. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 13836-13845, 2020b. +Liu, H., Simonyan, K., and Yang, Y. Darts: Differentiable architecture search. arXiv preprint arXiv:1806.09055, 2018. +So, D., Le, Q., and Liang, C. The evolved transformer. In International Conference on Machine Learning, pp. 5877-5886. PMLR, 2019. +Song, D., Wang, Y., Chen, H., Xu, C., Xu, C., and Tao, D. Addersr: Towards energy efficient image super-resolution. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 15648-15657, 2021. +Srinivas, A., Lin, T.-Y., Parmar, N., Shlens, J., Abbeel, P., and Vaswani, A. Bottleneck transformers for visual recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 16519-16529, 2021. +Su, X., You, S., Xie, J., Zheng, M., Wang, F., Qian, C., Zhang, C., Wang, X., and Xu, C. Vision transformer architecture search. arXiv preprint arXiv:2106.13700, 2021. +Tan, M. and Le, Q. Efficientnet: Rethinking model scaling for convolutional neural networks. In International Conference on Machine Learning, pp. 6105-6114. PMLR, 2019. +Tan, M., Chen, B., Pang, R., Vasudevan, V., Sandler, M., Howard, A., and Le, Q. V. Mnasnet: Platform-aware neural architecture search for mobile. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 2820-2828, 2019. + +Touvron, H., Cord, M., Douze, M., Massa, F., Sablayrolles, A., and Jegou, H. Training data-efficient image transformers & distillation through attention. In Proceedings of the 38th International Conference on Machine Learning, volume 139 of Proceedings of Machine Learning Research, pp. 10347-10357. PMLR, 18-24 Jul 2021. +Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, L. u., and Polosukhin, I. Attention is all you need. In Advances in Neural Information Processing Systems, volume 30. Curran Associates, Inc., 2017. +Wan, A., Dai, X., Zhang, P., He, Z., Tian, Y., Xie, S., Wu, B., Yu, M., Xu, T., Chen, K., et al. Fbnetv2: Differentiable neural architecture search for spatial and channel dimensions. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 12965-12974, 2020. +Wang, D., Gong, C., Li, M., Liu, Q., and Chandra, V. Alphanumeric: Improved training of supernet with alpha-divergence. arXiv preprint arXiv:2102.07954, 2021a. +Wang, H., Wu, Z., Liu, Z., Cai, H., Zhu, L., Gan, C., and Han, S. Hat: Hardware-aware transformers for efficient natural language processing. arXiv preprint arXiv:2005.14187, 2020a. +Wang, Q., Li, B., Xiao, T., Zhu, J., Li, C., Wong, D. F., and Chao, L. S. Learning deep transformer models for machine translation. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pp. 1810-1822. Association for Computational Linguistics, July 2019. doi: 10.18653/v1/P19-1176. +Wang, S., Li, B. Z., Khabsa, M., Fang, H., and Ma, H. Linformer: Self-attention with linear complexity. arXiv preprint arXiv:2006.04768, 2020b. +Wang, Y., Huang, M., Han, K., Chen, H., Zhang, W., Xu, C., and Tao, D. Addernet and its minimalist hardware design for energy-efficient artificial intelligence. arXiv preprint arXiv:2101.10015, 2021b. +Wu, B., Wan, A., Yue, X., Jin, P., Zhao, S., Golmant, N., Gholaminejad, A., Gonzalez, J., and Keutzer, K. Shift: A zero flop, zero parameter alternative to spatial convolutions. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 9127-9135, 2018. +Wu, B., Dai, X., Zhang, P., Wang, Y., Sun, F., Wu, Y., Tian, Y., Vajda, P., Jia, Y., and Keutzer, K. Fbnet: Hardware-aware efficient convnet design via differentiable neural architecture search. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 10734-10742, 2019a. + +Wu, F., Fan, A., Baevski, A., Dauphin, Y., and Auli, M. Pay less attention with lightweight and dynamic convolutions. In International Conference on Learning Representations, 2019b. URL https://openreview.net/forum?id=SkVhlh09tx. +Wu, H., Xiao, B., Codella, N., Liu, M., Dai, X., Yuan, L., and Zhang, L. Cvt: Introducing convolutions to vision transformers. arXiv preprint arXiv:2103.15808, 2021. +Wu, Z., Liu, Z., Lin, J., Lin, Y., and Han, S. Lite transformer with long-short range attention. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id=ByeMP1HKPH. +Xiao, T., Singh, M., Mintun, E., Darrell, T., Dollar, P., and Girshick, R. Early convolutions help transformers see better. arXiv preprint arXiv:2106.14881, 2021. +Xie, L., Chen, X., Bi, K., Wei, L., Xu, Y., Chen, Z., Wang, L., Xiao, A., Chang, J., Zhang, X., et al. Weight-sharing neural architecture search: A battle to shrink the optimization gap. arXiv preprint arXiv:2008.01475, 2020. +Xilinx Inc. Xilinx zynq-7000 soc zc706 evaluation kit. https://www.xilinx.com/products/boards-and-kits/ek-z7-zc706-g.html. +Xu, Y., Xu, C., Chen, X., Zhang, W., Xu, C., and Wang, Y. Kernel based progressive distillation for adder neural networks. In Advances in Neural Information Processing Systems, volume 33, pp. 12322-12333. Curran Associates, Inc., 2020. +Yang, Y., You, S., Li, H., Wang, F., Qian, C., and Lin, Z. Towards improving the consistency, efficiency, and flexibility of differentiable neural architecture search. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 6667-6676, June 2021. +You, H., Chen, X., Zhang, Y., Li, C., Li, S., Liu, Z., Wang, Z., and Lin, Y. Shiftaddnet: A hardware-inspired deep network. In Advances in Neural Information Processing Systems, volume 33, pp. 2771-2783. Curran Associates, Inc., 2020a. +You, S., Huang, T., Yang, M., Wang, F., Qian, C., and Zhang, C. Greedynas: Towards fast one-shot nas with greedy supernet. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 1999-2008, 2020b. +Yu, J., Jin, P., Liu, H., Bender, G., Kindermans, P.-J., Tan, M., Huang, T., Song, X., Pang, R., and Le, Q. Bignas: Scaling up neural architecture search with big single-stage models. In European Conference on Computer Vision, pp. 702-717. Springer, 2020. + +Yuan, L., Chen, Y., Wang, T., Yu, W., Shi, Y., Tay, F. E., Feng, J., and Yan, S. Tokens-to-token vit: Training vision transformers from scratch onImagenet. arXiv preprint arXiv:2101.11986, 2021. +Zaheer, M., Guruganesh, G., Dubey, K. A., Ainslie, J., Alberti, C., Ontanon, S., Pham, P., Ravula, A., Wang, Q., Yang, L., and Ahmed, A. Big bird: Transformers for longer sequences. In Advances in Neural Information Processing Systems, volume 33, pp. 17283-17297. Curran Associates, Inc., 2020. +Zhou, S., Wu, Y., Ni, Z., Zhou, X., Wen, H., and Zou, Y. Dorefa-net: Training low bitwidth convolutional neural networks with low bitwidth gradients. arXiv preprint arXiv:1606.06160, 2016. + +# A. Evaluate the Search Cost + +We further supply the total search cost of ShiftAddNAS on both NLP tasks and CV tasks in Table 8 and 9, respectively. For NLP tasks, with one Nvidia V100 GPU, ShiftAddNAS uses on average 9.3 GPU days (Gds) for searching which is comparable to HAT (Wang et al., 2020a) and $9,821 \times$ less than the Evolved Transformer (So et al., 2019). For CV tasks, ShiftAddNAS uses on average 8.9 Gds for searching which is $11\%$ and $82\%$ less than DARTS (Liu et al., 2018) and BossNAS (Li et al., 2021), respectively. In addition, we provide a concrete breakdown analysis of ShiftAddNAS search cost in Table 10. For NLP tasks, ShiftAddNAS needs on average 8.5 Gds for supernet training and 0.8 Gds for architecture searching; For CV tasks, ShiftAddNAS takes on average 7.7 Gds for supernet training and 1.2 Gds for architecture searching. + +Table 8: Search cost on NLP tasks. + +
MethodsSearch Cost
Evolved Trans.91,334 Gds
HAT9.3 Gds
ShiftAddNAS9.3 Gds
+ +Table 9: Search cost on CV tasks. + +
MethodsSearch Cost
DARTS50 Gds
BossNAS10 Gds
ShiftAddNAS8.9 Gds
+ +Table 10: Breakdown analysis of the search cost of ShiftAddNAS. + +
NLPCV
Supernet Train8.5 Gds7.7 Gds
Arch. Search0.8 Gds1.2 Gds
+ +# B. Visualization of the Heterogeneous Weight Distributions + +For better understanding of the proposed heterogeneous weight sharing strategy, we further supply the visualization of the heterogeneous weight distributions in Conv/Add/Shift layers, respectively, as shown in the Fig. 8. + +![](images/483a1ae6655556036f08df21994612a6be0a12adc11d54dde9f9ceb272b91462.jpg) +(a) Weights in Conv + +![](images/77dbe759d9f2c283a4b9eed4d348d1518cfa6bc0b9e6f2273f2cbdcf78f209e0.jpg) +(b) Weights in Add + +![](images/8d7fbafbd979a687aca957a12e5a97c468c1dfb69fa87f9b512c0da255ebde80.jpg) +(c) Weights in Shift +Figure 8: Visualization of the heterogeneous weight distributions in Conv/Add/Shift layers. + +# C. Complete Comparison between ShiftAddNAS and SOTA on CV Tasks + +We further compare ShiftAddNAS over SOTA baselines on ImageNet to evaluate its effectiveness on the image classification task, and supply the complete comparing results to Tab. 11 below. Note that we report both the rank #1 searched architecture with the highest accuracy that contains Shift and Conv blocks, and rank #2 searched architecture contains additional two Add blocks and achieves a $82.8\%$ top-1 accuracy on ImageNet with 8.4G MACs (#Mult: 7.4G; #Add: 9.1G; #Shift: 0.5G). + +# D. Visualization of the Searched Architecture + +For better understanding of the searched architecture, we provide the visualization of the searched architecture ShiftAddNAS-T1↑ and ShiftAddNAS-T1↑ in Fig. 9 and Fig. 10, respectively. The searched architecture ShiftAddNAS-T1↑ contains four Shift blocks, and achieves $83\%$ top-1 test accuracy on ImageNet with 8.5G MACs (#Mult: 7.1G; #Add: 8.5G; #Shift: 1.4G). The searched architecture ShiftAddNAS-T1↑ contains two Add blocks and one Shift block, and achieves $82.8\%$ top-1 test accuracy on ImageNet with 8.4G MACs (#Mult: 7.4G; #Add: 9.1G; #Shift: 0.5G). Moreover, the searched architecture prefers Conv as early blocks while consider Attn as later blocks, which is also consistent with the previous empirical observation that early convolutions help the overall performance (Xiao et al., 2021). + +More discussion for the searched architectures. The performance of the searched top architectures are quite close (e.g., the accuracy difference between rank #1 and rank #2 is smaller than $0.2\%$ ), and we also quantitatively measure the ratio breakdown of different operators in our searched top-10 architectures (Attn: $30\%$ ; Conv: $43\%$ ; Shift: $15\%$ ; Add: $12\%$ ). We see that the overall ratio of Add operators is quite comparable with that of Shift operators, thus our understanding is that the searched top architectures benefit from a relatively more balanced combination/contribution of all operators to + +Table 11: Comparison with SOTA baselines on ImageNet classification task. + +
ModelTop-1 Acc.Top-5 Acc.ParamsRes.MACs#Mult.#Add#ShiftModel Type
BNN55.8%78.4%26M22423.9G0.1G3.9G3.8GMult.-free
AdderNet74.9%91.7%26M22423.9G0.1G7.6G0Mult.-free
AdderNet-PKKD76.8%93.3%26M22423.9G0.1G7.6G0Mult.-free
DeepShift-Q70.7%90.2%26M22423.9G0.1G3.9G3.8GMult.-free
DeepShift-PS71.9%90.2%52M22423.9G0.1G3.9G3.8GMult.-free
ShiftAddNet72.3%-64M224210G0.1G16G3.9GMult.-free
ResNet-5076.1%92.9%26M22423.9G3.9G3.9G0CNN
ResNet-10177.4%94.2%45M22427.6G7.6G7.6G0CNN
SENet-5079.4%94.6%26M22423.9G3.9G3.9G0CNN
SENet-10181.4%95.7%45M22427.6G7.6G7.6G0CNN
ViT-B/1677.9%-86M384218G18G17G0Transformer
ViT-L/1676.5%-304M384264G64G63G0Transformer
DeiT-T74.5%-6M22421.3G1.3G1.3G0Transformer
DeiT-S81.2%-22M22424.6G4.6G4.6G0Transformer
VITAS77.4%93.8%13M22422.7G2.7G2.7G0Transformer
Autoformer-S81.7%95.7%23M22425.1G5.1G5.1G0Transformer
BoT-5078.3%94.2%21M22424.0G4.0G4.0G0CNN + Trans.
BoT-50 + SE79.6%94.6%21M22424.0G4.0G4.0G0CNN + Trans.
HR-NAS77.3%-6.4M22420.4G0.4G0.4G0CNN + Trans.
BossNAS-T080.5%95.0%38M22423.5G3.5G3.5G0CNN + Trans.
BossNAS-T0 + SE80.8%95.2%38M22423.5G3.5G3.5G0CNN + Trans.
ShiftAddNAS-T082.1%95.8%30M22423.7G2.7G3.8G1.0GHybrid
ShiftAddNAS-T0↑82.6%96.2%30M25624.9G3.6G4.9G1.4GHybrid
T2T-ViT-1981.9%-39M22428.9G8.9G8.9G0Transformer
TNT-S81.3%95.6%24M22425.2G5.2G5.2G0Transformer
Autoformer-B82.4%95.7%54M224211G11G11G0Transformer
BoTNet-S1-5981.7%95.8%28M22427.3G7.3G7.3G0CNN + Trans.
BossNAS-T182.2%95.8%38M22428.0G8.0G8.0G0CNN + Trans.
ShiftAddNAS-T182.7%96.1%30M22426.4G5.4G6.4G1.0GHybrid
ShiftAddNAS-T1↑183.0%96.4%30M25628.5G7.1G8.5G1.4GHybrid
ShiftAddNAS-T1↑282.8%96.2%30M25628.4G7.4G9.1G0.5GHybrid
+ +push forward the frontier of accuracy-efficiency tradeoff. Furthermore, showing such a ratio breakdown in searched top architectures further validates the necessity of adopting a hybrid search space. Finally, another insight from the general trends of the operator ratio breakdown is that, as the ranking of searched architectures drops, the ratio of Shift and Add operators will increase, which is consistent with our experiments, i.e., a purely ShiftNet or AdderNet will inevitably lead to accuracy drop. The above analysis also helps to validate the correctness of our search algorithm. + +# E. Detailed Search and Training Settings + +For NLP tasks, after training the supernet for 40K steps, we adopt an evolutionary algorithm (Wang et al., 2020a) to search for subnets with various latency and FLOPs constraints ranging from 1.5G to 4.5G for 30 steps with a population of 125, a crossover population of 50, and a mutation population of 50 with a probability of 0.3. During search, measuring latency for each chosen subnet can be time-consuming. Instead, we estimate the latency using a three-layer NN trained with encoding architecture parameters as features and measured latency as labels following (Wang et al., 2020a). The latency predictor is accurate with an average prediction error of $< 5\%$ . The searched subnets are then retrained from scratch for another 40K steps with an Adam optimizer and a cosine learning rate (LR) scheduler, where the LR is linearly warmed up from $10^{-7}$ to $10^{-3}$ and then annealed (same for training supernets). For CV tasks, we conduct an evolutionary search with FLOPs constraints for 20 steps with a population of 50, a crossover population of 25, and a mutation population of 25 with a probability of 0.2 following (Chen et al., 2021b). We train both the supernet and searched subnets using the same recipe and hyperparameters as DeiT (Touvron et al., 2021). Note that the position encoding in the attention blocks is replaced with a + +![](images/b9c29bb676855aabbcde86c91de5e206943d2f39cb6e893f692bb8fc5286b166.jpg) +Figure 9: Visualization of the searched architecture ShiftAddNAS-T1↑ with $83\%$ top-1 test accuracy on ImageNet. + +![](images/122a0d82ac28315c21e307ecb87d36abafbb0f31e3d92bbb6ee0422ae3520248.jpg) +Figure 10: Visualization of the searched architecture ShiftAddNAS-T1↑² with 82.8% top-1 test accuracy on ImageNet. + +depthwise convolution following (Li et al., 2021) for reducing the computational complexity. \ No newline at end of file diff --git a/shiftaddnashardwareinspiredsearchformoreaccurateandefficientneuralnetworks/images.zip b/shiftaddnashardwareinspiredsearchformoreaccurateandefficientneuralnetworks/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..60adf78560c6b55db3607e9e007bb2b2583771ee --- /dev/null +++ b/shiftaddnashardwareinspiredsearchformoreaccurateandefficientneuralnetworks/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e78800a10be40bdc46eeca869c0bcd26b68d6b832a31cd9afbfa95719404a7dd +size 1093556 diff --git a/shiftaddnashardwareinspiredsearchformoreaccurateandefficientneuralnetworks/layout.json b/shiftaddnashardwareinspiredsearchformoreaccurateandefficientneuralnetworks/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..1257296405328dce689b78e26161031c1ece148d --- /dev/null +++ b/shiftaddnashardwareinspiredsearchformoreaccurateandefficientneuralnetworks/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ab808ddf85ee5079fd1ff4dfaa7aca4ec2b6f2d10e273465fab41f5fb2899128 +size 496661 diff --git a/shorttermplasticityneuronslearningtolearnandforget/caf060ff-0787-46ed-b8a3-0bcaddf747b7_content_list.json b/shorttermplasticityneuronslearningtolearnandforget/caf060ff-0787-46ed-b8a3-0bcaddf747b7_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..26e205dc6a47cf8b8cd5aee24fc4bf738b505c5d --- /dev/null +++ b/shorttermplasticityneuronslearningtolearnandforget/caf060ff-0787-46ed-b8a3-0bcaddf747b7_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1afb47507c1853009a417903a507ed9746711a1b7f1fb35dd05d6bd38cfc50e9 +size 114836 diff --git a/shorttermplasticityneuronslearningtolearnandforget/caf060ff-0787-46ed-b8a3-0bcaddf747b7_model.json b/shorttermplasticityneuronslearningtolearnandforget/caf060ff-0787-46ed-b8a3-0bcaddf747b7_model.json new file mode 100644 index 0000000000000000000000000000000000000000..b96925a4a2ffbc10a7dc297dc2025fe09c560eaa --- /dev/null +++ b/shorttermplasticityneuronslearningtolearnandforget/caf060ff-0787-46ed-b8a3-0bcaddf747b7_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:42c21c0b775f3b630efb8bc77de50180945e68acb4f9db06fc9f58820433b31a +size 140003 diff --git a/shorttermplasticityneuronslearningtolearnandforget/caf060ff-0787-46ed-b8a3-0bcaddf747b7_origin.pdf b/shorttermplasticityneuronslearningtolearnandforget/caf060ff-0787-46ed-b8a3-0bcaddf747b7_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..7955dfe25372460d398e4e897ef0a8d4806571e4 --- /dev/null +++ b/shorttermplasticityneuronslearningtolearnandforget/caf060ff-0787-46ed-b8a3-0bcaddf747b7_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7bce323e1470a7fad49fa314de1b44d2f7b73ca81bdd509ae86969dad585b80f +size 4074823 diff --git a/shorttermplasticityneuronslearningtolearnandforget/full.md b/shorttermplasticityneuronslearningtolearnandforget/full.md new file mode 100644 index 0000000000000000000000000000000000000000..80020357d6ff7dc7595c1f23f07155b18d9779b2 --- /dev/null +++ b/shorttermplasticityneuronslearningtolearnandforget/full.md @@ -0,0 +1,419 @@ +# Short-Term Plasticity Neurons Learning to Learn and Forget + +Hector Garcia Rodriguez $^{1,2}$ Qinghai Guo $^{3}$ Timoleon Moraitis $^{1}$ + +# Abstract + +Short-term plasticity (STP) is a mechanism that stores decaying memories in synapses of the cerebral cortex. In computing practice, STP has been used, but mostly in the niche of spiking neurons, even though theory predicts that it is the optimal solution to certain dynamic tasks. Here we present a new type of recurrent neural unit, the STP Neuron (STPN), which indeed turns out strikingly powerful. Its key mechanism is that synapses have a state, propagated through time by a self-recurrent connection-within-the-synapse. This formulation enables training the plasticity with backpropagation through time, resulting in a form of learning to learn and forget in the short term. The STPN outperforms all tested alternatives, i.e. RNNs, LSTMs, other models with fast weights, and differentiable plasticity. We confirm this in both supervised and reinforcement learning (RL), and in tasks such as Associative Retrieval, Maze Exploration, Atari video games, and MuJoCo robotics. Moreover, we calculate that, in neuromorphic or biological circuits, the STPN minimizes energy consumption across models, as it depresses individual synapses dynamically. Based on these, biological STP may have been a strong evolutionary attractor that maximizes both efficiency and computational power. The STPN now brings these neuromorphic advantages also to a broad spectrum of machine learning practice. Code is available at https://github.com/NeuromorphicComputing/stpn. + +# 1. Introduction + +# 1.1. Biological vs artificial neural networks + +Biological neural networks are the source of inspiration for some of the most successful machine learning (ML) models, namely the artificial neural networks (ANNs) that underpin Deep Learning. Despite the success of ANNs, artificial intelligence (AI) models still pale in comparison to animals and humans in several respects. Widely acknowledged limitations include (a) the vast number of training episodes required before mastering a task, (b) difficulties in dynamically changing tasks, (c) the ad hoc task-specificity of ANN architectures, and (d) the high energy demands of running the algorithms on computers. Similarly, despite their biological inspiration at an abstract level, ANNs lack many of the computational operations that the known neuronal biophysics implies. It is conceivable that this latter disparity in implementation also underlies the former mismatch in performance. In particular, much of the complexity within biological neurons (a) is dedicated to synaptic plasticity for learning, (b) is governed by dynamically changing chemical concentrations, (c) is maintained across brain areas and species, and (d) accomplishes extreme energy efficiency. It is hard to ignore that these four biological properties that are largely missing from ANNs have a one-to-one correspondence to the four aforementioned limitations of ANNs. Based on this, our high-level ambition here is to explore whether these biological properties and the associated advantages can be brought to Deep Learning by a new rendition of a particular neuromorphic mechanism, i.e. short-term plasticity (STP) of synapses. Our approach is closely related to concepts from multiple subfields (Fig. 1.A), which we review in this section. + +# 1.2. Neuromorphic Computing + +Our goal here is aligned with the field of neuromorphic computing, which has been porting biophysical mechanisms from experimental neuroscience into models and emulating them in electronic circuits to improve neural computation (Indiveri & Horiuchi, 2011; Indiveri, 2021; Sarwat et al., 2022a;b). However, the focus has been mostly on the specific property of spiking neuronal activations, in so-called spiking neural networks (SNNs) (Maass, 1997; Ponulak & Kasinski, 2011). In addition, the field's aim has been over + +![](images/7b1d68665af52d899648bcee115044fae44f3917fcac15c629015d9b61f2b8fc.jpg) +Figure 1. (A) Our STPN model in the literature's context. (B) Simple connectionist neuron, with synaptic efficacies g. (C) The STPN. Plasticity through recurrent parameters, e.g. $\lambda$ . + +whelmingly to increase energy efficiency of the state of the art (SOTA), rather than its proficiency such as classification accuracy or achieved reward in useful tasks. Nevertheless, recent results show that advantages of neuromorphic mechanisms are not limited to efficiency. If other properties than spikes are considered, such as STP, neuromorphic models can in fact also lead to more proficient models (Moraitis et al., 2020), while remaining compatible with efficient electronics (Sarwat et al., 2022a). + +# 1.3. Plasticity and Short-Term Plasticity + +The term "plasticity" refers to the rules that determine how the efficacy, i.e. strength, of synaptic connections changes in the brain or in model networks. The term is often reserved for local rules, i.e. when the changes of a synapse depend on signals from the pre-synaptic and/or the post-synaptic neuron that the synapse connects, and potentially a third signal, such as concentration of neuromodulators (Gerstner et al., 2018; Pogodin & Latham, 2020; Sarwat et al., 2022b). Such plasticity is generally considered the underlying principle of learning in the brain, and a possible path to life-long ML. One type of plasticity rule is STP (Zucker, 1989; Tsodyks & Markram, 1997; Chamberlain et al., 2008; Mongillo et al., 2008), i.e. a type of plasticity with strong biological evidence, whose effect is constrained in time. On the other hand, if each plastic change is persistent, the rule is a type of long-term plasticity. For example, Hebb postulated that biological weights are updated proportionally to pre- and post-synaptic activations (Hebb, 1949). Despite its simplicity, networks with Hebbian-like plasticity and without supervision can be used to optimize models such as Bayesian + +mixtures (Nessler et al., 2009) and to solve tasks such as handwritten digit classification fast and with robustness to adversarial attacks (Moraitis et al., 2021). Extensions of such plasticity can be both insightful and powerful, playing a key role in the ML SOTA (Nessler et al., 2009; Scellier & Bengio, 2019; Löwe et al., 2019; Limbacher & Legenstein, 2020; Millidge et al., 2020; Illing et al., 2021). Particularly relevant to the present manuscript are cases where a plasticity rule causes synaptic changes at a different timescale with respect to another learning rule. This concept of "subordinate" or "interleaved" changes in synapses has been termed dynamic weights (Feldman, 1982), fast weights (Hinton & Plaut, 1987; Schmidhuber, 1992; 1993; Tieleman & Hinton, 2009; Ba et al., 2016; Schlag & Schmidhuber, 2017), or simply plasticity or learning (Bengio et al., 1990; Moraitis et al., 2018b; Miconi et al., 2018; 2020; Moraitis et al., 2020; Miconi, 2021). Interestingly, some of these approaches that use associative plastic updates have been shown to be equivalent to attention mechanisms (Ba et al., 2016), and even to models like linear transformers (Schlag et al., 2021). + +The short-term aspect of STP can be modelled by splitting the synaptic efficacy $G$ that weights a presynaptic input, into a long-term weight $W$ and an additive or multiplicative short-term component $F$ , e.g. $G = W + F$ . Subsequently, an update rule, which depends on local variables, increments $F$ , which otherwise decays exponentially with time, implying a type of learning followed by forgetting. The literature has shown diverse functions emerging from the various forms of STP. For example, STP can apply temporal filtering on synaptic inputs (Rosenbaum et al., 2012), or underpin biophysical models of working memory (Mongillo et al., 2008; Szatmáry & Izhikevich, 2010; Fiebig & Lansner, 2017). If realized as the fast-weight counterpart to a concurrent slower plasticity, it can focus learning from sequences on multiple timescales of the input (Moraitis et al., 2018a,b). It also instils a long short-term memory to recurrently connected neural networks (RNNs), resulting in properties and performance similar to Long Short-Term Memory (LSTM) (Hochreiter & Schmidhuber, 1997) units (Bellec & Salaj et al., 2018). In all these cases, STP was studied in the context of SNNs. The reason is that the increased biological plausibility of the spiking activations is a more useful model for many neuroscientists, and may bring energy efficiency advantages to neuromorphic engineering. However, SNNs are also harder to analyse mathematically or train practically, which limits the potential improvements from STP in useful ML tasks. + +Nevertheless, two recent models with STP did outperform others without in specific tasks, even though the STP-equipped models were SNNs. Namely, first, STP led to improved learning of restricted Boltzmann machines from unbalanced data (Leng et al., 2018). Second, and in closer relation to our present study, a very simple SNN learned + +without supervision from the standard static MNIST dataset of handwritten digits (LeCun et al., 1998), but was tested on the classification of frames of a video of digits with moving occlusions (Moraitis et al., 2020). Surprisingly, owing to STP's dynamics at the input synapses, the SNN outperformed simple supervised convolutional neural networks and LSTMs, even trained on the video dataset with temporal context. Moraitis et al. (2020) also included a mathematical proof that neural networks with STP at their input synapses are in fact the optimal model for certain dynamic data. The key enabling principle is that input synapses with STP memorize not only dataset-wide features in the long-term weights $W$ , but also recent features that are relevant to the immediate future in the short-term component $F$ . However, the practical demonstrations of STP's advantages remain limited due to the reliance on spiking neurons. It should be noted that some of the non-spiking models with fast weights, particularly those co-authored by Hinton (Hinton & Plaut, 1987; Tieleman & Hinton, 2009; Ba et al., 2016). Hinton & Plaut (1987); Tieleman & Hinton (2009) did include STP-like decaying dynamics in the fast subordinate weight changes, however training of the STP's parameters was not reported. In Ba et al. (2016), backpropagation trained an RNN's conventional slow weights end-to-end, while additional fast weights were updated by a separate non-learnable rule, also during inference. This system was able to solve tasks where attention to the recent inputs is important. However, the authors did not include STP in input synapses, but only in recurrent connections between hidden units. Here, we hypothesize that STP's potential for Deep Learning can be realized by enabling STP also at the input synapses, as in the theoretically supported proposal of Moraitis et al. (2020). + +In order to fulfil the promise of optimally adapting plasticity, one important element is missing from those previous studies. That is the optimization of the STP rule for each synapse and through learning, as opposed to fixed STP based on chosen hyper-parameters and uniform for all connections. How to realize this last ingredient is not immediately obvious. One recent work (Tyulmankov et al., 2022) did train a model equipped with the Hebbian STP mechanism of Moraitis et al. (2020). However, that model does not support recurrent connections between neurons, uses uniform plasticity parameters across all synapses, and focuses on simple associative tasks of random binary inputs. Therefore, the key advance was that the uniform hyperparameter in the earlier work was hand-tuned as opposed to optimized through backpropagation. Here we target advanced tasks, through fully recurrent models, and through the training of individual synapses' STP. To achieve this, we implement STP in a synapse as a sub-connection within that synapse, thus resulting in a formulation of STP Neurons (STPNs) as a novel type of recurrent unit (see Section 2). Through this formulation, the learning-and-forgetting function of STP + +becomes itself trainable, drawing links to the category of algorithms that are meta-learning, i.e. learning to learn. + +# 1.4. Learning to learn + +Meta-learning is a paradigm that applies machine learning to improve further learning in new domains. This has been considered analogous to the nesting of biological timescales of evolution, development, life-long skill learning, and learning for temporary objectives. In fact, direct empirical evidence for meta-plasticity, i.e. changes in plasticity, in the brain has been observed (Abraham & Bear, 1996). More generally, a large body of ML literature on meta-learning exists, with various approaches and applications (Schmidhuber et al., 1996; Thrun & Pratt, 1998; Bellec & Salaj et al., 2018; Hospedales et al., 2020). For instance, it has been shown that, through minimal modifications to how the training data is provided, RNNs learn to learn, where the inner learning loop consists in changes of recurrent state rather than changes of weights (Hochreiter et al., 2001; Wang et al., 2016). Clearly, some of the most relevant meta-learning methods with respect to our work here are those where learning to learn consists in learning the parameters of a plasticity rule that controls the changes of weights within the inner loop. Both evolutionary (Soltoggio et al., 2018) and gradient-based (Bengio et al., 1990) algorithms have long been described for such plasticity-rule meta-learning purpose. However, backpropagation-based end-to-end training of the individual-synapse plasticity parameters along with the other parameters of a neural network has only recently been demonstrated (Miconi et al., 2018). The trainable plasticity in that work outperformed non-plastic neural networks and has been followed up with extensions that confirm its advantages (Miconi et al., 2019; Beaulieu et al., 2020; Miconi, 2021). However, thus far, none of these has incorporated STP. It has not been obvious how to learn the spontaneous temporal dynamics of synaptic efficacy decay, i.e. how to learn the forgetting aspect of STP, for each synapse. As a matter of fact, in models without STP, fast weights are long-term, i.e. they persist through time, unless the fast-weight-update mechanism applies a learning increment or decrement. As a result, they lack a dedicated forgetting mechanism, and forgetting must be handled by the mechanism intended for learning. We believe that demonstrating the importance of learning to forget would be an important contribution to the meta-learning field, as it could possibly relate to the challenge of catastrophic forgetting in continual deep learning. Catastrophic forgetting refers to the phenomenon of neglecting a previously learned task because of learning a new one, and it is one of the important motivations for meta-learning research (Vuorio et al., 2018; Ren et al., 2018; Flennerhag et al., 2019; Javed & White, 2019; Hospedales et al., 2020; Sinitsin et al., 2020). It is plausible that learning, not only to learn, but also to explicitly for + +get would mitigate catastrophic forgetting. Here indeed we present a procedure of learning to learn and forget, realized as learning of STP parameters. + +# 1.5. Contribution to the field + +We present STPN, a new recurrent type of unit that expands the family of RNNs with the possibility of a recurrent state within each input synapse. It extends other fast-weight models by adding STP to inputs, and by making STP trainable per synapse. It builds on other models of differentiable plasticity by including a short-term aspect. It complements learning to learn with learning to forget. We will show that it is a better RNN choice than LSTM, surpasses the most recent fast-weight models, and outperforms other differentiable plasticity mechanisms, in a variety of tasks, with supervised and reinforcement learning, including examples of meta-learning. STPN's benefits comprise both improved task proficiency and energy efficiency. + +# 2. The STPN model + +# 2.1. The model + +We begin to construct the STPN model by defining initially a simple feed-forward hidden unit with activation $h_j$ , that receives an input vector $x$ from a preceding layer, and weights it by a synaptic efficacy vector $g_j$ (Fig. 1B). Two realizations (Fig. 1C) serve as intuition for casting such a model as a recurrent unit when STP is added. Firstly, the postsynaptic activation $h_j$ may feed back to the input synapses as one of the factors of the plasticity rule, e.g if STP is Hebbian. Secondly, the short-term memory and decay of each efficacy $g_{ij}$ implies that the synapse contains a state variable that is partly propagated to itself forward in time. Intuitively, these are two self-recurrent loops. + +The specific type of STP that we choose to base the STPN model on is the one that was motivated theoretically in Moraitis et al. (2020). According to this, a hidden neuron $j$ receiving an input vector $x$ from a preceding layer, weights it by a synaptic efficacy vector $g_{j}$ that consists of two additive components: $g_{j} = w_{j} + f_{j}$ . STP acts on $f_{j}$ . Meanwhile, component $w$ may be fixed, or updated by a different learning rule, either concurrently with STP, or preceding it. In this work, $w$ is updated via backpropagation in the outer loop between sequences. This STP rule dictates that $f_{ij}$ in a synapse $j$ from neuron $i$ , firstly decays exponentially with time $t$ , and secondly is subject to Hebbian plasticity proportional to the pre- and post-synaptic variables $x_{i}$ and $h_{j}$ . + +Based on the intuition for the two self-recurrent loops we construct STPN as a recurrent unit that aims to have analogous functionality to the latter Hebbian STP rule. We introduce upper-case symbols $G = W + F$ to indicate the + +matrices that connect the input vector to the hidden unit vector, and two equally-sized matrices $\Lambda$ and $\Gamma$ that contain elements $\lambda_{ij}$ and $\gamma_{ij}$ , which parameterize the STP. We will symbolize the element-wise and outer products by $\odot$ and $\otimes$ respectively. + +One time-step's pass through a layer of STPN units in this basic version, and assuming fixed weights $W$ and a nonlinearity $\sigma(\cdot)$ , is described by the following set of equations, where $\mathbb{1}$ indicates a matrix of ones: + +$$ +\boldsymbol {G} ^ {(t)} = \boldsymbol {W} + \boldsymbol {F} ^ {(t)} \tag {1} +$$ + +$$ +\boldsymbol {h} ^ {(t)} = \sigma (\boldsymbol {G} ^ {(t)} \boldsymbol {x} ^ {(t)}) \tag {2} +$$ + +$$ +\boldsymbol {F} ^ {(t + 1)} = \boldsymbol {\Gamma} \odot (\boldsymbol {x} ^ {(t)} \otimes \boldsymbol {h} ^ {(t)}) + (\mathbb {1} - \boldsymbol {\Lambda}) \odot \boldsymbol {F} ^ {(t)} \tag {3} +$$ + +The activation $h$ depends on the short-term component $F$ through $G$ (Eqs. (1) and (2)). $F$ , in turn, depends on the activation and on itself (Eq. (3)), wherein lies the recurrence of this model. Unlike in standard RNNs, this recurrence does not necessitate recurrent connections between hidden states $h_j$ , i.e. there are no synapses connecting units of the same layer. The recurrence is mediated in this case through the parameter matrices $\Gamma$ and $\Lambda$ that connect the synaptic state to itself and to its postsynaptic neuron. Therefore, this model realizes an uncommon type of recurrent connectivity, characterized by meta-weights, i.e. connections (self-loop from $f_{ij}$ through $\lambda_{ij}$ in Fig. 1D) within each synaptic connection (blue square $g_{ij}$ in Fig. 1D). + +In meta-learning terms, the Hebbian STP of Eqs. (1)-(3) describes one iteration of an inner learning (and forgetting) loop that is unsupervised (see Section 2.3). + +# 2.2. Equivalence to STP + +It can be shown rather simply that the STPN construct is not merely analogous to a neuron with the Hebbian STP rule that we focus on, but it is exactly this - however in the discrete rather than the continuous time domain. The original equations of the rule dictate firstly an exponential decay over time with a rate $0 < \lambda_{ij} < 1$ : + +$$ +\frac {d f _ {i j}}{d t} ^ {(d e c a y)} = - \lambda_ {i j} f _ {i j}. \tag {4} +$$ + +Secondly, at any discrete time point that the synapse receives an input $X_{i}^{(t)}$ , Hebbian plasticity with a learning rate $\gamma_{ij}$ increments $f_{ij}$ as well, by a $\Delta f_{ij}$ that also depends on the post-synaptic output $h_{j}^{(t)}$ : + +$$ +\frac {d f _ {i j}}{d t} ^ {(H e b b)} = \Delta f _ {i j} ^ {(t) (H e b b)} = \gamma_ {i j} x _ {i} ^ {(t)} h _ {j} ^ {(t)}. \tag {5} +$$ + +The combined effect of Eqs. (4) and (5) describes the full original STP rule. The continuous-time Eq. (4) can be approximated arbitrarily closely by small discrete time-steps + +![](images/4a5a6a85e52948f1d55a85d063a95e6b6575437830af39c0d1426776f42ff7c1.jpg) + +![](images/fd3b0f2668e499a2839bc8e1cbacceb214a4bd98356bf82058266c78de1d86ed.jpg) + +![](images/5e5cc80898607abcd612149692fdf6af95fd793a4d3ceddba95e7af2d2f1f1d5.jpg) +Figure 2. Proficiency during training of the STPN and other models across 4 tasks. Proficiency refers to: (A) Validation accuracy in ART (Ba et al., 2016); (B) Accumulated reward in an episode of the Maze Exploration task (Miconi et al., 2018); (C) Net score in the Atari game Pong (Bellemare et al., 2013) when one of the players reaches 21. (D) Number of timesteps in balance within an episode, capped at 1000, in Mujoco Inverted Pendulum (Todorov et al., 2012). + +![](images/c993ed25cd0c1d375188ebacb0fccdaecea4aa800e82c1b135a9a46e74e9ba37.jpg) + +through the Euler method (Euler, 1794; Kendall et al., 1989): + +$$ +\delta \boldsymbol {F} ^ {(t + 1) (d e c a y)} = - \boldsymbol {\Lambda} \odot \boldsymbol {F} ^ {(t)}. \tag {6} +$$ + +This method has long been used to simulate the continuous-time evolution of neuromorphic models, such as spiking neurons, including recently (Wozniak et al., 2020). + +On the other hand, Eq. (5) is already only dependent on discrete-time events, so in discrete time it remains the equivalent: $\Delta F^{(t + 1)(Hebb)} = \Gamma \odot (\pmb{x}^{(t)}\otimes \pmb{h}^{(t)})$ . STPN's Eq. (3) can therefore be written as + +$$ +\boldsymbol {F} ^ {(t + 1)} = \boldsymbol {F} ^ {(t)} + \Delta \boldsymbol {F} ^ {(t + 1) (H e b b)} + \delta \boldsymbol {F} ^ {(t + 1) (d e c a y)}, \tag {7} +$$ + +which shows that the model indeed is equivalent to discrete-time Hebbian STP. + +# 2.3. Learning to learn and forget with STPN + +STPN's parameters $\gamma_{ij}$ and $\lambda_{ij}$ are interpretable quite concretely in two ways. Firstly, as parameters of recurrent connections, they have a clear role of short-term memory. Secondly, $\gamma$ is also the Hebbian learning rate of the synapse, whereas $\lambda$ is its forget rate. Further, by framing the model as a network that is based on standard recurrent weighting operations, STPN's parameters are trainable. That is, not only the standard between-neuron connections $W$ , but also the + +characteristic connections-within-synapses can be trained. Notably, as these latter learned connections act as STP's rates of learning and forgetting, then training these parameters realizes a learning-to-learn scheme that also learns to forget. In this realization of meta-learning, the inner learning loop is the online unsupervised adaptation of the network through STP (Eq. (3)) to a given input sequence, whereas the outer learning loop consists in the optimization of the network's parameters, e.g. via backpropagation through time (BPTT), for the inner online learning task, over multiple examples of this inner task (see Algorithm 1 in the Appendix). + +# 2.4. STPN variants + +Even though thus far we have provided a description of STPN based on a feed-forward base structure (Eq. (2)), the same connection-within-a-synapse type of concurrency and plasticity can also be added to models that have concurrency between hidden units, like simple RNNs do. This simply changes the unit to also receive inputs from the same hidden layer, i.e. changes Eq. (2) into + +$$ +\boldsymbol {h} ^ {(t)} = \sigma \left(\boldsymbol {G} ^ {(t)} \left[ \boldsymbol {x} ^ {(t)}; \boldsymbol {h} ^ {(t - 1)} \right]\right), \tag {8} +$$ + +accompanied by the corresponding change in size of the parameter matrices $\pmb{F}$ and $\pmb{W}$ . We refer to the networks + +of Eqs. (2) and (8) as the STPNf and STPNr variants, respectively, of STPN connectivity (for their Feed-forward and Fully connected, or RNN non-plastic skeleton). This formulation is extensible to further variants, such as STPNl for an STPN with the addition of LSTM's gating, although those are not explored in this work. The results in Section 4 are achieved using the STPNr in most tasks, except for a fully-observable robotics environment where we tested the STPNf. + +# 3. Methods + +# 3.1. Training methods + +We found that, given the complexity of our model's synapse STP parameters, and especially for the more complex STPN models that include concurrency both in the synapse and between neurons such as the STPNr, training stability and robustness are not possible automatically. We explored approaches for making the STPN's training robust, and arrived in a strategy that consists in an initialization method and a weight-normalization approach that we introduced. See Appendix Algorithm 1 and Appendix A.4 for details. + +# 3.2. Energy consumption measurement + +Our approach focuses on the synaptic weighting mechanism, and as such it could provide guidelines for future neuromorphic hardware. Its energy consumption is therefore a key concern. Given that STP is a highly neuromorphic mechanism inspired by biophysics, it is probable that it is also highly efficient. In principle, STP has the potential to depress synaptic currents flexibly and independently through Hebbian decrements and short-term decay, which is a reason to intuitively expect high energy-efficiency from STPN. With this in mind, we measured the power consumption that each model would incur through weighting operations in hypothetical analog neuromorphic hardware. In such hardware, presynaptic input $x$ is provided as a voltage $V$ , whereas the matrix $G$ of synaptic efficacies $g$ could be represented in an array of resistive devices with conductance $g$ , such as memristors (Sarwat et al., 2022a). This enables weighting and summation through Ohm's and Kirchhoff's laws, and incurs a power consumption by each synapse, which is proportional to the conductance $g$ and the square of the applied input voltage $V^2$ , as shown in Eq. (9) + +$$ +P = V I = V \left(\frac {V}{R}\right) = V ^ {2} \left(\frac {1}{R}\right) = V ^ {2} g, \tag {9} +$$ + +where I is the electrical current, and R is the resistance. This method allowed us to measure the hypothetical power consumption of the various models using $P = x^{2}|g|$ . Notably, analog signals underlie synaptic transmission also in biological synapses, through ions. Fewer ions and smaller currents + +are transmitted when the biological synapse is depressed. Therefore, to the extent that STP is biologically plausible, our measurements of the STPN's power consumption provide some insight also into STP's role in the brain's energy budget. + +# 3.3. Tested baseline models + +In our experiments, we compare the STPN with other widely used networks with memory, like standard RNN and LSTM, and others with different kinds of synaptic memories, like RNN with Fast Weights (Ba et al., 2016) and Modulated plasticity RNN (Miconi et al., 2019). Given the qualitative architectural differences across the tested models, we make them comparable by choosing hidden sizes that correspond to equal number of parameters between models in each experiment. Ba et al. (2016) augmented RNNs by adding Fast Weights to some connections, specifically between recurrent neurons, i.e. not in feedforward synapses such as from the input layer. Also, the hyperparameters of plasticity are uniform throughout all fast-weight synapses: Hebbian update factor and decay of current memories. Additionally, they describe the use of an inner loop where fast weights can repeatedly act on an intermediate hidden state and be updated, while the effect of slow weights acts as a sustained boundary condition in each iteration. However, they found no significant empirical benefit in performing multiple such iterations; and neither do we when tuning this baseline. Additionally, note that this same mechanism can also be applied to any other network with synaptic memories, and is conceptually closer to work on recurrent processing of the same input as a form of adding computational resources (Schwarzschild et al., 2021a;b; Banino et al., 2021). Fast Weights RNN is a conceptually simpler version of STPN, primarily due to its use of plasticity only on recurrent connections, the plasticity rule being uniform across neurons and synapses, and the fact that parameters modulating fast learning and forgetting are not trained (but tuned using the validation set). Other mechanisms implemented by the Fast Weights network, like layer-normalization of the hidden activations, and a repeated application of the plasticity through multiple recurrent iterations on each time-step of the input sequence. Our control experiments (not shown) showed that this iterative aspect offers only a small improvement, and could be equally applied to STPN. Therefore, the Fast Weights model serves as a good baseline to the training of a synapse-specific STP mechanism. Miconi et al. (2018) exploit the idea of optimizing plasticity by training parameters that control each synapse's memory via backpropagation, hence Differentiable Plasticity. Miconi et al. (2019) further add a modulating term to the plasticity, akin to a third factor of three-factor plasticity rules, which is also trainable. Unlike STPN, in that prior work no variant could evolve (e.g. decay) its efficacies spontaneously with time, like STPN + +![](images/91697d2be5e07255195a559052785bad582a5150aba6d929c5dac027992f798d.jpg) + +![](images/5fc7147a105e1a4ab0990917124e354a02c9ca752ec1829775c35a899587fde0.jpg) + +![](images/f5ac67eb4f6751d6138024edf1a51241324d02a11ffd03a97532184dd8c85b8a.jpg) +Figure 3. Power consumption of trained models during inference, evaluated at each timestep. Mean and standard deviation over multiple random seeds are shown, averaged over multiple inference runs. Lower is better. + +![](images/d24d7d815b26dd1e7c109f14570da05eaefa3982d196b73de823b086cfe630f5.jpg) + +does through $\lambda$ . We select the modulated plasticity variant ("Modplast") as a baseline due to its superior performance among the variants tested in the Maze Exploration task in (Miconi et al., 2019). The other two major differences in this specific model with respect to STPN are: a) plasticity only in recurrent synapses, b) a meta-trained parameter per synapse that clips the plastic part of the efficacy. This model being the best out of multiple variants of trainable plastic RNNs serves as a good baseline for the STPN. HebbFF (Tyulmankov et al., 2022) is architecturally equivalent to STPNf with uniform plasticity. However, it offers no option for per-synapse plasticity parameters, recurrent between-neuron connections, or mechanisms to stabilize plastic updates such as the ones that we introduced Section 3. These become necessary in tasks with higher complexity than those tested in (Tyulmankov et al., 2022), which we tested and confirmed. Specifically, given that HebbFF could be described superficially, as a highly-simplified version of the STPN, we include comparisons to HebbFF alongside several other simpler STPN versions in Appendix A.2. We also carry out experiments using networks with non-synaptic memories, but which are general purpose ANNs with memory, and shown to perform meta-learning through the encoding of their neuronal memories (Wang et al., 2016). We compare the performance of RNN (a direct comparison to STPNr but without synaptic STP, and a different type of memory to STPNf) and LSTM (as a more complex non-plastic RNN + +with gating and an additional memory mechanism). + +# 3.4. Tested tasks + +Associative Retrieval Task (ART) (Ba et al., 2016) tests the capabilities of a network to successfully store associations between pairs of elements seen in a sequence, and retrieve one of the elements of the pair (the value) when queried with the other (the key) at the end of the sequence. This task and other variants (Schlag & Schmidhuber, 2017; Le et al., 2020) are therefore commonly used to compare the abilities of networks with memories of different nature. For the setup of this task, we mostly follow the experimental details provided in Ba et al. (2016), besides the modifications described in Appendix A.5.1. Maze Exporation: Maze or grid-like tasks have been commonly used in RL as a data efficient and interpretable task to test RL algorithms. (Miconi et al., 2018) instantiates a specific form of such maze, in which an agent has an egocentric view of its surroundings and whose goal is to navigate towards a reward, which it cannot see and whose position is randomized across episodes. Furthermore, the agent is randomly relocated to another position in the grid upon reward-finding and at the start of an episode. Given this environment design, we can think of the Maze Exploration task as a test to the meta-learning capabilities of the agents. Firstly, each maze instantiation (with a fixed reward position) represents the inner loop of learning, as the agent needs to learn how to effectively navi + +![](images/ab082b7d5bb1d7a94aa3ef0ac44a3b6b7b0f7b5562ba682dde8b55600228a9d1.jpg) +Figure 4. Energy efficiency as a function of task-specific proficiency, measured at regular intervals during training. Each scattered point is one instance of the model at a specific point of learning. All seeds for a model shown with the same color. + +![](images/334ff2e90d80beb8fffd1b89e2838ef0c6fd61ed3805b21cce52157eefe69c05.jpg) + +gate towards this new reward position, and do so from each initial random position after relocation when the reward is found. Secondly, across different episodes, parameters need to be optimized as to help within the inner loop and through different instantiations of the maze, hence they are learned to learn. Additionally, even within an episode, we can distinguish two qualitatively different phases: in the first steps, the agent needs to explore this instantiation of the maze in order to find the reward location. Upon learning of the positioning of the goal, it changes to an exploitation phase in which the key is to quickly reach the already seen reward. These two task distributions (the distribution of all possible mazes and the binary exploration-exploitation phases) positions this task as a good benchmark for the meta-learning and sequence adaptiveness capabilities of non-plastic and plastic networks with memory. Atari games and MuJoco simulated robotics: The previous two experimental setups, namely ART and Maze Exploration, were presented in plasticity related articles and have some characteristics that might favor models with plastic connections. RL is an area of research where the use of RNNs and its variants is still widespread in SOTA algorithms, more so in comparison to supervised learning domains regarding language, video or audio. In order to go beyond simple tasks to which the plastic networks literature has been limited, in the interest of exploring a domain in which RNNs are a component of SOTA approaches, and with the additional intent to examine the use of STPN as a general-purpose network with memory, we present some preliminary experiments with two tasks from two common Deep RL benchmarks: Atari Pong and MuJoCo Inverted Pendulum. Pong is an Atari 2600 game implemented in the Arcade Learning Environment (ALE) (Bellemare et al., 2013) in which the player faces an opponent, each player controls a bar that they can move up and down in order to hit a ball and therefore score a goal or stop the opponent from doing so. The game stops when a player reaches a score of 21. The reward obtained by the + +agent is the net score of the finished game, and the observations are the game frames. For our experiments in Pong, we use A2C, the synchronous version of A3C (Mnih et al., 2016) as the learning algorithm. The agent's network uses convolutional layers such as those in Mnih et al. (2016), a recurrent policy (shared by value and action branches) and non-plastic, feed-forward value and action branches. A simple algorithm such as A2C allows to better explore the real impact of the recurrent unit, and its previous use in the Maze task provides us with some assurances of its compatibility with plastic networks. Beyond the shift of domain from toy, plastic-network favoring tasks, Pong offers the first situation in which STPN is embedded in a larger network, and whose input is not sparse and directly from the environment, but dense and the result of the processing of multiple layers. Note because we do not perform frame stacking, the environment is a partial observable Markov decision process (POMDP), given that velocity of the ball cannot be inferred from a single frame (Hausknecht & Stone, 2015). This need for agents with memory justifies the use of recurrent policies and lack of comparison with a feed forward policy. MuJoCo (Todorov et al., 2012) is a physics engine widely used for research in robotics and reinforcement learning. Inverted Pendulum is one of the simplest tasks within MuJoCo, where the agent aims to balance an inverted pendulum which sits on a cart, by moving the cart forward and backward in one dimension with continuous valued controls. Our experiment with MuJoCo's inverted pendulum represents a preliminary step in the direction of using STPN in more complex problems in robotics and continuous control like those in the MuJoCo environment, and in combination more advanced RL algorithms, like Proximal Policy Optimization (PPO) algorithm (Schulman et al., 2017) in this case. Unlike Pong without frame stacking, InvertedPendulum is a fully observable Markov decision process (MDP), so memory of the past is not needed to assess the present or predict the future. Therefore, training the + +parameters that process hidden memories could represent an unnecessary effort in terms of credit assignment, aggravated by hidden states being of much greater dimensional that environmental observations. Therefore, we use the STPNf in this case, and MLP as a baseline; in addition to RNN and LSTM. For the terminology we use for different timescales (e.g. episodes, epochs, timesteps), see Appendix A.6. + +# 4. Results + +# 4.1. Accuracy & reward + +Fig. 2 shows that the STPN is more proficient, i.e. obtains larger validation accuracy and reward, than all other baselines. These plots report the mean and standard deviation over multiple seeds, except in Fig. 2.C, where we follow recommendations given in Agarwal et al. (2021) and report within 0.25 inter-quantile ranges, due the known propensity to certain catastrophic and non-representative runs of brittle algorithms like A2C in ALE. Furthermore, we find the unsupervised adaptability of STPN's plastic weights offers greater performance at inference time, as detailed in Table 3. Appendix A.2 presents the empirical advantages of including recurrent connections and learning per-synapse plasticity for STPN, with respect to non-recurrent or uniform plasticity versions of STPN. Additionally, we present benefits over HebbFF (Tyulmankov et al., 2022), a simpler feed-forward STPN with uniform plasticity. + +Across all tasks, we observe STPN show noticeable stability in the learning process while achieving higher proficiency earlier in training. This is particularly clear in the Inverted Pendulum task, where the mid-training instability of MLP, also reported by Schulman et al. (2017), is counteracted by the addition of STP to the synapses. We hypothesize that compared to other plastic models, explicitly learning decaying dynamics of synaptic memories helps adding stability to processing of the same inputs across time, as less relevant synapses will be closer to their long-term value $w_{ij}$ . + +STPN seems to be more robust to hyperparameter choice than other tested baselines. Three examples are: a) the fact that it outperforms modulated plasticity, a similarly complex plastic model, with the same parameters that are tuned for that specific network; b) in Pong, STPN can tolerate a larger learning rate than LSTM, as the latter was unable to learn with high learning rate for most random seeds, such that it needed a lower learning rate for its best mean final reward; and c) like in Maze Exploration, STPN outperforms the model for which the experiment hyperparameters are tuned in Inverted Pendulum. + +# 4.2. Energy consumption + +The initial hypothesis regarding the trainable dynamical suppression of synapses, specially to input synapses, improving + +the energy efficiency of backpropagated-trained models is unequivocally confirmed in our experiments, as shown in Figs. 3 and 4. See also Appendix Table 4. Unlike for proficiency metrics like accuracy or reward, the networks are not given any explicit signal or instruction to be more energetically efficient, making these results even more remarkable. However, in some cases a common goal can improve both proficiency and efficiency in the STPN: suppress unimportant synapses. We believe these results show such a goal is met. This is particularly clear in Fig. 4. (A) As the network optimizes proficiency, its energy consumption decays Similarly, in Fig. 4. (B) The growth of energy with respect to reward is minimal relative to other models, and largely attributable to past reward being part of the agent's observation in this experiment (hence a higher reward leading to a higher norm in the input and higher energy consumption). + +# 4.3. Learning to learn and forget + +Standard RNNs are seen as being able to meta-learn the encoding of a learning algorithm within its neuronal memories (Wang et al., 2016). STPN adds a synaptic state, which is updated by three meta-learned parameters (the long term synaptic efficacy, and the two STP parameters $\lambda, \gamma$ ), and has the potential of a higher influence in the output of the unit as compared to neuronal memories. The higher proficiency achieved by STPN on meta-learning tasks shows a learning-to-learn process is improving the predictive performance of the network. Further evidence for learning to learn and forget in the STPN is the following. Firstly, high proficiency is reached early in training, without incurring in too many instabilities or preventing further optimization at later stages of training, as can be seen in Fig. 2. Secondly, the negative slope of the efficiency vs proficiency curve of the STPN scatter points (Fig. 4) indicates a learning-to-forget mechanism, that improves both aspects. + +# 5. Discussion + +STPN is founded on prior theoretical optimality proofs and biological evidence. As a result, STPN is more performant, efficient and learns to better learn and forget than a variety of other models, and in a broad range of difficult tasks, by introducing individually trainable short-term plasticity to all synapses. The model also offers a new method to increase the efficiency of neuromorphic platforms. In combination with the prior experimental evidence that supports the biological plausibility of our plasticity, our results also raise STP's significance for animal behaviour and for the brain's energy budget. This outcome paves new and interdisciplinary research avenues, in RNNs, meta-learning, neuromorphic computing, and neuroscience, which we hope to see explored. + +# References + +Abraham, W. C. and Bear, M. F. Metaplasticity: the plasticity of synaptic plasticity. Trends in neurosciences, 19(4): 126-130, 1996. +Agarwal, R., Schwarzer, M., Castro, P. S., Courville, A. C., and Bellemare, M. G. Deep reinforcement learning at the edge of the statistical precipice. CoRR, abs/2108.13264, 2021. URL https://arxiv.org/abs/2108.13264. +Ba, J., Hinton, G. E., Mnih, V., Leibo, J. Z., and Ionescu, C. Using fast weights to attend to the recent past. Advances in Neural Information Processing Systems, 29: 4331-4339, 2016. +Banino, A., Balaguer, J., and Blundell, C. Pondernet: Learning to ponder. arXiv preprint arXiv:2107.05407, 2021. +Beaulieu, S., Frati, L., Miconi, T., Lehman, J., Stanley, K. O., Clune, J., and Cheney, N. Learning to continually learn. arXiv preprint arXiv:2002.09571, 2020. +Bellec & Salaj, Subramoney, A., Legenstein, R., and Maass, W. Long short-term memory and learning-to-learn in networks of spiking neurons. In Bengio, S., Wallach, H., Larochelle, H., Grauman, K., Cesa-Bianchi, N., and Garnett, R. (eds.), Advances in Neural Information Processing Systems, volume 31. Curran Associates, Inc., 2018. URL https://proceedings.neurips.cc/paper/2018/file/c203d8a151612acf12457e4d67635a95-Paper.pdf. +Bellemare, M. G., Naddaf, Y., Veness, J., and Bowling, M. The arcade learning environment: An evaluation platform for general agents. J. Artif. Intell. Res., 47: 253-279, 2013. doi: 10.1613/jair.3912. URL https://doi.org/10.1613/jair.3912. +Bengio, Y., Bengio, S., and Cloutier, J. Learning a synaptic learning rule. Citeseer, 1990. +Chamberlain, S. E., Yang, J., and Jones, R. S. The role of nmda receptor subtypes in short-term plasticity in the rat entorhinal cortex. *Neural plasticity*, 2008, 2008. +Euler, L. Institutiones calculi integralis. Academia Imperialis Scientiarum, 1794. +Feldman, J. A. Dynamic connections in neural networks. Biological cybernetics, 46(1):27-39, 1982. +Fiebig, F. and Lansner, A. A spiking working memory model based on hebbian short-term potentiation. Journal of Neuroscience, 37(1):83-96, 2017. + +Flennerhag, S., Rusu, A. A., Pascanu, R., Visin, F., Yin, H., and Hadsell, R. Meta-learning with warped gradient descent. arXiv preprint arXiv:1909.00025, 2019. +Gerstner, W., Lehmann, M., Liakoni, V., Corneil, D., and Brea, J. Eligibility traces and plasticity on behavioral time scales: experimental support of neohebbian three-factor learning rules. Frontiers in neural circuits, 12:53, 2018. +Hausknecht, M. J. and Stone, P. Deep recurrent q-learning for partially observable mdps. In 2015 AAAI Fall Symposia, Arlington, Virginia, USA, November 12-14, 2015, pp. 29-37. AAAI Press, 2015. URL http://www.aaii.org/ocs/index.php/FSS/FSS15/paper/view/11673. +Hebb, D. O. The organisation of behaviour: a neuropsychological theory. John Wiley & Sons, Inc., New York, 1949. +Hinton, G. Using fast weights to store temporary memories, 2017. URL https://www.youtube.com/watch?v=GLmptInTNSw. +Hinton, G. E. and Plaut, D. C. Using fast weights to deblur old memories. In Proceedings of the 9th Annual Conference of the Cognitive Science Society, pp. 177-186, 1987. +Hochreiter, S. and Schmidhuber, J. Long short-term memory. Neural computation, 9(8):1735-1780, 1997. +Hochreiter, S., Younger, A. S., and Conwell, P. R. Learning to learn using gradient descent. In IN LECTURE NOTES ON COMP. SCI. 2130, PROC. INTL. CONF. ON ARTI NEURAL NETWORKS (ICANN-2001, pp. 87-94. Springer, 2001. +Hospedales, T., Antoniou, A., Micaelli, P., and Storkey, A. Meta-learning in neural networks: A survey. arXiv preprint arXiv:2004.05439, 2020. +Illing, B., Ventura, J., Bellec, G., and Gerstner, W. Local plasticity rules can learn deep representations using self-supervised contrastive predictions. Advances in Neural Information Processing Systems, 34, 2021. +Indiveri, G. Introducing 'neuromorphic computing and engineering'. Neuromorphic Computing and Engineering, 1(1):010401, 2021. +Indiveri, G. and Horiuchi, T. K. Frontiers in neuromorphic engineering, 2011. +Javed, K. and White, M. Meta-learning representations for continual learning. In Wallach, H., Larochelle, H., Beygelzimer, A., d'Alché-Buc, F., Fox, E., and + +Garnett, R. (eds.), Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc., 2019. URL https://proceedings.neurips.cc/paper/2019/file/f4dd765c12f2ef67f98f3558c282a9cd-Paper.pdf. +Kendall, E. A. et al. An introduction to numerical analysis. John Wiley and Sons Inc., New York, USA, pp. 37-45, 1989. +Le, H., Tran, T., and Venkatesh, S. Self-attentive associative memory. In International Conference on Machine Learning, pp. 5682-5691. PMLR, 2020. +LeCun, Y., Bottou, L., Bengio, Y., and Haffner, P. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278-2324, 1998. +Leng, L., Martel, R., Breitwieser, O., Bytschok, I., Senn, W., Schemmel, J., Meier, K., and Petrovici, M. A. Spiking neurons with short-term synaptic plasticity form superior generative networks. Scientific reports, 8(1):1-11, 2018. +Liang, E., Liaw, R., Nishihara, R., Moritz, P., Fox, R., Goldberg, K., Gonzalez, J., Jordan, M., and Stoica, I. RLlib: Abstractions for distributed reinforcement learning. In Dy, J. and Krause, A. (eds.), Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pp. 3053-3062. PMLR, 10-15 Jul 2018. URL https://proceedings.mlr.press/v80/ liang18b.html. +Limbacher, T. and Legenstein, R. H-mem: Harnessing synaptic plasticity with hebbian memory networks. In Larochelle, H., Ranzato, M., Hadsell, R., Balcan, M., and Lin, H. (eds.), 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/f6876a9f998f6472cc26708e27444456-Abstr.html. +Löwe, S., O'Connor, P., and Veeling, B. S. Putting an end to end-to-end: Gradient-isolated learning of representations. arXiv preprint arXiv:1905.11786, 2019. +Maass, W. Networks of spiking neurons: the third generation of neural network models. Neural networks, 10(9): 1659-1671, 1997. +Miconi, T. Learning to acquire novel cognitive tasks with evolution, plasticity and meta-meta-learning. arXiv preprint arXiv:2112.08588, 2021. + +Miconi, T., Stanley, K., and Clune, J. Differentiable plasticity: training plastic neural networks with backpropagation. In International Conference on Machine Learning, pp. 3559-3568. PMLR, 2018. +Miconi, T., Rawal, A., Clune, J., and Stanley, K. O. Backpropamine: training self-modifying neural networks with differentiable neuromodulated plasticity. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id=r11rAiA5Ym. +Miconi, T., Rawal, A., Clune, J., and Stanley, K. O. Backpropamine: training self-modifying neural networks with differentiable neuromodulated plasticity. arXiv preprint arXiv:2002.10585, 2020. +Millidge, B., Tschantz, A., and Buckley, C. L. Predictive coding approximates backprop along arbitrary computation graphs. arXiv preprint arXiv:2006.04182, 2020. +Mnih, V., Badia, A. P., Mirza, M., Graves, A., Lillicrap, T. P., Harley, T., Silver, D., and Kavukcuoglu, K. Asynchronous methods for deep reinforcement learning. In Balcan, M. and Weinberger, K. Q. (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. 1928-1937. JMLR.org, 2016. URL http://proceedings.mlr.press/v48/mniha16.html. +Mongillo, G., Barak, O., and Tsodyks, M. Synaptic theory of working memory. Science, 319(5869):1543-1546, 2008. +Moraitis, T., Sebastian, A., and Eleftheriou, E. The role of short-term plasticity in neuromorphic learning: learning from the timing of rate-varying events with fatiguing spike-timing-dependent plasticity. IEEE Nanotechnology Magazine, 12(3):45-53, 2018a. +Moraitis, T., Sebastian, A., and Eleftheriou, E. Spiking neural networks enable two-dimensional neurons and unsupervised multi-timescale learning. In 2018 International Joint Conference on Neural Networks (IJCNN), pp. 1-8. IEEE, 2018b. +Moraitis, T., Sebastian, A., and Eleftheriou, E. Optimality of short-term synaptic plasticity in modelling certain dynamic environments. arXiv preprint arXiv:2009.06808, 2020. +Moraitis, T., Toichkin, D., Chua, Y., and Guo, Q. Softhebb: Bayesian inference in unsupervised hebbian soft winnertake-all networks, 2021. + +Nessler, B., Pfeiffer, M., and Maass, W. Stdp enables spiking neurons to detect hidden causes of their inputs. Advances in neural information processing systems, 22: 1357-1365, 2009. +Pogodin, R. and Latham, P. Kernelized information bottleneck leads to biologically plausible 3-factor hebbian learning in deep networks. In Larochelle, H., Ranzato, M., Hadsell, R., Balcan, M. F., and Lin, H. (eds.), Advances in Neural Information Processing Systems, volume 33, pp. 7296-7307. Curran Associates, Inc., 2020. URL https://proceedings.neurips.cc/paper/2020/file/517f24c02e620d5a4dac1db388664a63-Paper.pdf. +Ponulak, F. and Kasinski, A. Introduction to spiking neural networks: Information processing, learning and applications. Acta neurobiologiae experimentalis, 71(4): 409-433, 2011. +Ren, M., Liao, R., Fetaya, E., and Zemel, R. S. Incremental few-shot learning with attention attractor networks. arXiv preprint arXiv:1810.07218, 2018. +Rosenbaum, R., Rubin, J., and Doiron, B. Short term synaptic depression imposes a frequency dependent filter on synaptic information transfer. PLoS computational biology, 8(6):e1002557, 2012. +Salimans, T. and Kingma, D. P. Weight normalization: A simple reparameterization to accelerate training of deep neural networks. Advances in neural information processing systems, 29, 2016. +Sarwat, S. G., Kersting, B., Moraitis, T., Jonnalagadda, V. P., and Sebastian, A. Phase-change memtransistive synapses for mixed-plasticity neural computations. Nature Nanotechnology, 17(5):507-513, 2022a. +Sarwat, S. G., Moraitis, T., Wright, C. D., and Bhaskaran, H. Chalcogenide optomemristors for multi-factor neuromorphic computation. Nature communications, 13(1): 1-9, 2022b. +Scellier, B. and Bengio, Y. Equivalence of equilibrium propagation and recurrent backpropagation. Neural computation, 31(2):312-329, 2019. +Schlag, I. and Schmidhuber, J. Gated fast weights for on-the-fly neural program generation. In NIPS Metalearning Workshop, 2017. +Schlag, I., Irie, K., and Schmidhuber, J. Linear transformers are secretly fast weight programmers. In International Conference on Machine Learning, pp. 9355-9366. PMLR, 2021. + +Schmidhuber, J. Learning to control fast-weight memories: An alternative to dynamic recurrent networks. Neural Computation, 4(1):131-139, 1992. +Schmidhuber, J. Reducing the ratio between learning complexity and number of time varying variables in fully recurrent nets. In International Conference on Artificial Neural Networks, pp. 460-463. Springer, 1993. +Schmidhuber, J., Zhao, J., and Wiering, M. Simple principles of metalearning. Technical report IDSIA, 69:1-23, 1996. +Schulman, J., Wolski, F., Dhariwal, P., Radford, A., and Klimov, O. Proximal policy optimization algorithms. CoRR, abs/1707.06347, 2017. URL http://arxiv.org/abs/1707.06347. +Schwarzschild, A., Borgnia, E., Gupta, A., Huang, F., Vishkin, U., Goldblum, M., and Goldstein, T. Can you learn an algorithm? generalizing from easy to hard problems with recurrent networks. Advances in Neural Information Processing Systems, 34, 2021a. +Schwarzschild, A., Gupta, A., Ghiasi, A., Goldblum, M., and Goldstein, T. The uncanny similarity of recurrence and depth. arXiv preprint arXiv:2102.11011, 2021b. +Sinitsin, A., Plokhotnyuk, V., Pyrkin, D., Popov, S., and Babenko, A. Editable neural networks. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id=HJedXaEtvS. +Soltoggio, A., Stanley, K. O., and Risi, S. Born to learn: the inspiration, progress, and future of evolved plastic artificial neural networks. Neural Networks, 108:48-67, 2018. +Szatmáry, B. and Izhikevich, E. M. Spike-timing theory of working memory. PLoS computational biology, 6(8): e1000879, 2010. +Thrun, S. and Pratt, L. Learning to learn: Introduction and overview. In Learning to learn, pp. 3-17. Springer, 1998. +Tieleman, T. and Hinton, G. Using fast weights to improve persistent contrastive divergence. In Proceedings of the 26th annual international conference on machine learning, pp. 1033-1040, 2009. +Todorov, E., Erez, T., and Tassa, Y. Mujoco: A physics engine for model-based control. In 2012 IEEE/RSJ International Conference on Intelligent Robots and Systems, pp. 5026-5033. IEEE, 2012. +Tsodyks, M. V. and Markram, H. The neural code between neocortical pyramidal neurons depends on neurotransmitter release probability. Proceedings of the national academy of sciences, 94(2):719-723, 1997. + +Tyulmankov, D., Yang, G. R., and Abbott, L. Meta-learning synaptic plasticity and memory addressing for continual familiarity detection. Neuron, 110(3):544-557, 2022. +Vuorio, R., Cho, D.-Y., Kim, D., and Kim, J. Meta continual learning. arXiv preprint arXiv:1806.06928, 2018. +Wang, J. X., Kurth-Nelson, Z., Tirumala, D., Soyer, H., Leibo, J. Z., Munos, R., Blundell, C., Kumaran, D., and Botvinick, M. Learning to reinforcement learn. arXiv preprint arXiv:1611.05763, 2016. +Wozniak, S., Pantazi, A., Bohnstingl, T., and Eleftheriou, E. Deep learning incorporating biologically inspired neural dynamics and in-memory computing. Nature Machine Intelligence, 2(6):325-336, 2020. +Zucker, R. S. Short-term synaptic plasticity. Annual review of neuroscience, 12(1):13-31, 1989. + +# A. Appendix + +# A.1. The meta-learning algorithm + +Algorithm 1 STPN learning to learn and forget in a supervised meta-learning setting +Initialize weights and meta-parameters $\Theta = [W;\lambda ;\gamma ]$ +> Outer-loop learning. E.g. BPTT. +while training do Sample input sequence. + $\pmb {S} = [\pmb{x}^{(0)},\dots ,\pmb{x}^{(T)}]\sim \mathcal{D}$ +> Initialize short-term component. + $\pmb {F}^{(0)} = \pmb{0}$ +> Inner-loop learning via Hebbian STP $\equiv$ Recurrent model receiving an input sequence. +for $t = 1$ to $T$ do Obtain total efficacies. + $\pmb{G}^{(t)} = \pmb {W} + \pmb{F}^{(t)}$ +>Normalize total efficacies and their short-term components (optional but practically impactful). + $\hat{G}^{(t)} = G^{(t)} / \| G^{(t)}\|$ $\hat{F}^{(t)} = F^{(t)} / \| G^{(t)}\|$ +>Forward pass. + $\pmb {h}^{(t)} = \sigma (\hat{\pmb{G}}^{(t)}\pmb{x}^{(t)})$ +>Hebbian STP update $\equiv$ Synaptic-recurrent-state update. + $\pmb{F}^{(t + 1)} = \gamma \odot (\pmb{x}^{(t)}\otimes \pmb{h}^{(t)}) + \lambda \odot \hat{\pmb{F}}^{(t)}$ +end for +>Meta-learn via gradient update, e.g. BPTT. + $\Theta \gets \Theta -\nabla \mathcal{L}$ +end while + +# A.2. Importance of learning per-synapse STP parameters + +Table 1 shows that learning per-synapse STP parameters achieves greater proficiency and efficiency. This happens for both STPNf and STPNr, respectively without and with recurrent connections. Note energy efficiency being lower for purely feed-forward models, as happens for ART, can be expected. This is because recurrent activations are dense, whereas input for these problems is more sparse and lower magnitude on average, which we do not correct for in these measurements. All models had their hidden size chosen to have similar number of parameters. + +Table 1. Inference-time proficiency and energy efficiency of per-synapse and uniform STP models on ART and Maze Exploration + +
ARTMaze
ModelTest accuracyPower consumptionRewardPower consumption
STPNr per-synapse STP (Ours)99.99 ± 0.013.4 ± 0.4115.7 ± 1.680.2 ± 2.4
STPNf per-synapse STP (Ours)89.40 ± 5.141.2 ± 0.1112.9 ± 1.5154.8 ± 6.3
STPNr uniform STP (Ours)96.89 ± 6.214.0 ± 0.374.0 ± 1.4150.2 ± 5.5
STPNf uniform STP (Ours)60.21 ± 0.522.6 ± 0.185.2 ± 1.6355.6 ± 12.9
HebbFF (Tyulmankov et al., 2022)10.62 ± 0.027.9 ± 1.839.9 ± 1.3385.9 ± 8.9
+ +ART and Maze Exploration tasks were presented in other works presenting different networks with plasticity, so they serve as solid baselines for STPN without an explicit task bias introduced by our work. Nonetheless, HebbFF's performance on these two tasks is far below the structurally equivalent STPNf. Therefore, we decide to test the importance of recurrence and per-synapse STP in the Continual Familiarity Detection Task presented in (Tyulmankov et al., 2022). In this task, at each timestep the network is presented with a binary vector whose elements are $1$ or $-1$ . With probability $1 - p$ , this vector is + +randomly sampled. Otherwise, with probability $p$ , the vector provided to the network $R$ timesteps ago is used as input again. One exception is that, if an already repeated input was sampled to be repeated again, a new vector is generated instead. The network outputs a single bit at every timestep, representing whether it predicts the vector presented is repeated or not. + +We report results on the same three variations of this task presented in Tyulmankov et al. (2022), running 5 seeds for each variation of the task. In the first variation, a single dataset of random vectors is used for all iterations of training ('dataset' mode). In the following two, a new set of vectors is generated at each training iteration ('infinite' mode). The distance between repeated vectors $(R)$ is also varied from 3 to 6 in the last two experiments. We use T=5000 vectors per iteration (as the experiment logs in the public repository for Tyulmankov et al. (2022)), and train for the same number of epochs as the released models (Tyulmankov et al., 2022) (although it is not clear whether these were originally trained until convergence). All other training configurations are exactly the same as found in their publicly available code. We choose the hidden size of all other variants as to have similar number of parameters to HebbFF. Given HebbFF has a much higher memory consumption for the same number of trainable parameters than per-synapse STPNr, the STPNr has nearly half the number of hidden units in the Maze exploration for these comparison results as compared to those shown in Figs. 2 and 3, which explains the lower performance. + +Table 2 shows the generalization accuracy for the three tasks we described. For the 'dataset' mode, this means accuracy on a validation set. For the 'infinite' mode, accuracy is measured on a newly generated dataset at each iteration, which we label as 'train accuracy' although the network hasn't seen these specific examples before (hence generalization). The results confirm that STPN, especially in its per-synapse variants, performs competitively with HebbFF. Note that we did not tune any of the STPN variants for this task at all, whereas we can HebbFF to be well tuned. STPN is clearly stronger in the infinite mode with $R = 3$ , which happens to be the one with the shortest training iterations (1600, vs 3000 for 'dataset' mode and 3500 for the other 'infinite' mode task). Possibly training STPN until convergence would have led to more competitive results, in addition to tuning. Another reason for which HebbFF is better suited for this task is the domain restriction of STP parameters for HebbFF (e.g. only anti-Hebbian and short-term behavior) can be specially suited to this task but not generalize to more complex problems. Furthermore, the plastic update stabilization and initialization we use for STPN might be better suited for more complex problems. This results confirm the use of recurrence and per-synapse STP as a better general approach to configuring STPN. + +Table 2. Generalization proficiency of per-synapse and uniform STP models and LSTM in three variants of the Continual Familiarity Detection Task (Tyulmankov et al., 2022) + +
ModelDataset mode (R=3)Infinite mode (R=3)Infinite mode (R=6)
STPNr per-synapse STP (Ours)97.53 ± 0.3199.99 ± 0.0298.98 ± 0.28
STPNf per-synapse STP (Ours)98.16 ± 0.9199.92 ± 0.0498.72 ± 0.19
STPNr uniform STP (Ours)78.52 ± 12.8294.13 ± 7.5990.88 ± 3.00
STPNf uniform STP (Ours)81.08 ± 14.2791.95 ± 9.4591.50 ± 11.67
HebbFF (Tyulmankov et al., 2022)98.47 ± 0.8799.68 ± 0.0999.71 ± 0.12
LSTM66.75 ± 0.3978.52 ± 2.0774.37 ± 2.90
+ +# A.3. Further results + +For completeness, we present the inference-time equivalents of Figs. 2 and 3 in tabular form, which can be found in Tables 3 and 4. STPN has the added benefit of being able to adapt its synapses after training and hence having a better adaptation during inference, which clearly provides an added extra performance at test time. + +# A.4. Training methods + +Stabilization through a type of weight normalization. Plastic weights can significantly impact the predictions of a network based on recent experience. Although significant changes to the effective weights can increase predictive performance, fast changes of connectionist parameters have the potential to cause a variety of issues during training and evaluation. For instance, Ba et al. (2016) found that large or small norms in hidden vectors can cause the fast weights derived from them to grow or shrink excessively, leading to exploding or vanishing gradients. In their case, using layer normalization of hidden states, and performing a decay of fast weights, successfully controls such instabilities. Miconi et al. + +![](images/1d546f5d906cbec99bbed2edb6ce183cb7d435ef469ef0d17b9e461412f5b532.jpg) +Associative Retrieval Task (Ba et al. 2016) + +Maze exploration (Miconi et al. 2018) +![](images/a511f827d22bc098d8c022af1006dfb8f00980da6f6e3f56066fff73945d91f1.jpg) +STPNr per-synapse STP (Ours) +STPNf per-synapse STP (Ours) +STPNf uniform STP (Ours) +HebbFF (Tyulmankov et al.) + +![](images/4929503c8e1969453f794cb7224670a84bc38c15a5d7279adbedf6f5ba41dd59.jpg) +dat3 $\mathrm{T} = 5000$ Tyulmankov et al (2022) +Figure 5. Generalization proficiency curves during training of per-synapse and uniform STP models and LSTM, in ART, Maze Exploration and three variants of the Continual Familiarity Detection Task (Tyulmankov et al., 2022) + +![](images/f308b3af6701c799ec48dab2a9cb0656ac188c5f7e5b8c1226674d10e754540c.jpg) +LSTM + +![](images/dfafa9f6e7fa1b4e460686edf489d3ccf6de22b3ab71139534066241c75d4eba.jpg) +STPNr uniform STP (Ours) + +Table 3. Accuracy and reward of trained models during inference. Averaged over multiple evaluating runs, reported mean and standard deviation of different random seeds. + +
ModelAssociative RetrievalMaze ExplorationPongInverted Pendulum
STPN (Ours)98.55 ± 2.76132.7 ± 1.420.7 ± 0.5985.0 ± 15.0
LSTM47.28 ± 3.16119.8 ± 2.118.0 ± 4.623.2 ± 10.1
RNN46.83 ± 5.5697.9 ± 1.9-143.0 ± 22.4
Modulated Plasticity61.49 ± 15.79112.2 ± 2.0--
Fast Weights80.87 ± 1.67---
MLP---701.8 ± 98.9
+ +Table 4. Power consumption of trained models during inference. Average over multiple inference runs and timesteps within a run, reported mean and standard deviation over seeds. + +
ModelAssociative RetrievalMaze ExplorationPongInverted Pendulum
STPN (Ours)10.9 ± 3.8181.1 ± 2.952.7 ± 6.47.9 ± 2.5
LSTM65.6 ± 3.4649.1 ± 15.3576.8 ± 33.5758.8 ± 81.7
RNN43.0 ± 4.9330.6 ± 24.3-143.0 ± 22.4
Modulated plasticity32.0 ± 7.4231.6 ± 23.9--
Fast Weights80.6 ± 69.4---
MLP---115.8 ± 33.9
+ +(2019) cites the inherent instability of Hebbian updates as the reason for inclusion of a clipping mechanism for synaptic memories. Alternatively, it also experiments with an implicit normalization (by using Oja's rule instead of Hebb's rule for the plastic weight updates), or a decay term (not-trained, a function of the 'fast learning rate' which is uniform for all + +synapses); ultimately choosing the clipping due to superior empirical results. + +In our case, layer normalization of hidden inputs alone is not enough to counteract hidden states of varying norm, as input also forms part of the Hebbian update. Additionally, the gradients of STP parameters $\lambda$ and $\gamma$ , which are trainable in the STPN, suffer from further instability as these parameters are connected to the computational graph only through the updating of $F$ . Relying on decaying $F$ is also not an option, given we do not to restrict $\lambda$ to cause a decay of synaptic memories (as we found restricting it to hinder proficiency). In fact, in some cases, some synapses learn to potentiate their current memories. This adds to the issue of growing memories, especially if the updates to synaptic memories happen to also be purely additive. We experiment with multiple of these techniques, on top of explicit normalization of weights; which ultimately turns out to be the best option in most cases. This weight normalization is performed on the effective weights for each batch element at each timestep, which also normalizes the synaptic memories. Note however we store the un-normalized long-term weights, as these are common to all batch elements and an average norm across the batch defeats the purpose of sequence specific weight adaptation. Additionally, this allows to implicitly learn the relative norm between long-term and short-term weights, given no scaling of the normalized weights is learned as in standard weight normalization (Salimans & Kingma, 2016). We performed normalization per neuron, although similar performance was observed for global normalization and could be further explored. Additional learnable norm scaling is left for future work. To confirm weight normalization did not provide an inherent training improvement for all models (but only for STPN due to the previously cited reasons), we trained all baselines in ART and Maze with equivalent non-parametric weight normalization schemes, and find neither proficiency or efficiency are improved for other baselines. + +Initialization strategy of STP parameters. Initialization of STP parameters $\lambda$ and $\gamma$ can also have a significant impact on convergence speed. We tested different random initialization distributions in ART, where we find the best scheme that we use in all other experiments. We find initializing $\gamma_{ij} \sim \mathcal{U}\left(-\frac{0.001}{\sqrt{h}}, \frac{0.001}{\sqrt{h}}\right)$ is better over purely positive, centered away from zero, or more largely spread values. We hypothesize small initial values of $\gamma$ allow long-term weights to have a greater impact on very early training as short-term weights are very weakly updated. Surprisingly, a much wider and purely positive initialization $\lambda_{ij} \sim \mathcal{U}(0,1)$ is empirically better. Presumably, decay doesn't play a major role at very early stages of training when $\gamma$ is very close to zero, and in later stages of learning when plastic weights start playing a role, having large variety of dynamics across synapses and neurons allows for richer evolution of synaptic memories. + +# A.5. Experimental details + +We run a different number of seeds across experiments, running more when either or both experiment was not highly computationally expensive or more instances were necessary to make clearer conclusions. Specifically, we used 5 (ART and Pong), 3 (Maze) and 2 (Pendulum) seeds respectively. + +# A.5.1. ASSOCIATIVE RETRIEVAL + +Compared to the described setup in Ba et al. (2016), a modification in the experiments carried out is we do not include an embedding or (post-RNN,) pre-SoftMax fully connected layer, of size 100 each. The motivation behind such a choice is three fold: a) Reducing the network to only a RNN and a SoftMax layer makes the predictive capacity of the Network rely maximally on the RNN, which is the true subject of study b) the second author admits to the lack of need for such embedding (Hinton, 2017), and attributes its inclusion to reasons beyond the scope of such paper, and c) when tuning the learning rate we find all models (including non-plastic baselines with small hidden units) easily solve the task if an embedding layer is included, which we hypothesize is caused by such layer taking a major role in prediction. + +We tune the learning rate (to 0.001), which is not provided in Ba et al. (2016). The number of training epochs for the results reported in (Ba et al., 2016) is not provided either. We experiment with some values and report results on networks trained for 200 epochs, after which we find networks generally do not improve. Hidden sizes of networks are chosen so that a similar number of parameters are trained, with a focus on low-parameter regime as larger networks all solve the problem (also reported in Ba et al. (2016)). Therefore we choose a hidden size of 20 (the smallest tested size in Ba et al. (2016)) for the Fast weights RNN, and calculate the hidden size of other models as to obtain a similar number of parameters of the entire network. For RNN with fast weights, we use layer normalization, only one iteration of the inner loop, and $\lambda$ and $\eta$ , all as indicated in the Appendix A.1 in Ba et al. (2016). Although the network structure is different, we don't change the STP parameters ( $\lambda$ and $\eta$ ) as they the same values are used throughout the different tasks in the paper due to alleged robustness provided by layer normalization. Our experiments tuning fast weights RNN confirms this, as they show little difference when exploring other values. Additionally, we use hyperbolic tangent as activation function, for fairer comparison + +to other networks and as our experiments show a better performance than with ReLU (which only provides purely additive Hebbian factors). Initialization of recurrent (slow) weights as an identity matrix is known to favor longer (orthogonal) storing of hidden states in RNNs (Hinton, 2017) and hence don't offer a specific advantage to RNN with fast weights vs other RNNs, so the results shown in this paper don't follow such specific initialization for recurrent connections. + +# A.5.2. MAZE EXPLORATION + +We use the same parameters provided in (Miconi et al., 2019), and we run the experiments by adapting the open source repository (hence also using the parameters not explicitly mentioned in the article but introduced in the code). We only increase the batch size (number of agents 'acting in parallel') from 16 (in the code, not mentioned in the article) to 512 to maximize computational efficiency of gradient updates. Besides faster learning in a shorter amount of iterations due to more experience per gradient update, we find it can reduce variance of the update as in some episodes initial exploration for the reward fails or comes too late in the episode, hence the agent not being able to exploit learning the location of the reward. Regarding the hidden sizes of the RNNs, we choose a hidden size of 100 for the standard RNN (as provided in the standard Miconi et al. (2019) parameters), and calculate the hidden size of other models as to obtain a similar number of parameters for the entire network. Additionally, following Miconi et al. (2019), value and action branches are non plastic for all models, only fixed and feed forward. + +# A.5.3. ATARI PONG + +We use RLLib (Liang et al., 2018) to train and evaluate agents in PongNoFrameskip-v4. Besides the experimental choices described in Section 3.4, it should be noted that we use STPNr with 64 hidden units, and adjust the size of the LSTM to 48 hidden units in order to have a similar number of trainable parameters. We also follow Mnih et al. (2016) in the preprocessing (dimensionality and color scale) for the game frames, besides frame stacking. We tune rollout length (50), gradient clipping (40), discount factor (0.99) in shorter runs (which both models share in the displayed results); and additionally tune initial learning rate for the final longer runs (0.0007 and 0.0001 respectively), using a linear decay learning rate schedule finishing at $10^{-11}$ at 200 million iterations. Models are trained from the experienced collected by 64 parallel agents. + +# A.5.4. MUJOCO INVERTED PENDULUM + +We use RLLib to train and evaluate agents in InvertedPendulum-v2. We mostly do so with the same parameters reported in (Schulman et al., 2017), and for any other parameters not specified there we use the default options provided by RLLib. The only differences are: a) the use of a linearly decaying learning rate schedule, starting from the same original learning rate and finishing at 4 million timesteps at $10^{-11}$ ; b) since it's not specified in (Schulman et al., 2017), we employ a single parallel worker collecting experience in one environment c) the choice of a single layer policy network (besides de action and value branch) of size 64 (this is the only case where models' hidden sizes were not adjusted to obtain a similar number of parameters, as it didn't prove relevant in our experiments). + +# A.6. Terminology on timescales + +An explicit note about the different timescales across experiments might ease the interpretation of the reported results by the reader, and hence we now provide it. In the supervised learning task, namely ART, an epoch represents a training iteration in which the entire training dataset is seen, and sequence elements describe each of the characters presented to the network in a sequential manner. In reinforcement learning, where an agent interacts with an environment via actions, and receives rewards and observations; we refer to each of these interactions as an episode step or timestep. An episode encompasses a variable (Pong, Inverted Pendulum) or fixed (Maze) number of episode steps or timesteps. Finally, although iteration could also refer to a single timestep, we use such term to indicate one period between gradient updates, which can enclose multiple episodes experienced by multiple agents, depending on the learning algorithm. + +# A.7. STPN mechanics + +![](images/51e2bf3d4d7a206254ca3f268f79f1d6b801522848478c82b6341803f0f98683.jpg) +Figure 6. Evolution of effective weights through processing of a sequence in ART. Each separate plot represents a neuron, where the y axis are the input synapses for such neuron, and the x axis represents time, i.e. sequence elements. Color represents the magnitude of $G_{ij}$ for each synapse. We can observe the effect of training $\lambda_{ij}$ as different synapses increase or decrease in value at different rates + +![](images/68dd23b0ffef4f20eca70e3da57b53c038871716fa249f653718c2c31aeb6817.jpg) +Figure 7. Learnt STP parameters for STPN in ART. Each dot represents one synapse, each color represents the synapses of a single neuron. There is clearly some clustering of the parameters for each neuron at a specific sign for $\gamma$ , but with different learning rates for different synapses. \ No newline at end of file diff --git a/shorttermplasticityneuronslearningtolearnandforget/images.zip b/shorttermplasticityneuronslearningtolearnandforget/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..afd3e640802d86bb336ca7ab49572a55ff4fcdd3 --- /dev/null +++ b/shorttermplasticityneuronslearningtolearnandforget/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:065da0412ea66d9cc18afa8fce8cc2f67e396eb5b02b9657a7355b0b4e010d3c +size 697011 diff --git a/shorttermplasticityneuronslearningtolearnandforget/layout.json b/shorttermplasticityneuronslearningtolearnandforget/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..7c97e79270eb85486ab4eb90e2aebad6932ae81b --- /dev/null +++ b/shorttermplasticityneuronslearningtolearnandforget/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f572d2da62e816a2566540bfad96b590244fe18223d6cb34d0b1f3841f767254 +size 518616 diff --git a/showingyourofflinereinforcementlearningworkonlineevaluationbudgetmatters/1353a9db-d007-451c-a2f8-8d04eb715637_content_list.json b/showingyourofflinereinforcementlearningworkonlineevaluationbudgetmatters/1353a9db-d007-451c-a2f8-8d04eb715637_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..4f05d73d1a9b11c2a9ab43f7f33cbe26d46bb255 --- /dev/null +++ b/showingyourofflinereinforcementlearningworkonlineevaluationbudgetmatters/1353a9db-d007-451c-a2f8-8d04eb715637_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cfc8ddd66f0a1662a4b4155b0979a3397493f75aa7d5435375c60c651997f1d6 +size 134558 diff --git a/showingyourofflinereinforcementlearningworkonlineevaluationbudgetmatters/1353a9db-d007-451c-a2f8-8d04eb715637_model.json b/showingyourofflinereinforcementlearningworkonlineevaluationbudgetmatters/1353a9db-d007-451c-a2f8-8d04eb715637_model.json new file mode 100644 index 0000000000000000000000000000000000000000..a7cb1e9c53ad40a2e3517e62454a246ab727f8dd --- /dev/null +++ b/showingyourofflinereinforcementlearningworkonlineevaluationbudgetmatters/1353a9db-d007-451c-a2f8-8d04eb715637_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:68349e9f76255b966125fde367670501b668f9d8d98bf1cc512250ea577585d2 +size 172107 diff --git a/showingyourofflinereinforcementlearningworkonlineevaluationbudgetmatters/1353a9db-d007-451c-a2f8-8d04eb715637_origin.pdf b/showingyourofflinereinforcementlearningworkonlineevaluationbudgetmatters/1353a9db-d007-451c-a2f8-8d04eb715637_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..97ca0562843f7ad0a48b92d93ed1d19821d49c47 --- /dev/null +++ b/showingyourofflinereinforcementlearningworkonlineevaluationbudgetmatters/1353a9db-d007-451c-a2f8-8d04eb715637_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:23a61150e42dbcd0c562a629a8501281651da7f3d910a82adb2bea180948b5c8 +size 3295443 diff --git a/showingyourofflinereinforcementlearningworkonlineevaluationbudgetmatters/full.md b/showingyourofflinereinforcementlearningworkonlineevaluationbudgetmatters/full.md new file mode 100644 index 0000000000000000000000000000000000000000..24963210bc9b154658bc5f2a7b0b11e92def1f89 --- /dev/null +++ b/showingyourofflinereinforcementlearningworkonlineevaluationbudgetmatters/full.md @@ -0,0 +1,757 @@ +# Showing Your Offline Reinforcement Learning Work: Online Evaluation Budget Matters + +Vladislav Kurenkov1 Sergey Kolesnikov1 + +# Abstract + +In this work, we argue for the importance of an online evaluation budget for a reliable comparison of deep offline RL algorithms. First, we delineate that the online evaluation budget is problem-dependent, where some problems allow for less but others for more. And second, we demonstrate that the preference between algorithms is budget-dependent across a diverse range of decision-making domains such as Robotics, Finance, and Energy Management. Following the points above, we suggest reporting the performance of deep offline RL algorithms under varying online evaluation budgets. To facilitate this, we propose to use a reporting tool from the NLP field, Expected Validation Performance. This technique makes it possible to reliably estimate expected maximum performance under different budgets while not requiring any additional computation beyond hyperparameter search. By employing this tool, we also show that Behavioral Cloning is often more favorable to offline RL algorithms when working within a limited budget. + +# 1. Introduction + +In recent years, significant success has been achieved in applying Reinforcement Learning (RL) to different real-world scenarios (Chen et al., 2019; Tang et al., 2019; Gauci et al., 2019). Offline Reinforcement Learning (ORL) (Levine et al., 2020) is pioneering a real-world adaptation of RL, focusing on algorithms that can learn a policy from a fixed, previously recorded dataset, without having to interact with the environment during training. Many recent community efforts were focused on advanced benchmarks (Fu et al., 2021a; Gulcehre et al., 2021) and nuanced algorithm comparisons (Brandfonbrener et al., 2021a; Qin et al., 2021). + +$^{1}$ Tinkoff, Moscow, Russia. Correspondence to: Vladislav Kurenikov . + +Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s). + +However, it is widely recognized that even deep online RL is plagued with evaluation issues, such as insufficient account for statistical variability (Agarwal et al., 2022), or sensitivity to the choice of hyperparameters (Henderson et al., 2018). The latter problem is one of the reasons why the results of many deep RL methods are usually reported for a narrow range of values. + +When it comes to deep ORL algorithms, the choice of hyperparameters also plays a major role in the final performance (Wu et al., 2019). While many in the community note that the whole training and evaluation pipeline needs improvement (Fu et al., 2021b), the comparisons of new deep ORL algorithms are still mostly done through online performance reports on the best set of hyperparameters (Kostrikov et al., 2021; Fujimoto & Gu, 2021). + +In this paper, we argue that the hyperparameter search should not be ignored in the deep offline RL setting, demonstrating that the conclusions about the algorithms change when we control for the number of trained policies deployed online1. To this end, we introduce the notion of an online budget, i.e. the number of policies deployed online, and suggest to use an entire pipeline similar to the one in (Paine et al., 2020) for reporting results: training, offline selection, and online evaluation, but one where the selection is done by uniform sampling. As we will demonstrate, this decision allows us to re-use the Expected Validations Performance (EVP) (Dodge et al., 2019) technique from the NLP field to get reliable estimates of expected maximum performance under different online budgets from just one round of hyperparameter search. + +Our Contributions Here, we list the main contributions of our work: + +- We demonstrate that the preference between deep offline RL algorithms is budget-dependent. We stress that this is more critical for offline settings than for online ones, and that current evaluation methodology does not account for such dependence. +- We propose to use Expected Validation Performance (Dodge et al., 2019), a technique actively employed + +![](images/9788e9261b03c0ffec67d44281fcfcac45e0909b3ddbf7e9a405e50d8449d5e9.jpg) +Figure 1. Left: A widespread approach for reporting deep offline RL results, commonly known as online policy selection. Right: Full deep offline RL evaluation pipeline. We argue for reporting results under the second pipeline with varying sizes of the online evaluation budget $B$ . Note that selecting hyperparameters that perform best overall on the online policy selection tasks from the same domain (Fu et al., 2021a; Gulcehre et al., 2021) can also be put to the right pipeline as a special case. + +![](images/07c17ec6464605f9c96d3da4f0a612e7a3145a8c4ea98b7320057f552039bc61.jpg) + +in NLP, for reliable comparison of deep offline RL algorithms under varying online evaluation budgets. To stress the online nature of comparison (in opposition to validation), we refer to it as Expected Online Performance (EOP). This tool can take the both major components of deep offline RL into account: the offline policy selection (OPS) method as well as online evaluation budget. Furthermore, it can be applied without additional computational expenses. + +- Using the proposed tool, we also demonstrate that Behavioral Cloning (Pomerleau, 1991) is often more favorable under a limited evaluation budget. +- In addition, EOP can be applied to comparisons of OPS methods. Using EOP, we illustrate that their preference is also budget-dependent. + +In the end, we also discuss how the proposed solution relates to the recently introduced Active-OPS (Konyushkova et al., 2021) and deployment-constrained RL setup (Matsushima et al., 2020). + +# 2. Background + +# 2.1. Offline RL + +Reinforcement learning $(RL)$ is a framework for solving sequential decision-making problems. It is typically formulated as a Markov Decision Process (MDP) over a 5-tuple $(S, A, P, r, \gamma)$ , with action space $A$ , state space $S$ , transition dynamics $P$ , reward function $r$ , and discount factor $\gamma$ . The goal of the learning agent is to obtain a policy $\pi(s, a)$ that maximizes the expected discounted return $E_{\pi}[\sum_{t=0}^{\infty} \gamma^{t} r_{t+1}]$ through interaction with the MDP. + +In Offline RL, also known as Batch RL, instead of obtaining data and learning via environment interactions, the agent solely relies on a static dataset $D$ that was collected under + +some unknown behavioral policy (or a mixture of policies) $\pi_{\mu}$ . This setting is considered more challenging, as the agent loses its ability for exploration (Levine et al., 2020) and is faced with the problem of extrapolation error – being unable to correct its estimation inaccuracies when selected actions are not present in the training dataset (Fujimoto et al., 2019). + +# 2.2. Offline RL Evaluation + +Training and evaluation of deep offline RL algorithms is still in active development, and various authors approach it in different ways by simplifying the genuine offline setting (Gulcehre et al., 2021). At the core of the simplification are two primary issues: (1) unlimited amount of online evaluations available, and therefore (2) sidestepping offline policy selection. For example, it is common to report the maximum performance for the best set of hyperparameters (Figure 1, Left). Moreover, in many cases, the number of search trials is not made explicit (Kumar et al., 2020). + +To eliminate these simplifications, we adhere to a more general setup for training and evaluating offline RL algorithms similar to Paine et al. (2020) in order to satisfy hard offline constraints (Figure 1, Right). + +First, the dataset $D$ is randomly split trajectory-wise into training $D_{T}$ and validation $D_{V}$ subsets accordingly. Then a sequence of hyperparameter assignments $(h_1,h_2,\dots,h_N)$ is sampled for running an algorithm of interest, resulting in a sequence of policies $(\pi_1,\pi_2,\dots,\pi_N)$ . Note that at this stage, we do not know how good these policies are. + +Then, $B \leq N$ of policies are arbitrarily chosen for online evaluation, which we refer to as an online evaluation budget. In the most restricted offline RL setting, $B = 1$ . However, the generalization to $B > 1$ is justified by the online evaluation budget being conditioned on the relevant decision-making problem and the available resources. + +To choose policies for online evaluation, offline policy se + +Table 1. Best final performance of deep offline RL algorithms if they were evaluated under a different number of policies deployed online for Hopper-v3 environment. This table highlights that the usage of different online evaluation budgets ( $B$ ) may lead to different conclusions on preference between algorithms. $N$ is the total number of hyperparameters evaluated for a specific algorithm. + +
AlgorithmB=1B=2B=3B=4B=8B=15B=30FinalN
BC179420572179----21793
CQL1773195420722161239126032832283230
PLAS147518331996209623162507-250715
BCQ13251605174218261986--206212
CRR10131339147715451636--166812
BREMEN8831148131814391691--179512
MOPO111824304663787830
+ +lection (OPS) methods can be used. In specific domains, like recommender systems, policies can be picked based on established offline metrics, e.g. Recall, computed on the validation $D_V$ dataset (Xin et al., 2020). However, such metrics do not always exist, and it is often necessary to rely on general methods (Voloshin et al., 2020; Fu et al., 2021b) or proxy tasks (Fu et al., 2021a; Gulcehre et al., 2021). + +# 3. Online Evaluation Budget Matters + +As can be seen in Figure 1, Left, using online policy selection makes the evaluation budget $B$ equivalent to the number of hyperparameter search trials $N$ . On the other hand, Fu et al. (2021a); Gulcehre et al. (2021) search for the best set of hyperparameters using proxy tasks, but the online evaluation budget on the target task is $B = 1$ . + +Meanwhile, there is a whole spectrum of values in-between that could be relevant not only for a specific problem, but for a specific context. By context we mean a certain space of resources (computational resources, robotics hardware, time constraints, online testing capacity). Here, a practitioner may work on the same problem, but have a lower or bigger amount of resources available for online evaluation. + +Therefore, a natural question to ask when analysing results of deep ORL algorithms is "Will the conclusions about the algorithms change, if I have a lower or higher online evaluation budget than the one reported in the paper?" Unfortunately, current evaluation and report methodologies do not provide an answer, and the dependence between varied online evaluation budget and the resulting performance of the algorithms is left unreported. + +To address this issue independently, it is necessary to access detailed experimental results showing which hyperparameters resulted in which performance. While some authors open-source such data (Qin et al., 2021), it is not a common practice to do so. + +To demonstrate that the conclusions about algorithm prefer + +ence are dependent on the available online evaluation budget, we rely on open-sourced $^2$ results by Qin et al. (2021). For each algorithm in Table 1, we compute the expected maximum performance under uniform policy selection (i.e. the policies are chosen at random) given a specific online evaluation budget $B$ . The final column is what would be reported in the paper, demonstrating that CQL (Kumar et al., 2020) significantly outperforms its competitors. However, in budgets up to 4, Behavioral Cloning performs the best. Also, note that the preference between CRR (Wang et al., 2020) and BREMEN (Matsushima et al., 2020) is reversed starting from the budget of 8. + +# 4. Accounting for the Budget + +In the previous section, we demonstrated multiple model comparisons where authors would have reached a different conclusion if they had used a smaller (or bigger) online evaluation budget. To resolve this issue, we use a tool from the NLP field, Expected Validation Performance (EVP) (Dodge et al., 2019), that can be adapted for enhancing the quality of experimental reports in a deep ORL setting. + +# 4.1. Expected Online Performance + +Here, we give a detailed description for EVP, reframed for an offline RL setting, and with the computational budget replaced by an online evaluation budget (typically, $B \ll N$ ). We refer to this approach as Expected Online Performance (EOP). + +Having all $N$ policies evaluated online after hyperparameter search, we want an estimate of the expected maximum performance, given that we could deploy only $1 \leq B \leq N$ policies out of $N$ . + +![](images/5e0b13e45c0326bcbbe227796edb076db646a398b9349391327861ab312465bc.jpg) +(a) Walker2d, Low-1000 + +![](images/f6f1bee41879fef8a455eb913bad70b26f52ecb80258ee4f5fa0723d73f61c0f.jpg) +(b) Hopper, Medium-1000 +Figure 2. Expected Online Performance graphs under uniform offline policy selection on Qin et al. (2021) data. The proposed EOP graph clearly demonstrates that preference between algorithms is budget-dependent. Furthermore, it highlights that BC is often more favorable to offline RL algorithms under limited online evaluation budgets. The X-axis denotes the number of policies deployed online, and Y-axis refers to the normalized performance. Note that the number of estimates for a concrete algorithm is upper-bounded by the total number of hyperparameter assignments $(N)$ evaluated for this algorithm. Shadowed area represents one standard deviation. + +![](images/a221decb8e025eda55682dfb10708d97da6e07a85d45e31c1ebedbb51f7369d5.jpg) +(c) HalfCheetah, High-1000 + +The parameters of interest to us are $\theta_{1},\dots,\theta_{B}$ , where + +$$ +\theta_ {b} := E \left[ \max \left(V \left(\pi_ {1}\right), \dots , V \left(\pi_ {b}\right)\right) \right] = E \left[ V _ {(b: b)} \right] \tag {1} +$$ + +for $1 \leq b \leq B$ and $V$ is an random variable (RV) representing the result of online evaluation. In other words, $\theta_{b}$ is the expected value of the $b^{th}$ order statistic for a sample of size $b$ . The $i^{th}$ order statistic $V_{(i:b)}$ is an RV representing the $i^{th}$ smallest value if the RVs were sorted. + +Originally, EVP operates over one stage – hyperparameter value selection. But in an ORL setting, there is also a second stage – policy selection (see Figure 1, Right). To account for this discrepancy, we note that uniformly sampled hyperparameter values and then uniformly sampled policies result in the probability of a policy being selected for online evaluation proportional to the probability of its hyperparameters being used. Virtually, that makes $\theta_{b}$ be based on a sample size $b$ drawn independent and identically distributed. + +In this case, the estimator proposed in Dodge et al. (2019) can be readily applied. The derivation is similar to Tang et al. (2020): + +$$ +\begin{array}{l} P r \left[ V _ {(b: b)} < v \right] = P r \left[ V \left(\pi_ {1}\right) \leq v \wedge \dots \wedge V \left(\pi_ {b}\right) \leq v \right] \\ = \prod_ {i = 1} ^ {b} P r [ V (\pi_ {i}) \leq v ], \tag {2} \\ \end{array} +$$ + +which we denote as $F^b(v)$ . Then + +$$ +\theta_ {b} = E \left[ V _ {(b: b)} \right] = \int_ {- \inf } ^ {\inf } v d F ^ {b} (v). \tag {3} +$$ + +Without loss of generality, assume $V(\pi_1) \leq \ldots \leq V(\pi_N)$ . To approximate the Cumulative Distribution Function (CDF), use Empirical Cumulative Distribution Function (ECDF) + +$$ +\hat {F} _ {N} ^ {b} (v) = \left(\frac {1}{N} \sum_ {i = 1} ^ {N} I \left[ V \left(\pi_ {i}\right) \leq v \right]\right) ^ {b} \tag {4} +$$ + +To arrive at the final estimator, replace CDF with an ECDF in Equation 3 + +$$ +\hat {\theta} _ {b} = \int_ {- \inf } ^ {\inf } v d \hat {F} _ {N} ^ {b} (v) \tag {5} +$$ + +which, by definition, evaluates to + +$$ +\hat {\theta} _ {b} = \frac {1}{N} \sum_ {i = 1} ^ {N} V \left(\pi_ {i}\right) \left(\hat {F} _ {N} ^ {b} \left(V \left(\pi_ {i}\right)\right) - \hat {F} _ {N} ^ {b} \left(V \left(\pi_ {i - 1}\right)\right) \right. \tag {6} +$$ + +To summarize, $\hat{\theta}_b$ corresponds to the estimated expected maximum performance given that (1) hyperparameters were randomly sampled from a pre-defined grid, (2) we could deploy $1\leq b\leq B$ policies out of $N$ for online evaluation, and (3) these $b$ policies were picked by uniform policy selection. + +The major advantage of this estimator is that, if our evaluation methodology satisfies all three conditions described above, then the computation within a single round of hyperparameter search is sufficient to construct a reliable estimate of expected online performance for different values of $b$ , without requiring any further experimentation (Dodge et al., 2019). Moreover, for a compact presentation, we can plot a graph over the entire range of values for $b$ , demonstrating the dependence between the final performance and online evaluation budget (Figure 2). + +Note, that there are alternative estimators for the quantity of interest (Tang et al., 2020). However, Dodge et al. (2022) compared different approaches for estimating the expected maximum and found that the employed estimator (Dodge et al., 2019) is favored amongst existing approaches in terms of both MSE criterion and a percent of incorrect conclusions. + +![](images/7e0f1c45c220f132c48a2050e87ae8b799bb22a5e8d9c29f8f76361025c5443c.jpg) +(a) CityLearn, Medium-1000 + +![](images/426b4d339d02608eebdb7fb5427159680e1e5abe4ad473f76a7c70a539630251.jpg) +(b) FinRL, High-1000 +Figure 3. Expected Online Performance graphs under uniform offline policy selection. The proposed EOP graph clearly demonstrates that preference between algorithms is budget dependent. Furthermore, it highlights that BC is often more favorable to offline RL algorithms under limited online evaluation budgets. Shadowed area represents one standard deviation. + +![](images/f24687e0df6df75480b7a4434f7050576312ec42bf3200490310c7c47ebde270.jpg) +(c) Industrial Benchmark, Medium-1000 + +# 4.2. Target Metric + +The target metric can be represented by any convenient measure used in literature, e.g., absolute policy performance or policy performance normalized by an expert (Fu et al., 2021a). In our case studies (Section 5), we rely on a modified version of the latter. The main motivation behind this modification is that the original metric is normalized by the value provided by a domain-specific expert (Fu et al., 2021a). However, the final results of offline RL algorithms are highly dependent on training data, and expecting to achieve expert performance while training on data from weak policies can be too optimistic. Therefore, we normalize by the performance of the best policy (as there can be multiple) that collected the training data. + +# 4.3. Online Evaluation Budget + +The original EVP makes it possible to use various quantities as an argument to the target metric, e.g. number of hyperparameters enumerated or training time. Similarly, for EOP in the deep ORL setting, several options can be used, such as the number of trajectories, number of timesteps, or number of policies. We suggest using the latter option, and equate the online evaluation budget $B$ with the number of policies deployed for online evaluation. This choice provides researchers with the flexibility of defining their own amount of computation for getting reliable estimates for policy values. + +# 4.4. Beyond Uniform Policy Selection + +In Section 4.1 we outlined an estimator of expected maximum performance under varied online evaluation budgets. Although, an assumption was made that besides randomly sampled hyperparameters, the policies are also selected uniformly. However, comparing deep ORL methods with different OPS methods is also of interest. + +Since the policies selected under an arbitrary strategy (e.g. + +Fitted-Q Evaluation (Le et al., 2019)) are generally not i.i.d, the plug-in estimator derived above would be invalid. However, one can still estimate the parameters of interest using a vanilla average estimator. + +$$ +\hat {\theta} _ {b} = \frac {1}{M} \sum_ {r = 1} ^ {M} \max \left(V _ {1} ^ {r},..., V _ {b} ^ {r}\right) \tag {7} +$$ + +where $M$ is a number of hyperparameter search rounds with offline policy selection, $V_{i}^{r}$ corresponds to an RV representing the result of online evaluation for the $i^{th}$ selected policy in round $r$ . Note that this estimator loses the appealing computational side of EVP, and requires multiple runs of hyperparameter search with offline policy selection. This makes it more expensive in terms of computing time. + +In one of our case studies (Section 5.3), we demonstrate how one could use EOP for comparing not only deep ORL algorithms, but OPS methods as well. + +# 5. Case Studies + +To further demonstrate the use of the proposed technique and to identify whether online evaluation budget changes the preference between deep ORL algorithms besides the environment analyzed in Section 3, we consider several case studies covering a range of decision-making problems: robotics, finances, and energy management. + +# 5.1. NeoRL, Robotic Tasks + +Continuing the closer look at the results presented in Qin et al. (2021) from Section 3, we build Expected Online Performance graphs for other robotics environments (Figure 2). This once again confirms that the preference is budget-dependent. Moreover, this is consistent across environments, dataset sizes, and policy levels (for a complete set of graphs, check the Appendix). There are many cases when the conclusion changes with a budget. For example, in the Walker-2d environment, CQL is clearly preferred to PLAS + +![](images/0131cfb72df2e76576d15db0c7521a9e3f02ba874797e00567ae9c6bd23089d6.jpg) +(a) CQL, CityLearn, Low-10000 + +![](images/18b1f1444c60b633658cf2a5bd184005095eef0560d68c936bd72d16efc52da2.jpg) +Figure 4. Inverse of Normalized Regret@K over varied online evaluation budgets. The suggested method can also be used for comparing offline policy selection methods. A similar pattern emerges – preference for OPS methods is also budget-dependent. Furthermore, uniform policy selection can be competitive under low budgets, and action difference performs reasonably well across a range of environments, dataset sizes, and policy levels. Shadowed area represents one standard deviation. + +![](images/69f5e4ba5b2a06c3d7886c5eb58d336cf14c998cd4b74daf8965e78cef513446.jpg) +(b) TD3+BC, CityLearn, Low-10000 +(c) CQL, FinRL, Low-1000 + +(Zhou et al., 2020), but only up to the 9-10 policies available for online evaluation. Another example can be seen in Figure 2b for the Hopper environment: Behavioral Cloning significantly outperforms its competitors at low budgets, but loses to PLAS at higher ones. The same holds for the HalfCheetah environment, where CQL starts to prevail at higher budgets. + +As the online budget is upper-bound by the total number of enumerated hyperparameters, it is clear (Figure 2) that different algorithms were tuned more or less excessively. This results in more optimistic results for one algorithm, and in more pessimistic for another. Consider BCQ (Le et al., 2019) in Figure 2a. It is tuned up to 13 hyperparameter assignments showing the best result, but as long as a competing algorithm, PLAS, is tuned for 14 and more assignments, it starts to outperform BCQ. An even more vivid example is depicted in Figure 2c, where MOPO (Yu et al., 2020) starts to outperform both BREMEN and CRR at $2\mathrm{x}$ more hyperparameters tested. Note that reporting just one policy value (either using online policy selection or proxy tasks) hides this issue. + +# 5.2. NeoRL and Other Domains + +To validate that our findings hold outside of the open-sourced experimental results provided by Qin et al. (2021), and to cover a wider range of decision-making problems, we benchmark CQL (Kumar et al., 2020), TD3+BC (Fujimoto & Gu, 2021), and BC on the CityLearn (Vázquez-Canteli et al., 2019), FinRL (Liu et al., 2020), and Industrial Benchmark (Hein et al., 2017) environments3. In addition, we make sure that the hyperparameter search budgets are equal for all the algorithms to avoid the issue described in the previous section. The hyperparameter grids were deferred to the Appendix B.2. We average mean returns over 100 + +evaluation trajectories and 3 seeds. + +In Figure 3, we see that Behavioral Cloning is quite competitive against both CQL and TD3+BC under limited online evaluation budgets. This akin to the results we observed in robotics environments (Figure 2), suggesting that BC is often more preferable in restricted settings to deep ORL algorithms. + +# 5.3. Offline Policy Selection + +As the EOP incorporates offline policy selection, we can also use it to compare how well OPS methods perform against each other. To do so, we use inverse of normalized Regret@K (in our case at $B$ ) as a target metric. This allows us to answer the following question: "If we were able to run policies corresponding to $k$ hyperparameter settings in the actual environment and get reliable estimates for their values that way, how far would the best in the set we picked be from the best of all hyperparameter settings considered?" (Paine et al., 2020). But instead of reporting one value of $k$ as in Paine et al. (2020), we can easily report on all the values of $B$ . Moreover, the estimator outlined in Section 4.1 can be used for presenting the results of uniform policy selection. + +We do not aim to benchmark and compare the entire myriad of offline policy selection approaches, but rather to demonstrate how one can use the proposed tool for such purposes. To do so, we test several methods on the environments from the previous section, namely $V(s_0)$ using FQE, TD-Error, and Action Difference (Le et al., 2019; Hussenot et al., 2021). + +The results can be found in Figure 4. First, we observe a pattern similar to the one described in Sections 3, 5.1, 5.2: preference between offline policy selection methods is also budget-dependent. Therefore, it is not enough to report the result of such methods under just one selected threshold. + +old. Second, there is no clear winner among all setups, as even TD-Error may sometimes perform good (Figure 4a, for more - check the Appendix). However, Action Difference often performs reasonably well across many dataset sizes and policy levels in Industrial Benchmark and CityLearn environments (Figures 4a, 4b). We hypothesize that such a selection method can serve as a post-training conservative regularizer (i.e. picking policies that are more similar to the behavioral ones), but that requires further investigation. And the last notable observation is that uniform policy selection can be competitive to other considered methods, especially when the online evaluation budget is limited. Sometimes it can even perform the best among the entire set of methods (Figure 4a). + +# 6. Related Work + +To the best of our knowledge, the closest concept to our work is deployment-constrained RL (Matsushima et al., 2020; Su et al., 2021). The core idea of this setting is to consider the number of policies deployed online and to reuse the data for iterative training from such deployments. Matsushima et al. (2020); Su et al. (2021) propose new algorithms that are especially suited for this setting, claiming that they are more deployment-efficient. However, they also relied on an extensive hyperparameter search reporting for the best set of hyperparameters. This hides the actual number of policies evaluated online, while our approach prevents that. An interesting direction for future work would be to adapt the EOP for this iterative setting as well. + +Konyushkova et al. (2021) formulated a new problem, which is an extension to OPS, Active Offline Policy Selection (AOPS). The major difference is to allow for an OPS method to have a feedback loop from newly trained policies deployed online, and re-adjust which policy should be run next. While this is an important step forward, EOP can actually subsume A-OPS as one of the OPS methods, since sequential policy testing is allowed. Furthermore, our paper aims to consolidate all the parts of a deep ORL pipeline, while Konyushkova et al. (2021) focuses on a new problem. + +Recently, Agarwal et al. (2022) scrutinized the evaluation methodology of deep RL algorithms, and advocated for a set of statistical tools to be employed for more reliable comparison. However, Agarwal et al. (2022) focuses on reliable evaluation after hyperparameter tuning, while our work highlights its importance in offline deep RL setting, and argues that results should be reported under varied hyperparameter tuning capacity when comparing deep ORL algorithms. + +Brandfonbrener et al. (2021b) noted the extensive online evaluation budgets used in recent works on deep ORL. To address this issue, comparison between algorithms was made + +under a small hyperparameter tuning budget ( $B = 4$ ). However, evaluating only under a limited budget may not be enough. Our paper demonstrates that the preference between algorithms can be budget-dependent, requiring evaluation under various budgets. + +There is a sizeable body of work on Offline Policy Evaluation (Voloshin et al., 2020; Fu et al., 2021b) and, specifically, on Offline Policy Selection (Paine et al., 2020; Hussenot et al., 2021; Yang et al., 2020). This work does not aim to compare or benchmark these types of methods, but to provide a procedure for comparing deep ORL algorithms with OPS (and promote the usage of simple uniform selection) for achieving reliable conclusions. In addition, we demonstrate that a similar pattern, online-budget dependence, is relevant for OPS methods as well. + +Behavioral Cloning is typically reported in deep ORL papers as a baseline, and many papers claim to beat this baseline (Kumar et al., 2020; Fujimoto & Gu, 2021; Kumar et al., 2019; Le et al., 2019; Wang et al., 2020; Wu et al., 2019). However, when considering learning from human demonstrations, Mandlekar et al. (2021) demonstrated the superiority of BC over deep ORL algorithms, especially when recurrence is employed in network architecture. Reinforcing the effectiveness of BC, this work suggests that BC is preferable not only in settings with human demonstrations, but across a diverse range of decision-making problems, given that the online evaluation budget is severely limited. + +# 7. Closing Remarks + +Motivation: While a lot of RL community efforts are focused on offline RL datasets' general evaluation, this paper questions the methods' performance under the entire spectrum of their hyperparameters and available resources. As different problems and contexts may allow for different online evaluation budgets, we argue that they can also make different optimal solutions possible within these constraints. We hope that the proposed evaluation technique and our findings will encourage the ORL community to report performance results under different online evaluation budgets. + +Limitations: Although this work emphasizes the importance of several online evaluations, it does not investigate the possible evaluation risks. Many real-world applications have critical corner cases, especially in the autonomous driving, healthcare, and finance domains (Riccio et al., 2020). We note that the EOP has limited applicability in such risk-sensitive scenarios due to its focus on maximum performance. + +Opportunities: EOP proposes a unified methodology for finding the best-performing setup under different online budget constraints. Unlike Deep Learning domains, the deep ORL evaluation is still in active development. The + +possibility of having a standard performance evaluation report opens avenues for adopting more precise methods for different tasks and contexts or creating online budget-dependent ORL algorithms. + +# 8. Conclusion + +A lot of community effort was recently devoted to developing new algorithms and datasets, while noting that the whole evaluation pipeline is still to be improved upon (Fu et al., 2021a; Gulcehre et al., 2021). In this work, we demonstrated (Section 3) one of the problems with such pipelines, and proposed a technique named EOP (Section 4.1) to address it when presenting the results of deep ORL algorithms. Several empirical results were found (Section 5): (1) Behavioral Cloning is often more favorable under a limited evaluation budget, (2) Online Policy Selection method preferences are also budget-dependent. + +# References + +Agarwal, R., Schwarzer, M., Castro, P. S., Courville, A., and Bellemare, M. G. Deep Reinforcement Learning at the Edge of the Statistical Precipice. arXiv:2108.13264 [cs, stat], January 2022. +Brandfonbrener, D., Whitney, W. F., Ranganath, R., and Bruna, J. Offline RL Without Off-Policy Evaluation. arXiv:2106.08909 [cs, stat], June 2021a. +Brandfonbrener, D., Whitney, W. F., Ranganath, R., and Bruna, J. Quantile Filtered Imitation Learning. arXiv:2112.00950 [cs, stat], December 2021b. +Chen, M., Beutel, A., Covington, P., Jain, S., Belletti, F., and Chi, E. H. Top-K Off-Policy Correction for a REINFORCE Recommender System. In Proceedings of the Twelfth ACM International Conference on Web Search and Data Mining, WSDM '19, pp. 456-464, New York, NY, USA, January 2019. Association for Computing Machinery. ISBN 978-1-4503-5940-5. doi: 10.1145/3289600.3290999. +Dodge, J., Gururangan, S., Card, D., Schwartz, R., and Smith, N. A. Show Your Work: Improved Reporting of Experimental Results. arXiv:1909.03004 [cs, stat], September 2019. +Dodge, J. et al. Expected Validation Performance and Estimation of a Random Variable's Maximum. 2022. +Fu, J., Kumar, A., Nachum, O., Tucker, G., and Levine, S. D4RL: Datasets for Deep Data-Driven Reinforcement Learning. arXiv:2004.07219 [cs, stat], February 2021a. +Fu, J., Norouzi, M., Nachum, O., Tucker, G., Wang, Z., Novikov, A., Yang, M., Zhang, M. R., Chen, Y., Kumar, + +A., Paduraru, C., Levine, S., and Paine, T. L. Benchmarks for Deep Off-Policy Evaluation. arXiv:2103.16596 [cs, stat], March 2021b. +Fujimoto, S. and Gu, S. S. A Minimalist Approach to Offline Reinforcement Learning. arXiv:2106.06860 [cs, stat], June 2021. +Fujimoto, S., Conti, E., Ghavamzadeh, M., and Pineau, J. Benchmarking Batch Deep Reinforcement Learning Algorithms. arXiv:1910.01708 [cs, stat], October 2019. +Gauci, J., Conti, E., Liang, Y., Virochsiri, K., He, Y., Kaden, Z., Narayanan, V., Ye, X., Chen, Z., and Fujimoto, S. Horizon: Facebook's Open Source Applied Reinforcement Learning Platform. arXiv:1811.00260 [cs, stat], September 2019. +Gulcehre, C., Wang, Z., Novikov, A., Paine, T. L., Colmenarejo, S. G., Zolna, K., Agarwal, R., Merel, J., Mankowitz, D., Paduraru, C., Dulac-Arnold, G., Li, J., Norouzi, M., Hoffman, M., Nachum, O., Tucker, G., Heess, N., and de Freitas, N. RL Unplugged: A Suite of Benchmarks for Offline Reinforcement Learning. arXiv:2006.13888 [cs, stat], February 2021. +Haarnoja, T., Zhou, A., Abbeel, P., and Levine, S. Soft Actor-Critic: Off-Policy Maximum Entropy Deep Reinforcement Learning with a Stochastic Actor. In International Conference on Machine Learning, pp. 1861-1870. PMLR, July 2018. +Hein, D., Depeweg, S., Tokic, M., Udluft, S., Hentschel, A., Runkler, T. A., and Sterzing, V. A benchmark environment motivated by industrial control problems. In 2017 IEEE Symposium Series on Computational Intelligence (SSCI), pp. 1-8, November 2017. doi: 10.1109/SSCI.2017.8280935. +Henderson, P., Islam, R., Bachman, P., Pineau, J., Precup, D., and Meger, D. Deep Reinforcement Learning That Matters. In Thirty-Second AAAI Conference on Artificial Intelligence, April 2018. +Hussenot, L., Andrychowicz, M., Vincent, D., Dadashi, R., Raichuk, A., Ramos, S., Momchev, N., Girgin, S., Marinier, R., Stafiniak, L., Orsini, M., Bachem, O., Geist, M., and Pietquin, O. Hyperparameter Selection for Imitation Learning. In Proceedings of the 38th International Conference on Machine Learning, pp. 4511-4522. PMLR, July 2021. +Irpan, A., Rao, K., Bousmalis, K., Harris, C., Ibarz, J., and Levine, S. Off-Policy Evaluation via Off-Policy Classification. arXiv:1906.01624 [cs, stat], November 2019. + +Konyushkova, K., Chen, Y., Paine, T. L., Gulcehre, C., Paduraru, C., Mankowitz, D. J., Denil, M., and de Freitas, N. Active Offline Policy Selection. arXiv:2106.10251 [cs, stat], December 2021. +Kostrikov, I., Thompson, J., Fergus, R., and Nachum, O. Offline Reinforcement Learning with Fisher Divergence Critic Regularization. arXiv:2103.08050 [cs], March 2021. +Kumar, A., Fu, J., Tucker, G., and Levine, S. Stabilizing Off-Policy Q-Learning via Bootstrapping Error Reduction. arXiv:1906.00949 [cs, stat], November 2019. +Kumar, A., Zhou, A., Tucker, G., and Levine, S. Conservative Q-Learning for Offline Reinforcement Learning. arXiv:2006.04779 [cs, stat], August 2020. +Le, H. M., Voloshin, C., and Yue, Y. Batch Policy Learning under Constraints. arXiv:1903.08738 [cs, math, stat], March 2019. +Levine, S., Kumar, A., Tucker, G., and Fu, J. Offline Reinforcement Learning: Tutorial, Review, and Perspectives on Open Problems. arXiv:2005.01643 [cs, stat], November 2020. +Liu, X.-Y., Yang, H., Chen, Q., Zhang, R., Yang, L., Xiao, B., and Wang, C. D. FinRL: A Deep Reinforcement Learning Library for Automated Stock Trading in Quantitative Finance. arXiv:2011.09607 [cs, q-fin], November 2020. +Mandlekar, A., Xu, D., Wong, J., Nasiriany, S., Wang, C., Kulkarni, R., Fei-Fei, L., Savarese, S., Zhu, Y., and Martin-Martín, R. What Matters in Learning from Offline Human Demonstrations for Robot Manipulation. arXiv:2108.03298 [cs], August 2021. +Matsushima, T., Furuta, H., Matsuo, Y., Nachum, O., and Gu, S. Deployment-Efficient Reinforcement Learning via Model-Based Offline Optimization. arXiv:2006.03647 [cs, stat], June 2020. +Paine, T. L., Paduraru, C., Michi, A., Gulcehre, C., Zolna, K., Novikov, A., Wang, Z., and de Freitas, N. Hyperparameter Selection for Offline Reinforcement Learning. arXiv:2007.09055 [cs, stat], July 2020. +Pomerleau, D. A. Efficient Training of Artificial Neural Networks for Autonomous Navigation. Neural Computation, 3(1):88-97, March 1991. ISSN 0899-7667. doi: 10.1162/neco.1991.3.1.88. +Qin, R., Gao, S., Zhang, X., Xu, Z., Huang, S., Li, Z., Zhang, W., and Yu, Y. NeoRL: A Near Real-World Benchmark for Offline Reinforcement Learning. arXiv:2102.00714 [cs], February 2021. + +Riccio, V., Jahangirova, G., Stocco, A., Humatova, N., Weiss, M., and Tonella, P. Testing machine learning based systems: a systematic mapping. Empirical Software Engineering, 25(6):5193-5254, 2020. ISSN 1382-3256. doi: 10.1007/s10664-020-09881-0. +Su, D., Lee, J. D., Mulvey, J. M., and Poor, H. V. MUSBO: Model-based Uncertainty Regularized and Sample Efficient Batch Optimization for Deployment Constrained Reinforcement Learning. arXiv:2102.11448 [cs], June 2021. +Tang, R. et al. Showing Your Work Doesn't Always Work. 2020. +Tang, X., Qin, Z. T., Zhang, F., Wang, Z., Xu, Z., Ma, Y., Zhu, H., and Ye, J. A Deep Value-network Based Approach for Multi-Driver Order Dispatching. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, KDD '19, pp. 1780-1790, New York, NY, USA, July 2019. Association for Computing Machinery. ISBN 978-1-4503-6201-6. doi: 10.1145/3292500.3330724. +Vázquez-Canteli, J. R., Kämpf, J., Henze, G., and Nagy, Z. CityLearn v1.0: An OpenAI Gym Environment for Demand Response with Deep Reinforcement Learning. In Proceedings of the 6th ACM International Conference on Systems for Energy-Efficient Buildings, Cities, and Transportation, BuildSys '19, pp. 356-357, New York, NY, USA, November 2019. Association for Computing Machinery. ISBN 978-1-4503-7005-9. doi: 10.1145/3360322.3360998. +Voloshin, C., Le, H. M., Jiang, N., and Yue, Y. Empirical Study of Off-Policy Policy Evaluation for Reinforcement Learning. arXiv:1911.06854 [cs, stat], February 2020. +Wang, Z., Novikov, A., Zolna, K., Springenberg, J. T., Reed, S., Shahriari, B., Siegel, N., Merel, J., Gulcehre, C., Heess, N., and de Freitas, N. Critic Regularized Regression. arXiv:2006.15134 [cs, stat], September 2020. +Wu, Y., Tucker, G., and Nachum, O. Behavior Regularized Offline Reinforcement Learning. arXiv:1911.11361 [cs, stat], November 2019. +Xin, X., Karatzoglou, A., Arapakis, I., and Jose, J. M. Self-Supervised Reinforcement Learning for Recommender Systems. In Proceedings of the 43rd International ACM SIGIR Conference on Research and Development in Information Retrieval, pp. 931-940. Association for Computing Machinery, New York, NY, USA, July 2020. ISBN 978-1-4503-8016-4. +Yang, M., Dai, B., Nachum, O., Tucker, G., and Schuurmans, D. Offline Policy Selection under Uncertainty. arXiv:2012.06919 [cs], December 2020. + +Yu, T., Thomas, G., Yu, L., Ermon, S., Zou, J., Levine, S., Finn, C., and Ma, T. MOPO: Model-based Offline Policy Optimization. arXiv:2005.13239 [cs, stat], November 2020. +Zhou, W., Bajracharya, S., and Held, D. PLAS: Latent Action Space for Offline Reinforcement Learning. arXiv:2011.07213 [cs], November 2020. + +# A. Target Metrics + +# A.1. Performance Normalized by the Best Policy in Training Data + +$$ +V _ {n o r m a l i z e d} (\pi) = \frac {V (\pi) - V (\pi_ {b e s t})}{V (\pi_ {b e s t})} +$$ + +where $\pi_{best}$ is the best performing policy of all the policies that collected the training data. We make sure that the performance is bigger than zero for all the environments. + +# A.2. Inversed Normalized Regret@K + +Given the true values of all $N$ policies, + +$$ +R e g r e t @ K = \frac {V (\pi) - V \left(\pi_ {w o r s t}\right)}{V \left(\pi_ {b e s t}\right) - V \left(\pi_ {w o r s t}\right)} +$$ + +where $\pi$ is the best performing policy among first $K$ ranked by a given offline policy selection method, $\pi_{best}$ is the best performing across all $N$ policies, and $\pi_{worst}$ is the worst performing across all $N$ policies. + +# B. Experimental Setup in Other Domains + +In Sections 5.2 and 5.3, we run an additional set of experiments with deep ORL algorithms. Here, we describe them in more details. All the resulting EOP graphs can be found in Figures 8, 9, 10. + +# B.1. Multi-Level Policies and Dataset Sizes + +We replicate a procedure from Qin et al. (2021) for obtaining behavioral policies and datasets collection: we run Soft Actor-Critic (Haarnoja et al., 2018) until convergence and extract from 2 to 3 checkpointed policies with varying levels of expertise: low, medium, and high. + +Afterwards, these policies are used to collect datasets of varying sizes. Similar to Qin et al. (2021), we use the 99-999-9999 trajectories scheme. However, we do not inject any randomization while collecting the datasets, making the setting closer to more stringent real-life setups. + +# B.2. On Hyperparameters + +To define the space of hyperparameters, we mimicked a procedure common among deep learning practitioners. For a given algorithm, we scan through relevant papers and extract values specified there. However, instead of taking specific hyperparameter assignments, we randomize across the extracted values, as the optimal choice is largely problem-dependent. The exact hyperparameter space can be found in Table 5. + +# B.2.1. CQL + +We use hyperparameter values mentioned in Kumar et al. (2020) and Qin et al. (2021). Actor and critic networks are the same as in Qin et al. (2021): two separate MLPs with 2 hidden layers and 256 units per layer. The implementation can be found in the attached source code. + +# B.2.2. TD3+BC + +For this algorithm, we rely on hyperparameters specified in Fujimoto & Gu (2021) and also extend it with learning rates from Kumar et al. (2020). Actor and critic networks are the same as in Fujimoto & Gu (2021): two separate MLPs with 2 hidden layers and 256 units per layer. The implementation can be found in the attached source code. + +# B.2.3. BC + +The search space for Behavioral Cloning is taken from Mandlekar et al. (2021) and Qin et al. (2021). The network architecture is the same as in the algorithms above. Note that we do not use early stopping as in Qin et al. (2021), but rather fix the number of gradient steps. + +# B.3. Environments, Baselines, and Datasets + +For a more precise picture of the high-dimensionality of the problems, we include the environment configurations table from Qin et al. (2021) below. + +Table 2. Environment configurations. Taken from Qin et al. (2021). + +
EnvironmentObservation ShapeAction ShapeHave DoneMax Timesteps
IB1823False1000
FinRL18130False2516
CL7414False1000
+ +As discussed in the main text, we reproduced the procedure from Qin et al. (2021) to train behavioral policies and generate datasets. We omitted the CityLearn high-level policy since we could not match the performance reported in Qin et al. (2021) in a reasonable amount of time. Online performance for the policies used in the paper is in Table 3. + +Table 3. Behavioral policies. + +
EnvironmentLow LevelMedium LevelHigh Level
Industrial Benchmark-323856-276379-234101
CityLearn2779732498-
FinRL221294446
+ +# B.4. On Offline Policy Selection methods + +After sampling $N$ hyperparameters, running an offline RL algorithm, and obtaining $N$ policies, $B$ of them are selected for online evaluation $\pi_1,\ldots ,\pi_B$ . Generally, the probability of being selected for each policy can be defined as $p(\pi_i|h_i,D_v,S)$ , where $h_i$ is a tuple of hyperparameters used for training policy $\pi_{i}$ , $D_{v}$ is a validation dataset, and $S$ is a offline policy selection strategy. + +There is a plethora of approaches to offline policy evaluation and selection (Irpan et al., 2019; Fu et al., 2021b; Voloshin et al., 2020). In this work, we utilize a few selection methods already utilized in the robotics domain: those based on value functions (Paine et al., 2020) and action distributions (Mandlekar et al., 2021). + +# B.4.1. UNIFORM + +Uniform Selection is an extremely simple baseline that corresponds to picking policies completely at random. It ignores all the information regarding the validation dataset. The probability of a policy $\pi_{i}$ being selected for online evaluation is simply proportional to the probability of its hyperparameters $p(h_{i})$ . + +$$ +p \left(\pi_ {i} \mid h _ {i}, D _ {v}, S = \text {u n i f o r m}\right) \propto p \left(h _ {i}\right) \tag {8} +$$ + +As we demonstrated in the main text, this naive strategy serves as a competitive baseline to other selection methods, has good computational properties, and is strongly linked with a comparison tool utilized in natural language processing problems (Dodge et al., 2019). + +# B.4.2. EXPECTED INITIAL STATE VALUE + +These selection methods estimate an expected value of the target policy $\pi_{i}$ for the initial state distribution $E_{s_0\sim D_V}[Q(s_0,\pi_i(s_0))]$ and re-rank the policies accordingly. The $Q$ function can be reused from a training process (e.g. a critic from Conservative Q-Learning) $-V(s_{0})$ using Critic, or be refitted using Fitted-Q Evaluation (Le et al., 2019) - we refer to it as $V(s_{0})$ using FQE. These methods were found to be superior to others in simulated robotic tasks (Paine et al., 2020). + +# B.4.3. TEMPORAL DIFFERENCE ERROR + +This approach uses an average of the temporal difference across all transition tuples $(s, a, r, s')$ in the validation dataset $E_{(s, a, r, s') \sim D_V} [r + \gamma Q(s', \pi_i(s')) - Q(s, a)]$ . The lower the error for a policy, the higher its rank. Note that this method is rather indicative of the critics' quality and was shown to perform poorly (Paine et al., 2020). However, we still include it to obtain more evidence in novel environments (as far as we know, this approach was not tested for + +our set of environments) and to probe its ability to extract policies that improve over the baseline rather than try to find the best one. + +# B.4.4. ACTION DIFFERENCE + +This method measures how good a trained policy $\pi_{i}$ matches the behavioral policy $\pi_{\mu}$ by estimating an average expected difference in action $E_{(s,a)\sim D_V}[(\pi_i(s) - a)^2]$ . The lower the discrepancy, the higher the trained policy is ranked. This method is expected to result in finding policies close to the behavioral, with no sudden drop in performance at the expense of lower expected improvement. + +# B.5. Computational Resources + +The experiments were run on a computational cluster with 14x NVIDIA Tesla V100, 256GB RAM, and Intel(R) Xeon(R) Gold 6154 CPU @ 3.00GHz (72 cores) for 13 days. + +# C. Why Spearman's Rank Correlation Can Be Misleading for Offline Policy Selection Methods + +In Section 5.3, we demonstrated how the proposed approach can be used for comparing OPS methods using Regret@K metric, highlighting that the preference between these methods is budget-dependent. + +However, it may be pointed out that this is not really needed, as Spearman's rank correlation is usually representative of the ranking quality for such methods. Here, we show how it can fail by giving two examples in Table 4. The second ranking is what we usually want in offline RL setting – getting the best policy with the least amount of online executions as possible. However, its rank correlation is significantly lower than for the first ranking. + +Table 4. An example where Spearman's rank correlation coefficient is not representative of the desiderata in deep ORL setting. + +
TRUE RANKINGRANKING#1RANKING#2
151
242
3310
429
518
667
776
885
994
10103
SPEARMAN’S RHO0.76-0.02
+ +Table 5. Hyperparameters search space. + +
AlgorithmsSearch Space
CQLvariant ∈ {H,ρ}α ∈ {5,10}τ ∈ {−1,2,5,10}approximate-max backup ∈ {True, False}actor alpha tuning ∈ {True, False}actor learning rate ∈ {3e−5,3e−4,1e−4,1e−3}critic learning rate ∈ {3e−4,1e−4,1e−3}tau ∈ {5e−3,1e−2}batch size ∈ {256,512}γ ∈ [0.9,1.0]number of gradient steps ∈ {3e5}
TD3+BCα ∈ {1.0,2.0,2.5,3.0,4.0}actor learning rate ∈ {3e−5,3e−4,1e−4,1e−3}critic learning rate ∈ {3e−4,1e−4,1e−3}tau ∈ {5e−3,1e−2}batch size ∈ {256,512}γ ∈ [0.9,1.0]number of gradient steps ∈ {3e5}
BCnum modes in gaussian mixture model ∈ {1,5,10,100}learning rate ∈ {1e−3,3e−4,1e−4}batch size ∈ {256,512}number of gradient steps ∈ {2e5}
+ +Spearman's Rho may punish what we typically care about more (the left side of the ranking), and appraise what we care about less (the right side of the ranking). Meanwhile, usage of Regret@K graphs helps to avoid this problem, capturing the left side. + +![](images/8a911e79c01b5af398c4a7f3c701421228044df6848f79870a4de519d5b6cd3c.jpg) +(a) High-Level Policy, 10000 + +![](images/79c8aea1f7b16a042b477a791c03728811bf932f00113486daea0c9e661816f6.jpg) +(b) High-Level Policy, 1000 + +![](images/9d5b7efddc17b8dccdc1460f6e5e3364822a7b2469722444c996caf14a8b2e2d.jpg) +(c) High-Level Policy, 100 + +![](images/e23630e472ece59f0f015b11c3d66dca73cb1a479bb596b8a567749950725df4.jpg) +(d) Medium-Level Policy, 10000 + +![](images/80ea510f6dd12f634eaa98744f5480021df8949e60ed314adfd66602c46f42be.jpg) +(e) Medium-Level Policy, 1000 + +![](images/42c731f03c5bff5405d1b5f2fd365f1ada40b6dac111ab42da3877500cdc7664.jpg) +(f)Medium-Level Policy,100 + +![](images/2a03ddf2a578fe55d3535c7b72e3afff3c2f11018de2d0bb0b0af51f7554a0e0.jpg) +(g) Low-Level Policy, 10000 + +![](images/cf80162c3736b5ecb9138671563bedd09b8703b0069aa95d8acc52060bece24e.jpg) +(h) Low-Level Policy, 1000 + +![](images/a64636e3b765131c39163db1c3c6b1538db9f5166a1a39cfa880a502f7e2d447.jpg) +(i) Low-Level Policy, 100 +Figure 5. Expected Online Performance under uniform policy selection. Walker2d-v3, a robotic task from Qin et al. (2021), the graphs are computed using their open-sourced online evaluations for different hyperparameter assignments. + +![](images/1736ab9718bc5a035543a298df98612e760c1e34d908c2b051913de1105afed6.jpg) +(a) High-Level Policy, 10000 + +![](images/13cd64f769978af911499840b1cbc9cab7cc4c9bd466a27891d12546ee685ea5.jpg) +(b) High-Level Policy, 1000 + +![](images/a80588a1734231dcf48fdfb084803c8d16cad05e8d4429d0757e618e9cb43443.jpg) +(c) High-Level Policy, 100 + +![](images/d0d84e52ebdf4f9aad9a577ccaaf5b08799a25989117494896ab33cb4879c7bf.jpg) +(d) Medium-Level Policy, 10000 + +![](images/7a8dd2c86d19db95620bbe366dbfee1e4ea28825b6ce2e951a7e87a008161637.jpg) +(e) Medium-Level Policy, 1000 + +![](images/354c1cb93cb44c9481298ae9a14f9d841e8732f6c6bb7240a4296a0cd9e23be0.jpg) +(f) Medium-Level Policy, 100 + +![](images/6fc050dceadc1221dcae645c71b7c801122d296dee5fb1eaf4c76c4d6277ac7c.jpg) +(g) Low-Level Policy, 10000 + +![](images/fa79a9980033b9f4ef28c7f8780d37050dbdb617832d544b2082efae6e3db76c.jpg) +(h) Low-Level Policy, 1000 + +![](images/b32cb30d2afc782cc2f4f2f929f63ca928fdbecbb273959520af8245f1806769.jpg) +(i) Low-Level Policy, 100 +Figure 6. Expected Online Performance under uniform policy selection. Hopper-v3, a robotic task from Qin et al. (2021), the graphs are computed using their open-sourced online evaluations for different hyperparameter assignments. + +![](images/768cd9a92ba3f0f570a37b38f68c984469a6447024bb9cdcab8c36257411bba5.jpg) +(a) High-Level Policy, 10000 + +![](images/e8cbfc1e6ae671653192c9d01d64fb5ad87e45fd53c9ec4b8f0018f08245c90c.jpg) +(b) High-Level Policy, 1000 + +![](images/6c371f9cda402cf932f0ec926af4927096b1997a549946bdd5b5e2b455536c86.jpg) +(c) High-Level Policy, 100 + +![](images/7f94a985db341ea4504b77625637ce1a996eadc8ab6789480f1131c3bf2d94a5.jpg) +(d) Medium-Level Policy, 10000 + +![](images/d33753c29a59fd16f0c83768d9f907ad7e8112f890725902da655a82d4782e9b.jpg) +(e) Medium-Level Policy, 1000 + +![](images/d22e7743f6b825f6139990b688fe5193b3e49338f657777078673e26b3a5f605.jpg) +(f)Medium-Level Policy,100 + +![](images/e4964d75438b666e8ed7f712b84cca48feb83fab7e1022783efc2f262b715fed.jpg) +(g) Low-Level Policy, 10000 + +![](images/2057e8216ff096cec2f362cff8a3eb9f6567252a7b196218063478e9ab2f840e.jpg) +(h) Low-Level Policy, 1000 + +![](images/503c5fecf52f41dede4f92808aef034b70f34fdd2d01d05157071fd4befcd4de.jpg) +(i) Low-Level Policy, 100 +Figure 7. Expected Online Performance under uniform policy selection. HalfCheetah-v3, a robotic task from Qin et al. (2021), the graphs are computed using their open-sourced online evaluations for different hyperparameter assignments. + +![](images/f2890c48955ca89e755602ec6315e3d76d6964b78b51bf3b2b5781d741875ada.jpg) +(a) High-Level Policy, 999 + +![](images/d6aa04c525341834fd36ae8be83e5b55c05c25591171b8669b2092318997c121.jpg) +(b) Medium-Level Policy, 999 + +![](images/acfa7c3499666b60c9d96d40128078fa400864297b9883f9128976095a173cca.jpg) +(c) Low-Level Policy, 999 + +![](images/9544afbc9100b6e0ec054b3b2bc4656a8a8cd5bf1d33d5a3e81e0762504d0d59.jpg) +(d) High-Level Policy, 99 + +![](images/0136fab0b1a0c2c7e8f1ce47a7951eff7fdcdb9f5a23842bf13ec1aaf58f384d.jpg) +(e)Medium-Level Policy,99 + +![](images/7314cc51c8e945f87ae6c240a99448910efa23c8a5f6017b774fdaae55213e23.jpg) +(f) Low-Level Policy, 99 +Figure 8. Expected Online Performance under uniform policy selection. FinRL, one of our experiments, comparing CQL, TD3+BC, and BC under equal amounts of online evaluation budgets. + +![](images/edec9d2babc757ea9f02fe5de6c7d2e84b341bfffa85fe968db7b853bbf92986.jpg) +(a) Medium-Level Policy, 9999 + +![](images/068f50604ed19d1e63b13053972d3b1d84089970059c84221b5b1c94b807452c.jpg) +(b) Medium-Level Policy, 999 + +![](images/078d0e3fa8bba288c6c8468b148671f2b455e5f8a27faf21410ad2f283125600.jpg) +(c) Medium-Level Policy, 99 + +![](images/cbcb0ca218720b0fe0ef5b43630ec7326f49eb0ebceae8c509f245a70aa534a0.jpg) +(d) Low-Level Policy, 9999 + +![](images/afef1476f61b68315748ebac6d92301d94a92053d6fb7cd185450bedcca86856.jpg) +(e) Low-Level Policy, 999 + +![](images/6d1ed39b45d26c243e184e88edbb1e83ec59f642e8ba26201b2a1722543a6a8b.jpg) +(f) Low-Level Policy, 99 +Figure 9. Expected Online Performance under uniform policy selection. CityLearn, one of our experiments, comparing CQL, TD3+BC, and BC under equal amounts of online evaluation budgets. + +![](images/171f25b5f64d019c3e80c9575cfa7ca2710191af809680128e9c754bea5853df.jpg) +(a) High-Level Policy, 9999 + +![](images/560b1acb4aacf0f56d0732b501f1172011e7f29e8f89c1b01e2a1d6081bdb40c.jpg) +(b) High-Level Policy, 999 + +![](images/6d5479e286cf396da15dc62a2f6527c9247e46b93b9d6f5c28d19f0ce21abe2b.jpg) +(c) High-Level Policy, 99 + +![](images/16140eba44a06fe7f5e1f7289c654c4f8e2044fd56c33a40421fac32f2006713.jpg) +(d) Medium-Level Policy, 9999 + +![](images/7eb34530abfb937191dec7e9ae40edc67247c1474ffd353db11f49e39d39c09d.jpg) +(e) Medium-Level Policy, 999 + +![](images/b5a073526e6012aaf1b3c29b73d0915366678e2b1d9894ffd31cebd1c29c0268.jpg) +(f) Medium-Level Policy, 99 + +![](images/bc56149d795c21407668b5e7ef2aa11fdafcab5188fac4d5c3d7f6c928f56bfa.jpg) +(g) Low-Level Policy, 9999 + +![](images/16a3da189fc71af118018c7af64d46db91aad44179ad7463388026a838048ec8.jpg) +(h) Low-Level Policy, 999 + +![](images/496146282fc1c4028f96622d6e82996916d79bb5c2e71d7ae8f75ca5dda3959a.jpg) +(i) Low-Level Policy, 99 +Figure 10. Expected Online Performance under uniform policy selection. Industrial Benchmark, one of our experiments, comparing CQL, TD3+BC, and BC under equal amounts of online evaluation budgets. + +![](images/9d8b8eb4462d0beb088cd9be4b50a69bfa0c8a1d6ab9fce55b9a1dd1c6b761b0.jpg) +(a) High-Level Policy, 999 + +![](images/4b8cd09912db8c1a6b1ad48e50a843bec324717729a8d01fb1d1b6d3fe61d461.jpg) +(b) Medium-Level Policy, 999 + +![](images/f2886f024befafb7e6ffa4bd9c41280b3743fb3d8ed98b958a7876b18bd8117e.jpg) +(c) Low-Level Policy, 999 + +![](images/aace31fefbe6dff7dbfb9a63e085e254565dde300a0aceae911636aa109a9d08.jpg) +(d) High-Level Policy, 99 + +![](images/69f623decb895477a518cbc536b628e069a1972e94df9776e08580350cbab405.jpg) +(e) Medium-Level Policy, 99 + +![](images/a786cd42d6c0d3b386ab3f146748190f8d1dd027fb0da502a341245cf4af0102.jpg) +(f) Low-Level Policy, 99 +Figure 11. CQL, FinRL. Inversed Normalized Regret under different offline policy selection methods using EOP graph. The shaded area represents one standard deviation + +![](images/96e13152c117fc89eeacf727e2faad57d39fc0d7acc6d990f4c3812d2b3701f6.jpg) +(a) Medium-Level Policy, 9999 + +![](images/a5e6ff8bcf14fc394f0af702fe9db8548468beb587e84482930dc3f6fa014571.jpg) +(b) Medium-Level Policy, 999 + +![](images/9ecd27749e9eefe2526bf36ae0afc334d802b54827c015853e84f5f660dc4f83.jpg) +(c) Medium-Level Policy, 99 + +![](images/254d5622f8cccd4e48180f16fa287102e5f288385bb1e93239586142fd4311e8.jpg) +(d) Low-Level Policy, 9999 + +![](images/4860f0712fb78d742405dbf1a483c50abfb20583a7e8e87ebf621c6ef670f9c6.jpg) +(e) Low-Level Policy, 999 + +![](images/864909b1091879892066412282c76774698d77df4a8910d5aff4250c66389dd5.jpg) +(f) Low-Level Policy, 99 +Figure 12. CQL, CityLearn. Inversed Normalized Regret under different offline policy selection methods using EOP graph. The shaded area represents one standard deviation + +![](images/69990553e6ad3db9329197268884bc6141161bca59d050bc5c98bff61a3924e1.jpg) +(a) High-Level Policy, 9999 + +![](images/3bd0c3fa5f9696b68febd5153387ad0b8ee58baeeb374f234d471d34c1eb0192.jpg) +(b) High-Level Policy, 999 + +![](images/cebe59c1c65eee30f6a79688915fdc3257ed7a30849be0bae90049d3cb6d6c88.jpg) +(c) High-Level Policy, 99 + +![](images/d75b54dceb6eefa6c9514008bbad15c343146cc9345edc171afc357b0b03acb9.jpg) +(d) Medium-Level Policy, 9999 + +![](images/753631f16a837270feb91213e4d0be9704780836497c6a2d1311be1404bf3340.jpg) +(e) Medium-Level Policy, 999 + +![](images/eb7577ab40e435f3bd284864ca2eb5e6e41bae13348ad22f5f9ec8b78aca9c65.jpg) +(f) Medium-Level Policy, 99 + +![](images/31ed0ead51de7a248c1fcdd7d865b965bf081e9b406224bb0c1038bf09517586.jpg) +(g) Low-Level Policy, 9999 + +![](images/9a7c99b981ad9165d22ae98fd0f23598bc47cfa43963778ee88ad95ac628d4cd.jpg) +(h) Low-Level Policy, 999 + +![](images/f4a1e886cdfb6a13b2d1367d9e13868ff44ca33e768791dfed5a718be2aeeecc.jpg) +(i) Low-Level Policy, 99 +Figure 13. CQL, Industrial Benchmark. Inversed Normalized Regret under different offline policy selection methods using EOP graph. The shaded area represents one standard deviation + +![](images/0f549b6e36ff660fdd0eaaef77836ded95fc61901f268c0e1fdab3580faa65c2.jpg) +(a) High-Level Policy, 999 + +![](images/c7823b38b321ff48bddbe062737db4feb3e66a2ab876cfe4dbde33d50aca59a8.jpg) +(b) Medium-Level Policy, 999 + +![](images/93158c808ce641e1fab690d9c7c1a8c19ee4a73827b5db84711db5d8d9e69cea.jpg) +(c) Low-Level Policy, 999 + +![](images/302fb63d72621ab223c3b4bf3f1e54d329ad741fffe4d129f1e9f42ecd826260.jpg) +(d) High-Level Policy, 99 + +![](images/b515a6e1223cf21f30a75e89b1b516e9d34923ba9f4a11f12602069fcd8abb2f.jpg) +(e) Medium-Level Policy, 99 + +![](images/8ac813b73a9268aef77bd92fbae29369020260fb848517a5af5be0ac0b45bfc1.jpg) +(f) Low-Level Policy, 99 +Figure 14. TD3+BC, FinRL. Inversed Normalized Regret under different offline policy selection methods using EOP graph. The shaded area represents one standard deviation + +![](images/f6c2c686a5a6b5de3bd4ab8993a019bdc322ad6920988f488c2b409bc4cdf250.jpg) +(a) Medium-Level Policy, 9999 + +![](images/03ed330789a053dc6808adcc0067545b6d7e2480ef0d9761fb175cba6eb34158.jpg) +(b) Medium-Level Policy, 999 + +![](images/94563f03273f9437e09eb7a8ed4762a13b81b49c838efb33b9469c53195123f4.jpg) +(c) Medium-Level Policy, 99 + +![](images/a2c717ffad2e147e13a5a8c9254d8ddf96ce7a4355958a334d7f879f0fb52115.jpg) +(d) Low-Level Policy, 9999 + +![](images/65053ed0ef3e1620324f5b1322b10fa17cd2e3332d70b8163bcbe9cf5f95783c.jpg) +(e) Low-Level Policy, 999 + +![](images/2b753f0ba55b27429a40117be48f35fb0d2323e62a76495adfdfa3819fbba754.jpg) +(f) Low-Level Policy, 99 +Figure 15. TD3+BC, CityLearn. Inversed Normalized Regret under different offline policy selection methods using EOP graph. The shaded area represents one standard deviation + +![](images/9793cd28869c9172ad5a4d27f63fa49acfe17b33a45d42a49c2575d03d3a6c59.jpg) +(a) High-Level Policy, 9999 + +![](images/ca9fce1a85cfd7155f259c9234e9270934fc8e78e16e7833b74ed996a8f735a4.jpg) +(b) High-Level Policy, 999 + +![](images/1fb2ae7b6ac8b23a43f207acd15c9916939eab046a43611900b65d08a0660b27.jpg) +(c) High-Level Policy, 99 + +![](images/1dd9ecfeb144b120dd07f6fd726bf2d76ac3ff8a15fc44bc79a4032e20a9c54b.jpg) +(d) Medium-Level Policy, 9999 + +![](images/2a2dd99abdc7569853fae841b1ee4436a00c62e22e74061f5ff44187c7f525e8.jpg) +(e) Medium-Level Policy, 999 + +![](images/4382bf7b5aeb114761093e39e00fc9c6a72b9bae33b7cf21fd87a7709c7b8cf7.jpg) +(f) Medium-Level Policy, 99 + +![](images/fa0c29d09731e6cde6bc4c326c8eb6173edf9c1a4eadf8e57ea959cce4133f70.jpg) +(g) Low-Level Policy, 9999 + +![](images/60efebb476413eaf0909b0a05ace8b10a5f6dd6d9ef13f4ac54793156516dd39.jpg) +(h) Low-Level Policy, 999 + +![](images/fc3293facc261b7adbe40081f3bac8210cd6cb2129e30c58e1c2f940111dd971.jpg) +(i) Low-Level Policy, 99 +Figure 16. TD3+BC, Industrial Benchmark. Inversed Normalized Regret under different offline policy selection methods using EOP graph. The shaded area represents one standard deviation + +![](images/30bec3795c49813d63cca41d761b78b646ea09d1ebde2164d5daac01c2afdc97.jpg) +(a) High-Level Policy, 999 + +![](images/a72d3936bf7c7fe11e314588e7498f2e496e68315099c33207e88e0cce2763bd.jpg) +(b) Medium-Level Policy, 999 + +![](images/6be39ab01bb8a06aa1edb697b6eff01d05b65abe030df2be9859b7113e062770.jpg) +(c) Low-Level Policy, 999 + +![](images/5703b52f6a02198382bef27451f90e94c41633408178588c043f243a7a7aceae.jpg) +(d) High-Level Policy, 99 + +![](images/bb5a67d6e0a6a8ed324ead49507d561de58624c40ab9bb82a6c5cde3a4353c45.jpg) +(e) Medium-Level Policy, 99 + +![](images/adb5b23ac5bab0a833933fcdaa0891038d38b41c3edb8bedcba96d3927bb3a0b.jpg) +(f) Low-Level Policy, 99 +Figure 17. BC, FinRL. Inversed Normalized Regret under different offline policy selection methods using EOP graph. The shaded area represents one standard deviation + +![](images/1beecbf8f6c105de82fd73ac8ced150d20efa802dfea9e7dbcfa43d1d35c7a86.jpg) +(a) Medium-Level Policy, 9999 + +![](images/2a2fec43cc85fa579ab553cbcd66f466d0a152b9235df4fd381db1907f701943.jpg) +(b) Medium-Level Policy, 999 + +![](images/2e98cb5c25f14fea8078757dec9fd106c5ad2bd29ffc3e2b6616bca8eb176248.jpg) +(c) Medium-Level Policy, 99 + +![](images/8c02b3eea21d1a85913b311a174d318c43b02bcef8d99ac625b0297093856dfb.jpg) +(d) Low-Level Policy, 9999 + +![](images/236dc3ef445e6ce3c78b030c476e70bac8334e6f6dd38f26249dd7c26f1a941b.jpg) +(e) Low-Level Policy, 999 + +![](images/a3413e3852ceb5cb87fd256bcfc5d3d11093edbcbde8e8acf05e0bf8330dce15.jpg) +(f) Low-Level Policy, 99 +Figure 18. BC, CityLearn. Inversed Normalized Regret under different offline policy selection methods using EOP graph. The shaded area represents one standard deviation + +![](images/c7199b025ec51fbd09ebd079d3cf02191a37cd12c3d92f0436f50aee13c3d49c.jpg) +(a) High-Level Policy, 9999 + +![](images/61d24ccc11aed0c15a8a306272fcba4e0e12b95649a6912060f2dae739ad6eb7.jpg) +(b) High-Level Policy, 999 + +![](images/d0c2c024978807dacf4ca3982419139ab557d27c70018ba1f4b9ad03838cfb67.jpg) +(c) High-Level Policy, 99 + +![](images/5ee66d7046c08d19618e7079611cc066152265ddb5c21b6c69bbd4d44b150634.jpg) +(d) Medium-Level Policy, 9999 + +![](images/67dd77d8369c9cca5969d23d12c398fe6c60c282ac2dd5ee22be601c64d9f685.jpg) +(e) Medium-Level Policy, 999 + +![](images/9ef8ea2f1d2bca8ecec829addbbba763824eaf50f5859bbc6a93927c6bdaedfb.jpg) +(f) Medium-Level Policy, 99 + +![](images/3b615be322b1f13ecb34c200b3b63bd918ed6f0e3e3a7e8d3c54962a5d50952b.jpg) +(g) Low-Level Policy, 9999 + +![](images/04cc130d246e480d599aba4b61815476ff271db611308d0a110f642f089298db.jpg) +(h) Low-Level Policy, 999 + +![](images/5624cd8a98a23a26a2b524bece752e876576d40e54f77eea00704f41b16c3de8.jpg) +(i) Low-Level Policy, 99 +Figure 19. BC, Industrial Benchmark. Inversed Normalized Regret under different offline policy selection methods using EOP graph. The shaded area represents one standard deviation \ No newline at end of file diff --git a/showingyourofflinereinforcementlearningworkonlineevaluationbudgetmatters/images.zip b/showingyourofflinereinforcementlearningworkonlineevaluationbudgetmatters/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..d7f57dd770079f87b17617530cc004095e4b4be1 --- /dev/null +++ b/showingyourofflinereinforcementlearningworkonlineevaluationbudgetmatters/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:67c3abefe27580b0cb7cf69bd350bfa77e6ff3af5697082fa0b39e5f246a572e +size 1930687 diff --git a/showingyourofflinereinforcementlearningworkonlineevaluationbudgetmatters/layout.json b/showingyourofflinereinforcementlearningworkonlineevaluationbudgetmatters/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..c3124f98c0bc558a666102e6a7152fcc031b05d0 --- /dev/null +++ b/showingyourofflinereinforcementlearningworkonlineevaluationbudgetmatters/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:89206700c3bd4088b3d6264dee4e9902ff28aaaee70e63f0f62399ab5d5c0dec +size 834541 diff --git a/shuffleprivatelinearcontextualbandits/d6e91d3d-094b-4a56-83d9-ecc94f48fb20_content_list.json b/shuffleprivatelinearcontextualbandits/d6e91d3d-094b-4a56-83d9-ecc94f48fb20_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..bd23d6bf340218a4b772bdf19374c494cf3aa93b --- /dev/null +++ b/shuffleprivatelinearcontextualbandits/d6e91d3d-094b-4a56-83d9-ecc94f48fb20_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bc3e57ef28d49c8a719d49e06658b3ce288b046c0d895d1029a2f1d8402e06b8 +size 191300 diff --git a/shuffleprivatelinearcontextualbandits/d6e91d3d-094b-4a56-83d9-ecc94f48fb20_model.json b/shuffleprivatelinearcontextualbandits/d6e91d3d-094b-4a56-83d9-ecc94f48fb20_model.json new file mode 100644 index 0000000000000000000000000000000000000000..15fd021fc0b75c857c00492584462cfa72a9e0d6 --- /dev/null +++ b/shuffleprivatelinearcontextualbandits/d6e91d3d-094b-4a56-83d9-ecc94f48fb20_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9d9875f969410968c33da50fba12e300009ce65a83d3bba48656acc197621ff4 +size 227049 diff --git a/shuffleprivatelinearcontextualbandits/d6e91d3d-094b-4a56-83d9-ecc94f48fb20_origin.pdf b/shuffleprivatelinearcontextualbandits/d6e91d3d-094b-4a56-83d9-ecc94f48fb20_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..6daba6a6c28a55e3cf8e3b3880e46101b982f061 --- /dev/null +++ b/shuffleprivatelinearcontextualbandits/d6e91d3d-094b-4a56-83d9-ecc94f48fb20_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:af77ad934dff537fb83c04c007e2bab88daee39b6e55fb05f63a9c0342fb632f +size 9169205 diff --git a/shuffleprivatelinearcontextualbandits/full.md b/shuffleprivatelinearcontextualbandits/full.md new file mode 100644 index 0000000000000000000000000000000000000000..b1f9605060d15e52207991baeb42bd1b677b8a76 --- /dev/null +++ b/shuffleprivatelinearcontextualbandits/full.md @@ -0,0 +1,904 @@ +# Sayak Ray Chowdhury $^{*1}$ Xingyu Zhou $^{*2}$ + +# Abstract + +Differential privacy (DP) has been recently introduced to linear contextual bandits to formally address the privacy concerns in its associated personalized services to participating users (e.g., recommendations). Prior work largely focus on two trust models of DP – the central model, where a central server is responsible for protecting users' sensitive data, and the (stronger) local model, where information needs to be protected directly on users' side. However, there remains a fundamental gap in the utility achieved by learning algorithms under these two privacy models, e.g., if all users are unique within a learning horizon $T$ , $\widetilde{O}(\sqrt{T})$ regret in the central model as compared to $\widetilde{O}(T^{3/4})$ regret in the local model. In this work, we aim to achieve a stronger model of trust than the central model, while suffering a smaller regret than the local model by considering recently popular shuffle model of privacy. We propose a general algorithmic framework for linear contextual bandits under the shuffle trust model, where there exists a trusted shuffler – in between users and the central server – that randomly permutes a batch of users data before sending those to the server. We then instantiate this framework with two specific shuffle protocols – one relying on privacy amplification of local mechanisms, and another incorporating a protocol for summing vectors and matrices of bounded norms. We prove that both these instantiations lead to regret guarantees that significantly improve on that of the local model, and can potentially be of the order $\widetilde{O}(T^{3/5})$ if all users are unique. We also verify this regret behavior with simulations on synthetic data. Finally, under the practical scenario of non-unique users, we show that the regret of our shuffle private algorithm scale as $\widetilde{O}(T^{2/3})$ , which matches what the + +central model could achieve in this case. + +# 1. Introduction + +In the linear contextual bandit problem (Auer, 2003; Chu et al., 2011), a learning agent observes the context information $c_{t}$ of an user at every round $t$ . The goal is to recommend an action $a_{t}$ to the user so that the resulting reward $y_{t}$ is maximized. The mean reward is given by a linear function of an unknown parameter vector $\theta^{*} \in \mathbb{R}^{d}$ , $d \in \mathbb{N}$ , i.e., + +$$ +\mathbb {E} \left[ y _ {t} \mid c _ {t}, a _ {t} \right] = \left\langle \theta^ {*}, \phi \left(c _ {t}, a _ {t}\right) \right\rangle , +$$ + +where $\phi : \mathcal{C} \times \mathcal{X} \to \mathbb{R}^d$ maps a context-action pair to a $d$ -dimensional feature vector, and $\langle \cdot, \cdot \rangle$ denotes the standard Euclidean inner product. The context and action sets $\mathcal{C}$ and $\mathcal{X}$ are arbitrary, and can also possibly be varying with time. An agent's performance over $T$ rounds is typically measured through the cumulative pseudo-regret + +$$ +\mathrm {R e g} (T) = \sum_ {t = 1} ^ {T} \left[ \max _ {a \in \mathcal {X}} \langle \theta^ {*}, \phi (c _ {t}, a) \rangle - \langle \theta^ {*}, \phi (c _ {t}, a _ {t}) \rangle \right], +$$ + +which is the total loss suffered due to not recommending the actions generating highest possible rewards corresponding to observed contexts. This framework has found applications in many real-life settings such as internet advertisement selection (Abe et al., 2003), article recommendation in web portals (Li et al., 2010), mobile health (Tewari & Murphy, 2017), to name a few. The general applicability of this framework has motivated a line of work (Shariff & Sheffet, 2018; Zheng et al., 2020) studying linear contextual bandit problems under the additional constraint of differential privacy (Dwork, 2008), which guarantees that the users' contexts and generated rewards will not be inferred by an adversary during this learning process. + +To illustrate the privacy concern in the contextual bandit problem, let us consider a mobile medical application in which an mobile app recommends a tailored treatment plan (i.e., action) to each patient (i.e., user) based on her personal information such as age, weight, height, medical history etc. (i.e., context). Meanwhile, this mobile app's recommendation algorithm also needs to be updated once in a while in a cloud server after collecting data from a batch of patients, including treatment outcomes (i.e., rewards) + +and contexts, which are often considered to be private and sensitive information. Hence, each patient would like to obtain a personalized and effective treatment plan while guaranteeing their sensitive information remains protected against a potential adversarial attack in this interactive process. Protection of privacy is typically achieved by injecting sufficient noise in users' data (Arora et al., 2014; Xin & Jaakkola, 2014), which results in a loss in utility (i.e., an increase in regret) of the recommended action. Hence, the key question is how to balance utility and privacy carefully. + +This has motivated studies of linear contextual bandits under different trust models of differential privacy (i.e., who the user will trust with her sensitive data). On one end of the spectrum lies the central model, which guarantees privacy to users who trust the learning agent to store their raw data in the server and use those to update its strategy of recommending actions. Under this trust model, Shariff & Sheffet (2018) has shown that the cumulative regret is $\widetilde{O} \left( \frac{\sqrt{T} (\log(1 / \delta))^{1/4}}{\sqrt{\varepsilon}} \right)$ , where $\varepsilon$ and $\delta$ are privacy parameters with smaller values denoting higher level of protection. Perhaps unsurprisingly, this regret bound - due to the high degree of trust - matches the optimal $\Theta(\sqrt{T})$ scaling for non-private linear contextual bandits (Chu et al., 2011). However, this relatively high trust model is not always feasible since the users may not trust the agent at all. This is captured by the local model, where any data sent by the users must already be private, and the agent can only store those randomized data in the server. This is a strictly stronger notion of privacy, and hence, often comes at a price. Under this trust model, Zheng et al. (2020) has shown that the cumulative regret is $\widetilde{O} \left( \frac{T^{3/4} (\log(1 / \delta))^{1/4}}{\sqrt{\varepsilon}} \right)$ , which, as expected, is much worse than that in the central model. This naturally leads to the following question: + +# Can a finer trade-off between privacy and regret in linear contextual bandits be achieved? + +Furthermore, in both Shariff & Sheffet (2018) and Zheng et al. (2020), the learning agents update their strategy at every round. This not only puts excessive computational burden on the server (due to $T$ updates each taking at least $O(d^2)$ time and memory) but also could be practically infeasible at times. For example, consider the above mobile health application. The cloud server is often infeasible to update the algorithm deployed in mobile app after interactions with each single user. Rather, a more practical strategy is to update the algorithm after collecting a batch of users' data (e.g., a one-month period of data). + +Motivated by these, we consider the linear contextual bandit problem under an intermediate trust model of differential privacy, known as the shuffle model (Cheu et al., 2019; Erlingsson et al., 2019) in the hope to attain a finer regret-privacy trade-off, while only using batch updates. In this new trust model, there exists a shuffler between users and the central server which permutes a batch of users' random + +ized data before they are viewed by the server so that it can't distinguish between two users' data. Shuffling thus adds an another layer of protection by decoupling data from the users that sent them. Here, as in the local model, the users don't trust the server. However, it is assumed that they have a certain degree of trust in the shuffler since it can be efficiently implemented using cryptographic primitives (e.g., mixnets) due to its simple operation (Bittau et al., 2017; Apple, 2017). The shuffle model provides the possibility to achieve a stronger privacy guarantee than the central model while suffering a smaller utility loss than the local model. The key intuition behind this is that the additional randomness of the shuffler creates a privacy blanket (Balle et al., 2019b) so that each user now needs much less random noise to hide her information in the crowd. Indeed, the shuffle model achieves a better trade-off between utility and privacy as compared to central and local model in several learning problems such as empirical risk minimization (Girgis et al., 2021), stochastic convex optimization (Lowy & Razaviyayn, 2021; Cheu et al., 2021), and standard multi-arm bandits (Tenenbaum et al., 2021). However, little is known about (linear) contextual bandits in the shuffle model due to its intrinsic challenges. That is, in addition to rewards, the contexts are also sensitive information that need to be protected, which not only results in the aforementioned large gap in regret between local and central model1, but also leads to new challenges in the shuffle model. Against this backdrop, we make the following contributions: + +- We design a general algorithmic framework (Algorithm 1) for private linear contextual bandits in the shuffle model. It decomposes the learning process into three black-box components: a local randomizer at each user, an analyzer at the central server and a shuffler in-between. We instantiate the framework with two specific shuffle protocols. The first one directly builds on privacy amplification of existing local mechanisms. The other one utilizes an efficient mechanism for summing vectors with bounded $\ell_2$ norms. + +- We show that both shuffle protocols provide stronger privacy protection compared to the central model. Furthermore, when all users are unique, we prove a regret bound of $\widetilde{O}\left(T^{3/5}\right)$ for both the protocols, which improves over the $\widetilde{O}\left(T^{3/4}\right)$ regret of local model. Hence, we achieve a finer trade-off between regret and privacy. We further perform simulations on synthetic data that corroborate our theoretical results. + +- As a practical application of our general framework, we show that under the setting of non-unique or returning users, the regret of both our shuffle protocols matches the one that the central model would achieve in the + +same setting. This, along with the fact that both shuffle protocols also offer a certain degree of local privacy, further elaborate usefulness of shuffle model in private linear contextual bandits. + +Related work. Due to the utility gap present between central and local models, a significant body of recent work have focused on the shuffle model (Balle et al., 2019b; Feldman et al., 2020; Ghazi et al., 2019; Balle et al., 2019a). A nice overview of recent work in the shuffle model is presented in Cheu (2021). Regret performance of multi-armed bandit algorithms under central and local trust models have been considered in Mishra & Thakurta (2015); Sajed & Sheffet (2019); Ren et al. (2020a); Chen et al. (2020); Zhou & Tan (2020); Dubey (2021); Tossou & Dimitrakakis (2017), whereas online learning algorithms under full information have appeared in Guha Thakurta & Smith (2013); Agarwal & Singh (2017). Recently, the two models have also been adopted to design differentially private control and reinforcement learning algorithms (Vietri et al., 2020; Garcelon et al., 2020; Chowdhury et al., 2021; Chowdhury & Zhou, 2021). Han et al. (2021) consider linear bandits with stochastic contexts, and show that $\widetilde{O} (\sqrt{T} /\varepsilon)$ regret can be achieved even in the local model. In contrast, in this work, we allow the contexts to be arbitrary and can even be adversarily generated, which pose additional challenges. + +Batched linear bandits are studied in Han et al. (2020); Ren et al. (2020b), where the authors show that only $O(\sqrt{T})$ model update is sufficient to achieve corresponding minimax optimal regrets. In the shuffle private model, batched learning not only reduces the model update frequency, but more importantly plays a key role in amplifying privacy via shuffling a batch of users' data. Interestingly, as a byproduct, our established generic regret bound also improves over the non-private one in Ren et al. (2020b) in the sense that no restriction is required for the regularizer. + +Concurrent and independent work. While preparing this submission, we have noticed that Garcelon et al. (2021) also study linear contextual bandits in the shuffle model. The authors claim that a single fixed batch schedule is not sufficient to obtain a better regret-privacy trade-off in shuffle model. They propose to use separate asynchronous schedules – a fixed batch scheme for the shuffler and an adaptive model update scheme for the server. In contrast, thanks to a tighter analysis, we show that a single fixed batch schedule is indeed sufficient to attain the same regret-privacy trade-off in shuffle model. Moreover, we believe, there exists a fundamental gap in their analysis for the adaptive model update, which might make their results ungrounded. We provide a detailed discussion on this in Section 6, which highlights the key difference in dealing with adaptive update in the non-private and the private settings. Finally, in addition to the above differences in theoretical results, our + +established generic framework enables to design flexible shuffle private protocols for linear contextual bandits that are able to handle a wide range of practically interested privacy budget $\varepsilon$ rather than a restricted small value $\varepsilon \ll 1$ in the concurrent work (Garcelon et al., 2021). + +# 2. Privacy in the Shuffle Model + +In this section, we introduce the shuffle model, and its corresponding privacy notion called the shuffle differential privacy. Before that, we recall definitions of differential privacy under central and local models (Dwork et al., 2014). + +# 2.1. Central and Local Differential Privacy + +Throughout, we let $\mathcal{D}$ denote the data universe, and $n\in \mathbb{N}$ the number of (unique) users. Let $D_{i}\in \mathcal{D},i = 1,2,\ldots ,n$ denote the data point of user $i$ , and $D_{-i}\in \mathcal{D}^{n - 1}$ denote collection of data points of all but the $i$ -th user. Let $\varepsilon >0$ and $\delta \in (0,1]$ be given privacy parameters. + +Definition 2.1 (Differential Privacy (DP)). A mechanism $\mathcal{M}$ satisfies $(\varepsilon, \delta)$ -DP if for each user $i \in [n]$ , each data set $D, D' \in \mathcal{D}^n$ , and each event $\mathcal{E}$ in the range of $\mathcal{M}$ , + +$$ +\mathbb {P} \left[ \mathcal {M} \left(D _ {i}, D _ {- i}\right) \in \mathcal {E} \right] \leqslant \exp (\varepsilon) \mathbb {P} \left[ \mathcal {M} \left(D _ {i} ^ {\prime}, D _ {- i}\right) \in \mathcal {E} \right] + \delta . +$$ + +Definition 2.2 (Local Differential Privacy (LDP)). A mechanism $\mathcal{M}$ satisfies $(\varepsilon, \delta)$ -LDP if for each user $i \in [n]$ , each data point $D_i$ , $D_i' \in \mathcal{D}$ and each event $\mathcal{E}$ in the range of $\mathcal{M}$ , + +$$ +\mathbb {P} \left[ \mathcal {M} \left(D _ {i}\right) \in \mathcal {E} \right] \leqslant \exp (\varepsilon) \mathbb {P} \left[ \mathcal {M} \left(D _ {i} ^ {\prime}\right) \in \mathcal {E} \right] + \delta . +$$ + +Roughly speaking, a central DP (or, simply, DP) mechanism ensures that the outputs of the mechanism on two neighbouring data sets (i.e., those differ only on one user) are approximately indistinguishable. In contrast, local DP ensures that the output of the local mechanism for each user is indistinguishable. + +# 2.2.Shuffle Differential Privacy + +A (standard) shuffle protocol $\mathcal{P} = (\mathcal{R},\mathcal{S},\mathcal{A})$ consists of three parts: (i) a (local) randomizer $\mathcal{R}$ , (ii) a shuffler $\mathcal{S}$ and (iii) an analyzer $\mathcal{A}$ . For $n$ users, the overall protocol works as follows. Each user $i$ first applies the randomizer on its raw data $D_{i}$ and then sends the resulting messages $\mathcal{R}(D_i)$ to the shuffler. The shuffler $\mathcal{S}$ permutes messages from all the users uniformly at random and then reports the permuted messages $\mathcal{S}(\mathcal{R}(D_1),\ldots ,\mathcal{R}(D_n))$ to the analyzer. Finally, the analyzer $\mathcal{A}$ computes the output using received messages. In this protocol, the users trust the shuffler but not the analyzer. Hence, the privacy objective is to ensure that the outputs of the shuffler on two neighbouring datasets are indistinguishable in the analyzer's view. To this end, define the mechanism $(\mathcal{S}\circ \mathcal{R}^n)(D)\coloneqq \mathcal{S}(\mathcal{R}(D_1),\dots ,\mathcal{R}(D_n))$ where $D\in \mathcal{D}^n$ . + +Definition 2.3 (Shuffle differential privacy (SDP)). A protocol $\mathcal{P} = (\mathcal{R},\mathcal{S},\mathcal{A})$ for $n$ users satisfies $(\varepsilon ,\delta)$ -SDP if the mechanism $S\circ \mathcal{R}^n$ satisfies $(\varepsilon ,\delta)$ -DP. + +To achieve benefits of the shuffle model in intrinsically adaptive algorithms (e.g., gradient descent, multi-armed bandits etc.), one needs to divide the users into multiple batches, and run a potentially different shuffle protocol on each batch (Cheu et al., 2021; Tenenbaum et al., 2021). This is quite natural since the shuffler needs enough users' data to infuse sufficient randomness so as to amplify the privacy. Moreover, each protocol might depend on the output of the preceding protocols to foster adaptivity. Formally, a general $M$ -batch, $M \in \mathbb{N}$ , shuffle protocol $\mathcal{P}$ for $n$ users works as follows. In each batch $m$ , we simply run a standard single-batch shuffle protocol for a subset of $n_m$ users (such that $n = \sum_{m} n_m$ ) with randomizer $\mathcal{R}_m$ , shuffler $\mathcal{S}$ and analyzer $\mathcal{A}$ . To ensure adaptivity, the randomizer $\mathcal{R}_m$ and number of users $n_m$ for the $m$ -th batch could be chosen depending on outputs of the shuffler from all the previous batches, given by $\left\{\mathcal{S}\left(\mathcal{R}_{m'}(D_1), \ldots, \mathcal{R}_{m'}(D_{n_{m'}})\right)\right\}_{m' < m}$ . The objective of privacy is same as in the single-batch protocol - the analyzer's view must satisfy DP. However, instead of a single-batch output, one need to protect outputs of all the $M$ batches. To this end, define the (composite) mechanism $\mathcal{M}_{\mathcal{P}} = (\mathcal{S} \circ R_1^{n_1}, \ldots, \mathcal{S} \circ R_m^{n_m})$ , where each individual mechanism $\mathcal{S} \circ \mathcal{R}_m^{n_m}$ operates on $n_m$ users' data, i.e., on datasets from $\mathcal{D}^{n_m}$ . + +Definition 2.4 (M-batch SDP). An $M$ -batch shuffle protocol $\mathcal{P}$ is $(\varepsilon, \delta)$ -SDP if the mechanism $\mathcal{M}_{\mathcal{P}}$ is $(\varepsilon, \delta)$ -DP. + +# 3. A Shuffle Algorithm for Contextual Bandits + +In this section, we introduce a general algorithmic framework (Algorithm 1) for linear contextual bandits under the shuffle model. We build on the celebrated LinUCB algorithm (Chu et al., 2011; Abbasi-Yadkori et al., 2011), which is an application of the optimism in the face of uncertainty principle to linear bandits. Throughout the paper, we make the following assumptions, which are standard in the literature (Chu et al., 2011; Shariff & Sheffet, 2018). + +Assumption 3.1 (Boundedness). The rewards are bounded for all $t$ , i.e., $y_{t} \in [0,1]$ . Moreover, the parameter vector and the features have bounded norm, i.e., $\| \theta^{*}\|_{2} \leqslant 1$ and $\sup_{c,a} \| \phi(c,a)\|_{2} \leqslant 1$ .2 + +# 3.1. Algorithm: Shuffle Private LinUCB + +Our shuffle algorithm for contextual bandits consists of batches with a fixed size $B$ , i.e., we have total $M = T / B$ batches. The central idea is to construct, for each batch $m$ , + +# Algorithm 1 Shuffle Private LinUCB + +1: Parameters: Batch size $B \in \mathbb{N}$ , regularization $\lambda > 0$ , confidence radii $\{\beta_m\}_{m \geqslant 0}$ , feature map $\phi: \mathcal{C} \times \mathcal{X} \to \mathbb{R}^d$ +2: Initialize: Batch counter $m = 1$ , end-time $t_0 = 0$ , batch statistics $V_0 = \lambda I_d$ , $u_0 = 0$ , parameter estimate $\hat{\theta}_0 = 0$ +3: for local user $t = 1,2,\ldots$ do +4: Observe user's context information $c_t \in \mathcal{C}$ +5: Choose action $a_{t} \in \operatorname{argmax}_{a \in \mathcal{X}} \langle \phi(c_{t}, a), \widehat{\theta}_{m-1} \rangle + \beta_{m-1} \| \phi(c_{t}, a) \|_{V_{m-1}^{-1}}$ +6: Observe reward $y_{t}$ +7: #For the local randomizer: +8: Send randomized messages $M_{t,1} = R_1(\phi(c_t, a_t) y_t)$ and $M_{t,2} = R_2(\phi(c_t, a_t) \phi(c_t, a_t)^\top)$ to the shuffler +9: if $t = mB$ then +10: #For the shuffler: +11: Set batch end-time: $t_m = t$ +12: Permute all received messages uniformly at random $Y_{m,1} = S_1\left(\{M_{\tau,1}\}_{t_{m-1} + 1 \leq \tau \leq t_m}\right)$ and $Y_{m,2} = S_2\left(\{M_{\tau,2}\}_{t_{m-1} + 1 \leq \tau \leq t_m}\right)$ +13: #For the analyzer (server): +14: Compute per-batch statistics $\widetilde{u}_m = A_1(Y_{m,1})$ and $\widetilde{V}_m = A_2(Y_{m,2})$ using shuffled messages +15: Update overall batch statistics: $u_{m} = u_{m - 1} + \widetilde{u}_{m}$ , $V_{m} = V_{m - 1} + \widetilde{V}_{m}$ +16: Compute parameter estimate $\widehat{\theta}_m = V_m^{-1}u_m$ +17: Send updated models $(\theta_{m},V_{m})$ to users +18: Increase batch counter: $m = m + 1$ +19: end if +20: end for + +a $d$ -dimensional ellipsoid $\mathcal{E}_m$ with centre $\widehat{\theta}_m$ , shape matrix $V_m$ and radius $\beta_{m}$ so that it contains the unknown parameter $\theta^{*}$ with high probability. Moreover, the ellipsoids are designed while keeping the privacy setting in mind. They depend on the randomizer, shuffler and analyzer employed in the shuffle protocol based on required privacy levels $\varepsilon, \delta$ . The personal data of user $t$ in batch $m$ is given by the feature vector $\phi (c_t,a_t)$ and reward $y_{t}$ , where the action $a_{t}$ is selected given the context $c_{t}$ as + +$$ +a_{t}\in \operatorname *{argmax}_{a\in \mathcal{X}}\{\langle \phi (c_{t},a),\widehat{\theta}_{m - 1}\rangle +\beta_{m - 1}\| \phi (c_{t},a)\|_{V_{m - 1}^{-1}}\} . +$$ + +We consider a fixed randomizer across all the batches given by two functions $R_{1}$ and $R_{2}$ that locally operate on the vectors $\phi (c_t,a_t)y_t$ and matrices $\phi (c_t,a_t)\phi (c_t,a_t)^\top$ , respectively. Similarly, we have shuffler functions $S_{1}$ and $S_{2}$ operating on batches (of size $B$ ) of those respective randomized messages. Finally, the analyzer functions $A_{1}$ and $A_{2}$ receive permuted messages from $S_{1}$ and $S_{2}$ , and output, for each batch $m'$ , an aggregate vector $\widetilde{u}_{m'}$ and matrix $\widetilde{V}_{m'}$ , respectively. The central server uses this aggregate batch statistics to construct the ellipsoid: $V_{m} = \lambda I_{d} + \sum_{m^{\prime} = 1}^{m}\widetilde{V}_{m^{\prime}}$ + +and $\widehat{\theta}_m = V_m^{-1}\sum_{m' = 1}^{M}\widetilde{u}_{m'}$ . For a given confidence level $\alpha \in (0,1]$ , the radius of the ellipsoid is set as $\beta_{m} = O\left(\sqrt{2\log\left(\frac{2}{\alpha}\right) + d\log\left(1 + \frac{t_{m}}{d\lambda}\right)} + \sqrt{\lambda}\right)$ , where $t_m$ is the time when batch $m$ ends. The regularizer $\lambda$ and thus, in turn, the confidence radius $\beta_{m}$ typically depend on the total noise infused in the shuffle protocol. On a high level, these randomizer, shuffler and analyzer functions together provide suitable random perturbations to the Gram matrices and feature-reward vectors based on the privacy budget $\varepsilon, \delta$ , and in turn, they affect the regret performance via the noise levels of these perturbations. Next, we turn to discuss specific choices of these functions, and the associated performance guarantees of Algorithm 1 under those choices. + +# 3.2. Achieving SDP via LDP Amplification + +In this section, we show that our general framework (Algorithm 1) enables us to directly utilize existing LDP mechanisms for linear contextual bandits to achieve a finer utility-privacy trade-off. The key idea here is to leverage the explicit privacy amplification property of the shuffle protocol (Feldman et al., 2020). Roughly, the privacy guarantee can be amplified by a factor of $\sqrt{B}$ by randomly permuting the output of an LDP mechanism independently operating on a batch of $B$ different users. In other words, the same level of privacy can be achieved for each user by adding a $\sqrt{B}$ factor less noise in the presence of shuffler, yielding a better utility. Specifically, we instantiate Algorithm 1 with the shuffle protocol $\mathcal{P}_{\mathrm{Amp}} = (\mathcal{R}_{\mathrm{Amp}}, S_{\mathrm{Amp}}, A_{\mathrm{Amp}})$ , where we employ standard Gaussian mechanism (Dwork et al., 2014) as randomizer functions. Essentially, we inject independent Gaussian perturbation to each entry of the vector $\phi(c_t, a_t)y_t$ and the matrix $\phi(c_t, a_t)\phi(c_t, a_t)^{\top}$ with variances $\sigma_1^2$ and $\sigma_2^2$ , respectively. We make sure the noisy matrix is symmetric by perturbing upper diagonal entries, and copying those to the lower terms. The noise variances are properly tuned depending on the sensitivity of these elements to achieve desired level of privacy. In this case, the shuffler functions simply permute its data uniformly at random, and the job of the analyzer is to simply add its received data (i.e., vectors or matrices). We defer further details on the protocol $\mathcal{P}_{\mathrm{Amp}}$ to Appendix B and focus on performance guarantees first. + +Theorem 3.2 (Performance under LDP amplification). Fix time horizon $T \in \mathbb{N}$ , batch size $B \in [T]$ , confidence level $\alpha \in (0,1]$ , privacy budgets $\delta \in (0,1]$ , $\varepsilon \in (0, \sqrt{\frac{\log(2 / \delta)}{B}}]$ . Then, Algorithm 1 instantiated using shuffle protocol $\mathcal{P}_{\text{Amp}}$ with noise $\sigma_1 = \sigma_2 = \frac{4\sqrt{2\log(2.5B / \delta)\log(2 / \delta)}}{\varepsilon\sqrt{B}}$ , and regularizer $\lambda = \Theta(\sqrt{T}\sigma_1(\sqrt{d} + \sqrt{\log(T / B\alpha)})$ , enjoys the regret + +$$ +R e g (T) = O \left(d B \log T + \frac {\log^ {1 / 2} (B / \delta)}{\varepsilon^ {1 / 2} B ^ {1 / 4}} d ^ {3 / 4} T ^ {3 / 4} \log^ {2} (T / \alpha)\right), +$$ + +with probability at least $1 - \alpha$ . Moreover, it satisfies $O(\varepsilon, \delta)$ + +shuffle differential privacy (SDP). + +Corollary 3.3. Setting batch size $B = O(T^{3/5})$ in Algorithm 1, we can achieve regret $\widetilde{O}\left(\frac{T^{3/5}}{\sqrt{\varepsilon}}\log^{1/2}(T/\delta)\right)$ .4 + +Comparison with central and local DP models. At this point, we turn to compare the regret of our Shuffle Private LinUCB algorithm to that of LinUCB under central model with JDP guarantee5 (Shariff & Sheffet, 2018) and local model with LDP (Zheng et al., 2020) guarantee. As mentioned before, LinUCB achieves $\tilde{O}\left(\sqrt{\frac{T}{\varepsilon}}\right)$ and $\tilde{O}\left(\frac{T^{3/4}}{\sqrt{\varepsilon}}\right)$ regret under JDP and LDP guarantees, respectively. As seen in Corollary 3.3, our regret bound in the shuffle trust model lies perfectly in between these two extremes. Importantly, it improves over the $T^{3/4}$ scaling in the (stronger) local trust model, achieving a better trade-off between regret and privacy. However, it couldn't achieve the optimal $\sqrt{T}$ scaling in the (weaker) central trust model. It remains an open question whether $\sqrt{T}$ regret can be achieved under any notion of privacy stronger than the central model. + +Remark 3.4. Our shuffle protocol $\mathcal{P}_{\mathrm{Amp}}$ , by design, provides a certain level of local privacy to each user. Specifically, for batch size $B$ , Algorithm 1 is $O(\varepsilon \sqrt{B / \log(2 / \delta)}, \delta / B)$ -LDP. Furthermore, since shuffle model ensures a higher level of trust than the central model, Algorithm 1 is also $O(\varepsilon, \delta)$ -JDP. See Appendix B for details. + +Apart from achieving a refined utility-privacy trade-off, the above shuffle protocol $\mathcal{P}_{\mathrm{Amp}}$ requires minimum modifications over existing LDP mechanisms. However, the privacy guarantee in Theorem 3.2 holds only for small privacy budget $\varepsilon$ particularly when the batch size $B$ is large, which could potentially limit its application in some practical scenarios (e.g., when $\varepsilon$ is around 1 or larger (Apple, 2017)). Moreover, $\mathcal{P}_{\mathrm{Amp}}$ needs to communicate and shuffle real vectors and matrices, which are often difficult to encode on finite computers in practice (Canonne et al., 2020; Kairouz et al., 2021) and a naive use of finite precision approximation may lead to a possible failure of privacy protection (Mironov, 2012). To overcome these limitations of $\mathcal{P}_{\mathrm{Amp}}$ , we introduce a different instantiation of Algorithm 1 in the next section. + +# 3.3. Achieving SDP via Vector Summation + +We instantiate Algorithm 1 with the shuffle protocol $\mathcal{P}_{\mathrm{Vec}} = (\mathcal{R}_{\mathrm{Vec}},\mathcal{S}_{\mathrm{Vec}},\mathcal{A}_{\mathrm{Vec}})$ , where we rely on a particularly efficient and accurate mechanism for summing vectors with bounded $\ell_2$ norms (Cheu et al., 2021). First, the local randomizer $\mathcal{R}_{\mathrm{Vec}}$ adopts a one-dimensional randomizer that operates + +independently on each entry of the vector $\phi (c_t,a_t)y_t$ and the matrix $\phi (c_t,a_t)\phi (c_t,a_t)^\top$ , respectively. This adopted one-dimensional randomizer transmits only bits $(0 / 1)$ via a fixed-point encoding scheme (Cheu et al., 2019), and ensures privacy by injecting binomial noise. In particular, given any entry $x\in [0,1]$ , it is first encoded as $\widehat{x} = \bar{x} +\gamma_{1}$ using an accuracy parameter $g\in \mathbb{N}$ , where $\bar{x} = \lfloor xg\rfloor$ and $\gamma_{1}\sim \mathrm{Ber}(xg - \bar{x})$ . Then a binomial noise is generated, $\gamma_{2}\sim \mathrm{Bin}(b,p)$ , where parameters $b\in \mathbb{N},p\in (0,1)$ control the privacy noise. The output of the one-dimensional randomizer is simply a collection of total $g + b$ bits, in which $\widehat{x} +\gamma_{2}$ bits are 1 and the rest are 0. Combining the outputs of the one-dimensional randomizer for each entry of vector $\phi (c_t,a_t)y_t$ and matrix $\phi (c_t,a_t)\phi (c_t,a_t)^\top$ , yield final outputs of randomizer. The shuffler functions in $S_{\mathrm{Vec}}$ simply permutes all the received bits uniformly at random. The job of the analyzer $\mathcal{A}_{\mathrm{Vec}}$ is to add the received bits for each entry, and remove the bias introduced due to encoding and binomial noise. This is possible since bits are already labeled entry-wise when leaving $\mathcal{R}_{\mathrm{Vec}}$ . The constants $g,b,p$ are left as tunable parameters of $\mathcal{P}_{\mathrm{Vec}}$ , and need to be set properly depending on the desired level of privacy. The detailed implementation of this scheme is deferred to Appendix C. The following theorem states the performance guarantees of Algorithm 1 instantiated with $\mathcal{P}_{\mathrm{Vec}}$ . + +Theorem 3.5 (Performance under vector sum). Fix batch size $B \in [T]$ , privacy budgets $\varepsilon \in (0,15]$ , $\delta \in (0,1/2)$ . Then, Algorithm 1 instantiated with $\mathcal{P}_{\mathrm{Vec}}$ with parameters $p = 1/4$ , $g = \max \{2\sqrt{B}, d, 4\}$ and $b = \frac{C \cdot g^2 \cdot \log^2(d^2 / \delta)}{\varepsilon^2 B}$ is $(\varepsilon, \delta)$ -SDP, where $C \gg 1$ is some sufficiently large constant. Furthermore, for any $\alpha \in (0,1]$ , setting $\lambda = \Theta\left(\frac{\log(d^2 / \delta) \sqrt{T}}{\varepsilon \sqrt{B}} (\sqrt{d} + \sqrt{\log(T / B\alpha)})\right)$ , it enjoys the regret + +$$ +R e g (T) = O \left(d B \log T + \frac {\log^ {1 / 2} (d ^ {2} / \delta)}{\varepsilon^ {1 / 2} B ^ {1 / 4}} d ^ {3 / 4} T ^ {3 / 4} \log^ {2} (T / \alpha)\right), +$$ + +with probability at least $1 - \alpha$ . + +Remark 3.6. Similar to Corollary 3.3, an $\widetilde{O}\left(\frac{T^{3/5}}{\sqrt{\varepsilon}}\right)$ regret can also be achieved in this case by setting $B = O(T^{3/5})$ , but the dependence on $\delta$ is now: $\log^{1/2}(d^2/\delta)$ as compared to $\log^{1/2}(T/\delta)$ . Moreover, in contrast to Theorem 3.2, the guarantees hold for a wide range of $\varepsilon$ , making $\mathcal{P}_{\mathrm{Vec}}$ better suitable for practical purposes (Apple, 2017). Finally, as before, if $B$ also depends on privacy parameters, the dependence on $\varepsilon, \delta$ can be improved, see Corollary C.2. + +Remark 3.7. $\mathcal{P}_{\mathrm{Vec}}$ can also be regarded as privacy amplification of Binomial mechanism (rather than Gaussian mechanism in $\mathcal{P}_{\mathrm{Amp}}$ ), which is the reason that it also offers a certain degree, $O(\varepsilon \sqrt{B}, \delta)$ , to be precise, of LDP guarantee. + +Remark 3.8. Both shuffle protocols, $\mathcal{P}_{\mathrm{Amp}}$ and $\mathcal{P}_{\mathrm{Vec}}$ , in fact, can be tuned to satisfy $(\varepsilon, \delta)$ -LDP by sacrificing on regret performance. See Corollaries B.3 and C.3 for details. + +# 3.4. Key Techniques: Overview + +In this section, we provide a generic template of regret bound for linear contextual bandits under the shuffle model of privacy. To this end, we need following notations to discuss the effect of noise added by shuffle protocol, in the learning process. Let $n_m = \widetilde{u}_m - \sum_{t=t_{m-1}+1}^{t_m} \phi(c_t, a_t) y_t$ and $N_m = \widetilde{V}_m - \sum_{t=t_{m-1}+1}^{t_m} \phi(c_t, a_t) \phi(c_t, a_t)^\top$ denote the total noise added during batch $m$ in the feature-reward vector, and in the Gram-matrix, respectively. Furthermore, assume that there exist constants $\widetilde{\sigma}_1$ and $\widetilde{\sigma}_2$ such that for each batch $m$ , (i) $\sum_{m'=1}^{m} n_{m'}$ is a random vector whose entries are independent, mean zero, sub-Gaussian with variance at most $\widetilde{\sigma}_1^2$ , and (ii) $\sum_{m'=1}^{m} N_{m'}$ is a random symmetric sub-Gaussian matrix whose entries on and above the diagonal are independent with variance at most $\widetilde{\sigma}_2^2$ . Let $\sigma^2 = \max \{\widetilde{\sigma}_1^2, \widetilde{\sigma}_2^2\}$ . Then, we have the following result. + +Lemma 3.9 (Informal). With the choice of $\lambda \approx \sigma (\sqrt{d} +\sqrt{\log(T / (B\alpha))})$ , the regret of Algorithm 1 satisfies + +\[ +Reg(T) = \widetilde{O}\left(dB + d\sqrt{T} + \sqrt{\sigma T} d^{3/4}\right) \text{ with high probability.} +\] + +With the above result, one only needs to determine the noise variance $\sigma^2$ under different privacy protocols. We illustrate this with the shuffle protocols introduced in previous sections. First, note that since we assume unique users, Algorithm 1 is SDP if each batch is SDP. Now, for the LDP amplification protocol $\mathcal{P}_{\mathrm{Amp}}$ , in order to guarantee SDP for each batch with sufficiently small privacy loss $\varepsilon$ , it suffices to work with an LDP mechanism with loss $\varepsilon \sqrt{B}$ by virtue of amplification.6 We ensure this by choosing Gaussian mechanism with noise variance $O(1 / (\varepsilon^{2}B))$ . Hence, the total noise variance added by $\mathcal{P}_{\mathrm{Amp}}$ is $\sigma^2 \approx O\left(\frac{T}{\varepsilon^2B}\right)$ . Thus, by Lemma 3.9, we obtain the result in Theorem 3.2. Similarly, for the vector sum protocol $\mathcal{P}_{\mathrm{Vec}}$ , we ensure $\mathcal{P}_{\mathrm{Vec}}$ to be SDP by properly setting parameters $g, b, p$ . Moreover, the analyzer's outputs are unbiased estimates of the sum of the non-private vectors (matrices) within that batch, and the entry-wise private noise is sub-Gaussian with variance of $O\left(\frac{1}{\varepsilon^2}\right)$ . Thus, the total noise variance added by $\mathcal{P}_{\mathrm{Vec}}$ is $\sigma^2 \approx O\left(\frac{T}{\varepsilon^2B}\right)$ , and hence, by Lemma 3.9, we have the result in Theorem 3.5. + +Remark 3.10. Lemma 3.9, in fact, can serve as a general template of regret for private linear contextual bandit algorithms. For example, for the local model (Zheng et al., 2020), $B = 1$ and $\sigma^2 \approx \frac{T}{\varepsilon^2}$ , yielding $\widetilde{O}\left(\frac{T^{3/4}}{\sqrt{\varepsilon}}\right)$ regret. Similarly, for the central model (Shariff & Sheffet, 2018), $B = 1$ and $\sigma^2 \approx \frac{\log T}{\varepsilon^2}$ , which yields $\widetilde{O}\left(\frac{T^{1/2}}{\sqrt{\varepsilon}}\right)$ regret. + +# 4. Regret Performance under Returning Users + +Similar to existing work on differentially private bandits, in previous sections, we have assumed that all participating users are unique, i.e., each user participates in the protocol only at one round. A more practical scenario is that an user can contribute with her data at multiple rounds. For example, consider the mobile medical application described in the introduction. The cloud server can collect one particular user's data during multiple batches to track the effectiveness of its treatment plan over a period, and hence, use same user's data multiple times to update its recommendation algorithm. Motivated by this, we provide privacy and regret guarantees of Algorithm 1 under the setting of returning users in linear contextual bandits. We first define the setting of returning users that we consider in this section, and then state the performance guarantee for Algorithm 1. + +Assumption 4.1 (Returning Users). For a given time horizon $T \in \mathbb{N}$ and batch size $B \in [T]$ , any user can participate in all $M = T / B$ batches, but within each batch $m \in [M]$ , she only contributes once. + +In addition to the above motivating example, this assumption also captures many practical adaptive learning scenarios such as clinical trials and product recommendations, in which each trial (batch) involves a group of unique people, but the same person may participate in multiple trials (Ren et al., 2020b; Schwartz et al., 2017). + +Theorem 4.2 (Performance guarantees (informal)). Under Assumption 4.1, we obtain the following results for $\mathcal{P}_{\text{Amp}}$ and $\mathcal{P}_{\text{Vec}}$ , respectively. + +(i) For any $\varepsilon \leqslant \frac{2}{B}\log (2 / \delta)\sqrt{2T}$ and $\delta \in (0,1]$ , Algorithm 1 instantiated using $\mathcal{P}_{Amp}$ with noise levels $\sigma_{1} = \sigma_{2} = \frac{16\log(2 / \delta)\sqrt{T(\log(5T / \delta))}}{\varepsilon B}$ is $O(\varepsilon ,\delta)$ -SDP, and enjoys, with high-probability, the regret bound + +$$ +R e g (T) = \widetilde {O} \left(\frac {d T}{M} + \sqrt {\frac {M T}{\varepsilon}} d ^ {3 / 4} \log^ {3 / 4} (T / \delta)\right). +$$ + +(ii) For any $\varepsilon \leqslant 15$ , $\delta \in (0,1/2)$ , there exist choices of parameters $g, b \in \mathbb{N}$ , $p \in (0,1/2)$ depending on $B, \varepsilon, \delta$ such that Algorithm 1 instantiated using $\mathcal{P}_{\mathrm{Vec}}$ is $(\varepsilon, \delta)$ -SDP, and, enjoys, with high probability, the regret bound + +$$ +R e g (T) = \widetilde {O} \left(\frac {d T}{M} + \sqrt {\frac {M T}{\varepsilon}} d ^ {3 / 4} \log^ {3 / 4} \left(d ^ {2} M / \delta\right)\right). +$$ + +Proof sketch. In contrast to Section 3 for unique users, where $(\varepsilon, \delta)$ -SDP guarantee for Algorithm 1 can be established by showing each batch is $(\varepsilon, \delta)$ -SDP, we now need to guarantee that outputs of all the batches together have a total privacy loss of $(\varepsilon, \delta)$ . This is due to the fact that now each batch can potentially operate on the same set of users, and + +hence, one need to use advanced decomposition to calculate the total privacy loss. This leads to scaling up the noise variance by a multiplicative factor of $O(M)$ at each batch, which eventually leads to the above bound (the additional $M$ factor in $\delta$ also comes from advance composition). + +Interestingly, the privacy $(\varepsilon, \delta)$ -dependent term in above regret bounds match the one that can be achieved in the user-level central trust model that handles returning users. Note that, since existing work in the central model of privacy (i.e., under JDP guarantee) assume unique users (Shariff & Sheffet, 2018), we first generalize it to handle returning users. This can be viewed as the same form of generalization from event-level DP to user-level DP under continual observation, where the adjacent relation between two data streams changes from the flip of one single round to the flip of multiple rounds associated with a single user (Dwork et al., 2010). See Appendix D for formal definitions of event-level and user-level joint differential privacy (JDP). As in standard notion of DP, one straightforward approach for converting event-level JDP to user-level JDP is to use group privacy (Dwork et al., 2014). However, this black-box approach would blow up the terms dependent on $\delta$ . To overcome this, we propose a simple modification of original (event-level) algorithm in Shariff & Sheffet (2018) so that it can handle returning users. In particular, user-level JDP can be achieved by scaling up the noise variance by a multiplicative factor of $M_0^2$ , if any user participates in at most $M_0$ rounds. This follows from the fact that flipping one user now would change the $\ell_2$ sensitivity of the expanded binary-tree nodes from $O(\sqrt{\log T})$ to $O(M_0\sqrt{\log T})$ . Note that we use $M_0$ to distinguish from the number of batches $M$ since there is no batch concept in standard central model. This modified version enjoys the following regret guarantee. + +Proposition 4.3. If any user participates in at most $M_0$ rounds, the algorithm in Shariff & Sheffet (2018), with the above modification to handle user-level privacy, achieves the high-probability regret bound + +$$ +R e g (T) = \widetilde {O} \left(d \sqrt {T} + \sqrt {\frac {M _ {0} T}{\varepsilon}} d ^ {3 / 4} \log^ {1 / 4} (1 / \delta)\right). +$$ + +Remark 4.4. Comparing Theorem 4.2 and Proposition 4.3, we observe that the cost of privacy in the shuffle model is essentially same (upto a log factor) as in the central model under the setting of returning users. In particular, if $M = M_0 = T^{1/3}$ rounds (i.e., the same number of possible returning rounds for any user), the regret is $\widetilde{O}\left(\frac{T^{2/3}}{\sqrt{\varepsilon}}\right)$ in both shuffle and user-level central trust models. See Appendix E for complete proofs and more details. + +![](images/c0698b85ac8847ee6ee110b9a3c0e6ac54d0dd0561c112316b854b79214c2768.jpg) +(a) $\varepsilon = 0.2$ + +![](images/6b504fb3130803368ec8296c4e5fd6cb6a2b1ddd796c23f51bc81b37e92adc1a.jpg) +(b) $\varepsilon = 1$ +Figure 1: Comparison of cumulative regret for LinUCB (non-private), LinUCB-JDP (central model), LinUCB-SDP (shuffle model) and LinUCB-LDP (local model) with varying privacy level $\varepsilon = 0.2$ (a), $\varepsilon = 1$ (b) and $\varepsilon = 10$ (c). For $\varepsilon = 0.2$ (higher privacy level), gap between private and non-private regret is higher as compared to $\varepsilon = 10$ (lower privacy level). In all cases, regret of LinUCB-SDP lies perfectly in between LinUCB-JDP and LinUCB-LDP, achieving finer regret-privacy trade-off. + +![](images/260ca6d67402c6bf0a9d00f6d1f6148e6414e6fae8ba2eef506d18288ac9dc5f.jpg) +(c) $\varepsilon = 10$ + +# 5. Simulation Results + +In this section, we empirically evaluate the regret performance of Algorithm 1 (under shuffle model), which we abbreviate as LinUCB-SDP-Amp and LinUCB-SDP-Vec when instantiated with $\mathcal{P}_{\mathrm{Amp}}$ and $\mathcal{P}_{\mathrm{Vec}}$ , respectively. We compare them with the algorithms of Shariff & Sheffet (2018) and Zheng et al. (2020) under central and local models, which we call LinUCB-JDP and LinUCB-LDP, respectively. We benchmark these against the non-private algorithm of Abbasi-Yadkori et al. (2011), henceforth referred as LinUCB. For all the experiments, we consider 100 arms, set $T = 20000$ rounds, and average our results over 50 randomly generated bandit instances. Each instance is characterized by an (unknown) parameter $\theta^{*}$ and feature vectors of dimension $d = 5$ . To ensure boundedness, similar to Vaswani et al. (2020), we generate each $\theta^{*}$ and feature vectors by sampling a $(d - 1)$ -dimensional vectors of norm $1 / \sqrt{2}$ uniformly at random, and append it with a $1 / \sqrt{2}$ entry. We consider Bernoulli $\{0,1\}$ rewards. We fix $\delta = 0.1$ and plot the results for varying privacy level $\varepsilon \in \{0.2,1,10\}$ in Figure 1. We use Batchsize $B = 20$ for LinUCB-SDP. We postpone the results for $d = 10$ , 15 to Appendix G. + +From Figure 1, we observe that the regret performance of LinUCB-SDP (under both shuffle protocols $\mathcal{P}_{\mathrm{Amp}}$ and $\mathcal{P}_{\mathrm{Vec}}$ ) is indeed better than LinUCB-LDP. In addition, it is not surprising that LinUCB-SDP incurs a larger regret than LinUCB-JDP. Moreover, the regret performance of LinUCB-SDP (in fact for any private algorithm) comes closer to that of LinUCB as $\varepsilon$ increases, i.e., as the privacy guarantee becomes weaker. The experimental findings are consistent with our theoretical results. $^7$ + +$^{7}$ Code is available at https://github.com/sayakrc/Differentially-Private-Bandits. + +# 6. Concluding Remarks + +We conclude by discussing some important theoretical and practical aspects about shuffle protocols, and in general, about privacy in linear contextual bandits. + +Communications. In the protocol $\mathcal{P}_{\mathrm{Amp}}$ , each participating user at each round need to send one $d$ -dimensional real vector and one $d \times d$ real matrix. On the other hand, the protocol $\mathcal{P}_{\mathrm{Vec}}$ only communicates $0/1$ bits. In particular, each participating user at each round sends out a total of $O(d^{2}(g + b))$ bits, where $g + b \approx \sqrt{B} + \log(1/\delta) / \varepsilon^{2}$ . Hence, $\mathcal{P}_{\mathrm{Vec}}$ might be more feasible in practice than $\mathcal{P}_{\mathrm{Amp}}$ . + +Batched algorithms for local and central models. Existing work on differentially private linear contextual bandits under both local and central models perform sequential update, i.e., the model estimates are updated after each round. As mentioned before, this may not be feasible in practice due to computational load. Fortunately, our proposed algorithm (Algorithm 1) along with its generic regret bound (Lemma 3.9) also offers a simple way to design and analyze private algorithms for local and central models with batched update. In particular, we show that it suffices to update after every $B = \widetilde{O}(T^{3/4})$ rounds to achieve the same privacy-regret trade-off as in the sequential local model and every $B = \widetilde{O}(\sqrt{T})$ to match the sequential central model. See Appendix F for the details. + +Adaptive model update. One might wonder whether we can further reduce the update frequency to $O(\log T)$ via an adaptive model update schedule based on the standard determinant trick (Lemma 12 of Abbasi-Yadkori et al. (2011)). In this approach, the key step is to establish that $\| \phi(c,a) \|_{V_{\tau_t}^{-1}} \leqslant \eta \| \phi(c,a) \|_{V_t^{-1}}$ , where $\tau_t < t$ is the most recent model update time before $t$ . To this end, if one uses the determinant trick, one can obtain that + +$$ +\| \phi (c, a) \| _ {V _ {\tau_ {t}} ^ {- 1}} \leqslant \sqrt {\frac {\det (V _ {t})}{\det (V _ {\tau_ {t}})}} \| \phi (c, a) \| _ {V _ {t} ^ {- 1}}, +$$ + +if the condition $V_{t} \succeq V_{\tau_{t}}$ holds. Note that this is true in + +the non-private setting. However, this does not necessarily hold in private settings due to the added noise, which, to the best of our knowledge, is the key analytical gap in the current proof of the main result (Theorem 10) in Garcelon et al. (2021). As we can see, this issue exists in all three trust models when one needs to use the noisy design matrix to determine the update frequency via the determinant trick. + +Close the gap. For the case of unique users, we have shown that shuffle model enables us to achieve a regret $\tilde{O}(T^{3/5})$ , which is between local model regret $\tilde{O}(T^{3/4})$ and central model regret $\tilde{O}(\sqrt{T})$ . One important question is how to further close the gap. To this end, one might first need to have a tight lower bound for the regret under the local model. To the best of our knowledge, Liao et al. (2021) presents the first lower bound under local model $\Omega\left(\frac{1}{\min\{2,e^{\varepsilon}\}(e^{\varepsilon}-1)} d\sqrt{T}\right)$ . It is unclear to us whether the upper bound and lower bound are tight for the local model8. + +Advanced shuffle protocols. We use vector summation protocol in Cheu et al. (2021) rather than advanced shuffle protocols (in terms of communication cost) (e.g., Ghazi et al. (2020); Balle et al. (2020)) because it is simple to implement and suffices to deliver our main message. Another key technical reason is that the random noise introduced by these advanced shuffle protocols is (discrete) Laplace, which at best exhibits sub-exponential tail behavior. Now, in contextual bandits, one need to protect both rewards and feature vectors, and a principled way to achieve privacy is to inject suitable random noise to the matrices $\phi(\cdot)\phi(\cdot)^{\top}$ and vectors $\phi(\cdot)y$ generated by rewards and features. This raises the need to control respective norms of random vectors and random symmetric matrices with i.i.d. sub-exponential entries in order to achieve a meaningful utility/regret bound. In contrast, our current adopted shuffle protocol from Cheu et al results in random vectors and matrices with Binomial entries, which have sub-Gaussian tails. Hence, the respective norms can be controlled using standard results from random matrix theory. However, we are not aware of non-trivial bounds on matrix norms with sub-exponential entries (i.e., without a simple union bound over co-ordinates), which abstains us from using advanced shuffle protocols. + +Pure DP in the shuffle model. First, let us highlight the reason why we focus only on approximate DP. Existing linear contextual bandit algorithms under central and local privacy models consider only approximate DP, and our main motivation in this work is to close the gap in regret achieved under these two models via shuffling. Second, almost all the existing shuffle protocols can only guarantee approximate DP. To the best of knowledge, the very recent work (Cheu & Yan, 2021) develops the first shuffle protocol that is able to achieve pure DP with an error of $O(1 / \varepsilon)$ . However, since + +this new protocol also relies on discrete Laplace noise, the same challenge of controlling norms of vectors and matrices with sub-exponential entries in contextual bandits still remain. At mentioned before, to the best of our knowledge, it remains open to derive non-trivial (i.e., without a simple union bound over co-ordinates) concentration bounds on the norm for Laplace random matrices. That being said, if there indeed exist non-trivial concentrations for sub-exponential or Laplace matrices, our derived result (i.e., Lemma A.2) can also be used to derive meaningful regret bounds under this new protocol. + +Regret in low-privacy regime: As in previous works, we focus on the high-privacy regime. One may wonder if it is possible to potentially achieve $O(\sqrt{T} + \sqrt{T} / \varepsilon)$ regret after amplification in the low-privacy regime (i.e., $\varepsilon \approx \sqrt{\frac{e^{\varepsilon_0}}{n}}$ , by Lemma B.4). For example, this is possible if one can replace $\varepsilon_0^{-\frac{1}{2}}$ by $e^{-\frac{\varepsilon_0}{2}}$ in the second term of the regret bound in Proposition F.1. However, this essentially amounts to requiring a mechanism that guarantees $(\varepsilon_0, \delta_0)$ -LDP for $\varepsilon_0 > 1$ by injecting (sub-)Gaussian noise with standard deviation $\sigma = O(e^{-\varepsilon_0})$ . To the best of our knowledge, we are unaware of any such mechanism. The standard Gaussian mechanism fails to satisfy this since it needs $\sigma = \Theta(1/\sqrt{\varepsilon_0})$ to achieve $(\varepsilon_0, \delta_0)$ -DP in low-privacy regime. For pure DP, the state-of-the-art staircase mechanism (Geng et al., 2015), requires a noise with $\sigma = O(e^{-\varepsilon_0/2})$ rather than $\sigma = O(e^{-\varepsilon_0})$ . This again can't guarantee $\sqrt{T} / \varepsilon$ regret even if one manages to apply it in our context (with proper matrix-norm bounds). That being said, if there indeed exists the above required mechanism, our results can be used to establish the desired $\sqrt{T} / \varepsilon$ regret in low-privacy regime. + +Future work. One immediate future research direction is to address the above adaptive model update in the private settings. We also believe our framework can be generalized to design shuffle private algorithms for reinforcement learning with linear function approximation (e.g., linear mixture Markov decision processes (MDPs)) to achieve finer trade-off between the local model (Liao et al., 2021) and the central model (Zhou, 2022). + +# Acknowledgements + +We thank anonymous reviewers for their useful comments, which helped preparing the final version. XZ would like to thank Albert Cheu for insightful discussions on shuffle protocols. SRC is grateful to a CISE Postdoctoral fellowship of Boston University. + +# References + +Abbasi-Yadkori, Y., Pál, D., and Szepesvári, C. Improved algorithms for linear stochastic bandits. In Advances in + +Neural Information Processing Systems, pp. 2312-2320, 2011. +Abe, N., Biermann, A. W., and Long, P. M. Reinforcement learning with immediate rewards and linear hypotheses. Algorithmica, 37(4):263-293, 2003. +Agarwal, N. and Singh, K. The price of differential privacy for online learning. In International Conference on Machine Learning, pp. 32-40. PMLR, 2017. +Apple. Learning with privacy at scale. 2017. URL https: //machinelearning.apple.com/research/ learning-with-privacy-at-scale. +Arora, S., Yttri, J., and Nilsen, W. Privacy and security in mobile health (mhealth) research. Alcohol research: current reviews, 36(1):143, 2014. +Auer, P. Using confidence bounds for exploitation-exploration trade-offs. Journal of Machine Learning Research, 3:397-422, March 2003. ISSN 1532-4435. +Balle, B., Bell, J., Gascon, A., and Nissim, K. Differentially private summation with multi-message shuffling. arXiv preprint arXiv:1906.09116, 2019a. +Balle, B., Bell, J., Gascon, A., and Nissim, K. The privacy blanket of the shuffle model. In Annual International Cryptology Conference, pp. 638-667. Springer, 2019b. +Balle, B., Bell, J., Gascon, A., and Nissim, K. Private summation in the multi-message shuffle model. In Proceedings of the 2020 ACM SIGSAC Conference on Computer and Communications Security, pp. 657-676, 2020. +Bittau, A., Erlingsson, U., Maniatis, P., Mironov, I., Raghunathan, A., Lie, D., Rudominer, M., Kode, U., Tinnes, J., and Seefeld, B. Prochlo: Strong privacy for analytics in the crowd. In Proceedings of the 26th Symposium on Operating Systems Principles, pp. 441-459, 2017. +Canonne, C. L., Kamath, G., and Steinke, T. The discrete gaussian for differential privacy. In NeurIPS, 2020. +Chan, T. H., Shi, E., and Song, D. Private and continual release of statistics. In International Colloquium on Automata, Languages, and Programming, pp. 405-417. Springer, 2010. +Chen, X., Zheng, K., Zhou, Z., Yang, Y., Chen, W., and Wang, L. (locally) differentially private combinatorial semi-bandits. In International Conference on Machine Learning, pp. 1757-1767. PMLR, 2020. +Cheu, A. Differential privacy in the shuffle model: A survey of separations. arXiv preprint arXiv:2107.11839, 2021. + +Cheu, A. and Yan, C. Pure differential privacy from secure intermediaries. arXiv preprint arXiv:2112.10032, 2021. +Cheu, A., Smith, A., Ullman, J., Zeber, D., and Zhilyaev, M. Distributed differential privacy via shuffling. In Annual International Conference on the Theory and Applications of Cryptographic Techniques, pp. 375-403. Springer, 2019. +Cheu, A., Joseph, M., Mao, J., and Peng, B. Shuffle private stochastic convex optimization. arXiv preprint arXiv:2106.09805, 2021. +Chowdhury, S. R. and Zhou, X. Differentially private regret minimization in episodic markov decision processes. arXiv preprint arXiv:2112.10599, 2021. +Chowdhury, S. R., Zhou, X., and Shroff, N. Adaptive control of differentially private linear quadratic systems. In 2021 IEEE International Symposium on Information Theory (ISIT), pp. 485-490. IEEE, 2021. +Chu, W., Li, L., Reyzin, L., and Schapire, R. E. Contextual bandits with linear payoff functions. In International Conference on Artificial Intelligence and Statistics (AISTATS), volume 15, pp. 208-214, 2011. +Dubey, A. No-regret algorithms for private gaussian process bandit optimization. In International Conference on Artificial Intelligence and Statistics, pp. 2062-2070. PMLR, 2021. +Dwork, C. Differential privacy: A survey of results. In International conference on theory and applications of models of computation, pp. 1-19. Springer, 2008. +Dwork, C., Naor, M., Pitassi, T., and Rothblum, G. N. Differential privacy under continual observation. In Proceedings of the forty-second ACM symposium on Theory of computing, pp. 715-724, 2010. +Dwork, C., Roth, A., et al. The algorithmic foundations of differential privacy. Found. Trends Theor. Comput. Sci., 9(3-4):211-407, 2014. +Erlingsson, U., Feldman, V., Mironov, I., Raghunathan, A., Talwar, K., and Thakurta, A. 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. +Feldman, V., McMillan, A., and Talwar, K. Hiding among the clones: A simple and nearly optimal analysis of privacy amplification by shuffling. arXiv preprint arXiv:2012.12803, 2020. + +Garcelon, E., Perchet, V., Pike-Burke, C., and Pirotta, M. Local differentially private regret minimization in reinforcement learning. arXiv preprint arXiv:2010.07778, 2020. +Garcelon, E., Chaudhuri, K., Perchet, V., and Pirotta, M. Privacy amplification via shuffling for linear contextual bandits. arXiv preprint arXiv:2112.06008, 2021. +Geng, Q., Kairouz, P., Oh, S., and Viswanath, P. The staircase mechanism in differential privacy. IEEE Journal of Selected Topics in Signal Processing, 9(7):1176-1184, 2015. +Ghazi, B., Golowich, N., Kumar, R., Pagh, R., and Vel- ingker, A. On the power of multiple anonymous messages. arXiv preprint arXiv:1908.11358, 2019. +Ghazi, B., Kumar, R., Manurangsi, P., and Pagh, R. Private counting from anonymous messages: Near-optimal accuracy with vanishing communication overhead. In International Conference on Machine Learning, pp. 3505-3514. PMLR, 2020. +Girgis, A., Data, D., Diggavi, S., Kairouz, P., and Suresh, A. T. Shuffled model of differential privacy in federated learning. In International Conference on Artificial Intelligence and Statistics, pp. 2521-2529. PMLR, 2021. +Guha Thakurta, A. and Smith, A. (nearly) optimal algorithms for private online learning in full-information and bandit settings. Advances in Neural Information Processing Systems, 26:2733-2741, 2013. +Han, Y., Zhou, Z., Zhou, Z., Blanchet, J., Glynn, P. W., and Ye, Y. Sequential batch learning in finite-action linear contextual bandits. arXiv preprint arXiv:2004.06321, 2020. +Han, Y., Liang, Z., Wang, Y., and Zhang, J. Generalized linear bandits with local differential privacy. arXiv preprint arXiv:2106.03365, 2021. +Hsu, J., Huang, Z., Roth, A., Roughgarden, T., and Wu, Z. S. Private matchings and allocations. SIAM Journal on Computing, 45(6):1953-1984, 2016. +Kairouz, P., Liu, Z., and Steinke, T. The distributed discrete gaussian mechanism for federated learning with secure aggregation. In NeurIPS, 2021. +Kearns, M., Pai, M., Roth, A., and Ullman, J. Mechanism design in large games: Incentives and privacy. In Proceedings of the 5th conference on Innovations in theoretical computer science, pp. 403-410, 2014. +Li, L., Chu, W., Langford, J., and Schapire, R. E. A contextual-bandit approach to personalized news article + +recommendation. In Proceedings of the 19th international conference on World wide web, pp. 661-670, 2010. +Liao, C., He, J., and Gu, Q. Locally differentially private reinforcement learning for linear mixture markov decision processes. arXiv preprint arXiv:2110.10133, 2021. +Lowy, A. and Razaviyayn, M. Private federated learning without a trusted server: Optimal algorithms for convex losses. arXiv preprint arXiv:2106.09779, 2021. +Mironov, I. On significance of the least significant bits for differential privacy. In Proceedings of the 2012 ACM conference on Computer and communications security, pp. 650-661, 2012. +Mishra, N. and Thakurta, A. (nearly) optimal differentially private stochastic multi-arm bandits. In Proceedings of the Thirty-First Conference on Uncertainty in Artificial Intelligence, pp. 592-601, 2015. +Ren, W., Zhou, X., Liu, J., and Shroff, N. B. Multi-armed bandits with local differential privacy. arXiv preprint arXiv:2007.03121, 2020a. +Ren, Z., Zhou, Z., and Kalagnanam, J. R. Batched learning in generalized linear contextual bandits with general decision sets. IEEE Control Systems Letters, 2020b. +Sajed, T. and Sheffet, O. An optimal private stochastic-mab algorithm based on optimal private stopping rule. In International Conference on Machine Learning, pp. 5579-5588. PMLR, 2019. +Schwartz, E. M., Bradlow, E. T., and Fader, P. S. Customer acquisition via display advertising using multiarmed bandit experiments. Marketing Science, 36(4): 500-522, 2017. +Shariff, R. and Sheffet, O. Differentially private contextual linear bandits. Advances in Neural Information Processing Systems, 31:4296-4306, 2018. +Tenenbaum, J., Kaplan, H., Mansour, Y., and Stemmer, U. Differentially private multi-armed bandits in the shuffle model. In Beygelzimer, A., Dauphin, Y., Liang, P., and Vaughan, J. W. (eds.), Advances in Neural Information Processing Systems, 2021. URL https://openreview.net/forum?id=POAeY-efPEx. +Tewari, A. and Murphy, S. A. From ads to interventions: Contextual bandits in mobile health. In Mobile Health, pp. 495-517. Springer, 2017. +Tossou, A. and Dimitrakakis, C. Achieving privacy in the adversarial multi-armed bandit. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 31, 2017. + +Vaswani, S., Mehrabian, A., Durand, A., and Kveton, B. Old dog learns new tricks: Randomized ucb for bandit problems. In International Conference on Artificial Intelligence and Statistics, pp. 1988-1998. PMLR, 2020. +Vershynin, R. High-dimensional probability: An introduction with applications in data science, volume 47. Cambridge university press, 2018. +Vietri, G., Balle, B., Krishnamurthy, A., and Wu, S. Private reinforcement learning with pac and regret guarantees. In International Conference on Machine Learning, pp. 9754-9764. PMLR, 2020. +Wang, T., Zhou, D., and Gu, Q. Provably efficient reinforcement learning with linear function approximation under adaptivity constraints. arXiv preprint arXiv:2101.02195, 2021. +Xin, Y. and Jaakkola, T. Controlling privacy in recommender systems. Neural Information Processing Systems, 2014. +Zheng, K., Cai, T., Huang, W., Li, Z., and Wang, L. Locally differentially private (contextual) bandits learning. In NeurIPS, 2020. +Zhou, X. Differentially private reinforcement learning with linear function approximation. arXiv preprint arXiv:2201.07052, 2022. +Zhou, X. and Tan, J. Local differential privacy for bayesian optimization. arXiv preprint arXiv:2010.06709, 2020. + +# A. A Unified Regret Analysis Under Differential Privacy + +In this section, we will formally state Lemma 3.9, i.e., the generic regret of Algorithm 1 under sub-Gaussian private noise and then present its proof. + +Let's first recall the following notations. For each batch $m \in [M]$ , let $N_m := \widetilde{V}_m - \sum_{t=t_{m-1}+1}^{t_m} \phi(c_t, a_t) \phi(c_t, a_t)^\top$ denote the additional noise injected into the non-private Gram-matrix and similarly let $n_m := \widetilde{u}_m - \sum_{t=t_{m-1}+1}^{t_m} \phi(c_t, a_t) y_t$ denote the additional noise injected into the non-private feature-reward vector. Then, we let $H_m := \lambda I_d + \sum_{i=1}^{m} N_i$ to denote the total noise in the first $m$ batches plus the regularizer, and similarly let $h_m := \sum_{i=1}^{m} n_i$ . + +Assumption A.1 (Regularity). For any $\alpha \in (0,1]$ , $H_{m}$ is positive definite and there exist constants $\lambda_{\mathrm{max}}$ , $\lambda_{\mathrm{min}}$ and $\nu$ depending on $\alpha$ , such that with probability at least $1 - \alpha$ , for all $m \in [M]$ + +$$ +\left\| H _ {m} \right\| \leq \lambda_ {\max }, \quad \left\| H _ {m} ^ {- 1} \right\| \leq 1 / \lambda_ {\min }, \quad \left\| h _ {m} \right\| _ {H _ {m} ^ {- 1}} \leq \nu . +$$ + +With the above regularity assumption and the boundedness in Assumption 3.1, we fist establish the following general regret bound of Algorithm 1, which can be viewed as a direct generalization of the results in (Shariff & Sheffet, 2018) to the batched case. + +Lemma A.2. Let Assumptions A.1 and 3.1 hold. Fix any $\alpha \in (0,1]$ , with probability at least $1 - \alpha$ , the regret of Algorithm 1 satisfies + +$$ +R e g (T) \leq \frac {d B}{\log 2} \log \left(1 + \frac {T}{d \lambda_ {\mathrm {m i n}}}\right) + 8 \beta_ {M} \sqrt {d T \log \left(1 + \frac {T}{d \lambda_ {\mathrm {m i n}}}\right)}, +$$ + +where + +$$ +\beta_ {M} := \sqrt {2 \log \left(\frac {2}{\alpha}\right) + d \log \left(1 + \frac {T}{d \lambda_ {\mathrm {m i n}}}\right)} + \sqrt {\lambda_ {\mathrm {m a x}}} + \nu . +$$ + +In fact, Lemma 3.9 in the main paper is a simple application of Lemma A.2 by considering the following assumption. + +Assumption A.3 (sub-Gaussian private noise). There exist constants $\widetilde{\sigma}_1$ and $\widetilde{\sigma}_2$ such that for all $m\in [M]$ : (i) $\sum_{m^{\prime} = 1}^{m}n_{m^{\prime}}$ is a random vector whose entries are independent, mean zero, sub-Gaussian with variance at most $\widetilde{\sigma}_1^2$ , and (ii) $\sum_{m^{\prime} = 1}^{m}N_{m^{\prime}}$ is a random symmetric matrix whose entries on and above the diagonal are independent sub-Gaussian random variables with variance at most $\widetilde{\sigma}_2^2$ . Let $\sigma^2 = \max \{\widetilde{\sigma}_1^2,\widetilde{\sigma}_2^2\}$ . + +Now, we are well-prepared to formally state Lemma 3.9 in the main paper. + +Lemma A.4 (Formal statement of Lemma 3.9). Let Assumptions A.3 and 3.1 hold. Fix time horizon $T \in \mathbb{N}$ , batch size $B \in [T]$ , confidence level $\alpha \in (0,1]$ . Set $\lambda = \Theta(\max\{1, \sigma(\sqrt{d} + \sqrt{\log(T/(B\alpha))}\})$ and $\beta_m = \sqrt{2\log\left(\frac{2}{\alpha}\right) + d\log\left(1 + \frac{T}{d\lambda}\right)} + \sqrt{\lambda}$ . Then, Algorithm 1 achieves regret + +$$ +R e g (T) = O \left(d B \log T + d \sqrt {T} \log (T / \alpha)\right) + O \left(\sqrt {\sigma T} d ^ {3 / 4} \log T \log (T / \alpha)\right) +$$ + +with probability at least $1 - \alpha$ . + +Remark A.5. The above lemma also presents a regret bound for non-private batched LCB when $\sigma = 0$ . Note that in this case, our regret bound is achieved with a dimension-independent regularizer, in contrast to the necessary condition on $\lambda = \tilde{\Theta}(d)$ as required in (Ren et al., 2020b) to attain the optimal regret. + +# A.1. Proofs + +In this section, we present proofs for Lemma A.2 and Lemma A.4 above, respectively. + +Proof of Lemma A.2. Let $\mathcal{E}$ be the event given in Assumption A.1, which holds with probability at least $1 - \alpha$ under Assumption A.1. In the following, we condition on the event $\mathcal{E}$ . We first show that $\widehat{\theta}_m$ concentrates around the true parameter + +$\theta^{*}$ with a properly chosen confidence radius $\beta_{m}$ for all $m\in [M]$ . To this end, note that + +$$ +\begin{array}{l} \widehat {\theta} _ {m} = V _ {m} ^ {- 1} u _ {m} \\ = \left(\sum_ {t = 1} ^ {t _ {m}} \phi \left(c _ {t}, a _ {t}\right) \phi \left(c _ {t}, a _ {t}\right) ^ {\top} + \lambda I _ {d} + \sum_ {i = 1} ^ {m} N _ {m}\right) ^ {- 1} \left(\sum_ {t = 1} ^ {t _ {m}} \phi \left(c _ {t}, a _ {t}\right) y _ {t} + \sum_ {i = 1} ^ {m} n _ {m}\right) \\ = \left(\sum_ {t = 1} ^ {t _ {m}} \phi (c _ {t}, a _ {t}) \phi (c _ {t}, a _ {t}) ^ {\top} + H _ {m}\right) ^ {- 1} \left(\sum_ {t = 1} ^ {t _ {m}} \phi (c _ {t}, a _ {t}) y _ {t} + h _ {m}\right). \\ \end{array} +$$ + +By the linear reward function $y_{t} = \langle \phi (c_{t},a_{t}),\theta^{*}\rangle +\eta_{t}$ and elementary algebra, we have + +$$ +\theta^ {*} - \widehat {\theta} _ {m} = V _ {m} ^ {- 1} \left(H _ {m} \theta^ {*} - \sum_ {t = 1} ^ {t _ {m}} \phi \left(c _ {t}, a _ {t}\right) \eta_ {t} - h _ {m}\right). +$$ + +Thus, multiplying both sides by $V_{m}^{1 / 2}$ , yields + +$$ +\begin{array}{l} \left\| \theta^ {*} - \widehat {\theta} _ {m} \right\| _ {V _ {m}} \leq \left\| \sum_ {t = 1} ^ {t _ {m}} \phi (c _ {t}, a _ {t}) \eta_ {t} \right\| _ {V _ {m} ^ {- 1}} + \| H _ {m} \theta^ {*} \| _ {V _ {m} ^ {- 1}} + \| h _ {m} \| _ {V _ {m} ^ {- 1}} \\ \stackrel {(a)} {\leq} \left\| \sum_ {t = 1} ^ {t _ {m}} \phi (c _ {t}, a _ {t}) \eta_ {t} \right\| _ {(G _ {m} + \lambda_ {\min} I) ^ {- 1}} + \| \theta^ {*} \| _ {H _ {m}} + \| h _ {m} \| _ {H _ {m} ^ {- 1}}, \\ \end{array} +$$ + +where (a) holds by $V_{m} \succeq H_{m}$ and $V_{m} \succeq G_{m} + \lambda_{\min} I$ with $G_{m} := \sum_{t=1}^{t_{m}} \phi(c_{t}, a_{t}) \phi(c_{t}, a_{t})^{\top}$ under event $\mathcal{E}$ . Further, by the boundedness condition of $\theta^{*}$ and event $\mathcal{E}$ , $\| \theta^{*} \|_{H_{m}} \leq \sqrt{\lambda_{\max}}$ and $\| h_{m} \|_{H_{m}^{-1}} \leq \nu$ . For the remaining first term, we can use self-normalized inequality (cf. Theorem 1 in (Abbasi-Yadkori et al., 2011)) with the filtration $\mathcal{F}_{t} = \sigma(c_{1}, a_{1}, y_{1}, \ldots, c_{t}, a_{t}, y_{t}, c_{t+1}, a_{t+1})$ . In particular, we have with probability at least $1 - \alpha$ , for all $m \in [M]$ + +$$ +\left\| \sum_ {t = 1} ^ {t _ {m}} \phi \left(c _ {t}, a _ {t}\right) \eta_ {t} \right\| _ {\left(G _ {m} + \lambda_ {\min } I\right) ^ {- 1}} \leq \sqrt {2 \log \left(\frac {1}{\alpha}\right) + \log \left(\frac {\det \left(G _ {m} + \lambda_ {\min } I\right)}{\det \left(\lambda_ {\min } I\right)}\right)}. \tag {1} +$$ + +Now, using the trace-determinant lemma (cf. Lemma 10 in (Abbasi-Yadkori et al., 2011)) and the boundedness condition on $\| \phi(c, a) \|$ , we have + +$$ +\det (G _ {m} + \lambda_ {\min } I) \leq \left(\lambda_ {\min } + \frac {t _ {m}}{d}\right) ^ {d}. +$$ + +Putting everything together, we have with probability at least $1 - 2\alpha$ , for all $m \in [M]$ , $\left\| \theta^{*} - \widehat{\theta}_{m}\right\|_{V_{m}} \leq \beta_{m}$ , where + +$$ +\beta_ {m} := \sqrt {2 \log \left(\frac {1}{\alpha}\right) + d \log \left(1 + \frac {t _ {m}}{d \lambda_ {\min }}\right)} + \sqrt {\lambda_ {\max }} + \nu . +$$ + +With the above concentration result and our OFUL-type algorithm, the regret can be upper bounded as follows. + +$$ +\begin{array}{l} \mathcal {R} (T) = \sum_ {m = 1} ^ {M} \left[ 2 \beta_ {m - 1} \sum_ {t = t _ {m - 1} + 1} ^ {t _ {m}} \left(\| \phi \left(c _ {t}, a _ {t}\right) \| _ {V _ {m - 1} ^ {- 1}}\right) \right] \\ \leq \sum_ {m = 1} ^ {M} \left[ 2 \beta_ {M} \sum_ {t = t _ {m - 1} + 1} ^ {t _ {m}} \left(\| \phi \left(c _ {t}, a _ {t}\right) \| _ {\left(G _ {m - 1} + \lambda_ {\min } I\right) ^ {- 1}}\right) \right] \tag {2} \\ \end{array} +$$ + +At this moment, we note that the standard elliptical potential lemma (cf. Lemma 11 in (Abbasi-Yadkori et al., 2011)) cannot be applied to our batch setting due to the delay of $G_{m}$ . + +To handle this, inspired by (Wang et al., 2021), we let $\widehat{V}_k \coloneqq \sum_{t=1}^k \phi(c_t, a_t) \phi(c_t, a_t)^\top + \lambda_{\min} I_d$ , that is, a (virtual) design matrix at the end of time $k$ . Hence, we have $G_{m-1} + \lambda_{\min} I_d = \widehat{V}_{t_{(m-1)}}$ . Moreover, for any $t_m - 1 < t \leq t_m$ , let $m_t = t_{m-1}$ , that is, mapping $t$ to the starting time of the batch that includes $t$ . Finally, let $\Gamma_i(\cdot, \cdot) \coloneqq \beta_M \cdot \| \phi(\cdot, \cdot) \|_{\widehat{V}_i^{-1}}$ . + +With above notations, the bound in (2) can be rewritten as follows. + +$$ +\begin{array}{l} R (T) \leq \sum_ {m = 1} ^ {M} \left[ 2 \beta_ {M} \sum_ {t = t _ {m - 1} + 1} ^ {t _ {m}} \left(\| \phi (c _ {t}, a _ {t}) \| _ {(G _ {m - 1} + \lambda_ {\min }) ^ {- 1}}\right) \right] \\ = \sum_ {t = 1} ^ {T} 2 \Gamma_ {m _ {t}} \left(c _ {t}, a _ {t}\right) \\ \end{array} +$$ + +In the sequential case (i.e., $B = 1$ ), we always have $m_t = t - 1$ . Thus, the key is to bound the difference between $\Gamma_{m_t}(c_t, a_t)$ and $\Gamma_{t-1}(c_t, a_t)$ . To this end, we have the following claim, which will be proved at the end. + +Claim A.6. Define the set $\Psi$ as follows + +$$ +\Psi = \left\{t \in [ T ]: \Gamma_ {m _ {t}} \left(c _ {t}, a _ {t}\right) / \Gamma_ {t - 1} \left(c _ {t}, a _ {t}\right) > 2 \right\}. +$$ + +Then, we have + +$$ +| \Psi | \leq \frac {d T}{2 M \log 2} \log \left(1 + \frac {T}{d \lambda_ {\min}}\right). +$$ + +According to Claim A.6, we can decompose regret as follows. + +$$ +\begin{array}{l} R (T) \stackrel {(a)} {\leq} \sum_ {t = 1} ^ {T} \min \left\{2 \Gamma_ {m _ {t}} \left(c _ {t}, a _ {t}\right), 1 \right\} \\ = \sum_ {t \in \Psi} \min \left\{2 \Gamma_ {m _ {t}} \left(c _ {t}, a _ {t}\right), 1 \right\} + \sum_ {t \notin \Psi} \min \left\{2 \Gamma_ {m _ {t}} \left(c _ {t}, a _ {t}\right), 1 \right\} \\ \stackrel {(b)} {\leq} | \Psi | + \sum_ {t \notin \Psi} \min \left\{4 \Gamma_ {t - 1} \left(c _ {t}, a _ {t}\right), 1 \right\} \\ \stackrel {(c)} {\leq} | \Psi | + \sum_ {t = 1} ^ {T} 4 \beta_ {M} \min \left\{\| \phi \left(c _ {t}, a _ {t}\right) \| _ {\hat {V} _ {t - 1} ^ {- 1}}, 1 \right\} \\ \stackrel {(d)} {\leq} \frac {d T}{2 M \log 2} \log \left(1 + \frac {T}{d \lambda_ {\min}}\right) + 8 \beta_ {M} \sqrt {d T \log \left(1 + \frac {T}{d \lambda_ {\min}}\right)} \\ \end{array} +$$ + +where (a) holds by the boundedness of reward; (b) holds by definition of $\Psi$ ; (c) holds by the fact that $\beta_{M} \geq 1$ ; (d) follows from Claim A.6 and standard argument for linear bandit, i.e., Cauchy-Schwartz and standard elliptical potential lemma (cf. Lemma 11 in (Abbasi-Yadkori et al., 2011)). Hence, we have finished the proof of Lemma A.2. + +Finally, we give the proof of Claim A.6. + +For any $t \in \Psi$ , suppose $t_{m-1} < t \leq t_m$ for some $m$ . Then, we have $m_t = t_{(m-1)}$ and + +$$ +\log \det (\widehat {V} _ {t _ {m}}) - \log \det (\widehat {V} _ {t _ {(m - 1)}}) \overset {(a)} {\geq} \log \det (\widehat {V} _ {t - 1}) - \log \det (\widehat {V} _ {m _ {t}}) \overset {(b)} {\geq} 2 \log (\Gamma_ {m _ {t}} (c _ {t}, a _ {t}) / \Gamma_ {t - 1} (c _ {t}, a _ {t})) > 2 \log 2, +$$ + +where (a) holds by the fact $\widehat{V}_{t_m} \succeq \widehat{V}_{t-1}$ ; (b) holds by Lemma 12 in (Abbasi-Yadkori et al., 2011), that is, for two positive definite matrices $A, B \in \mathbb{R}^{d \times d}$ satisfying $A \succeq B$ , then for any $x \in \mathbb{R}^d$ , $\|x\|_A \leq \|x\|_B \cdot \sqrt{\operatorname*{det}(A) / \operatorname*{det}(B)}$ . Note that here we also use $\operatorname*{det}(A) = 1 / \operatorname*{det}(A^{-1})$ for any matrix; + +Therefore, if we let $\widehat{\Psi} \coloneqq \{m \in [M] : \log \det(\widehat{V}_{t_m}) - \log \det(\widehat{V}_{t_{(m-1)}}) > 2\log 2\}$ , then we have $|\Psi| \leq (T / M)|\widehat{\Psi}|$ . Thus, we only need to bound $|\widehat{\Psi}|$ . Note that for each $m$ , $\log \det(\widehat{V}_{t_m}) - \log \det(\widehat{V}_{t_{(m-1)}}) \geq 0$ , and hence + +$$ +2 \log 2 \cdot | \widehat {\Psi} | \leq \sum_ {m \in \widehat {\Psi}} \log \det (\widehat {V} _ {t _ {m}}) - \log \det (\widehat {V} _ {t _ {(m - 1)}}) \leq \sum_ {m = 1} ^ {M} \log \det (\widehat {V} _ {t _ {m}}) - \log \det (\widehat {V} _ {t _ {(m - 1)}}) = \log \left(\frac {\det (G _ {M} + \lambda_ {\min } I)}{\det (\lambda_ {\min } I)}\right) +$$ + +Algorithm 2 Local Randomizer $\mathcal{R}_{\mathrm{Amp}}$ +1: Parameters: $\sigma_{1},\sigma_{2},d$ +2: function $R_{1}(\phi (c,a)y)$ +3: Sample fresh noise $n\sim \mathcal{N}(0,\sigma_2^2 I_{d\times d})$ +4: $M_{1} = \phi (c,a)y + n$ +5: return $M_{t,1}$ +6: end function +7: function $R_{2}(\phi (c,a)\phi (c,a)^{\top})$ +8: Sample fresh noise $N_{(i,j)}\sim \mathcal{N}(0,\sigma_1^2),\forall i\leq j\leq d$ and let $N_{(j,i)} = N_{(i,j)}$ +9: $M_2 = \phi (c,a)\phi (c,a)^\top +N$ +10: return $M_2$ +11: end function + +Finally, using the same analysis as in (1), yields + +$$ +| \hat {\Psi} | \leq \frac {d}{2 \log 2} \log \left(1 + \frac {T}{d \lambda_ {\mathrm {m i n}}}\right), +$$ + +which directly implies the result of Claim A.6. + +Proof of Lemma A.4. To prove the result, thanks to Lemma A.2, we only need to determine the three constants $\lambda_{\mathrm{max}}, \lambda_{\mathrm{min}}$ and $\nu$ under the sub-Gaussian private noise assumption in Assumption A.3. To this end, we resort to concentration bounds for sub-Gaussian random vector and random matrix. + +To start with, under (i) in Assumption A.3, by the concentration bound for the norm of a vector containing sub-Gaussian entries (cf. Theorem 3.1.1 in (Vershynin, 2018)) and a union bound over $m$ , we have for all $m \in [M]$ and any $\alpha \in (0,1]$ with probability at least $1 - \alpha / 2$ , for some absolute constant $c_1$ , + +$$ +\left\| \sum_ {i = 1} ^ {m} n _ {i} \right\| = \| h _ {m} \| \leq \Sigma_ {n} := c _ {1} \cdot \widetilde {\sigma} _ {1} \cdot (\sqrt {d} + \sqrt {\log (M / \alpha)}). +$$ + +By (ii) in Assumption A.3, the concentration bound for the norm of a sub-Gaussian symmetric random matrix (cf. Corollary 4.4.8 (Vershynin, 2018)) and a union bound over $m$ , we have for all $m \in [M]$ and any $\alpha \in (0,1]$ , with probability at least $1 - \alpha / 2$ , + +$$ +\left\| \sum_ {i = 1} ^ {m} N _ {i} \right\| \leq \Sigma_ {N} := c _ {2} \cdot \widetilde {\sigma} _ {2} \cdot (\sqrt {d} + \sqrt {\log (M / \alpha)}) +$$ + +for some absolute constant $c_2$ . Thus, if we choose $\lambda = 2\Sigma_N$ , we have $\| H_m\| = \| \lambda I_d + \sum_{i = 1}^m N_i\| \leq 3\Sigma_N$ , i.e., $\lambda_{\max} = 3\Sigma_N$ , and $\lambda_{\min} = \Sigma_N$ . Finally, to determine $\nu$ , we note that + +$$ +\left\| h _ {m} \right\| _ {H _ {m} ^ {- 1}} \leq \frac {1}{\sqrt {\lambda_ {\operatorname* {m i n}}}} \left\| h _ {m} \right\| \leq c \cdot \left(\sigma \cdot \left(\sqrt {d} + \sqrt {\log (M / \alpha)}\right)\right) ^ {1 / 2} := \nu , +$$ + +where $\sigma = \max \{\widetilde{\sigma}_1,\widetilde{\sigma}_2\}$ . The final regret bound is obtained by plugging the three values into the result given by Lemma A.2. + +# B. Analysis of LDP Amplification Protocol + +# B.1. Pseudocode of $\mathcal{P}_{\mathrm{Amp}}$ + +The shuffle protocol is given by $\mathcal{P}_{\mathrm{Amp}} = (\mathcal{R}_{\mathrm{Amp}},\mathcal{S}_{\mathrm{Amp}},\mathcal{A}_{\mathrm{Amp}})$ , in which $\mathcal{R}_{\mathrm{Amp}}$ is presented in Algorithm 2, $S_{\mathrm{Amp}}$ is presented in Algorithm 3, and $\mathcal{A}_{\mathrm{Amp}}$ is presented in Algorithm 4. + +
Algorithm 3 Shuffler S_Amp
1:Input: {Mτ,1}τ∈B and {Mτ,2}τ∈B, in which B is a batch and Mτ,1 ∈ Rd, Mτ,2 ∈ Rd×d come from user τ
2:function S1({Mτ,1}τ∈B)
3:Generate a uniform permutation π of indexes in B
4:Set Y1 = (Mπ(1),1, ..., Mπ(B),1)
5:return Y1
6:end function
7:function S2({Mτ,2}τ∈B)
8:Generate a uniform permutation π of indexes in B
9:Set Y2 = (Mπ(1),2, ..., Mπ(B),2)
10:return Y2
11:end function
Algorithm 4 Analyzer A_Amp
1:Input: Shuffled outputs Y1 = (Mπ(1),1, ..., Mπ(B),1) and Y2 = (Mπ(1),2, ..., Mπ(B),2)
2:function A1(Y1)
3:return ∑i=1B Mπ(i),1
4:end function
5:function A1(Y2)
6:return ∑i=1B Mπ(i),2
7:end function
+ +# B.2. Main Results + +Theorem B.1 (Restatement of Theorem 3.2). Fix time horizon $T \in \mathbb{N}$ , batch size $B \in [T]$ , confidence level $\alpha \in (0,1]$ , and privacy budgets $\varepsilon \in (0,\sqrt{\frac{\log(2 / \delta)}{B}}]$ , $\delta \in (0,1]$ . Then, Algorithm 1 instantiated with shuffle protocol $\mathcal{P}_{Amp}$ with noise levels $\sigma_{1} = \sigma_{2} = \frac{4\sqrt{2\log(2.5B / \delta)\log(2 / \delta)}}{\varepsilon\sqrt{B}}$ , and regularizer $\lambda = \Theta (\sqrt{T}\sigma_1(\sqrt{d} +\sqrt{\log(T / B\alpha)})$ , enjoys the regret + +$$ +R e g (T) = O \left(d B \log T + \frac {\log^ {1 / 4} (B / \delta) \log^ {1 / 4} (2 / \delta)}{\varepsilon^ {1 / 2} B ^ {1 / 4}} d ^ {3 / 4} T ^ {3 / 4} \log T \log (T / \alpha)\right), +$$ + +with probability at least $1 - \alpha$ . Moreover, it satisfies $O(\varepsilon, \delta)$ -shuffle differential privacy (SDP). + +Corollary B.2 (Utility-targeted). Under the same assumption in Theorem B.1 and Algorithm 1 is instantiated with $\mathcal{P}_{\text{Amp}}$ . Let $B = O(d^{-1/5}\varepsilon^{-2/5}T^{3/5}\log^{1/5}(T/\delta)\log^{1/5}(2/\delta)$ , Algorithm 1 achieves $O(\varepsilon, \delta)$ -SDP with regret + +$$ +R e g (T) = \widetilde {O} \left(d ^ {4 / 5} T ^ {3 / 5} \varepsilon^ {- 2 / 5} \log^ {1 / 5} (T / \delta) \log^ {1 / 5} (2 / \delta)\right). +$$ + +Simultaneously, Algorithm 1 also achieves $O(\varepsilon, \delta)$ -JDP and $O(\varepsilon_0, \delta_0)$ -LDP where + +$$ +\varepsilon_ {0} = O \left(\varepsilon^ {4 / 5} T ^ {3 / 1 0} d ^ {- 1 / 1 0} \log^ {1 / 1 0} (T / \delta) \log^ {- 2 / 5} (2 / \delta)\right), \quad \delta_ {0} = O \left(\delta d ^ {1 / 5} T ^ {- 3 / 5} \varepsilon^ {2 / 5} \log^ {- 1 / 5} (T / \delta) \log^ {- 1 / 5} (2 / \delta)\right). +$$ + +Corollary B.3 (Privacy-targeted). Let Assumption 3.1 hold and Algorithm 1 is instantiated with $\mathcal{P}_{Amp}$ . For any $\varepsilon_0 \in [0,1]$ and $\delta_0 \in (0,1]$ , let $\sigma_1 = \sigma_2 = \frac{4\sqrt{2\log(2.5 / \delta_0)}}{\varepsilon_0}$ . Then, for all $B \in [T]$ , Algorithm 1 is $(\varepsilon_0, \delta_0)$ -LDP. Further suppose $B = O(d^{-1/4}T^{3/4}\varepsilon_0^{-1/2}\log^{1/4}(1/\delta_0))$ , then Algorithm 1 achieves regret + +$$ +R e g (T) = \tilde {O} \left(d ^ {3 / 4} T ^ {3 / 4} \varepsilon_ {0} ^ {- 1 / 2} \log^ {1 / 4} \left(1 / \delta_ {0}\right)\right). +$$ + +Simultaneously, Algorithm 1 achieves $O(\varepsilon, \delta)$ -SDP and $O(\varepsilon, \delta)$ -JDP where + +$$ +\varepsilon = O \left(\varepsilon_ {0} ^ {5 / 4} T ^ {- 3 / 8} d ^ {1 / 8} \log^ {3 / 8} (1 / \delta_ {0})\right), \quad \delta = O (\delta_ {0} d ^ {- 1 / 4} T ^ {3 / 4} \varepsilon_ {0} ^ {- 1 / 2} \log^ {1 / 4} (1 / \delta_ {0})). +$$ + +# B.3. Proofs + +To prove Theorem B.1, we need the following important lemma, which can be seen as a special case of Theorem 3.8 in (Feldman et al., 2020). In particular, in our paper, we consider a fixed local randomizer rather than the more general adaptive one in (Feldman et al., 2020). Another difference is that we consider the case of randomizer-then-shuffle rather than the shuffle-then-randomizer. However, as pointed in (Feldman et al., 2020), the two cases are equivalent when the local randomizer is a fixed one. + +Lemma B.4 (Amplification by shuffling). Consider a one-round protocol $\mathcal{P} = (\mathcal{R},\mathcal{S},\mathcal{A})$ over $n$ users. Let $\mathcal{R}$ be an $(\varepsilon_0,\delta_0)$ -LDP mechanism. Then, for any $\delta' \in [0,1]$ such that $\varepsilon_0 \leq \log \left(\frac{n}{16\log(2/\delta')}\right)$ , $\mathcal{P}$ is $(\widetilde{\varepsilon},\widetilde{\delta})$ -SDP, i.e., the analyzer's view is $(\widetilde{\varepsilon},\widetilde{\delta})$ -DP, where + +$$ +\widetilde {\varepsilon} \leq \log \left(1 + \frac {e ^ {\varepsilon_ {0}} - 1}{e ^ {\varepsilon_ {0}} + 1} \left(\frac {8 \sqrt {e ^ {\varepsilon_ {0}} \log (4 / \delta^ {\prime})}}{\sqrt {n}} + \frac {8 e ^ {\varepsilon_ {0}}}{n}\right)\right), \widetilde {\delta} = \delta^ {\prime} + (e ^ {\varepsilon} + 1) \left(1 + \frac {e ^ {- \varepsilon_ {0}}}{2}\right) n \delta_ {0}, +$$ + +That is, when $\varepsilon_0 > 1$ , $\widetilde{\varepsilon} = O\left(\frac{\sqrt{e^{\varepsilon_0\log(1 / \delta')}}}{\sqrt{n}}\right)$ and when $\varepsilon_0 \leq 1$ , $\widetilde{\varepsilon} = O\left(\varepsilon_0\frac{\sqrt{\log(1 / \delta')}}{\sqrt{n}}\right)$ . + +Roughly speaking, we have a privacy amplification by a factor $\sqrt{n}$ due to shuffling, which is the key to our analysis. + +Proof of Theorem B.1. To apply Lemma B.4, we choose $\delta' = \delta / 2$ and $\varepsilon_0 = \frac{\varepsilon \sqrt{B}}{\sqrt{\log(1 / \delta')}} = \frac{\varepsilon \sqrt{B}}{\sqrt{\log(2 / \delta)}}$ . For any $\varepsilon \in (0, \sqrt{\log(2 / \delta)} / \sqrt{B}]$ , we have $\varepsilon_0 \leq 1$ , which implies $\widetilde{\varepsilon} = O(\varepsilon)$ . Meanwhile, we let $\delta_0 = \delta / B$ for any $\delta \in [0, 1]$ , which implies that $\widetilde{\delta} = O(\delta)$ . Now, we are only left to choose $\sigma_1$ and $\sigma_2$ in $\mathcal{R}_{\mathrm{Amp}}$ so that it is $(\varepsilon_0, \delta_0)$ -LDP. To this end, via the standard Gaussian mechanism and boundedness assumption, we have when + +$$ +\sigma_ {1} = \sigma_ {2} = \frac {4 \sqrt {2 \log (2 . 5 / \delta_ {0})}}{\varepsilon_ {0}}, +$$ + +$\mathcal{R}_{\mathrm{Amp}}$ is $(\varepsilon_0,\delta_0)$ -LDP. Finally, plugging in $\varepsilon_0 = \varepsilon \sqrt{B} /\sqrt{\log(2 / \delta)}$ and $\delta_0 = \delta /B$ , yields + +$$ +\sigma_ {1} = \sigma_ {2} = \frac {4 \sqrt {2 \log (2 . 5 B / \delta) \log (2 / \delta)}}{\varepsilon \sqrt {B}}. +$$ + +Finally, plugging the value $\sigma = \frac{4\sqrt{2T\log(2.5B / \delta)\log(2 / \delta)}}{\varepsilon\sqrt{B}}$ (since there are total at most $T$ noise) into the regret bound in Lemma A.4 yields the required results. + +Proof of Corollary B.2. To establish the regret bound, we simply choose a balanced $B$ in the regret bound given by Theorem B.1. To prove the JDP guarantee, we will use the powerful *Billboard lemma* (cf. Lemma 9 in (Hsu et al., 2016)), which says that an algorithm is JDP if the action recommended to each user is a function of her private data and a common signal computed in a differential private way. In our case, the private data is user's context and the common signal is the updated policy (i.e., $\widehat{\theta}_m$ and design matrix $V_m$ ), which is a post-processing of shuffle outputs. Thus, the SDP guarantee directly implies the JDP guarantee in our case. Finally, the LDP guarantee simply follows from the standard Gaussian mechanism with parameter $\varepsilon_0 = \varepsilon \sqrt{B} / \sqrt{\log(2/\delta)}$ and $\delta_0 = \delta / B$ . + +Proof of Corollary B.3. The LDP guarantee follows from standard Gaussian mechanism. To show the regret bound, we will use the result in Theorem B.1. In particular, comparing the values of $\sigma_{1},\sigma_{2}$ in Corollary B.3 and the values in Theorem B.1, we can plug $\varepsilon = \frac{\varepsilon_0\sqrt{\log(2 / \delta)}}{\sqrt{B}}$ and $\delta = \delta_0B$ into the regret bound in Theorem B.1. Then, with a balanced choice of $B$ , we obtain the required regret. The SDP guarantee also follows from Theorem B.1 with $\varepsilon = \frac{\varepsilon_0\sqrt{\log(2 / \delta)}}{\sqrt{B}}$ and $\delta = \delta_0B$ . Finally, as in the proof of Corollary B.2, the JDP guarantee follows from SDP guarantee and Billboard lemma. + +Algorithm 5 Local Randomizer $\mathcal{R}_{\mathrm{Vec}}$ +1: Parameters: $g,b,p,d$ +2: # Local randomizer for a scalar within $[0,\Delta ]$ +3: function $\mathcal{R}^* (x,\Delta)$ +4: Set $\bar{x} = \lfloor xg / \Delta \rfloor$ +5: Sample rounding value $\gamma_{1}\sim \mathbf{Ber}(xg / \Delta -\bar{x})$ +6: Set $\hat{x} = \bar{x} +\gamma_1$ +7: Sample binomial noise $\gamma_{2}\sim \mathbf{Bin}(b,p)$ +8: Set $m$ be a multi-set containing $\hat{x} +\gamma_{2}$ copies of 1 and $(g + b) - (\hat{x} +\gamma_{2})$ copies of O. +9: return m +10: end function +11: function $R_{1}(\phi (c,a)y)$ +12: Set $\Delta_1 = 1$ +13: for each coordinate $k\in [d]$ do +14: Shift data $w_{k} = [\phi (c,a)y]_{k} + \Delta_{1}$ +15: Run the scalar randomizer $m_{k} = \mathcal{R}^{*}(w_{k},\Delta_{1})$ +16: end for +17: # Labeled outputs (all bits in $m_{k}$ are labeled by k) +18: $M_1 = \{(k,m_k)\}_{k\in [d]}$ +19: return M1 +20: end function +21: function $R_{2}(\phi (c,a)\phi (c,a)^{\top})$ +22: Set $\Delta_2 = 1$ +23: for all $i\leq j\leq d$ do +24: Shift data $w_{(i,j)} = [\phi (c,a)\phi (c,a)^{\top}]_{(i,j)} + \Delta_2$ +25: Run the scalar randomizer to obtain $m_{(i,j)} = \mathcal{R}^{*}(w_{(i,j)},\Delta_2)$ and $m_{(j,i)} = m_{(i,j)}$ +26: end for +27: # Labeled outputs +28: $M_2 = \{((i,j),m_{(i,j)})\}_{(i,j)\in [d]\times [d]}$ +29: return M2 +30: end function + +# C. Analysis of Vector Summation Protocol + +# C.1. Pseudocode of $\mathcal{P}_{\mathrm{Vec}}$ + +The shuffle protocol is given by $\mathcal{P}_{\mathrm{Vec}} = (\mathcal{R}_{\mathrm{Vec}},\mathcal{S}_{\mathrm{Vec}},\mathcal{A}_{\mathrm{vec}})$ , in which $\mathcal{R}_{\mathrm{vec}}$ is presented in Algorithm 5, $\mathcal{S}_{\mathrm{vec}}$ is presented in Algorithm 6, and $\mathcal{A}_{\mathrm{vec}}$ is presented in Algorithm 7. Note that the original algorithm for the analyzer in (Cheu et al., 2021) has a small issue in the de-bias process (cf. Algorithm 2 in (Cheu et al., 2021)). In particular, instead of subtracting the norm $\Delta$ , one needs to subtract $B\cdot \Delta$ , see Lines 11 and 19 in Algorithm 7. Here, $B$ corresponds to $n$ in Algorithm 2 of (Cheu et al., 2021). + +# C.2. Main Results + +Theorem C.1 (Restatement of Theorem 3.5). Fix batch size $B \in [T]$ , privacy budgets $\varepsilon \in (0,15]$ , $\delta \in (0,1/2)$ . Then, Algorithm 1 instantiated with $\mathcal{P}_{\mathrm{Vec}}$ with parameters $p = 1/4$ , $g = \max \{2\sqrt{B}, d, 4\}$ and $b = \frac{24 \cdot 10^4 \cdot g^2 \cdot \log^2(4(d^2 + 1)/\delta)}{\varepsilon^2 B}$ is $(\varepsilon, \delta)$ -SDP. Furthermore, for any $\alpha \in (0,1]$ , setting $\lambda = \Theta\left(\frac{\log(d^2/\delta)\sqrt{T}}{\varepsilon\sqrt{B}} (\sqrt{d} + \sqrt{\log(T/(B\alpha))})\right)$ , it enjoys the regret + +$$ +R e g (T) = O \left(d B \log T + \frac {\log^ {1 / 2} \left(d ^ {2} / \delta\right)}{\varepsilon^ {1 / 2} B ^ {1 / 4}} d ^ {3 / 4} T ^ {3 / 4} \log T \log (T / \alpha)\right), +$$ + +with probability at least $1 - \alpha$ . + +Corollary C.2 (Utility-targeted). Under the same assumption in Theorem C.1 and Algorithm 1 is instantiated with $\mathcal{P}_{\mathrm{vec}}$ . Let + +Algorithm 6 Shuffler $S_{\mathrm{Vec}}$ +1: Input: $\{M_{\tau,1}\}_{\tau \in \mathcal{B}}$ and $\{M_{\tau,2}\}_{\tau \in \mathcal{B}}$ , in which $\mathcal{B}$ is a batch of users. $M_{\tau,1} = \{(k,m_k)\}_{k \in [d]}$ and $M_2 = \{((i,j),m_{(i,j)})\}_{(i,j) \in [d] \times [d]}$ are labeled data of user $\tau$ +2: function $S_1(\{M_{\tau,1}\}_{\tau \in \mathcal{B}})$ +3: Uniformly permutes all messages, i.e., a total of $(g + b) \cdot B \cdot d$ bits +4: Set $y_k$ be the collection of bits labeled by $k \in [d]$ +5: Set $Y_1 = \{y_1, \ldots, y_d\}$ +6: return $Y_1$ +7: end function +8: function $S_2(\{M_{\tau,2}\}_{\tau \in \mathcal{B}})$ +9: Uniformly permutes all messages, i.e., a total of $(g + b) \cdot B \cdot d^2$ bits +10: Set $y_{(i,j)}$ be the collection of bits labeled by $(i,j) \in [d] \times [d]$ +11: Set $Y_2 = \{y_{(i,j)}\}_{(i,j) \in [d] \times d}$ +12: return $Y_2$ +13: end function + +$B = O(d^{-1/5}\varepsilon^{-2/5}T^{3/5}\log^{2/5}(d^2/\delta))$ , Algorithm 1 achieves $(\varepsilon, \delta)$ -SDP with regret + +$$ +R e g (T) = \widetilde {O} \left(d ^ {4 / 5} T ^ {3 / 5} \varepsilon^ {- 2 / 5} \log^ {2 / 5} (d ^ {2} / \delta)\right). +$$ + +Simultaneously, Algorithm 1 also achieves $O(\varepsilon, \delta)$ -JDP and $O(\varepsilon_0, \delta_0)$ -LDP where + +$$ +\varepsilon_ {0} = O \left(\varepsilon^ {4 / 5} T ^ {3 / 1 0} d ^ {- 1 / 1 0} \log^ {1 / 5} (d ^ {2} / \delta)\right), \quad \delta_ {0} = O (\delta). +$$ + +Corollary C.3 (Privacy-targeted). Let Assumption 3.1 hold and Algorithm 1 is instantiated with $\mathcal{P}_{\mathrm{Vec}}$ . For any $\varepsilon_0 \in (0,15]$ and $\delta_0 \in (0,1/2)$ , let + +$$ +g = \max \{d, 4 \}, \quad b = \frac {2 4 \cdot 1 0 ^ {4} \cdot g ^ {2} \cdot \left(\log \left(\frac {4 \cdot (d ^ {2} + 1)}{\delta_ {0}}\right)\right) ^ {2}}{\varepsilon_ {0} ^ {2}}, \quad p = 1 / 4, +$$ + +Then, for all $B \in [T]$ , Algorithm 1 is $(\varepsilon_0, \delta_0)$ -LDP. Further suppose $B = O(d^{-1/4} T^{3/4} \varepsilon_0^{-1/2} (\log (d^2 / \delta_0))^{1/2})$ , then Algorithm 1 achieves regret + +$$ +R e g (T) = \widetilde {O} \left(d ^ {3 / 4} T ^ {3 / 4} \frac {\log^ {1 / 2} (d ^ {2} / \delta_ {0})}{\sqrt {\varepsilon_ {0}}}\right). +$$ + +Simultaneously, Algorithm 1 also achieves $O(\varepsilon, \delta)$ -SDP and $O(\varepsilon, \delta)$ -JDP where + +$$ +\varepsilon = O \left(\varepsilon^ {5 / 4} T ^ {- 3 / 8} d ^ {1 / 8} (\log (d ^ {2} / \delta_ {0})) ^ {- 1 / 4}\right), \quad \delta = O (\delta_ {0}). +$$ + +# C.3. Proofs + +Proof of Theorem C.1. The privacy part follows from the one-round SDP guarantee of vector summation protocol in (Cheu et al., 2021). In particular, by Theorem 3.2 in (Cheu et al., 2021), we have to properly choose parameters $g, b, p$ in $\mathcal{R}_{\mathrm{Vec}}$ . To this end, by adapting the results of Lemma 3.1 in (Cheu et al., 2021), we have in our case when one chooses + +$$ +g = \max \{2 \sqrt {B}, d, 4 \}, \quad b = \frac {2 4 \cdot 1 0 ^ {4} \cdot g ^ {2} \cdot \left(\log \left(\frac {4 \cdot (d ^ {2} + 1)}{\delta}\right)\right) ^ {2}}{\varepsilon^ {2} B}, \quad p = 1 / 4, +$$ + +$\mathcal{P}_{\mathrm{Vec}}$ is $(\varepsilon, \delta)$ -SDP. It is worth pointing out that here we choose $b$ such that $p = 1/4$ , which is necessary for our following analysis on the tail of the private noise. This is the key difference compared to the original one in (Cheu et al., 2021) where the variance of the noise is sufficient. + +Algorithm 7 Analyzer $\mathcal{A}_{\mathrm{vec}}$ +1: Input: Shuffled outputs $Y_{1} = \{y_{k}\}_{k\in [d]}$ and $Y_{2} = \{y_{(i,j)}\}_{(i,j)\in [d]\times d}$ +2: Initialize: $g, b, p$ +3: # Analyzer for a collection $y$ of $(g + b) \cdot B$ bits using $\Delta$ +4: function $A^{*}(y, \Delta)$ +5: return $\frac{\Delta}{g} \left( \sum_{i=1}^{(g + b) \cdot B} y_{i} \right) - p \cdot b \cdot B$ +6: end function +7: function $A_{1}(Y_{1})$ +8: $\Delta_{1} = 1$ +9: for each coordinate $k \in [d]$ do +10: Run analyzer on $k$ -th labeled data to obtain $z_{k} = A^{*}(y_{k}, \Delta_{1})$ +11: Re-center: $o_{k} = z_{k} - B \cdot \Delta_{1}$ +12: end for +13: return $\{o_{1}, \ldots, o_{k}\}$ +14: end function +15: function $A_{2}(Y_{2})$ +16: $\Delta_{2} = 1$ +17: for all $i \leq j \leq d$ do +18: Run analyzer on $(i,j)$ -th labeled data to obtain $z_{(i,j)} = A^{*}(y_{(i,j)}, \Delta_{2})$ +19: Re-center: $o_{(i,j)} = z_{(i,j)} - B \cdot \Delta_{2}$ and $o_{(j,i)} = o_{(i,j)}$ +20: end for +21: return $\{o_{(i,j)}\}_{(i,j) \in [d] \times [d]}$ +22: end function + +Now, we turn to regret analysis. Thanks to our general regret bound in Corollary A.4, we only need to verify the condition of sub-Gaussian private noise in the protocol $\mathcal{P}_{\mathrm{Vec}}$ (in particular $\mathcal{R}_{\mathrm{Vec}}$ ). To this end, we need a more careful analysis compared to (Cheu et al., 2021) as the issue pointed above. Fix any coordinate $k \in [d]$ , we will determine the private noise in $k$ , which motivates us to check the scalar randomizer $\mathcal{R}^*$ in $\mathcal{R}_{\mathrm{Vec}}$ . Consider a batch of users. Let $z_{i}$ denote the sum of $g + b$ bits generated by user $i$ using $\mathcal{R}^*$ . That is, we have + +$$ +z _ {i} = \bar {x} _ {i} + \gamma_ {1, i} + \gamma_ {2, i}. +$$ + +This implies that + +$$ +z _ {i} - b p = \frac {g}{\Delta} x _ {i} + \gamma_ {1, i} + \bar {x} _ {i} - \frac {g}{\Delta} x _ {i} + \gamma_ {2, i} - b p. +$$ + +Define shifted random variables $\iota_{1,i} \coloneqq \gamma_{1,i} + \bar{x}_i - \frac{g}{\Delta} x_i$ and $\iota_{2,i} \coloneqq \gamma_{2,i} - bp$ . Thus, taking the summation over all $i$ within a given batch $\mathcal{B}$ of size $B$ , yields + +$$ +\sum_ {i \in \mathcal {B}} z _ {i} - B \cdot b \cdot p = \frac {g}{\Delta} \sum_ {i \in \mathcal {B}} x _ {i} + \sum_ {i \in \mathcal {B}} \iota_ {1, i} + \sum_ {i \in \mathcal {B}} \iota_ {2, i}, +$$ + +which implies that + +$$ +\frac {\Delta}{g} \left(\sum_ {i \in \mathcal {B}} z _ {i} - B \cdot b \cdot p\right) = \sum_ {i \in \mathcal {B}} x _ {i} + \frac {\Delta}{g} \sum_ {i \in \mathcal {B}} \iota_ {1, i} + \frac {\Delta}{g} \sum_ {i \in \mathcal {B}} \iota_ {2, i}. +$$ + +Note that the above is exactly the output of the analyzer $\mathcal{A}^*$ in $\mathcal{P}_{\mathrm{vec}}$ . Thus, to verify the sub-Gaussian condition in Assumption A.3, we only need to show that the last two terms above are zero-mean and sub-Gaussian random variables. To this end, we note that $\gamma_{1,i}$ is drawn from $\mathbf{Ber}(\frac{g}{\Delta} x_i - \bar{x}_i)$ . Hence, $\mathbb{E}[\iota_{1,i}] = 0$ and $\iota_{1,i}$ is sub-Gaussian with variance 1 since $\iota_{1,i} \in [-1,1]$ . By independence of private noise across $i$ , we have $\sum_{i \in \mathcal{B}} \iota_{1,i}$ is sub-Gaussian with variance of $B$ . Similarly, since $\gamma_{2,i}$ is independently sampled from binomial $\mathbf{Bin}(b,p)$ , we have $\mathbb{E}[\iota_{2,i}] = 0$ and $\sum_{i \in \mathcal{B}} \iota_{2,i}$ can be viewed as a sum of $B \cdot b$ bounded random variable within $[0,1]$ , hence it is sub-Gaussian with variance of $B \cdot b/4$ . Therefore, the total noise + +$\frac{\Delta}{g}\sum_{i\in \mathcal{B}}\iota_{1,i} + \frac{\Delta}{g}\sum_{i\in \mathcal{B}}\iota_{2,i}$ is sub-Gaussian with variance given by + +$$ +\frac {\Delta^ {2}}{g ^ {2}} \cdot B + \frac {\Delta^ {2}}{g ^ {2}} \cdot B \cdot b / 4 \stackrel {(a)} {=} \frac {1}{g ^ {2}} \cdot B + \frac {1}{g ^ {2}} \cdot B \cdot b / 4 = O \left(\frac {(\log (d ^ {2} / \delta)) ^ {2}}{\varepsilon^ {2}}\right). +$$ + +where (a) holds by the fact that in $\mathcal{P}_{\mathrm{vec}}$ , $\Delta = 1$ . Thus, this implies that $\widetilde{\sigma}_1^2$ , $\widetilde{\sigma}_2^2$ in Assumption A.3 are satisfied with $O\left(M\frac{(\log(d^2/\delta))^2}{\varepsilon^2}\right)$ , hence $\sigma$ in Lemma A.4 is given by $\sigma = O\left(\sqrt{T/B}\frac{\log(d^2/\delta)}{\varepsilon}\right)$ , which leads to the following regret bound + +$$ +R (T) = \tilde {O} \left(d B + \frac {(\log (d ^ {2} / \delta)) ^ {1 / 2}}{\sqrt {\varepsilon}} d ^ {3 / 4} B ^ {- 1 / 4} T ^ {3 / 4}\right), +$$ + +Hence, we finish the proof. + +Proof of Corollary C.2. The regret bound simply follows from a balanced choice of $B$ in Theorem C.1. As before, JDP follows from SDP and Billboard lemma. To show the LDP guarantee, one way is to use DP property of Binomial mechanism and the refined advanced composition in (Cheu et al., 2021) across dimensions (cf. Lemma 3.3 in (Cheu et al., 2021)). However, there is a simple way to achieve this by noting that when $B = 1$ , the SDP guarantee of $\mathcal{P}_{\mathrm{Vec}}$ also implies LDP guarantee since now the shuffle output is the same as the output at each local randomizer9. Thus, by comparing the values of $b$ for a general $B$ and the case when $B = 1$ , we can see that $\varepsilon_0 = \varepsilon \sqrt{B}$ and $\delta_0 = \delta$ , i.e., an implicit privacy amplification by $\sqrt{B}$ . Note that, this simple way might lead to a larger term in $\delta$ . A careful analysis via Binomial mechanism and the (refined) advanced composition could yield something like $\varepsilon_0 = \varepsilon \sqrt{B} / \sqrt{\log(d^2 / \delta)}$ and $\delta_0 = \delta / d^2$ , where $d^2$ comes from the $d \times d$ matrix in the computation. Here we choose the simple way to avoid additional complexity for clarity. + +Proof of Corollary C.3. The LDP guarantee follows from the same trick as in the proof of Corollary C.2 which helps to avoid Binomial mechanism and advance composition over dimensions. To establish the regret bound, we can compare the values of $b$ in Corollary C.3 and the one in Theorem C.1. In particular, we can plug $\varepsilon = \frac{\varepsilon_0}{\sqrt{B}}$ and $\delta = \delta_0$ into the regret bound in Theorem C.1. Then, with a balanced choice of $B$ , we obtain the required regret. The SDP guarantee also follows from Theorem C.1 with $\varepsilon = \frac{\varepsilon_0}{\sqrt{B}}$ and $\delta = \delta_0$ . Finally, as in the proof of Corollary B.2, the JDP guarantee follows from SDP guarantee and Billboard lemma. + +# D. Joint Differential Privacy + +In this section, we will give formal DP definitions in the central model for linear contextual bandits. In particular, we first present the standard (event-level) definition which assumes all users are unique and then generalize it to (user-level) definition that allows for returning users. To this end, we first give the following general DP definition. + +Definition D.1 (General DP). A randomized mechanism $\mathcal{M}:\mathcal{D}\to \mathcal{R}$ satisfies $(\varepsilon ,\delta)$ -differential privacy if for any two adjacent datasets $X,X^{\prime}\in \mathcal{D}$ and for any measurable subsets of outputs $\mathcal{V}\subseteq \mathcal{R}$ it holds that + +$$ +\mathbb {P} \left[ \mathcal {M} (X) \in \mathcal {Y} \right] \leq \exp (\varepsilon) \mathbb {P} \left[ \mathcal {M} \left(X ^ {\prime}\right) \in \mathcal {Y} \right] + \delta . +$$ + +Remark D.2. All the DP definitions in our main paper can be viewed as a particular instantiation of Definition D.1 in terms of adjacent relation between two datasets and the corresponding output sequences. + +A straightforward adaptation of Definition D.1 to linear contextual bandits in the central model is to consider the sequence of $T$ unique users as the dataset, denoted by $U_{T} \coloneqq \{u_{1},\ldots ,u_{T}\} \in \mathcal{U}^{T}$ , and the corresponding prescribed actions as the output sequence, denoted by $\mathcal{M}(U_T) \coloneqq \{a_1,\dots ,a_t\} \in \mathcal{A}^T$ . This is the central trust model because the learning agent in the protocol can have direct access to users' sensitive information, but all the prescribed actions via the deployed algorithm are indistinguishable on two neighboring user sequences. Unfortunately, it is not hard to see that this is in conflict with the goal of personalization of linear contextual bandits, which essentially requires the algorithm to prescribe different actions to different users according to their contexts. Indeed, as shown in (Shariff & Sheffet, 2018), any learning protocol that satisfy the above notion of privacy protection has to incur a linear regret. Hence, to obtain a non-trivial utility-privacy trade-off, we need to relax DP to the notion called joint differential privacy (JDP) (Kearns et al., 2014) in the central model, which + +requires that simultaneously for any user $u_{t} \in U_{T}$ , the joint distribution of the actions recommended to all users other than $u_{t}$ be differentially private in the type of the user $u_{t}$ . It weakens the classic DP notion only in that the action suggested specifically to $u_{t}$ may be sensitive in her type (i.e., context and reward responses $^{10}$ ), as required by personalization. However, JDP is still a very strong definition since it protects $u_{t}$ from any arbitrary collusion of other users against her, so long as she does not herself reveal the action suggested to her. Formally, we let $\mathcal{M}_{-t}(U_T) \coloneqq \mathcal{M}(U_T) \setminus \{a_t\}$ to denote all the actions prescribed by the deployed algorithm excluding the one recommended to $u_{t}$ and based on it we have the definition of JDP as follows. + +Definition D.3 (Joint Differential Privacy (JDP)). A learning process of linear contextual bandits is $(\varepsilon, \delta)$ -joint differentially private if its deployed algorithm $\mathcal{M}: \mathcal{U}^T \to \mathcal{A}^T$ satisfies that for all $t \in [T]$ , for all neighboring user sequences $U_T, U_T' \in \mathcal{U}^T$ differing only on the $t$ -th user and for all set of actions $\mathcal{A}_{-t} \subseteq \mathcal{A}^{T-1}$ given to all but the $t$ -th user, + +$$ +\mathbb {P} \left[ \mathcal {M} _ {- t} (U _ {T}) \in \mathcal {A} _ {- t} \right] \leq \exp (\varepsilon) \mathbb {P} \left[ \mathcal {M} _ {- t} (U _ {T} ^ {\prime}) \in \mathcal {A} _ {- t} \right] + \delta . +$$ + +The above JDP definition assumes that all the $T$ users are unique, which is the standard event-level DP considered in existing similar works (Shariff & Sheffet, 2018; Vietri et al., 2020; Chowdhury & Zhou, 2021). That is, since each user only contributes one event in the total $T$ rounds, two user sequences $U_{T}$ and $U_{T}^{\prime}$ are said to be adjacent if they only differ at one round $t \in [T]$ . + +However, a more practical situation is that one user could contribute her data at multiple rounds, i.e., returning users. This motivates us to consider a user-level JDP, in which two user sequences $U_{T}$ and $U_{T}^{\prime}$ are adjacent if one replaces all the data associated with user $u$ to $u^{\prime}$ in $U_{T}$ results in $U_{T}^{\prime}$ . In this case, changing one user in the sequence could affect the data at multiple rounds. Accordingly, the output sequences need to remove all the actions at these rounds to avoid the conflict with personalization. Following the notations in (Dwork et al., 2010), we say $U_{T}$ and $U_{T}^{\prime}$ are neighboring sequences if there exist $u, u^{\prime}$ such that if one replaces some of $u$ in $U_{T}$ , the resultant sequence is $U_{T}^{\prime}$ . Formally, $U_{T}, U_{T}^{\prime}$ are neighboring with neighboring indices $\mathcal{I}$ , if there exist $u, u^{\prime} \in \mathcal{U}$ and index set $\mathcal{I} \subseteq [T]$ such that $U_{T}|_{\mathcal{I}:u \to u^{\prime}} = U_{T}^{\prime}$ , in which $U_{T}|_{\mathcal{I}:u \to u^{\prime}}$ means replacing $u$ by $u^{\prime}$ in $U_{T}$ at all indices in $\mathcal{I}$ . Meanwhile, we let $\mathcal{M}_{-}\mathcal{I}(U_T) := \mathcal{M}(U_T) \setminus a_{\mathcal{I}}$ , where $a_{\mathcal{I}}$ is the set of actions at indices in $\mathcal{I}$ . With these notations, we have the following formal definition. + +Definition D.4 (User-level JDP). A learning process of linear contextual bandits is $(\varepsilon, \delta)$ -joint differentially private if its deployed algorithm $\mathcal{M}: \mathcal{U}^T \to \mathcal{A}^T$ satisfies that for all neighboring user sequences $U_T, U_T' \in \mathcal{U}^T$ with neighboring indices given by $\mathcal{I}$ , and for all set of actions $\mathcal{A}_{-\mathcal{I}} \subseteq \mathcal{A}^{T - |\mathcal{I}|}$ , + +$$ +\mathbb {P} \left[ \mathcal {M} _ {- \mathcal {I}} (U _ {T}) \in \mathcal {A} _ {- \mathcal {I}} \right] \leq \exp (\varepsilon) \mathbb {P} \left[ \mathcal {M} _ {- \mathcal {I}} (U _ {T} ^ {\prime}) \in \mathcal {A} _ {- \mathcal {I}} \right] + \delta . +$$ + +Remark D.5. A straightforward way to achieve user-level JDP via event-level JDP is to use group privacy property of DP (Dwork et al., 2014; Vietri et al., 2020). In particular, suppose a mechanism is $(\varepsilon, \delta)$ -JDP (event-level), then it is $(k\varepsilon, ke^{(k-1)\varepsilon} \delta)$ -JDP (user-level) if each user contributes at most $k$ rounds. This black-box approach leads to a large increase in $\delta$ . We will show that a careful and direct analysis can improve this part while the linear increase in $\varepsilon$ is unchanged. This makes sense since the sensitivity now increases by a factor of $k$ . + +# E. Regret and Privacy Analysis Under Returning Users + +We consider the following returning users case. + +Assumption E.1 (Returning Users). Fix a batch size $B$ , any particular user can potentially participate in all $M = T / B$ batches, but within each batch $m \in [M]$ , she only contributes once. + +Under the above assumption, our previous SDP guarantee from one-round SDP protocol is no longer true. Instead, we now need to guarantee that outputs of all the batches together have a total privacy loss of $(\varepsilon, \delta)$ , since all of them may reveal the sensitive information of a given user if she participates in all the batches, i.e., worst-case scenario. To this end, we resort to advanced composition theorem (Dwork et al., 2014), which is restated as follows for an easy reference. + +Theorem E.2 (Advanced composition). Given target privacy parameters $\varepsilon' \in (0,1)$ and $\delta' > 0$ , to ensure $(\varepsilon', k\delta + \delta') - DP$ for the composition of $k$ (adaptive) mechanisms, it suffices that each mechanism is $(\varepsilon, \delta)$ - $DP$ with $\varepsilon = \frac{\varepsilon'}{2\sqrt{2k\log(1/\delta')}^2}$ . + +# E.1. LDP Amplification Protocol + +Theorem E.3 (Formal statement of (i) in Theorem 4.2). Let Assumption 3.1 and Assumption E.1 hold. For any $\varepsilon \in [0, \frac{2}{B} \log(2/\delta) \sqrt{2T}]$ , $\delta \in (0, 1]$ and $B \in [T]$ , let $\sigma_1 = \sigma_2 = \frac{16 \log(2/\delta) \sqrt{T(\log(5T/\delta))}}{\varepsilon B}$ . Then, Algorithm 1 instantiated using $\mathcal{P}_{Amp}$ is $O(\varepsilon, \delta)$ -SDP. Furthermore, for any $\alpha \in (0, 1]$ , setting $\lambda = \Theta(\sqrt{T} \sigma_1(\sqrt{d} + \sqrt{\log(T/B\alpha)})$ , it has the following regret + +$$ +R e g (T) = O \left(\frac {d T}{M} \log T + \sqrt {\frac {M T}{\varepsilon}} d ^ {3 / 4} \log^ {1 / 4} (T / \delta) \log^ {1 / 2} (2 / \delta) \log T \log (T / \alpha)\right). +$$ + +The following corollary says that if the batch schedule also depends on privacy parameters, one can improve the dependence on $\varepsilon$ , i.e., from $\varepsilon^{-1/2}$ to $\varepsilon^{-1/3}$ . + +Corollary E.4 (Utility-targeted). Under the same assumption in Theorem E.3 and $B = O(d^{-1/6}\varepsilon^{-1/3}T^{2/3}(\log(T/\delta))^{1/2})$ , Algorithm 1 instantiated using $\mathcal{P}_{Amp}$ achieves $O(\varepsilon, \delta)$ -SDP with regret + +$$ +R (T) = \tilde {O} \left(d ^ {5 / 6} T ^ {2 / 3} \varepsilon^ {- 1 / 3} (\log (T / \delta)) ^ {1 / 2}\right). +$$ + +Proof of Theorem E.3. First, by advanced composition in Theorem E.2, if we let each batch's privacy parameters be $\varepsilon_{m} = \frac{\varepsilon}{2\sqrt{2M\log(2 / \delta)}}$ and $\delta_m = \delta /(2M)$ , then final privacy guarantee is $(\varepsilon ,\delta)$ -DP. Thus, we only need to replace $\varepsilon$ by $\varepsilon_{m}$ and $\delta$ by $\delta_{m}$ in Theorem B.1 + +# E.2. Vector Summation Protocol + +Theorem E.5 (Formal statement of (ii) in Theorem 4.2). Let Assumption 3.1 and Assumption E.1 hold. Then, for any $\varepsilon \leq 15$ , $\delta \in (0,1/2)$ and $B \in [T]$ , let + +$$ +g = \max \{2 \sqrt {B}, d, 4 \}, b = \frac {1 0 ^ {7} \cdot \log (2 / \delta) \cdot g ^ {2} \cdot T \cdot \left(\log \left(\frac {8 \cdot T (d ^ {2} + 1)}{B \delta}\right)\right) ^ {2}}{\varepsilon^ {2} B ^ {2}}, p = 1 / 4. +$$ + +Algorithm 1 instantiated using $\mathcal{P}_{Vec}$ is $(\varepsilon, \delta)$ -SDP. Furthermore, for any $\alpha \in (0,1]$ , setting + +$$ +\lambda = \Theta \left(\frac {T \sqrt {\log (2 / \delta)} \log (d ^ {2} T / (B \delta))}{B} \left(\sqrt {d} + \sqrt {\log (T / (B \alpha))}\right)\right), +$$ + +then it has the regret bound + +$$ +R e g (T) = O \left(\frac {d T}{M} \log T + \sqrt {\frac {M T}{\varepsilon}} d ^ {3 / 4} \log^ {3 / 4} \left(d ^ {2} M / \delta\right) \log T \log \left(T / \alpha\right)\right). +$$ + +Corollary E.6 (Utility-targeted). Under the same assumption in Theorem E.5, $B = O(d^{-1/6}\varepsilon^{-1/3}T^{2/3}(\log(Td^2/\delta))^{1/2})$ , Algorithm 1 instantiated using $\mathcal{P}_{Vec}$ achieves $(\varepsilon, \delta)$ -SDP with regret + +$$ +R (T) = \widetilde {O} \left(d ^ {5 / 6} T ^ {2 / 3} \varepsilon^ {- 1 / 3} \left(\log \left(d ^ {2} T / \delta\right)\right) ^ {1 / 2}\right). +$$ + +Proof of Theorem E.5. First, by advanced composition in Theorem E.2, if we let each batch's privacy parameters be $\varepsilon_{m} = \frac{\varepsilon}{2\sqrt{2M\log(2 / \delta)}}$ and $\delta_m = \delta /(2M)$ , then final privacy guarantee is $(\varepsilon ,\delta)$ -DP. Thus, we only need to replace $\varepsilon$ by $\varepsilon_{m}$ and $\delta$ by $\delta_{m}$ in Theorem C.1 + +# E.3. JDP under Returning Users + +As mentioned before, existing algorithm with JDP guarantee assumes unique users, i.e., event-level JDP given by Definition D.3. To handle returning users, we need to consider user-level JDP given by Definition D.4. One straightforward way is + +to resort to group privacy (Dwork et al., 2014). That is, if any user appears at most $M_0$ rounds in the process, the original $(\varepsilon, \delta)$ -JDP algorithm proposed in (Shariff & Sheffet, 2018) now achieves $(M_0\varepsilon, M_0\exp((M_0 - 1)\varepsilon)\delta)$ -JDP (user-level). However, this black-box will incur a large loss in the $\delta$ term. To overcome this, we note that a simple modification of the added noise in the original algorithm in (Shariff & Sheffet, 2018) will work. In particular, we scale up the noise variance by a multiplicative factor of $M_0^2$ , if any user participates in at most $M_0$ rounds. This follows from the fact that flipping one user now would change the $\ell_2$ sensitivity of the expanded binary-tree nodes from $O(\sqrt{\log T})$ to $O(M_0\sqrt{\log T})$ . Then, utilizing our derived generic regret bound in Lemma A.4, yields the following result. + +Proposition E.7. If any user participates in at most $M_0$ rounds, the algorithm in Shariff & Sheffet (2018), with the above modification to handle user-level privacy, achieves the high-probability regret bound + +$$ +R e g (T) = \widetilde {O} \left(d \sqrt {T} + \sqrt {\frac {M _ {0} T}{\varepsilon}} d ^ {3 / 4} \log^ {1 / 4} (1 / \delta)\right). +$$ + +Proof. The key idea behind the regret analysis in the central model for linear contextual bandits is (Shariff & Sheffet, 2018) is to utilize the following two properties of the so-called tree-based mechanism (or binary counting mechanism) (Chan et al., 2010): (i) change of each leaf-node (corresponding to a user's data) only incurs the change of $l_{2}$ -sensitivity of the expanded binary-tree by $O(\sqrt{\log T})$ ; (ii) for any $t \in [T]$ , the summation of data from time 1 to $t$ only involves at most $O(\log T)$ tree nodes. Property (i) is used to compute the added noise at each node to guarantee privacy while property (ii) is used to compute the total noise in the private sum when bounding the regret. Now, in the case of returning users, if we flip one user's data, it will change the $l_{2}$ -sensitivity of the expanded binary-tree by $O(M_0\sqrt{\log T})$ , i.e., an additional $M_0$ factor in the sensitivity, which leads to the additional $M_0^2$ factor in the added noise. Property (ii) is the same as before, i.e., total number of noise is at most $O(\log T)$ . Finally, by Lemma A.4, we have the result. + +# F. Batched Algorithms for Local and Central Models + +To start with, for the batched algorithm in the local model, one can simply replace the shuffler in Algorithm 1 by an identity mapping while using the same local randomizer as in (Zheng et al., 2020) (i.e., Gaussian mechanism). We call this algorithm Batched-Local-LinUCB. Thanks to Lemma A.4, we have the following privacy and regret guarantees. + +Proposition F.1. Let Assumption 3.1 hold. Fix any $\varepsilon_0\in [0,1]$ , $\delta_0\in (0,1]$ and $\alpha \in [0,1]$ , let $\sigma_{1} = \sigma_{2} = \frac{4\sqrt{2\log(2.5 / \delta_{0})}}{\varepsilon_{0}}$ . Then, for all $B\in [T]$ , Bathed-Local-LinUCB is $(\varepsilon_0,\delta_0)$ -LDP and with probability at least $1 - \alpha$ + +$$ +R (T) = \tilde {O} \left(d B + T ^ {3 / 4} d ^ {3 / 4} \frac {(\log (1 / \delta)) ^ {1 / 4}}{\sqrt {\varepsilon_ {0}}} \log (T / \alpha)\right). +$$ + +Remark F.2. The above theorem indicates that it suffices to update every $B = \tilde{O}(T^{3/4})$ to ensure the same privacy and regret guarantees as in the sequential case. + +For the batched algorithm in the central model, we can make the following simple modification over the sequential one in (Shariff & Sheffet, 2018), which relies on the seminal tree-based algorithm (Chan et al., 2010) at the central server (analyzer) to balance between privacy and regret. In the batched case, instead of updating the binary-tree nodes after every round, the server updates them only after each batch by treating the sum of the statistics (i.e., vectors or matrices) within the batch as a single new observation. We call this algorithm Batched-Central-LinUCB. With this modification and Lemma A.4, we have the following privacy and regret guarantees. + +Proposition F.3. Let Assumption 3.1 hold. Fix any $\varepsilon \in [0,1]$ , $\delta \in (0,1]$ and $\alpha \in [0,1]$ . Then, for all $B \in [T]$ , Bathed-Central-LinUCB is $(\varepsilon, \delta)$ -JDP and with probability at least $1 - \alpha$ + +$$ +R (T) = \tilde {O} \left(d B + \sqrt {T} d ^ {3 / 4} \frac {(\log (1 / \delta)) ^ {1 / 4}}{\sqrt {\varepsilon}} \log (T / \alpha)\right). +$$ + +Remark F.4. The above theorem indicates that it suffices to update every $B = \tilde{O}(\sqrt{T})$ to attain the same privacy-regret trade-off as in the sequential case. + +# G. Additional Experimental Results + +![](images/19731acf5a0effd2ded481eff494d729f74f5fb09f8590c0f533fc59c3108c59.jpg) +(a) $d = 10$ + +![](images/5a35269bb0ccb917ccdd458ed0e40a8c8bd9b2aa86d6199768c1c9bfce706ecd.jpg) +(b) $d = 15$ +Figure 2: Comparison of cumulative regret for LinUCB (non-private), LinUCB-JDP (central model), LinUCB-SDP (shuffle model) and LinUCB-LDP (local model) with privacy level $\varepsilon = 1$ for varying feature dimension $d = 10$ (a) and $d = 15$ (b). In all cases, regret of LinUCB-SDP lies perfectly in between LinUCB-JDP and LinUCB-LDP, achieving finer regret-privacy trade-off. \ No newline at end of file diff --git a/shuffleprivatelinearcontextualbandits/images.zip b/shuffleprivatelinearcontextualbandits/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..d0a0af91c88b04fe5cb6e649e817d1ddb9fd4464 --- /dev/null +++ b/shuffleprivatelinearcontextualbandits/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0483d719ba3c4710c53dc3e3cb68a6034352f05fef24484ea05b601a550a9b82 +size 730944 diff --git a/shuffleprivatelinearcontextualbandits/layout.json b/shuffleprivatelinearcontextualbandits/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..ba0d306ff2a958941dcfd124bf96d7edf0667db0 --- /dev/null +++ b/shuffleprivatelinearcontextualbandits/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a61950b08a520138d74dda3e91cff4bc79fc796a1da84a55bac23fa1abe811dd +size 1446223 diff --git a/simpleandnearoptimalalgorithmsforhiddenstratificationandmultigrouplearning/45073b34-7249-4310-bb45-61c3d2ae9c9a_content_list.json b/simpleandnearoptimalalgorithmsforhiddenstratificationandmultigrouplearning/45073b34-7249-4310-bb45-61c3d2ae9c9a_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..f461a1d86ea5d9f5b0101c13006e63712e1d2ff3 --- /dev/null +++ b/simpleandnearoptimalalgorithmsforhiddenstratificationandmultigrouplearning/45073b34-7249-4310-bb45-61c3d2ae9c9a_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4ad0e0343cda044b142fb271d8f1ab3fb117881eeda389c09155f67fd18a4e3d +size 197657 diff --git a/simpleandnearoptimalalgorithmsforhiddenstratificationandmultigrouplearning/45073b34-7249-4310-bb45-61c3d2ae9c9a_model.json b/simpleandnearoptimalalgorithmsforhiddenstratificationandmultigrouplearning/45073b34-7249-4310-bb45-61c3d2ae9c9a_model.json new file mode 100644 index 0000000000000000000000000000000000000000..dc315d1442691593963fde8d646f8c81e80eb702 --- /dev/null +++ b/simpleandnearoptimalalgorithmsforhiddenstratificationandmultigrouplearning/45073b34-7249-4310-bb45-61c3d2ae9c9a_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d0a9cd50057caec2fd9eafd655e5a9724b4f147e3546b8d158de679adba031d6 +size 231461 diff --git a/simpleandnearoptimalalgorithmsforhiddenstratificationandmultigrouplearning/45073b34-7249-4310-bb45-61c3d2ae9c9a_origin.pdf b/simpleandnearoptimalalgorithmsforhiddenstratificationandmultigrouplearning/45073b34-7249-4310-bb45-61c3d2ae9c9a_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..4a747081c9d20574a330c8fd38261ea9ea002f24 --- /dev/null +++ b/simpleandnearoptimalalgorithmsforhiddenstratificationandmultigrouplearning/45073b34-7249-4310-bb45-61c3d2ae9c9a_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:50354623ce6213309920605dabf3543a9ce981ef421ec4ae823176984116f1a8 +size 413462 diff --git a/simpleandnearoptimalalgorithmsforhiddenstratificationandmultigrouplearning/full.md b/simpleandnearoptimalalgorithmsforhiddenstratificationandmultigrouplearning/full.md new file mode 100644 index 0000000000000000000000000000000000000000..3ae6aa346014d634797a504e02930cbf46480d0e --- /dev/null +++ b/simpleandnearoptimalalgorithmsforhiddenstratificationandmultigrouplearning/full.md @@ -0,0 +1,1257 @@ +# Simple and near-optimal algorithms for hidden stratification and multi-group learning + +Christopher Tosh1 Daniel Hsu2 + +# Abstract + +Multi-group agnostic learning is a formal learning criterion that is concerned with the conditional risks of predictors within subgroups of a population. The criterion addresses recent practical concerns such as subgroup fairness and hidden stratification. This paper studies the structure of solutions to the multi-group learning problem, and provides simple and near-optimal algorithms for the learning problem. + +# 1. Introduction + +Despite its status as the de facto selection criterion for machine learning models, accuracy is an aggregate statistic that often obscures the underlying structure of mistaken predictions. Oakden-Rayner et al. (2020) recently raised this concern in the context of medical image analysis. Consider the problem of diagnosing an image as cancerous or not. Certain types of aggressive cancers may be less common than some non-aggressive types. Thus, classifiers that concentrate their errors on images of these rarer and more aggressive cancers can achieve higher overall accuracy than classifiers that spread their errors more evenly over all types of cancer. However, choosing classifiers that concentrate their errors on these rarer cancers is clearly not ideal, as it could lead to harmful misdiagnoses for those who need treatment the most. Oakden-Rayner et al. refer to this general phenomenon as the hidden stratification problem, where there is some latent grouping of the data domain and performance on these latent groups is just as important as performance on the entire domain. + +Similar scenarios arise in areas where fairness is a concern (see, e.g., Hardt et al., 2016). Here, the concern is that for applications such as credit recommendation or loan ap + +$^{1}$ Memorial Sloan Kettering Cancer Center, New York, NY $^{2}$ Department of Computer Science, Columbia University, New York, NY. Correspondence to: Christopher Tosh , Daniel Hsu . + +Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s). + +proval the errors of models may be concentrated on certain demographic groups and potentially exacerbate pre-existing social disadvantages. This issue can persist even when protected class information such as race or age is not explicitly included in the model, as other features often serve as good proxies for protected class information. + +The multi-group (agnostic) learning setting, formalized by Rothblum & Yona (2021a), is a learning-theoretic model for addressing these scenarios. This setting is specified by a collection of groups $\mathcal{G}$ , where each group $g \in \mathcal{G}$ is a subset of the input space, and a set of reference predictors $\mathcal{H}$ . Here, the groups in $\mathcal{G}$ can overlap in arbitrary ways, and $|\mathcal{G}|$ need not be finite. The multi-group learning objective is to find a predictor $f$ such that, for all groups $g \in \mathcal{G}$ simultaneously, the average loss of $f$ among examples in $g$ is comparable with that of the best predictor $h_g \in \mathcal{H}$ specific to $g$ . This learning objective thus pays attention to the group that is worst off with respect to $\mathcal{H}$ . Note that because a good reference predictor $h_g$ for one group $g$ may be very poor for another group $g'$ , a successful multi-group learner may need to choose its predictor $f$ from outside of $\mathcal{H}$ . + +Rothblum & Yona (2021a) obtained initial results for multi-group learning (and, in fact, study a broader class of objectives compared to what we consider here), but they leave open several theoretical questions that we address in this paper. First, while it is known that uniform convergence of empirical risks with respect to $\mathcal{H}$ is necessary and sufficient for the standard agnostic learning model, it is not clear whether the same holds for multi-group learning, let alone whether the sample complexities are equivalent. Second, Rothblum & Yona focus on finite $\mathcal{G}$ , but the motivation from hidden stratification may require the use of rich and infinite families of groups in order to well-approximate the potentially unknown strata of importance. Finally, Rothblum & Yona obtained their algorithm via a blackbox reduction to a more general problem, leaving open the possibility of simpler algorithms and prediction rules with multi-group learning guarantees. + +# 1.1. Summary of results + +We introduce some notation in order to state our results. Given $n$ i.i.d. training examples drawn from a distribution + +$\mathcal{D}$ over $\mathcal{X} \times \mathcal{Y}$ , let $\#_n(g)$ for a group $g \subseteq \mathcal{X}$ denote the number of training examples $(x, y)$ with $x \in g$ . For a predictor $f: \mathcal{X} \to \mathcal{Z}$ and a group $g \subseteq \mathcal{X}$ , let + +$$ +L (f \mid g) = \mathbb {E} _ {(x, y) \sim \mathcal {D}} [ \ell (f (x), y) \mid x \in g ] +$$ + +denote the conditional risk of $f$ on $g$ , and $\ell \colon \mathcal{Z} \times \mathcal{Y} \to [0,1]$ is a bounded loss function. + +Our first multi-group learning result is an algorithm to learn simple predictors with per-group conditional risk guarantees. Here, the class of 'simple predictors' we consider is the collection of decision lists in which internal (decision) nodes are associated with membership tests for groups from $\mathcal{G}$ , and leaf (prediction) nodes are associated with reference predictors from $\mathcal{H}$ . + +Theorem 4 (Informal). There is an algorithm $\mathcal{A}$ such that the following holds for any hypothesis set $\mathcal{H}$ and set of groups $\mathcal{G}$ . Given $n$ i.i.d. training examples from $\mathcal{D}$ , $\mathcal{A}$ produces a decision list $f$ such that, with high probability, + +$$ +L (f \mid g) \leq \inf _ {h \in \mathcal {H}} L (h \mid g) + O \left(\left(\frac {\log | \mathcal {H} | | \mathcal {G} |}{\gamma_ {n} \cdot \# _ {n} (g)}\right) ^ {1 / 3}\right) +$$ + +for all $g \in \mathcal{G}$ , where $\gamma_n \coloneqq \min_{g \in \mathcal{G}} \#_n(g) / n$ is the minimum empirical probability mass among groups in $\mathcal{G}$ .1 + +When $\mathcal{H}$ and $\mathcal{G}$ are infinite, a version of Theorem 4 also holds when the complexities of $\mathcal{H}$ and $\mathcal{G}$ are appropriately bounded; see Theorem 6 for a formal statement. + +Though the algorithm and resulting predictors of Theorem 4 and Theorem 6 are quite simple, the per-group excess error rates are suboptimal. Statistical learning theory suggests that if we knew a priori which group $g$ we would be tested on, empirical risk minimization (ERM) on the i.i.d. training examples restricted to $g$ would lead to an excess risk of $O(\sqrt{\log(|\mathcal{H}|)/\#\#_n(g)})$ in the finite setting (Shalev-Shwartz & Ben-David, 2014). The rates in Theorem 4 have two undesirable properties when compared to this theoretical rate: they have a worse exponent, and they depend on the minimum probability mass among all the groups. + +Our next result shows that the theoretical rate suggested by per-group ERM can be achieved in the multi-group learning setting, modulo a logarithmic factor in $|\mathcal{G}|$ . + +Theorem 8 (Informal). There is an algorithm $\mathcal{A}$ such that the following holds for any finite hypothesis set $\mathcal{H}$ and finite set of groups $\mathcal{G}$ . Given $n$ i.i.d. training examples from $\mathcal{D}$ , $\mathcal{A}$ produces a randomized predictor $f$ such that, with high probability, + +$$ +L (f \mid g) \leq \inf _ {h \in \mathcal {H}} L (h \mid g) + O \left(\left(\frac {\log (\left| \mathcal {H} \right| \left\| \mathcal {G} \right|)}{\# _ {n} (g)}\right) ^ {1 / 2}\right) +$$ + +for all $g\in \mathcal{G}$ + +The improved rates of Theorem 8 come at the expense of increased complexity in both learning procedure and prediction algorithm. + +In our final result, we show that in the group-realizable setting, where each group has a corresponding perfect predictor, this trade-off between optimal rates and simple algorithms is unnecessary. + +Theorem 10 (Informal). There is an algorithm $\mathcal{A}$ such that the following holds for any finite hypothesis set $\mathcal{H}$ and finite set of groups $\mathcal{G}$ such that for all $g\in \mathcal{G}$ there exists an $h\in \mathcal{H}$ satisfying $L(h\mid g) = 0$ . Given $n$ i.i.d. training examples from $\mathcal{D}$ , $\mathcal{A}$ produces a predictor $f$ such that, with high probability, + +$$ +L (f \mid g) \leq O \left(\frac {\log (| \mathcal {H} | | \mathcal {G} |)}{\# _ {n} (g)}\right) \quad f o r a l l g \in \mathcal {G}. +$$ + +# 1.2. Related work + +There are a number of areas of active research that intersect with the present paper. + +Distributionally robust optimization. The field of distributionally robust optimization, or DRO, focuses on the problem of optimizing some cost function such that the cost of the solution is robust to perturbations in the problem instance (Ben-Tal et al., 2009). In the context of machine learning and statistics, the idea is to use data from some training distribution to learn a predictor that will perform well when used on a worst-case choice of test distribution from some known class. In this field, the class of test distributions is typically a small perturbation of the training distribution (Bertsimas et al., 2018; Duchi et al., 2021; 2020). + +A special case of DRO of particular relevance to the current work is group-wise DRO. Here, the class of test distributions is fixed to be a finite set of distributions, and the goal is to find a predictor whose worst-case conditional risk over any of these test distributions is minimized. Several solutions for this problem have been proposed, including mirror descent (Mohri et al., 2019), group-wise regularization (Sagawa et al., 2020a), group-wise sample reweighting (Sagawa et al., 2020b), and two-stage training procedures (Liu et al., 2021). + +Group and individual fairness. As discussed above, prediction mistakes committed by machine-learned models can lead to widespread social harms, particularly if they are concentrated on disadvantaged social groups. To address this, a recent, but large, body of work has emerged to define fairness criteria of predictors and develop machine learning methods that meet these criteria. While many criteria for fair predictors abound, they can typically be broken into two + +categories. The first of these is group-wise fairness (Hardt et al., 2016; Agarwal et al., 2018; Donini et al., 2018) in which a classifier is trained to equalize some notion of harm, such as false-negative predictions, or benefit, such as true-positive predictions, across predefined groups. The second category of fairness notion is individual fairness (Dwork et al., 2012; Dwork & Ilvento, 2018), in which there is a distance function or notion of similarity among points, and the objective is to give similar predictions for similar points. + +Of particular relevance to the present paper is the work of Kearns et al. (2018), which studied group fairness for a large (potentially infinite) number of (potentially overlapping) groups. The authors assumed boundedness of the VC-dimensions for both the hypothesis class and the class of groups, as well as access to an oracle for solving certain cost-sensitive classification problems. Under these assumptions, they provided an algorithm that solves for a convex combination of hypotheses from the hypothesis class that respects certain notions of fairness for all groups and is competitive with the best such fair convex combination. + +Online fairness. There is a growing body of work at the intersection of online learning and fairness (Gillen et al., 2018; Noarov et al., 2021; Gupta et al., 2021). The most relevant to the present paper is the work of Blum & Lykouris (2020), which studies an online version of multi-group learning where the goal is to achieve low regret on each of the groups simultaneously. That work gives a reduction to sleeping experts, showing that for a particular choice of experts, the regret guarantees of the sleeping experts algorithm directly translates to a per-group regret guarantee. Inspired by this observation, in Section 4 we show that the offline multi-group learning problem can also be reduced to the sleeping experts problem. The online-to-batch conversion argument we use requires some care, however, since there are multiple objectives (one for each group) that need to be satisfied, in contrast to standard online-to-batch settings where only a single objective needs to be met. + +Multicalibration, multiaccuracy, and outcome distinguishability. Also motivated by fairness considerations, a recent line of work is centered on calibrating predictions to be unbiased on a collection of groups or subpopulations. + +Given a class of groups $\mathcal{G}$ , multiaccuracy requires that the expectation of a predictor is close to expectation of the outcome $y$ when conditioned on any $g \in \mathcal{G}$ (Hébert-Johnson et al., 2018; Diana et al., 2021). Kim et al. (2019) showed that for an appropriate choice of groups, multiaccuracy implies a type of multi-group learnability result. Unfortunately, the upper bound they show for the per-group error rate is only non-trivial when the best rate achievable at that group is small. In Appendix E, we show that this looseness is inherent to this type of multiaccuracy reduction. + +Multicalibration is a more stringent notion than multiaccuracy that requires these expectations to be close when conditioned both on the group and the value of the prediction. Even more stringent is outcome indistinguishability, a family of criteria that requires the predictions of a function $f: \mathcal{X} \to [0,1]$ to be indistinguishable against the true probabilities of positive versus negative outcomes with respect to classes of distinguishing algorithms with varying levels of access to the underlying distribution (Dwork et al., 2021). + +Using a reduction to the outcome indistinguishability framework, Rothblum & Yona (2021a) provided an algorithm with a multi-group learning guarantee. Specifically, they showed that for a given finite hypothesis class $\mathcal{H}$ and finite set of groups $\mathcal{G}$ , one can produce a predictor $f: \mathcal{X} \to \mathbb{R}$ such that $L(f \mid g) \leq \min_{h \in \mathcal{H}} L(h \mid g) + \epsilon$ for all $g \in \mathcal{G}$ with probability $1 - \delta$ . The sample complexity of their approach is $O\left(\frac{m_{\mathcal{H}}(\epsilon, \delta)^4}{\delta^4 \gamma} \log \frac{|\mathcal{H}||\mathcal{G}|}{\epsilon}\right)$ , where $m_{\mathcal{H}}(\epsilon, \delta)$ is the sample complexity of agnostically learning a classifier $h \in \mathcal{H}$ with excess error $\epsilon$ and failure probability $\delta$ (Rothblum & Yona, 2021b). Standard ERM arguments give us $m_{\mathcal{H}}(\epsilon, \delta) = O\left(\frac{1}{\epsilon^2} \log \frac{|\mathcal{H}|}{\delta}\right)$ , leading to an overall sample complexity of $O\left(\frac{1}{\epsilon^8 \delta^4 \gamma} \text{poly} \log \frac{|\mathcal{H}||\mathcal{G}|}{\epsilon \delta}\right)$ . + +In independent and concurrent work, Globus-Harris et al. (2022) also considered a multi-group learning setup under the framework of 'bias bug bounties.' In this setting, there is some deployed model and outsiders are incentivized to find groups on which the model does worse than Bayes optimal. If such a group is found, one can submit the group as well as a certificate of suboptimality to receive a bounty, and the model will be updated to improve performance on the affected group. Interestingly, the algorithm developed by Globus-Harris et al. to update their model (which they call LISTUPDATE) is equivalent to one of the algorithms presented in the present paper (PREPEND). Beyond the development of the concept of bias bug bounties, Globus-Harris et al. are primarily concerned with the computational complexity of finding such bounties, whereas the present work is focused on the statistical sample complexity of multi-group learning. + +Hidden stratification. The hidden stratification problem refers to settings where there are meaningful subgroups or divisions of the data space, but they are unknown ahead of time. The fear, as illustrated by Oakden-Rayner et al. (2020), is that prediction errors can be concentrated on some important subgroup and lead to real-world harms. Sohoni et al. (2020) proposed addressing this problem by clustering + +a dataset and solving a DRO problem as if the resulting clusters were the true known subgroups. + +Transfer learning and covariate shift. Broadly speaking, transfer learning studies the problem of learning a predictor given many samples from a source distribution $P$ and relatively few (or perhaps no) samples from a target distribution $Q$ , where the predictor will ultimately be evaluated on $Q$ . The results in this area depend on what is allowed to change between $P$ and $Q$ . Some works study the setting of covariate shift, where only the covariate distribution is allowed to change (Shimodaira, 2000; Zadrozny, 2004; Cortes et al., 2010; Kpotufe & Martinet, 2018; Hopkins et al., 2021). Others focus on label shift, where only the marginal label distribution changes, leaving the class conditional distributions unchanged (Azizzadenesheli et al., 2018). Finally, in the most general setting, $P$ and $Q$ may differ in both covariates and labels (Ben-David et al., 2010). + +Of these transfer learning settings, the covariate shift framework most closely resembles the multi-group learning setting. However, the two key differences are that (1) the transfer learning setting is typically concerned with performance on a single target distribution and (2) the target distributions that arise in multi-group learning are restricted to conditional distributions of the source distribution. Importantly, in the multi-group learning setup, the target distributions never have support that is outside of the source distribution. Because of this restriction, we can achieve a much stronger performance guarantee compared to what is possible in the setting of general covariate shift. + +One work that deviates from the single-target distribution framework is that of Hopkins et al. (2021), whose notion of covariate shift error is the maximum error over a set of target distributions, similar to the multi-group learning setup. However, in the covariate shift setting of Hopkins et al. (2021), there is only a single such benchmark hypothesis for all possible shifts, whereas in our multi-group setting, the benchmark hypothesis is allowed to depend on the group. Thus the guarantees in the setting of Hopkins et al. (2021) are not comparable to those in our setting. + +Boosting. Boosting is a classical machine learning technique for converting weak learners, i.e., learners that output predictors that are only marginally more accurate than random guessing, into strong learners, i.e., learners that output predictors with very high accuracy (Schapire, 1990; Freund, 1995). Many of the algorithms for achieving multiaccuracy, multicalibration, and outcome indistinguishability can be viewed as boosting algorithms (Hébert-Johnson et al., 2018; Kim et al., 2019; Dwork et al., 2021). For instance, the algorithm of Kim et al. (2019) is based on the boosting algorithm of Trevisan et al. (2009). One of the algorithms proposed in this paper, PREPEND, is no exception here and + +may also be viewed as a boosting algorithm. + +# 1.3. Paper outline + +The remainder of the paper is organized as follows. In Section 2, we formalize the multi-group learning setting. In Section 3 we present a simple algorithm for the multi-group learning problem that achieves a suboptimal generalization bound. In Section 4, we give a reduction to the online sleeping experts problem. The resulting algorithm achieves the correct generalization rate, though this comes at the expense of a significantly more complicated learning algorithm. Finally, in Section 5, we consider a setting in which each group has a corresponding perfect classifier. Here we show that there is no need to trade off simplicity and optimality: a relatively simple algorithm achieves the optimal per-group performance guarantee. + +All proofs are presented in the appendix. + +# 2. Setting and notation + +Let $\mathcal{X}$ denote an input space, $\mathcal{Y}$ denote a label space, and $\mathcal{Z}$ denote a prediction space. Let $\mathcal{D}$ denote a distribution over $\mathcal{X} \times \mathcal{Y}$ . Throughout, $\mathcal{H} \subseteq \{h : \mathcal{X} \to \mathcal{Z}\}$ denotes a (benchmark) hypothesis class. A group $g$ is a subset of the space $\mathcal{X}$ . We overload notation by identifying a group $g \subseteq \mathcal{X}$ with the binary function $g : \mathcal{X} \to \{0,1\}$ that indicates membership in $g$ . We denote the set of groups of interest by $\mathcal{G}$ , and let $P(g) := \mathbb{E}_{(x,y) \sim \mathcal{D}}[g(x)]$ for any group $g$ . Let $\ell \colon \mathcal{Z} \times \mathcal{Y} \to [0,1]$ be a bounded loss function, and for a predictor $f \colon \mathcal{X} \to \mathcal{Z}$ , the conditional risk of $f$ given $g$ is + +$$ +L (f \mid g) := \mathbb {E} _ {(x, y) \sim \mathcal {D}} [ \ell (f (x), y) \mid x \in g ]. +$$ + +For an i.i.d. sample $(x_{1},y_{1}),\ldots ,(x_{n},y_{n})\sim \mathcal{D}$ , we define the following empirical quantities: let $\# _n(g):=\sum_{i = 1}^{n}g(x_i),P_n(g):= \# _n(g) / n$ , and + +$$ +L _ {n} (f \mid g) := \frac {1}{\# _ {n} (g)} \sum_ {i = 1} ^ {n} g \left(x _ {i}\right) \ell \left(f \left(x _ {i}\right), y _ {i}\right). +$$ + +The (unconditional) risk and empirical risk of $f$ are $L(f) \coloneqq \mathbb{E}_{(x,y)\sim \mathcal{D}}[\ell (f(x),y)]$ and $L_{n}(f)\coloneqq \frac{1}{n}\sum_{i = 1}^{n}\ell (f(x_{i}),y_{i})$ . + +# 2.1. Multi-group agnostic learning + +At a high level, the objective in the multi-group (agnostic) learning setting is to find a predictor $f$ such that the conditional risk is not much larger than $\inf_{h \in \mathcal{H}} L(h \mid g)$ for all $g \in \mathcal{G}$ . This setting was formalized by Rothblum & Yona (2021a); they require, for a given $\epsilon > 0$ , that the excess conditional risks be uniformly small over all groups $g \in \mathcal{G}$ : + +$$ +L (f \mid g) \leq \inf _ {h \in \mathcal {H}} L (h \mid g) + \epsilon \quad \text {f o r a l l} g \in \mathcal {G}. \tag {1} +$$ + +Note that the best hypothesis in the benchmark class $h_g \in \mathcal{H}$ for a particular group $g$ may not be the same as that for a different group $g'$ . Indeed, there may be no single $h \in \mathcal{H}$ that has low conditional risk for all groups in $\mathcal{G}$ simultaneously. Hence, a learner may typically need to choose a predictor $f$ from outside of $\mathcal{H}$ . + +We will give non-uniform bounds on the excess conditional risks (discussed below), where $\epsilon$ is replaced by a quantity $\epsilon_{n}(g)$ depending on both the size $n$ training set and the specific group $g\in \mathcal{G}$ in question: + +$$ +L (f \mid g) \leq \inf _ {h \in \mathcal {H}} L (h \mid g) + \epsilon_ {n} (g) \quad \text {f o r a l l} g \in \mathcal {G}. \tag {2} +$$ + +The quantity $\epsilon_{n}(g)$ will be a decreasing function of $\#_n(g)$ , and it will be straightforward to determine a minimum sample size $n$ (in terms of a prescribed $\epsilon > 0$ ) such that Eq. (2) implies Eq. (1). + +# 2.2. Convergence of conditional risks + +For a class of $\{0,1\}$ -valued functions $\mathcal{F}$ defined over a domain $\mathcal{X}$ , the $k$ -th shattering coefficient, is given by + +$$ +\Pi_ {k} (\mathcal {F}) := \max _ {x _ {1}, \dots , x _ {k} \in \mathcal {X}} \left| \left\{\left(f (x _ {1}), \dots , f (x _ {k})\right): f \in \mathcal {F} \right\} \right|. +$$ + +For a class of real-valued functions $\mathcal{F}$ defined over a domain $\mathcal{X}$ , the thresholded class is given by + +$$ +\mathcal {F} _ {\text {t h r e s h}} := \{x \mapsto \mathbb {1} [ f (x) > \tau ]: f \in \mathcal {F}, \tau \in \mathbb {R} \}. +$$ + +Finally, for a hypothesis class $\mathcal{H}$ and a loss function $\ell \colon \mathcal{Z} \times \mathcal{Y} \to [0,1]$ , the loss-composed class is + +$$ +\ell \circ \mathcal {H} := \{(x, y) \mapsto \ell (h (x), y): h \in \mathcal {H} \}. +$$ + +The following theorem shows that the empirical conditional risks converge uniformly to their population counterparts. This can be seen as a generalization of a result by Balsubramani et al. (2019), which demonstrated universal convergence of empirical conditional probabilities. + +Theorem 1. Let $\mathcal{H}$ be a hypothesis class, let $\mathcal{G}$ be a set of groups, and let $\ell \colon \mathcal{Z} \times \mathcal{Y} \to [0,1]$ be a loss function. With probability at least $1 - \delta$ , + +$$ +\left| L (h \mid g) - L _ {n} (h \mid g) \right| \leq 9 \sqrt {\frac {D}{\# _ {n} (g)}} \quad \forall (h, g) \in \mathcal {H} \times \mathcal {G}, +$$ + +where $D = 2\log \left(\Pi_{2n}((\ell \circ \mathcal{H})_{\mathrm{thresh}})\Pi_{2n}(\mathcal{G})\right) + \log (8 / \delta)$ . + +In the standard agnostic binary classification setting, it is known that, in general, the best achievable error rate of a learning algorithm is on the order of the uniform convergence rate of the empirical risks of the entire hypothesis class (Shalev-Shwartz & Ben-David, 2014, Chapter 6). This can be seen as a statistical equivalence between learning and + +# Algorithm 1 PREPEND + +input Groups $\mathcal{G}$ , hypothesis class $\mathcal{H}$ , i.i.d. examples $(x_{1},y_{1}),\ldots ,(x_{n},y_{n})$ from $\mathcal{D}$ , error bound $\epsilon_{n}\colon \mathcal{G}\to \mathbb{R}_{+}$ . output Decision list $f_{T}\in \mathrm{DL}_{T}[\mathcal{G};\mathcal{H}]$ + +Compute $h_0\in \mathrm{argmin}_{h\in \mathcal{H}}L_n(h)$ + +Set $f_0 = [h_0] \in \mathrm{DL}_0[\mathcal{G};\mathcal{H}]$ . + +for $t = 0,1,\ldots ,$ do + +Compute + +$$ +(g_{t + 1},h_{t + 1})\in \operatorname *{argmax}_{(g,h)\in \mathcal{G}\times \mathcal{H}}L_{n}(f_{t} \mid g) - L_{n}(h\mid g) - \epsilon_{n}(g). +$$ + +if $L_{n}(f_{t}\mid g_{t + 1}) - L_{n}(h_{t + 1}\mid g_{t + 1})\geq \epsilon_{n}(g_{t + 1})$ then + +Prepend $(g_{t + 1},h_{t + 1})$ to $f_{t}$ to obtain + +$$ +f _ {t + 1} := \left[ g _ {t + 1}, h _ {t + 1}, g _ {t}, h _ {t}, \dots , g _ {1}, h _ {1}, h _ {0} \right]. +$$ + +else + +return $f_{t}$ . + +end if + +end for + +estimation. Theorem 1 raises the question of whether such an equivalence can also be established in the multi-group learning setting. In this work, we make partial progress towards establishing such an equivalence, providing a learning algorithm whose per-group error rate enjoys the same upper bound as the convergence rates in Theorem 1. + +# 3. A simple multi-group learning algorithm + +In this section we will show that there is a particularly simple class of predictors for solving the multi-group learning problem: decision lists in which internal (decision) nodes are associated with functions from $\mathcal{G}$ , and leaf (prediction) nodes are associated with functions from $\mathcal{H}$ . We denote the set of such decision lists of length $t$ by $\mathbb{D}\mathbb{L}_t[\mathcal{G};\mathcal{H}]$ . The function computed by $f_{t} = [g_{t},h_{t},g_{t - 1},h_{t - 1},\ldots ,g_{1},h_{1},h_{0}]\in$ $\mathbb{D}\mathbb{L}_t[\mathcal{G};\mathcal{H}]$ is as follows: upon input $x\in \mathcal{X}$ + +if $g_{t}(x) = 1$ then return $h_t(x)$ else if $g_{t - 1}(x) = 1$ + +then return $h_{t-1}(x)$ else if ... else return $h_0(x)$ . + +This computation can be recursively specified as + +$$ +f _ {t} (x) = \left\{ \begin{array}{l l} h _ {t} (x) & \text {i f} g _ {t} (x) = 1 \\ f _ {t - 1} (x) & \text {i f} g _ {t} (x) = 0 \end{array} \right. +$$ + +where $f_{t - 1} = [g_{t - 1},h_{t - 1},\dots ,g_1,h_1,h_0]\in \mathrm{DL}_{t - 1}[\mathcal{G};\mathcal{H}].$ (We identify $\mathrm{DL}_0[\mathcal{G};\mathcal{H}]$ with $\mathcal{H}$ .) + +We propose a simple algorithm, called PREPEND (Algorithm 1), for learning these decision lists. PREPEND proceeds in rounds, maintaining a current decision list + +$f_{t} \in \mathbb{DL}_{t}[\mathcal{G};\mathcal{H}]$ . At each round, it searches for a group $g_{t + 1} \in \mathcal{G}$ and a hypothesis $h_{t + 1} \in \mathcal{H}$ that witnesses an empirical violation of Eq. (2). If such a violation is found, $f_{t}$ is updated to $f_{t + 1}$ by preponding the pair $(h_{t + 1}, g_{t + 1})$ to the front of $f_{t}$ . If no violation is found, then we claim that $f_{t}$ is good enough, and terminate. + +We first bound the number of iterations executed by Algorithm 1 before it terminates. + +Lemma 2. Suppose that every $g \in \mathcal{G}$ satisfies $P_{n}(g) \cdot \epsilon_{n}(g) \geq \epsilon_{o}$ and say that $\min_{h \in \mathcal{H}} L_{n}(h) \leq \alpha$ . Then Algorithm 1 terminates after at most $t \leq \alpha / \epsilon_{o}$ rounds and outputs a predictor $f_{t} \in D L_{t}[\mathcal{G}; \mathcal{H}]$ such that + +$$ +L _ {n} (f _ {t} \mid g) \leq \inf _ {h \in \mathcal {H}} L _ {n} (h \mid g) + \epsilon_ {n} (g) \quad f o r a l l g \in \mathcal {G}. +$$ + +# 3.1. Sample complexity + +The key step in bounding the sample complexity of Algorithm 1 is in controlling the complexity of $\mathbb{DL}_T[\mathcal{G};\mathcal{H}]$ , whereupon Theorem 1 can be applied. To see how this is done, consider the case where $|\mathcal{G}|$ and $|\mathcal{H}|$ are finite. In this setting, there are $T$ decision nodes, each of which can be chosen from $\mathcal{G}$ , and there are $T + 1$ prediction nodes chosen from $\mathcal{H}$ . Thus, $|\mathbb{DL}_T[\mathcal{G};\mathcal{H}]| \leq |\mathcal{G}|^T |\mathcal{H}|^{T + 1}$ . + +To apply this observation, we first note that for any $f = [g_T, h_T, \ldots, g_1, h_1, h_0] \in \mathbb{D}\mathbb{L}_T[\mathcal{G};\mathcal{H}]$ , if there are rounds $t < t'$ such that $g_t = g_{t'}$ , then $f$ is functionally equivalent to $f' \in \mathbb{D}\mathbb{L}_{T-1}[\mathcal{G};\mathcal{H}]$ where $f'$ simply removes the occurrence of $h_t, g_t$ in $f$ . Thus, when the number of groups is finite, we can always pretend as if $\mathbb{D}\mathbb{L}_T[\mathcal{G};\mathcal{H}]$ is the set of decision lists of length exactly $|\mathcal{G}|$ . The next result follows immediately. + +Proposition 3. Suppose $|\mathcal{G}|$ and $|\mathcal{H}|$ are finite. The following holds with probability at least $1 - \delta$ . If Algorithm 1 is run until convergence, it will terminate with a predictor $f$ that satisfies + +$$ +\begin{array}{l} L (f \mid g) \leq \min _ {h \in \mathcal {H}} L (h \mid g) + \epsilon_ {n} (g) \\ + O \left(\sqrt {\frac {| \mathcal {G} | \log (| \mathcal {H} | | \mathcal {G} |) + \log (1 / \delta)}{\# _ {n} (g)}}\right) \\ \end{array} +$$ + +for all $g\in \mathcal{G}$ + +Proposition 3 suggests that when $|\mathcal{G}|$ is small, a reasonable approach is to take + +$$ +\epsilon_ {n} (g) = O \left(\sqrt {\frac {| \mathcal {G} | \log (| \mathcal {H} | | \mathcal {G} |) + \log (1 / \delta)}{\# _ {n} (g)}}\right), +$$ + +in which case we will terminate with a predictor whose excess conditional error on any group $g$ is $O(\epsilon_n(g))$ . Thus, when the number of groups is small, estimation error and learning error are within a factor of $\sqrt{|\mathcal{G}|}$ . + +If the number of groups is very large, or infinite, Proposition 3 may be vacuous. However, if we have a lower bound on the empirical mass of any group (or perhaps restrict ourselves to such groups), then we can give a result that remains useful. To do so, we introduce the notation + +$$ +\mathcal {G} _ {n, \gamma} = \{g \in \mathcal {G}: \# _ {n} (g) \geq \gamma n \}. +$$ + +Given this notation, we have the following result. + +Theorem 4. Suppose that $\mathcal{H}$ and $\mathcal{G}$ are finite, and $\gamma >0$ is given. There is a setting of $\epsilon_{n}(\cdot)$ such that the following holds. If Algorithm 1 is run with groups $\mathcal{G}_{n,\gamma}$ , then with probability $1 - \delta$ , it terminates with a predictor $f$ satisfying + +$$ +L (f \mid g) \leq \min _ {h \in \mathcal {H}} L (h \mid g) + O \left(\sqrt [ 3 ]{\frac {K / \gamma}{\# _ {n} (g)}} + \sqrt {\frac {\log (1 / \delta)}{\# _ {n} (g)}}\right) +$$ + +for all $g \in \mathcal{G}_{n,\gamma}$ , where $K \coloneqq \log (|\mathcal{G}||\mathcal{H}|)$ . In addition, with probability $1 - \delta$ , all $g \in \mathcal{G}$ satisfying $P(g) \geq \gamma + \sqrt{\frac{\log(|\mathcal{G}| / \delta)}{n}}$ will lie in $\mathcal{G}_{n,\gamma}$ . + +Theorem 4 implies the following sample complexity to achieve the error bound of the type in Eq. (1). + +Corollary 5. There is an absolute constant $c > 0$ such that the following holds. Suppose that $\mathcal{H}$ and $\mathcal{G}$ are finite, and $\gamma := \min_{g \in \mathcal{G}} P(g)$ . There is a setting of $\epsilon_n(\cdot)$ such that the following holds. If + +$$ +n \geq \frac {c}{\epsilon^ {3} \gamma^ {2}} \log \left(\frac {| \mathcal {G} | | \mathcal {H} |}{\delta}\right) +$$ + +then with probability $1 - \delta$ , Algorithm 1 terminates with a predictor $f$ satisfying + +$$ +L (f \mid g) \leq \min _ {h \in \mathcal {H}} L (h \mid g) + \epsilon \quad f o r a l l g \in \mathcal {G}. +$$ + +PREPEND can also handle the setting where both the number of groups and the number of hypotheses are infinite, so long as the pseudo-dimension of $\ell \circ \mathcal{H}$ and the VC-dimension of $\mathcal{G}$ are bounded. + +Theorem 6. Suppose that both the pseudo-dimension of $\ell \circ \mathcal{H}$ and the VC-dimension of $\mathcal{G}$ are bounded above by $d$ , and $\gamma > 0$ is given. There is a setting of $\epsilon_{n}(\cdot)$ such that the following holds. If Algorithm 1 is run with groups $\mathcal{G}_{n,\gamma}$ , then with probability $1 - \delta$ , it returns a predictor $f$ satisfying + +$$ +L (f \mid g) \leq \min _ {h \in \mathcal {H}} L (h \mid g) + O \left(\sqrt [ 3 ]{\frac {d \log n}{\gamma \# _ {n} (g)}} + \sqrt {\frac {\log (1 / \delta)}{\# _ {n} (g)}}\right) +$$ + +for all $g\in \mathcal{G}_{n,\gamma}$ . Moreover, with probability $1 - \delta$ , all $g\in \mathcal{G}$ satisfying $P(g)\geq \gamma +\sqrt{\frac{d\log(2n) + \log(4 / \delta)}{n}}$ lie in $\mathcal{G}_{n,\gamma}$ + +# 3.2. Inadmissibility of evaluation functions + +One interpretation of decision lists in the class $\mathbb{DL}_t[\mathcal{G};\mathcal{H}]$ is that they correspond to orderings of the set $\mathcal{G}\times \mathcal{H}$ . That is, for any $f\in \mathbb{DL}_t[\mathcal{G};\mathcal{H}]$ there is a corresponding ordering $(g_{1},h_{1}),(g_{2},h_{2}),\ldots$ where for a given $x\in \mathcal{X}$ , we first find + +$$ +i (x) = \min \{i: g _ {i} (x) = 1 \} +$$ + +and classify according to $h_{i(x)}(x)$ . Given this alternate perspective, one can ask whether it is possible to calculate such orderings directly. We will show a negative result here for the approach of evaluation functions. + +An evaluation function $s: \mathcal{H} \times \mathcal{G} \times (X \times \mathcal{Y})^* \to \mathbb{R}$ takes as input $h \in \mathcal{H}$ , $g \in \mathcal{G}$ and a sample $(x_1, y_1), \ldots, (x_n, y_n)$ and outputs a real number as a score. The ordering induced by an evaluation function is then simply the ordering of the corresponding scores, with ties being broken by some (possibly randomized) rule. We say that $s$ is an order-1 evaluation function if $s(h, g, (x_1, y_1), \ldots, (x_n, y_n))$ is only a function of $n$ , $P_n(g)$ and $L_n(h \mid g)$ . + +By Theorem 1, $P_{n}(g)$ and $L_{n}(h \mid g)$ converge to their expectations as $n$ grows to infinity. Thus, in the limit, an order-1 evaluation function is a function of $P(g)$ and $L(h \mid g)$ . Unfortunately, there exist two scenarios where these statistics are identical but no decision list solves the multi-group learning problem for both scenarios simultaneously. + +Proposition 7. There exist $\mathcal{H} = \{h_1, h_2\}$ , $\mathcal{G} = \{g_1, g_2\}$ , and distributions $\mathcal{D}_1$ and $\mathcal{D}_2$ such that the following holds. + +- $P_{\mathcal{D}_1}(g) = P_{\mathcal{D}_2}(g)$ and $L_{\mathcal{D}_1}(h \mid g) = L_{\mathcal{D}_2}(h \mid g)$ for all $h \in \mathcal{H}, g \in \mathcal{G}$ . +- For any decision list $f \in \mathcal{D}\mathcal{L}_t[\mathcal{G};\mathcal{H}]$ , there exists an $i \in \{1,2\}$ and $g \in \mathcal{G}$ such that + +$$ +L _ {\mathcal {D} _ {i}} (f \mid g) \geq \min _ {h \in \mathcal {H}} L _ {\mathcal {D} _ {i}} (h \mid g) + \frac {1}{8}. +$$ + +Here, the subscript $\mathcal{D}_i$ denotes taking probabilities with respect to $\mathcal{D}_i$ . + +# 4. A reduction to sleeping experts + +In this section, we will show that the rate suggested by Theorem 1 is achievable via a reduction to the sleeping experts problem, similar to the result of Blum & Lykouris (2020). The sleeping experts problem is an online expert aggregation problem such that during every round, some experts are 'awake' and some are 'asleep' (Blum, 1997; Freund et al., 1997). The goal for a learner in this setting is to achieve low regret against every expert on those rounds in which it was awake. + +To reduce the multi-group learning problem to a sleeping experts problem, we create an expert for every pair $(h,g)\in$ + +# Algorithm 2 Reduction to sleeping experts + +input Groups $\mathcal{G}$ , hypothesis class $\mathcal{H}$ , 2n i.i.d. examples $(x_{1},y_{1}),\ldots ,(x_{n},y_{n}),(x_{1}^{\prime},y_{1}^{\prime}),\ldots ,(x_{n}^{\prime},y_{n}^{\prime})$ from $\mathcal{D}$ . +output Randomized predictor $Q$ . + +Run MLC-HEDGE on $(x_{1},y_{1}),\ldots ,(x_{n},y_{n})$ using experts $\mathcal{H}\times \mathcal{G}$ with uniform initial probabilities, and perexpert learning rates $\eta_{h,g} = \min \bigl \{\sqrt{\frac{\log(|\mathcal{H}||\mathcal{G}|)}{\sum_{i = i}^{n}g(x_{i}^{\prime})}},1\bigr \} .$ Let $p_1,\dots ,p_n$ be the internal hypotheses of MLC-HEDGE. + +output $Q =$ uniform distribution over $p_1,\ldots ,p_n$ + +$\mathcal{H} \times \mathcal{G}$ . In each round $t$ , we feed an example $x_{t}$ and say that expert $(h, g)$ is awake if and only if $g(x_{t}) = 1$ , in which case the expert prediction is $h(x_{t})$ and the revealed loss is $\ell(h(x_{t}), y_{t})$ . Formally, the reduction looks as follows: + +For $t = 1,2,\ldots ,n$ + +- Input $x_{t}$ is revealed. +- If $g(x_{t}) = 1$ , then expert $(h,g)$ is awake and predicts $h(x_{t})$ . Otherwise, $(h,g)$ is asleep. +- The learner produces a distribution $p_t$ over the experts such that $\sum_{h,g} g(x_t)p_t(h,g) = 1$ . +- Label $y_{t}$ is revealed, and the learner suffers loss $\hat{\ell}_{t} = \sum_{h,g} p_{t}(h,g) g(x_{t}) \ell(h(x_{t}), y_{t})$ . + +There are several suitable algorithms in the literature for the sleeping experts problem. Most convenient for our purposes is MLC-HEDGE, originally proposed by Blum & Mansour (2007) and further analyzed by Gaillard et al. (2014). In Appendix C, we present MLC-HEDGE and state the learning guarantees proven by Gaillard et al. (2014). + +To convert this online learner into a batch learning algorithm, we follow the strategy of Helmbold & Warmuth (1995). We do this by keeping track of the internal hypotheses of the online learner. That is, let $p_t(\cdot; x)$ be the distribution that the learner at time $t$ would produce if fed the example $x$ . Given these internal hypotheses, the final predictor is as follows: on input $x$ , draw $t$ uniformly at random from $\{1, \ldots, n\}$ , draw $(h, g)$ from $p_t(\cdot; x)$ , and predict $h(x)$ . + +For a collection of internal hypotheses $p_1, \ldots, p_n$ and a distribution $Q$ over such hypotheses, we use the notation + +$$ +L (p _ {t} \mid g) := \mathbb {E} _ {(x, y)} \left[ \mathbb {E} _ {(\tilde {h}, \tilde {g}) \sim p _ {t} (\cdot ; x)} \left[ \ell (\tilde {h} (x), y) \right] \mid g \right] +$$ + +$$ +L (Q \mid g) := \mathbb {E} _ {p _ {t} \sim Q} \left[ L (p _ {t} \mid g) \right]. +$$ + +To run MLC-HEDGE, we need to specify an initial probability distribution over the experts and a set of expert-specific learning rates. Our initial distribution is uniform distribution over the experts. For the learning rates, we use half the + +# Algorithm 3 Consistent majority algorithm + +input Groups $\mathcal{G}$ , binary classifiers $\mathcal{H}$ , $n$ i.i.d. examples from a group-realizable distribution. + +output Group-conditional majority vote predictor $f$ . + +For each $g\in \mathcal{G}$ , let $\dot{h}_g\in \mathrm{argmin}_{h\in \mathcal{H}}L_n(h\mid g)$ + +output Predictor $x\mapsto \mathrm{sign}\left(\sum_{g\in \mathcal{G}}g(x)\hat{h}_g(x)\right)$ + +sample to estimate the empirical probability masses of each group and set the learning rates to optimize an upper bound on the per-expert regret (Gaillard et al., 2014, Theorem 16). Algorithm 2 presents the full method. + +Theorem 8. Let $Q$ be the randomized predictor returned by Algorithm 2. Then + +$$ +L (Q \mid g) \leq \min _ {h \in \mathcal {H}} L (h \mid g) + O \left(\sqrt {\frac {\log (| \mathcal {G} | | \mathcal {H} | / \delta)}{\# _ {n} (g)}}\right) +$$ + +for all $g\in \mathcal{G}$ with probability at least $1 - \delta$ + +Theorem 8 implies the following corollary. + +Corollary 9. There is an absolute constant $c > 0$ such that the following holds. Suppose $P(g) \geq \gamma > 0$ for all $g \in \mathcal{G}$ . Let $Q$ be the randomized predictor returned by Algorithm 2. If + +$$ +n \geq \frac {c}{\epsilon^ {2} \gamma} \log \frac {| \mathcal {G} | | \mathcal {H} |}{\delta}, +$$ + +then with probability at least $1 - \delta$ + +$$ +L (Q \mid g) \leq \min _ {h \in \mathcal {H}} L (h \mid g) + \epsilon \quad f o r a l l g \in \mathcal {G}. +$$ + +The dependence on $\log |\mathcal{H}|$ in Theorem 8 and Corollary 9 can be replaced by the pseudo-dimension of $\ell \circ \mathcal{H}$ (up to a log $n$ factor) using a slight modification to Algorithm 2. Simply use half of the training data to find, for each $g\in \mathcal{G}$ , a hypothesis $\hat{h}_g\in \mathcal{H}$ satisfying + +$$ +L (\hat {h} _ {g} \mid g) \leq \inf _ {h \in \mathcal {H}} L (h \mid g) + O \left(\sqrt {\frac {d \log n + \log (| \mathcal {G} | / \delta)}{\# _ {n} (g)}}\right) +$$ + +(say, using ERM); and then execute Algorithm 2 using $\{\hat{h}_g : g \in \mathcal{G}\}$ instead of $\mathcal{H}$ , along with the other half of the training data. Removing the dependence on $\log |\mathcal{G}|$ is algorithmically less straightforward. + +# 5. The group-realizable setting + +We restrict our attention now to the case where $\mathcal{Y} = \mathcal{Z} = \{-1, + 1\}$ and $\ell (z,y) = \mathbb{1}[z\neq y]$ is the binary zero-one loss. In the group-realizable setting, each group has an associated perfect classifier: + +$$ +\min _ {h \in \mathcal {H}} L (h \mid g) = 0 \quad \text {f o r a l l} g \in \mathcal {G}. +$$ + +Note that realizability is the stronger assumption $\min_{h\in \mathcal{H}}L(h) = 0$ . Realizability implies grouprealizability, but not vice versa. In this setting, the arguments from Section 4 can be adapted to show that the randomized predictor produced by Algorithm 2 achieves error + +$$ +L (Q \mid g) \leq O \left(\frac {\log (| \mathcal {G} | | \mathcal {H} |)}{\# _ {n} (g)}\right) +$$ + +with high probability for all $g \in \mathcal{G}$ . However, in the group-realizable setting, one can achieve this rate using a simpler approach. + +Algorithm 3 shows the algorithm for the group-realizable setting. The idea is to use ERM to fit a classifier to every group. Since the distribution is group-realizable, all of these classifiers will be consistent on the data from their respective groups. Given a data point to predict on, we collect all the groups it lies in and predict using the majority vote of the associated groups. + +Theorem 10. Suppose Algorithm 3 is run on $n$ i.i.d. examples from a group-realizable distribution and returns $f$ . With probability at least $1 - \delta$ , + +$$ +L (f \mid g) \leq O \left(\frac {\log \left(| \mathcal {G} | | \mathcal {H} | / \delta\right)}{\# _ {n} (g)}\right) \quad f o r a l l g \in \mathcal {G}. +$$ + +The function class used by Algorithm 3 is simple but seemingly quite powerful. One natural question is whether one could use this class to solve the multi-group learning problem in the general agnostic setting, for example via some sample splitting approach. The following result shows that this not possible in general. + +Proposition 11. There is a set of hypotheses $\mathcal{H} = \{h, h'\}$ , a set of groups $\mathcal{G} = \{g_1, g_2, g_3\}$ and a distribution $\mathcal{D}$ such that the following holds. If $\mathcal{F}$ is the set of possible predictors produced by Algorithm 3, then for all $f \in \mathcal{F}$ , there exists some $g \in \mathcal{G}$ such that + +$$ +L (f \mid g) > \min _ {h \in \mathcal {H}} L (h \mid g) + \frac {1}{4} +$$ + +where the loss is zero-one loss. + +# 6. Discussion and open problems + +In this work, we presented simple and near-optimal algorithms for multi-group learning. Here we point to some interesting directions for future work. + +Computation. It is not clear if any of the algorithms considered in this work can be made efficient, as they seem to rely either on enumeration or on complicated optimization subroutines. Thus, it is an interesting open problem to devise multi-group learning algorithms that are efficient for some specific choices of $\mathcal{H}$ and $\mathcal{G}$ and some restrictions on the marginal distribution over $\mathcal{X}$ . + +Representation. Through Algorithm 1, we have addressed the question of representational complexity for multi-group learning: we showed that decision lists of the form in $\mathsf{DL}_T[\mathcal{G};\mathcal{H}]$ are sufficient. However, the full expressivity of this class is not necessary in all cases (such as in the group-realizable setting). An expanded investigation of these representational issues should address this gap. +Simplicity and optimality. Finally, it remains an interesting open problem is to design an algorithm that is simple like Algorithm 1 but that also enjoys the performance guarantees of Algorithm 2. + +# Acknowledgements + +We thank Kamalika Chaudhuri for helpful initial discussions about hidden stratification. We acknowledge support from NSF grants CCF-1740833 and IIS-1563785, and a JP Morgan Faculty Award. Part of this work was completed while CT was at Columbia University. + +# References + +Agarwal, A., Beygelzimer, A., Dudík, M., Langford, J., and Wallach, H. A reductions approach to fair classification. In International Conference on Machine Learning, pp. 60-69, 2018. +Azizzadenesheli, K., Liu, A., Yang, F., and Anandkumar, A. Regularized learning for domain adaptation under label shifts. In International Conference on Learning Representations, 2018. +Balsubramani, A., Dasgupta, S., Freund, Y., and Moran, S. An adaptive nearest neighbor rule for classification. In Advances in Neural Information Processing Systems, pp. 7579-7588, 2019. +Ben-David, S., Blitzer, J., Crammer, K., Kulesza, A., Pereira, F., and Vaughan, J. W. A theory of learning from different domains. Machine learning, 79(1):151-175, 2010. +Ben-Tal, A., El Ghaoui, L., and Nemirovski, A. Robust optimization. Princeton university press, 2009. +Bertsimas, D., Gupta, V., and Kallus, N. Data-driven robust optimization. Mathematical Programming, 167(2):235-292, 2018. +Blum, A. Empirical support for winnow and weighted-majority algorithms: Results on a calendar scheduling domain. Machine Learning, 26(1):5-23, 1997. +Blum, A. and Lykouris, T. Advancing subgroup fairness via sleeping experts. In Innovations in Theoretical Computer Science Conference (ITCS), 2020. + +Blum, A. and Mansour, Y. From external to internal regret. Journal of Machine Learning Research, 8(6), 2007. +Boucheron, S., Bousquet, O., and Lugosi, G. Theory of classification: A survey of some recent advances. *ESAIM: probability and statistics*, 9:323-375, 2005. +Cesa-Bianchi, N., Conconi, A., and Gentile, C. On the generalization ability of on-line learning algorithms. IEEE Transactions on Information Theory, 50(9):2050-2057, 2004. +Cortes, C., Mansour, Y., and Mohri, M. Learning bounds for importance weighting. In Advances in Neural Information Processing Systems, pp. 442-450, 2010. +Cortes, C., Greenberg, S., and Mohri, M. Relative deviation learning bounds and generalization with unbounded loss functions. Annals of Mathematics and Artificial Intelligence, 85(1):45-70, 2019. +Diana, E., Gill, W., Kearns, M., Kenthapadi, K., Roth, A., and Sharifi-Malvajerdi, S. Multiaccurate proxies for downstream fairness. arXiv preprint arXiv:2107.04423, 2021. +Donini, M., Oneto, L., Ben-David, S., Shawe-Taylor, J., and Pontil, M. Empirical risk minimization under fairness constraints. In Advances in Neural Information Processing Systems, pp. 2796-2806, 2018. +Duchi, J., Hashimoto, T., and Namkoong, H. Distributionally robust losses for latent covariate mixtures, 2020. +Duchi, J. C., Glynn, P. W., and Namkoong, H. Statistics of robust optimization: A generalized empirical likelihood approach. Mathematics of Operations Research, 2021. +Dwork, C. and Ilvento, C. Individual fairness under composition. Proceedings of Fairness, Accountability, Transparency in Machine Learning, 2018. +Dwork, C., Hardt, M., Pitassi, T., Reingold, O., and Zemel, R. Fairness through awareness. In Proceedings of the 3rd innovations in theoretical computer science conference, pp. 214-226, 2012. +Dwork, C., Kim, M. P., Reingold, O., Rothblum, G. N., and Yona, G. Outcome indistinguishability. In Proceedings of the 53rd Annual ACM SIGACT Symposium on Theory of Computing, pp. 1095-1108, 2021. +Freedman, D. On tail probabilities for martingales. The Annals of Probability, 3(1):100-118, 1975. +Freund, Y. Boosting a weak learning algorithm by majority. Information and computation, 121(2):256-285, 1995. + +Freund, Y., Schapire, R. E., Singer, Y., and Warmuth, M. K. Using and combining predictors that specialize. In Proceedings of the twenty-ninth annual ACM Symposium on Theory of Computing, pp. 334-343, 1997. +Gaillard, P., Stoltz, G., and Van Erven, T. A second-order bound with excess losses. In Conference on Learning Theory, pp. 176-196. PMLR, 2014. +Gillen, S., Jung, C., Kearns, M., and Roth, A. Online learning with an unknown fairness metric. In Proceedings of the 32nd International Conference on Neural Information Processing Systems, pp. 2605-2614, 2018. +Globus-Harris, I., Kearns, M., and Roth, A. Beyond the frontier: Fairness without privacy loss. arXiv preprint arXiv:2201.10408, 2022. +Gupta, V., Jung, C., Noarov, G., Pai, M. M., and Roth, A. Online multivalid learning: Means, moments, and prediction intervals. arXiv preprint arXiv:2101.01739, 2021. +Hardt, M., Price, E., and Srebro, N. Equality of opportunity in supervised learning. Advances in neural information processing systems, 29:3315-3323, 2016. +Hébert-Johnson, U., Kim, M., Reingold, O., and Rothblum, G. Multicalibration: Calibration for the (computationally-identifiable) masses. In International Conference on Machine Learning, pp. 1939-1948, 2018. +Helmbold, D. P. and Warmuth, M. K. On weak learning. Journal of Computer and System Sciences, 50(3):551-573, 1995. +Hopkins, M., Kane, D., Lovett, S., and Mahajan, G. Realizable learning is all you need. arXiv preprint arXiv:2111.04746, 2021. +Kearns, M., Neel, S., Roth, A., and Wu, Z. S. Preventing fairness gerrymandering: Auditing and learning for subgroup fairness. In International Conference on Machine Learning, pp. 2564-2572, 2018. +Kim, M., Ghorbani, A., and Zou, J. Multiaccuracy: Black-box post-processing for fairness in classification. In Proceedings of the 2019 AAAI/ACM Conference on AI, Ethics, and Society, pp. 247-254, 2019. +Kpotufe, S. and Martinet, G. Marginal singularity, and the benefits of labels in covariate-shift. In Conference On Learning Theory, pp. 1882-1886, 2018. +Liu, E. Z., Haghgoo, B., Chen, A. S., Raghunathan, A., Koh, P. W., Sagawa, S., Liang, P., and Finn, C. Just train twice: Improving group robustness without training group information. In International Conference on Machine Learning, pp. 6781-6792. PMLR, 2021. + +Mohri, M., Sivek, G., and Suresh, A. T. Agnostic federated learning. In International Conference on Machine Learning, pp. 4615-4625, 2019. +Noarov, G., Pai, M., and Roth, A. Online multiobjective minimax optimization and applications. arXiv preprint arXiv:2108.03837, 2021. +Oakden-Rayner, L., Dunnmon, J., Carneiro, G., and Ré, C. Hidden stratification causes clinically meaningful failures in machine learning for medical imaging. In Proceedings of the ACM conference on health, inference, and learning, pp. 151-159, 2020. +Rothblum, G. and Yona, G. Multi-group agnostic pac learnability. In International Conference on Machine Learning, pp. 9107-9115, 2021a. +Rothblum, G. and Yona, G. Personal communication, 2021b. +Sagawa, S., Koh, P. W., Hashimoto, T. B., and Liang, P. Distributionally robust neural networks for group shifts: On the importance of regularization for worst-case generalization. In International Conference on Learning Representations, 2020a. +Sagawa, S., Raghunathan, A., Koh, P. W., and Liang, P. An investigation of why overparameterization exacerbates spurious correlations. In International Conference on Machine Learning, pp. 8346-8356. PMLR, 2020b. +Schapire, R. E. The strength of weak learnability. Machine learning, 5(2):197-227, 1990. +Shalev-Shwartz, S. and Ben-David, S. Understanding machine learning: From theory to algorithms. Cambridge university press, 2014. +Shimodaira, H. Improving predictive inference under covariate shift by weighting the log-likelihood function. Journal of statistical planning and inference, 90(2):227-244, 2000. +Sohoni, N. S., Dunnmon, J. A., Angus, G., Gu, A., and Ré, C. No subclass left behind: Fine-grained robustness in coarse-grained classification problems. arXiv preprint arXiv:2011.12945, 2020. +Trevisan, L., Tulsiani, M., and Vadhan, S. Regularity, boosting, and efficiently simulating every high-entropy distribution. In 24th Annual IEEE Conference on Computational Complexity, 2009. +Zadrozny, B. Learning and evaluating classifiers under sample selection bias. In International Conference on Machine Learning, pp. 114, 2004. + +# A. Missing proofs from Section 2 + +# A.1. Proof of Theorem 1 + +To simplify the proof, we will use the following notation. Let $P$ be a probability distribution over $\mathcal{X}$ , let $\mathcal{H}$ be a family of $[0,1]$ -valued functions over $\mathcal{X}$ , and let $\mathcal{G}$ be a family of $\{0,1\}$ -valued functions over $\mathcal{X}$ . Given a sample $x_{1},\ldots,x_{n}$ drawn from $P$ , we make the following definitions: + +$$ +P (h \mid g) := \frac {P (h g)}{P (g)} := \frac {\mathbb {E} [ h (x) g (x) ]}{\mathbb {E} [ g (x) ]} +$$ + +$$ +P _ {n} (h \mid g) := \frac {P _ {n} (h g)}{P _ {n} (g)} := \frac {\sum_ {i = 1} ^ {n} h (x _ {i}) g (x _ {i})}{\# _ {n} (g)}. +$$ + +Given this notation, we will prove the following theorem, which directly implies Theorem 1. + +Theorem 12. Let $P$ be a probability distribution over $\mathcal{X}$ , let $\mathcal{H}$ be a family of $[0,1]$ -valued functions over $\mathcal{X}$ , and let $\mathcal{G}$ be a family of $\{0,1\}$ -valued functions over $\mathcal{X}$ . Then with probability at least $1 - \delta$ , + +$$ +\left| P (h \mid g) - P _ {n} (h \mid g) \right| \leq \min \left\{9 \sqrt {\frac {D}{\# _ {n} (g)}}, 7 \sqrt {\frac {D P _ {n} (h \mid g)}{\# _ {n} (g)}} + \frac {1 6 D}{\# _ {n} (g)} \right\} +$$ + +for all $h\in \mathcal{H},g\in \mathcal{G}$ where $D = 2\log \Pi_{2n}(\mathcal{H}_{\mathrm{thresh}}) + 2\log \Pi_{2n}(\mathcal{G}) + \log (8 / \delta)$ + +To prove Theorem 12, we will provide relative deviation bounds on $[0,1]$ -valued functions of the following form: with probability $1 - \delta$ , + +$$ +| P (h) - P _ {n} (h) | \leq \sqrt {\frac {P _ {n} (h) \operatorname {c o m p} (\mathcal {H}) \log (1 / \delta)}{n}} + \frac {\operatorname {c o m p} (\mathcal {H}) \log (1 / \delta)}{n} +$$ + +for all $h\in \mathcal{H}$ , where $\mathrm{comp}(\mathcal{H})$ is some complexity measure of $\mathcal{H}$ . + +To establish this relative deviation bound, we first reduce the problem from $[0,1]$ -valued functions to $\{0,1\}$ -valued functions. + +Lemma 13. If $\mathcal{H}$ is a class of [0, 1]-valued function, then + +$$ +\Pr \left(\sup _ {h \in \mathcal {H}} \frac {P (h) - P _ {n} (h)}{\sqrt {P (h)}} > \epsilon\right) \leq \Pr \left(\sup _ {h ^ {\prime} \in \mathcal {H} _ {\text {t h r e s h}}} \frac {P \left(h ^ {\prime}\right) - P _ {n} \left(h ^ {\prime}\right)}{\sqrt {P \left(h ^ {\prime}\right)}} > \epsilon\right) +$$ + +$$ +\Pr \left(\sup _ {h \in \mathcal {H}} \frac {P _ {n} (h) - P (h)}{\sqrt {P _ {n} (h)}} > \epsilon\right) \leq \Pr \left(\sup _ {h ^ {\prime} \in \mathcal {H} _ {\text {t h r e s h}}} \frac {P _ {n} \left(h ^ {\prime}\right) - P \left(h ^ {\prime}\right)}{\sqrt {P _ {n} \left(h ^ {\prime}\right)}} > \epsilon\right). +$$ + +Proof. The proof is inspired by the proof of Theorem 3 of Cortes et al. (2019). For $h \in \mathcal{H}, t \in [0,1]$ , we use the notation + +$$ +P (h > t) = \mathbb {E} [ \mathbb {1} [ h (x) > t ] ] +$$ + +$$ +P _ {n} (h > t) = \frac {1}{n} \sum_ {i = 1} ^ {n} \mathbb {1} [ h (x _ {i}) > t ]. +$$ + +To prove the lemma, it will suffice to prove the following two implications + +$$ +\forall h \in \mathcal {H}, t \in [ 0, 1 ], P (h > t) - P _ {n} (h > t) \leq \epsilon \sqrt {P (h > t)} \longrightarrow \forall h \in \mathcal {H}, P (h) - P _ {n} (h) \leq \epsilon \sqrt {P (h)} +$$ + +$$ +\forall h \in \mathcal {H}, t \in [ 0, 1 ], P _ {n} (h > t) - P (h > t) \leq \epsilon \sqrt {P _ {n} (h > t)} \longrightarrow \forall h \in \mathcal {H}, P _ {n} (h) - P (h) \leq \epsilon \sqrt {P _ {n} (h)}. +$$ + +We will prove the first statement, as the second can be proven symmetrically. Assume that + +$$ +P (h > t) - P _ {n} (h > t) \leq \epsilon \sqrt {P (h > t)} +$$ + +for all $h \in \mathcal{H}$ and $t \in [0,1]$ . Since $h$ is [0, 1]-valued, we can write + +$$ +P (h) = \int_ {0} ^ {1} P (h > t) \mathrm {d} t +$$ + +$$ +P _ {n} (h) = \int_ {0} ^ {1} P _ {n} (h > t) d t. +$$ + +Thus, + +$$ +\begin{array}{l} P (h) - P _ {n} (h) = \int_ {0} ^ {1} P (h > t) - P _ {n} (h > t) d t \\ \leq \int_ {0} ^ {1} \epsilon \sqrt {P (h > t)} d t \\ \leq \epsilon \sqrt {\int_ {0} ^ {1} P (h > t) \mathrm {d} t} \\ = \epsilon \sqrt {P (h)} \\ \end{array} +$$ + +where the first inequality is by assumption and the second is by Jensen's inequality. + +The following result, found for example in Boucheron et al. (2005), provides uniform convergence bounds on the relative deviations of $\{0,1\}$ -valued functions. + +Lemma 14. If $\mathcal{F}$ is a class of $\{0,1\}$ -valued function, then + +$$ +\Pr \left(\sup _ {f \in \mathcal {F}} \frac {P _ {n} (f) - P (f)}{\sqrt {P _ {n} (f)}} > \epsilon\right) \leq 4 \Pi_ {2 n} (\mathcal {F}) \exp \left(- \frac {\epsilon^ {2} n}{4}\right) +$$ + +$$ +\Pr \left(\sup _ {f \in \mathcal {F}} \frac {P (f) - P _ {n} (f)}{\sqrt {P (f)}} > \epsilon\right) \leq 4 \Pi_ {2 n} (\mathcal {F}) \exp \left(- \frac {\epsilon^ {2} n}{4}\right) +$$ + +where $\Pi_k(\mathcal{F})$ is the $k$ -th shattering coefficient of $\mathcal{F}$ . + +Combining these two results, we have the following. + +Lemma 15. If $\mathcal{H}$ is a class of [0, 1]-valued function, then with probability $1 - \delta$ , + +$$ +P (h) - P _ {n} (h) \leq 2 \sqrt {P _ {n} (h) \frac {\log \Pi_ {2 n} (\mathcal {H} _ {\text {t h r e s h}}) + \log (8 / \delta)}{n}} + 4 \frac {\log \Pi_ {2 n} (\mathcal {H} _ {\text {t h r e s h}}) + \log (8 / \delta)}{n} +$$ + +$$ +P (h) - P _ {n} (h) \geq - 2 \sqrt {P _ {n} (h) \frac {\log \Pi_ {2 n} (\mathcal {H} _ {\text {t h r e s h}}) + \log (8 / \delta)}{n}} +$$ + +for all $h\in \mathcal{H}$ + +Proof. Combining Lemmas 13 and 14, we immediately have that with probability $1 - \delta$ + +$$ +\frac {P _ {n} (h) - P (h)}{\sqrt {P _ {n} (h)}} \leq 2 \sqrt {\frac {\log \Pi_ {2 n} (\mathcal {H} _ {\mathrm {t h r e s h}}) + \log (8 / \delta)}{n}} +$$ + +$$ +\frac {P (h) - P _ {n} (h)}{\sqrt {P (h)}} \leq 2 \sqrt {\frac {\log \Pi_ {2 n} (\mathcal {H} _ {\mathrm {t h r e s h}}) + \log (8 / \delta)}{n}} +$$ + +for all $h\in \mathcal{H}$ .Let us condition on this occurring. + +Using the standard trick that for $A, B, C \geq 0$ , the inequality $A \leq B\sqrt{A} + C$ entails the inequality $A \leq B^2 + B\sqrt{C} + C$ , we can observe from the second inequality above that + +$$ +P (h) \leq P _ {n} (h) + 2 \sqrt {P _ {n} (h) \frac {\log \Pi_ {2 n} (\mathcal {H} _ {\mathrm {t h r e s h}}) + \log (8 / \delta)}{n}} + 4 \frac {\log \Pi_ {2 n} (\mathcal {H} _ {\mathrm {t h r e s h}}) + \log (8 / \delta)}{n}. +$$ + +Combined with the first inequality, we have the lemma statement. + +![](images/40e0450702d7cb0486a175e6efb71cd79ac3333d3cca061b94153b9a848a352d.jpg) + +Now we turn to the proof of Theorem 12. + +Proof of Theorem 12. The proof is similar to the proof of Theorem 5 of Balsubramani et al. (2019). Let $\mathcal{F} = \mathcal{G} \cup \{hg : h \in \mathcal{H}, g \in \mathcal{G}\}$ . Note that for $g \in \mathcal{G}$ , $h \in \mathcal{H}$ and $t \in \mathbb{R}$ , we have + +$$ +\mathbb {1} [ h (x) g (x) > t ] = g (x) \mathbb {1} [ h (x) > t ]. +$$ + +Thus, if we let $\mathcal{C} = \{hg : h \in \mathcal{H}, g \in \mathcal{G}\}$ , we observe that + +$$ +\begin{array}{l} \log \Pi_ {n} (\mathcal {F} _ {\text {t h r e s h}}) \leq \log \Pi_ {n} (\mathcal {G}) + \log \Pi_ {n} (\mathcal {C} _ {\text {t h r e s h}}) \\ \leq \log \Pi_ {n} (\mathcal {G}) + \log \Pi_ {n} \left(\mathcal {H} _ {\text {t h r e s h}}\right) \Pi_ {n} (\mathcal {G}) \\ \leq 2 \log \Pi_ {n} \left(\mathcal {H} _ {\text {t h r e s h}}\right) \Pi_ {n} (\mathcal {G}). \\ \end{array} +$$ + +Combining this with Lemma 15, we have with probability $1 - \delta$ + +$$ +P _ {n} (f) - 2 \sqrt {P _ {n} (f) \frac {D}{n}} \leq P (f) \leq P _ {n} (f) + 2 \sqrt {P _ {n} (f) \frac {D}{n}} + 4 \frac {D}{n} +$$ + +for all $f\in \mathcal{F}$ , where we used the definition $D = 2\log \left(\Pi_{2n}(\mathcal{H}_{\mathrm{thresh}})\right) + 2\log \left(\Pi_{2n}(\mathcal{G})\right) + \log (8 / \delta)$ . Let us condition on this event holding. + +Now fix some $h\in \mathcal{H}$ and $g\in \mathcal{G}$ . We can work out + +$$ +\begin{array}{l} P (h \mid g) = \frac {P (h g)}{P (g)} \\ \leq \frac {P _ {n} (h g) + 2 \sqrt {P _ {n} (h g) \frac {D}{n}} + 4 \frac {D}{n}}{P _ {n} (g) - 2 \sqrt {P _ {n} (g) \frac {D}{n}}} \\ = \frac {P _ {n} (h g)}{P _ {n} (g)} \cdot \frac {1 + 2 \sqrt {\frac {D}{n P _ {n} (h g)}} + 4 \frac {D}{n P _ {n} (h g)}}{1 - 2 \sqrt {\frac {D}{n P _ {n} (g)}}} \\ = \frac {\# _ {n} (h g)}{\# _ {n} (g)} \cdot \frac {1 + 2 \sqrt {\frac {D}{\# _ {n} (h g)}} + 4 \frac {D}{\# _ {n} (h g)}}{1 - 2 \sqrt {\frac {D}{\# _ {n} (g)}}}. \\ \end{array} +$$ + +Here, we have used the notation $\#_n(f) = nP_n(f)$ . Observe that if $\#_n(g) \leq 16D$ , the theorem statement is trivial. Thus, we may assume that $\#_n(g) > 16D$ , whereupon the inequality $\frac{1}{1 - x} \leq 1 + 2x$ for all $x < 1/2$ implies + +$$ +\frac {1}{1 - 2 \sqrt {\frac {D}{\# _ {n} (g)}}} \leq 1 + 4 \sqrt {\frac {D}{\# _ {n} (g)}}. +$$ + +Thus, we have + +$$ +\begin{array}{l} P (h \mid g) \leq \frac {\# _ {n} (h g)}{\# _ {n} (g)} \cdot \left(1 + 2 \sqrt {\frac {D}{\# _ {n} (h g)}} + 4 \frac {D}{\# _ {n} (h g)}\right) \left(1 + 4 \sqrt {\frac {D}{\# _ {n} (g)}}\right) \\ = \frac {\# _ {n} (h g)}{\# _ {n} (g)} \cdot \left(1 + 2 \sqrt {\frac {D}{\# _ {n} (h g)}} + 4 \frac {D}{\# _ {n} (h g)} + 4 \sqrt {\frac {D}{\# _ {n} (g)}} + 4 \frac {D}{\sqrt {\# _ {n} (h g) \# _ {n} (g)}} + 1 6 \frac {D ^ {3 / 2}}{\# _ {n} (h g) \sqrt {\# _ {n} (g)}}\right) \\ = \frac {\# _ {n} (h g)}{\# _ {n} (g)} + 2 \frac {\sqrt {D \# _ {n} (h g)}}{\# _ {n} (g)} + 4 \frac {D}{\# _ {n} (g)} + 4 \frac {\# _ {n} (h g)}{\# _ {n} (g)} \sqrt {\frac {D}{\# _ {n} (g)}} + 4 \frac {D \sqrt {\# _ {n} (h g)}}{\# _ {n} (g) ^ {3 / 2}} + 1 6 \frac {D ^ {3 / 2}}{\# _ {n} (g) ^ {3 / 2}} \\ \leq P _ {n} (h \mid g) + \min \left\{9 \sqrt {\frac {D}{\# _ {n} (g)}}, 7 \sqrt {\frac {D P _ {n} (h \mid g)}{\# _ {n} (g)}} + \frac {8 D}{\# _ {n} (g)} \right\} \\ \end{array} +$$ + +where we have made use of the inequalities $\#_n(hg) \leq \#_n(g)$ and $\#_n(g) > 16D$ . + +In the other direction, we have two cases: $\#_n(hg) < 4D$ and $\#_n(hg) \geq 4D$ . Let us assume first that $\#_n(hg) < 4D$ . Then observe that + +$$ +\begin{array}{l} P _ {n} (h \mid g) - 9 \sqrt {\frac {D}{\# _ {n} (g)}} = \frac {\# _ {n} (h g)}{\# _ {n} (g)} - 9 \sqrt {\frac {D}{\# _ {n} (g)}} \\ < \frac {4 D}{\# _ {n} (g)} - 9 \sqrt {\frac {D}{\# _ {n} (g)}} \\ = \sqrt {\frac {D}{\# _ {n} (g)}} \left(4 \sqrt {\frac {D}{\# _ {n} (g)}} - 9\right) \leq 0 \leq P (h \mid g) \\ \end{array} +$$ + +where we have used the fact that $\#_n(g) > 16D$ . Similarly, we also have + +$$ +\begin{array}{l} P _ {n} (h \mid g) - 7 \sqrt {\frac {D P _ {n} (h \mid g)}{\# _ {n} (g)}} - \frac {8 D}{\# _ {n} (g)} = \frac {\# _ {n} (h g)}{\# _ {n} (g)} - 7 \sqrt {\frac {D \# _ {n} (h g)}{\# _ {n} (g) ^ {2}}} - \frac {8 D}{\# _ {n} (g)} \\ < \frac {4 D}{\# _ {n} (g)} - 7 \sqrt {\frac {D \# _ {n} (h g)}{\# _ {n} (g) ^ {2}}} - \frac {8 D}{\# _ {n} (g)} \leq 0 \leq P (h \mid g) \\ \end{array} +$$ + +Thus, we may assume that $\#_n(hg) \geq 4D$ , so that we have + +$$ +\begin{array}{l} P (h \mid g) = \frac {P (h g)}{P (g)} \\ \geq \frac {P _ {n} (h g) - 2 \sqrt {P _ {n} (h g) \frac {D}{n}}}{P _ {n} (g) + 2 \sqrt {P _ {n} (g) \frac {D}{n}} + 4 \frac {D}{n}} \\ = \frac {\# _ {n} (h g)}{\# _ {n} (g)} \cdot \frac {1 - 2 \sqrt {\frac {D}{\# _ {n} (h g)}}}{1 + 2 \sqrt {\frac {D}{\# _ {n} (g)}} + 4 \frac {D}{\# _ {n} (g)}}. \\ \end{array} +$$ + +Using the inequality $\frac{1}{1 + x} \geq 1 - x$ for all $x \geq 0$ , we have + +$$ +\begin{array}{l} P (h \mid g) \geq \frac {\# _ {n} (h g)}{\# _ {n} (g)} \left(1 - 2 \sqrt {\frac {D}{\# _ {n} (h g)}}\right) \left(1 - 2 \sqrt {\frac {D}{\# _ {n} (g)}} - 4 \frac {D}{\# _ {n} (g)}\right) \\ \geq \frac {\# _ {n} (h g)}{\# _ {n} (g)} \left(1 - 2 \sqrt {\frac {D}{\# _ {n} (h g)}} - 2 \sqrt {\frac {D}{\# _ {n} (g)}} - 4 \frac {D}{\# _ {n} (g)}\right) \\ = \frac {\# _ {n} (h g)}{\# _ {n} (g)} - 2 \frac {\sqrt {D \# _ {n} (h g)}}{\# _ {n} (g)} - 2 \frac {\# _ {n} (h g) \sqrt {D}}{\# _ {n} (g) ^ {3 / 2}} - 4 \frac {D \# _ {n} (h g)}{\# _ {n} (g) ^ {2}} \\ \geq P _ {n} (h \mid g) - \min \left\{5 \sqrt {\frac {D}{\# _ {n} (g)}}, 4 \sqrt {\frac {D P _ {n} (h \mid g)}{\# _ {n} (g)}} + \frac {4 D}{\# _ {n} (g)} \right\} \\ \end{array} +$$ + +where we again made use of the inequalities $\#_n(hg) \leq \#_n(g)$ and $\#_n(g) > 16D$ . + +# B. Missing proofs from Section 3 + +# B.1. Proof of Lemma 2 + +We first note that if the algorithm terminates at round $t$ , then we trivially must have + +$$ +L _ {n} (f _ {t} \mid g) \leq \inf _ {h \in \mathcal {H}} L _ {n} (h \mid g) + \epsilon_ {n} (g) \quad \text {f o r a l l} g \in \mathcal {G}. +$$ + +If the algorithm does not terminate at round $t$ , then we must have found a pair $h_{t+1}, g_{t+1}$ such that + +$$ +L \left(f _ {t} \mid g _ {t + 1}\right) - L \left(h _ {t + 1} \mid g _ {t + 1}\right) \geq \epsilon_ {n} \left(g _ {t + 1}\right), +$$ + +and we must have prepended the pair $(h_{t + 1},g_{t + 1})$ onto $f_{t}$ to create $f_{t + 1}$ . Observe that this prepending action implies that $f_{t + 1}$ will agree with $h_{t + 1}$ on $g_{t + 1}$ and agree with $f_{t}$ everywhere else. Thus, we have + +$$ +\begin{array}{l} L _ {n} (f _ {t}) - L _ {n} (f _ {t + 1}) = \mathbb {E} \left[ \ell (f _ {t} (x), y) - \ell (f _ {t + 1} (x), y) \right] \\ = P _ {n} \left(g _ {t + 1}\right) \mathbb {E} \left[ \ell \left(f _ {t} (x), y\right) - \ell \left(h _ {t + 1} (x), y\right) \mid g _ {t + 1} (x) = 1 \right] \\ \geq P _ {n} \left(g _ {t + 1}\right) \epsilon_ {n} \left(g _ {t + 1}\right) \geq \epsilon_ {o}. \\ \end{array} +$$ + +Thus, $L_{n}(f_{t})$ decreases by $\epsilon_{o}$ at every update, and we have $L_{n}(f_{0}) \leq \alpha$ . The theorem follows by combining these two observations. + +# B.2. Proof of Proposition 3 + +The discussion before the statement of Proposition 3 implies that $|\mathbb{D}\mathbb{L}_T[\mathcal{G};\mathcal{H}]\| \leq |\mathcal{H}|^{|\mathcal{G}| + 1}|\mathcal{G}|^{|\mathcal{G}|}$ . Applying Theorem 1, and utilizing the fact that for any finite class $\mathcal{H}$ , we have $\Pi_n(\mathcal{H})\leq |\mathcal{H}|$ , we have with probability at least $1 - \delta$ + +$$ +\begin{array}{l} \left| L (f \mid g) - L _ {n} (f \mid g) \right| \leq 9 \sqrt {\frac {2 \log | \mathrm {D L} _ {T} [ \mathcal {G} ; \mathcal {H} ] | + 2 \log | \mathcal {G} | + \log (8 / \delta)}{\# _ {n} (g)}} \\ \leq 9 \sqrt {\frac {2 (| \mathcal {G} | + 1) \log (| \mathcal {H} | | \mathcal {G} |) + \log (8 / \delta)}{\# _ {n} (g)}} \\ \end{array} +$$ + +for all $f\in \mathbb{D}\mathbb{L}_T[\mathcal{G};\mathcal{H}]$ and $g\in \mathcal{G}$ . Combined with Lemma 2, we have the proposition statement. + +# B.3. Proof of Theorem 4 + +We will actually show the slightly stronger bound of + +$$ +L (f \mid g) \leq \min _ {h \in \mathcal {H}} L (h \mid g) + 2 2 \left(\frac {\alpha \log (| \mathcal {G} | | \mathcal {H} |)}{\gamma \# _ {n} (g)}\right) ^ {1 / 3} + 1 8 \sqrt {\frac {\log (8 / \delta)}{\# _ {n} (g)}} +$$ + +where $\alpha = \min_{h\in \mathcal{H}}L_n(h)$ . The theorem follows from the fact that $\alpha \leq 1$ . + +We will take $\epsilon_{n}(g)$ to be the function + +$$ +\epsilon_ {n} (g) = 3 6 ^ {2 / 3} \left(\alpha \log (| \mathcal {G} | | \mathcal {H} |)\right) ^ {1 / 3} \left(\frac {n}{\gamma}\right) ^ {1 / 6} \left(\frac {1}{\# n (g)}\right) ^ {1 / 2}. +$$ + +Then the number of rounds PREPEND takes is bounded as + +$$ +\begin{array}{l} T \leq \frac {\alpha}{\min _ {g \in \mathcal {G} _ {n , \gamma}} P _ {n} (g) \epsilon_ {n} (g)} \\ = \frac {\alpha}{3 6 ^ {2 / 3} \left(\alpha \log (| \mathcal {G} | | \mathcal {H} |\right) ^ {1 / 3} (n / \gamma) ^ {1 / 6} \min _ {g \in \mathcal {G} _ {n , \gamma}} P _ {n} (g) (\# _ {n} (g)) ^ {- 1 / 2}} \\ = \alpha^ {2 / 3} 3 6 ^ {- 2 / 3} \left(\log (| \mathcal {G} | | \mathcal {H} |)\right) ^ {- 1 / 3} \left(\frac {n}{\gamma}\right) ^ {- 1 / 6} \cdot \left(\frac {n}{\gamma}\right) ^ {1 / 2} \\ = \alpha^ {2 / 3} 3 6 ^ {- 2 / 3} \left(c \log (| \mathcal {G} | | \mathcal {H} |)\right) ^ {- 1 / 3} \left(\frac {n}{\gamma}\right) ^ {1 / 3}. \\ \end{array} +$$ + +Observe that since $|\mathcal{G}|$ and $|\mathcal{H}|$ are finite, we have $|\mathbb{D}\mathbb{L}_T[\mathcal{G};\mathcal{H}]| \leq |\mathcal{H}|^{T + 1}|\mathcal{G}|^T$ . Combining Theorem 1 and Lemma 2, we + +have with probability $1 - \delta$ + +$$ +\begin{array}{l} L (f \mid g) \leq L _ {n} (f \mid g) + 9 \sqrt {\frac {2 (T + 1) \log (| \mathcal {H} | | \mathcal {G} |) + \log (8 / \delta)}{\# _ {n} (g)}} \\ \leq \min _ {h \in \mathcal {H}} L _ {n} (h \mid g) + \epsilon_ {n} (g) + 9 \sqrt {\frac {2 (T + 1) \log (| \mathcal {H} | | \mathcal {G} |) + \log (8 / \delta)}{\# _ {n} (g)}} \\ \leq \min _ {h \in \mathcal {H}} L (h \mid g) + \epsilon_ {n} (g) + 1 8 \sqrt {\frac {2 (T + 1) \log (| \mathcal {H} | | \mathcal {G} |) + \log (8 / \delta)}{\# _ {n} (g)}} \\ \leq \min _ {h \in \mathcal {H}} L (h \mid g) + \epsilon_ {n} (g) + 3 6 \sqrt {\frac {T \log (| \mathcal {H} | | \mathcal {G} |)}{\# _ {n} (g)}} + 1 8 \sqrt {\frac {\log (8 / \delta)}{\# _ {n} (g)}}. \\ \end{array} +$$ + +Now by our bound on $T$ , we have + +$$ +\begin{array}{l} 36 \sqrt {\frac {T \log (| \mathcal {H} | | \mathcal {G} |)}{\# _ {n} (g)}} \leq 3 6 \left(\frac {c \log (| \mathcal {H} | | \mathcal {G} |)}{\# _ {n} (g)} \cdot \alpha^ {2 / 3} 3 6 ^ {- 2 / 3} \left(\log (| \mathcal {G} | | \mathcal {H} |\right) ^ {- 1 / 3} \left(\frac {n}{\gamma}\right) ^ {1 / 3}\right) ^ {1 / 2} \\ = 3 6 ^ {2 / 3} \left(\alpha \log (| \mathcal {G} | | \mathcal {H} |)\right) ^ {1 / 3} \left(\frac {n}{\gamma}\right) ^ {1 / 6} \left(\frac {1}{\# _ {n} (g)}\right) ^ {1 / 2} = \epsilon_ {n} (g). \\ \end{array} +$$ + +Thus, we have + +$$ +L (f \mid g) \leq \min _ {h \in \mathcal {H}} L _ {n} (h \mid g) + 2 \epsilon_ {n} (g) + 1 8 \sqrt {\frac {\log (8 / \delta)}{\# _ {n} (g)}}. +$$ + +Finally, observe that $n / \gamma \leq \#_n(g) / \gamma^2$ for all $g\in \mathcal{G}_{n,\gamma}$ . Thus, we have + +$$ +\begin{array}{l} \epsilon_ {n} (g) = 3 6 ^ {2 / 3} \left(\alpha \log (| \mathcal {G} | | \mathcal {H} |)\right) ^ {1 / 3} \left(\frac {n}{\gamma}\right) ^ {1 / 6} \left(\frac {1}{\# _ {n} (g)}\right) ^ {1 / 2} \\ \leq 3 6 ^ {2 / 3} \left(\alpha \log (| \mathcal {G} | | \mathcal {H} |)\right) ^ {1 / 3} \left(\frac {\# _ {n} (g)}{\gamma^ {2}}\right) ^ {1 / 6} \left(\frac {1}{\# _ {n} (g)}\right) ^ {1 / 2} \\ \leq 3 6 ^ {2 / 3} \left(\frac {\alpha \log (| \mathcal {G} | | \mathcal {H} |)}{\gamma \# _ {n} (g)}\right) ^ {1 / 3}. \\ \end{array} +$$ + +# B.4. Proof of Corollary 5 + +By Lemma 14, we have with probability $1 - \delta /2$ that + +$$ +P _ {n} (g) \geq P (g) - 2 \sqrt {\frac {P (g)}{n} \log \left(1 6 | \mathcal {G} | / \delta\right)} +$$ + +for all $g \in \mathcal{G}$ . For the choice of $n$ in the statement, this implies $P_{n}(g) \geq \gamma / 2$ . By Theorem 4, we have with probability $1 - \delta / 2$ , + +$$ +L (f \mid g) \leq \min _ {h \in \mathcal {H}} L (h \mid g) + 2 2 \left(\frac {2 \log (1 6 | \mathcal {G} | | \mathcal {H} | / \delta)}{\gamma \# _ {n} (g)}\right) ^ {1 / 3} +$$ + +for all $g \in \mathcal{G}_{n,\gamma /2}$ . By a union bound, both of these hold with probability at least $1 - \delta$ , in which case we have $\mathcal{G}_{n,\gamma /2} = \mathcal{G}$ . Plugging in our bound on $\#_n(g) = nP_n(g)$ , we have + +$$ +\begin{array}{l} L (f \mid g) \leq \min _ {h \in \mathcal {H}} L (h \mid g) + 2 2 \left(\frac {2 \log (1 6 | \mathcal {G} | | \mathcal {H} | / \delta)}{\gamma \# _ {n} (g)}\right) ^ {1 / 3} \\ \leq \min _ {h \in \mathcal {H}} L (h \mid g) + 2 2 \left(\frac {4 \log (1 6 | \mathcal {G} | | \mathcal {H} | / \delta)}{\gamma^ {2} n}\right) ^ {1 / 3} \\ \leq \min _ {h \in \mathcal {H}} L (h \mid g) + \epsilon \\ \end{array} +$$ + +where the last line follows from the choice of $n$ in the corollary statement. + +![](images/e663b8e92efd19e764e4efc0cd6fd581f2815872af8889961c6cc07bd81a12ca.jpg) + +# B.5. Proof of Theorem 6 + +Observe first that every prediction by $f \in \mathbb{D}\mathbb{L}_T[\mathcal{G};\mathcal{H}]$ is actually done by some $h \in \mathcal{H}$ . Thus, + +$$ +\begin{array}{l} \Pi_ {n} \left(\left(\ell \circ \mathrm {D L} _ {T} [ \mathcal {G}; \mathcal {H} ]\right) _ {\text {t h r e s h}}\right) \leq \Pi_ {n} \left(\left(\ell \circ \mathcal {H}\right) _ {\text {t h r e s h}}\right) ^ {T + 1} \Pi_ {n} (\mathcal {G}) ^ {T} \\ \leq \left( \begin{array}{c} n \\ \leq d \end{array} \right) ^ {T + 1} \left( \begin{array}{c} n \\ \leq d \end{array} \right) ^ {T} \\ \leq (2 n) ^ {d (2 T + 1)} \\ \end{array} +$$ + +where the second line follows from the definition of pseudo-dimension and the Sauer-Shelah-Perles Lemma, and third line follows from the inequality $\binom{a}{\leq b} \leq (2a)^b$ . Thus, with probability $1 - \delta$ we have + +$$ +\left| L (f \mid g) - L _ {n} (f \mid g) \right| \leq 1 8 \sqrt {\frac {d (T + 1) \log (2 n) + \log (8 / \delta)}{\# _ {n} (g)}} \tag {3} +$$ + +for all $f \in \mathbb{D}\mathbb{L}_T[\mathcal{G};\mathcal{H}]$ and $g \in \mathcal{G}$ . Let us condition on this occurring. + +We will take $\epsilon_{n}(g)$ to be the function + +$$ +\epsilon_ {n} (g) = \left(2 \cdot 3 6 ^ {2} d \log (2 n)\right) ^ {1 / 3} \left(\frac {n}{\gamma}\right) ^ {1 / 6} \left(\frac {1}{\# _ {n} (g)}\right) ^ {1 / 2}. +$$ + +Then the number of rounds the rewrite algorithm takes is bounded as + +$$ +\begin{array}{l} T \leq \frac {L _ {0}}{\min _ {g \in \mathcal {G} _ {n , \gamma}} P _ {n} (g) \epsilon_ {n} (g)} \\ = \frac {1}{\left(2 \cdot 3 6 ^ {2} d \log (2 n)\right) ^ {1 / 3} (n / \gamma) ^ {1 / 6} \min _ {g \in \mathcal {G} _ {n , \gamma}} P _ {n} (g) (\# _ {n} (g)) ^ {- 1 / 2}} \\ \leq \left(2 \cdot 3 6 ^ {2} d \log (2 n)\right) ^ {- 1 / 3} \left(\frac {n}{\gamma}\right) ^ {- 1 / 6} \cdot \left(\frac {n}{\gamma}\right) ^ {1 / 2} \\ = \left(2 \cdot 3 6 ^ {2} d \log (2 n)\right) ^ {- 1 / 3} \left(\frac {n}{\gamma}\right) ^ {1 / 3}. \\ \end{array} +$$ + +Here, we have used the fact that the loss is bounded above by 1. Eq. (3) implies that, for the function $f$ returned by Algorithm 1, we have for all $g \in \mathcal{G}_{n,\gamma}$ , + +$$ +\begin{array}{l} L (f \mid g) \leq L _ {n} (f \mid g) + 1 8 \sqrt {\frac {d (T + 1) \log (2 n) + \log (8 / \delta)}{\# _ {n} (g)}} \\ \leq \min _ {h \in \mathcal {H}} L _ {n} (h \mid g) + \epsilon_ {n} (g) + 1 8 \sqrt {\frac {d (T + 1) \log (2 n) + \log (8 / \delta)}{\# _ {n} (g)}} \\ \leq \min _ {h \in \mathcal {H}} L (h \mid g) + \epsilon_ {n} (g) + 3 6 \sqrt {\frac {d (T + 1) \log (2 n) + \log (8 / \delta)}{\# _ {n} (g)}} \\ \leq \min _ {h \in \mathcal {H}} L (h \mid g) + \epsilon_ {n} (g) + 3 6 \sqrt {\frac {2 T d \log (2 n)}{\# _ {n} (g)}} + 3 6 \sqrt {\frac {\log (8 / \delta)}{\# _ {n} (g)}}. \\ \end{array} +$$ + +Now by our bound on $T$ , we have + +$$ +\begin{array}{l} 3 6 \sqrt {\frac {2 T d \log (2 n)}{\# _ {n} (g)}} \leq 3 6 \sqrt {\frac {2 d \log (2 n)}{\# _ {n} (g)} \left(2 \cdot 3 6 ^ {2} d \log (2 n)\right) ^ {- 1 / 3} \left(\frac {n}{\gamma}\right) ^ {1 / 3}} \\ = \left(2 \cdot 3 6 ^ {2} d \log (2 n)\right) ^ {1 / 3} \left(\frac {n}{\gamma}\right) ^ {1 / 6} \left(\frac {1}{\# _ {n} (g)}\right) ^ {1 / 2} \\ = \epsilon_ {n} (g). \\ \end{array} +$$ + +Thus, we have + +$$ +L (f \mid g) \leq \min _ {h \in \mathcal {H}} L _ {n} (h \mid g) + 2 \epsilon_ {n} (g) + 3 6 \sqrt {\frac {\log (8 / \delta)}{\# _ {n} (g)}}. +$$ + +Finally, observe that $n / \gamma \leq \#_n(g) / \gamma^2$ for all $g\in \mathcal{G}_{n,\gamma}$ . Thus, we have + +$$ +\begin{array}{l} \epsilon_ {n} (g) = \left(2 \cdot 3 6 ^ {2} d \log (2 n)\right) ^ {1 / 3} \left(\frac {n}{\gamma}\right) ^ {1 / 6} \left(\frac {1}{\# _ {n} (g)}\right) ^ {1 / 2} \\ \leq \left(2 \cdot 3 6 ^ {2} d \log (2 n)\right) ^ {1 / 3} \left(\frac {\# _ {n} (g)}{\gamma^ {2}}\right) ^ {1 / 6} \left(\frac {1}{\# _ {n} (g)}\right) ^ {1 / 2} \\ \leq 1 4 \left(\frac {d \log (2 n)}{\gamma \# _ {n} (g)}\right) ^ {1 / 3}. \\ \end{array} +$$ + +# B.6. Proof of Proposition 7 + +Let $\mathcal{X} = \{x_0, x_1, x_2\}$ and $g_i = \{x_0, x_i\}$ for $x_i = 1, 2$ . Let the marginal distribution over $\mathcal{X}$ be uniform. We will consider the 3 class classification setting, where $h_1(x) = 1$ and $h_2(x) = 2$ for all $x \in \mathcal{X}$ . We will consider two scenarios for the conditional distribution of $y$ given $x$ . + +In scenario 1, we have + +$$ +P (y \mid x _ {0}) = \left\{ \begin{array}{l l} 1 / 4 & \text {i f} y = 1, \\ 0 & \text {i f} y = 2, \\ 3 / 4 & \text {i f} y = 3, \end{array} \right. +$$ + +$$ +P (y \mid x _ {1}) = \left\{ \begin{array}{l l} 3 / 4 & \text {i f} y = 1, \\ 1 / 4 & \text {i f} y = 2, \\ 0 & \text {i f} y = 3, \end{array} \right. +$$ + +$$ +P (y \mid x _ {2}) = \left\{ \begin{array}{l l} 1 & \text {i f} y = 2, \\ 0 & \text {i f} y \in \{1, 3 \}. \end{array} \right. +$$ + +Abusing notation, we have under scenario 1: + +$$ +L \left(h _ {1} \mid x _ {0}\right) = 3 / 4 \quad L \left(h _ {1} \mid x _ {1}\right) = 1 / 4 \quad L \left(h _ {1} \mid x _ {2}\right) = 1 +$$ + +$$ +L \left(h _ {2} \mid x _ {0}\right) = 1 \quad L \left(h _ {2} \mid x _ {1}\right) = 3 / 4 \quad L \left(h _ {2} \mid x _ {2}\right) = 0 +$$ + +$$ +L \left(h _ {1} \mid g _ {1}\right) = 1 / 2 \quad L \left(h _ {1} \mid g _ {2}\right) = 7 / 8 +$$ + +$$ +L \left(h _ {2} \mid g _ {1}\right) = 7 / 8 \quad L \left(h _ {2} \mid g _ {2}\right) = 1 / 2. +$$ + +Observe that under scenario 1, for any decision list $f \in \mathbb{D}\mathbb{L}[\mathcal{G};\mathcal{H}]$ that does not order $(h_1,g_1)$ at the beginning there exists $g \in \mathcal{G}$ such that + +$$ +L (f \mid g) \geq \min _ {h \in \mathcal {H}} L (h \mid g) + 1 / 8. +$$ + +# Algorithm 4 MLC-HEDGE in the multi-group setting + +input Groups $\mathcal{G}$ , hypothesis class $\mathcal{H}$ , learning rates $\eta_{h,g} \in [0,1]$ . + +output Internal hypotheses $p_1(\cdot ;\cdot),\ldots p_n(\cdot ;\cdot)$ + +Initialize weights $w_{h,g}^{(0)} = \frac{1}{|\mathcal{H}||\mathcal{G}|}$ + +for $t = 1,2,\ldots ,n$ do + +Define + +$$ +p _ {t} ((h, g); x) := \frac {g (x) (1 - e ^ {- \eta_ {h , g}}) w _ {h , g} ^ {(t - 1)}}{\sum_ {h ^ {\prime} , g ^ {\prime}} g ^ {\prime} (x) (1 - e ^ {- \eta_ {h ^ {\prime} , g ^ {\prime}}}) w _ {h ^ {\prime} , g ^ {\prime}} ^ {(t - 1)}}. +$$ + +Receive point $(x_{t},y_{t})$ and incur loss + +$$ +\hat {\ell} _ {t} = \sum_ {h, g} g (x _ {t}) \ell (h (x _ {t}), y _ {t}) p _ {t} ((h, g); x _ {t}). +$$ + +Update weight vectors + +$$ +w _ {h, g} ^ {(t)} = w _ {h, g} ^ {(t - 1)} \exp \left(\eta_ {h, g} g (x _ {t}) \left(\hat {\ell} _ {t} e ^ {- \eta_ {h, g}} - \ell (h (x _ {t}), y _ {t})\right)\right). +$$ + +end for + +output $p_1,\ldots ,p_n$ + +In scenario 2, we have + +$$ +P (y \mid x _ {0}) = \left\{ \begin{array}{l l} 0 & \text {i f} y = 1, \\ 1 / 4 & \text {i f} y = 2, \\ 3 / 4 & \text {i f} y = 3, \end{array} \right. +$$ + +$$ +P (y \mid x _ {1}) = \left\{ \begin{array}{l l} 1 & \text {i f} y = 1, \\ 0 & \text {i f} y \in \{2, 3 \}, \end{array} \right. +$$ + +$$ +P (y \mid x _ {2}) = \left\{ \begin{array}{l l} 1 / 4 & \text {i f} y = 1, \\ 3 / 4 & \text {i f} y = 2, \\ 0 & \text {i f} y = 3. \end{array} \right. +$$ + +Under scenario 2: + +$$ +L \left(h _ {1} \mid x _ {0}\right) = 1 +$$ + +$$ +L \left(h _ {1} \mid x _ {1}\right) = 0 +$$ + +$$ +L \left(h _ {1} \mid x _ {2}\right) = 3 / 4 +$$ + +$$ +L \left(h _ {2} \mid x _ {0}\right) = 3 / 4 +$$ + +$$ +L \left(h _ {2} \mid x _ {1}\right) = 1 +$$ + +$$ +L \left(h _ {2} \mid x _ {2}\right) = 1 / 4 +$$ + +$$ +L \left(h _ {1} \mid g _ {1}\right) = 1 / 2 +$$ + +$$ +L \left(h _ {1} \mid g _ {2}\right) = 7 / 8 +$$ + +$$ +L \left(h _ {2} \mid g _ {1}\right) = 7 / 8 +$$ + +$$ +L (h _ {2} \mid g _ {2}) = 1 / 2. +$$ + +Conversely, we have that under scenario 2, for any decision list $f \in \mathbb{DL}[\mathcal{G};\mathcal{H}]$ that does not order $(h_2,g_2)$ at the beginning there exists $g \in \mathcal{G}$ such that + +$$ +L (f \mid g) \geq \min _ {h \in \mathcal {H}} L (h \mid g) + 1 / 8. +$$ + +# C. Missing proofs from Section 4 + +# C.1. MLC-HEDGE algorithm and guarantees + +Algorithm 4 displays MLC-HEDGE, as presented by Gaillard et al. (2014), in the multi-group learning setting. Theorem 16 of Gaillard et al. (2014) translates as follows. + +Theorem 16. Let $\eta_{h,g} \in [0,1]$ be the learning rate assigned to expert $(h,g)$ , and suppose that the initial probabilities are uniform over the experts. For each expert $(h,g)$ , the cumulative loss of MLC-HEDGE satisfies + +$$ +\sum_ {t = 1} ^ {n} g (x _ {t}) \left(\hat {\ell_ {t}} - \ell \left(h (x _ {t}), y _ {t}\right)\right) \leq \left(e - 1 + \frac {1}{\eta_ {h , g}}\right) \log \left(\left| \mathcal {H} \right| \left| \mathcal {G} \right|\right) + (e - 1) \eta_ {h, g} \sum_ {t = 1} ^ {n} g (x _ {t}) \ell \left(h (x _ {t}), y _ {t}\right). +$$ + +# C.2. An online-to-batch guarantee + +For a collection of internal hypotheses $p_1, \ldots, p_n$ and a distribution $Q$ over such hypotheses, we use the notational conventions + +$$ +L (p _ {t} \mid g) := \mathbb {E} _ {(x, y)} \left[ \mathbb {E} _ {(\tilde {h}, \tilde {g}) \sim p _ {t} (\cdot ; x)} \left[ \ell (\tilde {h} (x), y) \right] \mid g \right] +$$ + +$$ +L (Q \mid g) := \mathbb {E} _ {p _ {t} \sim Q} \left[ L (p _ {t} \mid g) \right]. +$$ + +The following lemma shows that the average population losses of these internal hypotheses can be bounded in terms of their average empirical performance. + +Lemma 17. Suppose the loss function is bounded in the range $[0,1]$ . Let $p_1,\ldots ,p_n$ be a sequence of hypotheses produced by an online learning algorithm on an i.i.d. sequence $(x_{1},y_{1}),\ldots ,(x_{n},y_{n})$ with associated losses $\hat{\ell}_1,\dots ,\hat{\ell}_n$ . Then with probability at least $1 - \delta$ , we have for all $g\in \mathcal{G}$ simultaneously + +$$ +\frac {1}{n} \sum_ {t = 1} ^ {n} L (p _ {t} \mid g) \leq \frac {1}{n} \sum_ {t = 1} ^ {n} \frac {g (x _ {t})}{P (g)} \hat {\ell} _ {t} + \sqrt {\frac {1}{n P (g)} \log \frac {| \mathcal {G} |}{\delta}} + \frac {2}{3 n P (g)} \log \frac {| \mathcal {G} |}{\delta}. +$$ + +A key ingredient in the proof of Lemma 17 is Freedman's inequality (Freedman, 1975). + +Theorem 18 (Freedman's inequality). Let $V_{1}, \ldots, V_{T}$ be a martingale difference sequence with respect to filtration $\mathcal{F}_t$ such that there exist constants $a, b \geq 0$ satisfying + +- $|V_t| \leq a$ for all $t = 1, \dots, T$ with probability 1 and +- $\sum_{t=1}^{T} \mathbb{E}[V_t^2 \mid \mathcal{F}_{t-1}] \leq b^2$ . + +Then with probability at least $1 - \delta$ , we have + +$$ +\sum_ {t = 1} ^ {T} V _ {t} \leq \frac {2}{3} a \log \frac {1}{\delta} + b \sqrt {2 \ln \frac {1}{\delta}}. +$$ + +Our proof of Lemma 17 is similar to the online-to-batch reduction of Cesa-Bianchi et al. (2004). Namely, fix $g \in \mathcal{G}$ and define the random variable + +$$ +V _ {t} = \frac {1}{n} L (p _ {t} \mid g) - \frac {1}{n P (g)} g (x _ {t}) \hat {\ell} _ {t} = \frac {1}{n} L (p _ {t} \mid g) - \frac {1}{n P (g)} g (x _ {t}) \sum_ {h, g ^ {\prime}} g ^ {\prime} (x _ {t}) p _ {t} (h, g ^ {\prime}; x _ {t}) \ell (h (x _ {t}), y _ {t}). +$$ + +Notice that $V_{1},\ldots ,V_{n}$ form a martingale difference sequence. Moreover, $V_{t}\in \left[-\frac{1}{nP(g)},\frac{1}{nP(g)}\right]$ . Letting $\mathcal{F}_t$ denote the + +sigma-field of all outcomes up to time $t$ , we can calculate + +$$ +\begin{array}{l} \mathbb {E} \left[ \left(g (x _ {t}) \sum_ {h, g ^ {\prime}} g ^ {\prime} (x _ {t}) p _ {t} (h, g ^ {\prime}; x _ {t}) \ell (h (x _ {t}), y _ {t})\right) ^ {2} \mid \mathcal {F} _ {t - 1} \right] \\ = P (g) \mathbb {E} \left[ \mathbb {E} \left[ \left(\sum_ {h, g ^ {\prime}} g ^ {\prime} \left(x _ {t}\right) p _ {t} \left(h, g ^ {\prime}; x _ {t}\right) \ell \left(h \left(x _ {t}\right), y _ {t}\right)\right) ^ {2} \mid g \right] \mid \mathcal {F} _ {t - 1} \right] \\ \leq P (g) \mathbb {E} \left[ \mathbb {E} \left[ \sum_ {h, g ^ {\prime}} g ^ {\prime} \left(x _ {t}\right) p _ {t} \left(h, g ^ {\prime}; x _ {t}\right) \ell \left(h \left(x _ {t}\right), y _ {t}\right) ^ {2} \mid g \right] \mid \mathcal {F} _ {t - 1} \right] \\ \leq P (g) \mathbb {E} \left[ L \left(p _ {t} \mid g\right) \mid \mathcal {F} _ {t - 1} \right] = P (g) L \left(p _ {t} \mid g\right) \\ \end{array} +$$ + +where the first inequality is Jensen's inequality and the second follows from the fact that the losses lie in $[0, 1]$ . Thus, + +$$ +\mathbb {E} [ V _ {t} ^ {2} \mid \mathcal {F} _ {t - 1} ] \leq \frac {1}{n ^ {2} P (g)} L (p _ {t} \mid g) - \frac {1}{n ^ {2}} L (p _ {t} \mid g) ^ {2} \leq \frac {1}{n ^ {2} P (g)} L (p _ {t} \mid g). +$$ + +Freedman's inequality then implies that with probability at least $1 - \delta /|\mathcal{G}|$ + +$$ +\begin{array}{l} \frac {1}{n} \sum_ {t = 1} ^ {n} L (p _ {t} \mid g) \leq \frac {1}{n P (g)} \sum_ {t = 1} ^ {T} g (x _ {t}) \hat {\ell} _ {t} + \frac {1}{n} \sqrt {\frac {1}{P (g)} \sum_ {t = 1} ^ {n} L (p _ {t} \mid g) \log \frac {| \mathcal {G} |}{\delta}} + \frac {2}{3 n P (g)} \log \frac {| \mathcal {G} |}{\delta} \\ \leq \frac {1}{n P (g)} \sum_ {t = 1} ^ {T} g (x _ {t}) \hat {\ell} _ {t} + \sqrt {\frac {1}{n P (g)} \log \frac {| \mathcal {G} |}{\delta}} + \frac {2}{3 n P (g)} \log \frac {| \mathcal {G} |}{\delta}, \\ \end{array} +$$ + +where we have again used the fact that the losses lie in $[0,1]$ . Taking a union bound over $\mathcal{G}$ finishes the proof. + +![](images/61b42b6cebc87dc00db5c2ac877286a02eef6ec39b818e04ad1bf17645cf3090.jpg) + +# C.3. Proof of Theorem 8 + +We will show that with probability at least $1 - \delta$ , the predictor $Q$ returned by Algorithm 2 satisfies + +$$ +L (Q \mid g) \leq \min _ {h \in \mathcal {H}} L (h \mid g) + 6 0 \sqrt {\frac {D}{\# _ {n} (g)}} + \frac {1 6 D}{\# _ {n} (g)} \quad \forall g \in \mathcal {G}, +$$ + +where $D = 2\log (|\mathcal{H}||\mathcal{G}|) + \log \frac{64}{\delta}$ + +Let $m = \lfloor n / 2\rfloor$ , and let $(x_{1},y_{1}),\ldots ,(x_{m},y_{m}),(x_{1}^{\prime},y_{1}^{\prime}),\ldots ,(x_{m}^{\prime},y_{m}^{\prime})$ be the data split utilized by Algorithm 2. For these two splits of our data, we will use the notation + +$$ +\begin{array}{l} S _ {m} (g) = \sum_ {i = 1} ^ {m} g \left(x _ {i}\right) \\ S _ {m} ^ {\prime} (g) = \sum_ {i = 1} ^ {m} g \left(x _ {i} ^ {\prime}\right) \\ L _ {m} (h \mid g) = \frac {1}{S _ {m} (g)} \sum_ {i = 1} ^ {m} g \left(x _ {i}\right) \ell \left(h \left(x _ {i}\right), y _ {i}\right). \\ \end{array} +$$ + +From Theorem 1 and Lemma 15, we have that with probability at least $1 - \delta /2$ + +$$ +\begin{array}{l} L _ {m} (h \mid g) \leq L (h \mid g) + 9 \sqrt {\frac {D}{S _ {m} (g)}} \\ - 2 \sqrt {S _ {m} (g) D} \leq m P (g) - S _ {m} (g) \leq 2 \sqrt {S _ {m} (g) D} + 4 D \\ - 2 \sqrt {S _ {m} ^ {\prime} (g) D} \leq m P (g) - S _ {m} ^ {\prime} (g) \leq 2 \sqrt {S _ {m} ^ {\prime} (g) D} + 4 D \\ - 2 \sqrt {\# _ {n} (g) D} \leq n P (g) - \# _ {n} (g) \leq 2 \sqrt {\# _ {n} (g) D} + 4 D \\ \end{array} +$$ + +for all $h\in \mathcal{H}$ and $g\in \mathcal{G}$ . Moreover, combining Theorem 16 and Lemma 17, we have that with probability at least $1 - \delta /2$ + +$$ +\begin{array}{l} L (Q \mid g) = \frac {1}{m} \sum_ {t = 1} ^ {m} L \left(p _ {t} \mid g\right) \\ \leq \frac {1}{m} \sum_ {t = 1} ^ {m} \frac {g (x _ {t})}{P (g)} \hat {\ell} _ {t} + \sqrt {\frac {1}{m P (g)} \log \frac {2 | \mathcal {G} |}{\delta}} + \frac {2}{3 m P (g)} \log \frac {2 | \mathcal {G} |}{\delta} \\ \leq \frac {1}{m P (g)} \left[ \sum_ {t = 1} ^ {m} g (x _ {t}) \ell \left(h _ {g} (x _ {t}), y _ {t}\right) + \left(e - 1 + \frac {1}{\eta_ {h _ {g} , g}}\right) \log \left(\left| \mathcal {H} \right| \left| \mathcal {G} \right|\right) + (e - 1) \eta_ {h _ {g}, g} \sum_ {t = 1} ^ {m} g (x _ {t}) \ell \left(h (x _ {t}), y _ {t}\right) \right] \\ + \sqrt {\frac {1}{m P (g)} \log \frac {2 | \mathcal {G} |}{\delta}} + \frac {2}{3 m P (g)} \log \frac {2 | \mathcal {G} |}{\delta} \\ \leq \frac {1}{m P (g)} \left[ \sum_ {t = 1} ^ {m} g \left(x _ {t}\right) \ell \left(h \left(x _ {t}\right), y _ {t}\right) + \left(2 + \frac {1}{\eta_ {h _ {g} , g}}\right) \log \left(\left| \mathcal {H} \right| \left| \mathcal {G} \right|\right) + 2 \eta_ {h, g} S _ {m} (g) \right] \\ + \sqrt {\frac {1}{m P (g)} \log \frac {2 | \mathcal {G} |}{\delta}} + \frac {2}{3 m P (g)} \log \frac {2 | \mathcal {G} |}{\delta} \\ \end{array} +$$ + +for all $g \in \mathcal{G}$ , where $h_g \coloneqq \operatorname*{argmin}_{h \in \mathcal{H}} L(h_g \mid g)$ and the last line has used the fact that the losses are restricted to $[0,1]$ . By a union bound, with probability at least $1 - \delta$ all of the above occurs. Let us condition on this happening. + +Pick some $g \in \mathcal{G}$ . Observe that the theorem trivially holds if $\#_n(g) < 352D + 4$ . Thus, we may assume $\#_n(g) \geq 352D + 4$ . In this setting, we can then see that + +$$ +\begin{array}{l} S _ {m} (g) \geq m P (g) - 2 \sqrt {S _ {m} (g) D} + 4 D \\ \geq \left(\frac {n}{2} - 1\right) P (g) - 2 \sqrt {S _ {m} (g) D} - 4 D \\ \geq \frac {1}{2} \left(\# _ {n} (g) - 2 \sqrt {\# _ {n} (g) D}\right) - 2 \sqrt {S _ {m} (g) D} - 4 D - 1 \\ \geq \frac {1}{2} \# _ {n} (g) - 3 \sqrt {\# _ {n} (g) D} - 4 D - 1 \\ \geq \frac {1}{4} \# _ {n} (g). \\ \end{array} +$$ + +Here the second-to-last line follows from the fact that $S_{m}(g) \leq \#_{n}(g)$ and the last line follows from our lower bound on $\#_{n}(g)$ . By a similar chain of reasoning, we also have $S_{m}^{\prime}(g) \geq \frac{1}{4} \#_{n}(g)$ . Given this, we can bound + +$$ +\begin{array}{l} \frac {1}{m P (g)} \sum_ {t = 1} ^ {m} g (x _ {t}) \ell (h (x _ {t}), y _ {t}) \leq \frac {S _ {m} (g)}{m P (g)} \left(L (h \mid g) + 9 \sqrt {\frac {D}{S _ {m} (g)}}\right) \\ \leq \frac {m P (g) + 2 \sqrt {S _ {m} (g) D}}{m P (g)} L (h \mid g) + \frac {9 \sqrt {D S _ {m} (g)}}{m P (g)} \\ \leq L (h \mid g) + \frac {1 1 \sqrt {D S _ {m} (g)}}{S _ {m} (g) - 2 \sqrt {D S _ {m} (g)}} \leq L (h \mid g) + 2 2 \sqrt {\frac {D}{S _ {m} (g)}} \\ \end{array} +$$ + +where the last inequality follows from the fact that $S_{m}(g) \geq \frac{1}{4} \#_{n}(g) > 16D$ . Similarly, we also have + +$$ +\frac {\sqrt {S _ {m} ^ {\prime} (g)}}{m P (g)} \leq 2 \sqrt {\frac {1}{S _ {m} ^ {\prime} (g)}} +$$ + +and + +$$ +\frac {S _ {m} (g)}{m P (g)} \leq 2. +$$ + +Putting it all together, we have + +$$ +\begin{array}{l} L (Q \mid g) \leq L (h \mid g) + 2 2 \sqrt {\frac {D}{S _ {m} (g)}} + \frac {2}{m P (g)} \left(\log (| \mathcal {G} | | \mathcal {H} |) + \frac {1}{3} \log \frac {2 | \mathcal {G} |}{\delta}\right) \\ + \frac {\sqrt {S _ {m} ^ {\prime} (g) \log (| \mathcal {G} | | \mathcal {H} |)}}{m P (g)} + \frac {2 S _ {m} (g)}{m P (g)} \sqrt {\frac {\log (| \mathcal {G} | | \mathcal {H} |)}{S _ {m} ^ {\prime} (g)}} + \sqrt {\frac {1}{m P (g)} \log \frac {2 | \mathcal {G} |}{\delta}} \\ \leq L (h \mid g) + 2 2 \sqrt {\frac {D}{S _ {m} (g)}} + \frac {4 D}{S _ {m} (g)} + 2 \sqrt {\frac {D}{S _ {m} ^ {\prime} (g)}} + 4 \sqrt {\frac {D}{S _ {m} ^ {\prime} (g)}} + 2 \sqrt {\frac {D}{S _ {m} (g)}} \\ \leq L (h \mid g) + 6 0 \sqrt {\frac {D}{\# _ {n} (g)}} + \frac {1 6 D}{\# _ {n} (g)}. \\ \end{array} +$$ + +# D. Missing proofs from Section 5 + +# D.1. Proof of Theorem 10 + +Let $\mathcal{F}$ denote the set of possible predictors produced by Algorithm 3. Since the only degrees of freedom enjoyed by Algorithm 3 are which classifier to assign to which group, we see that $|\mathcal{F}| \leq |\mathcal{G}||\mathcal{H}|$ . Moreover, since each of the classifiers $\hat{h}_g$ are consistent with the data in their respective groups, we can conclude that $f$ is consistent with all of the data. In particular, $L_n(f \mid g) = 0$ for all $g \in \mathcal{G}$ . Theorem 12 then implies that with probability at least $1 - \delta$ , + +$$ +L (f \mid g) \leq \frac {1 6}{\# _ {n} (g)} \left(2 \log \left(| \mathcal {F} | | \mathcal {H} |\right) + \log (8 / \delta)\right) \leq \frac {1 6}{\# _ {n} (g)} \left(2 \log \left(| \mathcal {G} | ^ {2} | \mathcal {H} |\right) + \log (8 / \delta)\right) +$$ + +for all $g\in \mathcal{G}$ + +# D.2. Proof of Proposition 11 + +Let $\mathcal{X} = \{x_0, x_1, x_2, x_3\}$ with the following probabilities + +$$ +P \left(\left(x _ {0}, + 1\right)\right) = 3 / 2 4, +$$ + +$$ +P \left(\left(x _ {1}, - 1\right)\right) = 7 / 2 4, +$$ + +$$ +P \left(\left(x _ {2}, - 1\right)\right) = 7 / 2 4, +$$ + +$$ +P \left(\left(x _ {3}, + 1\right)\right) = 7 / 2 4. +$$ + +We also take $g_{i} = \{x_{0}, x_{i}\}$ for $i = 1, 2, 3$ , and let $\mathcal{H} = \{h, h'\}$ where $h(x) = +1$ and $h'(x) = -1$ for all $x \in \mathcal{X}$ . + +Now any function $f \in \mathcal{F}$ corresponds to an assignment $\sigma : \mathcal{G} \to \mathcal{H}$ of groups to hypotheses. There are two cases to consider here. + +Case 1: $\sigma(g_1) = \sigma(g_2) = h'$ . In this case, we have that $f(x_0) = -1$ . Thus, + +$$ +L (f \mid g _ {3}) \geq P (x _ {0} \mid g _ {3}) = \frac {3}{1 0} = L (h \mid g) + \frac {3}{1 0}. +$$ + +Case 2: $h \in \{\sigma(g_1), \sigma(g_2)\}$ . Suppose without loss of generality that $\sigma(g_1) = h$ . Then we have $f(x_1) = +1$ . Thus, + +$$ +L (f \mid g _ {1}) \geq P (x _ {1} \mid g _ {1}) = \frac {7}{1 0} = L \left(h ^ {\prime} \mid g\right) + \frac {4}{1 0}. +$$ + +# E. Insufficiency of multiaccuracy + +In the binary prediction setting where $\mathcal{V} = \{0,1\}$ , Kim et al. (2019) use the definition that a function $f:\mathcal{X}\to [0,1]$ is $\alpha$ -multiaccurate with respect to $\mathcal{C}\subset [-1, + 1]^{\mathcal{X}}$ if + +$$ +\mathbb {E} _ {x, y} \left[ c (x) (f (x) - y) \right] \leq \alpha +$$ + +for all $c \in \mathcal{C}$ . To simplify the discussion, let us assume that the label $y$ is a deterministic function of the corresponding $x$ , i.e. there exists $\eta \in \{0,1\}^{\mathcal{X}}$ such that $\mathbb{E}[y \mid x] = \eta(x)$ . In this setting, Kim et al. showed that multiaccuracy can be translated into a notion of multi-group learning as follows. + +Proposition 19 (Proposition 1 from Kim et al. (2019)). Let $\mathcal{C}$ and $S \subseteq \mathcal{X}$ be given, and suppose that $f: \mathcal{X} \to [0,1]$ is $\alpha$ -multiaccurate with respect to $\mathcal{C}$ . Further define $\hat{\eta}(x) = 1 - 2\eta(x)$ . If there exists a $c \in \mathcal{C}$ such that + +$$ +\mathbb {E} _ {x, y} [ | c (x) - \hat {\eta} (x) 1 1 [ x \in S ] | ] \leq \tau , +$$ + +then + +$$ +\Pr_ {x, y} \left(\operatorname {s i g n} (f (x) - 1 / 2) \neq \operatorname {s i g n} (y - 1 / 2) \mid x \in S\right) \leq \frac {2}{P (S)} (\alpha + \tau). +$$ + +In the multi-group learning setup where $\mathcal{H} \subset [-1, +1]^{\mathcal{X}}$ and $\mathcal{G} \subset \{0, 1\}^{\mathcal{X}}$ , we can take $\mathcal{C} = \{x \mapsto h(x)g(x) \mid h \in \mathcal{H}, g \in \mathcal{G}\}$ . Proposition 19 tells us that $\alpha$ -multiaccuracy with respect to $\mathcal{C}$ implies + +$$ +\Pr_ {x, y} (\operatorname {s i g n} (f (x) - 1 / 2) \neq \operatorname {s i g n} (y - 1 / 2) \mid x \in g) \leq 4 \inf _ {h \in \mathcal {H}} L (h \mid g) + \frac {2 \alpha}{P (g)} \quad \text {f o r a l l} g \in \mathcal {G}, \tag {4} +$$ + +where the loss in $L(\cdot \mid \cdot)$ is zero-one loss. + +When each group has a corresponding low error classifier in $\mathcal{H}$ , Eq. (4) tells us that multiaccuracy leads to reasonably good predictions across all groups. However, the bound in Eq. (4) devolves to no better than random guessing whenever $\inf_{h\in \mathcal{H}}L(h\mid g)\geq 1 / 8$ . One may ask if this is due to some slack in the proof of Proposition 19 or if it is some intrinsic looseness associated with multiaccuracy. The following result shows that multiaccuracy reduction must result in at least some constant in front of $\inf_{h\in \mathcal{H}}L(h\mid g)$ . + +Proposition 20. Suppose $|\mathcal{X}|\geq 3$ and let $\epsilon >0$ . There exist $\eta ,f,g\in \{0,1\}^{\mathcal{X}}$ , $h\in \{-1, + 1\}^{\mathcal{X}}$ , and a marginal distribution over $\mathcal{X}$ such that + +- $f$ is 0-multiaccurate with respect to $\mathcal{C} = \{h \cdot g\}$ , +- $\operatorname{Pr}_x\left(h(x) \neq \eta(x) \mid x \in g\right) = \epsilon$ , but +- $\operatorname{Pr}_x(f(x) \neq \eta(x) \mid x \in g) = 2\epsilon.$ + +Proof. Suppose $\mathcal{X} = \{x_0, x_1, x_2\}$ with $P(x_0) = 1 - 2\epsilon$ and $P(x_1) = P(x_2) = \epsilon$ . Let $\eta(x) = g(x) = 1$ for all $x \in \mathcal{X}$ and define + +$$ +f (x) = \left\{ \begin{array}{l l} 0 & \text {i f} x \in \{x _ {1}, x _ {2} \} \\ 1 & \text {i f} x = x _ {0} \end{array} \right. \qquad \text {a n d} \qquad h (x) = \left\{ \begin{array}{l l} 1 & \text {i f} x \in \{x _ {0}, x _ {1} \} \\ - 1 & \text {i f} x = x _ {2} \end{array} \right.. +$$ + +Then we can establish the following facts. + +1. $\operatorname{Pr}_x\left(h(x) \neq \eta(x) \mid x \in g\right) = P(x_2) = \epsilon.$ +2. $\operatorname{Pr}_x(f(x) \neq \eta(x) \mid x \in g) = 1 - P(x_0) = 2\epsilon.$ + +3. For $c = h\cdot g$ , we have + +$$ +\mathbb {E} [ c (x) (f (x) - \eta (x)) ] = \mathbb {E} [ h (x) f (x) ] - \mathbb {E} [ h (x) ] = 1 - 2 \epsilon - (1 - 2 \epsilon) = 0. +$$ + +Thus, $f$ is 0-multiaccurate with respect to $\mathcal{C} = \{c\}$ . + +Combining all of the above gives the proposition. + +Thus, to get multi-group learning bounds of the form in Eq. (1) or Eq. (2), we must go beyond this type of simple application of multiaccuracy. \ No newline at end of file diff --git a/simpleandnearoptimalalgorithmsforhiddenstratificationandmultigrouplearning/images.zip b/simpleandnearoptimalalgorithmsforhiddenstratificationandmultigrouplearning/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..10936963aa5f5c77ac0a037253af4371115e98fd --- /dev/null +++ b/simpleandnearoptimalalgorithmsforhiddenstratificationandmultigrouplearning/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:86642ded8d7449191d4f4e1224fa1cea091769f8a7719426d8fec9a0500d7c02 +size 1470938 diff --git a/simpleandnearoptimalalgorithmsforhiddenstratificationandmultigrouplearning/layout.json b/simpleandnearoptimalalgorithmsforhiddenstratificationandmultigrouplearning/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..3e1a0965c712d24643f157b52e4b4f41dbc3f409 --- /dev/null +++ b/simpleandnearoptimalalgorithmsforhiddenstratificationandmultigrouplearning/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:85d9cb4ac68b77ace904b2522e2cfd061b29baf16cc7510d4b7325098d99eb0c +size 1300048 diff --git a/simplexneuralpopulationlearninganymixturebayesoptimalityinsymmetriczerosumgames/55282cf3-5cab-4ad5-a31e-4767c554377e_content_list.json b/simplexneuralpopulationlearninganymixturebayesoptimalityinsymmetriczerosumgames/55282cf3-5cab-4ad5-a31e-4767c554377e_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..df075d4aabe69a46c180dc8387fb9f3c2f764983 --- /dev/null +++ b/simplexneuralpopulationlearninganymixturebayesoptimalityinsymmetriczerosumgames/55282cf3-5cab-4ad5-a31e-4767c554377e_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fc8e26a0ba256c3f03b0aee9293be104be7571f199a022541d8c5984ebe85b6c +size 99851 diff --git a/simplexneuralpopulationlearninganymixturebayesoptimalityinsymmetriczerosumgames/55282cf3-5cab-4ad5-a31e-4767c554377e_model.json b/simplexneuralpopulationlearninganymixturebayesoptimalityinsymmetriczerosumgames/55282cf3-5cab-4ad5-a31e-4767c554377e_model.json new file mode 100644 index 0000000000000000000000000000000000000000..8ab98c1fd5d71b2d344119028597b938e9051947 --- /dev/null +++ b/simplexneuralpopulationlearninganymixturebayesoptimalityinsymmetriczerosumgames/55282cf3-5cab-4ad5-a31e-4767c554377e_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8a3742332a799afd0ba5fd9e87265722af41d92fef3e00531fd8cc9da16fa4ad +size 113379 diff --git a/simplexneuralpopulationlearninganymixturebayesoptimalityinsymmetriczerosumgames/55282cf3-5cab-4ad5-a31e-4767c554377e_origin.pdf b/simplexneuralpopulationlearninganymixturebayesoptimalityinsymmetriczerosumgames/55282cf3-5cab-4ad5-a31e-4767c554377e_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..20687e119a721955fe57ea2bbb94b8500ab7e3a0 --- /dev/null +++ b/simplexneuralpopulationlearninganymixturebayesoptimalityinsymmetriczerosumgames/55282cf3-5cab-4ad5-a31e-4767c554377e_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:520039a871685779ecb8990163a43f38033b2864c008fa2885dfc68f6a9cd092 +size 1431167 diff --git a/simplexneuralpopulationlearninganymixturebayesoptimalityinsymmetriczerosumgames/full.md b/simplexneuralpopulationlearninganymixturebayesoptimalityinsymmetriczerosumgames/full.md new file mode 100644 index 0000000000000000000000000000000000000000..2532eaa8db03c8bf7b57341ecadc80063e54ebc3 --- /dev/null +++ b/simplexneuralpopulationlearninganymixturebayesoptimalityinsymmetriczerosumgames/full.md @@ -0,0 +1,343 @@ +# Simplex Neural Population Learning: Any-Mixture Bayes-Optimality in Symmetric Zero-sum Games + +Siqi Liu $^{12}$ Marc Lanctot $^{2}$ Luke Harris $^{12}$ Nicolas Heess + +# Abstract + +Learning to play optimally against any mixture over a diverse set of strategies is of important practical interests in competitive games. In this paper, we propose simplex-NeuPL that satisfies two desiderata simultaneously: i) learning a population of strategically diverse basis policies, represented by a single conditional network; ii) using the same network, learn best-responses to any mixture over the simplex of basis policies. We show that the resulting conditional policies incorporate prior information about their opponents effectively, enabling near optimal returns against arbitrary mixture policies in a game with tractable best-responses. We verify that such policies behave Bayes-optimally under uncertainty and offer insights in using this flexibility at test time. Finally, we offer evidence that learning best-responses to any mixture policies is an effective auxiliary task for strategic exploration, which, by itself, can lead to more performant populations. + +# 1. Introduction + +How could we train agents to perform optimally against arbitrary mixtures over diverse opponent policies? Population learning offers one potential answer: generate a diverse set of opponents and train the agent to respond to mixtures of opponents over the population. The question then becomes how the population is generated and what properties it should have. In two-player zero-sum games, there is a well-known solution to this problem based on game-theoretic foundations: a Nash equilibrium distribution (NE, Nash (1951)) over a population of policies maximizes an agent's worst-case return against all possible opponent policies. Despite its theoretical appeal, searching the entire policy space quickly becomes intractable for + +most games. To this end, empirical game-theoretic analysis (EGTA, Wellman (2006)) proposed to study strategic exploration in games by investigating empirical (meta-)games, where each player considers only a small subset of possible policies. Policy-Space Response Oracles (PSRO, Lanctot et al. (2017)), further proposed a general, iterative framework towards constructing such empirical games. At each iteration, the policy population incorporates a new basis policy that is trained to best-respect to a mixture over its predecessors, following a meta-strategy solver (MSS). Importantly, when the best-response operator is exact, certain meta-strategy solvers produce meta-strategies known to converge to an NE of the game. + +One property of the NE target distribution is that it optimizes a safe objective: it maximizes the expected payoff in the worst-case, with the assumption that the opponents would play minimax-optimally. This assumption, however, rarely holds in practice — real-world agents could play arbitrarily far from NE, a phenomenon frequently observed among human players (Wright & Leyton-Brown, 2017), due to inadequate training or simply, to the overwhelming complexity of the game. This translates to the unfortunate situation where NE, though unexploitable, often leads to sub-optimal decision making at test time. The flexibility for players to express subjective beliefs over the opponent and to play optimally, based on such beliefs is thus of interests. We refer to this ability to play optimally against any mixture over a diverse set of policies as any-mixture optimality. Indeed, skilled human players are observed to resort to such flexibility when competing in games, adjusting their behaviours based on assumptions about their opponents so as to play optimally, if their assumptions prove correct (King-Casas et al., 2005; Schlicht et al., 2010). + +Unfortunately, existing population learning algorithms such as PSRO precisely lack such flexibility. The choice of MSS not only controls the strategic diversity of the resulting population, but also, restricts the set of basis policies that can be executed at test time. In particular, the output of population learning is a set of best-responses to specific mixture policies, enumerated by the MSS at each iteration. Consequently, a player can only play optimally against a few sets of opponents, or forgo optimality entirely and execute + +the NE mixture policy so as to be assured of safety, in expectation, over many games. At its extreme, a player cannot guarantee to play optimally even when the opponent uses the same population of policies and publicly declares their strategy in advance, nor can they play optimally if they wish to consider all strategies equally likely a priori without unduly ruling out any opponent strategy. + +Our goal is therefore to extend game-theoretic population learning algorithms so as to offer any-mixture optimality at test time. To this end, we interpret PSRO geometrically as iteratively expanding a population simplex whose vertices correspond to the set of basis policies, each best-responding to a point within the simplex from the previous iteration (Figure 1). To instead learn best-responses to all points within the population simplex, we further generalise recent work on Neural Population Learning (NeuPL, Liu et al. (2022)), a general framework that incorporates principled population learning algorithms, using scalable and efficient representation for the population of policies via a single conditional neural network. The result is thus a simple extension that not only retains the efficiency and game-theoretic properties of NeuPL, but also yields a conditional policy that behaves optimally against arbitrary mixtures over the policy population (Section 3). Additionally, we recognize best-response solving across the population simplex as optimising a continuum of Bayes-optimal objectives (Humplik et al., 2019; Ortega et al., 2019) and demonstrate properties of the resulting policies typically associated with Bayes-optimality. In particular, we show that the resulting conditional policies effectively incorporate prior information about their opponents so as to achieve near optimal returns against arbitrary mixtures policies in a game with tractable best-response solutions (Section 4.1). We further compare different choices of policies at test time in a more complex, partially-observed, spatiotemporal strategy game and show that executing the NE mixture policy can be far from optimal whereas executing an uninformed policy that considers all opponent strategies equally likely a priori can be highly effective (Section 4.2). Lastly, we show that simplex-NeuPL is not only critical in providing any-mixture optimality, but also, facilitates strategic exploration by promoting transfer across best-responses to the continuum of mixture policies, leading to more performant populations at no extra costs (Section 4.3). + +# 2. Background + +# 2.1. Partially-Observed Stochastic Games (POSG) + +Stochastic games (Shapley, 1953) generalise the basic formalism of Markov Decision Processes (MDPs) to multiple players. To model partial observability, we define a symmetric zero-sum partially-observed stochastic game (Hansen et al., 2004) by $(S,\mathcal{O},\mathcal{X},\mathcal{A},\mathcal{P},\mathcal{R})$ where $S$ defines the + +state space, $\mathcal{O}$ the observation space and $\mathcal{X}:S\to \mathcal{O}\times \mathcal{O}$ the observation function that returns partial views of the state for both players. Let $\mathcal{P}:S\times \mathcal{A}\times \mathcal{A}\rightarrow \operatorname *{Pr}(\mathcal{S})$ be the state transition distribution given a state and joint actions, $\mathcal{R}:S\to \mathbb{R}\times \mathbb{R}$ the reward function defining rewards for both players in state $s_t$ , denoted $\mathcal{R}(s_t) = (r_t, - r_t)$ . In state $s_t$ , players act according to policies conditioned on their respective observation histories $(\pi (\cdot |o_{\leq t}),\pi^{\prime}(\cdot |o_{\leq t}^{\prime}))$ . In practice, observation history can be represented as fixed-size embedding with the use of a learned recurrent neural network. Player $\pi$ achieves an expected return of $J(\pi ,\pi^{\prime}) = \mathbb{E}_{\pi ,\pi^{\prime}}[\sum_{t}r_{t}]$ against $\pi^\prime$ . A game is said to be symmetric if the expected return of a policy is only dependent on the policy played by the other player, rather than the identity or order of the player. A policy $\pi^{*}$ is said to best-respect to $\pi^{\prime}$ if $\forall \pi ,J(\pi^{*},\pi^{\prime})\geq J(\pi ,\pi^{\prime})$ . We note $\pi^{*}\gets \mathrm{BR}(\pi^{\prime})$ , if a best-response policy against $\pi^{\prime}$ can be computed tractably. In practice, an exact best-response operator may be intractable computationally and we define approximate best-response (ABR) operators as $\hat{\pi}\gets \mathrm{ABR}(\pi ,\pi^{\prime})$ such that $J(\hat{\pi},\pi^{\prime})\geq J(\pi ,\pi^{\prime})$ . In other words, an approximate best-response operator produces a policy $\hat{\pi}$ that performs at least as well as $\pi$ against $\pi^{\prime}$ . It's worth noting that we focus on POSG instead of Normalform Games (NFGs) as our focus is on developing Bayes-optimal policies that can benefit from information gathered through sequential interactions. + +# 2.2. Population Learning + +Population Learning defines an iterative procedure for strategic exploration in games. In particular, we consider the formalism of Policy-Space Response Oracles (PSRO, Lancot et al. (2017)) which combined EGTA with deep reinforcement learning. Given a symmetric zero-sum, partially-observed, stochastic game where each player has access to the same set of $N$ policies $\Pi \coloneqq \{\pi_i\}_{i = 0}^{N - 1}$ , we define a normal-form empirical (meta-)game where players' $i$ -th action corresponds to executing policy $\pi_{i}$ for an episode. A probability assignment $\sigma \in \Delta^{N - 1}$ over the policy population therefore defines a meta-game mixture strategy, or a mixture policy $\Pi^{\sigma}$ in the underlying game, with $\Delta^{|\Pi| - 1}$ representing the space of $|\Pi|$ -dimensional distributions, or the volume of a $(|\Pi| - 1)$ -simplex. When executing a meta-game mixture strategy, an action of the meta-game, or a policy in the underlying game, is sampled at the start of each episode, following $\sigma$ . The definition of (approximate) best-response readily extends to mixture policies, with $J(\pi, \Pi^{\sigma}) = \mathbb{E}_{i \sim \sigma}\left[\mathbb{E}_{\pi, \pi_i}[\sum_t r_t]\right]$ . We further define the empirical payoff matrix $\mathcal{U} \in \mathbb{R}^{|\Pi| \times |\Pi|} \gets \mathrm{Eval}(\Pi)$ with $\mathcal{U}_{ij} \coloneqq J(\pi_i, \pi_j)$ the payoff of the $i$ -th meta-game pure-strategy when playing against the $j$ -th. We further recall the definition of meta-strategy solver (MSS) $f: \mathbb{R}^{|\Pi| \times |\Pi|} \to \Delta^{|\Pi| - 1}$ which derives a meta-game mixture + +strategy $\Pi^{\sigma}$ from the empirical payoff matrix $\mathcal{U}$ . PSRO thus defines the following iterative procedure: at the $i$ -th iteration, $\pi_i \gets \mathrm{ABR}(\bar{\pi}, \Pi^{\sigma_{i-1}})$ is introduced to the policy population, with $\sigma_{i-1} \gets f(\mathcal{U})$ and $\bar{\pi}$ a randomly initialised policy. Starting from an arbitrary initial population $\Pi_0$ (typically a singleton $\{\pi_0\}$ ), PSRO proceeds iteratively, until the ABR operator fails to achieve a strictly positive payoff at that iteration. Finally, we note that while any MSS can be used, specific ones offer appealing properties. In particular, when NE is used as the meta-strategy solution, PSRO is known to converge to a NE of the full game. We refer to this implementation as PSRO-NASH for short. + +Neural Population Learning NeuPL (Liu et al., 2022) differs from the iterative population learning procedure described thus far in two ways. First, the population of policies $\Pi$ is represented using a shared conditional network $\Pi_{\theta,\Sigma} = \{\Pi_{\theta}(\cdot|o_{\leq t},\sigma_i); \sigma_i \in \Sigma\}$ , with $\Sigma = \{\sigma_i \in \Delta^{N-1}\}_{i=0}^{N-1}$ representing the adjacency matrix of an interaction graph (Garnelo et al., 2021) or equivalently, a set of meta-game mixture strategies. Second, the optimisation of the policy population proceeds concurrently, with policy $\Pi_{\theta}(\cdot|o_{\leq t},\sigma_i)$ maximising its expected returns against a mixture policy $\Pi_{\theta,\Sigma}^{\sigma_i}$ , defined over the neural population itself. We note that $\Pi_{\theta}$ corresponds to a single neural network which is shared across all policies within the neural population. Extending MSS from the iterative case, NeuPL updates the sequence of meta-strategies to best-respect to concurrently, using a meta-graph solver (MGS) $\mathcal{F}$ , with $\Sigma \gets \mathcal{F}(\mathcal{U})$ . Importantly, NeuPL is known to converge to a NE when a NE meta-strategy solver is applied iteratively, with $\sigma_i \gets \mathrm{SOLVE-NE}(\mathcal{U}_{ 0$ with $\sigma \leftarrow \operatorname {Eval}(\Pi)$ , if not, this iterative process terminates. This process is visualised in Figure 1, developing a sequence of policies iteratively starting from $\Pi = \{\pi_0\}$ , forming a population 3-simplex. + +This geometric interpretation of population clarifies the interplay between the MSS and the BR operator — for a given population simplex, one could in principle compute a best-response to each point within the simplex, developing infinitely many candidate policies that can be added to the population. Nevertheless, such procedure has been infeasible computationally, as best-response solving often comes at significant computational cost even for a single policy. A feasible solution is thus to rely on a meta-strategy solver. A MSS proposes a specific point within the simplex worth best-responding to, directing computational resources efficiently. This process forgoes optimal returns for all but a few select points for which the population offers best-responses, but yields population-level desiderata such as convergence to the NE (McMahan et al., 2003) or maximal exploration of the policy space (Balduzzi et al., 2019). + +Simplex Neural Population Learning Our proposal, is therefore to generalise NeuPL to additionally and concurrently optimise best-responses to all mixtures within the population simplex. Specifically, we utilize NeuPL to produce a set of basis policies and recognize that $\forall \sigma$ within the population simplex, we can optimise $\Pi_{\theta}(\cdot |o_{\leq t},\sigma)$ to maximise its expected returns against the mixture policy $\Pi_{\theta ,\Sigma}^{\sigma}$ . This leads to Algorithm 1 where in addition to optimising the discrete set of conditional policies $\Pi_{\theta ,\Sigma}\gets \{\Pi_{\theta}(\cdot |o_{\leq t},\sigma_i)\}_{i = 1}^{N}$ as in NeuPL, we also optimise best-responses to any mixture + +policies $\Pi^{\sigma}$ , with probability $\epsilon$ , where the opponent prior $\sigma$ is sampled according to a symmetric Dirichlet distribution with equal concentration $\alpha$ assigned to each unique policies (i.e. $\mathrm{UNIQUEROWS}(\Sigma)$ ) of the neural population. In other words, we sample mixture opponent policies uniformly over the population simplex, with support over the set of unique policies in the population simplex. We denote the concentration parameters as $\alpha \leq$ to indicate that $|\mathrm{UNIQUEROWS}(\Sigma)| \leq N$ and $\mathrm{UNIF}(\cdot)$ refers to sampling one distribution from a set of probability distributions uniformly at random. This procedure is illustrated in Algorithm 1. + +At convergence, simplex-NeuPL leads to a conditional policy from which one may construct not only all mixture policies within the population simplex $\Pi^{\sigma}$ , but also, their Bayes-optimal responses $\Pi_{\theta}(\cdot |o_{\leq t},\sigma)$ . In subsequent analyses, we refer to $\Pi_{\theta}(\cdot |o_{\leq t},\bar{\sigma})$ as the uninformed policy with $\bar{\sigma}$ the uniform distribution (i.e. uninformative opponent prior) and $\Pi_{\theta}(\cdot |o_{\leq t},\sigma)$ the informed policy as it is conditioned on the (often privileged) opponent sampling distribution. + +Algorithm 1 Simplex Neural Population Learning +1: $\Pi_{\theta}(\cdot |o_{\leq t},\sigma)$ $\triangleright$ Conditional neural population net. +2: $\Sigma \coloneqq \{\sigma_i\}_{i = 0}^{N - 1}$ $\triangleright$ Initial interaction graph. +3: $\mathcal{F}:\mathbb{R}^{N\times N}\to \mathbb{R}^{N\times N}$ $\triangleright$ Meta-graph solver. +4: while continuing do +5: $\Pi_{\theta ,\Sigma}\gets \{\Pi_{\theta}(\cdot |s,\sigma_i)\}_{i = 0}^{N - 1}$ $\triangleright$ Neural population. +6: simplex-sampling $\sim$ BERN(ε) $\triangleright$ With prob. $\epsilon$ +7: if simplex-sampling then +8: $\sigma \sim$ DIRICHLET(α≤) $\triangleright$ From simplex. +9: else +10: $\sigma \sim$ UNIF(UNIQUEROWS(Σ)) $\triangleright$ From MGS. +11: $\Pi_{\theta}(\cdot |o_{\leq t},\sigma)\gets$ ABR( $\Pi_{\theta}(\cdot |o_{\leq t},\sigma),\Pi_{\theta ,\Sigma}^{\sigma}$ ) +12: $\mathcal{U}\gets$ EVAL( $\Pi_{\theta ,\Sigma}$ ) $\triangleright$ (Optional) if $\mathcal{F}$ adaptive. +13: $\Sigma \gets \mathcal{F}(\mathcal{U})$ $\triangleright$ (Optional) if $\mathcal{F}$ adaptive. +14: return $\Pi_{\theta},\Sigma$ + +# 4. Results + +We experiment with simplex-NeuPL across two domains. First, we study the imperfect-information game of goof-spiel which remains amenable to analytical posterior inference and exact best-response solving (Section 4.1). Second, we explore the partially-observed, spatiotemporal strategy game of running-with-scissors, where information-seeking actions and observation history representation are critical in inferring opponent strategies and therefore, winning the game. The policy space of the latter is significantly larger and we seek to understand the trade-offs involved in the choice of policies at test time as well as the effect of unseen opponents on implicit posterior inference (Section 4.2). Throughout all experiments, we follow PSRO-NASH where + +an off-the-shelf Nash solver is used at each iteration of the meta-game solving, as in Liu et al. (2022). The specific implementation of $\mathcal{F}_{\mathrm{PSRO - N}}$ used as well as further details of our specific experimental setup are described in Appendix B. + +# 4.1. Goofspiel + +The game of *goofspiel* is a symmetric zero-sum bidding card game where players spend bid cards to collect points from a deck of point cards. In particular, we focus on the imperfect information variant of this game, with 5 point cards, revealed deterministically in descending order1. Players do not observe the bidding card played by its opponent, but only the win-loss history of each point card. This game has long been subject to game theoretic analyses with well-known strategic cycles (Ross, 1971; Rhoads & Bartholdi, 2012). An example game is shown in Figure 2 (Left) where player 2 wins the game by conceding the highest value point card but guarantees wins of all remaining point cards. + +In this section, we empirically investigate the effect of simplex-NeuPL in this domain. First, we show that simplex-NeuPL preserves game-theoretic strategic exploration as in Liu et al. (2022). This is expected, as any-mixture optimality implies that the resulting conditional policy $\Pi_{\theta}(\cdot |o_{\leq t},\sigma)$ can best-respect to the subset of mixture policies $\Sigma = \{\sigma_i\}_{i = 0}^{N - 1}$ recommended by the meta-graph solver. Second, we verify that more generally, the resulting informed policy approaches Bayes-optimality facing any mixture policies. This is a novel and important property for generalisation, as it allows for incorporating a wide range of prior beliefs at test time, as opposed to sampling from a small set of best-response policies enumerated during training. Lastly, we show that the resulting model exhibits implicit posterior inference over opponent identities through interaction. This echoes prior works showing that meta-learning over a range of tasks induces Bayes-optimal behaviours (Mikulik et al., 2020; Ortega et al., 2019). + +Game-Theoretic Strategic Exploration Strategic exploration in EGTA is typically expressed as iteratively solving for best-responses to mixture strategies of the induced empirical game, which are a subset of all mixture policies over the population of policies. Figure 2 (Middle) illustrates an example neural population learned by simplex-NeuPL, where each policy is optimised to best-respond to the NE over its predecessors as in PSRO-NASH. Specifically, the $i$ -th policy $\Pi_{\theta}(\cdot |o_{\leq t},\sigma_i)$ is optimised to best-respond to a mixture over $\Pi_{\theta}^{\Sigma < i} = \{\Pi_{\theta}(\cdot |o_{\leq t},\sigma_j)\}_{j = 1}^{i - 1}$ , following the meta-strategy NE solver given their pairwise payoff matrix $\mathcal{U}_{< i,< i}$ . The initial policy of this policy population is fixed to play bid cards in random order with a known best-response that plays bid cards in descending order, spending + +![](images/8c9a9b20bec295166a7ed636b3efbcf801bc80f7c604b7f2987b8304a8c56f47.jpg) +Figure 2. (Left) an example game of goofspiel showing 5 point cards revealed in descending order and the two players each playing their bidding cards in (hidden) order. In this game player 1 wins the first point card but loses all subsequent points and ends up losing the game; (Middle) a neural population of strategically diverse policies optimised by simplex-NeuPL, following PSRO-NASH; (Right) average return obtained by the exact best-response policy (blue), informed policy $\Pi_{\theta}(\cdot |o_{\leq t},\sigma)$ (red), uninformed policy $\Pi_{\theta}(\cdot |o_{\leq t},\bar{\sigma})$ (cyan) and the empirical NE mixture policy (orange) evaluated against 6 sets of opponent mixture policies $\{\{\Pi_{\theta ,\Sigma}^{\sigma_i,k};\sigma_{i,k}\sim \mathrm{DIR}(\alpha_k)\}_{i = 1}^{256};\alpha_k\}_{k = 1}^6.$ The $k$ -th opponent set features mixture policies whose mixture distributions are of a certain level of entropy (denoted $H(\sigma)$ ), sampled from a symmetric Dirichlet distribution of concentration $\alpha_{k}$ . Each point shows the average return against one of the opponent sets. + +bid cards matching the point card at each turn (Ross, 1971). Indeed, $\Pi_{\theta}(\cdot |o_{\leq t},\sigma_1)$ solely focuses on best-responding to the initial random policy and implements this deterministic point-matching policy. In turn, $\Pi_{\theta}(\cdot |o_{\leq t},\sigma_2)$ seeks to best-respond to $\Pi_{\theta}(\cdot |o_{\leq t},\sigma_1)$ , sacrificing the highest value point card in exchange for all remaining points. This recovers the known optimal policy against the point-matching. We further illustrate the set of policies implemented by the neural population in Appendix A.1.2. Extending NeuPL, we confirm that simplex-NeuPL similarly accommodates principled population learning algorithms such as PSRO-NASH, exploring the policy space of the game strategically. + +Any-Mixture Bayes-Optimality We now verify empirically that our proposed extension leads to a conditional policy that can best-respect to any mixture policies supported by the neural population, by simply conditioning on the prior distribution over opponent identities. To this end, we sample arbitrary prior distributions $\sigma$ over the simplex from symmetric Dirichlet distributions and evaluate the expected returns achieved by our method and several baselines against the same mixture policies $\Pi_{\theta,\Sigma}^{\sigma}$ . We compare i) the informed policy $\Pi_{\theta}(\cdot|o_{\leq t},\sigma)$ , conditioned on the true prior $\sigma$ ; ii) the uninformed policy $\Pi_{\theta}(\cdot|o_{\leq t},\bar{\sigma})$ , conditioned on an uninformative uniform prior $\bar{\sigma}$ ; iii) an exact best-response policy solved analytically as well as iv) the empirical NE mixture policy $\Pi_{\theta,\Sigma}^{\sigma_{\mathrm{NE}}}$ with $\sigma_{\mathrm{NE}} \gets \mathrm{SOLVE - NE}(\mathcal{U})$ . Figure 2 (Right) illustrates the result of this comparison, categorised by the levels of uncertainty present in the sampled priors. Notably, the conditional policy $\Pi_{\theta}(\cdot|o_{\leq t},\sigma)$ performs optimally against sampled mixture policies over the simplex, with its expected return approaching that of the exact best-response solution. Interestingly, we show that the uninformed policy performs markedly worse though the gap narrows as the true priors themselves become less informative with increased entropy. Last but not the least, + +we note that $\Pi_{\theta,\Sigma}^{\sigma_{\mathrm{NE}}}$ achieved similar returns as $\Pi_{\theta}(\cdot|o_{\leq t},\bar{\sigma})$ . This makes intuitive sense, as neither policy incorporates prior belief over the opponent distribution. Further details on the experimental setup, including the sampling of prior distributions and exact best-response solving are described in Appendix A.1.3. + +Implicit Bayesian Inference of Opponent Strategies For the instance of *goofspiel* that we are considering it is possible to compute the posterior distributions over opponent identities analytically, given a prior distribution, a set of policies and an observation history. Consider a policy population $\Pi = \{\pi_{\theta}(\cdot | o_{\leq t}, \sigma_i)\}_{i=0}^{N-1}$ with $o_t = (a_t, w_t)$ where $a_t$ denotes the private bid card played by the player at time $t$ , $w_t$ the publicly observed binary win-loss of the previous point card, $\sigma_i$ the identity of the player's policy, $\sigma_j$ the opponent identity at play, $\operatorname{Pr}(\sigma_j)$ the prior over the opponent identities, $a_t'$ the unobserved action taken by the opponent at time $t$ . The posterior distribution over the opponent policy $\sigma_j$ can be computed by + +$$ +\operatorname * {P r} (\sigma_ {j} | o _ {\leq t}) = \frac {\operatorname * {P r} (o _ {\leq t} | \sigma_ {j}) \operatorname * {P r} (\sigma_ {j})}{\sum_ {\hat {\sigma} _ {j}} \operatorname * {P r} (o _ {\leq t} | \hat {\sigma} _ {j}) \operatorname * {P r} (\hat {\sigma} _ {j})} +$$ + +with: + +$$ +\operatorname * {P r} (o _ {\le t} | \sigma_ {j}) = \sum_ {a _ {< t} ^ {\prime}} \left[ \prod_ {k = 0} ^ {t - 1} \pi_ {\theta} (a _ {k} ^ {\prime} | o _ {< k} ^ {\prime}, \sigma_ {j}) \operatorname * {P r} (w _ {k + 1} | a _ {k}, a _ {k} ^ {\prime}) \right] +$$ + +where the sum is over all legal unobserved opponent action sequences $a_{
Selin Aviyente1 + +# Abstract + +Graph learning (GL) aims to infer the topology of an unknown graph from a set of observations on its nodes, i.e., graph signals. While most of the existing GL approaches focus on homogeneous datasets, in many real world applications, data is heterogeneous, where graph signals are clustered and each cluster is associated with a different graph. In this paper, we address the problem of learning multiple graphs from heterogeneous data by formulating an optimization problem for joint graph signal clustering and graph topology inference. In particular, our approach extends spectral clustering by partitioning the graph signals not only based on their pairwise similarities but also their smoothness with respect to the graphs associated with the clusters. The proposed method also learns the representative graph for each cluster using the smoothness of the graph signals with respect to the graph topology. The resulting optimization problem is solved with an efficient block-coordinate descent algorithm and results on simulated and real data indicate the effectiveness of the proposed method. + +# 1. Introduction + +In many modern data science applications, relationships between entities, such as features or data samples, are well described with a graph structure. While many real-world data are intrinsically graph-structured, e.g. social and traffic networks, there is still a large number of applications, where the graph topology is not readily available. For instance, gene regulations in biological applications or neuronal connections in the brain are not known. In these applications, the graphs need to be learned since they reveal the relational structure and may assist in a variety of learning tasks. GL + +$^{1}$ Department of Electrical and Computer Engineering, Michigan State University, East Lansing, MI, US. Correspondence to: Abdullah Karaaslanli . + +Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s). + +deals with the inference of a topological structure among entities from a set of observations on these entities, i.e., graph signals. + +Methodologies to learn a graph from data include naive methods such as $k$ -nearest neighborhood ( $k$ -NN), probabilistic graphical models (Banerjee et al., 2008; d'Aspremont et al., 2008; Mazumder & Hastie, 2012; Hsieh et al., 2011) and more recently graph signal processing (GSP) (Mateos et al., 2019; Dong et al., 2019) and graph neural networks (GNNs) (Zhang et al., 2020; Wu et al., 2020; Bronstein et al., 2017). While the probabilistic graphical models assume the normality of the data, which is not true for most real-world data, GSP-based GL methods define observations on a collection of nodes as graph signals and fall into two categories. The first category assumes graph signals are outcomes of diffusion processes on graphs and reconstructs a graph from signals according to the diffusion model (Thanou et al., 2017; Pasdeloup et al., 2017; Shafipour et al., 2021; Segarra et al., 2017). The second category of methods promotes the smoothness of graph signals quantified by the Laplacian quadratic form or more generally via total variation (Dong et al., 2016; Kalofolias, 2016b; Berger et al., 2020). GNN-based methods, on the other hand, typically require a large volume of training data and the learned connectivity is often less explainable compared to probabilistic graph models and GSP methods. + +Most of the work on GSP-based GL has focused on the case where all data points follow the same relational model described by a single graph. However, in practice, the data may be coming from multiple graphs, i.e., multiview graphs. Examples of this setup include gene regulation networks where regulations vary across different cell types, and in social networks, where a set of users have varying interactions across different social media platforms. In this paper, we address the problem of multiple graph learning from a heterogeneous set of graph signals, where each cluster is associated with a different graph structure. To this end, we propose GRAScale algorithm for simultaneous GRAph Signal Clustering And graph LEarning. Previous works that perform the same task employ only relations of the graph signals to the graphs associated with the clusters for clustering assignment. However, clustering algorithm can also benefit from side information in the form of pairwise relations between graph signals. For instance, in a recommendation + +![](images/63355a2e7794431808cb22acb9bc3356433361025c7a013c527675e91e8f9879.jpg) +Figure 1. Overview of the proposed approach: Pairwise similarity between graph signals $(G^{c})$ and smoothness of the graph signals with respect to graphs associated with each cluster $(G^{s}$ 's) are used jointly in spectral clustering while simultaneously learning $G^{s}$ 's. + +system, when clustering graph signals, e.g. ratings for items, generated by a set of users, connections among the users can be used to inform the clustering algorithm. Therefore, we formulate GRAScale1 with the following key contributions: + +- We propose a new framework which is an extension of conventional spectral clustering where both the signals' pairwise similarity and smoothness with respect to the underlying graph structure are taken into account. +- The proposed methodology can learn the graph structures for mixed (heterogeneous) graph data. +- An efficient prox-linear block-coordinate descent (BCD) with improved consensus clustering based initialization is introduced for optimization. + +The overall framework is depicted in Figure 1. + +# 1.1. Related Work + +Most of the existing work on GL considers simple data, where all data points follow the same model defined with only one graph. In recent work, GSP community has addressed the problem of learning multiple graphs from heterogenous data in two different settings: i) multiple views of the same data and ii) heterogenous data with possibly unknown cluster information. + +The first class of methods, also known as joint inference of multiple graphs (Navarro et al., 2020), considers the setting where multiple related networks each with a subset of observations is available. In this setting, the membership of the signals to the graphs is known and the graphs are closely related to each other. This problem setting has been most widely studied for inferring the topology of time-varying networks (Kalofolias et al., 2017; Yamada et al., 2019; Bain-gana & Giannakis, 2016; Sardellitti et al., 2019). Assuming that the variation is smooth across time, the problem is reduced to learning multiple closely related graphs regular-ized with a term that promotes changes between consecutive + +graphs to be small in some pre-specified norm. More recently, the problem of joint inference of multiple graphs from the observed graph signals has been formulated with the assumption of graph stationarity (Navarro et al., 2020). In this formulation, the signals are assumed to be stationary, and pairwise similarity between all graphs is used to regularize the optimization. + +The second class of methods focuses on the case where the data is heterogeneous and each subgroup has its own graph structure. This problem has been addressed for both the supervised and unsupervised settings. The supervised setting, also known as multi-category GL problem, assumes that the number of classes and the signals that belong to each class are known a priori (Saboksayr et al., 2021; Kao et al., 2017). In this case, the goal is to learn multiple graphs each associated to a class of signals such that the representation of signals within a class and discrimination of signals in different classes are both taken into consideration. In the unsupervised setting, the number of clusters is known but the membership of the different graph signals is not known. In this case, the goal is to simultaneously cluster the data and learn the representative graph for each cluster (Araghi et al., 2019; Maretic & Frossard, 2020). In (Maretic & Frossard, 2020), graph signals are modelled by a graph Laplacian mixture model (GLMM), which extends the factor analysis model of (Dong et al., 2016) to jointly model the smooth graph signals and identify the clusters through Gaussian mixture model (GMM). This model assumes that the number of clusters is known a priori and the distribution of the data is Gaussian. The model is fitted to data through the expectation-maximization algorithm for simultaneous graph inference and clustering. On the other hand, (Araghi et al., 2019) proposes K-graphs, which is an extension of k-means clustering where the graph signals are assigned to the clusters based on their smoothness over each cluster's representative graph. Once the signals are clustered, the representative graphs are updated with graph learning algorithms. Both of GLMM and K-Graphs algorithms assign a graph signal to a cluster based on only the smoothness of the signal with respect to the graph associated with that cluster and do not explicitly take the pairwise relationships + +between the graph signals into account. + +# 2. Background + +# 2.1. Notations + +Scalers, vectors and matrices are denoted by lowercase $(x)$ , bold lowercase $(\mathbf{x})$ and bold uppercase $(\mathbf{X})$ letters, respectively. Entries of vectors and matrices are denoted as $x_{i}$ and $X_{ij}$ , respectively. $i$ th row and column of $\mathbf{X}$ are indicated as $\mathbf{X}_{i}$ and $\mathbf{X}_{\cdot i}$ , respectively. Superscript $\top$ indicates transpose of vectors and matrices. Identity matrix is shown by $\mathbf{I}$ . All ones and zeroes vectors and matrices are shown as $\mathbf{1}$ and $\mathbf{0}$ , respectively. The operator $\mathrm{dg}()$ takes a matrix $\mathbf{X}$ and returns a vector $\mathbf{x}$ with $x_{i} = X_{ii}$ or takes a vector $\mathbf{x}$ and returns a diagonal matrix $\mathbf{X}$ with $X_{ii} = x_{i}$ . Finally, $\delta_{ij}$ is Kronecker delta, which is equal to 1 if $i = j$ and 0, otherwise. + +# 2.2. Graphs and Graph Signals + +An undirected graph is denoted by $G = (V, E, \mathbf{W})$ where $V$ is the node set with $|V| = n$ , $E \subseteq V \times V$ is the edge set and $\mathbf{W} \in \mathbb{R}^{n \times n}$ is its adjacency matrix. An edge between node $v_i$ and $v_j$ is represented by $e_{ij}$ and is associated with a weight $w_{ij}$ . $\mathbf{W}$ is a symmetric matrix with $W_{ij} = w_{ij}$ if $e_{ij} \in E$ and 0, otherwise. Degree of $v_i$ is the sum of the weights of the edges connected to it, i.e., $d_i = \mathbf{W}_i^\top \mathbf{1}$ . Degree vector of $G$ is $\mathbf{d} = \mathbf{W1}$ and $\mathbf{D} = \mathrm{dg}(\mathbf{d})$ is the corresponding degree matrix. The Laplacian matrix of $G$ is defined as $\mathbf{L} = \mathbf{D} - \mathbf{W}$ . $\mathbf{L}$ is a positive semi-definite matrix and has eigendecomposition $\mathbf{L} = \mathbf{V}\boldsymbol{\Lambda}\mathbf{V}^\top$ where $\boldsymbol{\Lambda}$ is the diagonal matrix of eigenvalues and columns of $\mathbf{V}$ are the eigenvectors. Eigenvalues of $\mathbf{L}$ are assumed to be sorted in an ascending order, i.e., $0 = \Lambda_{11} \leq \Lambda_{22} \leq \dots \leq \Lambda_{nn}$ . + +A graph signal $\mathbf{x} \in \mathbb{R}^n$ is a vector whose entries reside on the nodes of a graph $G$ . Graph Fourier transform (GFT) of $\mathbf{x}$ is defined as the expansion of $\mathbf{x}$ in terms of the eigenbasis of the graph Laplacian (Shuman et al., 2013). This representation allows us to characterize $\mathbf{x}$ in terms of its graph spectral content. GFT of $\mathbf{x}$ is given by $\widehat{\mathbf{x}} = \mathbf{V}^\top \mathbf{x}$ . Inverse GFT is defined as (Shuman et al., 2013): + +$$ +\mathbf {x} = \mathbf {V} \widehat {\mathbf {x}} = \sum_ {i = 1} ^ {n} \widehat {x} _ {i} \mathbf {V}. +$$ + +Thus, $\mathbf{x}$ is the linear combination of eigenvectors of $\mathbf{L}$ with the coefficients equal to the entries of $\widehat{\mathbf{x}}$ . Eigenvectors of $\mathbf{L}$ corresponding to the small eigenvalues have small variation over the graph. Thus, if most of the energy of $\widehat{\mathbf{x}}$ lies in $\widehat{x}_i$ is corresponding to the small eigenvalues, then $\mathbf{x}$ is smooth with respect to the graph (Sandryhaila & Moura, 2014). The smoothness of $\mathbf{x}$ over $G$ is then quantified as (Shuman et al., 2013): + +$$ +\operatorname {t r} \left(\widehat {\mathbf {x}} ^ {\top} \boldsymbol {\Lambda} \widehat {\mathbf {x}}\right) = \operatorname {t r} \left(\mathbf {x} ^ {\top} \mathbf {V} \mathbf {L} \mathbf {V} ^ {\top} \mathbf {x}\right) = \operatorname {t r} \left(\mathbf {x} ^ {\top} \mathbf {L} \mathbf {x}\right), \tag {2} +$$ + +which is small if $\mathbf{x}$ is smooth over $G$ . + +# 2.3. Spectral Clustering + +Data clustering can be formulated as community detection on graphs, where the nodes correspond to data points and the edge weights indicate the pairwise similarity between data points. The problem of data clustering is then transformed to partitioning the nodes into groups with strong intra- and weak inter-group connectivity. Given a dataset $\mathcal{X} = \{\mathbf{x}_i\}_{i=1}^p$ with an associated graph $G = (V, E, \mathbf{W})$ , where $|V| = p$ and $v_i$ corresponds to $\mathbf{x}_i$ and $w_{ij}$ indicates the similarity between $\mathbf{x}_i$ and $\mathbf{x}_j$ , clustering is then formulated as the partitioning of $V$ into $k$ communities, i.e., $\mathcal{C} = \{C_1, \ldots, C_k\}$ . Given the cluster assignment vector $\mathbf{g} \in \mathbb{R}^p$ with $g_i = s$ if $v_i \in C_s$ , the graph cut is then defined as (von Luxburg, 2007): + +$$ +\operatorname {c u t} (\mathcal {C}) = \sum_ {i, j = 1} ^ {p} W _ {i j} \left(1 - \delta_ {g _ {i} g _ {j}}\right) = \operatorname {t r} \left(\mathbf {Z} ^ {\top} \mathbf {L} \mathbf {Z}\right), \tag {3} +$$ + +where $\mathbf{Z} \in \mathbb{R}^{p \times k}$ is the cluster assignment matrix with $Z_{is} = 1$ if $v_{i} \in C_{s}$ and 0, otherwise. The graph cut is the sum of the inter-community edge weights and $\mathcal{C}$ can be found by minimizing the graph cut. This minimization is NP-hard (von Luxburg, 2007). Thus, $\mathbf{Z}$ is relaxed to take on real values, which leads to the following optimization problem: + +$$ +\underset {\mathbf {Z}} {\operatorname {m i n i m i z e}} \operatorname {t r} (\mathbf {Z} ^ {\top} \mathbf {L} \mathbf {Z}) \mathrm {s . t .} \mathbf {Z} \in \mathbb {D}, \tag {4} +$$ + +where $\mathbf{Z}$ is constrained to be in a set $\mathbb{D}$ to ensure that $\mathbf{Z}$ preserves some properties of binary cluster membership matrix. These properties can include positivity ( $\mathbf{Z} \geq 0$ ), row-sum constraint ( $\mathbf{Z1} = \mathbf{1}$ ) or orthogonality ( $\mathbf{Z}^{\top} \mathbf{Z} = \mathbf{I}$ ) (von Luxburg, 2007; Shewchuk, 2016; Zass & Shashua, 2005). Once a real valued $\mathbf{Z}$ is learned, clustering algorithms such as $k$ -means can be employed to identify the clusters. + +# 2.4. Graph Learning + +An unknown graph $G$ can be learned from a set of observed graph signals defined over it with the assumption that graph signals are smooth over $G$ . Using this assumption, (Dong et al., 2016) proposed to learn $G$ by minimizing (2) with respect to $\mathbf{L}$ given a set of graph signals $\{\mathbf{x}_i\}_{i=1}^p$ as follows: + +$$ +\underset {\mathbf {L} \in \mathbb {L}} {\mathrm {m i n i m i z e}} \operatorname {t r} (\mathbf {X} ^ {\top} \mathbf {L} \mathbf {X}) + \alpha \| \mathbf {L} \| _ {F} ^ {2} \mathrm {s . t .} \operatorname {t r} (\mathbf {L}) = 2 n, (5) +$$ + +where $\mathbf{X} \in \mathbb{R}^{n \times p}$ is the data matrix whose columns are $\mathbf{x}_i$ 's and $\mathbb{L} = \{\mathbf{L}: L_{ij} = L_{ji} \leq 0 \forall i \neq j, \mathbf{L1} = \mathbf{0}\}$ is the set of valid Laplacian matrices. The first term in (5) measures the smoothness of the graph signals while the second term is the Frobenius norm of $\mathbf{L}$ and controls the density of the learned graph. Finally, the problem is constrained to prevent the trivial solution $\mathbf{L} = \mathbf{0}$ . + +# 3. Method + +# 3.1. Graph Signal Clustering with Regularized Graph Cut + +Assume we are given a dataset $\mathcal{X} = \{\mathbf{x}_i\}_{i=1}^p$ where $\mathbf{x}_i \in \mathbb{R}^n$ is a graph signal over a graph $G^s \in \mathcal{G} = \{G^1, \dots, G^k\}$ . All graphs in $\mathcal{G}$ are defined over the same vertex set $V$ with $|V| = n$ and have their own edge set $E^s$ , i.e., $G^s = (V, E^s, \mathbf{W}^s)$ , $\forall G^s \in \mathcal{G}$ . Let the partitioning of graph signals in $\mathcal{X}$ be defined as $\mathcal{C} = \{C_1, \dots, C_k\}$ where $C_s$ includes all of the graph signals defined over $G^s$ . In this paper, it is assumed that the partitioning of the graph signals, $\mathcal{C}$ , is not known a priori. The problem of learning $\mathcal{C}$ can be considered as a clustering problem. Let $G^c = (V^c, E^c, \mathbf{W}^c)$ be the graph that represents the similarity between the elements of $\mathcal{X}$ where $V^c$ is the node set with $|V^c| = p$ . Node $v_i^c \in V^c$ corresponds to $\mathbf{x}_i$ and $w_{ij}^c$ is the similarity between $\mathbf{x}_i$ and $\mathbf{x}_j$ . $\mathcal{C}$ can then be learned by applying spectral clustering to $G^c$ . However, spectral clustering as formulated in (4) does not use the fact that $\mathbf{x}_i$ 's are graph signals. One can improve the clustering by incorporating information from the graphs in $\mathcal{G}$ . Therefore, we propose a regularized graph cut (regcut) by assuming that the graph signals are smooth over the graphs they are defined on: + +$$ +\operatorname {r e g c u t} (\mathcal {C}) = \sum_ {i, j = 1} ^ {p} W _ {i j} ^ {c} \left(1 - \delta_ {g _ {i} g _ {j}}\right) + \alpha \sum_ {s = 1} ^ {K} \sum_ {i = 1} ^ {p} \delta_ {g _ {i} s} \mathbf {x} _ {i} ^ {\top} \mathbf {L} ^ {s} \mathbf {x} _ {i}, \tag {6} +$$ + +where $\mathbf{x}_i^\top \mathbf{L}^s\mathbf{x}_i$ is the smoothness of $\mathbf{x}_i$ over $G^{s}$ as defined in Section 2.2. By regularizing the graph cut with smoothness, we ensure that if $\mathbf{x}_i$ is assigned to the sth cluster it is smooth with respect to $G^{s}$ . As in Section 2.3, this problem is NP-hard. Therefore, we relax $\mathbf{Z}$ to take on real values and obtain the following optimization problem: + +$$ +\underset {\mathbf {Z} \in \mathbb {D}} {\operatorname {m i n i m i z e}} \operatorname {t r} \left(\mathbf {Z} ^ {\top} \mathbf {L} ^ {c} \mathbf {Z}\right) + \alpha \sum_ {s = 1} ^ {k} \operatorname {t r} \left(\mathrm {d g} \left(\mathbf {Z} _ {. s}\right) \mathbf {X} ^ {\top} \mathbf {L} ^ {s} \mathbf {X}\right), \tag {7} +$$ + +where $\mathbf{X}$ is the data matrix with $\mathbf{X}_{i} = \mathbf{x}_i$ and $\mathbf{Z}$ is constrained as in (4). + +# 3.2. Joint Graph Signal Clustering and Graph Learning + +For the optimization problem in (7), one needs to know $G^c$ and the graphs in $\mathcal{G}$ . Since these graphs are generally not available, they need to be learned. $G^c$ can be learned from $\mathbf{X}$ using the aforementioned GL methods or more classical approaches such as $k$ -nearest neighbor graphs. However, for graphs in $\mathcal{G}$ , we cannot use these approaches as we do not know the partitioning of the graph signals. Thus, the graphs in $\mathcal{G}$ must be learned simultaneously with clustering. Therefore, we extend (7) with GL: + +$$ +\begin{array}{l} \underset {\mathbf {Z}, \mathbf {L} ^ {1}, \dots , \mathbf {L} ^ {k}} {\operatorname {m i n i m i z e}} \operatorname {t r} (\mathbf {Z} ^ {\top} \mathbf {L} ^ {c} \mathbf {Z}) + \alpha_ {1} \sum_ {s = 1} ^ {k} \left[ \operatorname {t r} \left(\operatorname {d g} (\mathbf {Z} _ {\cdot s}) \mathbf {X} ^ {\top} \mathbf {L} ^ {s} \mathbf {X}\right) \right. \\ \left. + \left(\mathbf {Z} _ {. s} ^ {\top} \mathbf {1}\right) \alpha_ {2} \| \mathbf {L} ^ {s} \| _ {F} ^ {2} \right] \tag {8} \\ \in \mathbb {D}, \mathbf {L} ^ {s} \in \mathbb {L}, \operatorname {t r} (\mathbf {L} ^ {s}) = 2 n \forall s \in \{1, \dots , k \}, \\ \end{array} +$$ + +where each $\mathbf{L}^s$ is learned by assuming that graph signals in the $s$ th cluster are smooth over $G^s$ . As in (5), the Frobenius norm controls the sparsity of the learned graphs such that large values of $\alpha_2$ result in denser graphs. However, in this setting we weigh this sparsity term with $\mathbf{Z}_{s}^{\top}\mathbf{1}$ which corresponds to the number of signals in cluster $s$ to ensure that the sparsity levels of the learned graphs are similar for a given $\alpha_2$ . As the value of the smoothness term increases with the number of signals in the cluster, multiplying the sparsity term with $\mathbf{Z}_{s}^{\top}\mathbf{1}$ ensures that the relative importance of the sparsity term with respect to smoothness term remains similar across $s$ . Finally, we set $\mathbb{D} = \{\mathbf{Z}\in \mathbb{R}^{p\times k}\mid \mathbf{Z}\geq 0,\mathbf{Z1} = \mathbf{1}\}$ . + +# 3.3. Optimization + +The problem in (8) is a multi-convex problem, i.e., it is convex in each variable separately but non-convex when all variables are considered together. Therefore, we employ block coordinate descent (BCD) to solve (8) (Shi et al., 2017). At each iteration of BCD, the problem is solved cyclically over each variable while fixing the remaining variables. When solving with respect to a variable, we perform inexact minimization with prox-linear update as it results in easy-to-solve problems with fast convergence when extrapolation is used (Xu & Yin, 2013). Before applying BCD, we first vectorize (8) where we learn the upper triangular part of $\mathbf{L}^s$ . Let $\ell^s \in \mathbb{R}^m$ be the upper triangular part of $\mathbf{L}^s$ where $m = n(n - 1)/2$ . Define the operator $\mathrm{mt}$ with $\mathrm{mt}(\ell^s) = \mathbf{L}^s$ and define the matrix $\mathbf{P} \in \mathbb{R}^{m \times n}$ with $\mathbf{P}\ell^s = -\mathrm{dg}(\mathbf{L}^s)$ . Then, (8) can be rewritten as: + +$$ +\begin{array}{l} \underset {\mathbf {Z}, \mathbf {L} ^ {1}, \dots , \mathbf {L} ^ {k}} {\operatorname {m i n i m i z e}} \operatorname {t r} (\mathbf {Z} ^ {\top} \mathbf {L} ^ {c} \mathbf {Z}) + \alpha_ {1} \sum_ {s = 1} ^ {k} \left[ \operatorname {t r} (\mathrm {d g} (\mathbf {Z} _ {\cdot s}) \mathbf {X} ^ {\top} \operatorname {m t} (\ell^ {s}) \mathbf {X}) \right. \\ \left. + \left(\mathbf {Z} _ {\cdot s} ^ {\top} \mathbf {1}\right) \alpha_ {2} \left(2 \left\langle \ell^ {s}, \ell^ {s} \right\rangle + \left\langle \mathbf {P} \ell^ {s}, \mathbf {P} \ell^ {s} \right\rangle\right) \right] \tag {9} \\ \end{array} +$$ + +$$ +\mathrm {s . t .} \quad \mathbf {Z} \geq 0, \mathbf {Z} \mathbf {1} = \mathbf {1}, \ell^ {s} \leq 0, \mathbf {1} ^ {\top} \ell^ {s} = - n \forall s, +$$ + +where $\langle \cdot ,\cdot \rangle$ is the inner product. Prox-linear updates at the $t$ th iteration of BCD can then be found as follows: + +$$ +\mathbf {Z} ^ {(t + 1)} = \underset { \begin{array}{c} \mathbf {Z} > 0, \\ \mathbf {Z} \mathbf {1} = \mathbf {1} \end{array} } {\operatorname {a r g m i n}} \left\langle \widehat {\mathbf {G}} _ {Z} ^ {(t)}, \mathbf {Z} - \widehat {\mathbf {Z}} ^ {(t)} \right\rangle + \frac {\lambda_ {Z}}{2} \| \mathbf {Z} - \widehat {\mathbf {Z}} ^ {(t)} \| _ {F} ^ {2}, \tag {10} +$$ + +$$ +\boldsymbol {\ell} ^ {s (t + 1)} = \underset { \begin{array}{c} \boldsymbol {\ell} ^ {s} \leq 0, \\ \mathbf {1} ^ {\top} \boldsymbol {\ell} ^ {s} = - n \end{array} } {\operatorname {a r g m i n}} \langle \widehat {\mathbf {g}} _ {s} ^ {(t)}, \boldsymbol {\ell} ^ {s} - \widehat {\boldsymbol {\ell}} ^ {s} ^ {(t)} \rangle + \frac {\lambda_ {s}}{2} \| \boldsymbol {\ell} ^ {s} - \widehat {\boldsymbol {\ell}} ^ {s} ^ {(t)} \| _ {F} ^ {2}, \tag {11} +$$ + +Algorithm 1 GS Clustering with Simultaneous GL +Input: $\mathbf{X},\mathbf{L}^s,\alpha_1,\alpha_2,k$ and max_iter Set $t\gets 1$ Initialize $\mathbf{Z}^{(t)},\mathbf{Z}^{(t - 1)},\ell^{s(t)}$ and $\ell^{s(t - 1)}$ repeat Update $\mathbf{L}^{s(t + 1)}$ with (11) for $s\in \{1,\dots ,k\}$ Update $\mathbf{Z}^{(t + 1)}$ with (10) Set $t\gets t + 1$ until convergence or $t\geq$ max_iter Output: $\mathbf{Z}^{(t)},\mathbf{L}^{1(t)},\ldots ,\mathbf{L}^{k(t)}$ + +where $\widehat{\mathbf{G}}_Z^{(t)}$ is the gradient of the objective function in (9) with respect to $\mathbf{Z}$ evaluated at $\widehat{\mathbf{Z}}^{(t)},\widehat{\mathbf{g}}_s^{(t)}$ is the gradient with respect to $\ell^s$ evaluated at $\widehat{\ell}^{s(t)}$ , and: + +$$ +\widehat {\mathbf {Z}} ^ {(t)} = \mathbf {Z} ^ {(t - 1)} + w \left(\mathbf {Z} ^ {(t - 1)} - \mathbf {Z} ^ {(t - 2)}\right), \tag {12} +$$ + +$$ +\widehat {\boldsymbol {\ell}} ^ {s} ^ {(t)} = \boldsymbol {\ell} ^ {s (t - 1)} + w \left(\boldsymbol {\ell} ^ {s (t - 1)} - \boldsymbol {\ell} ^ {s (t - 2)}\right), \tag {13} +$$ + +where $0 \leq w \leq 1$ is the extrapolation parameter. Finally, $\lambda_Z$ and $\lambda_s$ are step sizes and can be set to the Lipschitz constants of the gradient of the objective function in (9) with respect to $\mathbf{Z}$ and $\ell^s$ . Solutions of both (10) and (11) are projections onto simplex, as shown in the Appendix. Overall optimization procedure is given in Algorithm 1. + +(Xu & Yin, 2013) show that BCD with prox-linear update converges for multi-convex problems, when the objective function consists of smooth and separable non-smooth terms. The problem in (9) satisfies these assumptions; thus, Algorithm 1 is guaranteed to converge. + +# 3.4. Initialization + +BCD type algorithms may converge to poor local minima (Shi et al., 2017). To overcome this problem, one can run the algorithm multiple times and consider the solution with the smallest objective value. One can also initiate the algorithm at a better point such that it converges to a solution with lower objective value. In this section, we describe a procedure to select better initializations for the proposed BCD algorithm. + +Consider the set $\mathcal{Z} = \{\mathbf{Z}^1, \ldots, \mathbf{Z}^b\}$ which is obtained by running Algorithm 1 $b$ times. Each $\mathbf{Z}^i$ indicates a possible partitioning of the graph signals. One can obtain a better clustering by combining information from all $Z^i$ 's using consensus clustering (Strehl & Ghosh, 2002), an ensemble learning method to combine multiple clusterings. We follow the consensus clustering procedure described in (Lancichinetti & Fortunato, 2012), where the consensus clustering $\mathbf{Z}^0$ is found from an association matrix $\mathbf{A}$ whose entries $A_{ij}$ are equal to the number of times graph signals $\mathbf{x}_i$ and $\mathbf{x}_j$ are assigned to the same cluster in $\mathcal{Z}$ . This association matrix can be used as the input to spectral clustering to find + +Algorithm 2 Initialization Procedure +Input: $b$ +Initialize $\mathcal{Z}$ as an empty set +for $i\leq b$ do Run Algorithm 1 and add learned $\mathbf{Z}$ to $\mathcal{Z}$ +end for +Find $\mathbf{Z}^0$ by applying consensus clustering to $\mathcal{Z}$ +Run Algorithm 1 with initial point set to $\mathbf{Z}^0$ +Output: Solutions of the last run + +$\mathbf{Z}^0$ . Once $\mathbf{Z}^0$ is found, we rerun the Algorithm 1 one more time, where $\mathbf{Z}$ is initialized at $\mathbf{Z}^0$ (the rest of the variables are initialized randomly). The clustering and learned graphs obtained from this run are used as the final result. This initialization procedure is given in Algorithm 2. + +In our experiments, we set $b = 9$ and we set the maximum number of iterations for each run to a small number, e.g., 100, since even sub-optimal solutions can result in a good consensus clustering. + +# 3.5. Hyperparameter Selection + +The proposed method requires the selection of three hyperparameters: number of clusters $k$ , $\alpha_{1}$ and $\alpha_{2}$ . In literature, various methods have been proposed to determine the number of clusters in spectral clustering. These methods generally define a quality function $Q$ and find the number of clusters as the value that optimizes $Q$ . Possible choices of $Q$ are eigengap (Von Luxburg, 2007), modularity (Newman, 2006), Bayesian information criterion (BIC) (Saldana et al., 2017), integrated completed likelihood (ICL) (Daudin et al., 2008). $\alpha_{2}$ controls the sparsity level of the learned graphs such that larger values of $\alpha_{2}$ result in denser graphs. We set it to a value that results in graphs with a pre-determined sparsity level. This approach is similar to previous graph construction schemes, such as in $k$ -NN graphs, where one wants to construct a graph with each node having at least $k$ neighbors. The selection of $\alpha_{1}$ is explained in detail through parameter sensitivity analysis in Section 4.1 + +# 4. Results + +In this section, the performance of GRAScale is evaluated on synthetic and real datasets and is compared to various state-of-the-art clustering and graph learning algorithms. We compare methods based on the quality of the resulting clustering as well as the accuracy of the learned graphs associated with each cluster. For the first comparison, we consider normalized spectral clustering (SC), GLMM and K-Graphs. For the latter comparison, GL (see Section 2.4), GLMM and K-Graphs are considered. As mentioned in Section 2.3, SC clusters signals only based on their pairwise similarities. Thus, by comparing GRAScale to SC, we can + +illustrate the benefits of considering graph signal smoothness. GLMM and K-Graphs perform simultaneous graph signal clustering and graph learning similar to the proposed method. However, they only rely on the smoothness of the signals with respect to graphs associated with each cluster. By comparing GRAScale against them, we can illustrate the benefits of incorporating pairwise similarities. Finally, when applying GL, we assume the partitioning of the signals is known; thus the performance of GL provides an upper bound for the performance of GRAScale in the graph learning task. We used the formulation of (Kalofolias, 2016a) for implementing GL. + +Parameter Selection: SC, GLMM, K-Graphs and GRAScale require the number of clusters $k$ as an input. We provided the ground truth $k$ as an input to all methods. GL, GLMM and K-graphs require a hyperparameter that controls the sparsity of the learned graphs similar to $\alpha_{2}$ in (8). For all methods, we set this hyperparameter to a value that results in graphs with sparsity levels between 0.1 and $0.15^{2}$ . GLMM and K-Graphs algorithms are based on alternating minimization, which causes their results to vary across runs. Therefore, we run each algorithm 10 times and report the average performance. For GRAScale, we set $b = 9$ as mentioned in Section 3.5. Thus, each algorithm is run 10 times. Finally, SC is applied to a binary $k$ -nearest neighbor graph with the number of neighbors set to 5. The same graph is used as $\mathbf{L}^c$ for the proposed method. + +Performance Metrics: Normalized mutual information (NMI) (Danon et al., 2005) is used to quantify the performance of clustering. For the graph learning task, F1-score is used to quantify how close the learned graphs are to the ground truth graphs. We measure F1-score for all $s$ and report the average. + +# 4.1. Synthetic Data + +Data Generation: Given a graph $G$ with Laplacian $\mathbf{L} = \mathbf{V}\Lambda \mathbf{V}^{\top}$ , we can generate a graph signal $\mathbf{x}$ that is smooth with respect to $G$ by filtering a given signal $\mathbf{x}_0$ with a low-pass graph filter (Dong et al., 2016; Kalofolias, 2016a). Mathematically, this is equivalent to $\mathbf{x} = h(\mathbf{L})\mathbf{x}_0$ where $h(\mathbf{L}) = \mathbf{V}h(\boldsymbol{\Lambda})\mathbf{V}^{\top}$ is a low-pass graph filter. Based on this, we generate the synthetic data as follows. We first generate $k$ graphs $\mathcal{G} = \{G^{1},\dots ,G^{k}\}$ based on a random graph model, such as Erdős–Rényi (ER) (Gilbert, 1959) or Barabási–Albert (BA) models (Albert & Barabási, 2002), where each $G^{s}$ has $n$ nodes. For each $G^{s}$ , we generate $p_{s}$ smooth graph signals as described above with $h(\boldsymbol{\Lambda}) =$ + +![](images/9c3989ac85421428180c35adc451a68d9b14aac5d8a4080232c05425dd51df17.jpg) +Figure 2. Results for Experiment 1 when cluster sizes are equal. Upper row illustrates the graph learning performance and the bottom row shows the clustering performance. Left and right columns are performances for ER and BA graph models, respectively. + +$\sqrt{\Lambda}^{\dagger}$ and $\mathbf{x}_0\sim \mathcal{P}$ , where $\dagger$ is the pseudo-inverse operator and $\mathcal{P}$ is a probability distribution to be determined. The graph signals are then used to construct data matrices $\mathbf{X}^{s}\in \mathbf{R}^{n\times p_{s}}$ , from which we build $\mathbf{X} = [\mathbf{X}^{1},\dots ,\mathbf{X}^{s}]\in \mathbb{R}^{n\times p}$ where $p = p_1 + \dots +p_s$ . White Gaussian noise with variance equal to $10\%$ of the signal power is added to the data matrix. Finally, we generate 20 different realizations of each dataset in all experiments and report the average performance across realizations. + +Experiment 1: In this experiment, we generate signals from $\mathcal{G} = \{G^1,G^2,G^3\}$ where each $G^{s}$ is generated by swapping the edges of a given graph $G\lceil m_G\times pert\rceil$ times. $m_{G}$ is the number of edges in $G$ and $pert > 0$ refers to the amount of perturbation. Smaller values of $pert$ causes graphs in $\mathcal{G}$ to be highly correlated; thus, clustering the graph signals generated from these graphs becomes a harder task. We generated $G$ with 50 nodes from two random graph models: ER with edge probability $p_{ER} = 0.1$ and BA model with $m_{BA} = 3$ . We generated $\mathbf{X}$ as described above with $\mathcal{P} = \mathcal{N}(0,\mathbf{I})$ . + +In Figure 2, we report the results when the cluster sizes are equal, i.e., $p_s = 200$ for all $s$ . It can be observed that the clustering performance for all methods increases with the amount of perturbation. This is due to the fact that as the perturbation level increases, the different clusters become more distinct. GRAScale performs better than GLMM and K-Graphs for both ER and BA models. SC is observed to perform very poorly as the signals are generated independently from each other. Thus, pairwise similarities between signals that are in the same cluster are not strong, resulting in low NMI values for SC. In terms of graph learning, GL + +![](images/e427a2d50fe3923bbae5db72441c0717eae3a5bb406fde3cd58ff8130bcf210e.jpg) +Figure 3. Results for Experiment 1 when cluster sizes are different. Upper row shows graph learning performance and bottom row shows clustering performance. Left and right columns are performances for ER and BA graph models, respectively. + +performs the best as expected since it assumes that the cluster membership of the signals is known a priori. There is a slight improvement in the graph learning performances of GLMM, K-Graphs and GRAScale as perturbation level increases and their performances converge to that of GL. Graph learning performances of GLMM, K-Graphs and the proposed method for small perturbation levels may seem counter-intuitive considering their low NMI values. However, graphs in $\mathcal{G}$ are very correlated for small values of perturbation, thus graph signals in a given cluster carry information about other graphs too. Therefore, methods can still perform well for graph inference even though the graph clusters may not be accurately identified. + +Figure 3 illustrates the results for the same simulation setting when there is heterogeneity in cluster sizes, i.e., $p_1 = 300$ , $p_2 = 200$ , and $p_3 = 100$ . Results are very similar to that of Figure 2. There is a slight drop in the performance of all algorithms compared to Figure 2 across all perturbation levels and graph models. + +Experiment 2: In the previous experiment, signals were generated independently; thus they do not have any explicitly imposed pairwise relations. In this experiment, we generate graph signals that have pairwise relations and are also smooth with respect to graphs associated with clusters. In order to achieve this goal, we first generate a data matrix $\mathbf{Y} \in \mathbb{R}^{n \times p}$ with $n = 50$ and $p = 600$ . Rows of $\mathbf{Y}$ are generated by filtering a signal $\mathbf{y} \in \mathbb{R}^p$ through a low-pass graph filter defined on $G^c$ . The signal similarity graph $G^c$ has $p$ nodes and $\mathbf{y} \sim \mathcal{N}(0, \mathbf{I})$ . If there is an edge between nodes $v_i$ and $v_j$ in $G^c$ , columns $\mathbf{Y}_{i}$ and $\mathbf{Y}_{j}$ will be similar to each other. We construct $G^c$ + +![](images/bd7e2056bc9e292533bb0633757a5967d8e8b46ea5574baed42374c2f7a20614.jpg) +Figure 4. Results for Experiment 2. Upper row shows graph learning performance and bottom row shows clustering performance. Left and right columns are performances for ER and BA graph models, respectively. + +from a planted partition model (Condon & Karp, 2001) whose nodes are partitioned into three equal sized clusters: $C_1 = \{v_1, \ldots, v_{200}\}$ , $C_2 = \{v_{201}, \ldots, v_{400}\}$ , and $C_3 = \{v_{401}, \ldots, v_{600}\}$ . Planted partition model has two parameters $p_{in}$ and $p_{out}$ , which determine the intra- and intercluster connectivity, respectively. We set $p_{in} = 0.05(1 - \mu)$ and $p_{out} = 0.05\mu$ , where $\mu > 0$ is the mixing coefficient. Larger values of $\mu$ causes the clusters to be less distinguishable. For the low-pass filter, we used a heat kernel $h(\Lambda^c) = \exp(-5\Lambda^c)$ where $\Lambda^c$ is the eigenvalue matrix corresponding to the Laplacian matrix of $G^c$ (Kalofolias, 2016a). We generated graphs in $\mathcal{G}$ as in the first experiment with pert set to 2. Once $\mathbf{Y}$ and $\mathcal{G}$ are generated, columns of $\mathbf{Y}$ in $C_s$ are filtered by the graph filter corresponding to $G^s \in \mathcal{G}$ for all $s$ to construct $\mathbf{X}$ . + +Figure 4 shows the performance of the different algorithms. With the introduction of pairwise similarity within clusters, the performance of SC is observed to improve significantly. However, its NMI value is still lower than GRAScale since the latter benefits from both pairwise relations and smoothness of the graph signals. GLMM and KGraphs have lower performance than the proposed method, as these methods employ only smoothness of the graph signals. Increasing the mixing coefficient causes a decrease in the performance of all methods, as larger values of $\mu$ result in less distinguishable clusters. The decrease in NMI values for SC and GRAScale with increasing $\mu$ values follows a similar trend. This indicates that the proposed method indeed uses the pairwise relations between signals. For the graph learning task, F1 score of the proposed method is higher than those of GLMM and K-Graphs and is very close to that of GL due to its high clustering performance. + +![](images/b47d81e8ac1fc93a954d1d1ef18c08348458e93856f53bd7ff1b32122491800b.jpg) +Figure 5. Sensitivity of F1 and NMI values to varying values of $\alpha_{1}$ and density of learned graphs. Left panel shows the graph learning performance and the right panel shows the clustering performance. + +Parameter Sensitivity: We study the sensitivity of the performance of GRAScale to the selection of $\alpha_{1}$ and $\alpha_{2}$ on a dataset from Experiment 2. We consider a dataset generated from the BA graph model with $\mu$ set to 0.25. The ground truth graph has a density around 0.12 in this dataset. We apply our algorithm to this dataset with varying $\alpha_{1}$ and $\alpha_{2}$ values and the performances are reported in Figure 5. For the $x$ -axis, densities of the learned graph are used rather than the values of $\alpha_{2}$ . Figure 5 shows that the density of learned graphs is important for the performance. In particular, low density graphs have poor performance in terms of F1 and NMI, as these graphs are very sparse and do not contain enough information. Similarly, high density values also result in low performance, since learned graphs include many false positive edges. Finally, this figure also shows that the proposed method is not sensitive to the value of $\alpha_{1}$ as long as the learned graphs have a reasonable density. In particular, there is a large range of $\alpha_{1}$ values, where F1-score and NMI are stable. Based on this observation, we set $\alpha_{1} = 10$ in all of our data analysis without any fine-tuning. + +# 4.2. Real Data + +In this section, the proposed method is applied to a real world data clustering problem, where the aim is to cluster the digits of MNIST dataset while learning a graph for each digit. More specifically, we selected 400 images corresponding to digits 0, 1, 2 and 3. After vectorizing each image, we obtain a data matrix of size $400 \times 1600$ , where + +![](images/9303a7fac7db5bc62bd9c98cb47f84edf9fcbca4654189c3896bdf4764e93c73.jpg) +Figure 6. Clustering performance for MNIST dataset. + +![](images/5833e2dc3c3a46357014070777cdbf4e55f4d7d80856ab8c59fe05e77cbdbfb8.jpg) +Figure 7. Graph structures learned for each digit by the proposed method. Points correspond to pixels, while lines indicate the inferred edges between pixels. Only top 300 edges are shown. + +the rows and columns correspond to pixels and images, respectively. SC, GLMM, K-Graphs and GRAScale are applied to the constructed data matrix and the clustering performance is reported in Figure 6. The best performing method is GRAScale, and it is followed by SC; while GLMM and K-Graphs have significantly lower performance. These results indicate that using pairwise similarities of the signals and their smoothness together improve the clustering performance. + +As mentioned in (Maretic & Frossard, 2020), learning a graph for each cluster can be helpful for the interpretability of clustering. By analyzing the graph structure learned for each cluster, one can deduce why a set of graph signals are assigned to the same cluster; which leads to explainable data science (Roscher et al., 2020). In Figure 7, we plot the graphs learned for each digit by GRAScale. It can be seen that the method learns very interpretable graph structures. The learned graphs for digits 0, 2, 3 have high resemblance to the digits themselves. Although the graph found for digit 1 has a meaningful structure, it is noisier than the other graphs. This is due to the fact that there is a lot of variation across samples for writing digit 1. This means that while we tend to cluster digits based on their numerical values, it might be the case that there is also a clustering within each digit based on the writing style. + +# 5. Conclusions + +In this paper, we presented GRAScale for simultaneous graph signal clustering and graph learning. Compared to previous methods developed for the same task, GRAScale uses two types of information: pairwise relations between graph signals and their smoothness with respect to graphs associated with clusters. Our results on synthetic and real datasets indicate that incorporating these complementary + +pieces of information within the same framework improves clustering and graph learning performance significantly. + +In the presented formulation of GRAScale, we assumed $\mathbf{L}^c$ is constructed a priori; however, this graph can also be learned along with clusters and graphs associated with clusters. In future work, we will consider this extension of jointly learning $\mathbf{L}^c$ along with the individual graphs, $\mathbf{L}^s$ . + +# Acknowledgements + +This work was supported by the National Science Foundation grant: CCF 2006800. + +# References + +Albert, R. and Barabási, A.-L. Statistical mechanics of complex networks. Reviews of modern physics, 74(1):47, January 2002. doi: 10.1103/RevModPhys.74.47. +Araghi, H., Sabbaqi, M., and Babaie-Zadeh, M. $k$ -graphs: An algorithm for graph signal clustering and multiple graph learning. IEEE Signal Processing Letters, 26(10): 1486-1490, 2019. +Baingana, B. and Giannakis, G. B. Tracking switched dynamic network topologies from information cascades. IEEE Transactions on Signal Processing, 65(4):985-997, 2016. +Banerjee, O., El Ghaoui, L., and d'Aspremont, A. Model selection through sparse maximum likelihood estimation for multivariate gaussian or binary data. The Journal of Machine Learning Research, 9:485-516, 2008. +Berger, P., Hannak, G., and Matz, G. Efficient graph learning from noisy and incomplete data. IEEE Transactions on Signal and Information Processing over Networks, 6: 105-119, 2020. +Bronstein, M. M., Bruna, J., LeCun, Y., Szlam, A., and Vandergheynst, P. Geometric deep learning: going beyond euclidean data. IEEE Signal Processing Magazine, 34(4): 18-42, 2017. +Condon, A. and Karp, R. M. Algorithms for graph partitioning on the planted partition model. *Random Structures & Algorithms*, 18(2):116-140, 2001. +Danon, L., Diaz-Guilera, A., Duch, J., and Arenas, A. Comparing community structure identification. Journal of statistical mechanics: Theory and experiment, 2005(09): P09008, 2005. +d'Aspremont, A., Banerjee, O., and El Ghaoui, L. First-order methods for sparse covariance selection. SIAM Journal on Matrix Analysis and Applications, 30(1):56-66, 2008. + +Daudin, J.-J., Picard, F., and Robin, S. A mixture model for random graphs. Statistics and computing, 18(2):173-183, 2008. +Dong, X., Thanou, D., Frossard, P., and Vandergheynst, P. Learning Laplacian Matrix in Smooth Graph Signal Representations. IEEE Transactions on Signal Processing, 64(23):6160-6173, October 2016. ISSN 1053-587X, 1941-0476. doi: 10.1109/TSP.2016.2602809. +Dong, X., Thanou, D., Rabbat, M., and Frossard, P. Learning graphs from data: A signal representation perspective. IEEE Signal Processing Magazine, 36(3):44-63, 2019. +Duchi, J., Shalev-Shwartz, S., Singer, Y., and Chandra, T. Efficient projections onto the 11-ball for learning in high dimensions. In Proceedings of the 25th international conference on Machine learning, pp. 272-279, 2008. +Gilbert, E. N. Random graphs. The Annals of Mathematical Statistics, 30(4):1141-1144, 1959. +Hsieh, C.-J., Dhillon, I., Ravikumar, P., and Sustik, M. Sparse inverse covariance matrix estimation using quadratic approximation. Advances in neural information processing systems, 24, 2011. +Kalofolias, V. How to learn a graph from smooth signals. In Artificial Intelligence and Statistics, pp. 920-929. PMLR, May 2016a. +Kalofolias, V. How to learn a graph from smooth signals. In Artificial Intelligence and Statistics, pp. 920-929, 2016b. +Kalofolias, V., Loukas, A., Thanou, D., and Frossard, P. Learning time varying graphs. In 2017 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 2826-2830. IEEE, 2017. +Kao, J.-Y., Tian, D., Mansour, H., Ortega, A., and Vetro, A. Disc-glasso: Discriminative graph learning with sparsity regularization. In 2017 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 2956-2960. IEEE, 2017. +Lancichinetti, A. and Fortunato, S. Consensus clustering in complex networks. Scientific Reports, 2(1):336, March 2012. ISSN 2045-2322. doi: 10.1038/srep00336. +Maretic, H. P. and Frossard, P. Graph Laplacian Mixture Model. IEEE Transactions on Signal and Information Processing over Networks, 6:261-270, April 2020. ISSN 2373-776X, 2373-7778. doi: 10.1109/TSIPN.2020.2983139. +Mateos, G., Segarra, S., Marques, A. G., and Ribeiro, A. Connecting the dots: Identifying network structure via graph signal processing. IEEE Signal Processing Magazine, 36(3):16-43, 2019. + +Mazumder, R. and Hastie, T. The graphical lasso: New insights and alternatives. Electronic journal of statistics, 6:2125, 2012. +Navarro, M., Wang, Y., Marques, A. G., Uhler, C., and Segarra, S. Joint inference of multiple graphs from matrix polynomials. arXiv preprint arXiv:2010.08120, 2020. +Newman, M. E. Modularity and community structure in networks. Proceedings of the national academy of sciences, 103(23):8577-8582, 2006. +Pasdeloup, B., Gripon, V., Mercier, G., Pastor, D., and Rabbat, M. G. Characterization and inference of graph diffusion processes from observations of stationary signals. IEEE transactions on Signal and Information Processing over Networks, 4(3):481-496, 2017. +Roscher, R., Bohn, B., Duarte, M. F., and Garcke, J. Explainable machine learning for scientific insights and discoveries. *IEEE Access*, 8:42200–42216, 2020. +Saboksayr, S. S., Mateos, G., and Cetin, M. Online discriminative graph learning from multi-class smooth signals. Signal Processing, 186:108101, 2021. +Saldana, D. F., Yu, Y., and Feng, Y. How many communities are there? Journal of Computational and Graphical Statistics, 26(1):171-181, 2017. +Sandryhaila, A. and Moura, J. M. F. Discrete Signal Processing on Graphs: Frequency Analysis. IEEE Transactions on Signal Processing, 62(12):3042-3054, May 2014. ISSN 1053-587X, 1941-0476. doi: 10.1109/TSP.2014.2321121. +Sardellitti, S., Barbarossa, S., and Di Lorenzo, P. Enabling prediction via multi-layer graph inference and sampling. In 2019 13th International conference on Sampling Theory and Applications (SampTA), pp. 1-4. IEEE, 2019. +Segarra, S., Marques, A. G., Mateos, G., and Ribeiro, A. Network topology inference from spectral templates. IEEE Transactions on Signal and Information Processing over Networks, 3(3):467-483, 2017. +Shafipour, R., Segarra, S., Marques, A. G., and Mateos, G. Identifying the topology of undirected networks from diffused non-stationary graph signals. IEEE Open Journal of Signal Processing, 2:171-189, 2021. +Shewchuk, J. R. Allow Me to Introduce Spectral and Isoperimetric Graph Partitioning. pp. 69, April 2016. +Shi, H.-J. M., Tu, S., Xu, Y., and Yin, W. A Primer on Coordinate Descent Algorithms. arXiv:1610.00040 [math, stat], January 2017. + +Shuman, D. I., Narang, S. K., Frossard, P., Ortega, A., and Vandergheynst, P. The emerging field of signal processing on graphs: Extending high-dimensional data analysis to networks and other irregular domains. IEEE Signal Processing Magazine, 30(3):83-98, April 2013. ISSN 1053-5888. doi: 10.1109/MSP.2012.2235192. +Strehl, A. and Ghosh, J. Cluster ensembles—a knowledge reuse framework for combining multiple partitions. Journal of machine learning research, 3(Dec):583-617, 2002. +Thanou, D., Dong, X., Kressner, D., and Frossard, P. Learning heat diffusion graphs. IEEE Transactions on Signal and Information Processing over Networks, 3(3):484-499, 2017. +Von Luxburg, U. A tutorial on spectral clustering. Statistics and computing, 17(4):395-416, 2007. +von Luxburg, U. A tutorial on spectral clustering. Statistics and Computing, 17(4):395-416, December 2007. ISSN 0960-3174, 1573-1375. doi: 10.1007/s11222-007-9033-z. +Wu, Z., Pan, S., Chen, F., Long, G., Zhang, C., and Philip, S. Y. A comprehensive survey on graph neural networks. IEEE transactions on neural networks and learning systems, 32(1):4-24, 2020. +Xu, Y. and Yin, W. A Block Coordinate Descent Method for Regularized Multiconvex Optimization with Applications to Nonnegative Tensor Factorization and Completion. SIAM Journal on Imaging Sciences, 6(3): 1758-1789, September 2013. ISSN 1936-4954. doi: 10.1137/120887795. +Yamada, K., Tanaka, Y., and Ortega, A. Time-varying graph learning based on sparseness of temporal variation. In ICASSP 2019-2019 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 5411-5415. IEEE, 2019. +Zass, R. and Shashua, A. A unifying approach to hard and probabilistic clustering. In Tenth IEEE International Conference on Computer Vision (ICCV'05) Volume 1, pp. 294-301 Vol. 1, Beijing, China, October 2005. IEEE. ISBN 978-0-7695-2334-7. doi: 10.1109/ICCV.2005.27. +Zhang, Z., Cui, P., and Zhu, W. Deep learning on graphs: A survey. IEEE Transactions on Knowledge and Data Engineering, 2020. + +# A. Solutions of BCD Steps + +In this section, the solutions of BCD steps are provided. We start with (11), which can be rewritten as follows: + +$$ +\begin{array}{l} \boldsymbol {\ell} ^ {s (t + 1)} = \operatorname * {a r g m i n} _ {\boldsymbol {\ell} ^ {s}} \| \boldsymbol {\ell} ^ {s} - \widehat {\boldsymbol {\ell}} ^ {s} ^ {(t)} + \frac {1}{\lambda_ {s}} \widehat {\mathbf {g}} _ {s} ^ {(t)} \| _ {F} ^ {2} \text {s . t .} \boldsymbol {\ell} ^ {s} \leq 0, \mathbf {1} ^ {\top} \boldsymbol {\ell} ^ {s} = - n, \\ = \underset {\boldsymbol {\ell} ^ {s}} {\operatorname {a r g m i n}} \| \boldsymbol {\ell} ^ {s} - \widehat {\boldsymbol {\ell}} ^ {s} ^ {(t)} + \frac {2 \mathbf {k} - \mathbf {P} ^ {\top} \mathbf {d} + (\mathbf {Z} _ {s} ^ {(t)}) ^ {\top} \mathbf {1}) \alpha_ {2} (4 \widehat {\boldsymbol {\ell}} ^ {s} ^ {(t)} + 2 \mathbf {P} ^ {\top} \mathbf {P} \widehat {\boldsymbol {\ell}} ^ {s} ^ {(t)})}{\lambda_ {s}} \| _ {F} ^ {2} \text {s . t .} \boldsymbol {\ell} ^ {s} \leq 0, \mathbf {1} ^ {\top} \boldsymbol {\ell} ^ {s} = - n, \tag {14} \\ \end{array} +$$ + +where, in the second line we substitute $\widehat{\mathbf{g}}_s^{(t)} = 2\mathbf{k} - \mathbf{P}^\top \mathbf{d} + (\mathbf{Z}_{.s}^{(t)})^\top \mathbf{1})\alpha_2(4\widehat{\ell}^{\mathrm{s}}^{(t)} + 2\mathbf{P}^\top \mathbf{P}\widehat{\ell}^{\mathrm{s}}^{(t)})$ $\mathbf{k}\in \mathbb{R}^m$ is the upper triangular part of $\mathbf{X}\mathrm{dg}(\mathbf{Z}_{.s}^{(t)})\mathbf{X}^{\top}$ , and $\mathbf{d}\in \mathbb{R}^n$ is the diagonal of $\mathbf{X}\mathrm{dg}(\mathbf{Z}_{.s}^{(t)})\mathbf{X}^{\top}$ . The solution of (14) is the projection of $\widehat{\ell^{\mathrm{s}}}^{(t)} - \frac{2\mathbf{k} - \mathbf{P}^\top\mathbf{d} + (\mathbf{Z}_{.s}^{(t)})^\top\mathbf{1})\alpha_2(4\widehat{\ell^{\mathrm{s}}}^{(t)} + 2\mathbf{P}^\top\mathbf{P}\widehat{\ell^{\mathrm{s}}}^{(t)})}{\lambda_s}$ onto the negative simplex, which can be performed efficiently using the algorithm described in (Duchi et al., 2008). To solve (10), we rewrite it as follows: + +$$ +\begin{array}{l} \mathbf {Z} ^ {(t + 1)} = \underset {\mathbf {Z}} {\operatorname {a r g m i n}} \| \mathbf {Z} - \widehat {\mathbf {Z}} ^ {(t)} + \frac {1}{\lambda_ {Z}} \widehat {\mathbf {G}} _ {Z} ^ {(t)} \| _ {F} ^ {2} \mathrm {s . t .} \mathbf {Z} \geq 0, \mathbf {Z} \mathbf {1} = \mathbf {1}, \\ = \underset {\mathbf {Z}} {\operatorname {a r g m i n}} \| \mathbf {Z} - \widehat {\mathbf {Z}} ^ {(t)} + \frac {2}{\lambda_ {Z}} \mathbf {L} ^ {c} \widehat {\mathbf {Z}} ^ {(t)} + \frac {\alpha_ {1}}{\lambda_ {Z}} \mathbf {Q} _ {1} + \frac {\alpha_ {1} \alpha_ {2}}{\lambda_ {Z}} \mathbf {Q} _ {2} \| _ {F} ^ {2} \text {s . t .} \mathbf {Z} \geq 0, \mathbf {Z} \mathbf {1} = \mathbf {1}, \tag {15} \\ \end{array} +$$ + +where, in the second line we substitute $\widehat{\mathbf{G}}_Z^{(t)} = 2\mathbf{L}^c\widehat{\mathbf{Z}}^{(t)} + \alpha_1\mathbf{Q}_1 + \alpha_1\alpha_2\mathbf{Q}_2,\mathbf{Q}_1\in \mathbb{R}^{p\times k}$ whose sth column is $\mathbf{Q}_{1,s.} = \mathrm{dg}(\mathbf{X}^\top \mathrm{mt}(\ell^{s(t + 1)})\mathbf{X})$ , and $\mathbf{Q}_2\in \mathbb{R}^{p\times k}$ whose sth column is $(2\langle \ell^{s(t + 1)},\ell^{s(t + 1)}\rangle +\langle \mathbf{P}\ell^{s(t + 1)},\mathbf{P}\ell^{s(t + 1)}\rangle)\mathbf{1}$ . The problem in (15) can be solved separately with respect to rows of $\mathbf{Z}$ . Let $\mathbf{A} = \widehat{\mathbf{Z}}^{(t)} + \frac{2}{\lambda_z}\mathbf{L}^c\widehat{\mathbf{Z}}^{(t)} + \frac{\alpha_1}{\lambda_z}\mathbf{Q}_1 + \frac{\alpha_1\alpha_2}{\lambda_z}\mathbf{Q}_2$ , then the subproblem of (15) with respect to ith row of $\mathbf{Z}$ is: + +$$ +\mathbf {Z} _ {i}. ^ {(t + 1)} = \underset {\mathbf {Z} _ {i}} {\operatorname {a r g m i n}} \| \mathbf {Z} _ {i}. - \mathbf {A} _ {i}. \| _ {2} ^ {2} \text {s . t .} \mathbf {Z} _ {i}. \geq 0, \mathbf {Z} _ {i}. ^ {\top} \mathbf {1} = 1, \tag {16} +$$ + +whose solution is the projection of $\mathbf{A}_i$ . onto the positive simplex, which can be performed efficiently using the algorithm described in (Duchi et al., 2008). \ No newline at end of file diff --git a/simultaneousgraphsignalclusteringandgraphlearning/images.zip b/simultaneousgraphsignalclusteringandgraphlearning/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..bfa7bd3daa2b6135f10205785246f65379721fde --- /dev/null +++ b/simultaneousgraphsignalclusteringandgraphlearning/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b5558355b8f098d629367c7246067b4a48ac3c8a960b2791b2eded7b047400b9 +size 433073 diff --git a/simultaneousgraphsignalclusteringandgraphlearning/layout.json b/simultaneousgraphsignalclusteringandgraphlearning/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..c878717565a029555211b81431be9aa76232cacc --- /dev/null +++ b/simultaneousgraphsignalclusteringandgraphlearning/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:741e534a651ab089e10078032274361a19a0c7993ff672da67949b594e349e74 +size 591833 diff --git a/simultaneouslylearningstochasticandadversarialbanditswithgeneralgraphfeedback/15184db1-6e25-447a-8280-903a317083ba_content_list.json b/simultaneouslylearningstochasticandadversarialbanditswithgeneralgraphfeedback/15184db1-6e25-447a-8280-903a317083ba_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..a5af1d8c580950c1fb12a97af02b2ab678178a75 --- /dev/null +++ b/simultaneouslylearningstochasticandadversarialbanditswithgeneralgraphfeedback/15184db1-6e25-447a-8280-903a317083ba_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7018cf8f6e28ca434122ef300abf41b9fcf3507875f1c7db3646dfcea1a3b016 +size 87412 diff --git a/simultaneouslylearningstochasticandadversarialbanditswithgeneralgraphfeedback/15184db1-6e25-447a-8280-903a317083ba_model.json b/simultaneouslylearningstochasticandadversarialbanditswithgeneralgraphfeedback/15184db1-6e25-447a-8280-903a317083ba_model.json new file mode 100644 index 0000000000000000000000000000000000000000..aa61112c5210185334f5efbc580c81818040f1e9 --- /dev/null +++ b/simultaneouslylearningstochasticandadversarialbanditswithgeneralgraphfeedback/15184db1-6e25-447a-8280-903a317083ba_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e3e39e7d979daeb549dd60b0e3c8ca0c8b65d3cde9c7854272d8bbc098fb6178 +size 101659 diff --git a/simultaneouslylearningstochasticandadversarialbanditswithgeneralgraphfeedback/15184db1-6e25-447a-8280-903a317083ba_origin.pdf b/simultaneouslylearningstochasticandadversarialbanditswithgeneralgraphfeedback/15184db1-6e25-447a-8280-903a317083ba_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..904708cf80a92b3373977b5a9fda767b09fd4354 --- /dev/null +++ b/simultaneouslylearningstochasticandadversarialbanditswithgeneralgraphfeedback/15184db1-6e25-447a-8280-903a317083ba_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0246cf9c164212f8499e9dded24b3f50d4d4578f4d47c99f3c841481d9e363ae +size 371106 diff --git a/simultaneouslylearningstochasticandadversarialbanditswithgeneralgraphfeedback/full.md b/simultaneouslylearningstochasticandadversarialbanditswithgeneralgraphfeedback/full.md new file mode 100644 index 0000000000000000000000000000000000000000..5a0e1d49f6c332b17ce6c3d1e01e3c2fa90aad64 --- /dev/null +++ b/simultaneouslylearningstochasticandadversarialbanditswithgeneralgraphfeedback/full.md @@ -0,0 +1,446 @@ +# Simultaneously Learning Stochastic and Adversarial Bandits with General Graph Feedback + +Fang Kong Yichi Zhou Shuai Li + +# Abstract + +The problem of online learning with graph feedback has been extensively studied in the literature due to its generality and potential to model various learning tasks. Existing works mainly study the adversarial and stochastic feedback separately. If the prior knowledge of the feedback mechanism is unavailable or wrong, such specially designed algorithms could suffer great loss. To avoid this problem, Erez & Koren (2021) try to optimize for both environments. However, they assume the feedback graphs are undirected and each vertex has a self-loop, which compromises the generality of the framework and may not be satisfied in applications. With a general feedback graph, the observation of an arm may not be available when this arm is pulled, which makes the exploration more expensive and the algorithms more challenging to perform optimally in both environments. In this work, we overcome this difficulty by a new trade-off mechanism with a carefully-designed proportion for exploration and exploitation. We prove the proposed algorithm simultaneously achieves poly log $T$ regret in the stochastic setting and minimax-optimal regret of $\tilde{O}(T^{2/3})$ in the adversarial setting where $T$ is the horizon and $\tilde{O}$ hides parameters independent of $T$ as well as logarithmic terms. To our knowledge, this is the first best-of-both-worlds result for general feedback graphs. + +# 1. Introduction + +The online learning problem can be formulated by a repeated game between the learner and an unknown environment + +$^{1}$ John Hopcroft Center for Computer Science, Shanghai Jiao Tong University, Shanghai, China $^{2}$ Microsoft Research Asia, Beijing, China. Correspondence to: Shuai Li . + +Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s). + +(Cesa-Bianchi & Lugosi, 2006; Lattimore & Szepesvári, 2020). The environment contains $K$ arms. In each round, the learner selects one among these arms and observes some feedback. At the end of the round, it obtains the reward of the selected arm. The objective of the learner is to minimize the cumulative regret over a specified horizon, defined as the difference between the cumulative reward of the optimal arm and that of the arms selected. + +To achieve this goal, the learner should adjust its strategy according to the feedback it observes. One of the most widely-studied feedback models is bandit feedback, where the learner only observes the reward of the selected arm in each round (Auer et al., 2002a; Lattimore & Szepesvári, 2020). The other extreme is called full feedback, where the learner is able to observe the reward of all arms no matter which arm it selects (Cesa-Bianchi & Lugosi, 2006; Eban et al., 2012). Both these two extremes are special cases of a general feedback model, where the feedback is characterized by a directed graph $G = ([K], E)$ (Mannor & Shamir, 2011). An edge $(i, j) \in E$ implies that the learner can observe arm $j$ when selecting arm $i$ . Under this framework, the graph of bandit feedback is composed of $K$ disjoint self-loops and that of full feedback is a clique with self-loops. Benefiting from its generality and potential to model various learning tasks, graph feedback has been widely studied in the literature (Wu et al., 2015; Alon et al., 2015; Li et al., 2020; Chen et al., 2021). + +Previous works on graph feedback mainly study two standard environments: stochastic (Buccapatnam et al., 2014; Wu et al., 2015; Tossou et al., 2017; Li et al., 2020) and adversarial (Mannor & Shamir, 2011; Alon et al., 2015; Chen et al., 2021). In the stochastic setting, the rewards of an arm are drawn independently from a fixed distribution. While in the adversarial setting, the rewards can be chosen arbitrarily. All of these works consider observable feedback graphs, i.e., each arm can be observed by selecting some arms. It is not hard to see that observability is necessary to guarantee sublinear regret (Alon et al., 2015). With a general observable graph, the optimal regret in both settings has been well understood. In the stochastic setting, Wu et al. (2015) develop the instance-optimal regret of order $\Theta (\log T)$ . And in the adversarial setting, Alon et al. (2015); Chen et al. (2021) + +
Regret bound (stochastic)Regret bound (adversarial)
Wu et al. (2015)O(|D| log T/Δ2), Ω(|D| log T/Δ2)-
Alon et al. (2015)-O((|D| log K)1/3T2/3), Ω((|D|/log2K)1/3T2/3)
Chen et al. (2021)-O((δ* log K)1/3T2/3), Ω((δ*/α)1/3T2/3)
OursO(|D|2(log T/Δ2)3/2)O(|D|1/3K2/3T2/3√logT)
+ +Table 1. Comparisons of regret bounds with most related works in different environments for online learning with general graph feedback. $T$ is the horizon, $K$ is the number of arms, $\Delta$ is the minimum reward gap between the optimal and sub-optimal arms, $D$ is the dominating set of the feedback graph, $\delta^{*}$ is the fractional weak domination number with $\delta^{*} \leq |D|$ and $\alpha = O(K / \delta^{*})$ is the integrality gap of the linear program for vertex packing. The regret bounds in Wu et al. (2015) do not show explicit dependence on $D$ and $\Delta$ . We compute the order of them in the bar graph which consists of $K / 2$ disjoint undirected edges which connect $K$ arms. + +show the minimax-optimal regret is $\Theta (T^{2 / 3})$ + +However, all these works treat different environment types separately. Once the prior knowledge of the reward type is unknown or wrong, the algorithms can suffer great loss. So a natural question is whether there is an algorithm that can simultaneously achieve poly log $T$ regret in the stochastic setting and $\tilde{O}(T^{2/3})$ regret in the adversarial setting. + +Similar best-of-both-worlds (BoBW) questions have been extensively studied under the bandit feedback (Bubeck & Slivkins, 2012; Seldin & Slivkins, 2014; Auer & Chiang, 2016; Seldin & Lugosi, 2017; Zimmert & Seldin, 2019) and a more general undirected feedback graph with self-loops (Erez & Koren, 2021). But as shown in the literature (Wu et al., 2015; Alon et al., 2015), even in a known single-type environment, learning with general feedback graphs (possibly without self-loops) is much harder. It is because the observations on an arm may not be available by simply selecting it, which makes the exploration of arms more expensive and the exploration-exploitation trade-off more challenging. This problem becomes especially difficult when trying to optimize for two different environments. Specifically, to achieve instance-optimality, the algorithm tends to first select arms with more observations to identify the optimal one. But these arms may have low rewards, which destroys the minimax-optimality over a specified horizon. So despite the importance of the above BoBW results under special feedback graphs, it is still open whether such type of results can be obtained with general graph feedback. + +In this paper, we make progress on this problem. We develop a new mechanism to trade off exploration and exploitation with carefully-designed proportions for these two parts. Equipped with this mechanism and the carefully-designed testing for the environment type, the algorithm is proved to achieve poly log $T$ regret in the stochastic setting and $\tilde{O}(T^{2/3})$ regret in the adversarial setting. Table 1 compares the regret bounds with most related works. It is shown that, compared with the state-of-the-art algorithms in both + +settings, our algorithm only suffers from additional logarithmic and constant factors in the regret while without prior knowledge of the environment type. + +# 2. Related Work + +The study of online learning with bandit feedback has a long history (Thompson, 1933; Lai & Robbins, 1985). This problem has been well studied in both stochastic (Auer et al., 2002a) and adversarial setting (Auer et al., 2002b). To generalize the feedback type, Mannor & Shamir (2011) first introduce the framework of graph feedback with self-loops in the adversarial setting, which problem has been extensively studied by the following works (Kocák et al., 2014; Cohen et al., 2016). Alon et al. (2015) successfully remove the assumption of self-loops. They develop the Exp3.G algorithm and establish theoretical guarantees for graphs with different observables. To be specific, the optimal regret is $\Theta(T)$ for non-observable graphs, $\tilde{\Theta}(\sqrt{T})$ for strongly-observable graphs, and $\tilde{\Theta}(T^{2/3})$ for general observable graphs, where a strongly-observable graph requires each arm to have a self-loop or have in-edges from all of the other arms. The $\tilde{\Theta}(T^{2/3})$ regret also indicates the hardness to learn with a general feedback graph, which has been recently improved by Chen et al. (2021) in terms of the dependence on graph structure. In the stochastic setting, Wu et al. (2015) first consider general observable graphs and show the optimal regret is of order poly log $T$ . Li et al. (2020) later generalize this result by considering probabilistic graph feedback. + +All of the above works separately study different environment types. A natural question is whether an algorithm can be derived to achieve the BoBW results. The BoBW problem was first studied by Bubeck & Slivkins (2012) in the bandit setting. They propose an algorithm and show it achieves not only poly log $T$ regret in the stochastic environment but also $\tilde{O}(\sqrt{T})$ regret in the adversarial environment. Their algorithm is based on several consistency conditions to detect the optimality of the arms and the type of the envi + +ronment, which is later refined by Auer & Chiang (2016). A similar mechanism has also been adopted to obtain the BoBW result for linear bandit (Lee et al., 2021). The other line of BoBW works are variants of online mirror descent (OMD) (Zimmert & Seldin, 2019), which achieves better results than Bubeck & Slivkins (2012); Auer & Chiang (2016) in terms of logarithmic factors. Apart from bandit feedback, the BoBW problem has been recently studied with more general feedback graphs, though the graphs are assumed to be undirected and contain a self-loop on each arm (Erez & Koren, 2021). The algorithm in this work is a variant of OMD, which achieves poly log $T$ regret in the stochastic setting and $O(\sqrt{T})$ regret in the adversarial setting. Recently, Lu et al. (2021) study a model between stochastic and adversarial, where the rewards are generated stochastically with a small fraction being corrupted adversially. Their work is also only applicable to undirected feedback graphs with self-loops. To the best of our knowledge, we are the first to give the BoBW results for online learning with general graph feedback. + +# 3. Setting + +The problem can be characterized by a graph $G = (V, E)$ , where $V = \{1, 2, \ldots, K\}$ is the set of $K$ arms and $E = \{(i, j)\}$ is the set of directed edges between arms. For each arm $i$ , denote $N^{\mathrm{in}}(i) = \{j \in V : (j, i) \in E\}$ as the set of in-neighbors and $N^{\mathrm{out}}(i) = \{j \in V : (i, j) \in E\}$ as the set of out-neighbors of $i$ . In each round $t = 1, 2, \ldots$ , the learner selects an arm $I_t \in V$ and the environment provides a reward vector $r_t := (r_t(1), r_t(2), \ldots, r_t(K)) \in [0, 1]^K$ . The learner is then rewarded with $r_t(I_t)$ and observes $r_t(j)$ for each arm $j \in N^{\mathrm{out}}(I_t)$ . + +It is not hard to see that if some arm $i$ is unobservable, i.e., $N^{\mathrm{in}}(i) = \emptyset$ , the learner could not determine which arm is optimal. Therefore, we consider a general observable graph, i.e., $N^{\mathrm{in}}(i) \neq \emptyset$ for each arm $i \in V$ . It is worth noting that in such a general graph, there may exist arm $i$ with $(i,i) \notin E$ . In this case, the learner though obtains the reward $r_t(i)$ by selecting arm $i$ , has no chance to get the observation on it. + +Stochastic and adversarial are two standard environments studied in the literature (Wu et al., 2015; Alon et al., 2015; Li et al., 2020; Chen et al., 2021). In the stochastic setting, the reward vector $r_t$ at time $t$ is independently drawn from a fixed reward distribution with expectation $\mathbb{E}[r_t] = \mu := (\mu_1, \mu_2, \dots, \mu_K)$ . Denote $i^* = \operatorname{argmax}_{i \in V} \mu_i$ as the optimal arm, which we assume is unique as previous works (Wu et al., 2015; Li et al., 2020; Erez & Koren, 2021). And for each arm $i \in V$ , define $\Delta_i = \mu_i^* - \mu_i$ as the expected reward gap of $i$ compared with $i^*$ . In this setting, the pseudo + +regret is defined as + +$$ +\operatorname {R e g} (T) = \sum_ {t = 1} ^ {T} \mu_ {i ^ {*}} - \mu_ {I _ {t}}. \tag {1} +$$ + +The instance-optimal expected regret attracts more interest in this setting, which is shown to be of order $\Theta(C(\mu) \log T)$ (Wu et al., 2015), where $C(\mu)$ is a constant related to the specific problem instance. The adversarial setting is more general than the stochastic setting, where the reward vector $r_t$ can be chosen arbitrarily. Following previous works (Alon et al., 2015; Chen et al., 2021), we consider the oblivious adversary where the rewards are chosen at the start of the game. The pseudo regret in this setting is defined as + +$$ +R e g (T) = \max _ {i \in V} \sum_ {t = 1} ^ {T} r _ {t} (i) - \sum_ {t = 1} ^ {T} r _ {t} (I _ {t}). \qquad (2) +$$ + +Researchers are interested in the minimax-optimal expected regret in this setting, which is of order $\Theta (T^{2 / 3})$ (Alon et al., 2015; Chen et al., 2021). + +# 4. Algorithm + +In this section, we present our BoBW algorithm for online learning with general graph feedback (Algorithm 1). + +The algorithm takes the feedback graph $G$ and a dominating set $D$ of the graph as input (Line 1). A dominating set contains arms whose out-neighbors can cover the whole arm set, i.e., $\cup_{j \in D} N^{\mathrm{out}}(j) = V$ . Thus any arm can be observed by selecting arms in $D$ . + +At a high level, the algorithm starts with the assumption that the environment is stochastic and continuously monitors whether the assumption is satisfied. Typical optimal stochastic algorithms (Wu et al., 2015; Li et al., 2020) first explores arms in the dominating set to collect more observations until the optimal arm is identified, and then focuses on the estimated optimal one. But such type of algorithms would fail if the underlying environment is adversarial, since the regret caused by exploring arms cannot be controlled before the environment is detected to be adversarial. + +As in the classical multi-armed bandits (MAB) problem, to minimize the cumulative regret, the learner needs to trade off exploitation and exploration. The former focuses on arms with high observed rewards so far to maintain high profits, while the latter aims to select unfamiliar arms to collect more observations (Auer et al., 2002a; Lattimore & Szepesvári, 2020). However, with general graph feedback, the observation of an arm may not be available by selecting it. Thus, to collect observations on an arm $i$ , the learner needs to select some arms from $N^{\mathrm{in}}(i)$ . To this end, the algorithm maintains the active arm set $A$ and the active dominating set $D_A$ , which are initialized as $V$ and + +Algorithm 1 BoBW with General Graph Feedback +1: Input: graph $G = (V,E)$ , dominating set $D$ , hyper-parameter $\{\gamma_t\}_t$ +2: Initialize: active arm set $A\gets V$ . $\forall i\in V,\tau_i\gets \infty ,\tau_i'\gets \infty$ . active dominating set $D_{A}\leftarrow D;\forall i\in D,\tau_{i}^{D}\leftarrow \infty ,u_{i}\leftarrow \frac{1}{|D|}$ +3: for $t = 1,2,\ldots$ do +4: for $i\in V$ do +5: $p_{t,A}(i)\gets 11\{i\in A\} \cdot \frac{1}{|A|}$ +6: $p_{t,D}(i)\gets 11\{i\in D_A\} \cdot \left(1 - \sum_{j\in D\setminus D_A}\frac{u_j\tau_j^D}{t}\right)\frac{1}{|D_A|} +11\{i\in D\setminus D_A\} \cdot \frac{u_i\tau_i^D}{t}$ +7: $p_t(i)\gets (1 - \gamma_t)\cdot p_{t,A}(i) + \gamma_t\cdot p_{t,D}(i)$ +8: end for +9: Select $I_{t}\sim p_{t}$ and be rewarded with $r_t(I_t)$ ; observe the reward $\{(i,r_t(i)),\forall i\in N^0$ +10: For each $i\in V$ , compute + +$$ +\tilde {H} _ {t} (i) \leftarrow \frac {1}{t} \sum_ {s = 1} ^ {t} \frac {r _ {t} (i) \cdot \mathbb {1} \{i \in N ^ {\text {o u t}} \left(I _ {t}\right) \}}{\sum_ {j \in N ^ {\text {i n}} (i)} p _ {t} (j)}. \tag {3} +$$ + +$$ +\tilde {H} _ {t} \left(j ^ {\prime}\right) - \tilde {H} _ {t} (i) > 3 \operatorname {R a d i u s} _ {t} \left(j ^ {\prime}\right) + 3 \operatorname {R a d i u s} _ {i} (t) \text {f o r} j ^ {\prime} \in \underset {j \in A} {\operatorname {a r g m a x}} \tilde {H} _ {t} (j) \tag {4} +$$ + +$$ +\text {w h e r e} \operatorname {R a d i u s} _ {t} (j) = \sqrt {4 \left(\frac {| D |}{t ^ {2}} \sum_ {s = 1} ^ {\min \left\{t , \tau_ {j} ^ {\prime} \right\}} \frac {1}{\gamma_ {s}} + \frac {| D | \cdot \max \left\{t - \tau_ {j} ^ {\prime} , 0 \right\}}{\gamma_ {t} \tau_ {j} ^ {\prime} t}\right) \log \frac {t}{\delta} + \frac {5 | D | ^ {2}}{\gamma_ {t} ^ {2} \min \left\{t ^ {2} , \tau_ {j} ^ {\prime 2} \right\}} \log^ {2} \frac {t}{\delta}}, \forall j \tag {5} +$$ + +11: for $i \in A$ such that +do +```txt +12: $A\gets A\setminus \{i\} ,\tau_i\gets t$ +``` + +13: end for +```txt +14: for $j \in D_A$ such that $i \notin A, \forall i \in N^{\mathrm{out}}(j)$ or $|A| = 1$ do +``` + +16: end for +```txt +15: $D_A\gets D_A\setminus \{j\} ,\tau_j^D\gets t,u_j\gets p_{t,D}(j)$ +``` + +18: $\tau_{i}^{\prime}\gets t$ +```txt +17: for $i \in V$ such that $\tau_i' > t$ and $\tau_j^D \leq t, \forall j \in D$ with $i \in N^{\mathrm{out}}(j)$ do +``` + +20: if $\exists i\notin A$ such that +```txt +19: end for +``` + +$$ +\tilde {H} _ {t} \left(j ^ {\prime}\right) - \tilde {H} _ {t} (i) \leq \operatorname {R a d i u s} _ {t} (i) + \operatorname {R a d i u s} _ {t} \left(j ^ {\prime}\right) \text {f o r} j ^ {\prime} \in \underset {j \in A} {\operatorname {a r g m a x}} \tilde {H} _ {t} (j) \tag {6} +$$ + +then +22: end if +```txt +21: Start Exp3.G and set $\tau \gets t$ +``` + +```txt +23: end for +``` + +$D$ , respectively (Line 2). Intuitively, $A$ is the candidate set of arms with the potential to be optimal and $D_A$ is a dominating set of $A$ . The learner can then explore arms in $D_A$ to get more observations and exploit arms in $A$ to collect more rewards. How to balance these two parts is the key to achieving optimal regret in both stochastic and adversarial environments. The hyper-parameter $(\gamma_t)_t$ is taken as input + +to control this trade-off (Line 1). + +For the proceeding of the above exploration-exploitation trade-off, the algorithm maintains several indicators for arms. Specifically, for each arm $i \in V$ , denote $\tau_{i}$ as the time when $i$ is considered as sub-optimal and deleted from active set $A$ . Then if the environment is truly stochastic, there is no need to exploit $i$ anymore after $\tau_{i}$ . Similarly, + +for each arm $j \in D$ , let $\tau_j^D$ represent the time when all of $j$ 's out-neighbors have been considered as sub-optimal and $j$ is deleted from $D_A$ . Based on this definition, the learner has no need to explore $j$ for more observations on $N^{\mathrm{out}}(j)$ after $\tau_j^D$ . Besides, for each arm $i \in V$ , denote $\tau_i' = \operatorname*{argmin}_{j \in D, j \in N^{\mathrm{in}}(i)} \tau_j^D$ as the time when all of $i$ 's dominating arms have been deleted from $D_A$ . All of above values are initialized as $\infty$ at the beginning (Line 2). + +To deal with the potential adversary, the learner needs to adopt a randomized strategy. Let $p_t$ be the action distribution at $t$ . The probability $p_t(i)$ of selecting $i$ at $t$ comes from two parts: the exploitation probability $p_{t,A}(i)$ (Line 5) and the exploration probability $p_{t,D}(i)$ (Line 6). Since arms in $V \setminus A$ are considered to be sub-optimal, the learner only needs to exploit arms in $A$ . Here the algorithm conducts exploitation through a uniform distribution over active arm set $A$ as Line 5. And for arms in the active dominating set $i \in D_A$ , the learner also needs to explore $i$ to get more observations on its out-neighbors, which is also implemented by a uniform distribution over $D_A$ (Line 6). Besides, since the environment still has the potential to be adversarial and the deleted arms may become better, the observations on the deleted arms are still required for monitoring. For this reason, the algorithm would re-sample arms $j \in D \setminus D_A$ with a certain probability (Line 6). Note that the re-sampling probability should be small enough to avoid more regret since $j$ may be sub-optimal arms. Here we follow Bubeck & Slivkins (2012) for the re-sampling schedule and continuously decrease the exploration probability for arms $j \in D \setminus D_A$ after $\tau_j^D$ as shown in Line 6, where $u_j$ records the exploration probability of dominating arm $j$ at time $\tau_j^D$ . The probability $p_t(i)$ is then defined as the weighted sum of these two parts and the weight is decided by the hyper-parameter $\gamma_t$ (Line 7). + +In each round $t$ , the learner selects an arm $I_{t} \sim p_{t}$ and observes the reward $r_{t}(i)$ for each arm $i \in N^{\mathrm{out}}(I_t)$ (Line 9). Based on the collected observations, it constantly detects the optimality of arms, which is implemented relying on the estimator $\tilde{H}_t$ defined as Eq.(3). The detection condition Eq.(4) is based on the concentration of the constructed estimators, where the concentration radius is shown in Eq.(5) and the detailed analysis is provided in Section 6. Specifically, if some arm $i$ satisfies the detection condition in Eq.(4), then it is considered to be sub-optimal and would be eliminated from the active arm set (Line 12). The active dominating set $D_A$ and the indicator $\tau_j^\prime$ for each arm $j$ would be updated accordingly (Line 14-19). It is worth noting that if the optimal arm is identified, i.e., $|A| = 1$ , $D_A$ should be emptied since there is no need to collect more observations on $A$ (Line 14). + +Recall that the learner also needs to re-sample arms $j \in D \setminus D_A$ to collect observations on deleted arms $i \notin A$ to + +detect whether they become better with the influence of the potential adversary. This detection condition should be weak enough to guarantee to be satisfied in the stochastic setting and also strong enough such that before the condition is satisfied, the learner does not pay too much regret in the actual adversarial setting. Here we define Eq.(6) to check whether a previous sub-optimal arm $i$ gets better. We show that in the stochastic setting, with high probability, this condition does not hold. And once it is satisfied, the learner believes the environment is actually adversarial and starts to run the optimal Exp3.G algorithm in the adversarial setting (Alon et al., 2015). + +# 5. Theoretical Guarantees and Discussions + +The regret upper bounds of Algorithm 1 in both stochastic and adversarial environments are presented in Theorem 5.1. + +Theorem 5.1 (Main). Let $\gamma_{t} = K^{\frac{2}{3}}|D|^{\frac{1}{3} t^{-\frac{1}{3}}}$ . In the stochastic setting, Algorithm 1 guarantees that with probability at least $1 - \delta$ , the regret is at most $O\left(|D|^2 \cdot \max_{i: i \neq i^*} \left( \frac{\log T / \delta}{\Delta_i^2} \right)^{\frac{3}{2}}\right)$ . Moreover, in the adversarial setting, with probability at least $1 - \delta$ , the expected regret is at most $O\left(K^{\frac{2}{3}}|D|^{\frac{1}{3}}T^{\frac{2}{3}} \sqrt{\log \frac{T}{\delta}}\right)$ . + +# 5.1. Discussions + +Theorem 5.1 is the first theoretical result for general graph feedback that simultaneously achieves near-optimal regret in both stochastic and adversarial environments. As shown in Table 1, our regret upper bound is only $O\left(|D|\sqrt{\log T} / \Delta\right)$ worse than the optimal regret in the stochastic setting (Wu et al., 2015) and $O(K^{2/3}\sqrt{\log T})$ worse than the optimal regret in the adversarial setting (Alon et al., 2015; Chen et al., 2021). Above all, to simultaneously learn in both environments, our algorithm only suffers from additional logarithmic and constant factors in the regret. + +Though our adopted framework belongs to the same line as Bubeck & Slivkins (2012), new techniques are needed to deal with the unique challenge brought by general graph feedback. With a general feedback graph, the observations and rewards of an arm cannot be simultaneously obtained. Thus an important modification of our algorithm is introducing the exploration on dominating arms and the challenge accompanying it is to trade off between selecting arms in dominating set and active set, which mechanism is controlled by the parameter $\gamma_{t}$ . It is also worth noting that setting $\gamma_{t}$ as previous works in one of the separate environments would cause the algorithm to fail in the other one. Specifically, if we directly follow the stochastic algorithm (Wu et al., 2015) and set $\gamma = 1$ before the optimal arm is identified and $\gamma = 0$ otherwise before starting Exp3.G, the regret in the adversarial setting would be $O(T)$ since the + +regret before starting Exp3.G cannot be controlled. On the other hand, if we directly follow the adversarial algorithm (Alon et al., 2015) and set $\gamma = T^{-1/3}$ , the regret in the stochastic setting would be $O(T^{1/3} \log T)$ . Both these two results are not desirable. + +Intuitively, to achieve the minimax-optimality in the adversarial setting, the learner needs to simultaneously conduct exploration on the dominating set and exploitation on the active set. However, if the environment is truly stochastic, the exploitation before an optimal arm is identified would produce additional regret. To bound this part of regret, we adjust the exploitation budget to let it polynomial depend on the exploration budget by setting $\gamma_{t}$ to vary with time $t$ . Thus when the optimal arm is identified after $O(\log T)$ exploration rounds, the additional cost of exploitation is also polynomial on $O(\log T)$ . And based on the consideration to minimize the regret in the adversarial setting, the exact value of $\gamma_{t}$ is set as $O(t^{-1/3})$ . The additional $\sqrt{\log T} / \Delta$ regret in the stochastic setting compared with the lower bound is just the cost for preserving the minimax-optimality in a harder adversarial environment. + +# 6. Proof of Theorem 5.1 + +Before the main proof, we first introduce some useful notations and inequalities. At any time $t$ , let $A_{t}$ be the active arm set $A$ at the start of round $t$ and denote $H_{t}(i) := \frac{1}{t}\sum_{s=1}^{t}r_{s}(i)$ as the averaged reward of $i$ at $t$ . + +The proof of Theorem 5.1 highly depends on the concentration of the estimator $\tilde{H}_t(i)$ . In the stochastic setting, it is an estimator of the unknown expected reward $\mu_i$ . And in the adversarial setting, it is the estimator of unknown averaged reward $H_t(i)$ . In these two environments, we want to separately bound the difference between $\tilde{H}_t(i)$ and $\mu_i(H_t(i)$ , respectively). + +Lemma 6.1. For any arm $i \in V$ and time $t < \tau$ , with probability at least $1 - \delta$ , $\left|\tilde{H}_t(i) - \mu_i\right| \leq \mathrm{Radius}_t(i)$ in the stochastic setting and $\left|\tilde{H}_t(i) - H_t(i)\right| \leq \mathrm{Radius}_t(i)$ in the adversarial setting. + +Proof. Since the proofs of the two inequalities are similar, here we mainly focus on the adversarial setting. + +In each round $t$ , let $\mathcal{F}_t$ be the history of observations. Define + +$$ +X _ {t} (i) = \tilde {r} _ {t} (i) - r _ {t} (i) = r _ {t} (i) \left(\frac {\mathbb {1} \{i \in N ^ {\mathrm {o u t}} (I _ {t}) \}}{\sum_ {j \in N ^ {\mathrm {i n}} (i)} p _ {s} (j)} - 1\right). +$$ + +Note that $(X_{s}(i))_{1\leq s\leq t}$ is a martingale difference sequences. According to the algorithm, at each time $t < \tau$ + +$$ +\sum_ {j \in N ^ {\mathrm {i n}} (i)} p _ {t} (j) \geq \frac {\gamma_ {t}}{| D |} \mathbb {1} \{t \leq \tau_ {i} ^ {\prime} \} + \frac {\gamma_ {t} \tau_ {i} ^ {\prime}}{| D | t} \mathbb {1} \{t > \tau_ {i} ^ {\prime} \}. +$$ + +Thus $|X_{t}(i)| \leq \max \left\{ \frac{|D|}{\gamma_{t}}, \frac{|D|t}{\gamma_{t}\tau_{i}^{\prime}} \right\} \leq \frac{|D|}{\gamma_{t}} \max \left\{ 1, \frac{t}{\tau_{i}^{\prime}} \right\}$ and + +$$ +\begin{array}{l} \sum_ {s = 1} ^ {t} \mathbb {E} \left[ X _ {s} (i) ^ {2} \mid \mathcal {F} _ {s - 1} \right] \leq \sum_ {s = 1} ^ {\min \left\{t, \tau_ {i} ^ {\prime} \right\}} \frac {| D |}{\gamma_ {s}} + \sum_ {s = \tau_ {i} ^ {\prime}} ^ {t} \frac {| D | s}{\gamma_ {s} \tau_ {i} ^ {\prime}} \\ \leq \sum_ {s = 1} ^ {\min \{t, \tau_ {i} ^ {\prime} \}} \frac {| D |}{\gamma_ {s}} + \frac {t | D |}{\gamma_ {t} \tau_ {i} ^ {\prime}} \cdot \max \left\{t - \tau_ {i} ^ {\prime}, 0 \right\}, \\ \end{array} +$$ + +where the last inequality holds since $\gamma_{t}$ decreases with the increase of $t$ by choosing $\gamma_{t} = (K^{2}|D|)^{1 / 3}t^{-1 / 3}$ . According to Lemma 6.7 and the definition of $\mathrm{Radius}_t(i)$ , we have with probability at least $1 - \delta$ + +$$ +\sum_ {s = 1} ^ {t} X _ {s} (i) \leq t \cdot \operatorname {R a d i u s} _ {t} (i), +$$ + +and further + +$$ +\left| \tilde {H} _ {t} (i) - H _ {t} (i) \right| \leq \operatorname {R a d i u s} _ {t} (i), +$$ + +since $\tilde{H}_t(i) - H_t(i) = \frac{1}{t}\sum_{s=1}^{t}X_s(i)$ . + +![](images/3d7decc68ae2ea3c138b812dcdf0c888c3b3cf1fd0e980f734760cb8954a4450.jpg) + +In the following, we provide the analysis of Algorithm 1 in both settings. + +# 6.1. Regret Analysis in the Stochastic Setting + +We first simply show that the optimal arm $i^{*}$ is never deleted from the active arm set $A$ . + +Lemma 6.2. At any time $t$ , $i^{*} \in A_{t}$ . + +Proof. At any time $t$ , for any arm $j \in A_t$ , + +$$ +\begin{array}{l} \tilde {H} _ {t} (j) - \tilde {H} _ {t} \left(i ^ {*}\right) \leq \mu_ {j} - \mu_ {i ^ {*}} + \operatorname {R a d i u s} _ {t} (j) + \operatorname {R a d i u s} _ {t} \left(i ^ {*}\right) \\ = - \Delta_ {j} + \operatorname {R a d i u s} _ {t} (j) + \operatorname {R a d i u s} _ {t} \left(i ^ {*}\right) \\ \leq 3 \operatorname {R a d i u s} _ {t} (j) + 3 \operatorname {R a d i u s} _ {t} \left(i ^ {*}\right), \\ \end{array} +$$ + +where the first inequality comes from Lemma 6.1. Thus the detection condition Eq.(4) is never satisfied for $i^{*}$ . + +We then prove that the Exp3.G algorithm is never started in the stochastic setting. + +Lemma 6.3. In the stochastic setting, Eq.(6) in Algorithm 1 is never satisfied and thus Exp3.G is never started. + +Proof. For each arm $i$ , let $j \in \operatorname{argmax}_{j' \in A_{\tau_i}} \tilde{H}_{\tau_i}(j')$ . Then according to the definition of $\tau_i$ , + +$$ +\tilde {H} _ {\tau_ {i}} (j) - \tilde {H} _ {\tau_ {i}} (i) > 3 \operatorname {R a d i u s} _ {\tau_ {i}} (j) + 3 \operatorname {R a d i u s} _ {\tau_ {i}} (i). +$$ + +Besides, according to Lemma 6.1, + +$$ +\tilde {H} _ {\tau_ {i}} (j) - \tilde {H} _ {\tau_ {i}} (i) \leq \mu_ {j} - \mu_ {i} + \operatorname {R a d i u s} _ {\tau_ {i}} (j) + \operatorname {R a d i u s} _ {\tau_ {i}} (i) +$$ + +$$ +\leq \Delta_ {i} + \operatorname {R a d i u s} _ {\tau_ {i}} (j) + \operatorname {R a d i u s} _ {\tau_ {i}} (i). +$$ + +Combining the above two inequalities, we have + +$$ +\begin{array}{l} \Delta_ {i} > 2 \operatorname {R a d i u s} _ {\tau_ {i}} (j) + 2 \operatorname {R a d i u s} _ {\tau_ {i}} (i) \\ = 4 \sqrt {\frac {4 | D |}{\tau_ {i} ^ {2}} \sum_ {s = 1} ^ {\tau_ {i}} \frac {1}{\gamma_ {s}} \log \frac {T}{\delta} + \frac {5 | D | ^ {2}}{\gamma_ {\tau_ {i}} ^ {2} \tau_ {i} ^ {2}} \log^ {2} \frac {T}{\delta}}, \tag {7} \\ \end{array} +$$ + +where the last equality holds by computing $\mathrm{Radius}_{\tau_i}(j)$ and $\mathrm{Radius}_{\tau_i}(i)$ with $\tau_i' \geq \tau_i$ and $\tau_j' \geq \tau_i$ . + +Further, at any time $t$ , according to Lemma 6.1 and the fact that $i^{*} \in A_{t}$ , we have for each arm $i \notin A_{t}$ + +$$ +\begin{array}{l} \max _ {j \in A _ {t}} \tilde {H} _ {t} (j) - \tilde {H} _ {t} (i) \geq \tilde {H} _ {t} \left(i ^ {*}\right) - \tilde {H} _ {t} (i) \\ \geq \Delta_ {i} - \operatorname {R a d i u s} _ {t} \left(i ^ {*}\right) - \operatorname {R a d i u s} _ {t} (i) \\ > \operatorname {R a d i u s} _ {t} \left(i ^ {*}\right) + \operatorname {R a d i u s} _ {t} (i), \tag {8} \\ \end{array} +$$ + +where Eq.(8) holds by computing $\mathrm{Radius}_t(i^*)$ and $\mathrm{Radius}_t(i)$ and comparing them with $\Delta_i$ which is lower bounded by Eq.(7). + +Let $j_{t} \in \operatorname{argmax}_{j \in A_{t}} \tilde{H}_{t}(j)$ . If $j_{t} = i^{*}$ , then we have proved Eq.(6) in Algorithm 1 is not satisfied. Otherwise, there must be $\mathrm{Radius}_t(j_t) = \mathrm{Radius}_t(i^*)$ , since both $\tau_{j_t}' > t$ and $\tau_{i^*}' > t$ when the optimal arm is not identified. Above all, no matter in either case, Exp3.G is not started. + +In the following, we try to bound the number of arms' selections. For convenience, denote $T_{i}(t) \coloneqq \sum_{s=1}^{t} \mathbb{1}\{I_{s} = i\}$ as the number of $i$ 's selections at the end of $t$ . + +Lemma 6.4. For consistency, define $\tau_i^D = 0$ for each arm $i \notin D$ . Then at any time $t = 1,2,\ldots$ , with probability at least $1 - \delta$ , for each arm $i \in V$ , + +$$ +\begin{array}{l} T _ {i} (t) \leq \tau_ {i} + \sum_ {s = 1} ^ {\tau_ {i} ^ {D}} \gamma_ {s} + \sum_ {s = \tau_ {i} ^ {D}} ^ {T} \gamma_ {s} \frac {\tau_ {i} ^ {D}}{s} \\ + \sqrt {4 \left(\tau_ {i} + \sum_ {s = 1} ^ {\tau_ {i} ^ {D}} \gamma_ {s} + \sum_ {s = \tau_ {i} ^ {D}} ^ {T} \gamma_ {s} \frac {\tau_ {i} ^ {D}}{s}\right) \log \frac {T}{\delta} + 5 \log^ {2} \frac {T}{\delta}}. \\ \end{array} +$$ + +Proof. Let $Z_{s,i}(p) \sim \text{Bernoulli}(p)$ for time $s = 1,2\ldots ,t$ , $i \in V$ . Then $\forall i,t$ , $T_{i}(t) = \sum_{s = 1}^{t}Z_{s,i}(p_{s}(i))$ . Define $X_{s}(i) = Z_{s,i}(p_{s}(i)) - p_{s}(i)$ . We have $|X_{s}(i)| \leq 1$ and + +$$ +\sum_ {s = 1} ^ {t} \mathbb {E} \left[ X _ {s} (i) ^ {2} \mid \mathcal {F} _ {s - 1} \right] \leq \tau_ {i} + \sum_ {s = 1} ^ {\tau_ {i} ^ {D}} \gamma_ {s} + \sum_ {s = 1} ^ {\tau_ {i} ^ {D}} \gamma_ {s} \frac {\tau_ {i} ^ {D}}{s}. +$$ + +According to Lemma 6.7, with probability at least $1 - \delta$ + +$$ +T _ {i} (t) \leq \tau_ {i} + \sum_ {s = 1} ^ {\tau_ {i} ^ {D}} \gamma_ {s} + \sum_ {s = 1} ^ {\tau_ {i} ^ {D}} \gamma_ {s} \frac {\tau_ {i} ^ {D}}{s} + \sum_ {s = 1} ^ {t} X _ {s} (i) +$$ + +$$ +\begin{array}{l} \leq \tau_ {i} + \sum_ {s = 1} ^ {\tau_ {i} ^ {D}} \gamma_ {s} + \sum_ {s = 1} ^ {\tau_ {i} ^ {D}} \gamma_ {s} \frac {\tau_ {i} ^ {D}}{s} \\ + \sqrt {4 \left(\tau_ {i} + \sum_ {s = 1} ^ {\tau_ {i} ^ {D}} \gamma_ {s} + \sum_ {s = 1} ^ {\tau_ {i} ^ {D}} \gamma_ {s} \frac {\tau_ {i} ^ {D}}{s}\right) \log \frac {T}{\delta} + 5 \log^ {2} \frac {T}{\delta}}. \\ \end{array} +$$ + +![](images/77640bf121d7c6765496a2642f09fccf7c5a1ecfc55c6c141d00ae1029f66154.jpg) + +Based on above results, the pseudo regret $Reg(T) = \sum_{i \neq i^*} \Delta_i T_i(T)$ in the stochastic setting can be upper bounded by + +$$ +\begin{array}{l} \sum_ {i \notin D, i \neq i ^ {*}} \Delta_ {i} \left(\tau_ {i} + \sqrt {4 \tau_ {i} \log \frac {T}{\delta} + 5 \log^ {2} \frac {T}{\delta}}\right) \\ + \sum_ {i \in D, i \neq i ^ {*}} \Delta_ {i} \left(\tau_ {i} + \sum_ {s = 1} ^ {\tau_ {i} ^ {D}} \gamma_ {s} + \sum_ {s = \tau_ {i} ^ {D}} ^ {T} \gamma_ {s} \frac {\tau_ {i} ^ {D}}{s} \right. \\ + \sqrt {4 \left(\tau_ {i} + \sum_ {s = 1} ^ {\tau_ {i} ^ {D}} \gamma_ {s} + \sum_ {s = \tau_ {i} ^ {D}} ^ {T} \gamma_ {s} \frac {\tau_ {i} ^ {D}}{s}\right) \log \frac {T}{\delta} + 5 \log^ {2} \frac {T}{\delta}}). \\ \end{array} +$$ + +In the following, we separately bound each part. + +Bound $\tau_{i}$ : At time $\tau_{i} - 1$ , since $i^{*} \in A_{\tau_{i} - 1}$ , it holds that + +$$ +\begin{array}{l} \Delta_ {i} - 2 \sqrt {\frac {4 | D |}{(\tau_ {i} - 1) ^ {2}} \sum_ {s = 1} ^ {\tau_ {i} - 1} \frac {1}{\gamma_ {s}} \log \frac {\tau_ {i}}{\delta} + \frac {5 | D | ^ {2} \log^ {2} \frac {\tau_ {i}}{\delta}}{\gamma_ {\tau_ {i} - 1} ^ {2} (\tau_ {i} - 1) ^ {2}}} \\ = \mu_ {i ^ {*}} - \mu_ {i} - \operatorname {R a d i u s} _ {\tau_ {i} - 1} (i ^ {*}) - \operatorname {R a d i u s} _ {\tau_ {i} - 1} (i) \\ \leq \tilde {H} _ {\tau_ {i} - 1} (i ^ {*}) - \tilde {H} _ {\tau_ {i} - 1} (i) \\ \leq \max _ {j \in A _ {\tau_ {i} - 1}} \tilde {H} _ {\tau_ {i} - 1} (j) - \tilde {H} _ {\tau_ {i} - 1} (i) \\ \leq 6 \sqrt {\frac {4 | D |}{(\tau_ {i} - 1) ^ {2}} \sum_ {s = 1} ^ {\tau_ {i} - 1} \frac {1}{\gamma_ {s}} \log \frac {\tau_ {i}}{\delta} + \frac {5 | D | ^ {2} \log^ {2} \frac {\tau_ {i}}{\delta}}{\gamma_ {\tau_ {i} - 1} ^ {2} (\tau_ {i} - 1) ^ {2}}}, \\ \end{array} +$$ + +where the first equality and the last inequality hold according to the algorithm and the values of $\mathrm{Radius}_{\tau_i - 1}(i)$ for these different arms, the first inequality comes from Lemma 6.1. + +We can then conclude $\tau_{i} \leq \frac{|D|}{K}\left(\frac{1024\log T / \delta}{\Delta_{i}^{2}}\right)^{3 / 2}$ . + +Bound $\tau_i^D$ for $i\in D$ : According to Algorithm 1, for each arm $i\in D$ , if $i^{*}\notin N^{\mathrm{out}}(i)$ , $\tau_{i}^{D} = \max_{j:j\in N^{\mathrm{out}}(i)}\tau_{j}$ . And If $i^{*}\in N^{\mathrm{out}}(i)$ , $\tau_{i}^{D} = \max_{j:j\neq i^{*}}\tau_{j}$ . + +Bound $\sum_{s=1}^{\tau_i^D} \gamma_s$ for $i \in D$ : + +$$ +\sum_ {s = 1} ^ {\tau_ {i} ^ {D}} \gamma_ {s} = \sum_ {s = 1} ^ {\tau_ {i} ^ {D}} K ^ {\frac {2}{3}} | D | ^ {\frac {1}{3}} s ^ {- \frac {1}{3}} +$$ + +$$ +\begin{array}{l} \leq K ^ {\frac {2}{3}} | D | ^ {\frac {1}{3}} \left(1 + \int_ {1} ^ {\tau_ {i} ^ {D}} s ^ {- \frac {1}{3}} d s\right) \\ \leq K ^ {\frac {2}{3}} | D | ^ {\frac {1}{3}} \left(1 + (\tau_ {i} ^ {D}) ^ {2 / 3}\right) \leq O \left(K ^ {\frac {2}{3}} | D | ^ {\frac {1}{3}} (\tau_ {i} ^ {D}) ^ {2 / 3}\right). \\ \end{array} +$$ + +Bound $\tau_{i}^{D}\sum_{s = \tau_{i}^{D}}^{T}\frac{\gamma_{s}}{s}$ for $i\in D$ .. + +$$ +\begin{array}{l} \tau_ {i} ^ {D} \sum_ {s = \tau_ {i} ^ {D}} ^ {T} \frac {\gamma_ {s}}{s} \leq K ^ {2 / 3} | D | ^ {1 / 3} \tau_ {i} ^ {D} \sum_ {s = \tau_ {i} ^ {D}} ^ {T} s ^ {- 4 / 3} \\ \leq 4 K ^ {2 / 3} | D | ^ {1 / 3} \tau_ {i} ^ {D}. \\ \end{array} +$$ + +Combining the above upper bound for each part, the regret can be bounded by + +$$ +\begin{array}{l} O \left( \right.\sum_ {i \neq i ^ {*}} \frac {\Delta_ {i} | D |}{K} \left(\frac {\log T / \delta}{\Delta_ {i} ^ {2}}\right) ^ {\frac {3}{2}} + \sum_ {i \in D, i \neq i ^ {*}} \Delta_ {i} \cdot \max _ {j: j \neq i ^ {*}} \\ \left. \left(\frac {| D | \log T / \delta}{\Delta_ {j} ^ {2}} + \frac {| D | ^ {\frac {4}{3}}}{K ^ {\frac {1}{3}}} \left(\frac {\log T / \delta}{\Delta_ {j} ^ {2}}\right) ^ {\frac {3}{2}}\right)\right) \\ \leq O \left(\frac {\left| D \right| ^ {\frac {7}{3}}}{K ^ {\frac {1}{3}}} \max _ {j: j \neq i ^ {*}} \left(\frac {\log T / \delta}{\Delta_ {j} ^ {2}}\right) ^ {\frac {3}{2}}\right) \\ \leq O \left(| D | ^ {2} \max _ {j: j \neq i ^ {*}} \left(\frac {\log T / \delta}{\Delta_ {j} ^ {2}}\right) ^ {\frac {3}{2}}\right). \\ \end{array} +$$ + +Thus we obtain the upper bound for the pseudo regret in Theorem 5.1. + +# 6.2. Regret Analysis in the Adversarial Setting + +Recall that $\tau$ is the time when Exp3.G is started. In the adversarial setting, let $i^{*} \in \operatorname{argmax}_{i \in V} \sum_{t=1}^{\tau} r_{t}(i)$ be one of the optimal arms in the first $\tau$ rounds. We first show that $i^{*}$ would not be deleted from $A$ before $\tau$ . + +Lemma 6.5. At time $\tau -1$ , $i^{*}\in A_{\tau -1}$ . + +Proof. Denote $I^{*} \in \operatorname{argmax}_{i \in A_{\tau - 1}} \sum_{t = 1}^{\tau - 1} r_{t}(i)$ as one of the optimal arms in $A_{\tau - 1}$ . Then for any arm $i \notin A_{\tau - 1}$ , + +$$ +\begin{array}{l} \sum_ {t = 1} ^ {\tau - 1} r _ {t} \left(I ^ {*}\right) - \sum_ {t = 1} ^ {\tau - 1} r _ {t} (i) \\ = (\tau - 1) \left(H _ {\tau - 1} \left(I ^ {*}\right) - \tilde {H} _ {\tau - 1} \left(I ^ {*}\right) + \tilde {H} _ {\tau - 1} \left(I ^ {*}\right) \right. \\ \left. - \tilde {H} _ {\tau - 1} (i) + \tilde {H} _ {\tau - 1} (i) - H _ {\tau - 1} (i)\right) \\ \geq (\tau - 1) \left(- \operatorname {R a d i u s} _ {\tau - 1} \left(I ^ {*}\right) - \operatorname {R a d i u s} _ {\tau - 1} (i) \right. \\ \left. + \tilde {H} _ {\tau - 1} \left(I ^ {*}\right) - \tilde {H} _ {\tau - 1} (i)\right) > 0 \\ \end{array} +$$ + +where the last inequality holds based on Lemma 6.1 and the fact that Eq.(6) in Algorithm 1 is not satisfied at $\tau - 1$ . + +Above all, any previously deleted arm $i \notin A_{\tau - 1}$ is worse than $I^{*}$ , thus we can conclude that $i^{*} \in A_{\tau - 1}$ holds. + +In the following, we bound the averaged regret before $\tau$ compared with $i^{*}$ caused by selecting different arms. + +Lemma 6.6. For each arm $i$ such that $i \notin A_{\tau - 1}$ , at $\tau_i - 1$ , + +$$ +H _ {\tau_ {i} - 1} \left(i ^ {*}\right) - H _ {\tau_ {i} - 1} (i) \leq 8 \operatorname {R a d i u s} _ {\tau_ {i} - 1} (i). +$$ + +Similarly, for each arm $i \in A_{\tau - 1}$ , at time $\tau - 1$ + +$$ +H _ {\tau - 1} \left(i ^ {*}\right) - H _ {\tau - 1} (i) \leq 8 \operatorname {R a d i u s} _ {\tau - 1} (i). +$$ + +Proof. For arm $i \notin A_{\tau - 1}$ , Eq.(4) in Algorithm 1 does not hold at time $\tau_i - 1$ , and since $i^* \in A_{\tau_i - 1}$ , + +$$ +\begin{array}{l} \tilde {H} _ {\tau_ {i} - 1} (i ^ {*}) - \tilde {H} _ {\tau_ {i} - 1} (i) \\ \leq \max _ {j \in A _ {\tau_ {i} - 1}} \tilde {H} _ {\tau_ {i} - 1} (j) - \tilde {H} _ {\tau_ {i} - 1} (i) \\ \leq 3 \operatorname {R a d i u s} _ {\tau_ {i} - 1} (j) + 3 \operatorname {R a d i u s} _ {\tau_ {i} - 1} (i) \\ = 6 \operatorname {R a d i u s} _ {\tau_ {i} - 1} (i). \tag {9} \\ \end{array} +$$ + +where Eq.(9) holds since at $\tau_{i} - 1$ , $\mathrm{Radius}_{\tau_i - 1}(j) = \mathrm{Radius}_{\tau_i - 1}(i)$ . Besides, at $\tau_{i} - 1$ , $\mathrm{Radius}_{\tau_i - 1}(i^*) = \mathrm{Radius}_{\tau_i - 1}(i)$ also holds according to Algorithm 1. Thus based on Lemma 6.1, + +$$ +\begin{array}{l} \tilde {H} _ {\tau_ {i} - 1} \left(i ^ {*}\right) - \tilde {H} _ {\tau_ {i} - 1} (i) \\ \geq H _ {\tau_ {i} - 1} \left(i ^ {*}\right) - H _ {\tau_ {i} - 1} (i) - \operatorname {R a d i u s} _ {\tau_ {i} - 1} \left(i ^ {*}\right) - \operatorname {R a d i u s} _ {\tau_ {i} - 1} (i) \\ = H _ {\tau_ {i} - 1} \left(i ^ {*}\right) - H _ {\tau_ {i} - 1} (i) - 2 \text {R a d i u s} _ {\tau_ {i} - 1} (i). \tag {10} \\ \end{array} +$$ + +Combining Eq.(9) and (10), we can obtain the first inequality in Lemma 6.6. Similar arguments hold at time $\tau - 1$ for arm $i \in A_{\tau - 1}$ to get the second inequality. + +Based on the above results, taking the expectation over the randomness of $I_{t}$ , we are able to bound the expected regret during the first $\tau$ rounds as follows. + +$$ +\begin{array}{l} \mathbb {E} \left[ \sum_ {t = 1} ^ {\tau} r _ {t} (i ^ {*}) - r _ {t} (I _ {t}) \right] \\ = \sum_ {t = 1} ^ {\tau} \left(r _ {t} \left(i ^ {*}\right) - \sum_ {i \in V} p _ {t} (i) r _ {t} (i)\right) \\ = \sum_ {t = 1} ^ {\tau} \left(r _ {t} \left(i ^ {*}\right) - \sum_ {i \in V} \left(1 - \gamma_ {t}\right) p _ {t, A} (i) r _ {t} (i)\right) \\ - \sum_ {i \in V} \gamma_ {t} p _ {t, D} (i) r _ {t} (i) \\ = \sum_ {t = 1} ^ {\tau} \gamma_ {t} \sum_ {i \in V} p _ {t, D} (i) \left(r _ {t} \left(i ^ {*}\right) - r _ {t} (i)\right) \\ + \sum_ {t = 1} ^ {\tau} (1 - \gamma_ {t}) \sum_ {i \in V} p _ {t, A} (i) \left(r _ {t} \left(i ^ {*}\right) - r _ {t} (i)\right) \\ \end{array} +$$ + +$$ +\begin{array}{l} \leq \sum_ {t = 1} ^ {\tau} \gamma_ {t} + \sum_ {t = 1} ^ {\tau} \sum_ {i \in V} p _ {t, A} (i) \left(r _ {t} \left(i ^ {*}\right) - r _ {t} (i)\right) \\ \leq \sum_ {t = 1} ^ {\tau} \gamma_ {t} + \sum_ {i \in V} \sum_ {t = 1} ^ {\min \left\{\tau_ {i}, \tau \right\}} \left(r _ {t} \left(i ^ {*}\right) - r _ {t} (i)\right) (11) \\ \leq \sum_ {t = 1} ^ {\tau} \gamma_ {t} + \sum_ {i \in V} \left(\mathbb {1} \{i \notin A _ {\tau} \} \cdot \tau_ {i} \left(H _ {\tau_ {i}} (i ^ {*}) - H _ {\tau_ {i}} (i)\right) \right. \\ + \mathbb {1} \left\{i \in A _ {\tau} \right\} \cdot \tau \left(H _ {\tau} \left(i ^ {*}\right) - H _ {\tau} (i)\right)) \\ \leq \sum_ {t = 1} ^ {\tau} \gamma_ {t} + O \left(\sqrt {K ^ {2} | D | \sum_ {t = 1} ^ {\tau} \frac {1}{\gamma_ {t}} \log \frac {T}{\delta}}\right) (12) \\ \leq O \left(K ^ {2 / 3} | D | ^ {1 / 3} \tau^ {2 / 3} \sqrt {\log \frac {T}{\delta}}\right), (13) \\ \end{array} +$$ + +where Eq.(11) holds according to Algorithm 1, Eq.(12) comes from Lemma 6.6 and the exact value of $\mathrm{Radius}_t(i)$ for $t = \tau_i - 1, \tau - 1$ . The last inequality holds by replacing $\gamma_t$ with $K^{2/3}|D|^{1/3}t^{-1/3}$ . + +We can divide the total horizon into two phases and bound the cumulative expected regret over $T$ rounds by $\mathbb{E}\left[Reg(T)\right] \leq \mathbb{E}\left[\sum_{t=1}^{\tau} r_t(i^*) - r_t(I_t)\right] + \mathbb{E}\left[\max_{i \in V} \sum_{t=\tau+1}^{T} r_t(i) - r_t(I_t)\right]$ . The regret in the first phase is upper bounded by Eq.(13). For the second phase, as shown in Alon et al. (2015, Theorem 2), the regret is of order $O\left((|D| \log K)^{1/3} T^{2/3}\right)$ . Above all, the regret upper bound in Theorem 5.1 is obtained. + +# 6.3. Technical Lemma + +Lemma 6.7 (Lemma 4.4 in Bubeck & Slivkins (2012)). Let $\mathcal{F}_1 \subseteq \mathcal{F}_2 \cdots \mathcal{F}_n$ be filtrations, and $X_1, X_2, \dots, X_n$ be real random variables such that $X_t$ is $\mathcal{F}_t$ measurable, $\mathbb{E}[X_t \mid \mathcal{F}_t] = 0$ and $|X_t| \leq b$ for some $b > 0$ . Denote $V_n = \sum_{t=1}^n \mathbb{E}[X_t^2 \mid \mathcal{F}_{t-1}]$ and $\delta > 0$ . Then with probability at least $1 - \delta$ , + +$$ +\sum_ {t = 1} ^ {n} X _ {t} \leq \sqrt {4 V _ {n} \log {\frac {n}{\delta}} + 5 b ^ {2} \log^ {2} {\frac {n}{\delta}}}. +$$ + +# 7. Conclusion + +In this paper, we propose the first algorithm for online learning with general graph feedback that achieves near-optimal regret in both stochastic and adversarial settings. Compared with previous BoBW works, we face a more challenging problem where only partial observations are available. To simultaneously preserve the minimax-optimality of $O(T^{2/3})$ in a much harder adversarial setting and the instance-optimality in the stochastic setting, we introduce a new trade-off mechanism between exploration and exploitation with carefully designed proportions. Without knowing + +the environment type in advance, the regret upper bound of our proposed algorithm matches the near-optimal results in both settings only up to some logarithmic and constant factors. + +Since the current upper bound in the adversarial setting is on the expected regret, one of the possible directions is to derive a high-probability pseudo regret bound as Bubeck & Slivkins (2012). It is more difficult as the pseudo regret in this problem with general graph feedback can only be decomposed into unobservable quantities, and similar techniques in Bubeck & Slivkins (2012) could not be adopted. The other interesting future direction is to investigate possible regularizers for OMD-type algorithms as Zimmert & Seldin (2019); Erez & Koren (2021), which are hoped to achieve tighter regret bounds in both settings. + +# Acknowledgement + +The corresponding author Shuai Li is supported by National Natural Science Foundation of China (62006151, 62076161). This work is sponsored by Shanghai Sailing Program. + +# References + +Alon, N., Cesa-Bianchi, N., Dekel, O., and Koren, T. Online learning with feedback graphs: Beyond bandits. In Conference on Learning Theory, pp. 23-35. PMLR, 2015. +Auer, P. and Chiang, C.-K. An algorithm with nearly optimal pseudo-regret for both stochastic and adversarial bandits. In Conference on Learning Theory, pp. 116-120. PMLR, 2016. +Auer, P., Cesa-Bianchi, N., and Fischer, P. Finite-time analysis of the multiarmed bandit problem. Machine learning, 47(2):235-256, 2002a. +Auer, P., Cesa-Bianchi, N., Freund, Y., and Schapire, R. E. The nonstochastic multiarmed bandit problem. SIAM journal on computing, 32(1):48-77, 2002b. +Bubeck, S. and Slivkins, A. The best of both worlds: Stochastic and adversarial bandits. In Conference on Learning Theory, pp. 42-1. JMLR Workshop and Conference Proceedings, 2012. +Buccapatnam, S., Eryilmaz, A., and Shroff, N. B. Stochastic bandits with side observations on networks. In *The 2014 ACM international conference on Measurement and modeling of computer systems*, pp. 289–300, 2014. +Cesa-Bianchi, N. and Lugosi, G. Prediction, learning, and games. Cambridge university press, 2006. + +Chen, H., Huang, Z., Li, S., and Zhang, C. Understanding bandits with graph feedback. In Advances in Neural Information Processing Systems, 2021. +Cohen, A., Hazan, T., and Koren, T. Online learning with feedback graphs without the graphs. In International Conference on Machine Learning, pp. 811-819. PMLR, 2016. +Eban, E., Birnbaum, A., Shalev-Shwartz, S., and Globerson, A. Learning the experts for online sequence prediction. In International Conference on Machine Learning, pp. 259-266, 2012. +Erez, L. and Koren, T. Towards best-of-all-worlds online learning with feedback graphs. In Advances in Neural Information Processing Systems, volume 34, 2021. +Kocák, T., Neu, G., Valko, M., and Munos, R. Efficient learning by implicit exploration in bandit problems with side observations. In Advances in Neural Information Processing Systems, pp. 613-621, 2014. +Lai, T. L. and Robbins, H. Asymptotically efficient adaptive allocation rules. Advances in applied mathematics, 6(1): 4-22, 1985. +Lattimore, T. and Szepesvári, C. Bandit algorithms. Cambridge University Press, 2020. +Lee, C.-W., Luo, H., Wei, C.-Y., Zhang, M., and Zhang, X. Achieving near instance-optimality and minimax-optimality in stochastic and adversarial linear bandits simultaneously. In International Conference on Machine Learning, 2021. +Li, S., Chen, W., Wen, Z., and Leung, K.-S. Stochastic online learning with probabilistic graph feedback. In Proceedings of the AAAI Conference on Artificial Intelligence, pp. 4675-4682, 2020. +Lu, S., Wang, G., and Zhang, L. Stochastic graphical bandits with adversarial corruptions. In Proceedings of the 35th AAAI Conference on Artificial Intelligence (AAAI), to appear, 2021. +Mannor, S. and Shamir, O. From bandits to experts: On the value of side-observations. In Advances in Neural Information Processing Systems, volume 24, pp. 684-692, 2011. +Seldin, Y. and Lugosi, G. An improved parametrization and analysis of the $\exp 3++$ algorithm for stochastic and adversarial bandits. In Conference on Learning Theory, pp. 1743-1759. PMLR, 2017. +Seldin, Y. and Slivkins, A. One practical algorithm for both stochastic and adversarial bandits. In International Conference on Machine Learning, pp. 1287-1295. PMLR, 2014. + +Thompson, W. R. On the likelihood that one unknown probability exceeds another in view of the evidence of two samples. Biometrika, 25(3/4):285-294, 1933. +Tossou, A. C., Dimitrakakis, C., and Dubhashi, D. Thompson sampling for stochastic bandits with graph feedback. In Proceedings of the AAAI Conference on Artificial Intelligence, 2017. +Wu, Y., György, A., and Szepesvári, C. Online learning with gaussian payoffs and side observations. In Advances in Neural Information Processing Systems, pp. 1360-1368, 2015. +Zimmert, J. and Seldin, Y. An optimal algorithm for stochastic and adversarial bandits. In International Conference on Artificial Intelligence and Statistics, pp. 467-475. PMLR, 2019. \ No newline at end of file diff --git a/simultaneouslylearningstochasticandadversarialbanditswithgeneralgraphfeedback/images.zip b/simultaneouslylearningstochasticandadversarialbanditswithgeneralgraphfeedback/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..c95e0ad53498815da6216a74b361984db25936e9 --- /dev/null +++ b/simultaneouslylearningstochasticandadversarialbanditswithgeneralgraphfeedback/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dc59be66dc5580c4540d86bb7f73753672074695b726eef7985cc65e46af2fb7 +size 460652 diff --git a/simultaneouslylearningstochasticandadversarialbanditswithgeneralgraphfeedback/layout.json b/simultaneouslylearningstochasticandadversarialbanditswithgeneralgraphfeedback/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..feac3d0f5d22b4e16ac7678dded97652976a7ca7 --- /dev/null +++ b/simultaneouslylearningstochasticandadversarialbanditswithgeneralgraphfeedback/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ecc8c8ce938e541528de568af8627751bcfcc5c87000a28ef8545301cf6149f9 +size 595935 diff --git a/sketchingalgorithmsandlowerboundsforridgeregression/3f85df57-e6ba-4386-b3fc-f0fbb752030e_content_list.json b/sketchingalgorithmsandlowerboundsforridgeregression/3f85df57-e6ba-4386-b3fc-f0fbb752030e_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..b094a5b66a9a33d1fe9b80b6468dd6f8a2044b31 --- /dev/null +++ b/sketchingalgorithmsandlowerboundsforridgeregression/3f85df57-e6ba-4386-b3fc-f0fbb752030e_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:38a30248e719f4aaf1e286106642d83420fbaea1b41014d491996f41ee5527ce +size 171037 diff --git a/sketchingalgorithmsandlowerboundsforridgeregression/3f85df57-e6ba-4386-b3fc-f0fbb752030e_model.json b/sketchingalgorithmsandlowerboundsforridgeregression/3f85df57-e6ba-4386-b3fc-f0fbb752030e_model.json new file mode 100644 index 0000000000000000000000000000000000000000..758868d9e42bccf6b8218058b7af7f5fba86cce4 --- /dev/null +++ b/sketchingalgorithmsandlowerboundsforridgeregression/3f85df57-e6ba-4386-b3fc-f0fbb752030e_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d98b504d9c60eb80fb8e0a095c0c8ce13bb607bfdc18a00f58f5a5e0dc470706 +size 194241 diff --git a/sketchingalgorithmsandlowerboundsforridgeregression/3f85df57-e6ba-4386-b3fc-f0fbb752030e_origin.pdf b/sketchingalgorithmsandlowerboundsforridgeregression/3f85df57-e6ba-4386-b3fc-f0fbb752030e_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..749c869cac13913cc8ffc9f5b1e2400821706286 --- /dev/null +++ b/sketchingalgorithmsandlowerboundsforridgeregression/3f85df57-e6ba-4386-b3fc-f0fbb752030e_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6ac8427d331bd9849b75996c2e82bbabbcba371bbdc2c2cb57db9584179e23e7 +size 570475 diff --git a/sketchingalgorithmsandlowerboundsforridgeregression/full.md b/sketchingalgorithmsandlowerboundsforridgeregression/full.md new file mode 100644 index 0000000000000000000000000000000000000000..f07ce36c1c30218986a380b5065599e37bbfdbe6 --- /dev/null +++ b/sketchingalgorithmsandlowerboundsforridgeregression/full.md @@ -0,0 +1,891 @@ +# Sketching Algorithms and Lower Bounds for Ridge Regression + +Praneeth Kacham1 David P. Woodruff1 + +# Abstract + +We give a sketching-based iterative algorithm that computes a $1 + \varepsilon$ approximate solution for the ridge regression problem $\min_x\| Ax - b\| _2^2 +$ $\lambda \| x\| _2^2$ where $A\in \mathbb{R}^{n\times d}$ with $d\geq n$ . Our algorithm, for a constant number of iterations (requiring a constant number of passes over the input), improves upon earlier work (Chowdhury et al., 2018) by requiring that the sketching matrix only has a weaker Approximate Matrix Multiplication (AMM) guarantee that depends on $\varepsilon$ , along with a constant subspace embedding guarantee. The earlier work instead requires that the sketching matrix has a subspace embedding guarantee that depends on $\varepsilon$ . For example, to produce a $1 + \varepsilon$ approximate solution in 1 iteration, which requires 2 passes over the input, our algorithm requires the OSNAP embedding to have $m = O(n\sigma^2 /\lambda \varepsilon)$ rows with a sparsity parameter $s = O(\log (n))$ , whereas the earlier algorithm of Chowdhury et al. (2018) with the same number of rows of OSNAP requires a sparsity $s = O(\sqrt{\sigma^2 / \lambda\varepsilon}\cdot \log (n))$ , where $\sigma = \| A\| _2$ is the spectral norm of the matrix $A$ . We also show that this algorithm can be used to give faster algorithms for kernel ridge regression. Finally, we show that the sketch size required for our algorithm is essentially optimal for a natural framework of algorithms for ridge regression by proving lower bounds on oblivious sketching matrices for AMM. The sketch size lower bounds for AMM may be of independent interest. + +1Computer Science Department, Carnegie Mellon University. Correspondence to: Praneeth Kacham , David P. Woodruff . + +Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s). + +# 1. Introduction + +Given a matrix $A \in \mathbb{R}^{n \times d}$ , a vector $b \in \mathbb{R}^n$ , and a parameter $\lambda \geq 0$ , the ridge regression problem is defined as: + +$$ +\min _ {x} \| A x - b \| _ {2} ^ {2} + \lambda \| x \| _ {2} ^ {2}. +$$ + +Throughout the paper, we assume $n \leq d$ , and that $x^{*}$ is the optimal solution for the problem. Let Opt be the optimal value for the above problem. Earlier work (Chowdhury et al., 2018) gives an iterative algorithm using so-called subspace embeddings. The following theorem states their results when their algorithm is run for 1 iteration. Note that their algorithm is more general and when run for $t$ iterations, the error is proportional to $\varepsilon^t$ . + +Theorem 1.1 (Theorem 1 of Chowdhury et al. (2018)). Given $A \in \mathbb{R}^{n \times d}$ , let $V \in \mathbb{R}^{d \times n}$ be an orthonormal basis for the rowspace of matrix $A$ . If $S \in \mathbb{R}^{m \times d}$ is a matrix which satisfies + +$$ +\left\| V ^ {\mathsf {T}} S ^ {\mathsf {T}} S V - I _ {n} \right\| _ {2} \leq \varepsilon / 2, \tag {1} +$$ + +then $\tilde{x} = A^{\mathsf{T}}(AS^{\mathsf{T}}SA^{\mathsf{T}} + \lambda I_n)^{-1}b$ satisfies + +$$ +\| \tilde {x} - x ^ {*} \| _ {2} \leq \varepsilon \| x ^ {*} \| _ {2}. +$$ + +A matrix $S$ which satisfies (1) is called an $\varepsilon / 2$ subspace embedding for the column space of $V$ , since for any $y$ in $\operatorname{colspan}(V)$ , we have $(1 - \varepsilon / 2)\|y\|_2^2 \leq \|Sy\|_2^2 \leq (1 + \varepsilon / 2)\|y\|_2^2$ . We also frequently drop the term "column space" and say $S$ is an $\varepsilon / 2$ subspace embedding for the matrix $V$ itself. + +There are many oblivious and non-oblivious constructions of subspace embeddings. As the name suggests, oblivious subspace embedding (OSE) constructions do not depend on the matrix $V$ that is to be embedded. OSEs specify a distribution $S$ such that for any arbitrary matrix $V$ , a random matrix $S$ drawn from the distribution $S$ is an $\varepsilon$ subspace embedding for $V$ with probability $\geq 1 - \delta$ . On the other hand, non-oblivious constructions compute a distribution $S$ that depends on the matrix $V$ that is to be embedded. See the survey by Woodruff (2014) for an overview. + +In many cases, such as in streaming, it is important that the sketch used is oblivious, since matrix-dependent subspace embedding constructions may need to read the entire input + +matrix first. Oblivious sketches also allow turnstile updates to the matrix $A$ in a stream. In the turnstile model of streaming, we receive updates of the form $((i,j),v)$ which update $A_{i,j}$ to $A_{i,j} + v$ . In our paper we focus on algorithms for ridge regression that use oblivious sketching matrices. + +To satisfy (1), using CountSketch (Clarkson & Woodruff, 2017; Meng & Mahoney, 2013), we can obtain a sketching dimension of $m = O(n^{2} / \varepsilon^{2})$ for which the matrix $SA^{\mathsf{T}}$ can be computed in $O(\mathrm{nnz}(A))$ time, where $\mathrm{nnz}(A)$ denotes the number of nonzero entries in the matrix $A$ . Using OSNAP embeddings (Nelson & Nguyen, 2013; Cohen, 2016), we can obtain a sketching dimension of $m = O(n^{1 + \gamma}\log (n) / \varepsilon^2)$ for which the matrix $SA^{\mathsf{T}}$ can be computed in time $O(\mathrm{nnz}(A) / \gamma \varepsilon)$ . For $\gamma = O(1 / \log (n))$ , we have $m = O(n\log (n) / \varepsilon^2)$ with $SA^{\mathsf{T}}$ that can be computed in time $O(\mathrm{nnz}(A)\log (n) / \varepsilon)$ . We can see that there is a tradeoff between CountSketch and OSNAP — one has a smaller sketching dimension while the other is faster to apply to a given matrix. If $t_{SA^{\mathsf{T}}}$ is the time required to compute $SA^{\mathsf{T}}$ , then $\tilde{x}$ in Theorem 1.1 can be computed in time $O(\mathrm{nnz}(A) + t_{SA^{\mathsf{T}}} + mn^{\omega -1} + n^{\omega})$ where $\omega$ is the matrix multiplication constant. Thus it is important to have both a small $t_{SA^{\mathsf{T}}}$ and small $m$ to obtain fast running times. + +When allowed $O(\log(1 / \varepsilon))$ passes over the input matrix $A$ , the algorithm of Chowdhury et al. (2018) produces an $\varepsilon$ relative error solution using only a constant, say 1/2 subspace embedding. When only $O(1)$ passes are allowed over the input, their algorithm requires a $\delta = f(\varepsilon)$ subspace embedding to obtain $\varepsilon$ error solutions. As seen above this leads to either a high value of $m$ or a high value of $t_{SA^{\intercal}}$ . + +We show that we only need a simpler Approximate Matrix Multiplication (AMM) guarantee, along with a constant subspace embedding, instead of requiring $S$ to be an $\varepsilon / 2$ subspace embedding. + +Definition 1.2 (AMM). Given matrices $A$ and $B$ of appropriate dimensions, a matrix $S$ satisfies the $\varepsilon$ -AMM property for $(A, B)$ if + +$$ +\| A ^ {\mathsf {T}} S ^ {\mathsf {T}} S B - A ^ {\mathsf {T}} B \| _ {\mathsf {F}} \leq \varepsilon \| A \| _ {\mathsf {F}} \| B \| _ {\mathsf {F}}. +$$ + +We now state the guarantees of our algorithm (Algorithm 1) for 1 iteration, requiring 2 passes over the matrix $A$ . + +Theorem 1.3. If $S$ is a random matrix such that for any fixed $d \times n$ orthonormal matrix $V$ and a vector $r$ , with probability $\geq 9/10$ , + +$$ +\left\| V ^ {\mathsf {T}} \mathbf {S} ^ {\mathsf {T}} \mathbf {S} V - I _ {n} \right\| _ {2} \leq 1 / 2 +$$ + +and + +$$ +\left\| V ^ {\mathsf {T}} \mathbf {S} ^ {\mathsf {T}} \mathbf {S} V r - r \right\| _ {2} \leq (\varepsilon / 2 \sqrt {n}) \| V \| _ {\mathbb {F}} \| V r \| _ {2} = (\varepsilon / 2) \| r \| _ {2}, \tag {2} +$$ + +then $\tilde{x} = A^{\mathsf{T}}(A\mathbf{S}^{\mathsf{T}}\mathbf{S}A^{\mathsf{T}} + \lambda I_n)^{-1}b$ satisfies $\| \tilde{x} -x^{*}\|_{2}\leq \varepsilon \| x^{*}\|_{2}$ with probability $\geq 9 / 10$ + +We show that the OSNAP distribution satisfies both of these two properties with a sketching dimension of $r = O(n\log (n) + n / \varepsilon^2)$ and with $SA^{\top}$ that can be computed in $O(\mathrm{nnz}(A)\cdot \log (n))$ time. Note that our algorithm (Algorithm 1) is also more general, and when run for $t$ iterations, the error is proportional to $\varepsilon^t$ . Our algorithm differs from that of Chowdhury et al. (2018) in that our algorithm needs a fresh sketching matrix in each iteration whereas their algorithm only needs one sketching matrix across iterations. + +Many natural problems in the streaming literature have been studied specifically with 2 passes (Chen et al., 2021; Konrad & Naidu, 2021; Assadi & Raz, 2020; Brody & Woodruff, 2011). Also in the case of federated learning, where minimizing the number of rounds of communication is important (Park et al., 2021), the smaller sketch sizes required by our algorithm (Algorithm 1) gives an improvement over the algorithm of Chowdhury et al. (2018). + +We can also bound the cost of $\tilde{x}$ computed by our algorithm. For any $x\in \mathbb{R}^d$ , let $\mathrm{cost}(x) = \| Ax - b\| _2^2 +\lambda \| x\| _2^2$ . Bounds on $\| \tilde{x} -x^{*}\|_{2}$ also let us obtain an upper bound on $\mathrm{cost}(\tilde{x})$ . It can be shown that for any vector $x$ , $\mathrm{cost}(\tilde{x}) = \mathrm{Opt} + \| A(x^{*} - \tilde{x})\|_{2}^{2} + \lambda \| x^{*} - \tilde{x}\|_{2}^{2}$ . Thus, $\| \tilde{x} -x^{*}\|_{2}\leq \varepsilon \| x^{*}\|_{2}$ implies that $\mathrm{cost}(\tilde{x}) = \mathrm{Opt} + (\sigma^2 +\lambda)\varepsilon^2\| x^*\| _2^2\leq (1+$ $(1 + \sigma^2 /\lambda)\varepsilon^2)\mathrm{Opt}$ . Throughout the paper, we are most interested in the case $\sigma^2\geq \lambda$ as it is when $\mathrm{cost}(\tilde{x})$ could be much higher than Opt. Setting $\varepsilon = O(\sqrt{\delta\lambda / \sigma^2})$ , we obtain that the solution $\tilde{x}$ returned by Theorem 1.3 is a $1 + \delta$ approximation. + +We also show that our algorithm can be used to obtain approximate solutions to Kernel Ridge Regression with a polynomial kernel. We show that instantiating the construction of Ahle et al. (2020) with appropriate sketching matrices gives a fast way to apply sketches, satisfying the subspace embedding and AMM properties, to the matrix $\phi(A)$ , where the $i$ -th row of the matrix $\phi(A)$ is given by $A_{i*}^{\otimes p}$ . + +# 1.1. Lower bounds for Ridge Regression + +It can be seen that the optimal solution $x^{*} = A^{\mathsf{T}}(AA^{\mathsf{T}} + \lambda I_{n})^{-1}b$ . Our algorithm, for one iteration, is simply to compute $\tilde{x} = A^{\mathsf{T}}(AS^{\mathsf{T}}SA^{\mathsf{T}} + \lambda I_{n})^{-1}b$ for a matrix $\mathbf{S}$ that satisfies the requirements in Theorem 1.3. All the algorithm does is substitute the expensive matrix product $AA^{\mathsf{T}}$ , which can take $O(n\cdot \mathrm{nnz}(A))$ time to compute, with the matrix product $AS^{\mathsf{T}}SA^{\mathsf{T}}$ , which only takes $t_{\mathbf{S}A^{\mathsf{T}}} + mn^{\omega -1}$ time to compute. Thus, constructing "good" distributions for which $\tilde{x}$ is a $1 + \varepsilon$ approximation seems to be the most natural way to obtain fast algorithms for ridge regression. As discussed previously, OSNAP matrices with $m = O(n\log (n) + n\sigma^2 /\lambda \varepsilon)$ and having near-optimal $t_{\mathbf{S}A^{\mathsf{T}}} = \tilde{O} (\mathrm{nnz}(A))$ can be used to compute a solution $\tilde{x}$ that is a $1 + \varepsilon$ approximation. We show that for a large class of nice-enough distributions over $m\times d$ matrices $S$ , if + +$\mathbf{S} \sim \mathcal{S}$ satisfies that $\tilde{x} = A^{\top}(A\mathbf{S}^{\top}\mathbf{S}A^{\top} + \lambda I)^{-1}b$ is a $1 + \varepsilon$ approximation with high probability, then $r = \Omega (n\sigma^2 /\lambda \varepsilon)$ . This shows that OSNAP matrices have both a near-optimal sketching dimension $r$ and near-optimal time $t_{\mathbf{S}A^{\top}}$ . We show the lower bound by showing that for any "nice" distribution $S$ for which $\tilde{x}$ is a $1 + \varepsilon$ approximation with high probability, the distribution must also satisfy an Approximate Matrix Multiplication (AMM) guarantee, i.e., for any matrix $B$ , for $\mathbf{S} \sim \mathcal{S}$ , $\| B^{\top}\mathbf{S}^{\top}\mathbf{S}B - B^{\top}B\|_{\mathbb{F}}$ must be small with high probability. We then show a lower bound on $m$ for any distribution $S$ which satisfies the AMM guarantee. Here we demonstrate our techniques in the simple case of $n = 1$ . Without loss of generality, we assume $\lambda = 1$ . + +Consider the ridge regression problem $\min_x(a^\top x - b)^2 + \|x\|_2^2$ , where $a$ is an arbitrary $d$ -dimensional vector. We have $\tilde{x} = a(a^\top \mathbf{S}^\top \mathbf{S}a + 1)^{-1}b$ and + +$$ +\operatorname {c o s t} (\tilde {x}) = \left(\frac {\| a \| _ {2} ^ {2} b}{\| \mathbf {S} a \| _ {2} ^ {2} + 1} - b\right) ^ {2} + \frac {\| a \| _ {2} ^ {2}}{(\| \mathbf {S} a \| _ {2} ^ {2} + 1) ^ {2}} b ^ {2} +$$ + +whereas $\mathrm{Opt} = b^{2} / (\|a\|_{2}^{2} + 1)$ . For $\|a\|_{2} \geq 100 / \sqrt{\varepsilon}$ , it turns out that unless $(1 - \sqrt{\varepsilon} / \|a\|_{2}) \|a\|_{2}^{2} \leq \|\mathbf{S}a\|_{2}^{2} \leq (1 + \sqrt{\varepsilon} / \|a\|_{2}) \|a\|_{2}^{2}$ , we will have $\mathrm{cost}(\tilde{x}) \geq (1 + \varepsilon / 2) \mathrm{Opt}$ . Thus for $\tilde{x}$ to be a $1 + \varepsilon / 2$ approximation with probability $\geq 99 / 100$ for any arbitrary $a$ , it must be the case that with probability $\geq 99 / 100$ , $|a^{\mathsf{T}}a - a^{\mathsf{T}}\mathbf{S}^{\mathsf{T}}\mathbf{S}a| = |\|a\|_{2}^{2} - \|\mathbf{S}a\|_{2}^{2}| \leq (\sqrt{\varepsilon} / \|a\|_{2}) \|a\|_{2}^{2}$ i.e., $\mathbf{S}$ must satisfy the AMM property with parameter $\sqrt{\varepsilon} / \|a\|_{2}$ . We show an $\Omega(1 / \delta^{2})$ lower bound for any distribution which satisfies the $\delta$ -AMM property, which gives a lower bound of $\Omega(\|a\|_{2}^{2} / \varepsilon)$ for ridge regression for $n = 1$ . + +For the case of general $n$ , we show that any "nice" distribution $S$ that gives $1 + \varepsilon$ approximate solutions for ridge regression must satisfy the $\sqrt{\varepsilon / n\sigma^2}$ -AMM guarantee, which by using the lower bound for AMM, gives an $\Omega (n\sigma^2 /\varepsilon)$ lower bound for ridge regression. + +To prove the lower bound, we crucially use the fact that the sketching distribution $\mathcal{S}$ must satisfy that $\tilde{x}$ is a $1 + \varepsilon$ approximation for any particular ridge regression problem instance $(A,b)$ with high probability. + +# 1.2. Lower bounds for AMM + +We prove the following lower bound for oblivious sketching matrices that give AMM guarantees. + +Theorem 1.4 (Informal). If $S$ is a distribution over $m \times d$ matrices such that for any $n \times d$ matrix $A$ , $S \sim S$ satisfies with probability $\geq 99/100$ , that + +$$ +\left\| A \mathbf {S} ^ {\top} \mathbf {S} A ^ {\top} - A A ^ {\top} \right\| _ {\mathsf {F}} \leq \delta \| A \| _ {\mathsf {F}} \| A ^ {\top} \| _ {\mathsf {F}}, +$$ + +for $\delta \leq c / \sqrt{n}$ , then $m = \Omega(1 / \delta^2)$ where $c > 0$ is a small enough universal constant. + +To the best of our knowledge, this is the first tight lower bound on the dimension of oblivious sketching matrices for AMM. The lower bound is tight up to constant factors as the CountSketch distribution with $m = O(1 / \delta^2)$ rows has the above property. Note that for $\delta = \varepsilon / n$ , the distribution $S$ as in the above theorem satisfies that for any $d \times n$ orthonormal matrix $V$ , with probability $\geq 99 / 100$ , + +$$ +\| V ^ {\mathsf {T}} \mathbf {S} ^ {\mathsf {T}} \mathbf {S} V - I _ {n} \| _ {\mathsf {F}} \leq (\varepsilon / n) \| V \| _ {\mathsf {F}} ^ {2} = \varepsilon . +$$ + +Thus, a distribution $S$ that has the $\varepsilon / n$ -AMM property also has the $\varepsilon$ -subspace embedding property. Nelson & Nguyen (2014) gives an $\Omega(n / \varepsilon^2)$ lower bound for such distributions, thus giving an $\Omega(1 / (\delta^2 n))$ lower bound for $\delta$ -AMM for small enough $\delta$ . The above theorem gives a stronger $\Omega(1 / \delta^2)$ lower bound. + +We now give a brief overview of our proof for $n = 1$ . Consider $a \in \mathbb{R}^d$ to be a fixed unit vector and let $\mathcal{S}$ be a distribution supported on $r \times d$ matrices as in the above theorem. Then we have $\operatorname*{Pr}_{\mathbf{S} \sim \mathcal{S}}[|a^\top \mathbf{S}^\top \mathbf{S}a - 1| \leq \delta] \geq 0.99$ . Let $U\Sigma V^\top$ be the singular value decomposition of $\mathbf{S}$ with $\Sigma \in \mathbb{R}^{r \times r}$ . Without loss of generality, we can assume that $V^\top$ is independent of $\Sigma$ and that $V^\top$ is a uniformly random orthonormal matrix. This follows from the fact that if $\mathbf{S}$ is an oblivious AMM sketch, then $\mathbf{SQ}$ is also an oblivious AMM sketch, where $\mathbf{Q}$ is a uniformly random $d \times d$ orthogonal matrix independent of $\mathbf{S}$ . Thus, we have $\operatorname*{Pr}_{\Sigma, V^\top}[|a^\top V\Sigma^2 V^\top a - 1| \leq \delta] \geq 0.99$ , where $\Sigma$ and $V^\top$ are random matrices that correspond to the AMM sketch $\mathbf{S}$ , as described. + +Jiang & Ma (2017) show that if $m = o(d)$ , then the total variation distance between $V^{\mathsf{T}}a$ and $(1 / \sqrt{d})\mathbf{g}$ is small, where $\mathbf{g}$ is an $m$ dimensional vector with independent Gaussian entries. Thus, we obtain that $\operatorname*{Pr}_{\Sigma ,\mathbf{g}}[|(1 / d)\mathbf{g}^{\mathsf{T}}\Sigma^{2}\mathbf{g} - 1|\leq \delta ] = \operatorname*{Pr}_{\Sigma ,\mathbf{g}}[|(1 / d)\sum_{i = 1}^{m}\sigma_{i}^{2}\mathbf{g}_{i}^{2} - 1|\leq \delta ]\geq 0.95.$ + +If $\sum_{i=1}^{m}\sigma_{i}^{2} \leq d/200$ , then $(1/d)\sum_{i=1}^{m}\sigma_{i}^{2}\mathbf{g}_{i}^{2} \leq 1/2$ with probability $\geq 0.99$ by Markov's inequality. So, $\operatorname{Pr}_{\Sigma}\left[\sum_{i=1}^{m}\sigma_{i}^{2} \leq d/200\right]$ must be small. On the other hand, $\operatorname{Var}\left((1/d)\sum_{i}\sigma_{i}^{2}\mathbf{g}_{i}^{2}\right) = (2/d^{2})\sum_{i=1}^{m}\sigma_{i}^{4}$ . Thus for $(1/d)\sum_{i=1}^{m}\sigma_{i}^{2}\mathbf{g}_{i}^{2}$ to concentrate in the interval $(1-\delta, 1+\delta)$ , we would expect $\sqrt{\operatorname{Var}\left((1/d)\sum_{i}\sigma_{i}^{2}\mathbf{g}_{i}^{2}\right)} \approx \delta$ , which implies $(2/d^{2})\sum_{i=1}^{m}\sigma_{i}^{4} \approx \delta^{2}$ . Thus, with a reasonable probability, it must be simultaneously true that $d/200 \leq \sum_{i=1}^{m}\sigma_{i}^{2}$ and $\sum_{i=1}^{m}\sigma_{i}^{4} \approx d^{2}\delta^{2}/2$ . Then, + +$$ +d ^ {2} / (2 0 0) ^ {2} \leq \left(\sum_ {i = 1} ^ {m} \sigma_ {i} ^ {2}\right) \leq m \sum_ {i = 1} ^ {m} \sigma_ {i} ^ {4} \approx m d ^ {2} \delta^ {2} / 2, +$$ + +thus obtaining $m \gtrsim \Omega(1/\delta^2)$ . We extend this proof idea to the general case of $n \geq 1$ . + +Non-asymptotic upper bounds on the total variation (TV) distance between Gaussian matrices and sub-matrices of random orthogonal matrices obtained in recent works (Jiang + +& Ma, 2017; Li & Woodruff, 2021) let us replace the matrices that are harder to analyze with Gaussian matrices in our proof of the lower bound for AMM. We believe this technique could be helpful in proving tight lower bounds for other types of sketching guarantees. + +# 1.3. Other Contributions + +We also show lower bounds on the communication complexity for approximating the optimal value of the ridge regression problem, which is a different, but related problem, to the computation of $1 + \varepsilon$ approximate solutions which is studied in this paper. We obtain an $\Omega(1/\varepsilon^2)$ bit lower bound for ridge regression when $\sigma^2/\lambda \approx 1$ . The hard instance is a two-party communication game on a $2 \times d$ matrix, for which one party has the first row and the other party has the second row. Surprisingly, if each party has $d/2$ columns of the design matrix $A = [A_1 A_2]$ , then they can compute the exact optimal value if the first party communicates $A_1 A_1^\top$ to the second party using $O(n^2)$ words of communication. This suggests that the turnstile streaming setting is harder than the column arrival setting for streaming algorithms for ridge regression. We stress that our algorithm to compute a $(1 + \varepsilon)$ -approximate solution to ridge regression works in the turnstile streaming setting by maintaining $\mathbf{SA}^\top$ in a stream. Nevertheless, to output the $d$ dimensional solution $\tilde{x}$ , our algorithm needs to compute one matrix-vector product with $A^\top$ at the end of the stream, necessitating a second pass over the stream. + +In contrast, we obtain $\Omega(d)$ bit communication complexity lower bounds for the Lasso and square-root Lasso objectives, even for computing $1 + c$ approximations to the optimum value for a small enough constant $c$ . Fast algorithms for these objectives seem to be harder to find and as the lower bounds indicate, there may not be sketching-based algorithms for these problems. + +We defer most of the proofs to the supplementary material. We also include an experiment there comparing the time required by our algorithm to the time required to compute the exact solution for ridge regression. + +# 2. Preliminaries + +For $n\in \mathbb{Z}$ $[n]$ denotes the set $\{1,\dots ,n\}$ .Given a matrix $A\in \mathbb{R}^{n\times d}$ , let $\mathrm{nnz}(A)$ denote the number of nonzero entries in $A$ . For the matrix $A$ $\| A\|_{\mathsf{F}}$ denotes the Frobenius norm $(\sum_{i,j}A_{i,j}^2)^{1 / 2}$ and $\| A\| _2$ denotes the spectral (operator) norm $\max_{x\neq 0}\| Ax\| _2 / \| x\| _2$ . When there is no ambiguity, throughout the paper we use $\sigma$ to denote $\| A\| _2$ Let $A = U\Sigma V^{\mathrm{T}}$ be the Singular Value Decomposition (SVD) with $U\in \mathbb{R}^{n\times \rho}$ $\Sigma \in \mathbb{R}^{\rho \times \rho}$ , and $V\in \mathbb{R}^{d\times \rho}$ , where $\rho = \mathrm{rank}(A)$ . For arbitrary matrices $M,N$ , the symbol $t_{MN}$ denotes the time required to compute the product $MN$ + +We use uppercase symbols $A, U, V, S, \ldots$ to denote matrices and lowercase symbols $a, b, u, v, \ldots$ to denote vectors. For a matrix $A$ , $A_{i*} \left( A_{*i} \right)$ denotes the $i$ -th row (column). We use boldface symbols $\mathbf{U}, \mathbf{V}, \mathbf{S}, \mathbf{r}, \ldots$ to stress that these objects are random and are explicitly sampled from an appropriate distribution. + +Definition 2.1 (Approximate Matrix Multiplication). Given an integer $d$ , we say that an $m \times d$ random matrix $\mathbf{S}$ has the $(\varepsilon, \delta)$ -AMM property if for any matrices $A$ and $B$ with $d$ rows, we have that + +$$ +\left\| A ^ {\mathsf {T}} \mathbf {S} ^ {\mathsf {T}} \mathbf {S} B - A ^ {\mathsf {T}} B \right\| _ {\mathsf {F}} \leq \varepsilon \| A \| _ {\mathsf {F}} \| B \| _ {\mathsf {F}}. +$$ + +with probability $\geq 1 - \delta$ over the randomness of $\mathbf{S}$ . + +We usually drop $\delta$ from the notation by picking it to be a small enough constant. + +Definition 2.2 (Oblivious Subspace Embeddings). Given an integer $d$ , an $m \times d$ random matrix $\mathbf{S}$ is an $(\varepsilon, \delta)$ -OSE for $n$ -dimensional subspaces if for any arbitrary $d \times n$ matrix $A$ , with probability $\geq 1 - \delta$ , simultaneously for all vectors $x$ , + +$$ +\| \mathbf {S} A x \| _ {2} ^ {2} \in (1 \pm \varepsilon) \| A x \| _ {2} ^ {2}. +$$ + +For both OSEs and distributions satisfying the $(\varepsilon, \delta)$ -AMM property, two major parameters of importance are the size of the sketch $(m)$ , and the time to compute $\mathbf{S}A(t_{\mathbf{S}A})$ . See Woodruff (2014) and the references therein for several OSE constructions and their corresponding parameters. + +# 3. Iterative Algorithm for Ridge Regression + +The following theorem describes the guarantees of the solution $\hat{x}$ returned by Algorithm 1. + +Theorem 3.1. If Algorithm 1 samples independent sketching matrices $\mathbf{S}_j \in \mathbb{R}^{m \times d}$ for all $j \in [t]$ satisfying the properties + +1. with probability $\geq 1 - 1 / (20t)$ , for all vectors $x$ , $\| \mathbf{S}_jA^\mathsf{T}x\| _2^2\in (1\pm 1 / 2)\| A^\mathsf{T}x\| _2^2$ , and +2. for all arbitrary matrices $M, N$ , with probability $\geq 1 - 1 / (20t)$ + +$$ +\| M ^ {\mathsf {T}} \mathbf {S} _ {j} ^ {\mathsf {T}} \mathbf {S} _ {j} N - M ^ {\mathsf {T}} N \| _ {\mathsf {F}} \leq \sqrt {\varepsilon / 4 n} \| M \| _ {\mathsf {F}} \| N \| _ {\mathsf {F}}, +$$ + +then with probability $\geq 9 / 10$ , $\| \hat{x} - x^{*}\|_{2} \leq (\sqrt{\varepsilon})^{t}\| x^{*}\|_{2}$ and further $\text{cost}(\hat{x}) \leq (1 + (\sigma^{2} / \lambda + 1)\varepsilon^{t})\text{Opt.}$ + +We prove a few lemmas which give intuition about the algorithm before proving the above theorem. + +After $i - 1$ iterations of the algorithm, $\sum_{j = 1}^{i - 1}\tilde{x}^{(j)}$ is the estimate for the optimum solution $x^{*}$ . At a high level, in the $i$ -th iteration, the algorithm is trying to compute an + +Algorithm 1 RIDGEREGRESSION +Input: $A\in \mathbb{R}^{n\times d},b\in \mathbb{R}^d,t\in \mathbb{Z},\varepsilon ,\lambda >0$ +Output: $\hat{x}\in \mathbb{R}^d$ $b^{(0)}\gets b,\tilde{x}^{(0)}\gets 0_d,y^{(0)}\gets 0_n$ +for $j = 1,\dots ,t$ do $b^{(j)}\gets b^{(j - 1)} - \lambda y^{(j - 1)} - A\tilde{x}^{(j - 1)}$ $\mathbf{S}_j\gets 1 / 2$ subspace embedding for the rowspace of $A$ and has the $\sqrt{\varepsilon / 4n}$ AMM property $y^{(j)}\gets (AS_j^\top S_jA^\top +\lambda I)^{-1}b^{(j)}$ $\tilde{x}^{(j)}\gets A^{\top}y^{(j)}$ +end for + $\hat{x}\gets \sum_{j = 1}^{t}\tilde{x}^{(j)}$ +return $\hat{x}$ + +approximation to the difference $x^{*} - \sum_{j=1}^{i-1} \tilde{x}_{j}$ by computing an approximate solution to the problem + +$$ +\min _ {x} \| A (x + \sum_ {j = 1} ^ {i - 1} \tilde {x} _ {j}) - b \| _ {2} ^ {2} + \lambda \| x + \sum_ {j = 1} ^ {i - 1} \tilde {x} _ {j} \| _ {2} ^ {2}. +$$ + +Let $x^{*(j)} = A^{\mathsf{T}}(AA^{\mathsf{T}} + \lambda I)^{-1}b^{(j)}$ . The following lemma shows that the solution to the above problem is $x^{*(i)}$ . + +Lemma 3.2. For all $i$ , $x^{*} = x^{*(i)} + \sum_{j=1}^{i-1} \tilde{x}^{(j)}$ . + +Proof. Let $f(x) = \| A(x + \sum_{j=1}^{i-1} \tilde{x}^{(j)}) - b \|_2^2 + \lambda \| x + \sum_{j=1}^{i-1} \tilde{x}^{(j)} \|_2^2$ and $z$ be the solution realizing $\min_x f(x)$ . We have $\nabla_x f(x) |_{x=z} = 0$ giving $z = (A^\mathsf{T}A + \lambda I)^{-1}(A^\mathsf{T}b - (A^\mathsf{T}A + \lambda I)\sum_{j=1}^{i-1} \tilde{x}^{(j)})$ . + +Noting that $\tilde{x}^{(j)} = A^{\mathsf{T}}y^{(j)}$ for all $j$ and that for all $i$ , $b^{(i)} = b - \lambda \sum_{j=1}^{i-1} y^{(j)} - \sum_{j=1}^{i-1} A \tilde{x}^{(j-1)}$ , we obtain that $z = (A^{\mathsf{T}}A + \lambda I)^{-1}A^{\mathsf{T}}b^{(i)}$ . Now using the matrix identity $(A^{\mathsf{T}}A + \lambda I)^{-1}A^{\mathsf{T}} = A^{\mathsf{T}}(AA^{\mathsf{T}} + \lambda I)^{-1}$ , we get $z = x^{*(i)}$ is the optimal solution to $\min_x f(x)$ . + +As $x^{*(i)}$ is the optimal solution, it is also clear that $x^* = x^{*(i)} + \sum_{j=1}^{i-1} \tilde{x}^{(j)}$ since otherwise $x^*$ is not the optimal solution for the original ridge regression problem, which is a contradiction. + +So by the end of the $(j - 1)$ -th iteration, the estimate to $x^{*}$ is off by $x^{*(j)}$ . The algorithm is approximating $x^{*(j)} = A^{\mathsf{T}}(AA^{\mathsf{T}} + \lambda I)^{-1}b^{*(j)}$ with $\tilde{x}^{(j)} = A^{\mathsf{T}}(AS_{j}^{\mathsf{T}}\mathbf{S}_{j}A^{\mathsf{T}} + \lambda I)^{-1}b^{*(j)}$ . The following lemma gives the error of this approximation assuming that the sketching matrix $\mathbf{S}_j$ has both the subspace embedding and AMM properties. This is the part where our proof differs from that of the proof of Chowdhury et al. (2018). + +Lemma 3.3. If $\mathbf{S}_j$ is drawn from a distribution such that for any fixed matrix $A^{\top}$ , $\mathbf{S}_j$ is a $1/2$ subspace embedding + +with probability $1 - \delta$ and for any fixed matrices $M, N$ , with probability $1 - \delta$ , + +$$ +\| M ^ {\mathsf {T}} \mathbf {S} _ {j} ^ {\mathsf {T}} \mathbf {S} _ {j} N - M ^ {\mathsf {T}} N \| _ {\mathsf {F}} \leq \sqrt {\varepsilon / n} \| M \| _ {\mathsf {F}} \| N \| _ {\mathsf {F}}, +$$ + +then with probability $\geq 1 - 2\delta$ , $\|x^{*(j)} - \tilde{x}^{(j)}\|_2 \leq (2\sqrt{\varepsilon}) \|x^{*(j)}\|_2$ . + +Proof. Let $A = U\Sigma V^{\mathsf{T}}$ be the singular value decomposition of $A$ . We have $x^{*(j)} = V\Sigma (I + \Sigma^2)^{-1}U^{\mathsf{T}}b^{(j)}$ . By using $(I + \Sigma^2)^{-1} = \Sigma^{-1}(I + \Sigma^{-2})^{-1}\Sigma^{-1}$ , we get $x^{*(j)} = V(I + \Sigma^{-2})^{-1}\Sigma^{-1}U^{\mathsf{T}}b^{(j)}$ . Let $v^{(j)} = (I + \Sigma^{-2})^{-1}\Sigma^{-1}U^{\mathsf{T}}b^{(j)}$ which gives $x^{*(j)} = Vv^{(j)}$ . + +Similarly, $\tilde{x}^{(j)} = V(V^{\mathsf{T}}\mathbf{S}_j^{\mathsf{T}}\mathbf{S}_jV + \Sigma^{-2})^{-1}\Sigma^{-1}U^{\mathsf{T}}b^{(j)}$ Writing $V^{\mathsf{T}}\mathbf{S}_j^{\mathsf{T}}\mathbf{S}_jV = I_n + E$ we have + +$$ +\begin{array}{l} \tilde {x} ^ {(j)} = V (I + \Sigma^ {- 2} + E) ^ {- 1} \Sigma^ {- 1} U ^ {\intercal} b ^ {(j)} \\ = V (I + (I + \Sigma^ {- 2}) ^ {- 1} E) ^ {- 1} (I + \Sigma^ {- 2}) ^ {- 1} \Sigma^ {- 1} U ^ {\mathsf {T}} b ^ {(j)} \\ = V (I + \left(I + \Sigma^ {- 2}\right) ^ {- 1} E) ^ {- 1} v ^ {(j)}. \\ \end{array} +$$ + +As $\| E\| _2\leq 1 / 2$ , the inverse $(I + (I + \Sigma^{-2})^{-1}E)^{-1}$ is well-defined. Since the matrix $V$ has orthonormal columns, $\| \tilde{x}^{(j)} - x^{*(j)}\| _2 = \| (I + (I + \Sigma^{-2})^{-1}E)^{-1}v^{(j)} - v^{(j)}\| _2.$ Let $(I + (I + \Sigma^{-2})^{-1}E)^{-1}v^{(j)} = v^{(j)} + \Delta$ and we have $v^{(j)} =$ $v^{(j)} + (I + \Sigma^{-2})^{-1}Ev^{(j)} + (I + (I + \Sigma^{-2})^{-1}E)\Delta$ which implies $(I + (I + \Sigma^{-2})^{-1}E)\Delta = -(I + \Sigma^{-2})^{-1}Ev^{(j)}$ Finally, + +$$ +\begin{array}{l} (1 / 2) \| \Delta \| _ {2} \leq \sigma_ {\min } (I + (I + \Sigma^ {- 2}) ^ {- 1} E) \| \Delta \| _ {2} \\ \leq \left\| \left(I + \left(I + \Sigma^ {- 2}\right) ^ {- 1} E\right) \Delta \right\| _ {2} \\ = \left\| \left(I + \Sigma^ {- 2}\right) ^ {- 1} E v ^ {(j)} \right\| _ {2} \leq \left\| E v ^ {(j)} \right\| _ {2}. \\ \end{array} +$$ + +which gives $\| x^{*(j)} - \tilde{x}^{(j)}\| _2 = \| V\Delta \| _2\leq 2\| Ev^{(j)}\| _2$ . If the matrix $\mathbf{S}_j$ has a $\sqrt{\varepsilon / n}$ -AMM property i.e., + +$$ +\begin{array}{l} \| V ^ {\mathsf {T}} \mathbf {S} _ {j} ^ {\mathsf {T}} \mathbf {S} _ {j} V v ^ {(j)} - V ^ {\mathsf {T}} V v ^ {(j)} \| _ {2} \leq \sqrt {\varepsilon / n} \| V \| _ {\mathsf {F}} \| v ^ {(j)} \| _ {2} \\ = \sqrt {\varepsilon} \| v ^ {(j)} \| _ {2}, \\ \end{array} +$$ + +we have $\| Ev^{(j)}\| _2\leq \sqrt{\varepsilon}\| Vv^{(j)}\| _2$ and that $\| x^{*(j)} - \tilde{x}^{(j)}\| _2\leq 2\sqrt{\varepsilon}\| v^{(j)}\| _2 = 2\sqrt{\varepsilon}\| x^{*(j)}\| _2.$ + +Proof of Theorem 3.1. By a union bound, with probability $\geq 9/10$ , in all $t$ iterations, we can assume that the matrices $\mathbf{S}_j$ have both the subspace embedding property for the column space of $A^{\mathsf{T}}$ , as well as the AMM property for $V$ and $v^{(j)}$ . + +From Lemma 3.2, $\| \hat{x} -x^{*}\|_{2} = \| \tilde{x}^{(t)} + \sum_{i = 1}^{t - 1}\tilde{x}^{(i)} - x^{*}\|_{2} =$ $\| \tilde{x}^{(t)} - x^{*(t)}\| _2\leq (\sqrt{\varepsilon})\| x^{*(t)}\| _2.$ We also have + +$$ +x ^ {*} = x ^ {* (j - 1)} + \sum_ {i = 1} ^ {j - 2} \tilde {x} ^ {(i)} = x ^ {* (j)} + \sum_ {i = 1} ^ {j - 1} \tilde {x} ^ {(i)} +$$ + +which implies $x^{*(j)} = x^{*(j-1)} - \tilde{x}^{(j-1)}$ and therefore, $\| x^{*(j)} \|_2 = \| \tilde{x}^{(j-1)} - x^{*(j-1)} \|_2 \leq \sqrt{\varepsilon} \| x^{*(j-1)} \|_2$ for all $j$ , where the last inequality follows from Lemma 3.3. Now noting that $x^{*(1)} = x^*$ , we obtain $\| \hat{x} - x^* \|_2 \leq (\sqrt{\varepsilon})^t \| x^* \|_2$ and using the Pythagorean theorem, + +$$ +\begin{array}{l} \operatorname {c o s t} (\hat {x}) \leq \operatorname {O p t} + \left(\sigma^ {2} + \lambda\right) \| \hat {x} - x ^ {*} \| _ {2} ^ {2} \\ \leq \operatorname {O p t} + (\sigma^ {2} + \lambda) \varepsilon^ {t} \| x ^ {*} \| _ {2} ^ {2}. \\ \end{array} +$$ + +As $\lambda \| x^{*}\|_{2}^{2}\leq \mathrm{Opt}$ , we obtain the result. + +![](images/b7d8274a604eeb063b449c81e05f8e62b6c234f4a642622d733d224937b9608b.jpg) + +We now show that the OSNAP distribution has both the properties required by Algorithm 1. + +# 3.1. Properties of OSNAP + +Nelson & Nguyen (2013) proposed OSNAP, an oblivious subspace embedding. OSNAP embeddings are parameterized by their number $m$ of rows and their sparsity $s$ . Essentially, OSNAP is a random $m \times d$ matrix $\mathbf{S}$ , with each column having exactly $s$ nonzero entries at random locations. Each nonzero entry is $\pm 1 / \sqrt{s}$ with probability $1 / 2$ each. They show that if the positions of the nonzero entries satisfy an "expectation" property and if the nonzero values are drawn from a $k$ -wise independent distribution for a sufficiently large $k$ , then $\mathbf{S}$ is an OSE. + +Theorem 3.4 (Informal, (Nelson & Nguyen, 2013)). If $m = O(n^{1 + \gamma}\mathrm{poly}(\log (n),1 / \varepsilon) / \varepsilon^2)$ and $s = O(1 / \gamma \varepsilon)$ , then OSNAP is an $\varepsilon$ -OSE for $n$ dimensional spaces. Further, $t_{\mathbf{S}A} = O(\mathrm{nnz}(A) / \gamma \varepsilon)$ for any $d\times n$ matrix $A$ . + +In the supplementary, we show that OSNAP with any sparsity parameter $s$ and $m = \Omega(1 / \varepsilon^2)$ has the $\varepsilon$ -AMM property. We state our result as the following lemma. + +Lemma 3.5. OSNAP with $m = \Omega (1 / \varepsilon^2\delta)$ and sparsity parameter $s\geq 1$ has the $(\varepsilon ,\delta)$ -AMM property. + +# 3.2. Running times : Embedding vs Current Work + +As discussed in the introduction, the algorithm of Chowdhury et al. (2018) is better than ours when $O(\log(1 / \varepsilon))$ passes over the matrix $A$ are allowed, as we require a fresh $1/2$ subspace embedding in each iteration and they require only one $1/2$ subspace embedding. However, our algorithm is faster when the algorithm is restricted to $t = O(1)$ passes over the input. We compare the running time of our algorithm with theirs when both algorithms are run only for 1 iteration to obtain $1 + \varepsilon$ approximate solutions. For ease of exposition, we consider the case when $\sigma^2 / \lambda = O(1)$ . + +From Theorem 1.1, the algorithm of Chowdhury et al. (2018) requires a $c\sqrt{\varepsilon}$ subspace embedding to output a $1 + \varepsilon$ approximation to ridge regression. By applying a sequence of CountSketch and OSNAP sketches, we can obtain a $c\sqrt{\varepsilon}$ embedding with $m = n\mathrm{poly}(\log (n)) / \varepsilon$ and + +$t_{SA^{\intercal}} = O(\mathrm{nnz}(A) + n^{3}\mathrm{poly}(\log (n)) / \sqrt{\varepsilon})$ or by directly applying OSNAP, we obtain $m = n\mathrm{poly}(\log (n)) / \varepsilon$ and $t_{SA^{\intercal}} = O(\mathrm{nnz}(A)\mathrm{poly}(\log (n)) / \sqrt{\varepsilon})$ + +From Theorem 3.1, our algorithm needs a random matrix that has the $1/2$ subspace embedding property and the $c\sqrt{\varepsilon/n}$ -AMM property to compute a $1 + \varepsilon$ approximation. OSNAP with $m = O(n / \varepsilon + n \mathrm{poly}(\log(n)))$ and $s = O(\mathrm{poly}(\log(n)))$ has this property giving $t_{SA^{\intercal}} = O(\mathrm{nnz}(A) \mathrm{poly}(\log(n)))$ . + +Finally, the total time to compute $\tilde{x}$ is + +$$ +O \left(t _ {S A ^ {\intercal}} + m n ^ {\omega - 1} + n ^ {\omega}\right), +$$ + +where $\omega < 3$ denotes the matrix multiplication exponent. For the algorithm of Chowdhury et al. (2018), depending on the sketching matrices used as described above, the total running time is either + +$$ +O (\mathrm {n n z} (A) + n ^ {3} \operatorname {p o l y} (\log (n)) / \sqrt {\varepsilon} + n ^ {\omega} \operatorname {p o l y} (\log (n)) / \varepsilon) +$$ + +or + +$$ +O (\mathrm {n n z} (A) \operatorname {p o l y} (\log (n)) / \sqrt {\varepsilon} + n ^ {\omega} \operatorname {p o l y} (\log (n)) / \varepsilon). +$$ + +For Algorithm 1 with $t = 1$ , the total running time is $O(\mathrm{nnz}(A)\mathrm{poly}(\log (n)) + n^{\omega}\mathrm{poly}(\log (n)) / \varepsilon)$ . Thus we have that when $\mathrm{nnz}(A)\approx n^{\omega} / \varepsilon$ , our algorithm is asymptotically faster than their algorithm, as our running time does not have the $n^3$ term and $\mathrm{nnz}(A) / \sqrt{\varepsilon}$ terms. We note that although the fastest matrix multiplication algorithms are sometimes considered impractical, Strassen's algorithm is already practical for reasonable values of $n$ , and gives $\omega < \log_27$ . If we consider the algorithm of Chowdhury et al. (2018) using just the OSNAP embedding, our algorithm is faster by a factor of $1 / \sqrt{\varepsilon}$ , which could be substantial when $\varepsilon$ is small. + +Even non-asymptotically, our result shows that we can replace the sketching matrix in their algorithm with a sketching matrix that is both sparser and has fewer rows, while still obtaining a $1 + \varepsilon$ approximation. Both of these properties help the algorithm to run faster. + +# 4. Applications to Kernel Ridge Regression + +A function $k: X \times X \to \mathbb{R}$ is called a positive semi-definite kernel if it satisfies the following two conditions: (i) For all $x, y \in X$ , $k(x, y) = k(y, x)$ , and (ii) for any finite set $S = \{s_1, \ldots, s_t\} \subseteq X$ , the matrix $K = [k(s_i, s_j)]_{i,j \in [t]}$ is positive semi-definite. Mercer's theorem states that a function $k(\cdot, \cdot)$ is a positive semi-definite kernel as defined above if and only if there exists a function $\phi$ such that for all $x, y \in X$ , $k(x, y) = \phi(x)^{\top} \phi(y)$ . Many machine learning algorithms only work with inner products of the data points and therefore all such algorithms can work using + +the function $k$ directly instead of the explicit mapping $\phi$ , which in principle could even be infinite dimensional, for example, as in the case of the Gaussian kernel. + +Let the rows of a matrix $A$ be the input data points $a_1, \ldots, a_n$ , and let $\phi(A)$ denote the matrix obtained by applying the function $\phi$ to each row of the matrix $A$ . The kernel ridge regression problem (see Murphy (2012) for more details) is defined as + +$$ +c ^ {*} = \underset {c} {\arg \min } \| \phi (A) \cdot c - b \| _ {2} ^ {2} + \lambda \| c \| _ {2} ^ {2}. +$$ + +We have that $c^{*} = \phi (A)^{\mathsf{T}}(\phi (A)\cdot \phi (A)^{\mathsf{T}} + \lambda I)^{-1}b$ and the value predicted for an input $x$ is given by $\phi (x)^{\mathsf{T}}c^{*} = \phi (x)^{\mathsf{T}}\phi (A)^{\mathsf{T}}(\phi (A)\cdot \phi (A)^{\mathsf{T}} + \lambda I)^{-1}b.$ Letting $\beta = (\phi (A)\phi (A)^{\mathsf{T}} + \lambda I)^{-1}b$ we have $\phi (x)^{\mathsf{T}}c^{*} = \sum_{i}k(a_{i},x)\beta_{i}.$ Now, note that the $(i,j)$ -th entry of the matrix $K \coloneqq \phi (A)\cdot \phi (A)^{\mathsf{T}}$ is given by $k(a_{i},a_{j})$ and therefore, to solve the kernel ridge regression problem, we do not need the explicit map $\phi (\cdot)$ and can work directly with the kernel function. Nevertheless, to construct the matrix $K$ , we need to query the kernel function $k$ for $\Theta (n^2)$ pairs of inputs, which may be prohibitive if the kernel evaluation is slow. + +Our result for ridge regression shows that if $\mathbf{S}$ is a $1/2$ subspace embedding and gives a $\varepsilon/2\sqrt{n}$ AMM guarantee, then + +$$ +\tilde {c} = \phi (A) ^ {\mathsf {T}} \cdot (\phi (A) \cdot \mathbf {S} ^ {\mathsf {T}} \mathbf {S} \cdot \phi (A) ^ {\mathsf {T}} + \lambda I) ^ {- 1} b +$$ + +satisfies $\| \tilde{c} - c^* \| \leq \varepsilon \| c^* \|_2$ and if $\tilde{\beta} \coloneqq (\phi^\mathsf{T}(A) \cdot \mathbf{S}^\mathsf{T}\mathbf{S} \cdot \phi(A)^\mathsf{T} + \lambda I)^{-1}b$ , then for a new input $x$ , the prediction on $x$ can be computed as $\sum_{i} k(a_i, x) \tilde{\beta}_i$ . For polynomial kernels, $k(x, y) = \langle x, y \rangle^p$ , given the matrix $A$ , it is possible to compute $\mathbf{S} \cdot \phi(A)^\mathsf{T}$ for a random matrix $\mathbf{S}$ that satisfies both the subspace embedding property and the AMM property, and hence obtain $\tilde{\beta}$ without computing the kernel matrix. The next theorem follows from the proofs of Theorems 1 and 3 of Ahle et al. (2020). + +Theorem 4.1. For all positive integers $n, d, p$ , there exists a distribution on linear sketches $\Pi^p \in \mathbb{R}^{m \times d^p}$ parameterized by sparsity $s$ such that: if $m = \Omega(p / \varepsilon^2)$ and any sparsity $s$ , then $\Pi^p$ has the $\varepsilon$ -AMM property, while if $m = \tilde{\Omega}(p^4 n / \varepsilon^2)$ and $s = \tilde{\Omega}((p^4 / \varepsilon^2) \text{poly}(\log(nd / \varepsilon)))$ , then $\Pi^p$ has the $\varepsilon$ subspace embedding property. Further, given any matrix $A \in \mathbb{R}^{n \times d}$ , the matrix $\Pi^p \cdot \phi(A)^\top$ for $\phi(x) = x^{\otimes p}$ can be computed in $\tilde{O}(pnm + ps \cdot \text{nnz}(A))$ time. + +We show that the construction of Ahle et al. (2020) gives the above theorem when $S_{\mathrm{base}}$ is taken to be TensorSketch and $T_{\mathrm{base}}$ is taken to be OSNAP. To prove the theorem, we first prove a lemma which shows that the OSNAP distribution has the JL-moment property. For a random variable $\mathbf{X}$ , let $\| \mathbf{X}\|_{L^t} \coloneqq (\mathbb{E}[|\mathbf{X}|^t])^{1 / t}$ . + +Definition 4.2 (JL-Moment Property). For every positive integer $t$ and parameters $\varepsilon, \delta \geq 0$ , we say a random matrix + +$\mathbf{S} \in \mathbb{R}^{m \times d}$ satisfies the $(\varepsilon, \delta, t)$ -JL moment property if for any $x \in \mathbb{R}^d$ with $\|x\|_2 = 1$ , + +$$ +\left\| \left\| \mathbf {S} x \right\| _ {2} ^ {2} - 1 \right\| _ {L ^ {t}} \leq \varepsilon \delta^ {1 / t} \text {a n d} \mathbb {E} [ \| \mathbf {S} x \| _ {2} ^ {2} ] = 1. +$$ + +Lemma 4.3. If $\mathbf{S}$ is an OSNAP matrix with $m = \Omega(1/\delta \varepsilon^2)$ rows and any sparsity parameter $s \geq 1$ , then $\mathbf{S}$ has the $(\varepsilon, \delta, 2)$ -JL moment property. + +Proof of Theorem 4.1. Let $q = 2^{\lceil \log_2(p) \rceil}$ . The construction of the sketch for polynomial kernels of Ahle et al. (2020) uses two distributions of matrices $S_{\mathrm{base}}$ and $T_{\mathrm{base}}$ . The proof of Theorem 1 of Ahle et al. (2020) requires that the distributions $S_{\mathrm{base}}$ and $T_{\mathrm{base}}$ have the $(\varepsilon / \sqrt{4q + 2}, \delta, 2)$ -JL moment property. We take $S_{\mathrm{base}}$ to be TensorSketch and $T_{\mathrm{base}}$ to be OSNAP. As Lemma 4.3 shows, OSNAP with $m = \Omega(q / \delta \varepsilon^2)$ and any sparsity $s$ has the $(\varepsilon / \sqrt{4q + 2}, \delta, 2)$ -JL moment property. + +From Theorem 3 of Ahle et al. (2020), we also have that for $m = \tilde{\Omega}(p^4 n / \varepsilon^2)$ and sparsity parameter $s = \tilde{\Omega}((p^4 / \varepsilon^2) \cdot \mathrm{poly}(\log(nd / \varepsilon)))$ , the sketch has the $\varepsilon$ -subspace embedding property. The running time of applying the sketch to $\phi(A)^{\mathsf{T}}$ also follows from the same theorem. + +Thus for the sketch to have both the $1/2$ subspace embedding property and the $\varepsilon/\sqrt{4n}$ AMM property, we need to take $m = \tilde{\Omega}(p^4 n + pn/\varepsilon^2)$ and $s = \tilde{\Omega}(p^4\mathrm{poly}(\log(nd)))$ . The time to compute $\Pi^p \cdot \phi(A)^\top$ is $\tilde{O}(p^5\mathrm{nnz}(A) + p^5n^2 + p^2n/\varepsilon^2)$ and the time to compute $\tilde{\beta}$ is $\tilde{O}(p^5\mathrm{nnz}(A) + p^5n^2 + p^2n^2/\varepsilon^2 + p^4n^\omega + pn^\omega/\varepsilon^2)$ , thereby obtaining a near-input sparsity time algorithm for polynomial kernel ridge regression. + +# 5. Lower bounds + +Dimensionality reduction, by multiplying the input matrix $A$ on the right with a random sketching matrix, seems to be the most natural way to speed up ridge regression. Recall that in our algorithm above, we show that we only need the sketching distribution to satisfy a simple AMM guarantee, along with being a constant factor subspace embedding, to be able to obtain a $1 + \varepsilon$ approximation. We show that, in this natural framework, the bounds on the number of rows required for a sketching matrix we obtain are nearly optimal for all "non-dilating" distributions. + +More formally, we show lower bounds in the restricted setting where for an oblivious random matrix $\mathbf{S}$ , the vector $\tilde{x} = A^{\mathsf{T}}(A\mathbf{S}^{\mathsf{T}}\mathbf{S}A^{\mathsf{T}} + \lambda I)^{-1}b$ must be a $1 + \varepsilon$ approximation to the ridge regression problem with probability $\geq 99 / 100$ . We show that the matrix $\mathbf{S}$ must at least have $m = \Omega (n\sigma^2 /\lambda \varepsilon)$ rows if $\mathbf{S}$ is "non-dilating". + +Definition 5.1 (Non-Dilating Distributions). A distribution $S$ over $m \times d$ matrices is a Non-Dilating distribution if for + +all $d \times n$ orthonormal matrices $V$ , + +$$ +\Pr_ {\mathbf {S} \sim \mathcal {S}} [ \| \mathbf {S} V \| _ {2} \leq O (1) ] \geq 9 9 / 1 0 0. +$$ + +Most sketching distributions proposed in previous work satisfy the property $\mathbb{E}[V^{\mathsf{T}}\mathbf{S}^{\mathsf{T}}\mathbf{S}V] = V^{\mathsf{T}}V = I$ . Thus the condition of non-dilation is not very restrictive. For example, a Gaussian distribution with $O(n)$ rows satisfies this condition, and other sketching distributions such as SRHT, CountSketch, and OSNAP with $O(n\log (n))$ rows all satisfy this condition with $O(1)$ replaced by at most $O(\log (n))$ . Though we prove our lower bounds for non-dilating distributions with $O(1)$ distortion, the lower bounds also hold with distributions with $O(\log (n))$ distortion with at most an $O(\log (n))$ factor loss in the lower bound. + +For $n' \geq n$ , let $O^{n' \times n}$ denote the collection of $n' \times n$ orthonormal matrices $V \in \mathbb{R}^{n' \times n}$ i.e., $V^{\mathrm{T}}V = I_n$ . Without loss of generality, we assume that $\lambda = 1$ . + +Assume that there is a distribution $S$ over $m \times d$ matrices such that given an arbitrary matrix $A \in \mathbb{R}^{n \times d}$ and $b \in \mathbb{R}^n$ such that for $\mathbf{S} \sim S$ , with probability $\geq 99 / 100$ , + +$$ +\left\| A \tilde {x} - b \right\| _ {2} ^ {2} + \left\| \tilde {x} \right\| _ {2} ^ {2} \leq (1 + \varepsilon) \mathrm {O p t}, +$$ + +where $\tilde{x} = A^{\mathsf{T}}(A\mathbf{S}^{\mathsf{T}}\mathbf{S}A^{\mathsf{T}} + I)^{-1}b$ . Given an instance $(A,b)$ , let $\mathbf{S}$ be a good $A,b$ matrix if the above event holds, i.e., $\tilde{x}$ is a $1 + \varepsilon$ approximation. Let $b$ be a fixed unit vector. Thus, from our assumption, + +$$ +\Pr_ {\mathbf {U} \sim O ^ {n \times n}, \mathbf {V} \sim O ^ {d \times n}, \mathbf {S} \sim \mathcal {S}} [ \mathbf {S} \text {i s g o o d} _ {\sigma \mathbf {U V} ^ {\top}, b} ] \geq 9 9 / 1 0 0. \tag {3} +$$ + +For the problem $(\sigma \mathbf{U}\mathbf{V}^{\top},b)$ where $b$ is a fixed unit vector, we have $\mathrm{Opt} = 1 / (1 + \sigma^2)$ . We also have for $v = (\Sigma^{-2} + \mathbf{V}^{\top}\mathbf{S}^{\top}\mathbf{S}\mathbf{V})^{-1}\Sigma^{-1}\mathbf{U}^{\top}b$ that + +$$ +\begin{array}{l} \operatorname {c o s t} (\tilde {x}) - \operatorname {O p t} = v ^ {\top} E \Sigma (I - (\Sigma^ {2} + I) ^ {- 1}) \Sigma E v \\ \geq \lambda_ {\min } (I - (\Sigma^ {2} + I) ^ {- 1}) \| \Sigma E v \| _ {2} ^ {2}, \\ \end{array} +$$ + +where $E = \mathbf{V}^{\mathrm{T}}\mathbf{S}^{\mathrm{T}}\mathbf{S}\mathbf{V} - \mathbf{V}^{\mathrm{T}}\mathbf{V}$ , which is the error in approximating the identity matrix using the sketch $\mathbf{S}$ , and $\Sigma$ is the matrix of singular values of $\sigma \mathbf{U}\mathbf{V}^{\mathrm{T}}$ . In our case, $\Sigma = \sigma I_{n}$ for some $\sigma \geq 1$ which implies that + +$$ +\operatorname {c o s t} (\tilde {x}) - \operatorname {O p t} \geq \frac {1}{2} \| E \left(\sigma^ {- 2} I + \mathbf {V} ^ {\top} \mathbf {S} ^ {\top} \mathbf {S V}\right) ^ {- 1} \mathbf {U} ^ {\top} b \| _ {2} ^ {2} +$$ + +once we cancel out $\Sigma$ and $\Sigma^{-1}$ . Thus, if $\mathbf{S}$ is good $(\sigma \mathbf{U} \mathbf{V}^{\top}, b)$ , + +$$ +\| E (\sigma^ {- 2} I + \mathbf {V} ^ {\mathsf {T}} \mathbf {S} ^ {\mathsf {T}} \mathbf {S V}) ^ {- 1} \mathbf {U} ^ {\mathsf {T}} b \| _ {2} ^ {2} \leq \frac {2 \varepsilon}{1 + \sigma^ {2}} \leq \frac {2 \varepsilon}{\sigma^ {2}}. +$$ + +Therefore, $\operatorname{Pr}_{\mathbf{U},\mathbf{V},\mathbf{S}}[\| E(\sigma^{-2}I + \mathbf{V}^{\top}\mathbf{S}^{\top}\mathbf{S}\mathbf{V})^{-1}\mathbf{U}^{\top}b\|_{2}^{2} \leq 2\varepsilon / \sigma^{2}] \geq \operatorname{Pr}_{\mathbf{U},\mathbf{V},\mathbf{S}}[\mathbf{S}$ is good $\sigma_{\mathbf{U}\mathbf{V}^{\top},b}] \geq 99/100$ . Now, for a fixed unit vector $b$ , the vector $\mathbf{U}^{\top}b$ is a uniformly random unit vector that is independent of $\mathbf{V}$ and $\mathbf{S}$ . Thus, + +$$ +\Pr_ {\mathbf {V}, \mathbf {S}, \mathbf {r}} [ \| E (\sigma^ {- 2} I + \mathbf {V} ^ {\top} \mathbf {S} ^ {\top} \mathbf {S V}) ^ {- 1} \mathbf {r} \| _ {2} ^ {2} \leq 2 \varepsilon / \sigma^ {2} ] \geq 0. 9 9, +$$ + +where above and throughout the section, $\mathbf{r}$ is a uniformly random unit vector. Now we transform this property of the random matrix $\mathbf{S}$ into a probability statement about the Frobenius norm of a certain matrix. + +Lemma 5.2 (Random vector to Frobenius Norm). If $\mathbf{M} \in \mathbb{R}^{n \times n}$ is a random matrix independent of the random uniform vector $\mathbf{r}$ such that $Pr_{\mathbf{M},\mathbf{r}}[\|\mathbf{M}\mathbf{r}\|_2^2 \leq a] \geq 99/100$ , then $Pr_{\mathbf{M}}[\|\mathbf{M}\|_{\mathsf{F}}^2 \leq Can] \geq 9/10$ for large enough constant $C$ . + +This lemma implies that for any random matrix $\mathbf{S}$ satisfying (3), we have $\| E(\sigma^{-2}I + \mathbf{V}^{\mathsf{T}}\mathbf{S}^{\mathsf{T}}\mathbf{S}\mathbf{V})^{-1}\|_{\mathsf{F}}^{2}\leq Cn\varepsilon /\sigma^{2}$ with probability $\geq 9 / 10$ over $\mathbf{V},\mathbf{S}$ . Using the non-dilating property of $\mathbf{S}$ and applying a union bound, we now have with probability $\geq 8 / 10$ + +$$ +\begin{array}{l} \| E \| _ {\mathsf {F}} ^ {2} \leq \frac {\| E (\sigma^ {- 2} I + \mathbf {V} ^ {\mathsf {T}} \mathbf {S} ^ {\mathsf {T}} \mathbf {S V}) ^ {- 1} \| _ {\mathsf {F}} ^ {2}}{\sigma_ {\min } ((\sigma^ {- 2} I + \mathbf {V} ^ {\mathsf {T}} \mathbf {S} ^ {\mathsf {T}} \mathbf {S V}) ^ {- 1}) ^ {2}} \\ = \frac {C n \varepsilon / \sigma^ {2}}{\sigma_ {\mathrm {m i n}} ((\sigma^ {- 2} I + \mathbf {V} ^ {\intercal} \mathbf {S} ^ {\intercal} \mathbf {S V}) ^ {- 1}) ^ {2}} \leq O (n \varepsilon / \sigma^ {2}) \\ \end{array} +$$ + +where we used the fact that for any invertible matrix $A$ , $1 / \sigma_{\min}(A^{-1}) = \sigma_{\max}(A)$ and $\sigma_{\max}(\sigma^{-2}I + \mathbf{V}^{\top}\mathbf{S}^{\top}\mathbf{S}\mathbf{V}) \leq (1 / \sigma^{2}) + \| \mathbf{V}^{\top}\mathbf{S}^{\top}\mathbf{S}\mathbf{V}\|_{2} = O(1)$ with probability $\geq 9/10$ . Thus, a lower bound on the number of rows in the matrix $\mathbf{S}$ to obtain, with probability $\geq 8/10$ , + +$$ +\left\| \mathbf {V} ^ {\top} \mathbf {S} ^ {\top} \mathbf {S V} - I \right\| _ {\mathrm {F}} \leq O \left(\sqrt {n \varepsilon / \sigma^ {2}}\right) = O \left(\sqrt {\varepsilon / n \sigma^ {2}}\right) n \tag {4} +$$ + +implies a lower bound on the number of rows of a random matrix $\mathbf{S}$ that satisfies (3). + +# 5.1. Lower bounds for AMM + +Lemma 5.3. Given parameters $n$ and error parameter $\varepsilon \leq c / \sqrt{n}$ for a small enough constant $c$ , for all $d \geq Cn / \varepsilon^2$ if a random matrix $\mathbf{S} \in \mathbb{R}^{m \times d}$ for all matrices $A \in \mathbb{R}^{d \times n}$ satisfies, $\| A^{\mathrm{T}}\mathbf{S}^{\mathrm{T}}\mathbf{S}A - A^{\mathrm{T}}A\|_{\mathsf{F}} \leq \varepsilon \| A^{\mathrm{T}}\|_{\mathsf{F}}\| A\|_{\mathsf{F}}$ with probability $\geq 9 / 10$ , then $m = \Omega (1 / \varepsilon^2)$ . + +Moreover, the lower bound of $\Omega(1/\varepsilon^2)$ holds even for the sketching matrices that give the following guarantee: $Pr_{\mathbf{A},\mathbf{S}}[\| \mathbf{A}^\top \mathbf{S}^\top \mathbf{S}\mathbf{A} - I\|_{\mathsf{F}} \leq \varepsilon n] \geq 0.9$ , where $\mathbf{A}$ is a uniformly random $d \times n$ orthonormal matrix independent of the sketch $\mathbf{S}$ . + +Although the above lemma only shows that an AMM sketch requires $m = \Omega(1 / \varepsilon^2)$ for $d \geq C n / \varepsilon^2$ , we can extend it to show the lower bound for $d \geq C / \varepsilon^2$ for a large enough constant $C$ . Note that $C / \varepsilon^2 = \Omega(n)$ since $\varepsilon \leq c / \sqrt{n}$ . + +Theorem 5.4. Given $n \geq 0$ and $\varepsilon < c / \sqrt{n}$ for a small enough constant $c$ , there are universal constants $C, D$ such that for all $d \geq D / \varepsilon^2$ , any distribution that has the $\varepsilon$ AMM property for $d \times n$ matrices must have $\geq C / \varepsilon^2$ rows. + +As discussed in the introduction, we crucially use the fact that a sub-matrix of a random orthonormal matrix is close + +to a Gaussian matrix in total variation distance to prove the above theorem. This seems to be a useful direction to obtain lower bounds for other sketching problems. + +# 5.2. Lower Bound Wrapup + +In the case of ridge regression with $\lambda = 1$ , (4) shows that the sketching distribution has to satisfy the AMM guarantee with parameter $c\sqrt{\varepsilon / n\sigma^2}$ . By using the above hardness result for AMM, we obtain the following theorem. + +Theorem 5.5. If $S$ is a non-dilating distribution over $m \times d$ matrices such that for all ridge regression instances $(A, b, \lambda)$ with $A \in \mathbb{R}^{n \times d}$ , $1 \leq \sigma^2 / \lambda \leq \alpha$ satisfies, + +$$ +P r _ {\mathbf {S} \sim \mathcal {S}} [ \| A \tilde {x} - b \| _ {2} ^ {2} + \lambda \| \tilde {x} \| _ {2} ^ {2} \leq (1 + \varepsilon) \mathrm {O p t} ] \geq 0. 9 9, +$$ + +for $\tilde{x} = A^{\mathsf{T}}(A\mathbf{S}^{\mathsf{T}}\mathbf{S}A^{\mathsf{T}} + \lambda I)^{-1}b$ then $m = \Omega (n\alpha /\varepsilon) = \Omega (n\sigma^2 /\lambda \varepsilon)$ + +# 6. Communication Complexity Lower Bounds for Ridge Regression + +Consider a ridge regression matrix $A$ of the form $A_{1} + A_{2}$ where Alice has the matrix $A_{1}$ and Bob has the matrix $A_{2}$ . To compute a vector $y$ such that $A^{\mathsf{T}}y$ is a $1 + \varepsilon$ approximation, the theorem from the previous section lower bounds the communication required between Alice and Bob by $\Omega (n\sigma^{2} / \lambda \varepsilon)$ . The lower bound is crude in that it assumes that they only communicate $A_{1}\mathbf{S}^{\mathsf{T}}$ between them for some sketch $\mathbf{S}$ , and they compute $y$ only as $(A\mathbf{S}^{\mathsf{T}}\mathbf{S}A^{\mathsf{T}} + \lambda I)^{-1}b$ . + +In this section, we present communication complexity lower bounds for a different but related problem of computing a value $v$ such that $v = (1 \pm \varepsilon) \mathrm{Opt}$ in the above two-player scheme, where Alice has the matrix $A_{1}$ and Bob has the matrix $A_{2}$ . We show the lower bound by reducing from the well-known GAP-HAMMING problem (Indyk & Woodruff, 2003; Woodruff, 2004) to a ridge regression instance with a $2 \times d$ design matrix. + +In the GAP-HAMMING problem, Alice and Bob receive vectors $x, y \in \{\pm 1\}^d$ and want to decide if $d_H(x, y) \geq d/2 + \varepsilon d$ or $d_H(x, y) \leq d/2 - \varepsilon d$ , where $d_H(x, y)$ is the Hamming distance $|\{i | x_i \neq y_i\}|$ . This problem has a communication complexity lower bound of $\Omega(1/\varepsilon^2)$ bits, even for multiple rounds (Chakrabarti & Regev, 2012). Let $M$ be a $2 \times d$ matrix with $x$ and $y$ as its rows. Consider the following ridge regression problem: + +$$ +\min _ {x} \| M x - \left[ \begin{array}{c} 1 \\ - 1 \end{array} \right] \| _ {2} ^ {2} + \lambda \| x \| _ {2} ^ {2}. +$$ + +Let $N = d_{H}(x,y)$ . The optimal value of the above ridge regression problem is given by $2\lambda /(\lambda +2N)$ . In the case when $N\geq d / 2 + \varepsilon d$ and $N\leq d / 2 + \varepsilon d$ , the optimal values differ by a factor of $1 + 4\varepsilon /(1 + \lambda /d)$ . So, obtaining a + +$1 + O(\varepsilon /(1 + \lambda /d))$ approximation to ridge regression lets us solve the Gap-Hamming problem, and hence requires $\Omega (1 / \varepsilon^2)$ bits of communication. As $\| M\| _2^2 = \Theta (d)$ , we obtain an $\Omega (1 / \varepsilon^{2}(1 + \lambda /\sigma^{2}))$ bit lower bound for computing a $1 + \varepsilon$ approximate value for ridge regression. + +In contrast to the $\Omega(1 / \varepsilon^2)$ type communication lower bounds on computing $1 \pm \varepsilon$ approximations to the optimal values of ridge regression, we obtain $\Omega(d)$ lower bounds on the communication complexity of approximating optimal values of Lasso and square-root Lasso objectives even up to a factor of $1 + c$ for a small enough constant $c > 0$ . Concretely, we prove the following results. + +Theorem 6.1 (Communication Complexity of Lasso). Let $0 < \lambda < 1$ be the Lasso parameter. If Alice has the $n \times d$ matrix $M_1$ and Bob has the $n \times d$ matrix $M_2$ , then to determine a $1 + c$ approximation, for a small enough constant $c$ , to the optimal value of + +$$ +\min _ {z} \| \left(M _ {1} + M _ {2}\right) z - b \| _ {2} ^ {2} + \lambda \| z \| _ {1}, +$$ + +requires $\Omega(d)$ bits of communication between Alice and Bob. + +Theorem 6.2 (Hardness of Sketching Square-Root Lasso). Let $0 < \lambda < 2\sqrt{2}/3$ be the Lasso parameter. If Alice has the $n \times d$ matrix $M_1$ and Bob has the $n \times d$ matrix $M_2$ , then to determine a $1 + c$ approximation, for a small enough constant $c > 0$ , to the optimal value of + +$$ +\min _ {z} \| (M _ {1} + M _ {2}) z - b \| _ {2} + \lambda \| z \| _ {1}, +$$ + +requires $\Omega(d)$ bits of communication between Alice and Bob. + +To show these lower bounds, we reduce the classic DisJOINTNESS problem (Håstad & Wigderson, 2007) to computing $1 + c$ approximations to optimal values of an appropriate Lasso and square-root Lasso problem. See the supplementary for proofs. + +# Acknowledgments + +The authors thank National Institute of Health (NIH) grant 5401 HG 10798-2, Office of Naval Research (ONR) grant N00014-18-1-2562, and a Simons Investigator Award. + +# References + +Ahle, T. D., Kapralov, M., Knudsen, J. B., Pagh, R., Velingker, A., Woodruff, D. P., and Zandieh, A. Oblivious sketching of high-degree polynomial kernels. In Proceedings of the Fourteenth Annual ACM-SIAM Symposium on Discrete Algorithms, pp. 141-160. SIAM, 2020. + +Assadi, S. and Raz, R. Near-quadratic lower bounds for two-pass graph streaming algorithms. In 2020 IEEE 61st + +Annual Symposium on Foundations of Computer Science (FOCS), pp. 342-353. IEEE, 2020. +Brody, J. and Woodruff, D. P. Streaming algorithms with one-sided estimation. In Approximation, Randomization, and Combinatorial Optimization. Algorithms and Techniques, pp. 436-447. Springer, 2011. +Chakrabarti, A. and Regev, O. An optimal lower bound on the communication complexity of Gap-Hamming-Distance. SIAM Journal on Computing, 41(5):1299-1317, 2012. +Chen, L., Kol, G., Paramonov, D., Saxena, R., Song, Z., and Yu, H. Near-optimal two-pass streaming algorithm for sampling random walks over directed graphs. arXiv preprint arXiv:2102.11251, 2021. +Chowdhury, A., Yang, J., and Drineas, P. An iterative, sketching-based framework for ridge regression. In International Conference on Machine Learning, pp. 989-998. PMLR, 2018. +Clarkson, K. L. and Woodruff, D. P. Low-rank approximation and regression in input sparsity time. J. ACM, 63(6), January 2017. ISSN 0004-5411. doi: 10.1145/3019134. +Cohen, M. B. Nearly tight oblivious subspace embeddings by trace inequalities. In Proceedings of the twenty-seventh annual ACM-SIAM symposium on Discrete algorithms, pp. 278-287. SIAM, 2016. +Håstad, J. and Wigderson, A. The randomized communication complexity of set disjointness. Theory of Computing, 3(1):211-219, 2007. +Indyk, P. and Woodruff, D. P. Tight lower bounds for the distinct elements problem. In 44th Symposium on Foundations of Computer Science (FOCS 2003), 11-14 October 2003, Cambridge, MA, USA, Proceedings, pp. 283-288. IEEE Computer Society, 2003. doi: 10.1109/SFCS.2003.1238202. +Jiang, T. and Ma, Y. Distances between random orthogonal matrices and independent normals. arXiv preprint arXiv:1704.05205, 2017. +Konrad, C. and Naidu, K. K. On two-pass streaming algorithms for maximum bipartite matching. arXiv preprint arXiv:2107.07841, 2021. +Li, Y. and Woodruff, D. P. The product of Gaussian matrices is close to Gaussian. In Approximation, Randomization, and Combinatorial Optimization. Algorithms and Techniques (APPROX/RANDOM), 2021. +Lowther, G. Anti-concentration of Gaussian Quadratic form. MathOverflow.net, 2012. URL https://mathoverflow.net/q/95108. + +Meng, X. and Mahoney, M. W. Low-distortion subspace embeddings in input-sparsity time and applications to robust linear regression. In Proceedings of the forty-fifth annual ACM symposium on Theory of computing, pp. 91-100, 2013. +Murphy, K. P. Machine learning: a probabilistic perspective. MIT press, 2012. +Nelson, J. and Nguyen, H. L. OSNAP: faster numerical linear algebra algorithms via sparser subspace embeddings. In 54th Annual IEEE Symposium on Foundations of Computer Science, FOCS 2013, pp. 117-126, 2013. +Nelson, J. and Nguyen, H. L. Lower bounds for oblivious subspace embeddings. In International Colloquium on Automata, Languages, and Programming, pp. 883-894. Springer, 2014. +Park, Y., Han, D.-J., Kim, D.-Y., Seo, J., and Moon, J. Few-round learning for federated learning. Advances in Neural Information Processing Systems, 34, 2021. +Woodruff, D. P. Optimal space lower bounds for all frequency moments. In Munro, J. I. (ed.), Proceedings of the Fifteenth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2004, New Orleans, Louisiana, USA, January 11-14, 2004, pp. 167-175. SIAM, 2004. +Woodruff, D. P. Sketching as a tool for numerical linear algebra. Foundations and Trends® in Theoretical Computer Science, 10(1-2):1-157, 2014. ISSN 1551-305X. doi: 10.1561/0400000060. + +# A. Missing Proofs from Section 4 + +Proof of Lemma 4.3. For $i \in [m]$ and $j \in [d]$ , let $\delta_{i,j}$ be the indicator random variable that denotes if the $(i,j)$ -th entry of the matrix $S$ is nonzero. We have that $\sum_{i} \delta_{i,j} = s$ and that for any $S \subseteq [m] \times [d]$ , $\mathbb{E}[\Pi_{(i,j) \in S} \delta_{i,j}] \leq (s/m)^{|S|}$ . Also, let $\sigma_{i,j}$ be the sign of the $(i,j)$ -th entry and let $\sigma_{i,j}$ be 4-wise independent Rademacher random variables. Now, + +$$ +\begin{array}{l} \| \mathbf {S} x \| _ {2} ^ {2} = \sum_ {i} | \mathbf {S} _ {i *} x | ^ {2} = \frac {1}{s} \sum_ {i} \left(\sum_ {j} \delta_ {i, j} \sigma_ {i, j} x _ {j}\right) ^ {2} = \frac {1}{s} \sum_ {i} \sum_ {j, j ^ {\prime}} \delta_ {i, j} \delta_ {i, j ^ {\prime}} \sigma_ {i, j} \sigma_ {i, j ^ {\prime}} x _ {j} x _ {j ^ {\prime}} \\ = \frac {1}{s} \sum_ {i} \sum_ {j} (\delta_ {i, j}) ^ {2} (\sigma_ {i, j}) ^ {2} x _ {j} ^ {2} + \frac {1}{s} \sum_ {i} \sum_ {j \neq j ^ {\prime}} \delta_ {i, j} \delta_ {i, j ^ {\prime}} \sigma_ {i, j} \sigma_ {i, j ^ {\prime}} x _ {j} x _ {j ^ {\prime}}. \\ \end{array} +$$ + +We have $\delta_{i,j}^2 = \delta_{i,j}$ and $\sigma_{i,j}^2 = 1$ for all $i, j$ . So, + +$$ +(1 / s) \sum_ {i} \sum_ {j} (\delta_ {i, j}) ^ {2} (\sigma_ {i, j}) ^ {2} x _ {j} ^ {2} = (1 / s) \sum_ {i} \sum_ {j} \delta_ {i, j} x _ {j} ^ {2} = (1 / s) \sum_ {j} x _ {j} ^ {2} \sum_ {i} \delta_ {i, j} = (1 / s) \sum_ {j} x _ {j} ^ {2} \cdot s = \| x \| _ {2} ^ {2} = 1. +$$ + +Therefore, + +$$ +\| \mathbf {S} x \| _ {2} ^ {2} = 1 + \frac {1}{s} \sum_ {i} \sum_ {j \neq j ^ {\prime}} \delta_ {i, j} \delta_ {i, j ^ {\prime}} \sigma_ {i, j} \sigma_ {i, j ^ {\prime}} x _ {j} x _ {j ^ {\prime}}. +$$ + +If $\sigma_{i,j}$ are uniform random signs that are 2-wise independent, then for $j\neq j^{\prime}$ , $\mathbb{E}[\sigma_{i,j}\sigma_{i,j^{\prime}}] = 0$ and as the set of random variables $\delta_{i,j}$ are independent of the random variables $\sigma_{i,j}$ , we have $\mathbb{E}[\delta_{i,j}\delta_{i,j'}\sigma_{i,j}\sigma_{i,j'}] = \mathbb{E}[\delta_{i,j}\delta_{i,j'}]\mathbb{E}[\sigma_{i,j}\sigma_{i,j'}] = 0$ for $j\neq j'$ which implies that $\mathbb{E}[\| \mathbf{S}x\| _2^2 ] = 1$ . We also have + +$$ +(\| \mathbf{S}x\|_{2}^{2} - 1)^{2} = \frac{1}{s^{2}}\sum_{i,i^{\prime}}\sum_{\substack{j\neq j^{\prime}\\ k\neq k^{\prime}}}\delta_{i,j}\delta_{i,j^{\prime}}\delta_{i^{\prime},k}\delta_{i^{\prime},k^{\prime}}\sigma_{i,j}\sigma_{i,j^{\prime}}\sigma_{i^{\prime},k}\sigma_{i^{\prime},k^{\prime}}x_{j}x_{j^{\prime}}x_{k}x_{k^{\prime}}. +$$ + +If $i \neq i'$ , $j \neq j'$ , and $k \neq k'$ , then the random variables $\sigma_{i,j}$ , $\sigma_{i,j'}$ , $\sigma_{i',k}$ , and $\sigma_{i',k'}$ are distinct and if they are 4-wise independent Rademacher random variables, then $\mathbb{E}[\sigma_{i,j}\sigma_{i,j'}\sigma_{i',k}\sigma_{i',k'}] = 0$ which implies that + +$$ +\mathbb{E}[(\| \mathbf{S}x\|_{2}^{2} - 1)^{2}] = \frac{1}{s^{2}}\sum_{i}\sum_{\substack{j\neq j^{\prime}\\ k\neq k^{\prime}}}\mathbb{E}[\delta_{i,j}\delta_{i,j^{\prime}}\delta_{i,k}\delta_{i,k^{\prime}}]\mathbb{E}[\sigma_{i,j}\sigma_{i,j^{\prime}}\sigma_{i,k}\sigma_{i,k^{\prime}}]x_{j}x_{j^{\prime}}x_{k}x_{k^{\prime}}. +$$ + +Again, if all the indices $j,j^{\prime},k,k^{\prime}$ are distinct, then by the 4-wise independence of the $\sigma$ random variables, we obtain that $\mathbb{E}[\sigma_{i,j}\sigma_{i,j'}\sigma_{i,k}\sigma_{i,k'}] = 0$ , which leaves only $j = k\neq j^{\prime} = k^{\prime}$ and $j = k^{\prime}\neq j^{\prime} = k$ as the cases where the expectation can be non-zero. In each of these cases, $\sigma_{i,j}\sigma_{i,j'}\sigma_{i,k}\sigma_{i,k'} = 1$ with probability 1. Therefore, + +$$ +\mathbb {E} [ (\| \mathbf {S} x \| _ {2} ^ {2} - 1) ^ {2} ] = \frac {2}{s ^ {2}} \sum_ {i} \sum_ {j, j ^ {\prime}} \mathbb {E} [ \delta_ {i, j} \delta_ {i, j ^ {\prime}} ] x _ {j} ^ {2} x _ {j ^ {\prime}} ^ {2} \leq \frac {2}{s ^ {2}} \frac {s ^ {2}}{m ^ {2}} \sum_ {i} \sum_ {j \neq j ^ {\prime}} x _ {j} ^ {2} x _ {j ^ {\prime}} ^ {2} \leq \frac {2}{m ^ {2}} \sum_ {i} (\sum_ {j} x _ {j} ^ {2}) (\sum_ {j ^ {\prime}} x _ {j ^ {\prime}} ^ {2}) \leq \frac {2}{m ^ {2}} +$$ + +which gives that $\| \| \mathbf{S}x\| _2^2 -1\|_{L^2} = \mathbb{E}[(\| \mathbf{S}x\| _2^2 -1)^2 ]^{1 / 2}\leq \sqrt{2 / m}$ . Now, for $m = \Omega (1 / \varepsilon^2\delta)$ , we have $\| \| \mathbf{S}x\| _2^2 -1\|_{L^2}\leq \varepsilon \delta^{1 / 2}$ , which proves that the matrix $\mathbf{S}$ has the $(\varepsilon ,\delta ,2)$ -JL moment property. + +# B. Missing Proofs from Section 5 + +# B.1. Proof of Lemma 5.2 + +Lemma 5.2 transforms a probability statement about the squared norm of a product of a random matrix $\mathbf{M}$ with an independent uniform random vector $\mathbf{r}$ . To prove the lemma, we first prove the following similar lemma in which the matrix $M$ is a deterministic matrix. + +Lemma B.1. Let $M \in \mathbb{R}^{n \times n}$ be a fixed matrix and $\mathbf{r}$ be a uniformly random unit vector. If $Pr_{\mathbf{r}}[||M\mathbf{r}||_2^2 \leq a] \geq 9/10$ , then $||M||_{\mathsf{F}}^2 \leq Cna$ for a large enough universal constant $C$ . + +Proof. Let $\mathbf{g} \in \mathbb{R}^n$ be a Gaussian random vector with i.i.d. entries drawn from $N(0,1)$ . Then the distribution of $\mathbf{g} / \| \mathbf{g}\|_2$ is identical to that of a uniformly random unit vector in $n$ dimensions by rotational invariance of the Gaussian distribution. Therefore from our assumption, $\operatorname{Pr}_{\mathbf{g}}[\| M\mathbf{g}\|_2^2 \leq a\| \mathbf{g}\|_2^2] \geq 9/10$ . We also have that with probability $\geq 9/10$ , $\| \mathbf{g}\|_2^2 \leq C_1n$ for a large enough absolute constant $C_1$ . Thus, we have by a union bound that, + +$$ +\Pr_ {\mathbf {g}} [ \| M \mathbf {g} \| _ {2} ^ {2} \leq a \| \mathbf {g} \| _ {2} ^ {2} \wedge \| \mathbf {g} \| _ {2} ^ {2} \leq C _ {1} n ] \geq 8 / 1 0, +$$ + +which implies that + +$$ +\Pr_ {\mathbf {g}} [ \| M \mathbf {g} \| _ {2} ^ {2} \leq C _ {1} a n ] \geq 8 / 1 0. +$$ + +Let $M = U\Sigma V^{\top}$ be the singular value decomposition of the matrix $M$ . Then, the above equation is equivalent to + +$$ +8 / 1 0 \leq \Pr_ {\mathbf {g}} [ \| \Sigma V ^ {\mathsf {T}} \mathbf {g} \| _ {2} ^ {2} \leq C _ {1} a n ] = \Pr_ {\mathbf {g}} [ \| \Sigma \mathbf {g} \| _ {2} ^ {2} \leq C _ {1} a n ] +$$ + +where the equality follows from the fact that for an orthonormal matrix $V^{\mathsf{T}}$ , we have $V^{\mathsf{T}}\mathbf{g} \equiv \mathbf{g}$ . Thus, if the singular values of $M$ are $\sigma_1, \ldots, \sigma_n$ , we have + +$$ +\Pr_ {\mathbf {g}} \left[ \sum_ {i} \sigma_ {i} ^ {2} \mathbf {g} _ {i} ^ {2} \leq C _ {1} a n \right] \geq 8 / 1 0. +$$ + +Now, we have the following lemma which gives an upper bound on the probability of a linear combination of squared Gaussian random variables being small. + +Lemma B.2 (Lowther (2012)). If $a_i \geq 0$ for $i = 1, \dots, n$ are constants and $\mathbf{g}_1, \dots, \mathbf{g}_n$ are i.i.d. Gaussians of mean 0 and variance 1, then for every $\delta > 0$ , + +$$ +P r \left[ \sum_ {i} a _ {i} \mathbf {g} _ {i} ^ {2} \leq \delta \sum_ {i} a _ {i} \right] \leq e \sqrt {\delta}. +$$ + +Proof. The inequality is obviously true for $\delta \geq 1$ . We now consider arbitrary $\delta < 1$ . Assume without loss of generality that $\sum_{i}a_{i} = 1$ . Now, for any $\lambda >0$ + +$$ +\Pr \left[ \sum_ {i} a _ {i} \mathbf {g} _ {i} ^ {2} \leq \delta \right] = \Pr \left[ - \lambda \sum_ {i} a _ {i} \mathbf {g} _ {i} ^ {2} \geq - \lambda \delta \right] = \Pr \left[ \exp \left(- \lambda \sum_ {i} a _ {i} \mathbf {g} _ {i} ^ {2}\right) \geq \exp (- \lambda \delta) \right] \leq \exp (\lambda \delta) \mathbb {E} \left[ \exp \left(- \lambda \sum_ {i} a _ {i} \mathbf {g} _ {i} ^ {2}\right) \right] +$$ + +and therefore, + +$$ +\begin{array}{l} \Pr \left[ \sum_ {i} a _ {i} \mathbf {g} _ {i} ^ {2} \leq \delta \right] = \exp (\lambda \delta) \mathbb {E} \left[ \exp \left(- \lambda \sum_ {i} a _ {i} \mathbf {g} _ {i} ^ {2}\right) \right] \\ = \exp (\lambda \delta) \prod_ {i} \mathbb {E} [ \exp (- \lambda a _ {i} \mathbf {g} _ {i} ^ {2}) ] \\ = \exp (\lambda \delta) \prod_ {i} (1 + 2 \lambda a _ {i}) ^ {- 1 / 2}. \\ \end{array} +$$ + +Now, $\prod_{i}(1 + 2\lambda a_{i})\geq 1 + 2\lambda (\sum_{i}a_{i}) = 1 + 2\lambda$ which implies that $\prod (1 + 2\lambda a_i)^{-1 / 2}\leq (1 + 2\lambda)^{-1 / 2}$ which gives + +$$ +\Pr \left[ \sum_ {i} a _ {i} \mathbf {g} _ {i} ^ {2} \leq \delta \right] \leq \exp (\lambda \delta) (1 + 2 \lambda) ^ {- 1 / 2}. +$$ + +Picking $\lambda \geq 0$ such that $1 + 2\lambda = 1 / \delta$ , we obtain that $\operatorname*{Pr}[\sum_i a_i \mathbf{g}_i^2 \leq \delta] \leq \exp((1 - \delta) / 2)\sqrt{\delta} \leq e\sqrt{\delta}$ . + +For $\delta = 0.01$ , the above lemma implies that $\operatorname{Pr}[\sum_i \sigma_i^2 \mathbf{g}_i^2 \leq 0.01 \sum_i \sigma_i^2] \leq e \cdot (0.1) \leq 0.3$ . This, in particular implies that $0.01 \sum_i \sigma_i^2 = 0.01 \| \Sigma \|_{\mathbb{F}}^2 \leq C_1 a n$ which gives $\| M \|_{\mathbb{F}}^2 = \| \Sigma \|_{\mathbb{F}}^2 \leq C a n$ for a large enough absolute constant $C$ . + +We now extend the above lemma to the case when the matrix $\mathbf{M}$ is also random and independent of the random unit vector $\mathbf{r}$ . + +Proof of Lemma 5.2. Let $\mathbf{M}$ be good if $\operatorname*{Pr}_{\mathbf{r}}[\| \mathbf{M}\mathbf{r}\| _2^2\leq a]\geq 9 / 10$ and let $\mathbf{M}$ be bad otherwise and note from the above lemma that if $\mathbf{M}$ is good, then $\| \mathbf{M}\|_{\mathbb{F}}^{2}\leq C a n$ . Now, + +$$ +\begin{array}{l} 9 9 / 1 0 0 \leq \Pr_ {\mathbf {M}, \mathbf {r}} [ \| \mathbf {M r} \| _ {2} ^ {2} \leq a ] \\ \leq \Pr_ {\mathbf {M}} [ \mathbf {M} \text {i s g o o d} ] + \Pr_ {\mathbf {M}} [ \mathbf {M} \text {i s b a d} ] \cdot (9 / 1 0) \\ = 9 / 1 0 + (1 / 1 0) \cdot \Pr_ {\mathbf {M}} [ \mathbf {M} \text {i s g o o d} ] \\ \end{array} +$$ + +which implies that $\operatorname{Pr}_{\mathbf{M}}[\mathbf{M}$ is good] $\geq 9 / 10$ and therefore $\mathrm{Pr}_{\mathbf{M}}[||\mathbf{M}||_{\mathsf{F}}^{2}\leq Can]\geq \mathrm{Pr}_{\mathbf{M}}[\mathbf{M}$ is good] $\geq 9 / 10$ + +![](images/a073e31a67eeb1f263351d27ad4b9ccd951302af77272a820d1f7e83fed1b422.jpg) + +# B.2. Proof of Lower Bounds for AMM + +Proof of Lemma 5.3. We assume that such a distribution exists with $m \leq c / \varepsilon^2$ for a small enough constant $c$ . Let $\mathbf{A} \in \mathbb{R}^{d \times n}$ be a uniformly random orthonormal matrix ( $\mathbf{A}^\top \mathbf{A} = I_n$ ) independent of the sketching matrix. Then we have + +$$ +\Pr_ {\mathbf {A}, \mathbf {S}} [ \| \mathbf {A} ^ {\top} \mathbf {S} ^ {\top} \mathbf {S} \mathbf {A} - I \| _ {\mathbb {F}} \leq \varepsilon n ] \geq 0. 9, +$$ + +as $\| A^{\mathsf{T}}\|_{\mathsf{F}} = \sqrt{n}$ . Let $\mathbf{S} = U\Sigma V^{\mathsf{T}}$ be the singular value decomposition with $U\in \mathbb{R}^{m\times m}$ , $\Sigma \in \mathbb{R}^{m\times m}$ and $V^{\mathsf{T}}\in \mathbb{R}^{m\times d}$ . Note that if $\mathbf{S}$ is a random matrix that satisfies the AMM property, then $\mathbf{S}\cdot \mathbf{Q}$ is also a random matrix that satisfies the AMM property where $\mathbf{Q}$ is an independent uniformly random orthonormal matrix. Therefore, we can without loss of generality assume that $\boldsymbol{\Sigma}$ is independent of $V^{\mathsf{T}}$ and that $V^{\mathsf{T}}$ is a uniformly random orthonormal matrix. Thus, the above condition implies that + +$$ +\Pr_ {\mathbf {A}, V, \Sigma} [ \| \mathbf {A} ^ {\mathsf {T}} V \Sigma^ {2} V ^ {\mathsf {T}} \mathbf {A} - I \| _ {\mathbb {F}} \leq \varepsilon n ] \geq 0. 9. +$$ + +Using the following lemma, we effectively show that the matrix $V^{\mathrm{T}}\mathbf{A}$ in the above statement can be replaced with $(1 / \sqrt{d})\hat{\mathbf{G}}$ where $\hat{\mathbf{G}}$ is a Gaussian matrix of the same dimensions as $V^{\mathrm{T}}\mathbf{A}$ . + +Lemma B.3 (Lemma 3 of Li & Woodruff (2021)). Let $\mathbf{G} \sim \mathcal{G}_{d,d}$ and $\mathbf{Z} \sim O^{d \times d}$ . Suppose that $p, q \leq d$ and $\hat{\mathbf{G}}$ is the top left $p \times q$ block of $\mathbf{G}$ and $\hat{Z}$ is the top left $p \times q$ block of $Z$ . Then $d_{KL}(\frac{1}{\sqrt{d}} \hat{\mathbf{G}} \| \hat{Z}) \leq C \frac{pq}{d}$ , where $C$ is a universal constant. By applying Pinsker's inequality, we obtain that + +$$ +d _ {T V} \left(\frac {1}{\sqrt {d}} \hat {\mathbf {G}} \| \hat {Z}\right) \leq \sqrt {(1 / 2) d _ {K L} \left(\frac {1}{\sqrt {d}} \hat {\mathbf {G}} \| \hat {Z}\right)} \leq \sqrt {C p q / 2 d}. +$$ + +Now both the matrices $V, \mathbf{A}$ can be taken to be the first $m$ and $n$ columns of independent uniform random orthogonal matrices $\mathbf{V}'$ and $\mathbf{A}'$ , respectively. By the properties of the Haar Measure, we obtain that $\mathbf{V}'^{\top}\mathbf{A}'$ is also a uniform random orthogonal matrix. Thus, the matrix $V^{\top}\mathbf{A}$ can be seen as the top left $m \times n$ sub-matrix of a uniformly random orthogonal matrix. If $nm \leq d / 100C$ , which can be assumed as $m \leq c / \varepsilon^2$ for a small enough constant $\alpha$ , we have from the above lemma that $d_{\mathrm{TV}}\left(\frac{1}{\sqrt{d}}\mathbf{G}\| V^{\top}\mathbf{A}\right) \leq 0.1$ which implies that + +$$ +| \operatorname * {P r} _ {\mathbf {G}, \Sigma} [ \| (1 / d) \mathbf {G} ^ {\top} \Sigma^ {2} \mathbf {G} - I \| _ {\mathsf {F}} \leq \varepsilon n ] - \operatorname * {P r} _ {\mathbf {A}, V, \Sigma} [ \| \mathbf {A} ^ {\top} V \Sigma^ {2} V ^ {\top} \mathbf {A} - I \| _ {\mathsf {F}} \leq \varepsilon n ] | \leq 0. 1 +$$ + +and therefore + +$$ +\Pr_ {\mathbf {G}, \Sigma} [ \| (1 / d) \mathbf {G} ^ {\top} \Sigma^ {2} \mathbf {G} - I \| _ {\mathbb {F}} \leq \varepsilon n ] \geq 0. 8, \tag {5} +$$ + +where $\mathbf{G}$ is an $m\times n$ matrix of i.i.d. normal random variables. We will now show that if $m\ll 1 / \varepsilon^2$ , then no distribution over matrices $\Sigma$ satisfies the above condition. Note that $\mathbf{G}$ and $\boldsymbol{\Sigma}$ are independent. We prove this by showing that a random matrix $\boldsymbol{\Sigma}$ satisfying the above probability statement must satisfy two properties simultaneously that cannot be satisfied unless $m\geq c / \varepsilon^{2}$ for a large enough constant $c$ . + +Let $\mathbf{G}_l$ denote the left half of the matrix $\mathbf{G}$ and $\mathbf{G}_r$ denote the right half of the matrix $\mathbf{G}$ . We have + +$$ +\left\| \left(1 / d\right) \mathbf {G} ^ {\top} \Sigma^ {2} \mathbf {G} - I \right\| _ {\mathbb {F}} ^ {2} \geq \frac {1}{d ^ {2}} \left\| \mathbf {G} _ {r} ^ {\top} \Sigma^ {2} \mathbf {G} _ {l} \right\| _ {\mathbb {F}} ^ {2} +$$ + +which is obtained by considering the Frobenius norm of only the bottom-left block matrix of $(1 / d)\mathbf{G}^{\mathrm{T}}\Sigma^{2}\mathbf{G} - I$ . We first have the following lemma. + +Lemma B.4. Let $M$ be a fixed matrix and $\mathbf{G}$ be a Gaussian matrix with $t$ columns. Then with probability $\geq 0.9$ , $\| M\mathbf{G}\|_{\mathbb{F}}^{2} \geq 0.001t\| M\|_{\mathbb{F}}^{2}$ . + +Proof. Let $M = U\Sigma V^{\mathsf{T}}$ . We have $M\mathbf{G} = U\Sigma V^{\mathsf{T}}\mathbf{G} = U\Sigma \mathbf{G}'$ where $\mathbf{G}'$ is a Gaussian matrix with $t$ columns. Now, $\| M\mathbf{G}\|_{\mathbb{F}}^{2} = \| U\Sigma \mathbf{G}'\|_{\mathbb{F}}^{2} = \| \Sigma \mathbf{G}'\|_{\mathbb{F}}^{2} = \sum_{i}\sum_{j}\sigma_{i}^{2}g_{ij}^{2}$ . By Lemma B.2, $\sum_{i}\sum_{j}\sigma_{i}^{2}g_{ij}^{2}\geq (\sum_{i}\sum_{j}\sigma_{i}^{2})\cdot 0.001$ with probability $\geq 0.9$ . Now, using the equality $\sum_{i}\sum_{j}\sigma_{i}^{2} = \sum_{i}t\sigma_{i}^{2} = t\| \Sigma \|_{\mathbb{F}}^{2} = t\| M\|_{\mathbb{F}}^{2}$ , we finish the proof. + +Thus, conditioned on the matrix $\mathbf{G}_r^\top \Sigma^2$ , we have that with probability $\geq 0.9$ + +$$ +\| \mathbf {G} _ {r} ^ {\top} \Sigma^ {2} \mathbf {G} _ {l} \| _ {\mathsf {F}} ^ {2} \geq 0. 0 0 1 (n / 2) \| \mathbf {G} _ {r} ^ {\top} \Sigma^ {2} \| _ {\mathsf {F}} ^ {2}. +$$ + +Applying the same lemma again, we have with probability $\geq 0.9$ , $\| \mathbf{G}_r^\top \Sigma^2 \|_F^2 \geq 0.001(n/2) \| \Sigma^2 \|_F^2$ . Thus, overall with probability $\geq 0.8$ over $\mathbf{G}$ , we have for any fixed $\Sigma$ that, $\| \mathbf{G}_r^\top \Sigma^2 \mathbf{G}_l \|_F^2 \geq \Omega(n^2 \| \Sigma^2 \|_F^2)$ . and therefore, + +$$ +\operatorname * {P r} _ {\mathbf {G}, \Sigma} [ \| \mathbf {G} _ {r} ^ {\mathsf {T}} \Sigma^ {2} \mathbf {G} _ {l} \| _ {\mathsf {F}} ^ {2} \geq \Omega (n ^ {2} \| \Sigma^ {2} \| _ {\mathsf {F}} ^ {2}) ] \geq 0. 8. +$$ + +Using a union bound with (5), we obtain that with probability $\geq 0.6$ , it is simultaneously true that + +$$ +\varepsilon^ {2} n ^ {2} \geq \| (1 / d) \mathbf {G} ^ {\top} \Sigma^ {2} \mathbf {G} - I \| _ {\mathsf {F}} ^ {2} \geq \frac {1}{d ^ {2}} \| \mathbf {G} _ {r} ^ {\top} \Sigma^ {2} \mathbf {G} _ {l} \| _ {\mathsf {F}} ^ {2} +$$ + +and + +$$ +\left\| \mathbf {G} _ {r} ^ {\top} \Sigma^ {2} \mathbf {G} _ {l} \right\| _ {\mathsf {F}} ^ {2} \geq \Omega (n ^ {2} \| \Sigma^ {2} \| _ {\mathsf {F}} ^ {2}) +$$ + +which implies that with probability $\geq 0.6$ , $(1 / d^{2})\| \Sigma^{2}\|_{\mathsf{F}}^{2} = O(\varepsilon^{2})$ i.e., $(1 / d^{2})\sum_{i = 1}^{m}\sigma_{i}^{4} = O(\varepsilon^{2})$ . Thus, if $\mathbf{S}$ is a random matrix that satisfies the AMM property and if $\sigma_1,\ldots ,\sigma_r$ are its singular values, then with probability $\geq 0.6$ , + +$$ +\sum_ {i} \sigma_ {i} ^ {4} \leq C _ {1} d ^ {2} \varepsilon^ {2} \tag {6} +$$ + +for a universal constant $C_1$ . + +We now obtain a different probability statement about the singular values of the sketching matrix $\mathbf{S}$ by considering the sum of squares of the diagonal entries of the matrix $(1 / d)\mathbf{G}^{\mathsf{T}}\Sigma^{2}\mathbf{G} - I = (1 / d)\sum_{i = 1}^{m}\sigma_{i}^{2}\mathbf{g}_{i}\mathbf{g}_{i}^{\mathsf{T}} - I$ where $\mathbf{g}_i$ are $n$ dimensional Gaussian vectors. Note that $((1 / d)\mathbf{G}^{\mathsf{T}}\Sigma^{2}\mathbf{G} - I)_{jj} = (1 / d)\sum_{i = 1}^{m}\sigma_{i}^{2}\mathbf{g}_{ij}^{2} - 1$ . Fix the matrix $\boldsymbol{\Sigma}$ . Clearly, + +$$ +\| (1 / d) \mathbf {G} ^ {\mathsf {T}} \Sigma^ {2} \mathbf {G} - I \| _ {\mathsf {F}} ^ {2} \geq \sum_ {j = 1} ^ {n} ((1 / d) \sum_ {i = 1} ^ {m} \sigma_ {i} ^ {2} \mathbf {g} _ {i j} ^ {2} - 1) ^ {2}. +$$ + +If $\sum_{i=1}^{m}\sigma_{i}^{2} \leq d/100$ , we have that with probability at least 0.9, $(1/d)\sum_{i=1}^{m}\sigma_{i}^{2}\mathbf{g}_{ij}^{2} \leq (10/d)\mathbb{E}[\sum_{i=1}^{m}\sigma_{i}^{2}\mathbf{g}_{ij}^{2}] \leq (10/d) \cdot (d/100)$ which implies that $((1/d)\sum_{i=1}^{m}\sigma_{i}^{2}\mathbf{g}_{ij}^{2}-1)^{2} \geq 1/4$ with probability $\geq 0.9$ . Let $j \in [n]$ be large if the previous event holds. By a Chernoff bound, with probability $\geq 0.9$ , there are $\geq n/C_2$ large values $j \in [n]$ for a large enough absolute constant $C_2$ . Thus, $\sum_{i=1}^{m}\sigma_{i}^{2} \leq d/100$ implies that with probability $\geq 0.9$ , $\|(1/d)G^{\top}\Sigma^{2}G - I\|_{\mathbb{F}}^{2} \geq (n/C_2)(1/4) = n/4C_2 \geq \varepsilon^{2}n^{2}$ as we assumed that $\varepsilon \leq c/\sqrt{n}$ for a small enough constant $c$ . Now, if $\operatorname*{Pr}_{\Sigma}[\sum_{i=1}^{m}\sigma_{i}^{2} \leq d/100] > 0.3$ , then by the above property for a fixed $\Sigma$ , $\operatorname*{Pr}_{\Sigma,G}[\| (1/d)\mathbf{G}^{\top}\Sigma^{2}\mathbf{G} - I\|_{\mathbb{F}}^{2} \geq \varepsilon^{2}n^{2}] > 0.2$ which implies that + +$$ +\operatorname * {P r} _ {\Sigma , \mathbf {G}} [ \| (1 / d) \mathbf {G} ^ {\top} \Sigma^ {2} \mathbf {G} - I \| _ {\mathsf {F}} ^ {2} \leq \varepsilon^ {2} n ^ {2} ] < 0. 8 +$$ + +which is a contradiction to (5). Thus, $\mathrm{Pr}_{\Sigma}[\| \Sigma \|_{\mathbb{F}}^2 \leq d / 100] < 0.3$ which implies + +$$ +\Pr_ {\Sigma} \left[ \sum_ {i = 1} ^ {m} \sigma_ {i} ^ {2} \geq d / 1 0 0 \right] \geq 0. 7. \tag {7} +$$ + +By a union bound on (6) and (7), with probability $\geq 0.3$ , it simultaneously holds that + +$$ +\sum_ {i = 1} ^ {m} \sigma_ {i} ^ {4} \leq C _ {1} d ^ {2} \varepsilon^ {2} \text {a n d} \sum_ {i = 1} ^ {m} \sigma_ {i} ^ {2} \geq d / 1 0 0. +$$ + +Now, + +$$ +d ^ {2} / 1 0 0 ^ {2} \leq \left(\sum_ {i = 1} ^ {m} \sigma_ {i} ^ {2}\right) ^ {2} \leq m \sum_ {i = 1} ^ {m} \sigma_ {i} ^ {4} \leq C _ {1} m d ^ {2} \varepsilon^ {2}. +$$ + +Here we used the Cauchy-Schwarz inequality which finally implies that $m = \Omega(1 / \varepsilon^2)$ . Thus, any oblivious distribution that gives AMM with $\varepsilon < c / \sqrt{n}$ for a small enough constant $c$ must have $\Omega(1 / \varepsilon^2)$ rows. + +Before proving Theorem 5.4, we first prove the following lemma that shows CountSketch preserves the Frobenius norm of a matrix. + +Lemma B.5 (CountSketch Preserves Frobenius Norms). If $\mathbf{S}$ is a CountSketch matrix with $m \geq 200 / \varepsilon^2$ , then for any arbitrary matrix $A$ , with probability $\geq 9 / 10$ , + +$$ +\| \mathbf {S} A \| _ {\mathsf {F}} ^ {2} = (1 \pm \varepsilon) \| A \| _ {\mathsf {F}} ^ {2}. +$$ + +Proof. For any vector $x$ , we have $\mathbb{E}[(\| \mathbf{S}x\|_2^2 - \| x\|_2^2)^2] \leq (2/m)\| x\|_2^4$ if $\mathbf{S}$ is a CountSketch matrix with $m$ rows. Now, + +$$ +\mathbb {E} [ | | \mathbf {S} x | | _ {2} ^ {2} - | | x | | _ {2} ^ {2} | ] ^ {2} \leq \mathbb {E} [ (| | \mathbf {S} x | | _ {2} ^ {2} - | | x | | _ {2} ^ {2}) ^ {2} ] \leq (2 / m) | | x | | _ {2} ^ {4} +$$ + +which implies that $\mathbb{E}[\| \mathbf{S}x\| _2^2 -\| x\| _2^2 ]\leq \sqrt{2 / m}\| x\| _2^2$ . For any arbitrary matrix $A$ , we have $\vert \vert \vert \vert A\vert \vert_2^2 -\vert \vert A\vert \vert_2^2\vert =$ $\begin{array}{r}\left|\sum_{i}\| \mathbf{S}A_{*i}\|_{\mathsf{F}}^{2} - \| A_{*i}\|_{\mathsf{F}}^{2}\right|\leq \sum_{i}\left|\| \mathbf{S}A_{*i}\|_{2}^{2} - \| A_{*i}\|_{2}^{2}\right|. \end{array}$ Thus, $\mathbb{E}[\vert \vert \vert \vert \vert \vert \vert A\vert \vert_2^2 -\vert \vert A\vert \vert_2^2\vert ]\leq \sum_i\mathbb{E}[\vert \vert \vert \vert \vert A_{*i}\vert \vert_2^2 -\vert \vert A_{*i}\vert \vert_2^2 ]]\leq$ $\sqrt{2 / m}\sum_{i}\| A_{*i}\|_{2}^{2} = \sqrt{2 / m}\| A\|_{\mathsf{F}}^{2}$ . For $m\geq 200 / \varepsilon^2$ , we have $\mathbb{E}[\vert \vert \vert \vert \vert A\vert \vert_2^2 -\vert \vert A\vert \vert_2^2\vert ]\leq (\varepsilon /10)\| A\|_{\mathsf{F}}^{2}$ . By Markov's inequality, with probability $\geq 9 / 10$ n $\| S A\|_{\mathsf{F}}^{2} = (1\pm \varepsilon)\| A\|_{\mathsf{F}}^{2}$ + +Proof of Theorem 5.4. Given $n$ and $\varepsilon \leq c / \sqrt{n}$ for a small enough constant, assume that for $d = C_1 / \varepsilon^2$ for a large enough universal constant $C_1$ , there is a random matrix $\mathbf{S}$ with $r < C_2 / \varepsilon^2$ rows such that for any fixed matrix $A \in \mathbb{R}^{d \times n}$ , with probability $\geq 99 / 100$ , + +$$ +\| A ^ {\mathsf {T}} \mathbf {S} ^ {\mathsf {T}} \mathbf {S} A - A ^ {\mathsf {T}} A \| _ {\mathsf {F}} \leq (\varepsilon / 3) \| A ^ {\mathsf {T}} \| _ {\mathsf {F}} \| A \| _ {\mathsf {F}}. +$$ + +Now consider an arbitrary matrix $B \in \mathbb{R}^{d' \times n}$ for $d' \geq Cn / \varepsilon^2$ for which the previous lemma applies. Let $\mathbf{S}_1$ be a CountSketch matrix with $K / \varepsilon^2$ rows for a large enough $K$ . With probability $\geq 95 / 100$ , we simultaneously have (i) $\| B^\top \mathbf{S}_1^\top \mathbf{S}_1 B - B^\top B \|_{\mathsf{F}} \leq (\varepsilon / 3) \| B^\top \|_{\mathsf{F}} \| B \|_{\mathsf{F}} = (\varepsilon / 3) \| B \|_{\mathsf{F}}^2$ , and (ii) $\| \mathbf{S}_1 B \|_{\mathsf{F}} = (1 \pm \varepsilon / 3) \| B \|_{\mathsf{F}}$ . By picking $C_1$ large enough, we have that $C_1 \geq K$ . Thus, by our assumption, the random matrix $\mathbf{S}$ gives the AMM property for the matrix $\mathbf{S}_1 A$ . Conditioning on the above events, we have with probability $\geq 99 / 100$ that + +$$ +\begin{array}{l} \| B ^ {\top} \mathbf {S} _ {1} ^ {\top} \mathbf {S} ^ {\top} \mathbf {S} \mathbf {S} _ {1} B - B ^ {\top} \mathbf {S} _ {1} ^ {\top} \mathbf {S} _ {1} B \| _ {F} \\ \leq (\varepsilon / 3) \| B ^ {\mathsf {T}} \mathbf {S} _ {1} ^ {\mathsf {T}} \| _ {\mathsf {F}} \| \mathbf {S} _ {1} B \| _ {\mathsf {F}} \\ \leq (\varepsilon / 3) (1 + \varepsilon / 3) ^ {2} \| B \| _ {\mathbb {F}} ^ {2} \leq (\varepsilon / 2) \| B \| _ {\mathbb {F}} ^ {2}. \\ \end{array} +$$ + +By the triangle inequality, we obtain $\| B^{\mathsf{T}}\mathbf{S}_1^{\mathsf{T}}\mathbf{S}^{\mathsf{T}}\mathbf{S}\mathbf{S}_1B - B^{\mathsf{T}}B\|_{\mathbb{F}}\leq (\varepsilon /3 + \varepsilon /2)\| B\|_{\mathbb{F}}^2\leq \varepsilon \| B\|_{\mathbb{F}}^2$ . Thus, by a union bound, with probability $\geq 0.9$ , the random matrix $\mathbf{S}\cdot \mathbf{S}_1$ satisfies that for any fixed matrix $B$ with $\geq Cn / \varepsilon^2$ rows, with probability $\geq 0.9$ + +$$ +\left\| B ^ {\mathsf {T}} \left(\mathbf {S} \cdot \mathbf {S} _ {1}\right) ^ {\mathsf {T}} \left(\mathbf {S} \cdot \mathbf {S} _ {1}\right) B - B ^ {\mathsf {T}} B \right\| _ {\mathsf {F}} \leq \varepsilon \| B \| _ {\mathsf {F}} ^ {2} +$$ + +implying that even for a matrix with at least $Cn / \varepsilon^2$ rows, there is an oblivious sketching distribution with $r < C_2 / \varepsilon^2$ rows which gives an AMM guarantee. This contradicts the previous lemma and hence our assumption that there is a small sketching matrix for matrices with $d = C_1 / \varepsilon^2$ rows is false. Thus, we have that for any $d \geq C / \varepsilon^2$ for a large enough constant $C$ , there is no sketching distribution with $< C_1 / \varepsilon^2$ rows that gives the $\varepsilon$ AMM guarantee for matrices with $\geq d$ rows. + +# C. Missing Proofs from Section 6 + +# C.1. Lower Bounds for Ridge Regression + +Note that multiplying a column of $M$ with $-1$ does not change the optimum value. Therefore, without loss of generality, we can assume that the columns of $M$ are either $[11]^{\mathrm{T}}$ or $[1 - 1]^{\mathrm{T}}$ . Thus, we have that $d - N$ columns of $M$ are equal to $[11]^{\mathrm{T}}$ and $N$ columns of the matrix $M$ are equal to $[1 - 1]^{\mathrm{T}}$ . Let $I \subseteq [n]$ , $|I| = N$ be the set of columns of $M$ that are equal to + +$[1 - 1]^{\top}$ . Now, for any vector $x$ , + +$$ +\begin{array}{l} \| M x - \left[ \begin{array}{c} 1 \\ - 1 \end{array} \right] \| _ {2} ^ {2} + \lambda \| x \| _ {2} ^ {2} \\ = \left(\sum_ {i \in I} x _ {i} + \sum_ {i \notin I} x _ {i} - 1\right) ^ {2} + \left(- \sum_ {i \in I} x _ {i} + \sum_ {i \notin I} x _ {i} + 1\right) ^ {2} \\ + \lambda \sum_ {i \in I} x _ {i} ^ {2} + \lambda \sum_ {i \not \in I} x _ {i} ^ {2} \\ = 2 \left(\sum_ {i \notin I} x _ {i}\right) ^ {2} + 2 \left(\sum_ {i \in I} x _ {i} - 1\right) ^ {2} + \lambda \sum_ {i \in I} x _ {i} ^ {2} + \lambda \sum_ {i \notin I} x _ {i} ^ {2}. \\ \end{array} +$$ + +Clearly, to minimize the expression, we need to set $x_{i} = 0$ for $i \notin I$ . We also have that for a fixed value of $\sum_{i \in I} x_{i}$ , the expression $\sum_{i \in I} x_{i}^{2}$ is minimized when $x_{i} = x_{i'}$ for all $i, i' \in I$ . Let $x_{i} = \alpha$ for all $i \in I$ . Then, + +$$ +\| M x - \left[ \begin{array}{c} 1 \\ - 1 \end{array} \right] \| _ {2} ^ {2} + \lambda \| x \| _ {2} ^ {2} = 2 (N \alpha - 1) ^ {2} + \lambda N \alpha^ {2}. +$$ + +To minimize the expression, we set $\alpha = 2 / (2N + \lambda)$ and obtain that + +$$ +\min _ {x} \| M x - \left[ \begin{array}{c} 1 \\ - 1 \end{array} \right] \| _ {2} ^ {2} + \lambda \| x \| _ {2} ^ {2} = \frac {2 \lambda}{\lambda + 2 N}. +$$ + +# D. Communication Lower Bounds for other Regularized Problems + +We show communication lower bounds for computing $1 + \varepsilon$ approximations to optimum values of Lasso and the square-root Lasso problems by reducing the DISJOINTNESS problem to computing these optimum values. + +In an instance of DisJOINTNESS problem Alice receives a set $A \subseteq [n]$ and Bob receives a set $B \subseteq [n]$ . They send bits to each other to communicate based on a pre-determined protocol to find if $A \cap B = \emptyset$ or not. + +Theorem D.1 (Hardness of DISJOINTNESS (Håstad & Wigderson, 2007)). Every public-coin randomized protocol for DISJOINTNESS that has two-sided error at most a constant $\varepsilon \in (0,1/2)$ uses $\Omega(n)$ communication in the worst case (over inputs and coin flips). + +Theorem D.2 (Communication Complexity of Lasso). Let $0 < \lambda < 1$ be the Lasso parameter. If Alice has the $n \times d$ matrix $M_1$ and Bob has the $n \times d$ matrix $M_2$ , then to determine a $1 + c$ approximation, for a small enough constant $c$ , to the optimal value of + +$$ +\min _ {z} \| (M _ {1} + M _ {2}) z - b \| _ {2} ^ {2} + \lambda \| z \| _ {1} +$$ + +requires $\Omega (d)$ bits of communication between Alice and Bob. + +Proof. We prove the theorem by reducing the DISJOINTNESS problem to an instance of the Lasso problem. Let $A, B \subseteq [d]$ denote the sets received by Alice and Bob, respectively. Let $x^{(1)}, x^{(2)} \in \{0, 1\}^d$ be the vectors that denote $A$ and $B$ respectively. We have $x_i^{(1)} = 1$ if and only if $i \in A$ and similarly $x_i^{(2)} = 1$ if and only if $i \in B$ . Let $M$ denote a $2 \times d$ matrix with two rows such that $M_{1*} = x^{(1)}$ and $M_{2*} = x^{(2)}$ . We consider the Lasso problem: + +$$ +\min _ {z} \| M z - \left[ \begin{array}{c} 1 \\ 1 \end{array} \right] \| _ {2} ^ {2} + \lambda \| z \| _ {1} +$$ + +for some $0 < \lambda < 1$ . + +Consider the following two cases: + +1. $A \cap B \neq \emptyset$ : Let $i \in A \cap B$ . We have $x_i^{(1)} = x_i^{(2)} = 1$ and therefore $M_{1i} = M_{2i} = 1$ . Let $z = e_i$ . We have $Me_i = [1 \quad 1]^{\top}$ . Therefore + +$$ +\| M e _ {i} - \left[ \begin{array}{c} 1 \\ 1 \end{array} \right] \| _ {2} ^ {2} + \lambda \| e _ {i} \| _ {1} = 0 + \lambda = \lambda . +$$ + +Therefore $\min_{z}\| Mz - 1_2\| _2^2 +\lambda \| z\| _1\leq \lambda$ + +2. Let $A \cap B = \emptyset$ . Let $z$ be an arbitrary vector. We have $M_{1*}z = \sum_{i\in A}z_{i}$ and $M_{2*}z = \sum_{i\in B}z_{i}$ . Thus, + +$$ +\| M z - 1 _ {2} \| _ {2} ^ {2} + \lambda \| z \| _ {1} = (\sum_ {i \in A} z _ {i} - 1) ^ {2} + (\sum_ {i \in B} z _ {i} - 1) ^ {2} + \lambda (\sum_ {i \in A} | z _ {i} | + \sum_ {i \in B} | z _ {i} |), +$$ + +We can see that the optimum value can be attained by setting $z_{i} = \alpha$ for some $i\in A$ and $z_{j} = \beta$ for some $j\in B$ and setting the rest of the coordinates to 0. We now consider + +$$ +\min _ {\alpha} (\alpha - 1) ^ {2} + \lambda \alpha . +$$ + +The optimal solution for the above is attained at $\alpha$ satisfying $2(\alpha - 1) + \lambda = 0$ which gives $\alpha = 1 - \lambda / 2$ . Thus the optimum value for + +$$ +\min _ {z} \| M z - 1 _ {2} \| _ {2} ^ {2} + \lambda \| z \| _ {1} +$$ + +when $A\cap B = \emptyset$ is given by + +$$ +2 \cdot \frac {\lambda^ {2}}{4} + \lambda (2 - \lambda) = 2 \lambda - \lambda^ {2} / 2 \geq 3 \lambda / 2. +$$ + +The optimal Lasso values differ by a factor of at least $3/2$ . Thus a protocol that can compute $1 + c$ approximation to the optimal value of ridge regression can be used to solve the DISJOINTNESS problem which gives an $\Omega(d)$ bits lower bound for approximating Lasso. + +We similarly have the following communication lower bounds for Square-root Lasso. + +Theorem D.3 (Hardness of Sketching Square-Root Lasso). Let $0 < \lambda < 2\sqrt{2}/3$ be the Lasso parameter. If Alice has the $n \times d$ matrix $M_1$ and Bob has the $n \times d$ matrix $M_2$ , then to determine a $1 + c$ approximation, for a small enough constant $c$ , to the optimal value of + +$$ +\min _ {z} \| (M _ {1} + M _ {2}) z - b \| _ {2} + \lambda \| z \| _ {1}, +$$ + +requires $\Omega (d)$ bits of communication between Alice and Bob. + +Proof. We use the same notation as in the proof of the above theorem. In the case of $A \cap B \neq \emptyset$ , we again have that the optimum value is at most $\lambda$ . In the other case, where $A \cap B = \emptyset$ , we again have that the optimum value can be attained by setting $z_{i} = \alpha = z_{j}$ for some $i \in A$ and $j \in B$ . Thus we have the following optimization problem + +$$ +\min _ {\alpha} \sqrt {2} | \alpha - 1 | + 2 \lambda | \alpha | = \min (\sqrt {2}, 2 \lambda). +$$ + +Thus, the optimum value of the square-root Lasso problem is at most $\lambda$ in the case $A\cap B\neq \emptyset$ and is at least $\min (\sqrt{2},2\lambda)$ in the case of $A\cap B = \emptyset$ . If $\lambda < 2\sqrt{2} /3$ , then $\min (\sqrt{2},2\lambda)\geq (3\lambda /2)$ . Thus, if Alice and Bob can obtain an $11 / 10$ approximation for the Square-Root Lasso instance $(M,1_{2},\lambda)$ for some $\lambda < 2\sqrt{2} /3$ , they can solve the DISJOINTNESS instance which implies an $\Omega (d)$ bit lower bound for computing a $1 + c$ approximation for Square-Root Lasso. + +# E. An Experiment + +We run our algorithm on a ridge regression instance with a $6000 \times 70000$ matrix $A$ whose entries are independent Gaussian random variables. We set $\lambda$ such that $\sigma^2 / \lambda \approx 1$ . Naively computing $x^* = A^\top (AA^\top + \lambda I)^{-1}b$ takes $t_{\mathrm{naive}} = 71$ seconds on our machine. We use OSNAP with sparsity $s = 8$ and vary the number $r$ of rows and observe the running times and quality of the solution that is obtained by our algorithm. + +Our experiments show the general trends we expect. Increasing the number of rows in the sketching matrix results in a solution $\tilde{x}$ that has lower cost and also is closer to the optimum solution $x^{*}$ . We also see that the running time of the algorithm is nearly linear in the sketch size $r$ , implying that the time required to apply the sketch is negligible for this instance. At sketch size $r = 30000$ , that is less than $d / 2$ , we see that the algorithm runs nearly $40\%$ faster than the naive algorithm while computing a solution that has a cost within $5\%$ of the optimum. For larger values of $d$ , we expect to obtain a greater speedup as compared to naively computing $x^{*}$ . + +Notice that we do not compare with the algorithm of Chowdhury et al. (2018) as for one iteration, our algorithm is exactly the same as theirs. Our theorems show that the sketch can be smaller and sparser than what is shown in their work to compute $1 + \varepsilon$ approximate solutions, giving the first proof of correctness about the quality of the solution at smaller sketch sizes. + +![](images/33e87f611122ec9f660ea59f3d45d1b6ddb89c7f991a77df3a174936c62db01f.jpg) +Figure 1. $t_{\mathrm{alg}} / t_{\mathrm{naive}}$ vs # of rows of OSNAP + +![](images/dd7828e4413f5c65d26c8328701c35ab65d54d2e7fd6209e2e9ae83303173dde.jpg) +Figure 2. $\cos (\tilde{x}) / \mathrm{Opt}$ vs # of rows of OSNAP + +![](images/0dff18f3bcaa4e20c9e41c323902746cf9d3f10193e50c41196e5bb2e4549e14.jpg) +Figure 3. $\| \tilde{x} - x^{*}\|_{2} / \| x^{*}\|_{2}$ vs # of rows of OSNAP \ No newline at end of file diff --git a/sketchingalgorithmsandlowerboundsforridgeregression/images.zip b/sketchingalgorithmsandlowerboundsforridgeregression/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..9cf6283db4ce4068bd41dc84cd55bfae12cc49c0 --- /dev/null +++ b/sketchingalgorithmsandlowerboundsforridgeregression/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:df86d8498c0f09509af7ef68424a9c82e4a3781920a6dd99ea1a69018a9cad35 +size 632786 diff --git a/sketchingalgorithmsandlowerboundsforridgeregression/layout.json b/sketchingalgorithmsandlowerboundsforridgeregression/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..c7ef49197d9e4f52b5cca1b19aca6b1aeb70bb58 --- /dev/null +++ b/sketchingalgorithmsandlowerboundsforridgeregression/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:acd1d06a3d5f585c5988f0da181f858c1dfd5af4d48fa1ba3424282adc93aa8f +size 1521631 diff --git a/skexgenautoregressivegenerationofcadconstructionsequenceswithdisentangledcodebooks/23534b62-3c8b-4049-bc4d-a3f55d2426af_content_list.json b/skexgenautoregressivegenerationofcadconstructionsequenceswithdisentangledcodebooks/23534b62-3c8b-4049-bc4d-a3f55d2426af_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..0081db4ecb182c05e56f6f2c36a18d3032c1d2d8 --- /dev/null +++ b/skexgenautoregressivegenerationofcadconstructionsequenceswithdisentangledcodebooks/23534b62-3c8b-4049-bc4d-a3f55d2426af_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c92deecdcaf40daa9acc37be382a98bfc8a8fb04eda36c521ef44e360e72ad34 +size 86564 diff --git a/skexgenautoregressivegenerationofcadconstructionsequenceswithdisentangledcodebooks/23534b62-3c8b-4049-bc4d-a3f55d2426af_model.json b/skexgenautoregressivegenerationofcadconstructionsequenceswithdisentangledcodebooks/23534b62-3c8b-4049-bc4d-a3f55d2426af_model.json new file mode 100644 index 0000000000000000000000000000000000000000..6d6ae8326227ebf1e2a49e162ea072b9bb82710d --- /dev/null +++ b/skexgenautoregressivegenerationofcadconstructionsequenceswithdisentangledcodebooks/23534b62-3c8b-4049-bc4d-a3f55d2426af_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8f05a6a14481edfadd8136a74dd8a504fb66f495bf212bf0c58574861a1be93a +size 108616 diff --git a/skexgenautoregressivegenerationofcadconstructionsequenceswithdisentangledcodebooks/23534b62-3c8b-4049-bc4d-a3f55d2426af_origin.pdf b/skexgenautoregressivegenerationofcadconstructionsequenceswithdisentangledcodebooks/23534b62-3c8b-4049-bc4d-a3f55d2426af_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..002afb9118b0f9a6b7cfbde86ba2b88762055976 --- /dev/null +++ b/skexgenautoregressivegenerationofcadconstructionsequenceswithdisentangledcodebooks/23534b62-3c8b-4049-bc4d-a3f55d2426af_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eca9bd160434ec656acda4bcfc34c38d4f4c8d0ef6d98419c12027681ce13090 +size 15318030 diff --git a/skexgenautoregressivegenerationofcadconstructionsequenceswithdisentangledcodebooks/full.md b/skexgenautoregressivegenerationofcadconstructionsequenceswithdisentangledcodebooks/full.md new file mode 100644 index 0000000000000000000000000000000000000000..e48d9ba1cf67d591baf80a61faa72ad51bf43421 --- /dev/null +++ b/skexgenautoregressivegenerationofcadconstructionsequenceswithdisentangledcodebooks/full.md @@ -0,0 +1,369 @@ +# SkexGen: Autoregressive Generation of CAD Construction Sequences with Disentangled Codebooks + +Xiang Xu $^{1}$ Karl D.D. Willis $^{2}$ Joseph G. Lambourne $^{2}$ + +Chin-Yi Cheng² Pradeep Kumar Jayaraman² Yasutaka Furukawa¹ + +# Abstract + +We present SkexGen, a novel autoregressive generative model for computer-aided design (CAD) construction sequences containing sketch-and-extrude modeling operations. Our model utilizes distinct Transformer architectures to encode topological, geometric, and extrusion variations of construction sequences into disentangled codebooks. Autoregressive Transformer decoders generate CAD construction sequences sharing certain properties specified by the codebook vectors. Extensive experiments demonstrate that our disentangled codebook representation generates diverse and high-quality CAD models, enhances user control, and enables efficient exploration of the design space. The code is available at https://samxuxiang.github.io/skexgen. + +# 1. Introduction + +Professional designers generate a diverse set of computer aided design (CAD) models with topological or geometric variations while achieving a design goal. In early concept design, designers explore shapes with aesthetic and functional advantages. In mechanical design, designers optimize the physical properties of a part to maximize strength while minimizing weight and manufacturing cost. + +Training a computational agent with the capabilities of a professional designer is an extremely challenging machine learning task. Designers traditionally rely on parametric CAD models that allow one to correct small mistakes (Camba et al., 2016), optimize geometric properties (Grasel et al., 2004), and generate a product family by altering just a few parameters (Chakrabarti et al., 2011; Maher et al., 1996). However, a parametric CAD model + +is brittle and fails over large design changes such as topological modifications. Furthermore, the construction of a parametric CAD model itself requires the expertise of a professional designer. + +With the advance of deep learning, neural networks empower a family of exciting new methodologies (Wu et al., 2021; Willis et al., 2021a; Ganin et al., 2021) towards an intelligent system capable of diverse generation while understanding a design goal and allowing user control. This paper pushes the frontier of the state-of-the-art by introducing "SkexGen", a sketch-and-extrude generative model for CAD construction sequences that enhances variations in design generation while enabling effective control and exploration of the design space. + +SkexGen is a novel autoregressive generative model that uses discrete codebooks (van den Oord et al., 2017) for CAD model generation. We employ a sketch-and-extrude modeling language to describe CAD construction sequences, where a sketch operation creates 2D primitives and an extrude operation lifts and combines them into 3D. Transformer encoders learn a disentangled latent representation as three codebooks, capturing topological, geometric, and extrusion variations. Given codebook vectors, autoregressive Transformer decoders generate sketch-and-extrude construction sequences, which are processed into a CAD model. + +We evaluate SkexGen on a large-scale sketch-and-extrude dataset (Wu et al., 2021). Qualitative and quantitative evaluations against multiple baselines and state-of-the-art methods demonstrate that our method generates more realistic and diverse CAD models, while allowing effective control and efficient exploration of the design space not possible with prior approaches. We make the following contributions. + +- SkexGen architecture that autoregressively generates high quality and diverse CAD construction sequences. +- Disentangled codebooks, which encode topological, geometric, and extrusion variations of construction sequences, enabling effective control and exploration of designs. +- Extensive qualitative and quantitative evaluations on public benchmarks, demonstrating state-of-the-art performance. + +# 2. Related Work + +Constructive Solid Geometry: 3D shapes can be expressed as a constructive solid geometry (CSG) tree, where parametric primitives, such as cuboids, spheres, and cones, are combined together with Boolean operations. This lightweight representation has been used extensively for reconstruction tasks in combination with program synthesis (Du et al., 2018; Nandi et al., 2017; 2018), neurally-guided program synthesis (Sharma et al., 2018; Ellis et al., 2019; Tian et al., 2019), unsupervised learning (Kania et al., 2020), and with specialized parametric primitives (Chen et al., 2020; Yu et al., 2022). Although CSG is a convenient representation, parametric CAD remains the most prevalent paradigm for mechanical design and makes extensive use of the sketch-and-extrude modeling operations instead. + +Construction Sequence Generation: A precursor to sketch-and-extrude construction sequence generation is PolyGen (Nash et al., 2020), where $n$ -gon mesh vertices and faces are predicted using Transformers (Vaswani et al., 2017) and pointer networks (Vinyals et al., 2015). Large-scale datasets of parametric CAD construction sequences (Seff et al., 2020; Willis et al., 2021b) have opened the door to learning directly from the modeling operations by CAD users. (Willis et al., 2021b) and (Xu et al., 2021) predict the sequence of extrude operations for partial recovery of the construction sequence without the underlying sketch information. Predicting sequences of sketch primitives (e.g., line, arc, circle) is a critical building block that forms the 2D basis of CAD and can be readily extended to 3D with the addition of the extrude operation. + +The Transformer architecture has enabled sketch/sketch-and-extrude construction sequence generation in recent (Willis et al., 2021a; Wu et al., 2021) and concurrent (Para et al., 2021; Seff et al., 2022; Ganin et al., 2021) work. Although these approaches can produce a diverse range of shapes, providing user control over an existing design is more elusive. To be useful for real world CAD applications, the designer needs a way to influence the generated shape. One approach is to condition the network on user-provided images (Ganin et al., 2021), point clouds (Wu et al., 2021), or hand-drawn sketches (Seff et al., 2022). However, this approach simply converts an existing design into a CAD construction sequence representation. Instead we present a novel approach for exploring the space of related designs with separate control over topology and geometry. + +Codebook Architectures: Codebooks have proven effective on a number of image and audio generation tasks since their introduction by (van den Oord et al., 2017), improving the diversity of generated images (Razavi et al., 2019) and providing additional user control (Esser et al., 2021). They are particularly suited to encoding CAD modeling + +sequences due to their high structural regularity. + +# 3. Sketch-and-Extrude Construction Sequence + +We define a sketch-and-extrude construction sequence representation as a hierarchy of primitives, building on TurtleGen (Willis et al., 2021a) and DeepCAD (Wu et al., 2021) with several modifications to make the representation more expressive and amenable for learning (See Figure 1). + +Primitive Hierarchy: A "curve" (i.e., line, arc, or circle) is the lowest-level primitive. A "loop" is a closed path, consisting of one (i.e., circle) or multiple curves (e.g., linearc-line). A "face" is a 2D area bounded by loops, which is new in our representation. Precisely, a face is defined by one outer loop and some number of inner loops as holes, a convention in many CAD systems (Lee & Lee, 2001). A "sketch" is formed by one or multiple faces. An "extruded-sketch" is a 3D volume, formed by extruding a sketch. A "sketch-and-extrude" model is formed by multiple extruded-sketches via Boolean operations (i.e., intersection, union, and subtraction). Note that the DeepCAD (Wu et al., 2021) representation does not have a face primitive and cannot represent a sketch with multiple faces (e.g., $ES_{1}$ in Figure 1). + +Construction Sequence: Following DeepCAD (Wu et al., 2021), we represent a sketch-and-extrude CAD model using a sequence with five types of tokens: 1) A topology token indicates a curve type (line/arc/circle); 2) A geometry token contains a point coordinate; 3) An end-primitive token indicates the end of a primitive (curve/loop/face/sketch/extruded-sketch); 4) An extrusion token contains parameters associated with the extrusion and Boolean operations; and 5) An end-sequence token indicates the end of the sequence. Figure 1 illustrates a sample primitive hierarchy and a sequence. We provide the full language specification in Appendix A. + +# 4. SkexGen Architecture + +SkexGen is an autoregressive generative model that learns variations of sketch-and-extrude models with three disentangled codebooks in two network branches. Figure 2 visualizes the SkexGen architecture. The "Sketch" branch learns topological and geometric variations of 2D sketches, while the "Extrude" branch learns variations of 3D extrusions (e.g., directions). Both branches are similar and this section explains the sketch branch with two encoders and one decoder. Details of the extrude branch are in Appendix B. + +# 4.1. Topology Encoder + +The topology encoder takes a subsequence of the input, where the token is either 1) a topology token $(T)$ , which indicates one of the 3 curve types (line/arc/circle); 2) an + +![](images/a4e844d772c066c9859653919f43876cf91eeacf9e2d0ac6c29a297aa5892157.jpg) +Figure 1. A sample sketch-and-extrude model is illustrated as a primitive hierarchy and a code sequence. It consists of two sketches, which are formed by faces, loops, and curves. The sequence starts by a topology token $(T_{1})$ , indicating the start of a curve (type arc). Two geometry tokens follow $(G_{1}$ and $G_{2})$ , each of which stores a 2D point coordinate. Note that a circle is defined by four points with four geometry tokens (e.g., $G_{5} - G_{8}$ ). An arc is defined by three points (e.g., $G_{1} - G_{3}$ ) but with two tokens, where the third point is specified by the next curve (or the first curve when a loop is closed). Similarly, a line is defined by start point (e.g., $G_{4}$ ). $G_{8}$ is the last point for curve $(C_4)$ , loop $(L_{2})$ , and face $(F_{1})$ . Therefore, the geometry token $(G_{8})$ is followed by end-primitive tokens for curve, loop, and face. + +end-primitive token $(E)$ for one of the 3 primitive types (loop/face/sketch); or 3) An end-sequence token $(End)$ , indicating the end of the sequence. Accordingly, a token is initialized with a one-hot vector of dimension $7(= 3 + 3 + 1)$ . + +Embeddings: The one-hot vector is transformed into a $d_{\mathrm{E}} = 256$ dimensional embedding. We consider a topology token $T$ in the subsequence where $h_{T}^{tp}$ is the 7-dim one hot vector and $i_{T}$ denotes its index in the input subsequence. Its embedding vector is computed as: + +$$ +T \leftarrow \mathbf {W} ^ {\mathbf {t p}} h _ {T} ^ {t p} + \mathbf {p} ^ {(i _ {T})}, \tag {1} +$$ + +where $\mathbf{W}^{\mathbf{tp}}\in \mathbb{R}^{d_{\mathrm{E}}\times 7}$ denotes a learnable matrix. $\mathbf{p}^{(i_T)}\in$ $\mathbb{R}^{d_E}$ denotes the learnable position encoding at index $i_T$ of the topology subsequence1. + +Architecture: The encoder is based on a standard Transformer architecture (Vaswani et al., 2017) with four layer blocks, each of which contains a self-attention layer with eight heads, layer-normalization and feed-forward layers. Following Vision Transformer (Dosovitskiy et al., 2021), the input topology information is encoded into a "code + +token", which is pretended to the input and initialized with a learnable embedding $Z_{tp}$ . Let $Z_{tp}^{e}$ be the embedding of a code-token at the output of the encoder. The embedding $Z_{tp}^{e}$ is quantized to the closest code in the codebook of size $N$ : $\{\mathbf{b}_{tp}^{(i)} \mid i = 1,2\dots N\}$ . The final code-token $Z_{tp}^{Q}$ after encoding and quantization is then passed to the decoder: + +$$ +Z _ {t p} ^ {Q} \leftarrow \mathbf {b} _ {t p} ^ {(k)}, \text {w h e r e} k = \operatorname {a r g m i n} _ {j} \| Z _ {t p} ^ {e} - \mathbf {b} _ {t p} ^ {(j)} \| ^ {2}. \tag {2} +$$ + +Here we assumed one code-token for simplicity. In practice, the topology encoder has four code-tokens and makes four output codes $\left(Z_{tp}^{Q_{(1)}}, Z_{tp}^{Q_{(2)}}, Z_{tp}^{Q_{(3)}}, Z_{tp}^{Q_{(4)}}\right)$ . We tried different codebook sizes and found that $N = 500$ achieves good results. + +# 4.2. Geometry Encoder + +The geometry encoder takes a subsequence of the input, where a token is either 1) a geometry token $(G)$ ; 2) an end-primitive token $(E)$ for one of the 4 primitive types (curve/face/loop/sketch); or 3) an end-sequence token $(End)$ . The geometry token $G$ specifies a 2D point coordinate along a curve. Since a coordinate is numerical, we discretize sketches into $64 \times 64$ (6 bits) pixels and consider + +![](images/685eac6d47fb9a9626e83154dbcc9e772d89b9c75dfdca3d7c529180f983317a.jpg) +Figure 2. The SkexGen architecture has two branches. The sketch branch (left) has two encoders that learn topological and geometric variations of sketches in two codebooks. An autoregressive decoder generates the sketch subsequence given codebook vectors. The extrude branch (right) has an encoder and a decoder that learns variations of extrude and Boolean operations. The two branches are trained independently. Another autoregressive decoder learns to select effective combinations of codes from the three codebooks (not shown). + +$64^{2}$ possible pixel locations $^{2}$ . Therefore, a one-hot vector of dimension $4101(= 64^{2} + 4 + 1)$ uniquely determines the token information. + +Embeddings: We follow Eq. 1 and use a learnable matrix $\mathbf{W}^{\mathrm{ge}}\in \mathbb{R}^{d_{\mathrm{E}}\times 4101}$ together with position encoding to initialize input token embeddings. Token $E$ and $End$ are initialized similarly to the topology token $T$ , by multiplying their one-hot vector with $\mathbf{W}^{\mathrm{ge}}$ and adding the position encoding. Geometry tokens $G$ are initialized differently as: + +$$ +G \leftarrow \mathbf {W} ^ {\mathbf {g e}} h _ {G} ^ {g e} + \mathbf {W} ^ {\mathbf {x}} h _ {G} ^ {x} + \mathbf {W} ^ {\mathbf {y}} h _ {G} ^ {y} + \mathbf {p} ^ {(i _ {G})}. \tag {3} +$$ + +$h_{G}^{ge}\in \mathbb{R}^{4101}$ denotes the one-hot vector. The geometry tokens $G$ have additional coordinate embeddings where $h_G^x,h_G^y\in \mathbb{R}^{64}$ is a one-hot vector indicating the x, y coordinate of the pixel. $\mathbf{W}^{\mathbf{x}},\mathbf{W}^{\mathbf{y}}\in \mathbb{R}^{d_{\mathrm{E}}\times 64}$ are learnable coordinate matrices. Coordinate embeddings are optional but further improve results in our experiments. + +Architecture: Similar to the topology encoder, code-tokens in the geometry encoder produces the embedding $\{Z_{ge^{(i)}}^{\epsilon (i)}\}$ and the quantized code $\{Z_{ge}^{Q(i)}\}$ . We use two code-tokens for the geometry encoder $(i = 1,2)$ . Codebook size is 1000. + +# 4.3. Sketch Decoder + +The sketch decoder takes as input the topology and geometry codebooks and generates geometry tokens $G$ and end-primitive tokens $E$ (for curve/loop/face/sketch) to recover the sketch subsequence. Note that topology tokens $T$ are + +not generated, as they can be inferred from the number of geometry tokens within each curve (i.e., line/arc/circle have $1/2/4$ G tokens). This means that geometry encoder and sketch decoder have similar subsequence (see Figure 2). + +Input: Given the past $k - 1$ tokens, the autoregressive decoder predicts the conditional probability of the $k^{\text{th}}$ token. The training input sequences are shifted one to the right, with the "start" symbol (initialized by the position encoding) added at front. Since the types of possible tokens in the decoder are equivalent to those of the geometry encoder, we use the same one-hot encoding scheme of dimension 4101 and also a learnable matrix of size $d_{\mathrm{E}} \times 4101$ with position encoding to initialize the embedding vectors. + +Output: The decoder produces a subsequence "shifted one to the left", that is, predicting the original $k$ tokens in the input (See Figure 2). Let $K$ be a token in the output of sketch decoder, which has a $d_{\mathrm{E}}$ dimensional embedding. We use a learnable matrix $\mathbf{W}^{\mathrm{out}} \in \mathbb{R}^{4101 \times d_{\mathrm{E}}}$ to predict the probability likelihood over 4101 classes as: + +$$ +h _ {K} ^ {\text {o u t}} \leftarrow \operatorname {s o f t m a x} \left(\mathbf {W} ^ {\text {o u t}} K\right). \tag {4} +$$ + +Cross-attention: The Transformer architecture takes four and two quantized codebook vectors from the topology and the geometry codebooks via cross-attention. To distinguish two different codebooks, we borrow the idea of position encoding and add learnable embedding vectors $\mathbf{p}^{(q_{tp})} \in \mathbb{R}^{4 \times d_{\mathrm{E}}}$ and $\mathbf{p}^{(q_{ge})} \in \mathbb{R}^{2 \times d_{\mathrm{E}}}$ to the topology code $\{Z_{tp}^{Q(i)}\}$ and geometry code $\{Z_{ge}^{Q(i)}\}$ respectively: + +$$ +Z _ {t p} ^ {Q (i)} + \mathbf {p} ^ {\left(q _ {t p}\right)} \quad \text {o r} \quad Z _ {g e} ^ {Q (i)} + \mathbf {p} ^ {\left(q _ {g e}\right)}. \tag {5} +$$ + +The base network setting is the same as the encoder (i.e., 4 layer-blocks with 8 heads), except that it is autoregressive with masking (only previous tokens are attended). + +# 4.4. Training + +The topology encoder, geometry encoder, and sketch decoder are jointly trained with three loss functions: + +$$ +\sum_ {K} \operatorname {C r o s s E n t r o p y} \left(h _ {K} ^ {\text {o u t}}, h _ {K} ^ {\mathrm {g t}}\right) + \tag {6} +$$ + +$$ +\left| \left| s g \left(Z _ {t p} ^ {e}\right) - \mathbf {b} _ {t p} \right| \right| _ {2} ^ {2} + \beta \left| \left| Z _ {t p} ^ {e} - s g \left(\mathbf {b} _ {t p}\right) \right| \right| _ {2} ^ {2} + +$$ + +$$ +\left| \left| s g \left(Z _ {g e} ^ {e}\right) - \mathbf {b} _ {g e} \right| \right| _ {2} ^ {2} + \beta \left| \left| Z _ {g e} ^ {e} - s g \left(\mathbf {b} _ {g e}\right) \right| \right| _ {2} ^ {2}. +$$ + +The first line computes the sequence reconstruction loss, where $h_K^{\mathrm{out}}$ is the predicted probability likelihood from the sketch decoder and $h_K^{\mathrm{gt}}$ is the ground-truth one-hot vector. The second and the third lines are standard codebook and commitment losses used with VQ-VAE (van den Oord et al., 2017) $^3$ . $sg$ denotes the stop-gradient operation, which is the identity function in the forward pass but blocks gradients in the backward pass. $\beta$ scales the commitment loss and is set to 0.25. This ensures the encoder output commits to one code vector. We omit explicitly writing out the multiple code-tokens within each encoder for simplicity. + +Given a ground-truth subsequence, we run the two encoders and autoregressively run the decoder until the same number of tokens are generated. Instead of feeding back the generated tokens, we do teacher forcing and pass the ground-truth to the input of the decoder, which effectively allows us to train the decoder for a single step each. + +# 4.5. Generation + +SkexGen generates CAD models in two steps: 1) code generation from the three codebooks; and 2) sketch-and-extrude construction sequence generation given the codes. + +Code generation: Unlike a VAE, our quantized codes do not follow a Normal distribution. After using the trained topology, geometry, and extrude encoders to obtain codes from each training sample, we train a Transformer decoder that generates codes, i.e. selecting code indexes from each of the three codebooks. Our framework also allows conditional code generation with a minor modification to the architecture. For example, a "topology conditioned code selector" selects the compatible geometry and extrude codes given topology codes. We provide full details in Appendix C. + +Sequence generation: Given the codes, the sketch and the extrude decoders autoregressively generate construction subsequences separately by nucleus sampling (Holtzman et al., + +2020). The subsequences are merged to form a complete sketch-and-extrude sequence, which is then parsed to boundary representation (Weiler, 1986) using CAD software. + +# 5. Experiments + +In this section we perform experiments to understand: 1) the ability of SkexGen to generate high quality and diverse results, 2) the level of control that codebooks enable over the generation process, and 3) the performance of SkexGen for applications such as design exploration and interpolation. + +# 5.1. Experiment Setup + +Dataset: We use the DeepCAD dataset (Wu et al., 2021) which contains 178,238 sequences and a data split of $90\%$ train, $5\%$ validation, and $5\%$ test. Duplicates are removed in a similar manner to Willis et al. (2021a). We separately remove duplicate sketch subsequences and duplicate extrude subsequences. Invalid sketch-and-extrude operations are also removed. The resulting training dataset contains 74,584 sketch subsequences and 86,417 extrude subsequences. For experiments with single sketches, we extract sketches from all steps of the CAD construction sequences. This leads to 114,985 training samples after duplicate removal. + +Implementation details: SkexGen is implemented in PyTorch (Paszke et al., 2019) and trained on a RTX A5000. For fair comparison, we follow DeepCAD (Wu et al., 2021) and use a Transformer with four-layer blocks where each block contains eight attention heads, pre-layer normalization, and feed-forward dimension of 512. The input embedding dimension is 256. Dropout rate is 0.1. During training, we use the Adam optimizer (Kingma & Ba, 2015) with a learning rate of 0.001. Linear warm-up and gradient clipping are used as in DeepCAD. We skip code quantization in the initial 25 epochs and find this stabilizes the codebook training. For data augmentation, we add small random noise to the coordinates of the geometry tokens. SkexGen is trained for a total of 500 epochs with a batch size of 128. Maximum length is 200 for sketch subsequences and 100 for extrude subsequences. At test time, we use nucleus sampling (Holtzman et al., 2020) with top-p of 0.95 and temperature of 1.0 to autoregressively sample from the decoders. + +Metrics: We use the following metrics for the quantitative evaluation. For 2D sketches, "Frechet inception distance (FID)" (Heusel et al., 2017) measures the generation fidelity. It compares mean and covariance of real and generated data distributions. Following (Das et al., 2020), we use features from ResNet-18 (He et al., 2016) pre-trained on a human sketch classification task (Eitz et al., 2012). For 3D CAD models, "Coverage" (COV) is the percentage of real data that match generated data based on the closest + +![](images/17ea7b5b9961de4ef397c93436548540b5c8725942ed4252716c819d06dfa501.jpg) +Figure 3. Uniformly sampled random sketch generation results by CurveGen, DeepCAD, and SkexGen. Circle is red, arc is green, and line is black. Visually, SkexGen generates more realistic and complex shapes. + +Table 1. Quantitative evaluations on the sketch generation task. We report the FID score to measure generation fidelity and the percentage of Unique and Novel. + +
FID ↓Unique %↑Novel %↑
CurveGen109.1293.0583.82
DeepCAD75.4798.7997.45
SkexGen18.5696.0283.54
+ +Chamfer distance of 2,000 uniformly sampled points on the surface. "Minimum Matching Distance" (MMD) is the average minimum matching distance between a generated sample and its nearest neighbor in the real set. "Jensen-Shannon Divergence" (JSD) is the similarity between the real and generated distributions based on the marginal point distribution. For both sketches and CAD models, the "Novel" score is the percentage of generated data that does not appear in the training set, the "Unique" score is the percentage of data that only appears once in the generated samples. We consider two data samples equal if all tokens in the sequence are the same after 6-bit quantization. Please refer to (Achlioptas et al., 2018; Wu et al., 2021) for details. + +# 5.2. Random Generation + +To assess the ability of SkexGen to generate high quality and diverse results, we compare 10,000 randomly generated samples from SkexGen with four other baselines: CurveGen (Willis et al., 2021a), DeepCAD (Wu et al., 2021), SkexGen with a single codebook without code disentanglement, and SkexGen with VAE without code quantization or code disentanglement. Other sketch generative models from + +Table 2. Quantitative evaluations on the CAD generation task based on the Coverage (COV) percentage, Minimum Matching Distance (MMD), Jensen-Shannon Divergence (JSD) and the percentage of Unique and Novel. The first row is the existing state-of-the-art DeepCAD (Wu et al., 2021). The last three rows provide an ablation study of SkexGen over two features: code disentanglement $(F_{d})$ and code quantization $(F_{q})$ . The second from last row disables the code disentanglement (i.e., using a single codebook), resembling standard VQ-VAE. The third from last row further disables the code quantization, resembling standard VAE. + +
COV %↑MMD ↓JSD ↓Unique %↑Novel %↑
DeepCAD76.81.682.0191.087.0
SkexGen - (Fd, Fq)74.31.540.9297.891.9
SkexGen - (Fd)80.41.551.1299.899.3
SkexGen83.61.480.8199.999.8
+ +concurrent work (Para et al., 2021; Seff et al., 2022; Ganin et al., 2021) rely on sketch constraint labels, and ideally a sketch constraint solver, and are not directly comparable. + +Sketch generation: We report quantitative results for sketch generation in Table 1. SkexGen has by far the best FID score. The unique and novel percentage are similar or better than CurveGen, with the exception that novel percentage is lower than DeepCAD. Closer examination of the qualitative results in Figure 3 reveals that DeepCAD produces many invalid results containing self-intersecting curves and nonwatertight geometry. Since invalid results do not appear in the training data, they are all counted as novel and the score is high. The FID metric detects that the invalid data is far from the ground truth distribution and consequently the DeepCAD FID score is much worse. The Unique metric for DeepCAD is only slightly better than SkexGen; we suspect this is due to the increased noise in the generated data. + +Overall, we find that sketches from SkexGen are better in terms of quality with more complex shapes, fewer self-intersections, and stronger symmetry. CurveGen also generates good quality results, but with fewer complex arrangements of rectangles and circles. DeepCAD can produce more complex shapes than CurveGen but with a lot of noise. Additional visualizations of our generated sketches are available in Appendix D. + +CAD generation: Table 2 provides quantitative evaluations on the sketch-and-extrude CAD model generation. We find that SkexGen performs the best across all metrics. Qualitative results for SkexGen and DeepCAD are shown in Figure 4 with additional results available in Appendix D. SkexGen generates CAD models that are considerably more complex, exhibit symmetries, and make frequent use of the arc curve type, reminiscent of human design. Results from SkexGen also contain frequent multi-step sketch-and-extrude sequences, whereas DeepCAD results are mostly + +![](images/c12582afd0c5c51dcbaa2a4b3e77609d68f9d31f14b654af274fb0b5d80a85de.jpg) +Figure 4. Uniformly sampled random sketch-and-extrude model generation results by DeepCAD and SkexGen. Visually, SkexGen generates more realistic and complex models. + +single-step. The amount of similar shapes generated by DeepCAD is also high. The middle two rows in Table 2 demonstrate the effectiveness of multiple disentangled codebooks. The generation quality decreases after reduction of multiple codebooks to just one and SkexGen is similar to a VQ-VAE. Results are the worst when no codebook is used and SkexGen effectively becomes a VAE. + +Running time: SkexGen is slower than DeepCAD due to autoregressive sampling, taking 90 secs to generate 10,000 samples compared to 15 secs for DeepCAD. However, it is $2 \times$ faster than CurveGen since CurveGen has two dependent autoregressive decoders. + +# 5.3. Controllable Generation + +Disentangled codebooks allow effective control and design exploration. The left of Figure 5 illustrates "topology conditioned code selection" results, where the conditioned topology codes are the same for each row and the other codes are obtained by nucleus sampling. For example, in row b, all sketches contain two separate faces, which consist of an inner circle and an outer loop of six lines. The geometric properties such as face size and distance between the two faces vary. The right of Figure 5 similarly shows "geometry conditioned code selection" results, where the geometry codes are fixed for each row. In row g, all the sketches have roughly the same size and arrangement of curves, while the topology of the outer loops are different, from lines (left) to circle (middle) to arcs (right). For CAD models in the bottom rows, extrude operations further vary, influencing the 3D layout of the models (e.g., row e). Figure 6 has more controllable generation results with different conditional + +code selectors, demonstrating the capability of SkexGen. + +To quantitatively measure the disentanglement between the three codebooks, we follow the evaluation in $\beta$ -VAE (Higgins et al., 2017). A pair of sketch-and-extrude sequences are generated by the decoders by keeping one of the topology, geometry or extrude tokens the same, and sampling the rest. A small Transformer-based classifier is trained to identify which code is fixed using the average pairwise difference in the encoded latent space over all pairs of data. The classification accuracy for SkexGen is $99.8 \pm 0.1\%$ . + +# 5.4. Applications + +We demonstrate two applications enabled by the proposed SkexGen system. + +Interpolation allows intuitive design exploration. Given a pair of models, we follow the same encoding and decoding process in Sect. 4, except that we linearly interpolate their codes before quantization $\left(\{Z^{e}\}\right)$ and produce one model. Precisely, we 1) use the encoders to extract 10 codes (4 topology $\{Z_{tp}^{e}\}$ , 2 geometry $\{Z_{ge}^{e}\}$ , and 4 extrude $\{Z_{ex}^{e}\}$ ) from each model; 2) linearly interpolate them; and 3) perform the code quantization and autoregressive sequence generation to produce an interpolated model. Note that we take the token of the highest score during the autoregressive generation for consistent interpolation instead of the nucleus sampling. Figure 7 shows interesting topological and geometric changes over the interpolation. In column b, the topology of the sketch changes from a set of 12 lines to a set of 4 lines and 2 circles, and finally to a set of 6 circles. The radius of the middle circle gradually increases until enclosing the four smaller ones. In column h, a rect- + +![](images/80bfb9a6a64fac0ac0a0149cb040f6a4891bc077330dc24a14763a6b69a0694d.jpg) +Figure 5. Controllable generation results. Each row shares the same topology (left) or the same geometry (right) codes. Other codes are randomly sampled by the code selector. Top rows are sketches and bottom rows are sketch-and-extrude CAD models. + +![](images/24cd38568e51bb834aaec16b8246dd91bcbccfdb03b5144f91df19badda89de3.jpg) +Figure 6. Controllable generation results. Each row shares the same topology and geometry (left) or the same extrude (right) codes. Other codes are randomly sampled by the code selector. + +angular solid gradually morphs into a circular hollow disk. Note that the results are often not "smooth", but our interpolation tasks are particularly challenging, requiring many topological changes that are discrete in nature. + +Topology, geometry, and extrude code mixing enables generation results not seen in previous work. In Figure 8 we mix the topology, geometry, or extrude codes from one data with those of another to produce a hybrid result. For example, in row a, the generated sketch has two inner circles + +as in the reference topology while the placement of the two circles resembles that of the reference geometry. In row k, the reference topology indicates many cylinders and the reference geometry indicates a square, resulting in many cylinders in the arrangement of a square. + +# 6. Conclusion + +We introduced SkexGen, a novel generative model for CAD construction sequences that enhances topological and geometric variations to enable better design control and exploration. SkexGen is a step towards an intelligent system capable of generating diverse CAD models while comprehending design goals and allowing user control. + +# Acknowledgements + +The research is supported by NSERC Discovery Grants, NSERC Discovery Grants Accelerator Supplements, and DND/NSERC Discovery Grants. + +![](images/25a42204eba76dc62aff4e809fcd86185cb5e8b2e9d5564d60e01deec42afe37.jpg) +Figure 7. Design interpolation results for sketches (left) and CAD models (right). The top and the bottom rows show the source and target shapes, interpolated results appear in the middle rows. + +![](images/deb978b96e6c46712ea50a7812011cbfe9daccf5cfac3ac669d4ca00ea956475.jpg) +Figure 8. Topology, geometry, and extrude code mixing results. Given two reference CAD models or sketches (A and B), SkexGen can generate a new data whose topological property is similar to A and the geometric property is similar to B, by simply copying the topology codes from A, the geometry codes from B, and passing the mixed codes to the decoders for sampling. + +# References + +Achlioptas, P., Diamanti, O., Mitliagkas, I., and Guibas, L. Learning representations and generative models for 3d point clouds. In International conference on machine learning, pp. 40-49. PMLR, 2018. +Camba, J. D., Contero, M., and Company, P. Parametric cad modeling: An analysis of strategies for design reusability. Computer-Aided Design, 74:18-31, 2016. +Chakrabarti, A., Shea, K., Stone, R., Cagan, J., Campbell, M., Hernandez, N. V., and Wood, K. L. Computer-based design synthesis research: an overview. Journal of Computing and Information Science in Engineering, 11(2), 2011. +Chen, Z., Tagliasacchi, A., and Zhang, H. Bsp-net: Generating compact meshes via binary space partitioning. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 45-54, 2020. +Das, A., Yang, Y., Hospedales, T., Xiang, T., and Song, Y.-Z. BezierSketch: A Generative Model for Scalable Vector Sketches. In Computer Vision - ECCV 2020, pp. 632-647. Springer International Publishing, 2020. +Dosovitskiy, A., Beyer, L., Kolesnikov, A., Weissenborn, D., Zhai, X., Unterthiner, T., Dehghani, M., Minderer, M., Heigold, G., Gelly, S., Uszkoreit, J., and Houlsby, N. An image is worth 16x16 words: Transformers for image recognition at scale. In International Conference on Learning Representations (ICLR), 2021. +Du, T., Inala, J. P., Pu, Y., Spielberg, A., Schulz, A., Rus, D., Solar-Lezama, A., and Matusik, W. Inversecsg: Automatic conversion of 3d models to csg trees. Annual Conference on Computer Graphics and Interactive Techniques (SIGGRAPH), 37(6):1-16, 2018. +Eitz, M., Hays, J., and Alexa, M. How do humans sketch objects? ACM Trans. Graph. (Proc. SIGGRAPH), 31(4): 44:1-44:10, 2012. +Ellis, K., Nye, M., Pu, Y., Sosa, F., Tenenbaum, J., and Solar-Lezama, A. Write, execute, assess: Program synthesis with a repl. In Advances in Neural Information Processing Systems (NeurIPS), pp. 9169-9178, 2019. +Esser, P., Rombach, R., and Ommer, B. Taming transformers for high-resolution image synthesis. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 12873-12883, 2021. +Ganin, Y., Bartunov, S., Li, Y., Keller, E., and Saliceti, S. Computer-aided design as language. In Advances in Neural Information Processing Systems (NeurIPS), 2021. + +Grasel, J., Keskin, A., Swoboda, M., Przewozny, H., and Saxe, A. A full parametric model for turbomachinery blade design and optimisation. In Proceedings of the ASME 2004 International Design Engineering Technical Conferences and Computers and Information in Engineering Conference, volume 1: 30th Design Automation Conference, pp. 907-914, 09 2004. +He, K., Zhang, X., Ren, S., and Sun, J. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770-778, 2016. +Heusel, M., Ramsauer, H., Unterthiner, T., Nessler, B., and Hochreiter, S. Gans trained by a two time-scale update rule converge to a local nash equilibrium. Advances in neural information processing systems, 30, 2017. +Higgins, I., Matthew, L., Pal, A., Burgess, C. P., Glorot, X., Botvinick, M. M., Mohamed, S., and Lerchner, A. betavae: Learning basic visual concepts with a constrained variational framework. In 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings, 2017. +Holtzman, A., Buys, J., Du, L., Forbes, M., and Choi, Y. The curious case of neural text degeneration. In International Conference on Learning Representations (ICLR), 2020. +Kania, K., Zieba, M., and Kajdanowicz, T. Ucsg-net unsupervised discovering of constructive solid geometry tree. In Advances in Neural Information Processing Systems (NeurIPS), 2020. +Kingma, D. P. and Ba, J. Adam: A method for stochastic optimization. In International Conference on Learning Representations (ICLR), 2015. +Lee, S. H. and Lee, K. Partial entity structure: A compact non-manifold boundary representation based on partial topological entities. In Proceedings of the Sixth ACM Symposium on Solid Modeling and Applications, SMA '01, pp. 159-170, New York, NY, USA, 2001. Association for Computing Machinery. ISBN 1581133669. +Maher, M. L., Poon, J., and Boulanger, S. Formalising design exploration as co-evolution. In Advances in formal design methods for CAD, pp. 3-30. Springer, 1996. +Nandi, C., Caspi, A., Grossman, D., and Tatlock, Z. Programming language tools and techniques for 3d printing. In 2nd Summit on Advances in Programming Languages (SNAPL 2017). Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik, 2017. +Nandi, C., Wilcox, J. R., Panchekha, P., Blau, T., Grossman, D., and Tatlock, Z. Functional programming for compiling and decompiling computer-aided design. Proceedings + +of the ACM on Programming Languages, 2(ICFP):1-31, 2018. +Nash, C., Ganin, Y., Eslami, S. M. A., and Battaglia, P. W. Polymer: An autoregressive generative model of 3d meshes. ICML, 2020. +Para, W. R., Bhat, S. F., Guerrero, P., Kelly, T., Mitra, N., Guibas, L., and Wonka, P. Sketchgen: Generating constrained cad sketches. In Advances in Neural Information Processing Systems (NeurIPS), 2021. +Paszke, A., Gross, S., Massa, F., Lerer, A., Bradbury, J., Chanan, G., Killeen, T., Lin, Z., Gimelshein, N., Antiga, L., et al. Pytorch: An imperative style, high-performance deep learning library. Advances in neural information processing systems, 32:8026-8037, 2019. +Razavi, A., van den Oord, A., and Vinyals, O. Generating diverse high-fidelity images with vq-vae-2. In Advances in neural information processing systems, pp. 14866-14876, 2019. +Seff, A., Ovadia, Y., Zhou, W., and Adams, R. P. SketchGraphs: A large-scale dataset for modeling relational geometry in computer-aided design. In ICML 2020 Workshop on Object-Oriented Learning, 2020. +Seff, A., Zhou, W., Richardson, N., and Adams, R. P. Vitruvion: A generative model of parametric cad sketches. In International Conference on Learning Representations (ICLR), 2022. +Sharma, G., Goyal, R., Liu, D., Kalogerakis, E., and Maji, S. Csgnet: Neural shape parser for constructive solid geometry. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018. +Tian, Y., Luo, A., Sun, X., Ellis, K., Freeman, W. T., Tenenbaum, J. B., and Wu, J. Learning to infer and execute 3d shape programs. In International Conference on Learning Representations (ICLR), 2019. +van den Oord, A., Vinyals, O., and Kavukcuoglu, K. Neural discrete representation learning. In Proceedings of the 31st International Conference on Neural Information Processing Systems, NIPS'17, pp. 6309-6318, Red Hook, NY, USA, 2017. Curran Associates Inc. +Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, L., and Polosukhin, I. Attention is all you need. Advances in Neural Information Processing Systems (NeurIPS), pp. 5998-6008, 2017. +Vinyals, O., Fortunato, M., and Jaitly, N. Pointer networks. Advances in Neural Information Processing Systems (NeurIPS), 2015. + +Weiler, K. J. Topological structures for geometric modeling. Rensselaer Polytechnic Institute, 1986. +Willis, K. D. D., Jayaraman, P. K., Lambourne, J. G., Chu, H., and Pu, Y. Engineering sketch generation for computer-aided design. In The 1st Workshop on Sketch-Oriented Deep Learning (SketchDL), CVPR 2021, June 2021a. +Willis, K. D. D., Pu, Y., Luo, J., Chu, H., Du, T., Lambourne, J. G., Solar-Lezama, A., and Matusik, W. Fusion 360 gallery: A dataset and environment for programmatic cad construction from human design sequences. ACM Transactions on Graphics (TOG), 40(4), 2021b. +Wu, R., Xiao, C., and Zheng, C. Deepcad: A deep generative network for computer-aided design models. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), October 2021. +Xu, X., Peng, W., Cheng, C.-Y., Willis, K. D., and Ritchie, D. Inferring cad modeling sequences using zone graphs. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 6062-6070, June 2021. +Yu, F., Chen, Z., Li, M., Sanghi, A., Shayani, H., Mahdavi-Amiri, A., and Zhang, H. Capri-net: Learning compact cad shapes with adaptive primitive assembly. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 11768-11778, 2022. + +# A. Construction Sequence: Full Specification + +A construction sequence must follow certain rules to be a valid sketch-and-extrude model. Instead of providing a full specification as a context free grammar, which is possible, we describe rules with a few bullet points. + +- A sketch-and-extrude model consists of multiple extruded-sketches. +- A sketch consists of multiple faces. +- A face consists of multiple loops. +- A loop consists of multiple curves. +- A curve is either a line, an arc, or a circle, which consist of 2, 3, or 4 points, respectively. +- A loop with a circle can not contain additional curves since it is already a closed path. +- A point is represented by a geometry token. +- An end-primitive token appears at the end of each primitive (curve, line, face, loop, sketch, or extruded-sketch). +- When a face consists of multiple loops, the first loop defines the external boundary, and the remaining loops define internal loops (i.e., holes). + +# B. Extrude Branch Architecture + +The extrude branch takes a subsequence of the input, where a token is either 1) An extrude token, which is one of the five types $(H,R,O,S,B)$ ; 2) An end-primitive token $(E)$ for the extruded-sketch primitive type; and 3) An end-sequence token $(End)$ . + +- $H$ indicates the displacements of the top and the bottom planes from the reference plane in which a sketch is extruded to form a solid. Since we know that the two values are necessary, we repeat $H$ tokens twice in the sequence instead of having one token encode two values. We quantize each height value into 64 bins and represent the value as a 64 dimensional one-hot vector. +- $R$ is a 3D rotation of the extrusion direction. Looking through $3 \times 3$ rotation matrices in our datasets, each entry of the rotation matrix has a value of either -1, 0, or 1. These three values cover almost all rotations from DeepCAD dataset ( $>99\%$ ). Similarly to $H$ , we repeat $R$ nine times in the sequence, where each token indicates one of the three values as a 3 dimensional one-hot vector. +- $O$ is a 3D translation vector applied to the extruded solid. Similarly to $H$ , we know that three values are necessary, and we repeat $O$ three times in the sequence. We quantize each height value into 64 bins and represent the value as a 64 dimensional one-hot vector. +- $S$ indicates a sketch scaling factor consisting of three values: the center of scaling as a 2D coordinate and the uniform scaling factor. Similarly, we quantize each value into 64 bins as a 64 dimensional one-hot vector. +- $B$ indicates one of the three Boolean operations (intersection, union, or subtraction) and is represented by a 3-dimensional one-hot vector. + +Embeddings: Figure 1 in the main paper shows that an extrude subsequence consists of 7 types of tokens including End. In fact, an extrude subsequence after flatten consists of $19(= 2 + 9 + 3 + 3 + 1 + 1)$ individual tokens: [HHRRRRRRRRROOSSSBE] (not counting End). Each token is represented by a $72(= 64 + 3 + 3 + 1 + 1)$ dimensional one-hot vector, where numeric tokens $(H, O, S)$ share the 64 bins. + +Extrude encoder: The encoder is the same as the topology or geometry encoder except that a one-hot vector is of 72 dimensional instead of 4101. Similar to Eq. 5, we also add an additional learnable embedding which distinguish the token types (e.g. the 9 rotation matrix tokens VS the 3 translation tokens). + +Extrude decoder: The decoder is the same as the sketch decoder except 1) Only one (instead of two) codebook is used and no learnable embedding is added to distinguish different codebooks in cross-attention (Eq. 5); 2) The output $h_K^{out}$ is of dimension 72 instead of 4101. + +Training: Similar to Eq. 6, reconstruction loss, codebook loss, and commitment loss are used for training. Extrude branch has a total of four code-tokens and a codebook size of 1000. + +# C. Code Selector: Details + +The topology, geometry, and extrude codebooks provide $10(= 4 + 2 + 4)$ codes to the sketch and extrude decoders for model generation. Without loss of generality, let us explain a topology-geometry conditioned extrude code selector. In our experiments, the maximum size of each codebook is 1,000, and we simply use a 1000 dimensional one-hot encoding to represent each code in a codebook. + +Just as in the sketch decoder (Sect. 4.3), one-hot vectors are multiplied with a learnable matrix of size $(256 \times 1000)$ to compress feature embedding to 256 dimensional. Codes from the topology and the geometry codebooks are then injected via cross-attention to the decoder. We use the same position encoding to the codebook vectors as in Eq. 5. The decoder architecture is similar to the sketch decoder, producing the missing four extrude codes one by one in an autoregressive manner. The output embeddings finally pass through a fully-connected layer $(1000 \times 256)$ and softmax, predicting the probability likelihood over the 1000 codebook indexes. + +# D. Additional Results + +# D.1. Sketch Generation + +Figure 9 to Figure 15 show uniformly sampled random sketches generated by SkexGen. + +# D.2. CAD Generation + +Figure 16 to Figure 22 show uniformly sampled random CAD models generated by SkexGen. + +![](images/0a6ffcc899edad79a36c9f85e319643e48e3c04a543fb43177b41e96e0ccff01.jpg) +Figure 9. Uniformly sampled random sketches generated by SkexGen. + +![](images/9d78f72d283e1aa8341cac617bdb87fdba2e46868905b8b1a5b876801340a931.jpg) +Figure 10. Uniformly sampled random sketches generated by SkexGen. + +![](images/3c9501a27615b0f06c448d7e11ee8168699e6fdf47c02fed322e16185693dc9b.jpg) +Figure 11. Uniformly sampled random sketches generated by SkexGen. + +![](images/cf64fd6ce704e2c84e78a92599722291c07e82c9c1a6cf190f3c215dbf3631ee.jpg) +Figure 12. Uniformly sampled random sketches generated by SkexGen. + +![](images/8f90904d5b6d5650931db333a9785bd6e36e2873eac46ec33ede5745bd91af93.jpg) +Figure 13. Uniformly sampled random sketches generated by SkexGen. + +![](images/34dde797626f20d6add00237be5d11bfe1d2ac7fb00f64d894fb7cde02b0acb9.jpg) +Figure 14. Uniformly sampled random sketches generated by SkexGen. + +![](images/83670beef74072ab0210ba63c08c8ff868b0e7ad47ab0fa3a905d60961b34b97.jpg) +Figure 15. Uniformly sampled random sketches generated by SkexGen. + +![](images/e8eec7cbcbe3ec98bb54fb9f676d775a738b059acf08adfbaa0f70b47ff85e9c.jpg) +Figure 16. Uniformly sampled random CAD models generated by SkexGen. + +![](images/a90df9701de78a2a43b215e461b520b726b341575f109f261140637aef91bc67.jpg) +Figure 17. Uniformly sampled random CAD models generated by SkexGen. + +![](images/8b1c08155346b46d331e1d93a2740a219637ed24786cf2ae63e59fee24c6d594.jpg) +Figure 18. Uniformly sampled random CAD models generated by SkexGen. + +![](images/4d6c928e8a32b7db89101fcdda8461ba73cfe44ad4ad935a29ba190971878f18.jpg) +Figure 19. Uniformly sampled random CAD models generated by SkexGen. + +![](images/6f076118fd57d5666aa0ce84ef18cec194a0eb105d03ff7b65783fe215462cef.jpg) +Figure 20. Uniformly sampled random CAD models generated by SkexGen. + +![](images/bd05c70507dd5b1171ed6161950e87eab0f0e7b60a950324aa1be11936d34190.jpg) +Figure 21. Uniformly sampled random CAD models generated by SkexGen. + +![](images/9a711acc088504e5f29d8bfcdbdfd7a6225008f4271db2642e18c133ecb47883.jpg) +Figure 22. Uniformly sampled random CAD models generated by SkexGen. \ No newline at end of file diff --git a/skexgenautoregressivegenerationofcadconstructionsequenceswithdisentangledcodebooks/images.zip b/skexgenautoregressivegenerationofcadconstructionsequenceswithdisentangledcodebooks/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..adeeed998d0b17c442fcf2f7fac1143ef11b0d73 --- /dev/null +++ b/skexgenautoregressivegenerationofcadconstructionsequenceswithdisentangledcodebooks/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:561de3d4e9de4688adeb33d5fa4587af270ae7dcdc33392cebc3c3e2dd3e50cd +size 1866631 diff --git a/skexgenautoregressivegenerationofcadconstructionsequenceswithdisentangledcodebooks/layout.json b/skexgenautoregressivegenerationofcadconstructionsequenceswithdisentangledcodebooks/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..6791779d6dd0e84516af83967a6a3ac2be0435b9 --- /dev/null +++ b/skexgenautoregressivegenerationofcadconstructionsequenceswithdisentangledcodebooks/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:60b0563c7ee178ec64c3f5537061dfc591f67076a06b5176ab251de372db1799 +size 475415 diff --git a/skindeepunlearningartefactandinstrumentdebiasinginthecontextofmelanomaclassification/aedb0791-ab8e-4f82-85c2-c055fed8d73d_content_list.json b/skindeepunlearningartefactandinstrumentdebiasinginthecontextofmelanomaclassification/aedb0791-ab8e-4f82-85c2-c055fed8d73d_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..8aa72d331cb22f1ab27999df4e92c1aff73614cc --- /dev/null +++ b/skindeepunlearningartefactandinstrumentdebiasinginthecontextofmelanomaclassification/aedb0791-ab8e-4f82-85c2-c055fed8d73d_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2bfe5a097571d97e75fdb4da1d71468178c0eee13fe7d86ef98ccc9aadcdcac3 +size 125947 diff --git a/skindeepunlearningartefactandinstrumentdebiasinginthecontextofmelanomaclassification/aedb0791-ab8e-4f82-85c2-c055fed8d73d_model.json b/skindeepunlearningartefactandinstrumentdebiasinginthecontextofmelanomaclassification/aedb0791-ab8e-4f82-85c2-c055fed8d73d_model.json new file mode 100644 index 0000000000000000000000000000000000000000..6f08b6d3c5c26c6fd69b535fb18c5f1d90423a6e --- /dev/null +++ b/skindeepunlearningartefactandinstrumentdebiasinginthecontextofmelanomaclassification/aedb0791-ab8e-4f82-85c2-c055fed8d73d_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e78adbf808b804b9e84e11fb4d5e5501b170615e728083eb911739edcdf2d240 +size 150586 diff --git a/skindeepunlearningartefactandinstrumentdebiasinginthecontextofmelanomaclassification/aedb0791-ab8e-4f82-85c2-c055fed8d73d_origin.pdf b/skindeepunlearningartefactandinstrumentdebiasinginthecontextofmelanomaclassification/aedb0791-ab8e-4f82-85c2-c055fed8d73d_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..59b1fca4a5fc19caaad7f36635921c5cff6476e8 --- /dev/null +++ b/skindeepunlearningartefactandinstrumentdebiasinginthecontextofmelanomaclassification/aedb0791-ab8e-4f82-85c2-c055fed8d73d_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7192802532ef66d6f53bfcb88a4dbed27ddd19baa4a1ab266858f4ce7f9fc09a +size 9732678 diff --git a/skindeepunlearningartefactandinstrumentdebiasinginthecontextofmelanomaclassification/full.md b/skindeepunlearningartefactandinstrumentdebiasinginthecontextofmelanomaclassification/full.md new file mode 100644 index 0000000000000000000000000000000000000000..128a4273ca587f17c02ee78e045822637db06c89 --- /dev/null +++ b/skindeepunlearningartefactandinstrumentdebiasinginthecontextofmelanomaclassification/full.md @@ -0,0 +1,460 @@ +# Skin Deep Unlearning: Artefact and Instrument Debiasing in the Context of Melanoma Classification + +Peter J. Bevan1 Amir Atapour-Abarghouei2 + +# Abstract + +Convolitional Neural Networks have demonstrated dermatologist-level performance in the classification of melanoma from skin lesion images, but prediction irregularities due to biases seen within the training data are an issue that should be addressed before widespread deployment is possible. In this work, we robustly remove bias and spurious variation from an automated melanoma classification pipeline using two leading bias 'unlearning' techniques. We show that the biases introduced by surgical markings and rulers presented in previous studies can be reasonably mitigated using these bias removal methods. We also demonstrate the generalisation benefits of 'unlearning' spurious variation relating to the imaging instrument used to capture lesion images. Our experimental results provide evidence that the effects of each of the aforementioned biases are notably reduced, with different debiasing techniques excelling at different tasks. + +# 1. Introduction + +In recent years, Convolutional Neural Networks (CNN) have demonstrated skin lesion diagnosis performance on par with experienced dermatologists (Brinker et al., 2019a;b; Haenssle et al., 2018). This is particularly important since, when diagnosed early, melanoma may be easily cured by surgical excision (Haenssle et al., 2020; Winkler et al., 2019), and so accessible and accurate diagnostic tools have the potential to democratise dermatology and save numerous lives worldwide. + +While deploying such learning-based techniques far and wide could be massively beneficial, great care must be + +![](images/5aac8f8e5258ae9cba84aa2fccfe07f194dc0f8f59d0e6400af86e3e81a14709.jpg) +Figure 1: Examples of artefacts seen in ISIC 2020 data (Rotemberg et al., 2021). Top row shows images with surgical markings present, bottom row shows images with rulers. + +taken as any small pitfall could be replicated on a massive scale. For example, some dermatologists use visual aids such as skin markings to mark the location of a lesion, or rulers to indicate scale, as seen in Figure 1. In fact, Winkler et al. (Winkler et al., 2021; 2019) demonstrated how bias induced by the presence of these artefacts can result in diminished classification performance. They also suggest that dermatologists avoid using these aids in the future, which is a valid solution to the problem, though changing the habits of every dermatologist is highly unrealistic and could potentially be detrimental to their performance. + +Segmentation of the lesion from the surrounding skin has also previously been proposed, but is not a good option, since "any kind of pre-processing or segmentation itself may erroneously introduce changes that impede a CNN's correct classification of a lesion" (Winkler et al., 2021). Cropping surgical markings out of the image has been shown to be effective at mitigating surgical marking bias in the work of Winkler et al. (2019), but it is noted this must be done by an experienced dermatologist to prevent the loss of important information, which is costly and time-consuming. + +Consequently, the alternative path towards diminishing the effects of such artefacts would be not to remove the artefacts themselves from the image, but to reduce their influence on how the model functions, which translates to removing the 'bias' these artefacts introduce into the learning + +process. As such, recent advances in debiasing architectures for CNNs (Alvi et al., 2019; Kim et al., 2019) present an excellent opportunity to robustly mitigate the aforementioned biases without any need to alter the behaviour of physicians or pre-process the image data. + +Surgical artefacts left by physicians are not the only concern when it comes to skin lesion classification, however. Another issue that plagues many machine learning models is the domain shift between the training and real-world inference data, leading models to perform poorly upon deployment. One cause of this domain shift in skin lesion classification is likely to be spurious variation from minor differences in the imaging instruments used to capture lesions. Inspired by the work of Ganin et al. (2017), we propose also using 'unlearning' techniques (Alvi et al., 2019; Kim et al., 2019) for domain generalisation by removing spurious variation associated with instrument type to create a more generalisable, instrument-invariant model. + +In summary, this work aims to explore bias and domain 'unlearning' towards creating more robust, generalisable and fair models for melanoma classification. All implementation is publicly available on GitHub1. Our primary contributions can be summarised as follows: + +- Melanoma classification - The models presented demonstrate impressive melanoma classification performance, with many of the tested architectures beating the average performance of experienced dermatologists on a benchmark dataset $^{2}$ (Brinker et al., 2019b) (Section 4.2). +- Artefact debiasing - We mitigate the bias introduced by surgical markings and rulers, as shown in the work of Winkler et al. (2021; 2019) using 'Learning Not to Learn' (Kim et al., 2019) and 'Turning a Blind Eye' (Alvi et al., 2019) methods (Section 4.1). +- Domain generalisation - We demonstrate the generalisation benefits of unlearning (Alvi et al., 2019; Kim et al., 2019) information relating to the instruments used to capture skin lesion images (Section 4.2). + +We introduce related work in Section 2, methods in Section 3, experimental results in Section 4, limitations and potential future work in Section 5, and conclusions in Section 6. + +# 2. Related work + +We consider related work within two distinct areas, namely artefact bias in skin lesion images (Section 2.1) and domain generalisation (Section 2.2). + +# 2.1. Artefacts bias + +One of the problems addressed in this paper is the algorithmic bias introduced by certain artefacts present in skin lesion images. Precedent for investigating the mitigation of artefact bias in skin lesion classification is found in the work of Winkler et al. (2019), which compares the performance of a CNN classification model on 130 lesions without surgical markings present, versus the same 130 lesions with surgical markings present. Strong bias was demonstrated, with specificity hit hard, as well as Area Under the Curve (AUC). Another work (Winkler et al., 2021) shows a similar level of bias caused by rulers in skin lesion images. + +Segmentation of skin lesions from the surrounding healthy skin has been suggested as a means of removing artefacts from the input of skin lesion classification models (Jafari et al., 2016; Okur & Turkan, 2018). However, this is not commonly used at the time of writing, given that CNNs may utilise information in the surrounding skin regions (Bissoto et al., 2019; Winkler et al., 2021) and so removing this can impact classification performance. Artefacts themselves also often impede segmentation (Mishra & Celebi, 2016), and artefacts that are on the lesion itself are not separable from the lesion by image region. + +In an earlier work, Bissoto et al. (2020) tackle the issue of artefact bias removal in a manner similar to the one proposed in this work by using a model with seven debiasing heads in an attempt to mitigate the bias caused by seven artefacts. The authors conclude that the bias removal method in the work of Kim et al. (2019) ('Learning Not to Learn') is not ready to tackle the issue. However, ablation studies to isolate each head are lacking, and so the efficacy of each of the seven individual debiasing heads cannot be ascertained. It is, therefore, possible that certain heads bring down the performance of the entire model, or interact with each other unfavourably. In addition to this, the paper does not experiment with other leading debiasing solutions such as the one proposed in the work of Alvi et al. (2019) ('Turning a Blind Eye'), which may be more effective at the given task. + +In this work, we only focus on biases that are well documented as causing performance degradation, and compare individual debiasing heads across different methods before combining these heads. Bissoto et al. (2020) do note improvements in performance when testing their debiasing models on data with significant domain shift such + +as the Interactive Atlas of Dermoscopy clinical data (Lio & Nghiem, 2004), which indicates some improvement in generalisation. We build upon this notion in our domain generalisation experiments (Section 4.2). + +# 2.2. Domain generalisation + +A common assumption in machine learning is that the training and test data are drawn from the same distribution, though this assumption does not usually hold true in real-world applications (Csurka, 2017). For instance, inconsistencies in prostate cancer classification performance between image samples originating from different clinics is shown by Arvidsson et al. (2018), and the authors hypothesise that this could be due to domain shift caused by variation in the equipment used. In skin lesion classification, there are two main imaging methods: dermoscopic (skin surface microscopy), and clinical (standard photograph) (Westerhoff et al., 2000) (see Figure 2). This domain shift has been shown to impact model performance (Gu et al., 2020). Additionally, within these two imaging methods, many different brands and models of instrument are used by different clinics, which may also introduce domain bias. Supporting this hypothesis, it is shown by Jackson et al. (2020) that CNNs can easily discriminate between camera models, which can lead models to overfit to this spurious variation during training. + +Domain adaptation methods have been successfully used to minimise the distance between the underlying distributions of training and test datasets, i.e. a model trained on a given dataset (source distribution) is enabled to perform well on a different dataset (target distribution) via domain adaptation (Atapour-Abarghouei & Breckon, 2018; Csurka, 2017; Gu et al., 2020; Guan & Liu, 2022). However, such methods require knowledge of the target distribution, which is not always readily available. Domain generalisation, on the other hand, is more robust than domain adaptation, and differs in that the target domain is unseen (Li et al., 2020), aiming for improved performance on a wide range of possible test data. In this work, we explore applying bias unlearning techniques (Alvi et al., 2019; Kim et al., 2019) towards domain generalisation in melanoma classification, attempting to find an instrument-invariant feature representation without compromising performance. + +# 3. Methods + +In this work, two leading debiasing techniques within the literature are used, namely 'Learning Not To Learn' (LNTL) (Kim et al., 2019) and 'Turning a Blind Eye' (TABE) (Alvi et al., 2019). Both of these are often referred to as 'unlearning' techniques because of their ability to remove bias from the feature representation of a network by minimising the mutual information between the feature + +![](images/7068e0727f579c277b67845f58e3b1f874f026c52f84938d3c5a95575857796a.jpg) +Figure 2: Domain shift between clinical and dermoscopic images of the same lesion (Lio & Nghiem, 2004). Top row shows dermoscopic images, bottom row clinical. + +embedding and the unwanted bias. Further details of these unlearning methods are described in Sections 3.1 and 3.2. + +# 3.1. Learning Not to Learn + +'Learning Not to Learn' (LNTL) (Kim et al., 2019) proposes a novel regularisation loss combined with a gradient reversal layer (Ganin et al., 2017) to remove bias from the feature representation of a CNN during backpropagation. Figure 3 shows a generic overview of the LNTL architecture. The input image, $x$ , is passed into a feature extractor, $f\colon x\to \mathbb{R}^K$ , where $K$ is the dimension of the embedded feature. + +The feature extractor is implemented as a pre-trained convolutional architecture such as ResNeXt (He et al., 2016) or EfficientNet (Tan & Le, 2019) in this work. The extracted feature embedding is then passed in parallel into both $g \colon \mathbb{R}^K \to \mathcal{V}$ and $h \colon \mathbb{R}^K \to \mathcal{B}$ , the primary and auxiliary classification heads respectively, where, in the case of this work, $\mathcal{V}$ represents the set of possible lesion classes and $\mathcal{B}$ represents the set of target bias classes. + +The networks $f$ and $h$ play the minimax game, in which $h$ is trained to classify the bias from the extracted feature embedding (minimising cross-entropy), whilst $f$ is trained to maximise the cross-entropy to restrain $h$ from predicting the bias, and also to minimise the negative conditional entropy to reduce the mutual information between the feature representation and the bias. The gradient reversal layer between $h$ and $f$ acts as an additional step to remove information relating to the target bias from the feature representation. + +The gradient reversal layer works by multiplying the gradient of the auxiliary classification loss by a negative scalar during backpropagation, causing the feature extraction network, $f$ , to 'learn not to learn' the targeted bias, $b(x)$ , rather than learn it. By the end of training, $f$ has learnt to extract a feature embedding independent of the bias, $g$ has learnt to use this feature embedding to perform the primary clas- + +sification task without relying on the bias, and $h$ performs poorly at predicting the bias due to the lack of bias information in the feature embedding. + +The minimax game along with the main classification loss are formulated as: + +$$ +\begin{array}{l} \min _ {\theta_ {f}, \theta g} \max _ {\theta_ {h}} \mathbb {E} _ {\tilde {x} \sim P _ {X} (\cdot)} [ \underbrace {\mathcal {L} _ {g} (\theta_ {f} , \theta_ {g})} _ {(a)} \\ + \underbrace {\lambda \mathbb {E} _ {\tilde {b} \sim Q (\cdot | f (\tilde {x}))} [ \log Q (\tilde {b} | f (\tilde {x})) ]} _ {(b)} \tag {1} \\ - \underbrace {\mu \mathcal {L} _ {\mathcal {B}} (\theta_ {f} , \theta_ {h})} _ {(c)}, \\ \end{array} +$$ + +where (a) represents the cross-entropy loss of the main classification head, (b) represents the regularisation loss and (c) represents the cross-entropy loss of the auxiliary bias classification head. The hyperparameters $\lambda$ and $\mu$ are used to balance the terms. The parameters of each network are denoted as $\theta_{f}$ , $\theta_{g}$ and $\theta_{h}$ . An auxiliary distribution, $Q$ , is used to approximate the posterior distribution of the bias, $P$ , which is paramerised as the bias prediction network, $h$ . + +![](images/19dd06cf5ba0e47f1b5694bcced576943d52571f493571f8de5cf98186663698.jpg) +Figure 3: 'Learning Not to Learn' architecture. Feature extractor, $f$ , is implemented as a convolutional architecture such as ResNeXt or EfficientNet in this work. 'fc' denotes a fully-connected layer. + +# 3.2. Turning a Blind Eye + +Figure 4 shows a generic overview of the 'Turning a Blind Eye' (TABE) (Alvi et al., 2019) architecture. Similar to LNTL (Kim et al., 2019), this method also removes unwanted bias using an auxiliary classifier, $\theta_{m}$ , where $m$ is the $m$ -th unwanted bias. The TABE auxiliary classifier minimises an auxiliary classification loss, $\mathcal{L}_s$ , used to identify bias in the feature representation, $\theta_{\mathrm{repr}}$ , as well as an auxiliary confusion loss (Tzeng et al., 2015), $\mathcal{L}_{\mathrm{conf}}$ , used to make $\theta_{\mathrm{repr}}$ invariant to the unwanted bias. Since these losses stand in opposition to one another, they are minimised in separate steps: first $\mathcal{L}_s$ alone, and then the primary + +classification loss, $\mathcal{L}_p$ , together with $\mathcal{L}_{\mathrm{conf}}$ . The confusion loss is defined as follows: + +$$ +\mathcal {L} _ {\text {c o n f , m}} \left(x _ {m}, y _ {m}, \theta_ {m}; \theta_ {\text {r e p r}}\right) = - \sum_ {n _ {m}} \frac {1}{n _ {m}} \log p _ {n _ {m}}, \tag {2} +$$ + +where $x_{m}$ is the input, $y_{m}$ is the bias label, $p_{nm}$ is the softmax of the auxiliary classifier output and $n_m$ is the number of auxiliary classes. This confusion loss works towards finding a representation in which the auxiliary classification head performs poorly by finding the cross entropy between the output predicted bias and a uniform distribution. The complete joint loss function being minimised is: + +$$ +\begin{array}{l} \mathcal {L} \left(x _ {p}, y _ {p}, x _ {s}, y _ {s}, \theta_ {p}, \theta_ {s}, \theta_ {\text {r e p r}}\right) = \mathcal {L} _ {p} \left(x _ {p}, y _ {p}; \theta_ {\text {r e p r}}, \theta_ {p}\right) \tag {3} \\ + \mathcal {L} _ {s} + \alpha \mathcal {L} _ {\text {c o n f}}, \\ \end{array} +$$ + +where $\alpha$ is a hyperparameter which determines how strongly the confusion loss impacts the overall loss. The feature extractor, $f$ , is implemented as a pre-trained convolutional architecture such as ResNeXt (He et al., 2016) or EfficientNet (Tan & Le, 2019) in this work. + +![](images/518e85339fcee7e659491692f162ee4bfa7dee5578167ee69e2230dfe1caea19.jpg) +Figure 4: 'Turning a Blind Eye' generic architecture. Feature extractor, $f$ , is implemented as a convolutional architecture such as ResNeXt or EfficientNet in this work. 'fc' denotes a fully-connected layer. + +Additionally, as proposed by Kim et al. (2019), a hybrid of LNTL and TABE can be created by utilising the confusion loss (CL) from TABE, and then also applying gradient reversal (GR) from LNTL to the auxiliary classification loss as it is backpropagated to $f$ . We denote this configuration as 'CLGR'. + +# 3.3. Datasets + +This section briefly describes the datasets used in the experiments (see supplementary material Section B for example images). + +# 3.3.1.ISIC CHALLENGE TRAINING DATA + +The International Skin Imaging Collaboration (ISIC) challenge is a yearly automated melanoma classification challenge + +lenge with several publicly available dermoscopic skin lesion datasets (see ISIC archive3), complete with diagnosis labels and metadata. A combination of the 2017 and 2020 ISIC challenge data (Codella et al., 2018; Rotemberg et al., 2021) (35,574 images) is used as the training data in this work due to the higher representation of artefacts in these datasets than other competition years. Pre-processed (centre cropped and resized) images of size $256 \times 256$ are used for all training and testing. The surgical markings are labelled using colour thresholding, with the labels double-checked manually, while the rulers are labelled entirely manually. A random subset $(33\%, 3,326$ images) of the 2018 (Codella et al., 2018) challenge data is used as the validation set for hyperparameter tuning. + +The model and training data used by Winkler et al. (2021; 2019) are proprietary, and so the bias in these studies could not be exactly reproduced. Alternatively, since the primary objective is to investigate the possibility of removing bias from the task, we skew the ISIC data (Codella et al., 2018; Rotemberg et al., 2021) to produce similar levels of bias in our baseline model as shown in the aforementioned studies. Benign lesions in the training data with surgical markings are removed and images that are both malignant and marked are duplicated and randomly augmented (treating each duplicate as a new data point) to skew the model towards producing false positives for lesions with surgical markings, thus reproducing the level of bias demonstrated by Winkler et al. (2019). The dataset is processed similarly with rulers to demonstrate ruler bias. The number of duplications of melanoma images with surgical markings present, $dm$ , and with rulers present, $dr$ , are used as hyperparameters to control the level of skew in experiments. This artificially skewed data is only used to demonstrate artefact debiasing (Section 4.1), and the original data is used for all other experiments. + +# 3.3.2. HEIDELBERG UNIVERSITY TEST DATA + +The test set presented by Winkler et al. (2019) is used to evaluate the artefact debiasing approach presented in this work (Section 4.1). The dataset comprises 130 lesions: 23 malignant, 107 benign. There are two images of each lesion in the set, one without surgical markings, and one with surgical markings. This allows a direct evaluation of the effect of surgical marking bias on the performance of a model. The test set from the ruler bias study (Winkler et al., 2021) is not publicly available or shared, so the plain images from the work of Winkler et al. (2019) are superimposed with rulers to be used as test images. The approach of superimposing rulers was validated as not statistically significantly different from in-vivo rulers by Winkler et al. (2021). + +# 3.3.3.MCLASS BENCHMARK TEST DATA + +The MClass public human benchmark introduced by Brinker et al. (2019b) is used as a test dataset for assessing domain generalisation (Section 4.2), also providing a human benchmark. This dataset comprises a set of 100 dermoscopic images and 100 clinical images (different lesions), each with 20 malignant and 80 benign lesions. In the study, the dermoscopic and clinical image sets were classified by 157 and 145 experienced dermatologists respectively, with their average classification performances published. The dermoscopic MClass data is made up of images from the ISIC archive, some of which were also present in our ISIC training data (Section 3.3.1), so these were removed from the training data to prevent data leakage. + +# 3.3.4. INTERACTIVE ATLAS OF DERMOSCOPY AND ASAN DATA + +Two additional test sets, the Interactive Atlas of Dermoscopy dataset (Lio & Nghiem, 2004), and the Asan test dataset (Han et al., 2018), are used to further test domain generalisation (Section 4.2). The Atlas dataset comprises 1,011 lesions across 7 classes, with one dermoscopic and one clinical image per lesion. The Asan test dataset comprises 852 clinical images across 7 classes of lesions. Whilst the ISIC training data (Codella et al., 2018; Rotemberg et al., 2021) is mostly white Western patients, the Atlas and Asan datasets have representation from a broader variety of ethnic groups, which enables a better test of a model's ability to deal with domain shift. + +# 3.4. Implementation + +All experiments are implemented in PyTorch (Paszke et al., 2019) and carried out using two NVIDIA Titan RTX GPUs in parallel with a combined memory of 48 GB on an Arch Linux system with a 3.30GHz 10-core Intel CPU and 64 GB of memory. The baseline model is inspired by the winning entry from the 2020 ISIC challenge (Ha et al., 2020), which utilises the EfficientNet-B3 architecture (Tan & Le, 2019), pre-trained on the ImageNet dataset (Deng et al., 2009). ResNet-101 (He et al., 2016), ResNeXt-101 (Xie et al., 2017), DenseNet (Huang et al., 2017) and Inception-v3 (Szegedy et al., 2016) are each substituted for EfficientNet-B3 to evaluate the optimal network for the task, simultaneously testing the effectiveness of the debiasing techniques across different architectures. + +Early experimentation showed ResNeXt-101 to be the overall best performing architecture, as seen in Table 2, and therefore experimentation is focused around using this as the feature extractor in the domain generalisation experiments. EfficientNet-B3 is kept as the base architecture for surgical marking and ruler debiasing since the baseline per + +formance is closest to the reported performance of the unknown proprietary model used in the work of Winkler et al. (2019). The primary and auxiliary classification heads are implemented as a single fully-connected layer, as suggested by Kim et al. (2019). Stochastic gradient descent is used across all models, ensuring comparability and compatibility between the baseline and debiasing networks. + +Following a grid search, the learning rate (searched between 0.03 and 0.00001) and momentum (searched between 0 and 0.9) are selected as 0.0003 and 0.9 respectively (see Section D of the supplementary material for full hyperparameter tuning results). The learning rate of the TABLE heads is boosted by a factor of 10 (to 0.003), as suggested by Alvi et al. (2019), except when using multiple debiasing heads since this seems to cause instability. The best performing values of the hyperparameters $\alpha$ and $\lambda$ in Equation (1) and Equation (3) are also empirically chosen to be $\alpha = 0.03$ and $\lambda = 0.01$ . + +A weighted loss function is implemented for all auxiliary heads to tackle class imbalance, with each weighting coefficient, $\mathcal{W}_n$ , being the inverse of the corresponding class frequency, $c$ . Since the proportion of benign and malignant lesions is highly imbalanced in the test sets, accuracy proved not to be a descriptive metric to use. Instead, AUC is used as the primary metric across all experiments, as is standard in melanoma classification (Ha et al., 2020; Han et al., 2018; Li & Shen, 2018; Okur & Turkan, 2018), given that it takes into account both sensitivity and specificity across all thresholds and is effective at communicating the performance when the target classes are imbalanced (Mandrekar, 2010). We use test-time augmentation (Simonyan & Zisserman, 2015; Szegedy et al., 2016) to average predictions over 8 random flips along different axes, applied to all test images, to enable a fairer evaluation of our models. The optimal number of epochs for training each architecture on each dataset is chosen through analysis of the 5-fold cross validation curves for the baseline models, selecting the epoch at which the AUC reached its maximum or plateaued (see Section 5 of the supplementary material). + +# 4. Experimental results + +The results of our artefact bias removal experiments are presented in Section 4.1. We present the domain generalisation experimental results in Section 4.2. The three variations of debiasing heads that were implemented and combined in the experiments are: 'Learning Not to Learn' (LNTL) (Kim et al., 2019), 'Turning a Blind Eye' (TABLE) (Alvi et al., 2019), and a hybrid of the confusion loss (CL) from TABE with the gradient reversal layer (GRL) from LNTL (CLGR). + +# 4.1. Artefacts bias removal + +We attempt to mitigate the bias caused by two artefacts that have been shown to affect performance in melanoma classification, namely surgical markings (Winkler et al., 2019) and rulers (Winkler et al., 2021) (see Table 1 and Figure 5). Separate individually-skewed training sets are used with skew levels set at $dm = 20$ (dm being number of duplications of images with surgical markings) for examining the removal of surgical marking bias and $dr = 18$ (dr being duplications of images with rulers) for ruler bias. We use surgical marking and ruler labels as the target for the debiasing heads in each of these experiments respectively. + +Each model is trained and evaluated 6 times using 6 different random seeds, allowing the mean and standard deviation to be reported. The high scores are due to the inherent clarity of the cues within the images and consequent simplicity of the classification of the test set, consistent with the scores reported by Winkler et al. (2021; 2019). Any chance of a leak between the test set and the ISIC training data has been ruled out $^{4}$ . Despite the ease of classification, both the existence of bias and the effectiveness of bias mitigation can still be demonstrated, and experiments using the original test set provide direct evidence that we are able to mitigate the problem presented in these studies. While the baseline model performs very well for the unbiased images (Table 1 - 'Heid Plain'), performance suffers when this model is tested on the same lesions with either artefact present, replicating the findings from the work of Winkler et al. (2021; 2019). + +![](images/e730751ba22632db5bb29a4291c7f1c7931098aef44a72871ab2df37e5154735.jpg) +Figure 5: Comparing melanoma classification performance of artefact debiasing models against the baseline, trained on artificially skewed ISIC data. + +![](images/8446b548a497e3baf0f7feb39d9d9da9c6defcb0218b3f0984631dec26c80a24.jpg) + +Figure 5 presents evidence that each debiasing method is successful at mitigating artefact bias. LNTL is the most effective at unlearning surgical marking bias, improving on the baseline AUC by 0.055 (6.1% increase) on the equivalent marked images from the same set ('Heid marked'). All three techniques also mitigate ruler bias well, with CLGR being the most effective and showing a 0.127 increase in AUC compared to the baseline (15.3% increase). The res + +Table 1: Artefact debiasing: Melanoma classification performance when using unlearning techniques versus a baseline, trained on skewed ISIC data. Scores are AUC. 'Heid Plain' is free from artefacts while 'Heid Marked' and 'Heid Rulers' contain the same lesions with surgical markings and rulers present. $\dagger$ indicates surgical marking labels as target for the auxiliary head and $\ddagger$ indicates ruler labels. + +
Experiment(a) Surgical Marking Removal (dm=20)Experiment(b) Ruler Bias Removal (dr=18)
Heid PlainHeid MarkedHeid PlainHeid Ruler
Baseline0.990±0.0020.902±0.013Baseline0.999±0.0000.831±0.022
LNTL†0.991±0.0050.957±0.023LNTL‡0.997±0.0010.874±0.031
TABE†0.998±0.0010.917±0.019TABE‡0.992±0.0020.938±0.017
CLGR†0.998±0.0020.949±0.022CLGR‡0.999±0.0100.958±0.018
+ +# 4.2. Domain generalisation + +![](images/f89722dcbb936d8953e21cb00e4c7ec4bab6c108dd6d865d33c1fdc5d902d1b6.jpg) +Figure 6: Class distribution of instruments in ISIC 2020/2017 combined data (Codella et al., 2018; Rotemberg et al., 2021). Instruments inferred as separate through image size. + +first 8 'instrument' categories, but there are many outlier categories with a very small number of observations, which are discarded to prevent significant class imbalance. + +Table 2 compares the generalisation ability of each instrument debiasing method against the baseline. We test the models on a number of datasets of differing distributions to test generalisation. We apply the debiasing heads to several different model architectures (EfficientNet-B3 (Tan & Le, 2019), ResNet-101 (He et al., 2016), ResNeXt-101 (Xie et al., 2017), DenseNet (Huang et al., 2017), Inception-v3 (Szegedy et al., 2016)) and compare the results, allowing us to select a champion architecture for further experimentation. ResNeXt-101 is chosen for focused experimentation and discussion since it achieves the highest score on 3 out of the 5 test sets, as seen in Table 2. TABLE and CLGR outperform the respective baselines across most experiments for most tested architectures, but all methods generally under-perform when used with ResNet-101 or when tested on the Atlas Dermoscopic data (please see Table 2 for detailed breakdown). On the MClass clinical test set using ResNeXt-101, the CLGR head is the difference between the model performing below the dermatologist benchmark, and exceeding it (8.5% AUC increase), highlighting the potential impact of these domain generalisation methods. + +In general, the greatest performance increases are observed on the clinical test sets, likely since these have the greatest domain shift from the dermoscopic training set. The models utilising LNTL were less successful, and even negatively impacted performance in some cases. This highlights that a single technique should not be applied in blanket fashion, as is done by Bissoto et al. (2020); certain techniques may only be suitable for specific tasks and datasets. + +Figure 7 shows the benefits of using a TABLE head for instrument bias removal compared to the baseline model (both ResNeXt-101), showing an $11.6\%$ AUC improvement on the Asan clinical test set and a $6.6\%$ increase on the MClass dermoscopic test set. TABLE can be differentiated from the baseline on each clinical test set, suggesting this to be a good tool for domain generalisation with dermo + +ults of our experiments suggest that unlearning techniques can be used to reduce the bias demonstrated by Winkler et al. (2021; 2019), but are not a perfect solution, given that the artefacts still have a negative impact on performance when compared to performance on the plain images. +Another significant issue within melanoma classification is instrument bias, hindering the application of a trained model to image data acquired via different imaging instruments. We attempt to address this issue by removing instrument bias from the model pipeline using unlearning techniques (Alvi et al., 2019; Kim et al., 2019), with the aim of improving domain generalisation. According to ISIC, image dimensions in ISIC competition data are a good proxy for the imaging instrument used to capture the image5. Figure 6 shows the distribution of image sizes in the ISIC dataset, following omission of outlier classes. +These dimensions were used as the auxiliary target for debiasing, attempting to remove spurious variation related to the imaging instrument from the feature representation. The vast majority (98%) of the ISIC training images (Codella et al., 2018; Rotemberg et al., 2021) make up the + +Table 2: Domain generalisation: Comparing generalisation ability of each debiasing method across different architectures, trained using ISIC 2017 and 2020 data. All scores are AUC. The 'dermatologists' row is the AUC scores from the work of Brinker et al. (2019b). The $\S$ symbol indicates the use of instrument labels for the auxiliary head. Bold numbers are the highest score for that architecture, underlined scores are the highest scores across all architectures. + +
ExperimentArchitectureAtlasAsanMClass
DermoscopicClinicalClinicalDermoscopicClinical
Dermatologists————0.6710.769
BaselineEfficientNet-B30.7570.5650.4770.7860.775
LNTL§EfficientNet-B30.7090.5620.5700.8300.630
TABE§EfficientNet-B30.8110.6290.6850.8770.889
CLGR§EfficientNet-B30.7610.5620.6560.8820.838
BaselineResNet-1010.8020.6060.7040.8770.819
LNTL§ResNet-1010.7760.5400.7660.8170.748
TABE§ResNet-1010.7460.5410.6170.8090.808
CLGR§ResNet-1010.7950.6150.7230.8700.739
BaselineResNeXt-1010.8190.6160.7680.8530.744
LNTL§ResNeXt-1010.7760.5970.7460.8210.778
TABE§ResNeXt-1010.8170.6740.8570.9080.768
CLGR§ResNeXt-1010.7840.6500.7850.8180.807
BaselineDenseNet0.7750.5590.6550.8510.695
LNTL§DenseNet0.7600.5480.7500.8590.689
TABE§DenseNet0.8090.6220.7430.8630.788
CLGR§DenseNet0.7600.5960.8720.8430.776
BaselineInception-v30.7620.5280.6710.7840.605
LNTL§Inception-v30.7840.5560.7290.8090.583
TABE§Inception-v30.7510.5930.7350.8180.746
CLGR§Inception-v30.7220.5370.7750.8470.706
+ +![](images/e989b258577777b58a060c46b098ca2bfbbe17d6647112eea6a3432b4acee1ce.jpg) +Figure 7: ROC curves for TABLE instrument debiasing on ASAN clinical (left), and MClass dermoscopic (right) test sets, with ResNeXt-101 as the base architecture. + +![](images/d80e44a3300451ebd838513a6decc9a0bec0c820372c81f57da0b6f05e116b39.jpg) + +scopic and clinical data. Since both the training data and the MClass dermoscopic data are from the ISIC archive, the improved performance suggests the benefits of instrument invariance even when testing on data drawn from a similar distribution as the training data. This is likely due to the mitigation of domain bias caused by variation in the specific type of dermoscopic instrument used. + +We experiment with using two debiasing heads, each removing a different bias (instrument, surgical marking or ruler), aiming to improve generalisation. The top config + +urations are shown in Table 3. Using a single TABLE head removing instrument bias is still the most effective overall configuration. For results across a more complete set of configurations, refer to Section 8 in the Appendix. + +Table 3: Generalisation of ResNeXt-101 models trained using ISIC 2017 and 2020 data. The 'dermatologists' row is the AUC scores from the work of Brinker et al. (2019b). Instrument, surgical marking and ruler labels represented by $\S$ , $\dagger$ and $\ddagger$ respectively. + +
ExperimentAtlasAsanMClass
DermoscopicClinicalClinicalDermoscopicClinical
Dermatologists———0.6710.769
Baseline0.7570.5650.4770.7860.775
TABE§0.8170.6740.8570.9080.768
CLGR‡0.8180.6100.7600.8860.882
TABE§+LNTL‡0.8280.6400.7470.8800.824
+ +# 4.3. Ablation studies + +Ablation was built into the experimentation process since individual bias removal heads were implemented in isolation before attempting combinations, and debiasing heads were implemented both with and without gradient reversal. + +Table 4: Ablation of gradient reversal (denoted by *) from LNTL using ResNeXt-101 for removal of instrument bias. + +
ExperimentAtlasAsanMClass
DermoscopicClinicalClinicalDermoscopicClinical
LNTL0.8040.6120.7680.8190.801
LNTL*0.7830.6050.7100.8270.747
+ +Using a single head to unlearn instrument bias is found to be more effective for generalisation than combining this head with artefact bias removal heads. TABE (Alvi et al., 2019) both with and without the gradient reversal layer has proven successful for different tasks (Table 1, Table 2), but ablation of the gradient reversal layer from LNTL (Kim et al., 2019) generally diminished performance (see Table 4). + +# 5. Limitations and future work + +While we have demonstrated the impressive performance of unlearning techniques for artefact debiasing, one drawback of such approaches is the need to manually label these artefacts in each training image. These artefacts, however, are often quick and easy to identify by untrained individuals. Further research may look to uncover biases caused by other artefacts in a similar manner to the work of Winkler et al. (2021; 2019) and evaluate the effectiveness of unlearning techniques at mitigating these. Future work could also incorporate an algorithm which accurately labels artefacts and dynamically changes the model architecture to apply the required bias removal heads for the task. + +As for potential improvements in domain generalisation, image size cannot be universally assumed as a proxy for the imaging instrument across all datasets so we recommend the actual instrument model be recorded as metadata when collecting training data for melanoma classification. Further research could include incorporating an instrument identification system which could provide labels for the image acquisition instrument. Further work may also evaluate the effectiveness of debiasing techniques in improving generalisation for diagnostic smartphone apps such as those reviewed by Rat et al. (2018). Detailed analysis into the specific reasons why certain debiasing methods seem to work better for certain tasks could also be a useful avenue for future research. + +# 6. Conclusion + +This work has compared and demonstrated the effectiveness of debiasing methods in the context of skin lesion classification. We have successfully automated the mitigation of the surgical marking and ruler bias presented by Winkler et al. (2021; 2019) using unlearning techniques (Sec + +tion 4.1). We have investigated the use of bias removal models on two test sets for each artefact bias, one comprising lesion images with no artefacts present and one comprising the same lesion images with artefacts present. We have shown that the debiasing models perform on par with the baseline on the images without artefacts, and better on the images with artefacts. Utilising confusion loss with gradient reversal for bias removal (Kim et al., 2019) improves the baseline AUC by $15.3\%$ on lesion images with rulers present (Table 1) whilst using LNTL (Kim et al., 2019) improves performance by $6.1\%$ when surgical markings are present. This suggests the addition of these debiasing heads leads to a model more robust to each artefact bias, without compromising performance when no bias is present. Utilising these techniques could be an alternative to the behaviour change amongst dermatologists suggested by Winkler et al. (2021; 2019). + +We have also provided evidence of the generalisation benefits of using unlearning techniques to remove instrument-identifying information from the feature representation of CNNs trained for the classification of melanoma (Section 4.2). We have demonstrated this using the ISIC training data (Codella et al., 2018; Rotemberg et al., 2021), with image size as a proxy for the imaging instrument. To test the generalisation capabilities of our bias removal approaches, we have used five popular skin lesion test sets with varying degrees of domain shift. Utilising the 'Turning a Blind Eye' (Alvi et al., 2019) debiasing head is generally the most effective method, most notably inducing an $11.6\%$ AUC increase compared to the baseline on the Asan dataset (Han et al., 2018) when using a ResNeXt-101 feature extractor. Our models perform better than experienced dermatologists, consistently beating their average AUC score on the MClass test sets (Brinker et al., 2019b). Generalisation methods such as this are powerful for ensuring consistent results across dermatology clinics, and may have utility in the emerging diagnostic app space (Rat et al., 2018), given that differences between smartphone cameras are likely to introduce spurious variation in a similar manner. + +# Acknowledgements + +We thank Holger Haensle & team of Heidelberg University Department of Dermatology for providing the test dataset from Winkler et al. (2019); we thank Jochen Weber of ISIC for providing additional information on the ISIC dataset; we thank Chris Deotte for providing cropped and resized ISIC data. + +# References + +Alvi, M., Zisserman, A., and Nellåker, C. Turning a Blind Eye: Explicit Removal of Biases and Variation from Deep Neural Network Embeddings. In Leal-Taixe, L. and Roth, S. (eds.), Computer Vision - ECCV 2018 Workshops, volume 11129, pp. 556-572. Springer International Publishing, Cham, 2019. ISBN 978-3-030-11008-6 978-3-030-11009-3. doi: 10.1007/978-3-030-11009-3_34. +Arvidsson, I., Overgaard, N. C., Marginean, F.-E., Krzyzanowska, A., Bjartell, A., Åström, K., and Heyden, A. Generalization of prostate cancer classification for multiple sites using deep learning. In 2018 IEEE 15th International Symposium on Biomedical Imaging (ISBI 2018), pp. 191-194, April 2018. doi: 10.1109/ISBI.2018.8363552. +Atapour-Abarghouei, A. and Breckon, T. P. Real-Time Monocular Depth Estimation Using Synthetic Data with Domain Adaptation via Image Style Transfer. In 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 2800–2810, Salt Lake City, UT, June 2018. IEEE. ISBN 978-1-5386-6420-9. doi: 10.1109/CVPR.2018.00296. +Bissoto, A., Fornaciali, M., Valle, E., and Avila, S. (De) Constructing Bias on Skin Lesion Datasets. In 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops (CVPRW), pp. 2766-2774, Long Beach, CA, USA, June 2019. IEEE. ISBN 978-1-72812-506-0. doi: 10.1109/CVPRW.2019.00335. +Bissoto, A., Valle, E., and Avila, S. Debiasing Skin Lesion Datasets and Models? Not So Fast. In 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops (CVPRW), pp. 3192-3201, Seattle, WA, USA, June 2020. IEEE. ISBN 978-1-72819-360-1. doi: 10.1109/CVPRW50498.2020.00378. +Brinker, T. J., Hekler, A., Enk, A. H., Klode, J., Hauschild, A., Berking, C., Schilling, B., Haferkamp, S., Schadendorf, D., Fröhling, S., Utikal, J. S., von Kalle, C., and Collaborators. A convolutional neural network trained with dermoscopic images performed on par with 145 dermatologists in a clinical melanoma image classification task. European Journal of Cancer (Oxford, England: 1990), 111:148-154, April 2019a. ISSN 1879-0852. doi: 10.1016/j.ejca.2019.02.005. +Brinker, T. J., Hekler, A., Hauschild, A., Berking, C., Schilling, B., Enk, A. H., Haferkamp, S., Karoglan, A., von Kalle, C., Weichenthal, M., Sattler, E., Schadendorf, D., Gaiser, M. R., Klode, J., and Utikal, J. S. Comparing artificial intelligence algorithms to 157 German dermatologists: The melanoma classification benchmark. + +European Journal of Cancer, 111:30-37, April 2019b. ISSN 0959-8049. doi: 10.1016/j.ejca.2018.12.016. +Codella, N. C. F., Gutman, D., Celebi, M. E., Helba, B., Marchetti, M. A., Dusza, S. W., Kalloo, A., Liopyris, K., Mishra, N., Kittler, H., and Halpern, A. Skin Lesion Analysis toward Melanoma Detection: A Challenge at the 2017 International Symposium on Biomedical Imaging (ISBI), hosted by the International Skin Imaging Collaboration (ISIC). In 2018 IEEE 15th International Symposium on Biomedical Imaging (ISBI 2018), pp. 168-172, April 2018. doi: 10.1109/ISBI.2018.8363547. +Csurka, G. A Comprehensive Survey on Domain Adaptation for Visual Applications. In Csurka, G. (ed.), Domain Adaptation in Computer Vision Applications, Advances in Computer Vision and Pattern Recognition, pp. 1-35. Springer International Publishing, Cham, 2017. ISBN 978-3-319-58347-1. doi: 10.1007/978-3-319-58347-1_1. +Deng, J., Dong, W., Socher, R., Li, L.-J., Li, K., and Fei-Fei, L. ImageNet: A large-scale hierarchical image database. In 2009 IEEE Conference on Computer Vision and Pattern Recognition, pp. 248-255, June 2009. doi: 10.1109/CVPR.2009.5206848. +Ganin, Y., Ustinova, E., Ajakan, H., Germain, P., Larochelle, H., Laviolette, F., Marchand, M., and Lempitsky, V. Domain-Adversarial Training of Neural Networks. In Csurka, G. (ed.), Domain Adaptation in Computer Vision Applications, pp. 189-209. Springer International Publishing, Cham, 2017. ISBN 978-3-319-58346-4 978-3-319-58347-1. doi: 10.1007/978-3-319-58347-1_10. +Gu, Y., Ge, Z., Bonnington, C. P., and Zhou, J. Progressive Transfer Learning and Adversarial Domain Adaptation for Cross-Domain Skin Disease Classification. IEEE Journal of Biomedical and Health Informatics, 24(5):1379-1393, May 2020. ISSN 2168-2208. doi: 10.1109/JBHI.2019.2942429. +Guan, H. and Liu, M. Domain Adaptation for Medical Image Analysis: A Survey. IEEE Transactions on Biomedical Engineering, 69(3):1173-1185, March 2022. ISSN 1558-2531. doi: 10.1109/TBME.2021.3117407. Conference Name: IEEE Transactions on Biomedical Engineering. +Ha, Q., Liu, B., and Liu, F. Identifying Melanoma Images using EfficientNet Ensemble: Winning Solution to the SIIM-ISIC Melanoma Classification Challenge. arXiv e-prints, 2010:arXiv:2010.05351, October 2020. +Haenssle, H., Fink, C., Schneiderbauer, R., Toberer, F., Buhl, T., Blum, A., Kalloo, A., Hassen, A. B. H., + +Thomas, L., Enk, A., Uhlmann, L., Alt, C., Arenbergerova, M., Bakos, R., Baltzer, A., Bertlich, I., Blum, A., Bokor-Billmann, T., Bowling, J., Braghiroli, N., Braun, R., Buder-Bakhaya, K., Buhl, T., Cabo, H., Cabrijan, L., Cevic, N., Classen, A., Deltgen, D., Fink, C., Georgieva, I., Hakim-Meibodi, L.-E., Hanner, S., Hartmann, F., Hartmann, J., Haus, G., Hoxha, E., Karls, R., Koga, H., Kreusch, J., Lallas, A., Majenka, P., Marghoob, A., Massone, C., Mekokishvili, L., Mestel, D., Meyer, V., Neuberger, A., Nielsen, K., Oliviero, M., Pampena, R., Paoli, J., Pawlik, E., Rao, B., Rendon, A., Russo, T., Sadek, A., Samhaber, K., Schneiderbauer, R., Schweizer, A., Toberer, F., Trennheuser, L., Vlahova, L., Wald, A., Winkler, J., Wolbing, P., and Zalaudek, I. Man against machine: Diagnostic performance of a deep learning convolutional neural network for dermoscopic melanoma recognition in comparison to 58 dermatologists. Annals of Oncology, 29(8):1836-1842, August 2018. ISSN 09237534. doi: 10.1093/annonc/mdy166. +Haenssle, H., Fink, C., Toberer, F., Winkler, J., Stolz, W., Deinlein, T., Hofmann-Wellenhof, R., Emmert, S., Buhl, T., Zutt, M., Blum, A., Abassi, M., Thomas, L., Tromme, I., Tschandl, P., Enk, A., Rosenberger, A., Alt, C., and Zukervar, P. Man against machine reloaded: Performance of a market-approved convolutional neural network in classifying a broad spectrum of skin lesions in comparison with 96 dermatologists working under less artificial conditions. Annals of Oncology, 31:137-143, January 2020. doi: 10.1016/j.annonc.2019.10.013. +Han, S. S., Kim, M. S., Lim, W., Park, G. H., Park, I., and Chang, S. E. Classification of the Clinical Images for Benign and Malignant Cutaneous Tumors Using a Deep Learning Algorithm. Journal of Investigative Dermatology, 138(7):1529-1538, July 2018. ISSN 0022202X. doi: 10.1016/j.jid.2018.01.028. +He, K., Zhang, X., Ren, S., and Sun, J. Deep Residual Learning for Image Recognition. In 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 770-778, Las Vegas, NV, USA, June 2016. IEEE. ISBN 978-1-4673-8851-1. doi: 10.1109/CVPR.2016.90. +Huang, G., Liu, Z., Van Der Maaten, L., and Weinberger, K. Q. Densely Connected Convolutional Networks. In 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 2261-2269, Honolulu, HI, July 2017. IEEE. ISBN 978-1-5386-0457-1. doi: 10.1109/CVPR.2017.243. +Jackson, P. T., Bonner, S., Jia, N., Holder, C., Stonehouse, J., and Obara, B. Camera Bias in a Fine Grained Classification Task. arXiv:2007.08574 [cs], July 2020. + +Jafari, M. H., Karimi, N., Nasr-Esfahani, E., Samavi, S., Soroushmehr, S. M. R., Ward, K., and Najarian, K. Skin lesion segmentation in clinical images using deep learning. In 2016 23rd International Conference on Pattern Recognition (ICPR), pp. 337-342, December 2016. doi: 10.1109/ICPR.2016.7899656. +Kim, B., Kim, H., Kim, K., Kim, S., and Kim, J. Learning Not to Learn: Training Deep Neural Networks With Biased Data. In 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 9004-9012, Long Beach, CA, USA, June 2019. IEEE. ISBN 978-1-72813-293-8. doi: 10.1109/CVPR.2019.00922. +Li, H., Wang, Y., Wan, R., Wang, S., Li, T.-Q., and Kot, A. C. Domain generalization for medical imaging classification with linear-dependency regularization. In Proceedings of the 34th International Conference on Neural Information Processing Systems, NIPS'20, pp. 3118-3129, Red Hook, NY, USA, December 2020. Curran Associates Inc. ISBN 978-1-71382-954-6. +Li, Y. and Shen, L. Skin Lesion Analysis towards Melanoma Detection Using Deep Learning Network. Sensors (Basel, Switzerland), 18(2), February 2018. ISSN 1424-8220. doi: 10.3390/s18020556. +Lio, P. A. and Nghiem, P. Interactive Atlas of Dermoscopy: Giuseppe Argenziano, MD, H. Peter Soyer, MD, Vincenzo De Giorgio, MD, Domenico Piccolo, MD, Paolo Carli, MD, Mario Delfino, MD, Angela Ferrari, MD, Rainer Hofmann-Wellenhof, MD, Daniela Massi, MD, Giampiero Mazzocchetti, MD, Massimiliano Scalvenzi, MD, and Ingrid H. Wolf, MD, Milan, Italy, 2000, Edra Medical Publishing and New Media. 208 pages. $290.00. ISBN 88-86457-30-8.CD-ROM requirements (minimum): Pentium 133 MHz, 32-Mb RAM, 24X CD-ROM drive, $800 \times 600$ resolution, and 16-bit color graphics capability. Test system: Pentium III 700 MHz processor running Microsoft Windows 98. Macintosh compatible only if running Windows emulation software. Journal of the American Academy of Dermatology, 50(5):807-808, May 2004. ISSN 0190-9622, 1097-6787. doi: 10.1016/j.jaad.2003.07.029. +Mandrekar, J. N. Receiver Operating Characteristic Curve in Diagnostic Test Assessment. Journal of Thoracic Oncology, 5(9):1315-1316, September 2010. ISSN 1556-0864. doi: 10.1097/JTO.0b013e3181ec173d. +Mishra, N. K. and Celebi, M. E. An Overview of Melanoma Detection in Dermoscopy Images Using Image Processing and Machine Learning. arXiv e-print, arXiv:1601.07843, January 2016. +Okur, E. and Turkan, M. A survey on automated melanoma detection. Engineering Applications of Artificial Intelli + +gence, 73:50-67, August 2018. ISSN 0952-1976. doi: 10.1016/j.engappai.2018.04.028. +Paszke, A., Gross, S., Massa, F., Lerer, A., Bradbury, J., Chanan, G., Killeen, T., Lin, Z., Gimelshein, N., Antiga, L., Desmaison, A., Kopf, A., Yang, E., DeVito, Z., Raison, M., Tejani, A., Chilamkurthy, S., Steiner, B., Fang, L., Bai, J., and Chintala, S. PyTorch: An imperative style, high-performance deep learning library. In Wallach, H., Larochelle, H., Beygelzimer, A., dAlché-Buc, F., Fox, E., and Garnett, R. (eds.), Advances in Neural Information Processing Systems 32, pp. 8024-8035. Curran Associates, Inc., 2019. +Rat, C., Hild, S., Sérandour, J. R., Gaultier, A., Quereux, G., Dreno, B., and Nguyen, J.-M. Use of Smartphones for Early Detection of Melanoma: Systematic Review. Journal of Medical Internet Research, 20(4): e9392, April 2018. doi: 10.2196/jmir.9392. +Rotemberg, V., Kurtansky, N., Betz-Stablein, B., Caffery, L., Chousakos, E., Codella, N., Combalia, M., Dusza, S., Guitera, P., Gutman, D., Halpern, A., Helba, B., Kittler, H., Kose, K., Langer, S., Lioprys, K., Malvehy, J., Musthaq, S., Nanda, J., Reiter, O., Shih, G., Stratigos, A., Tschandl, P., Weber, J., and Soyer, H. P. A patientcentric dataset of images and metadata for identifying melanomas using clinical context. Scientific Data, 8 (1):34, January 2021. ISSN 2052-4463. doi: 10.1038/s41597-021-00815-z. +Selvaraju, R. R., Cogswell, M., Das, A., Vedantam, R., Parikh, D., and Batra, D. Grad-CAM: Visual Explanations from Deep Networks via Gradient-Based Localization. In 2017 IEEE International Conference on Computer Vision (ICCV), pp. 618-626, October 2017. doi: 10.1109/ICCV.2017.74. +Shrikumar, A., Greenside, P., and Kundaje, A. Learning Important Features Through Propagating Activation Differences. In Proceedings of the 34th International Conference on Machine Learning, pp. 3145-3153. PMLR, July 2017. ISSN: 2640-3498. +Simonyan, K. and Zisserman, A. Very deep convolutional networks for large-scale image recognition. In International Conference on Learning Representations, 2015. +Simonyan, K., Vedaldi, A., and Zisserman, A. Deep inside convolutional networks: Visualising image classification models and saliency maps. In Workshop at International Conference on Learning Representations, 2014. +Szegedy, C., Vanhoucke, V., Ioffe, S., Shlens, J., and Wojna, Z. Rethinking the Inception Architecture for Computer Vision. In 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 2818-2826. + +IEEE Computer Society, June 2016. ISBN 978-1-4673-8851-1. doi: 10.1109/CVPR.2016.308. +Tan, M. and Le, Q. V. EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks. Proceedings of the 36th International Conference on Machine Learning, 97:6105-6114, 2019. +Tzeng, E., Hoffman, J., Darrell, T., and Saenko, K. Simultaneous Deep Transfer Across Domains and Tasks. In 2015 IEEE International Conference on Computer Vision (ICCV), pp. 4068-4076, December 2015. doi: 10.1109/ICCV.2015.463. +Westerhoff, K., McCarthy, W. H., and Menzies, S. W. Increase in the sensitivity for melanoma diagnosis by primary care physicians using skin surface microscopy. British Journal of Dermatology, 143(5):1016-1020, 2000. ISSN 1365-2133. doi: 10.1046/j.1365-2133.2000.03836.x. +Winkler, J. K., Fink, C., Toberer, F., Enk, A., Deinlein, T., Hofmann-Wellenhof, R., Thomas, L., Lallas, A., Blum, A., Stolz, W., and Haenssle, H. A. Association Between Surgical Skin Markings in Dermoscopic Images and Diagnostic Performance of a Deep Learning Convolutional Neural Network for Melanoma Recognition. JAMA Dermatology, 155(10):1135, October 2019. ISSN 2168-6068. doi: 10.1001/jamadermatol.2019.1735. +Winkler, J. K., Sies, K., Fink, C., Toberer, F., Enk, A., Abassi, M. S., Fuchs, T., and Haenssle, H. A. Association between different scale bars in dermoscopic images and diagnostic performance of a market-approved deep learning convolutional neural network for melanoma recognition. European Journal of Cancer, 145:146-154, March 2021. ISSN 0959-8049. doi: 10.1016/j.ejca.2020.12.010. +Xie, S., Girshick, R. B., Dollár, P., Tu, Z., and He, K. Aggregated Residual Transformations for Deep Neural Networks. 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2017. doi: 10.1109/CVPR.2017.634. + +# Appendix + +This section presents supplementary material that can be referenced to enhance the readers' understanding of the details of the work. We could not fit the general literature review for skin lesion classification in the paper, so this is presented in Section A. Samples of each training and test dataset are illustrated in Section B, to give a feel for the images present in each. Justification for our choice of metrics is given in Section C. Hyperparameter tuning results are presented in Section D. Additional experimental results in the form of ROC curves and tables that were not included in the main paper can be found in Section E. Our attempt at interpreting artefact bias using vanilla gradient saliency maps (Simonyan et al., 2014) is presented in Section E.1.1. + +# A. Skin lesion classification + +The task of classifying skin lesions using machine learning has received attention within the research community since as early as 1988, initially using traditional machine learning methods such as decision trees in combination with segmentation (Okur & Turkan, 2018). Originally, lack of model sophistication, compute power and quality data meant that performance was not at the level of dermatologists. Like with many other areas of computer vision, the rise of convolutional neural networks and ever increasing compute power has seen the performance of skin lesion classification models rapidly increase to the point where there is evidence of machine learning techniques matching or even surpassing dermatologists at the task (Brinker et al., 2019a; Haenssle et al., 2018). The power of deep learning to extract features has meant many modern models perform best without segmentation, and often use information in the surrounding skin in the classification task (Bissoto et al., 2019). + +Skin diseases can be separated into many classes. On the most granular scale, skin diseases can be separated into neoplastic and non-neoplastic conditions. A neoplastic condition is an abnormal growth of cells known as a tumour, while a non-neoplastic skin condition refers to any other type of skin condition. We focus on neoplastic lesions in this work. These neoplastic lesions can be separated into benign (non-cancerous) and malignant (cancerous), which is a very important classification to make, since cancerous tissue has the ability to invade the rest of the body and ultimately cause fatality. On a more fine-grained level, lesions may be classified by specific disease, such as cyst, basal cell carcinoma or melanoma. In terms of classification in machine learning, it is possible to use specific diseases as classes for prediction, allowing malignancy to be also inferred from this classification (Ha et al., 2020). We opt for the more common binary approach of classifying using benign/malignant as classes. + +# B. Examples of data + +Figure 8 shows a sample of the images from the ISIC dermoscopic training data (Codella et al., 2018; Rotemberg et al., 2021), including some examples of surgical markings and some examples of rulers. + +![](images/a98f4cc5a9bd59cc8fd8b04d3c8a828dbd57d89a1b5361ea9928b95af56caddf.jpg) +(a) Benign + +![](images/9d73979740f9cec5401097d4b2ef274e062329aa9de85a39e1fe1fa51aaf72d8.jpg) +(b) Malignant +Figure 8: Example images from the ISIC dermoscopic training set (Codella et al., 2018; Rotemberg et al., 2021). + +Figure 9 shows the class distribution for the surgical marking and ruler labels in the ISIC data. The distribution of artefacts is highly imbalanced, pointing to why weighted loss functions were needed to stabilise training. + +![](images/00cc2ed1f2bcc10d7189c1827459059a96f12add23743df9336e29cd2933cbf3.jpg) +(a) Marking distribution +Figure 9: Class distribution of artefacts in ISIC 2020 & 2017 training data (Codella et al., 2018; Rotemberg et al., 2021). + +![](images/2f62ec816fd06383ce2494a7a28f71b732ad94ec28d354025857bd84691b6b48.jpg) +(b) Ruler distribution + +Figure 10 shows a sample of the 'Heid Plain' images from Heidelberg University (Winkler et al., 2019). These are dermoscopic images collected by the university of a variety of neoplastic lesions. Figure 11 shows a sample of the 'Heid Marked' images from Heidelberg university (Winkler et al., 2019). These are the same lesions from 'Heid Plain', but with surgical markings either applied in vivo (physically applied and images recaptured), or electronically superimposed. Figure 12 shows a sample of the 'Heid Ruler' images, which was made by electronically superimposing rulers onto the 'Heid Plain' images. + +Figure 13 shows a sample of the 'Interactive Atlas of Dermoscopy' (Lio & Nghiem, 2004) dermoscopic images, while Figure 14 shows the equivalent clinical images from the same set. The domain shift between clinical and dermoscopic images is clearly illustrated: the skin/lesion can be seen in more detail in the dermoscopic images due to the + +![](images/cb3a03eeda8f83a21a82e95214a4a19f0311774dd6d73ee9d0f385f87f4fe511.jpg) +Figure 10: Example images from the Heidelberg University training set with no artefacts (Winkler et al., 2019). + +![](images/427ece1b8b9c091d419a0f5e5e7ffa1b9141122041f5c4f0d72731f98ca14ed3.jpg) +Figure 11: Example images from the Heidelberg University training set with surgical markings (Winkler et al., 2019). + +reduction in surface shine. + +Figure 15 shows a sample of the Asan clinical test set (Han et al., 2018). This dataset is collected from the Asan medical centre, Seoul, South Korea and so features predominantly South Korean patients. + +Figure 16 shows a sample of the MClass (Brinker et al., 2019b) dermoscopic benchmark test set, and Figure 17 shows a sample the MClass clinical benchmark test set. Both of these test sets were sent to a number of experienced dermatologists (157 for dermosocpic images, 145 for clinical images), who attempted to classify the images, with AUC scores reported in the work of Brinker et al. (2019b). Since true AUC cannot be calculated for dichotomous human predictions (we cannot adjust the threshold of human predictions), the authors use the average of sensitivity and specificity as a pseudo AUC score. + +# C. Metrics + +The best evaluation metric for the task was carefully considered. We took into account the commonly used metrics in similar studies, as well as the specific requirements of the experiments. + +Sensitivity (recall) is a measure of the proportion of the + +![](images/955e7f5a48f2455d61559a66f9bc01d9809976c61ad370a9cf8572bfaa2104b9.jpg) +Figure 12: Example images from the Heidelberg University training set with superimposed rulers (Winkler et al., 2019). + +![](images/1857b24f5a5d21260a4a980a59c3b32718ea2c29f68a073bc36f099be321bf71.jpg) +Figure 13: Example images from the Interactive Atlas of Dermoscopy dermoscopic test set (Lio & Nghiem, 2004). + +![](images/005b768009edf4c0130456b4e8b5dd2734ca21c67a193e6a55515e46bd4cb7ce.jpg) +Figure 14: Example images from the Interactive Atlas of Dermoscopy clinical test set (Lio & Nghiem, 2004). + +![](images/376fa1fb2419f7cf99df3c81f7d731e684cbc14324ca45200454969df14cd3b1.jpg) +Figure 15: Example images from the Asan clinical test set (Han et al., 2018). + +![](images/ba48a887b7bcb9356e025288cfa8672b98ea877d800b13d3f31fa7cb1dae3e0f.jpg) +Figure 16: Example images from the MClass dermoscopic test set (Brinker et al., 2019b). + +![](images/a97b213983475abbfcf36a39b89007130cd90c15c99febd180afca80771d51fa.jpg) +Figure 17: Example images from the MClass clinical test set (Brinker et al., 2019b). + +positive class that was correctly classified. Specificity is the proportion of the negative class that was correctly identified. These two metrics are defined as: + +$$ +S e n s i t i v i t y = \frac {T r u e P o s i t i v e}{T r u e P o s i t i v e + F a l s e N e g a t i v e} +$$ + +$$ +S p e c i f i c i t y = \frac {T r u e N e g a t i v e}{T r u e N e g a t i v e + F a l s e P o s i t i v e} +$$ + +These are regularly used as metrics in the medical sciences, since it is important to both identify disease (leading to correct treatment) and rule disease out (preventing unnecessary treatment). In order to use these metrics, a threshold must be set at which the output of a model (between 0 and 1) is taken as a positive or negative classification. The default position for this threshold is 0.5, but this threshold may also be adjusted towards finding an acceptable trade-off between true positive, true negative, false positive and false negative predictions. Analysing the receiver operating characteristic (ROC) curve is a very useful way of finding this threshold, as it visualises how sensitivity and specificity vary over every possible threshold (see Figure 21 for example ROC curves). + +The area under this curve (AUC) can hence be used as a single robust metric to evaluate the performance of a model where sensitivity and specificity are important, and where the threshold is open to adjustment (such as melanoma classification) (Mandrekar, 2010). We avoid relying on accuracy, sensitivity and specificity in this work, since these all rely on the assumption of a selected threshold, and instead use AUC as the primary metric, also plotting the ROC curves. This is standard practice in melanoma classification (Ha et al., 2020; Han et al., 2018; Li & Shen, 2018; Okur & Turkan, 2018). + +We anticipate that the binary classification threshold would then be selected by a medical professional to suit their desired level of sensitivity and specificity. An AUC of 1 means the classifier is distinguishing positive and negative classes perfectly, and an AUC of 0.5 equates to random chance. Anything less than 0.5 and there may be an issue with the model or data labelling, since the model is actively predicting the wrong classes; in fact, inverting the data labels in this case would result in an AUC of over 0.5. We also avoid relying on accuracy due to the imbalance between benign/malignant lesions in the test sets meaning accuracy is not as descriptive of performance as AUC. + +# D. Hyperparameter tuning + +Table 5 shows the chosen number of epochs for training each architecture for each dataset. These were chosen as the point at which the AUC reached its maximum or plateaued. + +Table 6 shows results of the grid search used to select learning rate and momentum, searching between 0.03 and 0.00001 for learning rate and 0 to 0.9 for momentum. We tune the baseline ResNeXt-101 model and also use these hyperparameters for the debiasing models to maximise cross-comparability. Whilst we used 5-fold cross validation for choosing the number of epochs, this was not computationally feasible for the grid search, and so a random subset (33%, 3326 images) of the 2018 (Codella et al., 2018) challenge data is used as the validation set for hyperparameter tuning. With more time and computational resources, we could have optimised the number of epochs at the same time as these hyperparameters. In hindsight, perhaps a random search rather than a brute force grid search would have allowed more exhaustive tuning within the computational limitations but it is important to note that the optimal performance is not the primary focus of this paper and as such, a detailed hyperparameter tuning procedure does not significantly contribute to the objectives of this paper. + +Table 5: Optimal number of epochs for training, selected through analysis of cross validation curves. + +
Training datasetArchitectureEpochs
ISICEfficientNet-B315
ISICResNet-1016
ISICResNeXt-1014
ISICInception-v35
ISICDenseNet6
+ +# E. Additional results + +# E.1. Artefact bias removal + +To label the artefacts in the training data, we attempt to use colour thresholding to automatically label both surgical markings and rulers. We set the script to separate the images into different directories for inspection. This method is somewhat successful for identifying surgical markings. However, by looking at the images labelled unmarked, we see that some are not picked up, and so we also go through and manually pick out the remainders. This method does not work well at all for labelling rulers, likely due to the fact that hairs have similar pixel values to rulers. As a result, we manually label each image for rulers. The manual labelling process is not difficult to the human eye since these artefacts are quite obvious and so this can be done quickly and accurately. + +Figure 18 shows the ROC plots from the surgical marking bias experiments. All models perform almost perfect classification of the easy test set with no artefacts (Figure 18a). The test set with surgical markings present causes perform + +Table 6: Hyperparameter tuning of baseline ResNeXt-101 model, trained for 4 epochs and using a random subset (33%, 3326 images) of the 2018 ISIC challenge data (Codella et al., 2018) is used as the validation set for hyperparameter tuning. + +
LRMomAUCLRMomAUCLRMomAUCLRMomAUC
0.0300.8070.030.30.8240.030.60.8000.030.90.789
0.0100.8250.010.30.8260.010.60.8370.010.90.834
0.00300.8370.0030.30.8520.0030.60.8540.0030.90.848
0.00100.8150.0010.30.8200.0010.60.8260.0010.90.843
0.000300.7830.00030.30.7980.00030.60.8090.00030.90.866
0.000100.6810.00010.30.7270.00010.60.7700.00010.90.814
0.0000300.4690.000030.30.5240.000030.60.6270.000030.90.783
0.0000100.3980.000010.30.4090.00010.60.4450.000010.90.681
+ +ance to drop for all models. However, it is clear from Figure 18b that the debiasing models are more robust than the baseline, especially LNTL, which retains close to the same AUC score across both test sets. Similarly, the introduction of rulers into the lesion images also causes a drop in the performance of all models (see Figure 19b). The baseline is again affected most by this bias, with TABE clearly most robust to it. + +Although we choose to use AUC as the primary metric rather than accuracy since accuracy depends on the threshold set (qualified in Appendix Appendix C), Table 7 shows the accuracy scores that correspond to the AUC scores in Table 1. These accuracy scores are calculated with a threshold of 0.5. These accuracy scores also corroborate that the debiasing techniques improve the models robustness to artefact bias. + +# E.1.1.SALIENCY MAPS + +Since artefact bias can be located by image region, we attempt to identify whether the model is utilising the artefacts for classification by producing vanilla gradient saliency maps (Simonyan et al., 2014). This is a pixel attribution method and is designed to highlight pixels that were most relevant for classification using a heatmap of the same resolution as the input image. This method leverages backpropagation to calculate the gradient of the loss function with respect to the input pixels. These pixel-wise derivative values can then be used to create a heatmap of the input image which highlights the location of pixels with high values. We output saliency maps for both the plain and biased images from the work of Winkler et al. (2021; 2019), to see if the focus of the model shifts from the lesion to the artefact (see Figure 20). It can be noticed in Figure 20 that for the baseline, there are less highlighted pixels in the lesion region when surgical markings are present compared to when there is not, and potentially more in regions that correspond to surgically marked regions. When using the LNTL model, the most salient pixels look to be located back in the general image region of the lesion, indicating + +the model has learned not to use the surgical markings for classification. + +This method is a simple saliency map technique and suffers from certain issues, such as the ReLU activation function leading to a saturation problem (Shrikumar et al., 2017). For future work, a more sophisticated technique like the GRAD-CAM post-hoc attention method (Selvaraju et al., 2017) may yield better quality visualisations. + +# E.2. Domain generalisation + +Figure 21 shows the ROC curves corresponding to Table 2. TABLE and CLGR are able to be differentiated from the baseline across most test sets, providing evidence that these models generalise better than the baseline when removing instrument bias. + +Table 8 is the full version of Table 3. A single debiasing head removing instrument bias is shown to be generally more effective than any combination of instrument, surgical marking or ruler bias removal. This is more evidence that combining debiasing heads can sometimes negatively impact performance, perhaps explaining the poor performance of the seven-head solution in the work of Bissoto et al. (2020). + +![](images/c179f1797d7e37c977236d8368a6cc7a8fe5f837a19d13b351cabb3845d1db0a.jpg) +(a) No surgical markings present. + +![](images/5c778f69eff9de720c21f0164f3b28f3b5f6296cb589bfff73552cbc6c27cf1a.jpg) +(b) Surgical markings present. +Figure 18: Comparison between model performances with no surgical markings present (left) vs with surgical markings present (right). EfficientNet-B3 trained on ISIC 2020 & 2017 data (Codella et al., 2018; Rotemberg et al., 2021), skewed to $dm = 20$ . + +Table 7: Comparison of each unlearning technique against the baseline, trained on artificially skewed ISIC data. 'Heid plain' test set is free of artefacts while 'Heid Marked' and 'Heid Rulers' are the same lesions with surgical markings and rulers present respectively. All scores are accuracy (0.5 threshold). + +
Experiment(a) Surgical Marking Removal (dm=20)Experiment(b) Ruler Bias Removal (dr=18)
Heid PlainHeid MarkedHeid PlainHeid Ruler
Baseline0.903±0.0060.853±0.018Baseline0.961±0.0090.682±0.057
LNTL†0.918±0.0080.906±0.017LNTL‡0.954±0.0130.778±0.046
TABE†0.928±0.0230.836±0.058TABE‡0.955±0.0090.835±0.030
CLGR†0.927±0.0210.915±0.015CLGR‡0.963±0.0050.899±0.002
+ +![](images/3c785de14d6cd2fd71524c8af9ab13838e29dc3f6b05fdc48e9a48bf29385d25.jpg) +(a) No rulers present. +Figure 19: Comparison between model performances with no rulers present (left) vs with rulers present (right). EfficientNet-B3 trained on ISIC 2020 & 2017 data (Codella et al., 2018; Rotemberg et al., 2021), skewed to $dr = 18$ . + +![](images/212bcecb2100c540fe651b2e4f3eedf92eea855f5e51a5f5e062167ec11a073a.jpg) +(b) Rulers present. + +![](images/633242d0d4e43791e8fc0bc4d664fc0cf025de42b2f77ef62f0ad3081f792d0f.jpg) +(a) No surgical markings, baseline. + +![](images/a62b12eb6ebf2b20e17fdbd5b89a64d33bf4814568f45d78d57b93a80c66379d.jpg) +(b) Surgical markings, baseline. +Figure 20: Vanilla gradient saliency maps (Simonyan et al., 2014) pointing to image regions most used by the model for classification. We compare the baseline on an unbiased and biased image of the same lesion, and also the LNTL model on the same biased image. + +![](images/ed752e10a61f461b6ba898e31fddbb929cbed87307a5539732ba6b9b23c1378e.jpg) +(c) Surgical markings, LNTL. + +Table 8: Domain generalisation: Comparison of generalisation benefits of using different targets for the debiasing heads (ResNeXt-101), including some models with two debiasing heads. The 'dermatologists' row is the AUC scores from the work of Brinker et al. (2019b). A capital 'D' indicates the images are dermoscopic, while a capital 'C' means the images are clinical. The $\S$ symbol indicates the use of instrument labels, $\dagger$ represents surgical marking labels and $\ddagger$ represents ruler labels. + +
ExperimentAtlasAsanMClass
DermoscopicClinicalClinicalDermoscopicClinical
Dermatologists———0.6710.769
Baseline0.8190.6160.7680.8530.744
LNTL§0.7760.5970.7460.8210.778
TABE§0.8170.6740.8570.9080.768
CLGR§0.7840.6500.7850.8180.807
LNTL†0.7370.5890.6310.7310.799
TABE†0.7880.6580.7680.8890.851
CLGR†0.7580.5830.6790.8190.774
LNTL‡0.8180.6160.7050.8490.759
TABE‡0.8130.6670.6790.8650.846
CLGR‡0.8180.6100.7600.8860.882
LNTL§+LNTL†0.7890.5880.7040.8490.796
TABE§+TABE†0.8070.6290.7790.8590.810
LNTL§+TABE†0.8020.5910.7660.8640.705
LNTL§+CLGR†0.5730.5740.6450.7170.617
CLGR§+CLGR†0.8010.6560.8400.8110.820
CLGR§+LNTL†0.7630.6150.7670.8330.790
TABE§+LNTL†0.8230.6290.7870.8810.781
LNTL§+LNTL‡0.7860.6040.6860.8370.779
TABE§+TABE‡0.8060.6120.7830.8270.794
LNTL§+TABE‡0.8060.6060.7280.8810.747
LNTL§+CLGR‡0.8160.6180.7400.8720.792
CLGR§+CLGR‡0.7980.6130.7230.8980.795
CLGR§+LNTL‡0.7930.5860.7040.8760.776
TABE§+LNTL‡0.8280.6400.7470.8800.824
+ +![](images/5f41ba2b4e23c050239cfdce5621290b9a3ae4fa50c6ccc7734a3df61d738546.jpg) +(a) Atlas dermoscopic. + +![](images/db5c67d843ef722a22d9a1519d881f3e1ac221d3a68965d1c73932b86863fa1b.jpg) +(b) Atlas clinical + +![](images/657b3e870e301f6e4dae595cf2e8725bb666ab65683315a6cf1db9a61a01a98b.jpg) +(c) Asan (clinical) + +![](images/d329b1eca66b0b14fd8f3b3cc714d3685f2f420798262b3ab45eba89ca56f093.jpg) +(d) MClass Dermoscopic + +![](images/8115aae8dee84236833fdaf138d0e13fd2f61a7254f29167774333086aff8f5d.jpg) +(e) MClass Clinical +Figure 21: ROC curves for each debiasing method, with ResNeXt-101 as the base architecture, aiming to remove spurious variation caused by the imaging instrument used. Model trained using the ISIC 2020 (Rotemberg et al., 2021) and 2017 data (Codella et al., 2018) and tested on five test sets (Brinker et al., 2019b; Han et al., 2018; Lio & Nghiem, 2004). \ No newline at end of file diff --git a/skindeepunlearningartefactandinstrumentdebiasinginthecontextofmelanomaclassification/images.zip b/skindeepunlearningartefactandinstrumentdebiasinginthecontextofmelanomaclassification/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..aaf2b803cee26b88ad7608df259cefd3ac071d78 --- /dev/null +++ b/skindeepunlearningartefactandinstrumentdebiasinginthecontextofmelanomaclassification/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2c64791e23f235bab70b8ce700ed9b2a8a53bca412b39370ea76ac84cd790c9f +size 1149693 diff --git a/skindeepunlearningartefactandinstrumentdebiasinginthecontextofmelanomaclassification/layout.json b/skindeepunlearningartefactandinstrumentdebiasinginthecontextofmelanomaclassification/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..85e9c77fe695c2d2bbb8dd71266627028d02dc99 --- /dev/null +++ b/skindeepunlearningartefactandinstrumentdebiasinginthecontextofmelanomaclassification/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1fc5a1d2bcc4ec3a0850574f4118f2e768b49df29db6309f6bc0201c7eccbde4 +size 542907 diff --git a/smoothedadaptiveweightingforimbalancedsemisupervisedlearningimprovereliabilityagainstunknowndistributiondata/e907bedb-5889-4497-8515-fc904b784f65_content_list.json b/smoothedadaptiveweightingforimbalancedsemisupervisedlearningimprovereliabilityagainstunknowndistributiondata/e907bedb-5889-4497-8515-fc904b784f65_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..9e575478652acf13b161395458465cf640171121 --- /dev/null +++ b/smoothedadaptiveweightingforimbalancedsemisupervisedlearningimprovereliabilityagainstunknowndistributiondata/e907bedb-5889-4497-8515-fc904b784f65_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cd09eba777fd0436d7c98028db0aa2a7d61ff73f1f601557375774cb778c25bd +size 111029 diff --git a/smoothedadaptiveweightingforimbalancedsemisupervisedlearningimprovereliabilityagainstunknowndistributiondata/e907bedb-5889-4497-8515-fc904b784f65_model.json b/smoothedadaptiveweightingforimbalancedsemisupervisedlearningimprovereliabilityagainstunknowndistributiondata/e907bedb-5889-4497-8515-fc904b784f65_model.json new file mode 100644 index 0000000000000000000000000000000000000000..3e2971808c1c1c65f1492e326a8a465e7e1c8d86 --- /dev/null +++ b/smoothedadaptiveweightingforimbalancedsemisupervisedlearningimprovereliabilityagainstunknowndistributiondata/e907bedb-5889-4497-8515-fc904b784f65_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:215290f9344ce8a3da47af2c5b04a6791d67c2396a375c552afec84ee95ee8e1 +size 132873 diff --git a/smoothedadaptiveweightingforimbalancedsemisupervisedlearningimprovereliabilityagainstunknowndistributiondata/e907bedb-5889-4497-8515-fc904b784f65_origin.pdf b/smoothedadaptiveweightingforimbalancedsemisupervisedlearningimprovereliabilityagainstunknowndistributiondata/e907bedb-5889-4497-8515-fc904b784f65_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..44778316808a0043a997c5f54f2a0d70d2ee8113 --- /dev/null +++ b/smoothedadaptiveweightingforimbalancedsemisupervisedlearningimprovereliabilityagainstunknowndistributiondata/e907bedb-5889-4497-8515-fc904b784f65_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3ce760dc4e9f0f401a40eac3a895b6a0f8d467279de5ddd025c0731ddf7270c4 +size 6869087 diff --git a/smoothedadaptiveweightingforimbalancedsemisupervisedlearningimprovereliabilityagainstunknowndistributiondata/full.md b/smoothedadaptiveweightingforimbalancedsemisupervisedlearningimprovereliabilityagainstunknowndistributiondata/full.md new file mode 100644 index 0000000000000000000000000000000000000000..86a6d8c0fdb32408aef3cf2831bbb1af86e9f03b --- /dev/null +++ b/smoothedadaptiveweightingforimbalancedsemisupervisedlearningimprovereliabilityagainstunknowndistributiondata/full.md @@ -0,0 +1,427 @@ +# Smoothened Adaptive Weighting for Imbalanced Semi-Supervised Learning: Improve Reliability Against Unknown Distribution Data + +Zhengfeng Lai\*1 Chao Wang\*2 Henry Gunawan1 Sen-Ching Cheung3 Chen-Nee Chuah1 + +# Abstract + +Despite recent promising results on semi-supervised learning (SSL), data imbalance, particularly in the unlabeled dataset, could significantly impact the training performance of a SSL algorithm if there is a mismatch between the expected and actual class distributions. The efforts on how to construct a robust SSL framework that can effectively learn from datasets with unknown distributions remain limited. We first investigate the feasibility of adding weights to the consistency loss and then we verify the necessity of smoothed weighting schemes. Based on this study, we propose a self-adaptive algorithm, named Smoothed Adaptive Weighting (SAW). SAW is designed to enhance the robustness of SSL by estimating the learning difficulty of each class and synthesizing the weights in the consistency loss based on such estimation. We show that SAW can complement recent consistency-based SSL algorithms and improve their reliability on various datasets including three standard datasets and one gigapixel medical imaging application without making any assumptions about the distribution of the unlabeled set. + +# 1. Introduction + +Although deep neural networks have repeatedly achieved promising performance on various tasks (He et al., 2016; Chen et al., 2019; Chan et al., 2019), their success heavily relies on the accessibility of large annotated datasets that typically involve labor-intensive labeling. The labeling cost + +$^{1}$ Department of Electrical and Computer Engineering, University of California Davis, Davis, CA, USA $^{2}$ Department of Statistics and Data Science, Southern University of Science and Technology, Shenzhen 518055, P.R. China (Work done at UC Davis.) $^{3}$ Department of Electrical and Computer Engineering, University of Kentucky, Lexington, KY, USA. Correspondence to: Zhengfeng Lai . + +Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s). + +could be even higher in medical imaging applications where images are at gigapixel level (Lai et al., 2021) and specific domain knowledge is required (Chan et al., 2019). Semi-supervised learning (SSL) is one of the promising methods to reduce the labeling cost by leveraging unlabeled data. + +To leverage unlabeled data effectively, recent state-of-the-art SSL algorithms (Arazo et al., 2020; Sohn et al., 2020; Berthelot et al., 2020) produce pseudo labels on unlabeled data, and then train the model by iteratively optimizing consistency loss as a regularization via pseudo labels. These SSL methods typically assume that labeled and unlabeled data are balanced (i.e., equal representation from different classes). One challenge for the wide-adoption of SSL is that the performance may suffer from imbalanced training set (Kim et al., 2020; Calderon-Ramirez et al., 2020; Pulido et al., 2020), such as a long-tailed dataset from CIFAR-10 shown in Figure 1(a) (Krizhevsky, 2009). Specifically, the model's predictions can be biased towards the majority classes and away from minority classes that have few samples (Dong et al., 2018). This affects the quality of pseudo labels, which could subsequently make the model even more biased with self-reinforcing errors (Tai et al., 2021). Consider the example shown in Figure 1: using FixMatch (Sohn et al., 2020) on the long-tailed CIFAR-10 dataset, Figure 1(c) shows that the numbers of pseudo labels for minority classes $\{6,7,8,9,10\}$ are significantly smaller than the true distribution. In fact, the smallest class receives no pseudo labels at all. Figure 1(b) shows that original SSL model generates more pseudo labels for majority classes. The bias in the pseudo label distribution has prolonged the training and affected the classification performance. + +In supervised learning (SL), re-weighting (Cao et al., 2019; Tan et al., 2020) and re-sampling (Kang et al., 2020; 2019; Chawla et al., 2002) based methods have shown their success. However, they were designed for SL and require label information of the entire dataset. Hence they may not be directly applicable in SSL settings where the majority samples are unlabeled. A few recent studies (Kim et al., 2020; Yang & Xu, 2020; Hyun et al., 2020; Wei et al., 2021) try to address the issue in SSL settings, but all of these methods may introduce additional heavy computations (e.g. complicated re-sampling (Wei et al., 2021), pseudo label alignment (Kim + +![](images/f8181eb2e1e175f5cc66e2abe79db391180ec389b31c07fc8f0b8dff5a6c2e55.jpg) +(a) + +![](images/f55aa0e51f6cecec6212ce65d633db564b062bb7bb514cdbd3bbd4771be31c4a.jpg) +(b) +Figure 1. Experimental results on CIFAR-10 under imbalanced ratio $\gamma = 100$ . (a) Class distribution of labeled and unlabeled data. (b) Estimated distribution of majority classes $\{1,2,3,4,5\}$ . (c) Estimated distribution of minority classes $\{6,7,8,9,10\}$ . + +![](images/637d5a198aaca8d1a99bafb5c10d1ba99af98fdeef74f138b7ce54d2372a9aeb.jpg) +(c) + +et al., 2020)) and have made assumptions about the distribution of the unlabeled data. For example, CReST (Wei et al., 2021) assumes that unlabeled data have almost the same distribution as labeled data. DARP (Kim et al., 2020) utilizes the confusion matrix from labeled data to estimate unlabeled data distribution. However, in real-world scenarios (such as in gigapixel pathology imaging problems (Lai et al., 2021)), such prior information about the unlabeled data is often unavailable. This is the second challenge SSL faces in realistic tasks. + +Contributions. As re-sampling based techniques may introduce significant computational cost (Lee et al., 2021), we focus on the feasibility of adapting re-weighting techniques from SL to SSL settings. We first relax the second challenge by following (Wei et al., 2021) to assume the unlabeled data share similar distribution as the labeled data. Under this setting, we verify the effectiveness and necessity of smoothed weighting schemes on the consistency loss in countering the class imbalance problem. We then turn to the second challenge of unknown distribution of unlabeled data and propose Smoothed Adaptive Weighting (SAW) that can automatically estimate the learning difficulty for each class and assign weights to the consistency loss per epoch. + +We demonstrate the compatibility of SAW to any existing pseudo-label based SSL algorithms and the effectiveness of SAW under various imbalanced degrees among the labeled and unlabeled sets. SAW improves both ReMix-Match (Berthelot et al., 2020) and FixMatch (Sohn et al., 2020) by up to $30.0\%$ and $40.5\%$ , respectively, in terms of absolute geometric mean scores (GM) gain. Furthermore, SAW outperforms DARP (Kim et al., 2020), a recent work that specifically tackles the imbalance issue in SSL, by up to $10.9\%$ . To demonstrate the robustness of SAW under different distributions, we also evaluate it on a hold-out test set that has completely different distribution from the training set and achieve up to $15\%$ of absolute performance gain over DARP (Kim et al., 2020). Lastly, we test SAW on a gigapixel-level pathology dataset (Lai et al., 2021) to verify the applicability of our algorithm on a real use-case + +in medical imaging. Our work differs from the prior work in that it deals with multi-class problems without making or relying on any assumptions about the unlabeled data. + +# 2. Related works + +Semi-supervised learning (SSL). One branch of SSL is pseudo labeled-based methods (Sohn et al., 2020; Berthelot et al., 2020; Arazo et al., 2020), which generate pseudo labels for unlabeled samples and use them in the following training loop. To promote consistency across predictions over unlabeled samples, consistency regularization can be applied across different augmented views of the same unlabeled training samples (Tarvainen & Valpola, 2017; Miyato et al., 2018). Recent state-of-the-art SSL algorithms such as FixMatch (Sohn et al., 2020) and ReMixMatch (Berthelot et al., 2020) combine both pseudo labels and consistency regularization. However, all of these aforementioned methods assume balanced class distribution in both labeled and unlabeled data and may face performance degradation in real-world imbalanced datasets (Calderon-Ramirez et al., 2020; Pulido et al., 2020). + +Imbalanced supervised learning. Real-world datasets are typically of "long-tailed" distribution (Liu et al., 2019; Van Horn et al., 2018; Jamal et al., 2020; Liu et al., 2020). Supervised learning on imbalanced distribution has been widely studied. Popular methods to re-sampling the data (Chawla et al., 2002; Buda et al., 2018; Pouyanfar et al., 2018; Kang et al., 2019) and re-weighting the loss function (Aurelio et al., 2019; Cao et al., 2019; Tan et al., 2020; Khan et al., 2017; Menon et al., 2020). Although these methods perform effectively on supervised learning where all samples are labeled, their applicability to SSL is unclear considering the majority of samples are unlabeled in SSL settings. + +Imbalanced semi-supervised learning. For multi-class classification, CReST (Wei et al., 2021) is a classrebalancing self-training framework to expand the labeled data by adding pseudo-labeled samples. One obvious draw- + +![](images/c22b7d2113b10eca04fe088e4833632a7e0a74a8ec1561631b0040b68bc32c76.jpg) +Figure 2. Illustration of the SAW framework. +Figure 3. The normalized weights generated from setting different values of $\beta$ by using the smoothing function (4). + +![](images/7545a6af09cd7fb6bf5291e7864e96de0e997ce6e4ffc0f5ee3bf205e1186d5a.jpg) + +back is that it directly assumes labeled and unlabeled data are of almost the same distribution, which may not be true in realistic scenarios. DARP (Kim et al., 2020) introduced a distribution aligning scheme to softly refine the pseudo labels generated from the model. However, DARP also assumes that labeled and unlabeled data can be sampled from similar input distribution: they approximate the confusion matrix of unlabeled data as that of labeled data. Another limitation of these methods is that they may introduce significantly additional computation cost. + +# 3. Methodology + +# 3.1. Preliminaries + +Consider a multi-class classification problem with $C$ classes $(C > 2)$ . An input vector and corresponding one-hot label are denoted $x\in \mathbb{R}^d$ and $y\in \{0,1\} ^C$ , respectively. Here $d$ is the dimension of the input. The training data contains $m$ labeled instances $\mathcal{D}^{(1)} = \left\{(x_i^{(1)},y_i^{(1)})\right\}_{i = 1}^m$ and $n$ unlabeled instances $\mathcal{D}^{(\mathrm{u})} = \left\{x_j^{(\mathrm{u})}\right\}_{j = 1}^n$ , with $m\ll n$ . The number of training labeled instances in $\mathcal{D}^{(1)}$ of class $k$ is denoted as $m_{k}$ , i.e., $\sum_{k = 1}^{C}m_{k} = m$ . Similarly, we have $n_k$ for unlabeled instances in $\mathcal{D}^{(\mathrm{u})}$ of class $k$ with $\sum_{k = 1}^{C}n_{k} = n$ . In general, the distribution of unlabeled data $\{n_k\}_{k = 1}^C$ is unknown. Without loss of generality, we assume $\{m_k\}$ and $\{n_k\}$ are sorted by cardinality in descending order, i.e., $m_1\geq m_2\geq \dots \geq m_C$ , and $n_1\geq n_2\geq \dots \geq n_C$ . In a class-imbalanced dataset, the class distribution is skewed, i.e., $m_1\gg m_C$ or $n_1\gg n_C$ . Here we define $\gamma_l = \frac{m_1}{m_C}$ and $\gamma_u = \frac{n_1}{n_C}$ to measure the degree of class imbalance in labeled and unlabeled data, respectively. + +The goal of SSL is to train a classifier $h(x;\theta) : \mathbb{R}^d \to [0,1]^C$ using the above training data. Here $h(x;\theta)$ is param- + +eterized by $\theta \in \Theta$ and its $k$ -component $h(x;\theta)_k \in [0,1]$ is the predictive probability for the $k$ -th class given an input $x$ . The training process is to minimize the loss in both labeled and unlabeled data + +$$ +\min _ {\theta \in \Theta} \sum_ {i = 1} ^ {m} \mathcal {L} _ {l} \left(x _ {i} ^ {(1)}, y _ {i} ^ {(1)}; \theta\right) + \sum_ {j = 1} ^ {n} \Omega \left(x _ {j} ^ {(\mathrm {u})}; \theta\right), \tag {1} +$$ + +where $\mathcal{L}_l$ is the per-sample supervised loss (e.g., cross-entropy) for labeled data and $\Omega$ is the per-sample regularization for unlabeled data. Note that some SSL algorithms (e.g., FixMatch (Sohn et al., 2020)) include both labeled and unlabeled data in the regularization term, where we can simply replace the second term of (1) by $\sum_{j=1}^{n+m} \Omega(x_j; \theta)$ , for $x_j \in \mathcal{D}^{(1)} \cup \mathcal{D}^{(\mathrm{u})}$ . One of the widely used regularization is consistency loss (Tarvainen & Valpola, 2017; Sohn et al., 2020; Miyato et al., 2018). This kind of regularization forces SSL to predict consistency on different views of the same sample. To utilize $\mathcal{D}^{(\mathrm{u})}$ effectively, many SSL algorithms infer their labels by some pseudo labeling scheme $p$ defined as $\left\{p(x_j^{(\mathrm{u})}; \theta) \in [0,1]^C \Bigg| \sum_{k=1}^C p(x_j^{(\mathrm{u})}; \theta)_k = 1 \right\}_{j=1}^n$ . Then, we can formulate the consistency loss as follow: + +$$ +\mathcal {L} _ {c} (x; \theta) := \sum_ {k = 1} ^ {C} p (x; \theta) _ {k} \cdot \log \left(h (\mathrm {p t} (x); \theta) _ {k}\right). \tag {2} +$$ + +Here $\mathfrak{pt}(x)$ defines the specific augmentation scheme. In VAT (Miyato et al., 2018), this operator is an adversarial perturbation that disregards the input class distribution. Fix-Match (Sohn et al., 2020) adopts strong and weak augmentation as perturbations in $\mathfrak{pt}(x)$ and $p(x;\theta)$ , respectively. Note that other consistency loss like the mean-square error can also be used: $\| p(x;\theta) - h(\mathfrak{pt}(x);\theta)\|_2^2$ . For simplicity, in the following content, we will only consider consistency loss (2) as the regularization term, i.e., $\Omega = \mathcal{L}_c$ . + +![](images/b3f652a8e57b6eaf6c894b1d2d11ded4a887b24af014b681a8ed768c4c2b0eae.jpg) +Figure 4. Empirical illustration of the performance with smoothing weighting functions under FixMatch (Sohn et al., 2020) on CIFAR10-LT (the imbalance ratio $\gamma = 100$ ). (a): The performance by using smoothing function (4) and setting different $\beta$ . (b) The performance by using smoothing function (5) and setting different $\nu$ . + +![](images/8077bf4459a87aeb97423ea93b9354eabe3becc334bb166bfdde3e255e8a97d4.jpg) + +# 3.2. A deeper look at weighting the consistency loss + +In this subsection, we take a deeper look at the consistency loss and investigate the feasibility of adding weights to the consistency loss, which differs from traditional cross-entropy loss studied in other imbalanced learning works. Here we define a weighted consistency loss as + +$$ +\mathcal {L} _ {c w} (x; w, \theta) := \sum_ {k = 1} ^ {C} w _ {k} \cdot p (x; \theta) _ {k} \cdot \log \left(h (\operatorname {p t} (x); \theta) _ {k}\right), \tag {3} +$$ + +where $w_{k}$ is the weight of the $k$ -th class. In supervised learning (SL), the assigned weights are associated with the number of samples for each class (Aurelio et al., 2019; Cao et al., 2019; Tan et al., 2020; Khan et al., 2017; Menon et al., 2020). However, in SSL settings, such information for the unlabeled set is typically unavailable. Before we fully address this challenge, we first assume that the unlabeled data share similar distribution as the labeled data and use this as the prior assumption to study the weighting schemes for the consistency loss. Then we will discuss how to synthesize the weights when the distribution is inconsistent and unknown in Section 3.3. + +Assumption 3.1. Unlabeled data share similar distribution as the labeled set, i.e., $\gamma_l = \gamma_u$ . + +The distribution of unlabeled data is assumed accessible under this strong assumption to help us take a deeper analysis on the feasibility of weighting the consistency loss and what weighting schemes should be applied if it is feasible. A long-tailed version of the CIFAR-10 (Krizhevsky, 2009) with a class-imbalanced ratio $\gamma \coloneqq \gamma_{l} = \gamma_{u} = 100$ is studied. We test FixMatch (Sohn et al., 2020) with its consistency loss replaced by $\mathcal{L}_{cw}$ . With such assumption, we first apply the weights by strictly inverse the class frequency to the consistency loss. As the imbalance ratio is severe here, we find + +the gradients can be accumulated to be abnormally large and result in unstable training (An et al., 2020; Cao et al., 2019), which may even hurt the original model (as shown in Figure 4(a) when $\beta = 1$ ). + +Effective re-weighting (Cui et al., 2019) is one of a typical smoothed weighting schemes for supervised learning. We adapt the corresponding weighting function into SSL as one example to further investigate whether weighting schemes are applicable to the consistency loss and what type of weights should be assigned. In (Cui et al., 2019), weights are set to be inversely proportional to the effective number of samples for each class, i.e., + +$$ +w _ {k} \propto 1 / E _ {k}, \text {w h e r e} E _ {k} = \left(1 - \beta^ {n _ {k}}\right) / (1 - \beta). \tag {4} +$$ + +The degree of flattening is determined by the value of $\beta$ as $\beta = 0$ leads to uniform weights. When $\beta$ goes to 1, $E_{k} \rightarrow n_{k}$ , which corresponds to the weights by strictly inverse class frequency. The normalized weights with different values of $\beta$ are shown in Figure 3. The performance is evaluated by balanced accuracy (bACC) (Wang et al., 2017; Huang et al., 2016) and geometric mean scores (GM) (Branco et al., 2016; Kubat, 1997). In Figure 4(a), we observe that selecting weights by either strictly inverse class frequency or uniform weights produce the worst results while smoothed versions of weights show some improvements. This observation indicates the importance of the smoothness for the weights added to consistency loss. + +To further verify the necessity of smoothed weights in consistency loss, we study other smoothing functions, such as + +$$ +w _ {k} \propto \frac {n}{n + \nu \cdot n _ {k}}, \text {f o r} k = 1, \dots , C, \tag {5} +$$ + +where $\nu$ is the hyper-parameter to describe the smoothing degree. Figure 4(a) shows the results of Equation (4) and Figure 4(b) shows the results of one alternative smoothing + +Algorithm 1 The SAW Framework +Data: Labeled data $\{(x_i,y_i)\}_{i = 1}^m$ , unlabeled data + $\{x_j\}_{j = 1}^n$ weight in supervised loss $w^{(1)}$ , number of +classes $C$ , learning rate $\eta$ , max epoch $T$ +Initialize uniform weights in consistency loss $w^{(\mathrm{u})}$ and +model parameter $\theta$ +while $t < T$ do +for 1, . $K$ do Sample batches label data $\{x,y\}$ Sample batches unlabeled data $\{x\}$ Update $\theta \leftarrow \theta -\eta \cdot \nabla \mathcal{L}(\theta ,w^{(\mathrm{u})})$ +end for +Compute pseudo labels $p(x;\theta)$ and estimate distribu- tion $(n_{1},n_{2},\dots,n_{C})$ Adjust the distribution $(\hat{n}_1,\hat{n}_2,\dots,\hat{n}_C)$ Update weight $w^{(\mathrm{u})}$ based on smoothed weighting func +tion +end while +Return: $\theta$ + +function (5): both of them provide some improvements when the weights are smoothed. Therefore, we verify the effectiveness of smoothed weights when the assumption that unlabeled data share similar distribution as the labeled data holds true in this subsection. + +# 3.3. SAW: Smoothed adaptive weighting against unknown distribution data + +In real-world scenarios, the distribution of unlabeled data is unknown and Assumption 3.1 cannot hold true. For example, in medical imaging applications (Lai et al., 2021; Tang et al., 2019), the distribution of gigapixel pathology images is unavailable unless the neuropathologists fully annotate the majority of samples. The weights in consistency loss therefore cannot be directly inferred from labeled data under this setting. In (Kim et al., 2020), the distribution of unlabeled data is estimated from the confusion matrix of a subset of labeled dataset. This estimation is limited as it assumes that confusion matrices of labeled and unlabeled datasets are similar. Besides, when labeled data are scarce, the confusion matrix of a subset of labeled dataset may fail to represent the whole dataset. In this subsection, we propose the learning difficulty to represent the whole dataset and synthesize the weights for the consistency loss, which does not rely on any assumptions about the unlabeled data. + +Learning difficulty and adaptive weighting. A recent work (Zhang et al., 2021) indicates that the learning effect of a class can be reflected by the number of predicted samples. When we take a deeper look into Figure 1(b) and (c), the number of pseudo labels for minority classes is significantly underestimated by FixMatch. Hence we follow the finding from (Zhang et al., 2021) to use the number of pseudo labels + +to reflect the the learning effect of each class during the training process. Here we refer to the minority classes as difficult classes and use the number of pseudo labels for one class as the metric to measure the learning difficulty of the model on that class. Fewer pseudo labels indicate that the corresponding class is a difficult class for the model. + +Instead of aligning the pseudo labels via estimating the distribution, our aim is to alleviate the confirmation bias of pseudo labels based on the estimated learning difficulty. This can be implemented by adaptively synthesizing the smoothed weight term $w^{(\mathbf{u})}$ for consistency loss, which will encourage the model to focus on difficult classes. In general, we utilize gradient descent methods or its variants, such as Adam (Kingma & Ba, 2015), to update the $\theta$ in the training process, i.e., $\theta \gets \theta - \eta \cdot \nabla \mathcal{L}(\theta, w^{(\mathbf{u})})$ , where $\eta$ is the learning rate and $\mathcal{L}$ is the loss function: $\mathcal{L}(\theta, w^{(\mathbf{u})}) = \sum_{i=1}^{m} \mathcal{L}_{lw}(x_i^{(1)}, y_i^{(1)}; w^{(1)}, \theta) + \sum_{j=1}^{n} \mathcal{L}_{cw}(x_j^{(\mathbf{u})}; w^{(\mathbf{u})}, \theta)$ . The weight $w^{(1)}$ is fixed based on the distribution of the labeled data, while the weight $w^{(\mathbf{u})}$ is initialized to be uniform. After training for one epoch, we compute the one-hot pseudo label $p(x, \theta)$ via the updated $\theta$ . Then class distributions can be estimated by $n_k = \sum_{j=1}^{n} p(x_j, \theta)_k$ , for $k = 1, \ldots, C$ . Take the effective re-weighting (Cui et al., 2019) as one example here. The weights can be proportional to $(1 - \beta) / (1 - \beta^{n_k})$ . But singularity may rise when estimated $n_k = 0$ . Here we adjust $n_k$ by $\hat{n}_k = \max(n_k, 1)$ . Note that this weighting function (Cui et al., 2019) is not a requisite and can be replaced by other smoothed weighting functions described in Section 3.2. During the training process, improved quality of pseudo labels could result in a better estimation of distribution. We call this proposed algorithm as smoothed adaptive weighting (SAW), which is summarized in Algorithm 1 and Figure 2. + +# 4. Experiments + +In this section, we evaluate the efficacy of SAW on various class-imbalanced scenarios for SSL in multi-class classification problems, including CIFAR-10, CIFAR100 (Krizhevsky, 2009), and STL-10 (Coates et al., 2011). The evaluation criteria on these imbalanced classification problems include balanced accuracy (bACC) (Huang et al., 2016; Wang et al., 2017) and geometric mean scores (GM) (Branco et al., 2016). We run each algorithm for three trials to report the mean value and standard deviation under each setting. All experiments use the same encoder (Wide ResNet-28-2 (Oliver et al., 2018)) and batch size (64) under the same number of training iterations (around $2.5 \times 10^{5}$ ). Lastly, we evaluate SAW on a gigapixel pathology imaging dataset (Lai et al., 2021) to further verify the applicability of SAW in practical settings with unavailable distribution. Our codes can be found at https://github.com/ZJUJeffLai/SAW_SSL. + +Table 1. Comparison of classification performance on CIFAR10-LT under $\gamma = {\gamma }_{l} = {\gamma }_{u}$ (hold-out test set is balanced). The evaluation criterion is bACC/GM. The best results are in bold. + +
AlgorithmSSLRBγ = 50γ = 100γ = 150
Wide ResNet-28-2 (Oliver et al., 2018)--65.2±0.05 / 61.1±0.0958.8±0.13 / 51.0±0.1155.6±0.43 / 44.0±0.98
Re-sampling (Japkowicz, 2000)-✓64.3±0.48 / 60.6±0.6755.8±0.47 / 45.1±0.3052.2±0.05 / 38.2±1.49
LDAM-DRW (Cao et al., 2019)-✓68.9±0.07 / 67.0±0.0862.8±0.17 / 58.9±0.6057.9±0.20 / 50.4±0.30
cRT (Kang et al., 2020)-✓67.8±0.13 / 66.3±0.1563.2±0.45 / 59.9±0.4059.3±0.10 / 54.6±0.72
ReMixMatch (Berthelot et al., 2020)✓-81.5±0.26 / 80.2±0.3273.8±0.38 / 69.5±0.8469.9±0.47 / 62.5±0.35
ReMixMatch + cRT (Kang et al., 2019)✓✓86.8±0.50 / 86.5±0.4981.4±0.41 / 80.7±0.4578.9±0.84 / 77.8±0.94
ReMixMatch + DARP (Kim et al., 2020)✓-82.1±0.14 / 80.8±0.0975.8±0.09 / 72.6±0.2471.0±0.27 / 64.5±0.68
ReMixMatch + DARP + cRT (Kim et al., 2020)✓✓87.3±0.61 / 87.0±0.1183.5±0.07 / 83.1±0.0979.7±0.54 / 78.9±0.49
ReMixMatch + CReST (Wei et al., 2021)✓✓85.2±0.19 / 84.9±0.2576.2±0.31 / 75.1±0.2871.4±0.23 / 67.5±0.40
ReMixMatch + SAW✓-86.3±0.61 / 86.1±0.6477.0±0.59 / 76.0±0.4271.5±0.30 / 68.9±0.26
ReMixMatch + SAW + cRT (Kang et al., 2019)✓✓87.6±0.21 / 87.4±0.2685.4±0.32 / 83.9±0.2179.9±0.15 / 79.9±0.12
FixMatch (Sohn et al., 2020)✓-79.2±0.33 / 77.8±0.3671.5±0.72 / 66.8±1.5168.4±0.15 / 59.9±0.43
FixMatch + DARP (Kim et al., 2020)✓-81.8±0.24 / 80.9±0.2875.5±0.05 / 73.0±0.0970.4±0.25 / 64.9±0.17
FixMatch + CReST (Wei et al., 2021)✓✓83.0±0.39 / 81.5±0.1775.7±0.38 / 72.7±0.8570.8±0.25 / 64.5±0.31
FixMatch + CReST + & LA (Wei et al., 2021)✓✓85.6±0.36 / 81.9±0.4581.2±0.70 / 74.5±0.9971.9±2.24 / 64.4±1.75
FixMatch + SAW✓-84.0±0.10 / 83.6±0.1277.5±0.63 / 76.3±0.8071.6±0.35 / 69.7±0.46
FixMatch + SAW + & LA (Menon et al., 2020)✓✓86.2±0.15 / 83.9±0.3580.7±0.15 / 77.5±0.2173.7±0.06 / 71.2±0.17
+ +Table 2. Comparison of classification performance on CIFAR10-LT under $\gamma_l = 100, \gamma_u \neq \gamma_l$ (hold-out test set is balanced). The evaluation criterion is bACC/GM. The best results are in bold. + +
Algorithmγu=1γu=50γu=150
ReMixMatch (Berthelot et al., 2020)48.3±0.14 / 19.5±0.8575.1±0.43 / 71.9±0.7772.5±0.10 / 68.2±0.32
ReMixMatch* (Berthelot et al., 2020)85.0±1.35 / 84.3±1.5577.0±0.12 / 74.7±0.0472.8±0.10 / 68.8±0.21
ReMixMatch* + DARP (Kim et al., 2020)89.7±0.15 / 89.4±0.1777.4±0.22 / 75.0±0.2573.2±0.11 / 69.2±0.31
ReMixMatch* + CReST (Wei et al., 2021)45.9±1.27 / 20.1±1.9970.2±0.45 / 65.8±0.7165.4±0.34 / 62.9±0.15
ReMixMatch* + SAW88.3±0.15 / 88.9±0.1080.3±0.36 / 79.6±0.4074.0±0.94 / 72.4±0.94
FixMatch (Sohn et al., 2020)68.9±1.95 / 42.8±8.1173.9±0.25 / 70.5±0.5269.6±0.60 / 62.6±1.11
FixMatch + DARP (Kim et al., 2020)85.4±0.55 / 85.0±0.6577.3±0.17 / 75.5±0.2172.9±0.24 / 69.5±0.18
FixMatch + CReST (Wei et al., 2021)60.2±1.34 / 35.9±2.5065.8±0.78 / 67.1±0.8460.1±1.44 / 51.4±1.68
FixMatch + SAW83.9±0.44 / 83.3±0.4781.5±2.25 / 80.9±2.3076.8±0.31 / 75.4±0.37
+ +# 4.1. CIFAR10-LT + +Setup. We evaluate SAW on a "synthetically long-tailed" variant of CIFAR-10 (CIFAR10-LT) introduced in (Kim et al., 2020; Cui et al., 2019; Cao et al., 2019). In the training set, all images are randomly sampled based on the predefined imbalance ratios: $\gamma_l$ is for labeled data while $\gamma_u$ is for unlabeled data. We set $m_1 = 1500$ and $n_1 = 3000$ , then have $m_k = m_1 \cdot \gamma_l^{\epsilon_k}$ and $n_k = n_1 \cdot \gamma_l^{\epsilon_k}$ , where $\epsilon_k = -\frac{k-1}{C-1}$ . After that, we vary $\gamma_l$ and $\gamma_u$ to construct multiple CIFAR10-LT to mimic different imbalanced scenarios. The hold-out test set remains untouched and balanced (Kim et al., 2020). + +Main results under $\gamma_{l} = \gamma_{u}$ . Following (Kim et al., 2020), we evaluate SAW assuming that labeled and unlabeled sets are sampled from almost the same distributions by setting $\gamma$ at 50, 100, 150, respectively (Kim et al., 2020). To verify the effectiveness of SAW, we apply it to the recent state-of-the-art SSL algorithms: ReMixMatch (Berthelot et al., + +2020) and FixMatch (Sohn et al., 2020). To have a comprehensive comparison, we selected several benchmarks: 1) Wide ResNet-28-2 (Oliver et al., 2018) as a supervised learning baseline without using any unlabeled data and rebalancing algorithms; 2) Re-sampling (Japkowicz, 2000); 3) Label distribution-aware margin (LDAM-DRW) (Cao et al., 2019); 4) classifier Re-Training cRT (Kang et al., 2020). We compare SAW with recent imbalanced SSL algorithms, DARP (Kim et al., 2020) and CReST (Wei et al., 2021). The results are summarized in Table 1. SAW consistently improves both FixMatch and ReMixMatch on bACC and GM for all evaluated settings. Specifically, SAW improves the bACC of FixMatch up to $6\%$ absolute bACC gain and achieves up to $9.8\%$ absolute GM gain compared to the original FixMatch. Besides, it also improves up to $4.8\% / 6.5\%$ at absolute bACC/GM gain compared to ReMixMatch. SAW consistently outperforms the recent imbalanced algorithm (DARP) for both bACC and GM in all settings. In (Kim + +Table 3. Comparison of classification performance on CIFAR100-LT under $\gamma = {\gamma }_{l} = {\gamma }_{u}$ ,and STL-10 where the distribution of unlabeled data is unknown. Hold-out test set is balanced. The evaluation criterion is bACC/GM. The best results are in bold. + +
AlgorithmCIFAR100-LT (γ = γl = γu)STL-10
γ = 10γ = 20γl = 10γl = 20
ReMixMatch (Berthelot et al., 2020)59.2±0.03 / 52.1±0.1353.5±0.03 / 42.3±0.1367.8±0.45 / 61.1±0.9260.1±1.18 / 44.9±1.52
ReMixMatch* + DARP (Kim et al., 2020)59.8±0.20 / 52.9±0.4154.4±0.07 / 44.2±0.0779.4±0.07 / 78.2±0.1070.9±0.44 / 67.0±1.62
ReMixMatch* + CReST (Wei et al., 2021)59.6±0.32 / 52.5±0.2453.9±0.15 / 43.9±0.1965.3±0.23 / 59.3±0.4155.8±2.05 / 40.2±2.39
ReMixMatch* + SAW61.8±0.06 / 56.9±0.4055.3±0.26 / 46.3±0.6582.0±0.55 / 81.0±0.6479.2±0.44 / 77.9±0.52
FixMatch (Sohn et al., 2020)60.1±0.05 / 54.4±0.1154.0±0.04 / 44.4±0.1772.9±0.09 / 69.6±0.0163.4±0.21 / 52.6±0.09
FixMatch + DARP (Kim et al., 2020)61.1±0.23 / 56.4±0.2854.9±0.05 / 46.4±0.4177.8±0.33 / 76.5±0.4069.9±1.77 / 65.4±3.07
FixMatch + CReST (Wei et al., 2021)60.8±0.32 / 54.9±0.4554.5±0.21 / 44.8±0.1970.5±0.75 / 67.8±0.3260.5±2.13 / 50.3±2.56
FixMatch + SAW62.1±0.25 / 58.0±0.2055.7±0.10 / 49.4±0.4078.3±0.25 / 77.0±0.1971.9±0.81 / 69.0±0.81
+ +Table 4. Comparison of classification performance on CIFAR10-LT under $\gamma = {\gamma }_{l} = {\gamma }_{u}$ (hold-out test set is of reversed distribution). The evaluation criterion is bACC/GM. The best results are in bold. + +
Algorithmγ = 50γ = 100γ = 150
ReMixMatch (Berthelot et al., 2020)71.0±0.55 / 83.5±0.2954.7±0.51 / 74.4±0.4741.5±1.69 / 66.4±1.22
ReMixMatch + DARP (Kim et al., 2020)66.9±0.75 / 80.5±0.4649.7±1.55 / 70.5±0.9035.8±1.81 / 60.9±2.42
ReMixMatch + CReST (Wei et al., 2021)64.3±0.25 / 75.7±0.3451.2±0.92 / 72.1±0.8539.2±1.46 / 65.8±1.88
ReMixMatch + SAW86.3±0.61 / 86.1±0.6477.0±0.59 / 76.0±0.4271.5±0.30 / 68.9±0.26
FixMatch (Sohn et al., 2020)70.5±0.26 / 82.2±0.3151.0±1.65 / 71.5±1.2438.5±1.15 / 63.4±0.31
FixMatch + DARP (Kim et al., 2020)72.2±0.62 / 82.8±0.1757.6±0.36 / 74.8±0.4846.5±1.26 / 68.1±0.10
FixMatch + CReST (Wei et al., 2021)69.4±0.35 / 80.1±0.4152.4±0.32 / 70.3±0.2842.9±1.45 / 67.4±1.07
FixMatch + SAW78.7±0.77 / 84.2±0.3664.3±1.96 / 76.4±0.8857.5±2.83 / 70.5±1.50
+ +et al., 2020), they showed the compatibility of DARP with cRT (Kang et al., 2019) under ReMixMatch (Berthelot et al., 2020); in (Wei et al., 2021) they showed the compatibility of CReST with LA (Menon et al., 2020). Therefore, to have a fair comparison, we follow their methodologies to design experiments to evaluate the combination of SAW and cRT/LA. We find SAW is compatible with cRT/LA and its performance can be further improved. + +Main results under $\gamma_{l} \neq \gamma_{u}$ . In real-world scenarios, it is natural that unlabeled data have different distributions, i.e., $\gamma_{l} \neq \gamma_{u}$ . Under this setting, traditional methods (LA (Menon et al., 2020) and cRT (Kang et al., 2019)) designed for SL may not be applicable considering the unknown distribution of unlabeled sets. We acknowledge that CReST (Wei et al., 2021) is originally designed with the assumption that the distribution of the unlabeled data is similar to that of the labeled data, and hence may not work well with the various scenarios we consider. However, we include the baseline results for completion. In Table 2, SAW shows its superiority when unlabeled data have different imbalanced ratio from labeled data, especially when unlabeled data are also severely imbalanced (such as $\gamma_{u} = 50 / 150$ ). In these settings, SAW improves original ReMixMatch up to $5.2\%$ of bACC and $7.7\%$ of GM. Meanwhile, it improves original FixMatch up to $15\%$ of bACC and $40.5\%$ of GM. + +Even compared to DARP, SAW outperforms up to $4.2\%$ of bACC and $5.9\%$ of GM. Although the performance of SAW on balanced unlabeled data is slightly lower than DARP, it still improves original FixMatch and ReMixMatch significantly. Considering the fact that DARP needs to explicitly assume similar distribution between labeled and unlabeled set (Kim et al., 2020), SAW has the potential to enhance the practicability of SSL in the real-world datasets where the distribution of unlabeled data is unavailable. + +# 4.2. CIFAR100-LT and STL-10 + +Setup. Besides CIFAR10-LT, we also evaluate our framework on CIFAR-100 (Krizhevsky, 2009) and STL-10 (Coates et al., 2011). For CIFAR-100, we follow the above process to set $\gamma$ and prepare a long-tailed training set as CIFAR100-LT, where we set $m_{1} = 150$ and $n_1 = 300$ . For STL-10, we set $m_{1}$ as 450 and construct a similar "synthetically long-tailed" version of labeled data; all unlabeled data are used since their class distribution is unknown. Hence the imbalanced ratio of labeled data can be different from that of unlabeled data $(\gamma_l\neq \gamma_u)$ . Main results. The results on CIFAR100-LT and STL-10 are summarized in Table 3. Note that the gain of SAW is significant under $\gamma_{l} = 20$ in STL-10: $19.1\% /30.0\%$ of improvements at bACC/GM for ReMixMatch, $18.5\% /16.4\%$ of improve + +![](images/d8e8ce6a774965858363a07b1976c64de0c7da2a5b19e235c15ffb2415de7527.jpg) +Figure 5. Segmentation masks visualization: GM, WM, and background are indicated by cyan, yellow, and black, respectively. SL refers to train supervised learning (U-Net (Oskal et al., 2019)) on all 20 pathology images with their annotations. The SSL results are only using $0.1\%$ area of 2 pathology images selected from the training set. + +ments at bACC/GM for FixMatch. When we compare it with DARP, it still outperforms DARP up to $8.3\% / 10.9\%$ on ReMixMatch. This is due to the vast mismatch between the distribution of labeled data and that of unlabeled data. Therefore, the results here prove the superiority of SAW for both matching and non-matching distributions between the labeled and unlabeled data. + +# 4.3. Empirical analysis on SAW + +Stress-test. The previous sections report the results on a balanced test set. In reality, if the training set is severely imbalanced, the hold-out test set can also be imbalanced, and even follow a totally different distribution compared to the training set. We first evaluate all algorithms on a test set that is of the same distribution as training set, but we find all algorithms perform very well as expected. Thus, to further stress-test these algorithms, we construct a hold-out test set with a flipped distribution compared to the training data. Table 4 summarizes the results on the situations where labeled and unlabeled data are sampled from the same distribution. Under this setting, DARP (Kim et al., 2020) even hurt the performance of original ReMixMatch. SAW improves both original SSL algorithms and outperforms DARP (Kim et al., 2020). SAW improves ReMixMatch up to $30\%$ at bACC and $2.6\%$ at GM. Similarly, SAW also improves original FixMatch up to $19\%$ at bACC and $7.1\%$ at GM. We find that DARP may degrade the performance of original ReMix-Match while SAW consistently outperforms both DARP and baselines. For the settings where unlabeled data have different distributions (as shown in Appendix B.2), SAW achieves more surprising improvements, with up to $15\%$ of absolute performance gain compared to DARP. + +Computational complexity. In SAW, as we neither have any resampling actions nor alignment optimization, the ad + +ditional running time constitutes only $5\%$ of the original SSL models as we simply add the weights. However, the additional running time incurred by DARP due to the pseudolabel alignment can be up to $20\%$ of that of the original SSL algorithms. For CReST, as it iteratively samples the training data and re-initializes the classifier's network, the additional running time can be an order of magnitude longer than the original SSL algorithms. + +# 4.4. Additional evaluation on a real-world application + +Besides above standard datasets, we further evaluate SAW on a gigapixel pathology imaging dataset (Lai et al., 2021) as a real-world application. In this dataset, each slide is at gigapixel level and the goal is to segment white matter (WM) from grey matter (GM). We follow the settings of a recent work (Lai et al., 2021): $0.1\%$ of regions from 2 slides are labeled and the hold-out test set includes 10 slides. Figure 5 shows the segmentation masks from the SL (U-Net (Oskal et al., 2019)) trained with all pathology images annotated at pixel level, original FixMatch (Sohn et al., 2020), and SAW without any prior information from the unlabeled data by using only $0.1\%$ regions from 2 slides as the labeled set. Figure 5 clearly shows the performance gain of SAW on WM (the minority class): original SSL algorithm has difficulty classifying WM while SAW improves significantly. Statistically, for the minority class - WM, SAW improves the IoU score (Rahman & Wang, 2016) by over $22\%$ ; for the majority class - GM, it also achieves nearly $4\%$ of improvement. For the DICE coefficient (Zou et al., 2004), another metric, SAW brings up to $15.9\%$ of improvement on the minority class and $1.6\%$ on the majority class. More numerical results are in the Appendix B.8. Considering the fact that we truly regard the dataset as unlabeled and does not make any assumption on the unlabeled data, we + +have verified the applicability of SAW on a medical case. We do not include the comparison with DARP (Kim et al., 2020) and CReST (Wei et al., 2021) here as the distribution of the unlabeled set in this case is unavailable without neuropathologists' assessments. + +# 5. Discussion + +In this work, we have presented the effectiveness of smoothed adaptive weighting scheme (SAW) on imbalanced semi-supervised learning via various imbalanced scenarios using several public datasets. We also evaluate SAW on a pathology imaging dataset to show its reliability against unknown distribution data. We verify the feasibility of adding weights to the consistency loss and the necessity of smoothed weights. Based on this, we estimate learning difficulty of each class and synthesize the smoothed weights based on this estimation, which can overcome the challenge of unknown distribution in unlabeled data. When combined with two leading SSL methods FixMatch and ReMixMatch, SAW shows consistent improvements over the baselines and those augmented with DARP in almost all experiment settings. The two main advantages of SAW are: first, it does not require any knowledge of the class distribution of the unlabeled data and work well even in the case when the labeled data, unlabeled data and testing data all assume vastly different distributions; second, it can be easily integrated with any SSL algorithms that use consistency loss. + +# Acknowledgements + +This work was supported by the NSF HDR:TRIPODS grant CCF-1934568. + +# References + +An, J., Ying, L., and Zhu, Y. Why resampling outperforms reweighting for correcting sampling bias with stochastic gradients. In International Conference on Learning Representations, 2020. +Arazo, E., Ortego, D., Albert, P., O'Connor, N. E., and McGuinness, K. Pseudo-labeling and confirmation bias in deep semi-supervised learning. In 2020 International Joint Conference on Neural Networks (IJCNN), pp. 1-8. IEEE, 2020. +Aurelio, Y. S., de Almeida, G. M., de Castro, C. L., and Braga, A. P. Learning from imbalanced data sets with weighted cross-entropy function. Neural Processing Letters, 50(2):1937-1949, 2019. +Berthelot, D., Carlini, N., Cubuk, E. D., Kurakin, A., Sohn, K., Zhang, H., and Raffel, C. Remixmatch: Semi-supervised learning with distribution alignment and aug- + +mentation anchoring. In International Conference on Learning Representations (ICLR), 2020. +Branco, P., Torgo, L., and Ribeiro, R. P. A survey of predictive modeling on imbalanced domains. ACM Computing Surveys (CSUR), 49(2):31, 2016. +Buda, M., Maki, A., and Mazurowski, M. A. A systematic study of the class imbalance problem in convolutional neural networks. Neural Networks, 106:249-259, 2018. +Busa-Fekete, R., Szörenyi, B., Dembczynski, K., and Hüllermeier, E. Online F-measure optimization. In Advances in Neural Information Processing Systems (NeurIPS), volume 28, 2015. +Calderon-Ramirez, S., Moemeni, A., Elizondo, D., Colreavy-Donnelly, S., Chavarria-Estrada, L. F., Molina-Cabello, M. A., et al. Correcting data imbalance for semi-supervised Covid-19 detection using x-ray chest images. arXiv preprint arXiv:2008.08496, 2020. +Cao, K., Wei, C., Gaidon, A., Arechiga, N., and Ma, T. Learning imbalanced datasets with label-distribution-aware margin loss. In Advances in Neural Information Processing Systems (NeurIPS), volume 32, 2019. +Chan, L., Hosseini, M. S., Rowsell, C., Plataniotis, K. N., and Damaskinos, S. Histosegnet: Semantic segmentation of histological tissue type in whole slide images. In Proceedings of the IEEE/CVF International Conference on Computer Vision (CVPR), pp. 10662-10671, 2019. +Chawla, N. V., Bowyer, K. W., Hall, L. O., and Kegelmeyer, W. P. SMOTE: synthetic minority over-sampling technique. Journal of Artificial Intelligence Research, 2002. +Chen, W., Jiang, Z., Wang, Z., Cui, K., and Qian, X. Collaborative global-local networks for memory-efficient segmentation of ultra-high resolution images. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 8924-8933, 2019. +Coates, A., Ng, A., and Lee, H. An analysis of single-layer networks in unsupervised feature learning. In Proceedings of the fourteenth international conference on artificial intelligence and statistics (AISTATS), 2011. +Cui, Y., Jia, M., Lin, T.-Y., Song, Y., and Belongie, S. Class-balanced loss based on effective number of samples. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2019. +Dong, Q., Gong, S., and Zhu, X. Imbalanced deep learning by minority class incremental rectification. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2018. + +He, K., Zhang, X., Ren, S., and Sun, J. Deep residual learning for image recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 770-778, 2016. +Huang, C., Li, Y., Change Loy, C., and Tang, X. Learning deep representation for imbalanced classification. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016. +Hyun, M., Jeong, J., and Kwak, N. Class-imbalanced semi-supervised learning. arXiv preprint arXiv:2002.06815, 2020. +Jamal, M. A., Brown, M., Yang, M.-H., Wang, L., and Gong, B. Rethinking class-balanced methods for long-tailed visual recognition from a domain adaptation perspective. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 7610-7619, 2020. +Japkowicz, N. The class imbalance problem: Significance and strategies. In Proceedings of the International Conference on Artificial Intelligence (ICAI), 2000. +Kang, B., Xie, S., Rohrbach, M., Yan, Z., Gordo, A., Feng, J., and Kalantidis, Y. Decoupling representation and classifier for long-tailed recognition. In International Conference on Learning Representations, 2019. +Kang, B., Xie, S., Rohrbach, M., Yan, Z., Gordo, A., Feng, J., and Kalantidis, Y. Decoupling representation and classifier for long-tailed recognition. In International Conference on Learning Representations (ICLR), 2020. +Khan, S. H., Hayat, M., Bennamoun, M., Sohel, F. A., and Togneri, R. Cost-sensitive learning of deep feature representations from imbalanced data. IEEE transactions on neural networks and learning systems, 29(8):3573-3587, 2017. +Kim, J., Hur, Y., Park, S., Yang, E., Hwang, S. J., and Shin, J. Distribution aligning refinery of pseudo-label for imbalanced semi-supervised learning. In Advances in Neural Information Processing Systems (NeurIPS), volume 33, pp. 14567-14579, 2020. +Kingma, D. P. and Ba, J. Adam: A method for stochastic optimization. International Conference on Learning Representations (ICLR), 2015. +Krizhevsky, A. Learning multiple layers of features from tiny images. Technical report, Department of Computer Science, University of Toronto, 2009. +Kubat, M. Addressing the curse of imbalanced training sets: One-sided selection. In Proceedings of the International Conference on Machine Learning (ICML), pp. 179-186, 1997. + +Lai, Z., Wang, C., Oliveira, L. C., Dugger, B. N., Cheung, S.-C., and Chuah, C.-N. Joint semi-supervised and active learning for segmentation of gigapixel pathology images with cost-effective labeling. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 591-600, 2021. +Lee, H., Shin, S., and Kim, H. Abc: Auxiliary balanced classifier for class-imbalanced semi-supervised learning. Advances in Neural Information Processing Systems, 34, 2021. +Liu, J., Sun, Y., Han, C., Dou, Z., and Li, W. Deep representation learning on long-tailed data: A learnable embedding augmentation perspective. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 2970-2979, 2020. +Liu, Z., Miao, Z., Zhan, X., Wang, J., Gong, B., and Yu, S. X. Large-scale long-tailed recognition in an open world. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 2537-2546, 2019. +Menon, A. K., Jayasumana, S., Rawat, A. S., Jain, H., Veit, A., and Kumar, S. Long-tail learning via logit adjustment. In International Conference on Learning Representations, 2020. +Miyato, T., Maeda, S.-i., Koyama, M., and Ishii, S. Virtual adversarial training: a regularization method for supervised and semi-supervised learning. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2018. +Oliver, A., Odena, A., Raffel, C. A., Cubuk, E. D., and Goodfellow, I. Realistic evaluation of deep semi-supervised learning algorithms. In Advances in Neural Information Processing Systems (NeurIPS), pp. 3235-3246, 2018. +Oskal, K., Risdal, M., Janssen, E., Undersrud, E., and Gulsrud, T. A U-net based approach to epidermal tissue segmentation in whole slide histopathological images. SN Appl. Sci., 1:672, 06 2019. doi: 10.1007/s42452-019-0694-y. +Pouyanfar, S., Tao, Y., Mohan, A., Tian, H., Kaseb, A. S., Gauen, K., Dailey, R., Aghajanzadeh, S., Lu, Y.-H., Chen, S.-C., et al. Dynamic sampling in convolutional neural networks for imbalanced data classification. In 2018 IEEE conference on multimedia information processing and retrieval (MIPR), pp. 112-117. IEEE, 2018. +Pulido, J. V., Guleria, S., Ehsan, L., Fasullo, M., Lippman, R., Mutha, P., Shah, T., Syed, S., and Brown, D. E. Semi-supervised classification of noisy, gigapixel histology images. In 2020 IEEE 20th International Conference on Bioinformatics and Bioengineering (BIBE), pp. 563-568. IEEE, 2020. + +Rahman, M. A. and Wang, Y. Optimizing intersection-overunion in deep neural networks for image segmentation. In International symposium on visual computing, pp. 234-244. Springer, 2016. +Sohn, K., Berthelot, D., Carlini, N., Zhang, Z., Zhang, H., Raffel, C. A., Cubuk, E. D., Kurakin, A., and Li, C.-L. FixMatch: Simplifying semi-supervised learning with consistency and confidence. Advances in Neural Information Processing Systems (NeurIPS), 33, 2020. +Tai, K. S., Bailis, P., and Valiant, G. Sinkhorn label allocation: Semi-supervised classification via annealed self-training. In International Conference on Machine Learning (ICML), 2021. +Tan, J., Wang, C., Li, B., Li, Q., Ouyang, W., Yin, C., and Yan, J. Equalization loss for long-tailed object recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 11662-11671, 2020. +Tang, Z., Chuang, K. V., DeCarli, C., Jin, L.-W., Beckett, L., Keiser, M. J., and Dugger, B. N. Interpretable classification of alzheimer's disease pathologies with a convolutional neural network pipeline. Nature communications, 10(1):1-14, 2019. +Tarvainen, A. and Valpola, H. Mean teachers are better role models: Weight-averaged consistency targets improve semi-supervised deep learning results. In Advances in Neural Information Processing Systems (NeurIPS), 2017. +Van Horn, G., Mac Aodha, O., Song, Y., Cui, Y., Sun, C., Shepard, A., Adam, H., Perona, P., and Belongie, S. The inaturalist species classification and detection dataset. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018. +Wang, Y.-X., Ramanan, D., and Hebert, M. Learning to model the tail. In Advances in Neural Information Processing Systems (NeurIPS), 2017. +Wei, C., Sohn, K., Mellina, C., Yuille, A., and Yang, F. CReST: A class-rebalancing self-training framework for imbalanced semi-supervised learning. arXiv preprint arXiv:2102.09559, 2021. +Yang, Y. and Xu, Z. Rethinking the value of labels for improving class-imbalanced learning. In Advances in Neural Information Processing Systems (NeurIPS), volume 33, pp. 19290-19301, 2020. +Zhang, B., Wang, Y., Hou, W., Wu, H., Wang, J., Okumura, M., and Shinozaki, T. Flexmatch: Boosting semisupervised learning with curriculum pseudo labeling. Advances in Neural Information Processing Systems, 34, 2021. + +Zou, K. H., Warfield, S. K., Bharatha, A., Tempany, C. M., Kaus, M. R., Haker, S. J., Wells III, W. M., Jolesz, F. A., and Kikinis, R. Statistical validation of image segmentation quality based on a spatial overlap index1: scientific reports. Academic radiology, 11(2):178-189, 2004. + +# Appendix + +# A. Training details + +# A.1. Data source and compute resources + +The three standard datasets we use are public: + +- CIFAR-10 (Krizhevsky, 2009) can be downloaded at https://www.cs.toronto.edu/ kriz/cifar.html; +- CIFAR-100 (Krizhevsky, 2009) can be downloaded at https://www.cs.toronto.edu/ kriz/cifar.html; +- STL-10 (Coates et al., 2011) can be downloaded at https://cs.stanford.edu/acoates/stl10/. + +We run our experiments on GPUs including: Nvidia Titan XP, 2080Ti, Tesla T4, Titan RTX. We conduct all experiments under an environment with Ubuntu 18.04 (x86) as the OS, CUDA 10.0.130 and cuDNN 8 as the GPU drivers and libraries. Our mainly used framework includes PyTorch 1.1.0 and Torchvision 0.3.0. + +# A.2. Training settings + +General settings. We adopt a Wide ResNet-28-2 (Oliver et al., 2018) as the encoder for all experiments in this work. We use Adam (Kingma & Ba, 2015) as our optimizer with the learning rate at 0.002. We also utilize an Exponential Moving Average (EMA) with the weight decay of 0.999 during the training process. Our baseline SSL models include the most recent state-of-the-art algorithms: FixMatch (Sohn et al., 2020), ReMixMatch (Berthelot et al., 2020). We train each setting with 500 epochs and have three trials with different random seeds. + +FixMatch. We set the hyper-parameters of FixMatch by following (Sohn et al., 2020; Kim et al., 2020). The details are summarized in Table 5. The GitHub we refer to is available at https://github.com/google-research/fixmatch. + +Table 5. FixMatch settings. + +
Hyper-parameterValue
Confidence Threshold τ0.95
Unlabeled loss weight λu1
Ratio of unlabeled data in each mini-batch μ2
+ +ReMixMatch. We set the hyper-parameters of ReMixMatch by following (Berthelot et al., 2020; Kim et al., 2020). The details are summarized in Table 6. The GitHub we refer to is available at https://github.com/google-research/remixmatch. + +Table 6. ReMixMatch settings. + +
HyperparameterValue
MixUp Beta Distribution α0.75
Sharpening Temperature (T)0.5
Weight on Unsupervised Loss λu1.5
Weight on Rotation Loss λr0.5
Weight on Un-Augmented Example λu0.5
+ +DARP. One of our baseline is the most recent imbalanced algorithm, DARP (Kim et al., 2020). We follow their settings strictly: $\alpha$ is set as 2.0, the number of warm-up epochs is set as 200, the number of iterations for DARP convergence is set as 10. The GitHub we refer to is available at https://github.com/bbuing9/DARP. + +Our codes. To protect the confidentiality of double blind review, we will post our GitHub URL for all of our codes of SAW after the review process. + +# B. Additional Experimental Results + +# B.1. Distribution estimation + +We also plot the class frequency during the training process to observe the role SAW plays in SSL algorithms. We set the imbalance ratio of CIFAR10-LT as $\gamma_l = \gamma_u = 50$ and use FixMatch as an example. The results are as shown in Figure 6: for the majority class, SAW is able to drive it back from biased prediction within a couple of epochs. For the minority class, SAW shows its focus and encourages the model to predict samples as miniorty class. + +# B.2. Stress-test + +We also conduct stress-test experiments under the settings of $\gamma_l \neq \gamma_u$ on the test set of reversed distributions. The results are summarized in Table 7. SAW achieves significant improvements in all settings where the distribution of unlabeled data is different from that of labeled data. Specifically, SAW improves original FixMatch by up to $15.4\%$ of bACC and $35.1\%$ of GM; SAW also improves original ReMix-Match by up to $14.0\%$ of bACC and $35.4\%$ of GM. SAW also shows its superiority compared to DARP, especially considering SAW does not require any prior information from the unlabeled data. + +On the other hand, we study the scenarios where the holdout test set is imbalanced with the same distribution as the labeled dataset in the training set. The results are summarized in Table 9. We can see that all methods achieve good performance since the test set has the same distribution as the training set. However, CReST slightly hurts the original performance of SSL. + +After that, we also study more severe scenarios: when the + +![](images/dae48d61bbee4fa09e3e51d34292f750bd2ea341e4cd49db1e3107bc2729c94f.jpg) +(a) + +![](images/2c3a727c7bc84c56b94411a8178ee2e735e3eb78c4be5f39cb4292ab4e29e9e1.jpg) +(b) + +![](images/13709979619f983cbf8d82cd7b21085b20fd179defe11068540575b63bb23bd1.jpg) +(c) +Figure 6. Estimation of distribution: class frequency of class 2 (a), class 5 (b), and class 9 (c). + +Table 7. Comparison of classification performance on CIFAR10-LT under $\gamma_l = 100, \gamma_u \neq \gamma_l$ (hold-out test set is of reversed distributions). The evaluation criterion is bACC/GM. The best results are in bold. + +
AlgorithmCIFAR-10 (γl=100)
γu=1γu=50γu=150
ReMixMatch (Berthelot et al., 2020)70.0±1.39 / 48.3±0.5361.4±0.21 / 77.3±0.4148.6±1.62 / 71.3±0.67
ReMixMatch* + DARP (Kim et al., 2020)67.3±1.63 / 49.5±2.0154.5±1.30 / 72.6±0.5844.6±1.69 / 67.7±1.16
ReMixMatch* + SAW84.0±0.05 / 83.7±0.4272.7±0.56 / 79.6±1.1159.8±1.03 / 73.6±1.19
FixMatch (Sohn et al., 2020)70.0±1.39 / 48.3±0.5361.0±1.61 / 76.4±0.5248.0±2.26 / 70.4±0.88
FixMatch + DARP (Kim et al., 2020)68.1±0.37 / 48.5±1.4659.5±1.41 / 75.2±1.0855.1±1.31 / 73.8±0.43
FixMatch + SAW84.0±0.39 / 83.4±0.4276.4±6.71 / 81.5±1.9763.3±0.37 / 75.4±1.23
+ +training labeled data is perfectly balanced, but the unlabeled data and hold-out data are imbalanced and flipped, we summarize the results in Table 8: we find DARP even hurts the original FixMatch while SAW still achieves performance gain consistently. + +Table 8. Comparison of bACC on CIFAR10-LT under $\gamma_{l} = 1$ (labeled set is balanced) but $\gamma_{u} \neq \gamma_{l}$ . The hold-out test set is of the flipped distribution of the training unlabeled set. + +
CIFAR10-LT
γu50100150
FixMatch (Sohn et al., 2020)77.8±0.3666.8±1.5159.9±0.43
FixMatch + DARP (Kim et al., 2020)68.4±1.3655.6±3.2252.1±2.07
FixMatch + SAW82.4±0.4975.2±1.4670.1±0.94
+ +# B.3. Per-class performance + +To show the source of our absolute performance gain, we present per-class F1 score (Busa-Fekete et al., 2015) on the balanced test set of CIFAR10-LT with $\gamma_l = \gamma_u = 100$ as shown in Figure 7(a). We find SAW improves the F1 score for almost every class, especially for minority classes (index as 8,9,10). Specifically, SAW provides gain on the precision of majority classes and the recall of minority classes without much penalty on other metrics. This explains again why + +Table 9. Comparison of bACC on CIFAR10-LT under $\gamma = \gamma_{l} = \gamma_{u}$ . The hold-out test set is of the same distribution of the training set (imbalanced). + +
AlgorithmCIFAR10-LT
γ = 50γ = 100γ = 150
FixMatch (Sohn et al., 2020)89.2±0.5985.4±0.5983.1±0.33
FixMatch + DARP (Kim et al., 2020)93.1±1.9590.1±0.9888.5±0.89
FixMatch + CReST (Wei et al., 2021)86.7±1.9884.3±1.2082.4±1.46
FixMatch + SAW94.7±1.2392.4±0.3590.5±0.47
+ +SAW achieves significant gain in Table 4 where the distribution of hold-out test set is flipped based on unlabeled data' distribution (the minority class in the training set becomes the majority class in the test set). Figure 7 also shows the comparison of the confusion matrix of original FixMatch (Figure 7(b)) and SAW (Figure 7(c)) on the hold-out test set. Similar to the estimated distributions shown in Figure 1(b) and (c), we find that SAW provides robust re-weighting on both the minority and majority classes due to the smoothed weighting scheme, which is easily transferred to better generalization on a test set of totally different distributions. + +We also compare the per-class performance during the training process between original FixMatch (Sohn et al., 2020) + +![](images/39e7c27a5efe6ff2a0ec3b38d70f82c63b21a4475bd2e2c8f0cacc95b94ffc78.jpg) +(a) + +![](images/65ef2e3690f52d37e1a37649fa8aa78afe1af3a4576f9c282e3957bff4b03d27.jpg) +(b) +Figure 7. Per-class results on the balanced test set of CIFAR-10 under the imbalanced ratio $\gamma = 100$ . (a) F1 score for each class. (b) Confusion matrix of original FixMatch. (c) Confusion matrix of FixMatch with SAW. + +![](images/10a399d60eacee7db8924c8dfcdd2a2ef69e586eb8e47021c3093c2984cfa377.jpg) +(c) + +and SAW. As shown in Figure 8, we plot the confusion matrix after training 100, 200, and 300 epochs, respectively. SAW improves the performance of minority classes quickly, even 100 epochs make a difference compared to the original FixMatch. + +# B.4. Alternative for smoothed weighting function + +Besides the two mentioned in the main paper, we also studied + +$$ +w _ {k} \propto (n / n _ {k}) ^ {\alpha}, \text {f o r} k = 1, \dots , C, \tag {6} +$$ + +as another smoothing weighting function. We use SAW_2 to denote using Equation 6 as the smoothing function. We use SAW_1 to denote using Equation 5. As shown in Table 10, SAW_2 achieves $83.2\%$ , $77.3\%$ , and $71.5\%$ of bACC when $\gamma = 50, 100$ , and 150, respectively in CIFAR 10-LT. These results are comparable to the results of the other two functions in Table 1. Hence we verify the necessity of smoothing weights to SSL. + +Table 10. Comparison of classification performance on CIFAR10-LT under $\gamma = \gamma_l = \gamma_u$ (hold-out test set is balanced). The evaluation criterion is bACC. + +
AlgorithmCIFAR10-LT
γ = 50γ = 100γ = 150
FixMatch (Sohn et al., 2020)79.2±0.3371.5±0.7268.4±0.15
FixMatch + DARP (Kim et al., 2020)81.8±0.2475.5±0.0570.4±0.25
FixMatch + CReST (Wei et al., 2021)83.0±0.3975.7±0.3870.8±0.25
FixMatch + SAW84.0±0.1077.5±0.6371.6±0.35
FixMatch + SAW_183.7±0.1878.2±0.2172.5±0.67
FixMatch + SAW_283.2±0.4877.3±0.1771.5±0.53
+ +# B.5. Effect of adaptive weighting + +To investigate the effect of adaptive updating, we conduct a sanity test: provide the true class distribution to the model by replacing the estimated distribution with the true distribution. Here we test the CIFAR10-LT where the labeled and + +unlabeled data share the same distribution. The true distribution of unlabeled data can be directly estimated from labeled data. To distinguish from SAW, we call this smoothed weighting without the adaptive scheme as SW. The results are summarized in Table 11. With the true distribution for estimating $\beta$ , our SW improves FixMatch up to $4.7\%$ on bACC when $\gamma = 100$ . With the adaptive weighting scheme, our algorithm SAW further improves the performance, which proves the advantage of the adaptive weighting. SAW even achieves better performance compared to CReST+ (Wei et al., 2021) considering they have a strong pre-assumption that unlabeled data are sample from the same distributions as labeled data while SAW does not require any prior information from unlabeled data. In SW, where the weights are calculated based on the true distribution, the weight for each class is fixed and not adjustable during the training process. The performance will be affected by the degree of smoothing, i.e., the value of $\beta$ . In SAW, the weight is based on the pseudo-label distribution, which can make the model adjustable and self-reinforcing. Hence SAW is less sensitive to the value of $\beta$ and may perform better than SW when using non-optimal value of $\beta$ . A similar observation can be seen in Table 12. With an optimal value of beta and a known distribution of unlabeled data, SW performs slightly better than SAW. + +Table 11. Comparison of classification performance on CIFAR10-LT under $\gamma = \gamma_l = \gamma_u$ (hold-out test set is balanced). The evaluation criterion is bACC. The best results are in bold. + +
AlgorithmCIFAR10-LT
γ=50γ=100γ=150
FixMatch (Sohn et al., 2020)79.2±0.3371.5±0.7268.4±0.15
FixMatch + DARP (Kim et al., 2020)81.8±0.2475.5±0.0570.4±0.25
FixMatch + CReST (Wei et al., 2021)83.0±0.3975.7±0.3870.8±0.25
FixMatch + CReST+ (Wei et al., 2021)83.9±0.1477.4±0.3672.8±0.58
FixMatch + SW82.7±0.5876.2±0.0670.8±0.26
FixMatch + SAW84.0±0.1077.5±0.6371.6±0.35
+ +![](images/8901dfcc6792abaafce6e1cf7722af786987ed1bd26ab799d8c6ed66a897771a.jpg) +After 100 Epochs + +![](images/ec3fdd4a3045296ef4a0759f248300de23ab6e50621ab9cf223234987dda0532.jpg) +After 200 Epochs + +![](images/25ad1b953d1792e947b7f9831ea60ee3490c664167fe6b3c709b208f8b192fd0.jpg) +After 300 Epochs + +![](images/79c40618a872ff63f3d09aa8234e887515b5dbd438a2bd84083dbbf4eee9c502.jpg) +Figure 8. The confusion matrix comparison between original FixMatch (Sohn et al., 2020) and FixMatch + SAW during the training progress. The top row is from original FixMatch while the bottom row denotes FixMatch + SAW. + +![](images/f8059abf9f4252c1c8e689961b9f2a0e169724997ebc65690cc485502c2e62d5.jpg) + +![](images/5fef9c0dc400abeea38dfbaea2c0768b1e35e997e8f5614de550e4f935826c55.jpg) + +Table 12. Comparison of classification performance on CIFAR10-LT under $\gamma = 100$ (hold-out test set is of balanced) with a fixed $\beta = 0.99, 0.999, 0.9999$ . The evaluation criterion is bACC/GM. The best results are in bold. + +
Algorithmβ = 0.99β = 0.999β = 0.9999
FixMatch + SW75.0±0.67 / 73.0±0.5877.5±0.98 / 76.3±1.2172.4±1.69 / 70.7±2.16
FixMatch + SAW77.3±0.67 / 75.4±0.8877.4±0.30 / 76.2±0.4073.7±0.63 / 72.3±0.93
+ +Table 13. Comparison of classification performance on CIFAR10-LT under $\gamma = \gamma_{l} = \gamma_{u}$ (hold-out test set is balanced). The evaluation criterion is bACC. SL_W denotes only applying smoothed weights to the supervised loss on labeled data, CL_W denotes only applying smoothed weights to the consistency loss. + +
AlgorithmCIFAR10-LT
γ=50γ=100γ=150
FixMatch (Sohn et al., 2020)79.2±0.3371.5±0.7268.4±0.15
FixMatch + SL_W79.9±0.0572.2±0.8968.9±0.33
FixMatch + CL_W82.5±0.3076.3±0.2170.4±0.19
FixMatch + SAW84.0±0.1077.5±0.6371.6±0.35
+ +# B.6. Effect of weights on supervised loss + +The motivation on adding the weight in consistency loss is to alleviate the bias in pseudo labels during the class-imbalanced training. We have studied the function of weighting in both supervised loss and consistency loss. We conclude that applying smoothed weights to both loss items can result in the best performance based on our experiments. Table 13 summarizes the results: the weights on consistency loss are important, which is expected considering the fact that the majority samples are unlabeled in SSL settings. We also find that applying weights to the supervised loss can further improve the performance. Thus we decide to apply smoothed weights to both loss items, which is SAW. + +# B.7. Effect of the parameter $\beta$ + +As discussed in Methodology, we heuristically select $\beta = (N - 1) / N$ , where $N$ is updated after each epoch via $N = \sum_{k=1}^{C} (m_k + \hat{n}_k) / C$ . Here a sensitivity analysis on the parameter $\beta$ is provided. Similarly, we consider CIFAR10-LT under $\gamma = 100$ , and test both SW and SAW with a fixed $\beta \in \{0.99, 0.999, 0.9999\}$ in the training process. Table 12 shows that the trend is similar to the weighting function of $\nu$ , indicating the effectiveness of smoothed weighting in SSL. Moreover, SAW is less sensitive to the value of $\beta$ . Therefore, there is no need to specifically tune the parameter $\beta$ for each setting. The heuristic selection in SAW already brings the + +optimal result among these trials. Hence $\beta = (N - 1) / N$ is a parameter determining the degree of smoothing. In reality, this parameter needs to be tuned as the data volume $N$ is unknown. However, the value of $\beta$ is only sensitive to the scale of $N$ . We only provided a reference value of $N$ , which is the average number of samples per class. This can be regarded as an approximate value to the optimal one. When applying the proposed method to a new dataset, researchers can fine-tune the value of beta from the initial reference one. + +# B.8. Additional evaluation on a pathology application + +Besides three standard datasets (CIFAR-10, CIFAR-100, and STL-10), we also select a gigapixel pathology dataset (Lai et al., 2021) as an additional real-world case to further evaluate the reliability of SAW in realistic applications. This main goal of this dataset is to segment white matter (WM) from grey matter (GM). We follow the way in (Lai et al., 2021) to use only $0.1\%$ of regions as the labeled data and treat the remaining areas as unlabeled. This is a common case in medical imaging applications where the distribution of unlabeled data is unavailable as the gigapixel resolution requires massive annotation efforts. + +Table 14. IoU score comparison on the 10 hold-out slides. + +
AlgorithmGMWM
FixMatch80.743.0
FixMatch + SAW84.665.4
+ +Table 15. DICE coefficient comparison on the 10 hold-out slides. + +
AlgorithmGMWM
FixMatch89.461.3
FixMatch + SAW91.077.2
+ +Table 14 and Table 15 summarizes the results of two measuring metrics on the hold-out test set: IoU score (Rahman & Wang, 2016) and DICE coefficient (Zou et al., 2004). For the minority class - WM, SAW improves the IoU score (Rahman & Wang, 2016) by over $22\%$ ; for the majority class - GM, it also achieves nearly $4\%$ of improvement. For the DICE coefficient, another metric, SAW brings up to $15.9\%$ of improvement on the minority class and $1.6\%$ on the majority class. From this case, we verify the reliability of SAW on a real-world application when the distribution information is unknown. \ No newline at end of file diff --git a/smoothedadaptiveweightingforimbalancedsemisupervisedlearningimprovereliabilityagainstunknowndistributiondata/images.zip b/smoothedadaptiveweightingforimbalancedsemisupervisedlearningimprovereliabilityagainstunknowndistributiondata/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..e6d61a47da9e65fff945b52dcf009f593b99b9a4 --- /dev/null +++ b/smoothedadaptiveweightingforimbalancedsemisupervisedlearningimprovereliabilityagainstunknowndistributiondata/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de1fde2f8e632b66233f990e5e285f366d10dd0284ddb4f936a42dfb45e7d31b +size 1204488 diff --git a/smoothedadaptiveweightingforimbalancedsemisupervisedlearningimprovereliabilityagainstunknowndistributiondata/layout.json b/smoothedadaptiveweightingforimbalancedsemisupervisedlearningimprovereliabilityagainstunknowndistributiondata/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..38c0825ad3001a200fb9801c069eae90c1dd8287 --- /dev/null +++ b/smoothedadaptiveweightingforimbalancedsemisupervisedlearningimprovereliabilityagainstunknowndistributiondata/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7706dde4c192dfd00fc6cbef66eb40c177fa264d0866be3bfe7987bbc9994ff5 +size 597930 diff --git a/smoothedadversariallinearcontextualbanditswithknapsacks/b4955006-1896-48d0-ab29-d1074eb0dfd7_content_list.json b/smoothedadversariallinearcontextualbanditswithknapsacks/b4955006-1896-48d0-ab29-d1074eb0dfd7_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..4164cc67e47e5b8547d6431721dc78edfa2280d0 --- /dev/null +++ b/smoothedadversariallinearcontextualbanditswithknapsacks/b4955006-1896-48d0-ab29-d1074eb0dfd7_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ab10d5e3dc5325a95a5e48cb04242af4c9b90b77dd381bb803276b20409aa041 +size 205586 diff --git a/smoothedadversariallinearcontextualbanditswithknapsacks/b4955006-1896-48d0-ab29-d1074eb0dfd7_model.json b/smoothedadversariallinearcontextualbanditswithknapsacks/b4955006-1896-48d0-ab29-d1074eb0dfd7_model.json new file mode 100644 index 0000000000000000000000000000000000000000..f7fe315c133972ff48621190750a14054f08fd18 --- /dev/null +++ b/smoothedadversariallinearcontextualbanditswithknapsacks/b4955006-1896-48d0-ab29-d1074eb0dfd7_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5718630787b6304e89952e761126f85a2e4ff74b5af56a9343ca576d3eaf06f8 +size 235439 diff --git a/smoothedadversariallinearcontextualbanditswithknapsacks/b4955006-1896-48d0-ab29-d1074eb0dfd7_origin.pdf b/smoothedadversariallinearcontextualbanditswithknapsacks/b4955006-1896-48d0-ab29-d1074eb0dfd7_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e48b59e72241f9ea65f8a4702c89b3fc3c561e53 --- /dev/null +++ b/smoothedadversariallinearcontextualbanditswithknapsacks/b4955006-1896-48d0-ab29-d1074eb0dfd7_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f594d80d53d0ee8d111436624f0c3b583876705eb464cd55060d1baaa48e43e1 +size 590779 diff --git a/smoothedadversariallinearcontextualbanditswithknapsacks/full.md b/smoothedadversariallinearcontextualbanditswithknapsacks/full.md new file mode 100644 index 0000000000000000000000000000000000000000..702692c413a49c84c39783e780f1d0ded57e896d --- /dev/null +++ b/smoothedadversariallinearcontextualbanditswithknapsacks/full.md @@ -0,0 +1,1156 @@ +# Smoothed Adversarial Linear Contextual Bandits with Knapsacks + +Vidyashankar Sivakumar $^{1}$ Shiliang Zuo $^{2}$ Arindam Banerjee $^{2}$ + +# Abstract + +Many bandit problems are characterized by the learner making decisions under constraints. The learner in Linear Contextual Bandits with Knapsacks (LinCBwK) receives a resource consumption vector in addition to a scalar reward in each time step which are both linear functions of the context corresponding to the chosen arm. For a fixed time horizon $T$ , the goal of the learner is to maximize rewards while ensuring resource consumptions do not exceed a pre-specified budget. We present algorithms and characterize regret for LinCBwK in the smoothed setting where base context vectors are assumed to be perturbed by Gaussian noise. We consider both the stochastic and adversarial settings for the base contexts, and our analysis of stochastic LinCBwK can be viewed as a warm-up to the more challenging adversarial LinCBwK. For the stochastic setting, we obtain $O(\sqrt{T})$ additive regret bounds compared to the best context dependent fixed policy. The analysis combines ideas for greedy parameter estimation in (Kannan et al., 2018; Sivakumar et al., 2020) and the primal-dual paradigm first explored in (Agrawal & Devanur, 2016; 2014a). Our main contribution is an algorithm with $O(\log T)$ competitive ratio relative to the best context dependent fixed policy for the adversarial setting. The algorithm for the adversarial setting employs ideas from the primal-dual framework (Agrawal & Devanur, 2016; 2014a) and a novel adaptation of the doubling trick (Immorlica et al., 2019). + +# 1. Introduction + +The contextual bandits framework (Langford & Zhang, 2007; Lattimore & Szepesvari, 2019; Slivkins, 2021) is a popular sequential decision making framework used in multiple practical applications such as clinical trials, web search, and content optimization. Contextual bandit problems have multiple rounds where in each round a learner watches a set of context vectors corresponding to $K$ arms and chooses an arm with the goal of maximizing cumulative rewards. In linear contextual bandits (LinCB) (Chu et al., 2011; Li et al., 2010), the rewards for an arm are a linear function of the context vector. Algorithms for contextual bandit problems typically have to balance between exploration, choosing potentially sub-optimal arms for acquiring more information, and exploitation, choosing arms to optimize immediate rewards. Motivated by fairness and ethics considerations (Bird et al., 2016; Raghavan et al., 2018; Kannan et al., 2018) or to avoid inefficient exploration strategies (Bastani et al., 2018), recent work has studied settings where an exploration free greedy algorithm can be employed. The crux of all such prior work is an assumption of inherent randomness in context vectors aiding exploration. In the smoothed bandits framework (Kannan et al., 2018) the inherent randomness is due to stochastic perturbations of the context vectors. + +Often a learner has to operate under constraints while maximizing rewards (Babaioff et al., 2015; Badanidiyuru et al., 2012; Besbes & Zeevi, 2012; Singla & Krause, 2013; Combes et al., 2015). For example clinical trials are constrained by available medical resources or optimizing for ad placements should account for advertisers budget and user reach. There is now a body of work under the theme bandits with knapsacks ( $BwK$ ) addressing the tension between maximizing rewards while satisfying constraints (Badanidiyuru et al., 2013; Agrawal & Devanur, 2014a; 2016; Immorlica et al., 2019; Agrawal et al., 2016; Badanidiyuru et al., 2014). + +Smoothened LinCBwK. In this work, we consider the linear contextual bandits with knapsacks (LinCBwK) problem (Agrawal & Devanur, 2016) under the smoothed assumption on context vectors. The LinCBwK problem has $d$ resources with budget $B \in \mathbb{R}_+$ for each resource. In each round $t$ , there are $K$ context vectors $\{\mathbf{x}_t(a)\}_{a=1}^K$ , $\mathbf{x}_t(a) \in \mathbb{R}^m$ , one corresponding to each arm $a \in [K]$ . The smoothed context vectors are of the form $\mathbf{x}_t(a) = \pmb{\nu}_t(a) + \mathbf{g}_t(a)$ , + +where $\pmb{\nu}_t(a) \in \mathbb{B}_2^m$ (unit ball) is the base context vector and $\mathbf{g}_t(a) \sim \mathcal{N}(\mathbf{0}, \sigma^2\mathbb{I}_{m \times m})$ are Gaussian perturbations. Typically $\sigma^2 = \frac{1}{m}$ (Kannan et al., 2018; Sivakumar et al., 2020). On choosing an arm $a_t \in [K]$ , the learner receives a noisy reward $r_t(a_t) \in \mathbb{R}_+$ and consumption vector $\mathbf{v}_t(a_t) \in \mathbb{R}_+^d$ satisfying + +$$ +\mathbb {E} \left[ r _ {t} (a) \mid \mathbf {x} _ {t} (a), H _ {t - 1} \right] = \boldsymbol {\mu} _ {*} ^ {\intercal} \mathbf {x} _ {t} (a), \tag {1} +$$ + +$$ +\mathbb {E} \left[ \mathbf {v} _ {t} (a) \mid \mathbf {x} _ {t} (a), H _ {t - 1} \right] = W _ {*} ^ {\intercal} \mathbf {x} _ {t} (a), \tag {2} +$$ + +where $H_{t - 1}$ denotes the history, the reward vector $\mu_{*} \in S^{m - 1}$ (unit sphere) and the consumption matrix $W_{*} \in \mathbb{R}^{m \times d}$ with columns in $S^{m - 1}$ are fixed but unknown to the learner. Additionally, the parameter $\mu_{*}$ and columns of $W_{*}$ can be assumed to have some structure like sparsity. In each round, the learner also has a "no-op" option which is to choose none of the arms and receive 0 reward with 0 resource consumption. The learner's goal is to choose arms which maximize the total reward over $T$ time steps while ensuring total consumption for each resource does not exceed $B$ . + +$$ +\max \sum_ {t = 1} ^ {T} r _ {t} \left(a _ {t}\right) \quad \text {s . t .} \quad \sum_ {t = 1} ^ {T} \mathbf {v} _ {t} \left(a _ {t}\right) \leqslant \mathbf {1} B. \tag {3} +$$ + +Stochastic and Adversarial Contexts. We study algorithms under two assumptions on the base context vectors: (a) Stochastic LinCBwK when the base context vectors $\pmb{\nu}_{t}(a)$ are sampled from an unknown distribution, and (b) Adversarial LinCBwK when the $\pmb{\nu}_{t}(a)$ are chosen by an adaptive adversary. In both cases, we compare the learner's performance against an optimal adaptive policy with knowledge of $\pmb{\mu}_{*}$ , $W_{*}$ which, unlike LinCB, is no longer a single arm but a probability distribution over the arms (Agrawal & Devanur, 2014a; Badanidiyuru et al., 2013; Immorlica et al., 2019). Compared to LinCB, the learner's algorithm is more complicated because it should not only optimize the per step reward but also account for how much resources are being consumed vs. how much to conserve for future. + +The tension between consumption vs. conservation differentiates the algorithms for stochastic and adversarial LinCBwK. While in the stochastic setting, historical data can be extrapolated to guide decisions to consume vs. conserve, it is impossible in the adversarial setting to use historical data to plan for the future. Thus, for stochastic LinCBwK, we are able to achieve stronger additive regret bounds with respect to the optimal adaptive policy. Let $\mathrm{OPT}_1$ denote the optimal adaptive policy's reward for smoothed stochastic LinCBwK. We present an algorithm whose reward REW satisfies + +$$ +\mathrm {R E W} \geqslant \mathrm {O P T} _ {1} - \tilde {O} \left(\left(\frac {\mathrm {O P T} _ {1}}{B} + 1\right) \frac {\sqrt {T}}{\sigma}\right), \tag {4} +$$ + +where $\tilde{O} (\cdot)$ notation hides dependence on logarithmic factors and dimension of the problem. + +For adversarial LinCBwK, we are only able to bound the competitive ratio, i.e., the ratio between the optimal adaptive policy's reward and the algorithm's reward. With $\mathrm{OPT}_2$ denote the optimal adaptive policy's reward for the smoothed adversarial LinCBwK, we present an algorithm whose reward REW satisfies + +$$ +\mathrm {R E W} \geqslant \frac {\mathrm {O P T} _ {2}}{O (d [ \log T ])} - \tilde {O} \left(\left(\frac {\mathrm {O P T} _ {2}}{B} + 1\right) \frac {\sqrt {T}}{\sigma}\right). \tag {5} +$$ + +Our framework is general enough to handle structure assumptions like sparsity on the parameter vectors. + +LinCBwK Algorithms. Algorithms for both stochastic and adversarial LinCBwK broadly perform two steps in each round: 1) estimating reward and consumptions for each arm, and 2) pulling arms while balancing earned reward and resource consumptions. In the smoothed setting, we use (episodic) greedy estimates of reward and consumptions for each arm obtained using constrained least squares estimates of the reward and consumption parameters (Kannan et al., 2018; Sivakumar et al., 2020). This is in sharp contrast with most existing work in contextual bandits including prior work on stochastic LinCBwK (Agrawal & Devanur, 2016) which compute rewards based on upper confidence bound (UCB). For choosing arms by balancing the tradeoff between reward and consumptions, multiple primal-dual approaches have been explored in BwK (Badanidiyuru et al., 2013; Agrawal & Devanur, 2016; 2014b; Immorlica et al., 2019) and related literature on online stochastic packing problems (Agarwal et al., 2014; Mehta, 2013; Mehta et al., 2007; Buchbinder & Naor, 2009; Williamson & Shmoys, 2011; Devanur & Hayes, 2009; Agrawal & Devanur, 2014b; Devanur et al., 2011; Feldman et al., 2010; Molinaro & Ravi, 2012). Our algorithm is built on the framework developed in (Agrawal & Devanur, 2014b; 2016) where in each round, the algorithm maximizes a linear combination of the reward and consumptions with a tradeoff parameter $Z$ . The function can be viewed as the Lagrangian of the constrained linear program (LP) in (3) with suitable modifications due to the sequential and bandit nature of the problem. $Z$ can be viewed as a global parameter which captures the tradeoff between the optimal reward and the budget. Specifics of the computation of $Z$ differs for stochastic and adversarial LinCBwK, being substantially more challenging for the adversarial setting. Our algorithms provide ways of computing $Z$ and comes with regret bounds as in (4), (5). + +Comparison with Prior Work. We analyze smoothed LinCBwK where the (stochastic or adversarial) contexts are perturbed by a small amount of Gaussian noise. The smoothing assumption (Kannan et al., 2018; Sivakumar et al., 2020) is a middle ground between assuming stochastic independent contexts and adversarial contexts both of which arguably are not representative of most real world problems. In sharp contrast to the explore-exploit bandit algorithms + +Table 1. Comparisons with prior work on regret upper bounds and budget constraints. OPT is an upper bound on optimal reward, $K$ is number of arms, $B$ is the budget, $m$ is context dimension for the LinCBwK problem, $d$ is number of constraints. + +
SettingRegretBudget B
Stochastic BwK (Badanidiyuru et al., 2013)O(√K OPT(1 + √OPT/B))
Adversarial BwK (Immorlica et al., 2019)OPT /O(d log T) - O(T7/4K/B)Ω(KT3/4)
Stochastic LinCBwK (Agrawal & Devanur, 2016)O(m√T)Ω(mT3/4)
Smoothened Stochastic LinCBwK (This paper)O(m√T)Ω(m2/3T3/4)
Smoothened Adversarial LinCBwK (This paper)OPT /O(d log T) - O(m√T)Ω(T3/4)
+ +in prior literature (Agrawal & Devanur, 2016; Immorlica et al., 2019), we show an exploration free greedy algorithm theoretically achieves optimal regret in the smoothed setting. Practically such exploration free bandit algorithms are desirable in problems where ethics, fairness (Bird et al., 2016), or computational efficiency (Bastani et al., 2018) are concerns. For LinCB, (Bietti et al., 2018) empirically show the greedy algorithm to perform as well as state-of-the-art explore-exploit bandit algorithms on many practical datasets. + +Table 1 is a summary of prior results for variations of the bandit with knapsacks problems. Our results for stochastic LinCBwK match upto log factors the regret bounds for LinCBwK in (Agrawal & Devanur, 2016) and the bounds for LinCB with smoothed contexts in (Sivakumar et al., 2020). Our main contribution is an algorithm and regret analysis for smoothed adversarial LinCBwK. Although we do not rigorously analyze lower bounds, our algorithm achieves worst case competitive ratio which match upto constant factors the bounds in (Immorlica et al., 2019) for the arguably simpler setting of adversarial multi armed bandits (MAB) with knapsacks. We also analyze regret bounds in the high-dimensional regularized setting, e.g., Lasso. + +Notations: Vectors are denoted by bold symbols, e.g., $\pmb{\mu},\mathbf{y}$ and matrices are denoted by upper case letters, e.g., $W,X$ For context $\mathbf{x}_t(a) = \pmb {\nu}_t(a) + \mathbf{g}_t(a),a\in [K]$ we will use $X_{t},N_{t},G_{t}\in \mathbb{R}^{m\times (K + 1)}$ with $X_{t} = N_{t} + G_{t}$ to denote the set of base context vectors, Gaussian perturbation vectors, and observed context vectors respectively in round $t$ .The last column in $X_{t},N_{t},G_{t}$ is 0 corresponding to the no-op arm. $\mathbf{r}_t\in \mathbb{R}^{K + 1}$ and $V_{t}\in \mathbb{R}^{d\times (K + 1)}$ will denote the reward and consumption vectors at time $t$ + +# 2. Smoothed LinCBwK + +As discussed in Section 1, in the smoothed setting, the context vectors are Gaussian perturbed versions of base context vectors, i.e., for all $a \in [K]$ , + +$$ +\mathbf {x} _ {t} (a) = \boldsymbol {\nu} _ {t} (a) + \mathbf {g} _ {t} (a), \tag {6} +$$ + +where $\pmb{\nu}_t(a) \in \mathbb{B}_2^m$ are the base context vectors and $\mathbf{g}_t(a) \sim \mathcal{N}(\mathbf{0}, \sigma^2\mathbb{I}_{m \times m})$ are Gaussian perturbations. We consider + +two settings for the base context vectors $\pmb{\nu}_t(a)$ : (a) stochastic, where the $\pmb{\nu}_t(a)$ are stochastically chosen independently from a fixed but unknown distribution, and (b) adversarial, where the $\pmb{\nu}_t(a)$ are chosen by an adaptive adversary. The following result establishes high probability bounds on $\| \mathbf{x}_t(a)\| _2$ . + +Lemma 1 Let $\beta \coloneqq \operatorname*{argmax}_{t\in [T],a\in [K]}\| \mathbf{x}_t(a)\| _2$ . Then with probabilit at least $(1 - \delta)$ + +$$ +\beta \leqslant O \left(1 + \sigma \sqrt {m \log (T K / \delta)}\right). \tag {7} +$$ + +We will assume $\sigma^2 = 1 / m$ . Since the parameter vectors have $L_{2}$ norm unity the rewards and consumptions in each time step are bounded by $O(\beta)$ . + +Our framework can handle sparsity assumptions on $\mu_*$ and columns of $W_*$ . Without loss of generality, we will assume the same structure for $\mu_*$ and the columns of $W_*$ . The sparsity structure is represented by an atomic norm $J(\cdot)$ (Chandrasekaran et al., 2012). We use the constrained least squares estimator in each step for estimation. + +$$ +\hat {\boldsymbol {\mu}} _ {t} = \operatorname * {a r g m i n} _ {\boldsymbol {\mu} \in \mathbb {R} ^ {m}} \frac {1}{2 t} \| \tilde {\mathbf {y}} _ {t} - \tilde {S} _ {t} \boldsymbol {\mu} \| _ {2} ^ {2} \quad \text {s . t .} \quad J (\boldsymbol {\mu}) \leqslant J (\boldsymbol {\mu} _ {*}), +$$ + +and + +$$ +(\widehat {W} _ {t}) _ {: j} = \operatorname * {a r g m i n} _ {\mathbf {w} \in \mathbb {R} ^ {m}} \frac {1}{2 t} \| (\tilde {Q} _ {t}) _ {: j} - \tilde {S} _ {t} \mathbf {w} \| _ {2} ^ {2} \text {s . t .} J (\mathbf {w}) \leqslant J (W _ {* j}), +$$ + +where $\tilde{S}_t\in \mathbb{R}^{t\times m}$ is the matrix with contexts chosen before time $t$ as rows, $\tilde{\mathbf{y}}_t\in \mathbb{R}^t$ are the rewards observed before time $t$ and $\tilde{Q}_t\in \mathbb{R}^{t\times d}$ are the consumption vectors observed before time $t$ . Let $E_{c}\coloneqq \{\mathbf{e}\mid J(\pmb {\mu}_{*} + \mathbf{e})\leqslant J(\pmb {\mu}_{*})\}$ denote the error set and $A =$ cone $(E_c)\cap S^{m - 1}$ denote the error cone (Wainwright, 2019; Vershynin, 2018; Banerjee et al., 2014). Error sets for the columns of $W_{*}$ are defined similarly. Our results for regret will have dependence on the Gaussian width of the error set $w(A)$ (Talagrand, 2005; 2014). For example $w(A) = \Theta (\sqrt{m})$ if no structure is assumed for the parameter vectors and $w(A) = \Theta (\sqrt{s\log m})$ if the parameters are $s$ -sparse and Lasso (Tibshirani, 1996) + +is used for parameter estimation. Henceforth we will overload the term $A$ to denote the error cone for constrained estimation of $\mu_{*}$ and columns of $W_{*}$ . + +We will compare our algorithms to the class of dynamic policies. Formally, let $\phi (T) = (X_{t},\mathbf{r}_{t},V_{t})_{t = 1}^{T}$ denote a particular instantiation of contexts for $T$ time steps. $\mathbf{r}_t\in$ $\mathbb{R}^{K + 1}$ $V_{t}\in \mathbb{R}^{d\times (K + 1)}$ denote the reward and consumption vectors at time $t$ including for the no-op arm. A dynamic policy $p_t:\phi (T)\mapsto \Delta_{K + 1}$ maps contexts at each time step to distributions over $K + 1$ options, viz. the $K$ arms and the no-op option. In particular, we develop regret bounds with respect to the optimal dynamic policy $p^* (\cdot)$ which has foreknowledge of $\mu_{*},W_{*}$ and the mechanism by which the contexts are generated. Interestingly, we will in fact work with a suitably defined context dependent static policy as a benchmark by showing that its reward upper bounds the reward of the optimal dynamic policy while satisfying the resource constraints. + +Benchmarks: Stochastic setting. In the stochastic setting $X_{t}$ 's are generated from an unknown distribution $\mathcal{D}$ . Here $\mathcal{D}$ is the distribution for the convolution $X_{t} = N_{t} + G_{t}$ with $X_{t}, N_{t}, G_{t} \in \mathbb{R}^{m \times (K + 1)}$ denoting the observed context matrix, base vectors matrix and Gaussian perturbation matrix respectively. The last column of all matrices is the 0 vector corresponding to the no-op arm. Let $\pi : \mathbb{R}^{m \times (K + 1)} \mapsto \Delta_{K + 1}$ denote a context dependent probability distribution over arms and let $r(\pi)$ and $\mathbf{v}(\pi)$ denote the expected reward and consumption vector of policy $\pi(\cdot)$ , i.e., + +$$ +r (\pi) := \mathbb {E} _ {X \sim \mathcal {D}} [ \mathbf {r} ^ {\intercal} \pi (X; \mathcal {D}) ], \quad \mathbf {v} (\pi) := \mathbb {E} _ {X \sim \mathcal {D}} [ V \pi (X; \mathcal {D}) ]. +$$ + +Let, + +$$ +\pi^ {*} := \underset {\pi} {\operatorname {a r g m a x}} T \mathbf {r} (\pi) \quad \text {s . t .} \quad T \mathbf {v} (\pi) \leqslant B \mathbf {1}. \tag {8} +$$ + +We revisit a result by (Agrawal & Devanur, 2016) which shows that in the stochastic setting, the reward obtained by the optimal dynamic policy $p^*(\cdot)$ can be upper bounded by an optimal context-dependent static policy $\pi^*(\cdot)$ . + +# Lemma 2 (Lemma 1 in (Agrawal & Devanur, 2016)) + +Let $\overline{\mathrm{OPT}}_1\coloneqq \mathbb{E}_{\phi (T)}[\sum_{t = 1}^{T}\pmb {\mu}_*\top X_tp_t^* (\phi (T))]$ denote the value of the optimal feasible dynamic policy $p^*$ which knows parameters $\mu_{*},W_{*}$ and distribution $\mathcal{D}$ . Then, the optimal static policy $\pi^{*}$ in (8) satisfies: $Tr(\pi^{*})\geqslant \overline{\mathrm{OPT}}_{1}$ and $Tv(\pi^{*})\leqslant B1$ + +Since the optimal static policy $\pi^{*}$ is competitive with the optimal dynamic policy $p^{*}$ , for the stochastic setting it suffices to compare the performance of our proposed algorithm with the performance of $\pi^{*}$ . If the sequence of arms chosen by our algorithm is $\{a_{t}\}$ , we define regret as: $R_{1}(T)\coloneqq \mathrm{OPT}_{1} - \sum_{t = 1}^{T}\mathbf{r}_{t}(a_{t})$ , where $\mathrm{OPT}_1\coloneqq Tr(\pi^*)$ + +Benchmarks: Adversarial setting. In the smoothed adversarial setting, the base context vectors $\pmb{\nu}_t(a), a \in [K]$ are chosen by an adaptive adversary, and the optimal feasible dynamic policy $p^*$ is the one which maximizes the cumulative reward $p^* := \operatorname{argmax}_p \sum_{t=1}^{T} \pmb{\mu}_*^\top X_t p_t(\phi(T))$ while staying feasible. As in the smoothed stochastic setting, we consider the optimal static policy $\pi^*$ that depends on context $X_t$ and realization $\phi(T)$ . The policy $\pi^*$ optimizes the cumulative reward while staying feasible, i.e., + +$$ +\begin{array}{l} \pi^ {*} := \underset {\pi} {\operatorname {a r g m a x}} \sum_ {t = 1} ^ {T} \boldsymbol {\mu} _ {*} ^ {\intercal} X _ {t} \pi (X _ {t}; \phi (T)) \\ \sum_ {t = 1} ^ {T} W _ {*} ^ {\mathsf {T}} X _ {t} \pi (X _ {t}; \phi (T)) \leqslant B \mathbf {1}. \tag {9} \\ \end{array} +$$ + +Lemma 3 Let $\overline{\mathrm{OPT}}_2\coloneqq \sum_{t = 1}^T\pmb {\mu}_*\mathsf{T}X_tp_t^* (\phi (T))$ and $\mathrm{OPT}_2\coloneqq \sum_{t = 1}^T\pmb {\mu}_*\mathsf{T}X_t\pi^* (X_t;\phi (T))$ respectively denote the value of the optimal feasible dynamic and static policies which have knowledge of the parameters $\pmb {\mu}_{*},W_{*}$ . Then $\mathrm{OPT}_2\geqslant \overline{\mathrm{OPT}}_2$ + +Since the optimal static policy again dominates the optimal dynamic policy under feasibility, it suffices to compare the performance of our algorithm to that of the static policy $\pi^{*}$ . If the sequence of arms chosen by our algorithm is $\{a_{t}\}$ , we define regret as: $R_{2}(T) := \mathrm{OPT}_{2} - \sum_{t=1}^{T} \mathbf{r}_{t}(a_{t})$ , where $\mathrm{OPT}_{2} := \sum_{t=1}^{T} \boldsymbol{\mu}_{*}^{\mathrm{T}} X_{t} \pi^{*}(X_{t}; \phi(T))$ . + +# 3. Greedy Algorithm + +In this section we discuss the greedy algorithm GreedyLinCBwK (Algorithm 1) used in both the stochastic and adversarial settings. GreedyLinCBwK is based on the primal-dual paradigm explored in prior work on BwK (Agrawal & Devanur, 2014a;b; 2016; Immorlica et al., 2019) with a key unique aspect: our algorithm keeps updating estimates $\widehat{\mu}_t$ , $\widehat{W}_t$ respectively of the true reward and consumption parameters $\mu_*$ , $W_*$ and picks arms greedily using these estimates. The greedy approach of arm selection in GreedyLinCBwK is in sharp contrast with both the existing UCB-based approach for LinCBwK in the stochastic setting (Agrawal & Devanur, 2014a;b; 2016) and the approach for adversarial BwK setting in (Immorlica et al., 2019). The overall approach in GreedyLinCBwK has similarities with prior work on both stochastic and adversarial bandits with knapsacks (Agrawal & Devanur, 2016; Immorlica et al., 2019) in that the primal arm selection is with bandit feedback and the dual update is essentially a full information online convex optimization (OCO). + +Algorithm 1 GreedyLinCBwK +Input: Parameter $Z\in \mathbb{R}_{+}$ , budget $B$ , context matrix $S_{1}$ reward vector $\mathbf{y}_1$ , consumption matrix $Q_{1}$ Initialize $\theta_{1}$ using uniform distribution for $t = 1$ to $T$ do $(S,\mathbf{y},Q,\pmb {\theta},T_{\mathrm{eff}})_{t + 1} = GreedyStep(Z,B,(S,\mathbf{y},Q,\pmb {\theta},T_{\mathrm{eff}})_t)$ if $Q_{t + 1}\mathbf{e}_j\geqslant B$ for any $j\in [d]$ then EXIT end if end for + +Algorithm 2 GreedyStep +Input: Parameter $Z\in \mathbb{R}_{+}$ budget $B$ , context matrix $S_{t}$ reward vector $\mathbf{y}_t$ , consumption matrix $Q_{t}$ , dual vector $\theta_t$ $T_{\mathrm{eff}}(t)$ +Estimate $\widehat{\pmb{\mu}}_t,\widehat{W}_t = \mathrm{Estimate}(S_t,\mathbf{y}_t,Q_t,T_{\mathrm{eff}}(t))$ +Set $a_{t} = \operatorname {argmax}_{a\in [K]}\mathbf{x}_{t}(a)^{\intercal}(\widehat{\pmb{\mu}}_{t} - Z\widehat{W}_{t}\pmb{\theta}_{t})$ . +if $\mathbf{x}_t(a_t)^\top (\widehat{\pmb{\mu}}_t - Z\widehat{W}_t\pmb {\theta}_t)\geqslant -2\zeta_t$ as in (10) then Select arm $a_{t},T_{\mathrm{eff}}(t + 1) = T_{\mathrm{eff}}(t) + 1$ Observe reward $r_t(a_t)$ and consumption $\mathbf{v}_t(a_t)\in \mathbb{R}^d$ Append $\mathbf{x}_t(a_t),r_t(a_t),\mathbf{v}_t(a_t)$ to $S_{t}$ $\mathbf{y}_t,Q_t$ to get $S_{t + 1},\mathbf{y}_{t + 1},Q_{t + 1}$ +else Set $a_{t} =$ the no-op arm, $T_{\mathrm{eff}}(t + 1) = T_{\mathrm{eff}}(t)$ Set $S_{t + 1},\mathbf{y}_{t + 1},Q_{t + 1} = S_t,\mathbf{y}_t,Q_t$ +end if +Update $\pmb{\theta}_{t + 1}$ using OMD with $g_{t}(\pmb {\theta}):= \langle \pmb {\theta},(\mathbf{v}_{t}(a_{t})-$ $\frac{B_0}{T}\mathbf{1})\rangle$ and $\pmb {\theta}_t\in \Delta_{d + 1}$ + +# 3.1. The GreedyLinCBwK Algorithm + +The algorithm has three key steps as illustrated in GreedyStep (Algorithm 2): parameter estimation, arm selection to receive reward and consumption vector, and dual update, with some steps picking the no-op arm. + +Estimation. In each step, the algorithm estimates the reward vector $\widehat{\mu}_t$ and constraint parameter $\widehat{W}_t$ based on a constrained least squares formulation as shown in Estimate (Algorithm 3). In the smoothed stochastic setting, one can show that the estimated parameters $\widehat{\mu}_t, \widehat{W}_t$ approach the true parameters at a $O(1 / \sqrt{T_{\mathrm{eff}}(t)})$ rate using standard techniques. Showing a similar result for the smoothed adversarial settings needs more care, and our analysis leverages recent advances in such analysis (Sivakumar et al., 2020). + +Arm Selection. The arm selection is based on + +$$ +a _ {t} = \operatorname * {a r g m a x} _ {a \in [ K ]} \mathbf {x} _ {t} (a) ^ {\intercal} (\widehat {\boldsymbol {\mu}} _ {t} - Z \widehat {W} _ {t} \boldsymbol {\theta} _ {t}) , +$$ + +Algorithm 3 Estimate +Input: Context matrix $S_{t}$ ,reward vector $\mathbf{y}_t$ ,consumption matrix $Q_{t}$ , effective steps $T_{\mathrm{eff}}(t)$ +Compute SVD of design matrix: $\frac{1}{\sqrt{T_{\mathrm{eff}}(t)}} S_t = UDV^{\intercal}$ +Compute Puffer transformation: $F = U D^{-1}U^{\intercal}$ and define $\tilde{S}_t = FS_t,\tilde{\mathbf{y}}_t = F\mathbf{y}_t,\tilde{Q}_t = FQ_t$ +Estimate parameters using constrained least squares + +$$ +\hat {\boldsymbol {\mu}} _ {t} = \operatorname * {a r g m i n} _ {\boldsymbol {\mu} \in \mathbb {R} ^ {m}} \frac {1}{2 T _ {\text {e f f}} (t))} \| \tilde {\boldsymbol {y}} _ {t} - \tilde {S} _ {t} \boldsymbol {\mu} \| _ {2} ^ {2} \text {s . t .} J (\boldsymbol {\mu}) \leqslant J (\boldsymbol {\mu} _ {*}) +$$ + +$$ +\left(\widehat {W} _ {t}\right) _ {: j} = \operatorname * {a r g m i n} _ {\mathbf {w} \in \mathbb {R} ^ {m}} \frac {1}{2 T _ {\text {e f f}} (t)} \| \left(\tilde {Q} _ {t}\right) _ {: j} - \tilde {S} _ {t} \mathbf {w} \| _ {2} ^ {2} \text {s . t .} J (\mathbf {w}) \leqslant J \left(W _ {* j}\right) +$$ + +as long as $\mathbf{x}_t(a_t)^\intercal (\widehat{\pmb{\mu}}_t - Z\widehat{W_t}\pmb {\theta}_t)\geqslant -2\zeta_t$ where + +$$ +\zeta_ {t} = O \left(\frac {\left(w (A) + \sqrt {\log (T d / \delta)}\right) Z \beta \log K}{\sigma \sqrt {T _ {\mathrm {e f f}} (t)}}\right), \tag {10} +$$ + +otherwise the no-op arm is selected. Such an arm choice was first explored in (Agrawal & Devanur, 2014b; 2016) who prescribed using $Z = \Omega(\mathrm{OPT} / B)$ to obtain optimal regret rates, where OPT is the reward obtained by the optimal static policy. As we show in subsequent sections, the algorithms for the stochastic and adversarial settings differ in how OPT and by extension $Z$ is estimated and used. + +Dual Update. For a chosen arm $a_{t}$ , the corresponding consumption vector $\mathbf{v}_t(a_t)$ needs to stay within the per step budget $\frac{B}{T} \mathbf{1}$ , i.e., $\mathbf{v}_t(a_t) - \frac{B}{T} \mathbf{1} \leqslant \mathbf{0}$ . Similar to (Agrawal & Devanur, 2016; Immorlica et al., 2019) we will assume the presence of a dummy time resource with $B / T$ consumption in each round irrespective of the chosen arm. Following related work (Agrawal & Devanur, 2016; Abernethy et al., 2011), the dual update involves maximizing $\langle \pmb{\theta}_{t+1}, \mathbf{v}_t(a_t) - \frac{B}{T} \mathbf{1} \rangle$ under the constraint $\pmb{\theta}_{t+1} \in \Delta_{d+1}$ sequentially, which can be done with online mirror descent (OMD). + +No-op Arm. Note that GreedyStep (Algorithm 2) chooses the no-op arm only when the objective for all arms is below $-2\zeta_{t}$ with $\zeta_{t}$ as in (10) which changes with time. The negative threshold $-2\zeta_{t}$ corresponds to the objective value estimation error when using $\widehat{\pmb{\mu}}_t, \widehat{W}_t$ to estimate the objective instead of $\pmb{\mu}_{*}, W_{*}$ . In particular, in steps where GreedyStep chooses the no-op arm, an algorithm using $\pmb{\mu}_{*}, W_{*}$ would also have chosen the no-op arm with high probability. + +# 3.2. Primal-Dual Perspective + +We develop an understanding of GreedyLinCBwK by considering the optimization problem in hindsight to find the optimum static policy over $T$ steps. The purpose is to gain insights about key steps in the algorithm, and more rigorous technical results are presented in subsequent sections. + +Consider the optimization problem: + +$$ +\max _ {\pi} \sum_ {t = 1} ^ {T} \boldsymbol {\mu} _ {*} ^ {\intercal} X _ {t} \pi \left(X _ {t}\right) \quad \text {s . t .} \quad W _ {*} ^ {\intercal} X _ {t} \pi \left(X _ {t}\right) - \frac {B}{T} \mathbf {1} \leqslant 0, t \in [ T ] \tag {11} +$$ + +Let $\mathbf{y}_t\in \mathbb{R}_+^{(d + 1)\times 1}$ be the Lagrange multipliers corresponding to the $t$ -th constraint, and let $\theta_{t} = \mathbf{y}_{t} / \| \mathbf{y}_{t}\|_{1}$ be the normalized Lagrange multipliers. The Lagrangian is given by: + +$$ +\begin{array}{l} \mathcal {L} (\pi , \boldsymbol {\theta}) = \sum_ {t = 1} ^ {T} \boldsymbol {\mu} _ {*} ^ {\intercal} X _ {t} \pi (X _ {t}) - \sum_ {t = 1} ^ {T} \left\langle \mathbf {y} _ {t}, W _ {*} ^ {\intercal} X _ {t} \pi (X _ {t}) - \frac {B}{T} \mathbf {1} \right\rangle \\ = \sum_ {t = 1} ^ {T} \boldsymbol {\mu} _ {*} ^ {\intercal} X _ {t} \pi (X _ {t}) - Z \sum_ {t = 1} ^ {T} \left\langle \boldsymbol {\theta} _ {t}, W _ {*} ^ {\intercal} X _ {t} \pi (X _ {t}) - \frac {B}{T} \mathbf {1} \right\rangle , \\ \end{array} +$$ + +where $Z$ is a suitable constant. Note that we are not showing the primal constraints $\pi(X_{t}) \in \Delta_{K+1}$ and dual constraints $\theta_{t} \in \Delta_{d+1}$ explicitly to avoid clutter. + +Scaling constant $Z$ . Let OPT denote the (primal) optimal value for (11). Since the primal is a feasible bounded LP, strong duality holds (Bertsimas & Tsitsiklis, 1997; Boyd & Vandenberghe, 2005), and the solutions of the primal and dual problems match, i.e., is both OPT. With $\mathbf{y}_t^*$ denoting the optimal Lagrange dual parameters, by strong duality $\mathrm{OPT} = \sum_{t=1}^{T} \langle \mathbf{y}_t^*, \frac{B}{T} \mathbf{1} \rangle$ . Then, with $Z_t^* := \| \mathbf{y}_t^* \|_1$ and $\theta_t^* = \mathbf{y}_t^* / \| \mathbf{y}_t^* \|_1$ , we have + +$$ +\begin{array}{l} \mathrm {O P T} = \sum_ {t = 1} ^ {T} \left\langle \mathbf {y} _ {t} ^ {*}, \frac {B}{T} \mathbf {1} \right\rangle = \sum_ {t = 1} ^ {T} Z _ {t} ^ {*} \left\langle \boldsymbol {\theta} _ {t} ^ {*}, \frac {B}{T} \mathbf {1} \right\rangle \\ = \sum_ {t = 1} ^ {T} Z _ {t} ^ {*} \frac {B}{T} = B \cdot Z ^ {*}, \\ \end{array} +$$ + +where $Z^{*} \coloneqq \frac{1}{T}\sum_{t = 1}^{T}Z_{t}^{*} = \frac{1}{T}\sum_{t = 1}^{T}\| \mathbf{y}_{t}^{*}\|_{1}$ , so that we have $Z^{*} = \frac{\mathrm{OPT}}{B}$ . Thus, the optimal scaling constant $Z^{*}$ is simply the per step average of the sum of optimal Langrange multipliers $\| \mathbf{y}_t^*\| _1$ , and satisfies $Z^{*} = \frac{\mathrm{OPT}}{B}$ so that an estimate of OPT will yield an estimate of $Z^{*}$ . In the online setting, $\mathbf{y}_t^*$ are not known, and are estimated sequentially. As a result, GreedyLinCBwK will keep an (running) estimate of OPT and hence $Z$ based on (a) the current estimates $\widehat{\pmb{\mu}}_t$ , $\widehat{W}_t$ respectively of $\mu^{*}, W^{*}$ , and (b) the contexts $X_{1:t}$ observed till time step $t$ . + +Primal updates. The primal update would ideally be based on $\frac{\partial cL(\pi,\pmb{\theta})}{\partial\pi(X_t)}$ , i.e., gradient of the Lagrangian w.r.t. the policy. Since we can pull only one arm, i.e., a bandit step, the update will have to be based on partials w.r.t. $\pi (X_{t})(a),a\in [K]$ and picking the arm with the largest gradient, i.e., a Frank-Wolfe, conditional gradient, or coordinate ascent type update (Frank & Wolfe, 1956). Note that the partial derivative is simply: $\frac{\partial\mathcal{L}(\pi,\pmb{\theta})}{\partial\pi(X_t)(a)} = \mathbf{x}_t(a)^{\intercal}(\pmb {\mu}_* - ZW_*\pmb {\theta}_t)$ , and the arm chosen is the one which maximizes this. + +Dual updates. Since the true consumption vector at step $t$ by pulling arm $a$ is $\mathbf{v}_t(a)$ and since the primal is a maximization, the cumulative dual objective to be minimized is $-\sum_{t=1}^{T} \langle \pmb{\theta}_t, \mathbf{v}_t(a) - \frac{B}{T} \mathbf{1} \rangle$ over $\pmb{\theta}_t \in \Delta_{d+1}$ . For convenience, we will equivalently consider maximizing $\sum_{t=1}^{T} \langle \pmb{\theta}_t, \mathbf{v}_t(a) - \frac{B}{T} \mathbf{1} \rangle$ . Since the problem needs to be solved sequentially, this becomes a simple example of OCO with a linear objective and simplex constraint, which can be solved by online mirror descent (OMD) or exponentiated gradient (EG) descent (Shalev-Shwartz et al., 2012) with sublinear regret. + +Proposition 1 With $g_{t}(\pmb{\theta}) = \langle \pmb{\theta}, \mathbf{v}_{t}(a) - \frac{B}{T}\mathbf{1} \rangle$ , OMD with constraint $\pmb{\theta}_{t} \in \Delta_{d+1}$ achieves the following regret: + +$$ +R _ {D} (T) = \max _ {\boldsymbol {\theta} \in \Delta_ {d + 1}} \sum_ {t = 1} ^ {T} g _ {t} (\boldsymbol {\theta}) - \sum_ {t = 1} ^ {T} g _ {t} (\boldsymbol {\theta} _ {t}) = O \left(\sqrt {T \log (d)}\right). +$$ + +# 3.3. Main Result: Reward from GreedyLinCBwK + +Theorem 1 lower bounds the reward obtained by the greedy algorithm. $T_{\mathrm{stop}}$ is either $T$ or the first round any resource consumption exceeds $B$ . The algorithm incurs additive regret $R(T)$ due to use of estimates $\widehat{\mu}, \widehat{W}$ instead of $\mu_*$ , $W_*$ to compute the reward and constraint objectives. The reward can be lower bounded by either of two quantities. The primal update ensures the reward is greater than $\mathrm{OPT}(T_{\mathrm{stop}}) + Z(\gamma_a(T_{\mathrm{stop}}) - \gamma_\pi (T_{\mathrm{stop}}))$ . Presence of the no-op arm ensures the reward is lower bounded by $Z\gamma_a(T_{\mathrm{stop}})$ . + +Theorem 1 Let $T_{stop} \leqslant T$ denote the stopping time of the algorithm. Let $\beta = \max_{t \in [T], a \in [K]} \| \mathbf{x}_t(a) \|_2$ be the maximum $\ell_2$ norm of context vectors. Then with probability at least $1 - 2\delta$ , + +$$ +\operatorname {R E W} \geqslant \max \left[ \operatorname {O P T} \left(T _ {\text {s t o p}}\right) + Z \left(\gamma_ {a} \left(T _ {\text {s t o p}}\right) - \gamma_ {\pi} \left(T _ {\text {s t o p}}\right)\right), \right. +$$ + +$$ +\left. Z \gamma_ {a} \left(T _ {\text {s t o p}}\right) \right] - O (Z R (T)), +$$ + +where + +$$ +\operatorname {R E W} = \sum_ {t = 1} ^ {T _ {\text {s t o p}}} \left\langle \boldsymbol {\mu} _ {*}, \mathbf {x} _ {t} \left(a _ {t}\right) \right\rangle \tag {12} +$$ + +$$ +\operatorname {O P T} \left(T _ {\text {s t o p}}\right) = \sum_ {t = 1} ^ {T _ {\text {s t o p}}} \left\langle \boldsymbol {\mu} _ {*}, X _ {t} \boldsymbol {\pi} ^ {*} \left(X _ {t}\right) \right\rangle \tag {13} +$$ + +$$ +\gamma_ {\pi} \left(T _ {s t o p}\right) = \sum_ {t = 1} ^ {T _ {s t o p}} \left\langle W _ {*} ^ {\mathsf {T}} X _ {t} \boldsymbol {\pi} ^ {*} \left(X _ {t}\right), \boldsymbol {\theta} _ {t} \right\rangle \tag {14} +$$ + +$$ +\gamma_ {a} \left(T _ {\text {s t o p}}\right) = \sum_ {t = 1} ^ {T _ {\text {s t o p}}} \left\langle W _ {*} ^ {\mathbf {T}} \mathbf {x} _ {t} \left(a _ {t}\right), \boldsymbol {\theta} _ {t} \right\rangle . \tag {15} +$$ + +and, with $\sigma^2$ being the Gaussian perturbation variance, + +$$ +R (T) = O \left(\frac {\left(w (A) + \sqrt {\log (T d / \delta)}\right) \beta \sqrt {T} \log K}{\sigma}\right). \tag {16} +$$ + +# 4. Smoothed Stochastic LinCBwK + +In this section, we discuss the algorithm for stochastic LinCBwK. The algorithm has two phases. In the initial warm start phase with $T_0$ time steps, the arms are chosen uniformly at random. The parameter $Z$ is estimated at the end of the warm start phase. We further discuss estimation of $Z$ in Section 4.1. In the exploit phase, greedy Algorithm 1 is run with a fixed $Z$ computed at the end of the warm start phase and a budget $B' = B - \beta T_0$ . This is due to Lemma 1 which bounds the maximum consumption for any resource per round to $\beta$ . The execution of the algorithm stops either after $T$ time steps or when one of the resource consumption exceeds $B$ . Our algorithm differs from (Agrawal & Devanur, 2016) in two aspects. The algorithm chooses arms uniformly at random in the warm start phase instead of the more involved exploration technique employed in (Agrawal & Devanur, 2016). The algorithm computes greedy estimates of the reward and constraint objectives in each time step of the exploit phase instead of UCB estimates. + +# 4.1. Estimation of $Z$ + +Recall the discussion in Section 3.2 where we establish $Z^{*} = \frac{\mathrm{OPT}_{1}}{B}$ where $\mathrm{OPT}_1$ is the optimal static policy reward. To estimate $Z$ after the warm start phase, we estimate the optimal reward $\widehat{\mathrm{OPT}}(T_0; \omega(T_0))$ where $\omega(T_0) = (X_t, r_t, \mathbf{v}_t, a_t)_{t=1}^{T_0}$ are observations in the warm start phase and extrapolate it. Let $\widehat{\boldsymbol{\mu}}_{T_0}$ and $\widehat{W}_{T_0}$ denote the parameter estimates at the end of the warm start phase. Then, + +$$ +\begin{array}{l} \widehat {\mathrm {O P T}} \left(T _ {0}; \omega \left(T _ {0}\right)\right) := \max _ {\pi} \sum_ {t = 1} ^ {T _ {0}} \hat {\boldsymbol {\mu}} _ {T _ {0}} ^ {\intercal} X _ {t} \boldsymbol {\pi} \left(X _ {t}\right) \\ \text {s . t .} \quad \sum_ {t = 1} ^ {T _ {0}} \widehat {W} _ {T _ {0}} ^ {\intercal} X _ {t} \boldsymbol {\pi} (X _ {t}) \leqslant B _ {0} + R (T _ {0}), \\ \widehat {\mathrm {O P T}} (T; \omega (T _ {0})) := \frac {T}{T _ {0}} \widehat {\mathrm {O P T}} (T _ {0}), \tag {17} \\ \end{array} +$$ + +where $B_0 = (T_0 / T)B$ and $R(T_0)$ is an upper bound on the regret $\sum_{t=1}^{T_0}(W_* - \widehat{W}_{T_0})X_t\pi(X_t)$ after the warm start phase. Note that $R(T_0) = O\left(\frac{(w(A) + \sqrt{\log(T_0d/\delta)})\beta\sqrt{T_0}\log K}{\sigma}\right)$ is the regret at the end of the warm start phase. We set $Z(T_0)$ as follows. + +$$ +Z (T _ {0}) = \frac {\left(\widehat {\mathrm {O P T}} (T ; \omega (T _ {0})) + 2 \left(\frac {T}{T _ {0}}\right) R (T _ {0})\right)}{B} + 1. +$$ + +# Algorithm 4 Smoothed Stochastic LinCBwK + +Input: Budget $B\in \mathbb{R}_{+}$ , Total timesteps $T$ + +Initialize $S_{1} = \left[ \begin{array}{l}\end{array} \right],y_{1} = \left[ \begin{array}{l}\end{array} \right],Q_{1} = \left[ \begin{array}{l}\end{array} \right]$ + +for $\tau = 1$ to $T_0$ do + +Select arm $\mathbf{x}_{\tau}(a_{\tau})$ uniformly at random, observe noisy reward $r_{\tau}(a_{\tau})$ and consumption vector $\mathbf{v}_{\tau}(a_{\tau}) \in \mathbb{R}^{d}$ . Obtain $S_{\tau + 1}, y_{\tau + 1}, Q_{\tau + 1}$ by appending $\mathbf{x}_{\tau}(a_{\tau})$ , $r_{\tau}(a_{\tau})$ , $\mathbf{v}_{\tau}(a_{\tau})$ to $S_{\tau}, y_{\tau}, Q_{\tau}$ . + +end for + +Let $B' = B - \beta T_0$ . Compute parameter $Z$ such that $\frac{\mathrm{OPT}_1}{B'} \leqslant Z \leqslant O\left(\frac{\mathrm{OPT}_1}{B'} + 1\right)$ . + +Run Algorithm GreedyLinCBwK with budget $B'$ from time $T_0 + 1$ to $T$ . + +We revisit the following result from (Agrawal & Devanur, 2016) on error bounds on estimator $\widehat{\mathrm{OPT}}(T; \omega(T_0))$ with respect to the optimal reward $\mathrm{OPT}_1$ . The bounds account for both the extrapolation error and use of $\widehat{\pmb{\mu}}_{T_0}$ , $\widehat{W}_{T_0}$ instead of the true parameters for estimation. + +Lemma 4 [Lemma 5 in (Agrawal & Devanur, 2016)] For $R(T_0) = O\left(\frac{(w(A) + \sqrt{\log(T_0d / \delta)})\beta\sqrt{T_0}\log K}{\sigma}\right)$ , with probability at least $1 - \delta$ + +$$ +\widehat {\operatorname {O P T}} (T; \omega (T _ {0})) \geqslant \operatorname {O P T} _ {1} - 2 \left(\frac {T}{T _ {0}}\right) R (T _ {0}) +$$ + +$$ +\widehat {\mathrm {O P T}} (T; \omega (T _ {0})) \leqslant \mathrm {O P T} _ {1} + 9 \left(\frac {T}{T _ {0}}\right) R (T _ {0}) \left(\frac {\mathrm {O P T} _ {1}}{B} + 1\right) \tag {18} +$$ + +Set $Z(T_0) = \frac{\left(\widehat{\mathrm{OPT}}(T;\omega(T_0)) + 2\left(\frac{T}{T_0}\right)R(T_0)\right)}{B} + 1$ . Then with probability $1 - O(\delta)$ , + +$$ +Z (T _ {0}) \geqslant \frac {\mathrm {O P T} _ {1}}{B} + 1 +$$ + +$$ +Z \left(T _ {0}\right) \leqslant \left(1 + \frac {1 1 \left(\frac {T}{T _ {0}}\right) R \left(T _ {0}\right)}{B}\right) \left(\frac {\mathrm {O P T} _ {1}}{B} + 1\right). \tag {19} +$$ + +Moreover if $B \geqslant \tilde{\Omega}\left(\frac{T}{\sqrt{T_0}}\frac{w(A)\log K}{\sigma}\right)$ then $Z(T_0) \leqslant O\left(\frac{\mathrm{OPT}_1}{B} + 1\right)$ . + +# 4.2. Regret Analysis + +Let $T_{\mathrm{stop}} \leqslant T$ denote the stopping time step of the algorithm which is either $T$ or the first time any of the resource consumption exceeds $B$ . The final regret is obtained by combining the results of Lemma 4 and Theorem 1. Since arms are chosen at random we accrue linear regret in the warm start phase. Here $R_{D}(T)$ is the regret of the dual OCO algorithm from Proposition 1. + +Theorem 2 Assume $B \geqslant \tilde{\Omega}\left(\max \left(T_0, \frac{T}{\sqrt{T_0}} \frac{w(A) \log K}{\sigma}\right)\right)$ . Then if $Z(T_0)$ is set as outlined in Lemma 4, we have + +$$ +\frac {\mathrm {O P T} _ {1}}{B} + 1 \leqslant Z (T _ {0}) \leqslant O \left(\frac {\mathrm {O P T} _ {1}}{B} + 1\right). \tag {20} +$$ + +Moreover with probability at least $1 - 6\delta$ , following is the regret for the greedy Algorithm 4, + +$$ +\operatorname {r e g r e t} (T) \leqslant O \left(\left(\frac {\mathrm {O P T} _ {1}}{B} + 1\right) \max \left(T _ {0}, R (T)\right)\right), \tag {21} +$$ + +where $R(T) = O\left(\frac{\left(w(A) + \sqrt{\log(Td / \delta)}\right)\beta\sqrt{T}\log K}{\sigma}\right)$ . + +We wrap up with special cases of our results. + +Corollary 1 Assume the variance of the Gaussian noise in the smoothed setting $\sigma^2 = \Omega(1/m)$ . Then with probability at least $1 - O(\delta)$ , + +- If $J(\cdot)$ is the $\ell_2^2$ norm, $T_0 = \tilde{O}\left(m^{2/3}\sqrt{T}\right)$ and $B \geqslant \tilde{\Omega}(m^{2/3}T^{3/4})$ , + +$$ +\operatorname {r e g r e t} (T) \leqslant \tilde {O} \left(\left(\frac {\mathrm {O P T} _ {1}}{B} + 1\right) m \sqrt {T}\right) \tag {22} +$$ + +- If $J(\cdot) = \|\cdot\|_1$ , $\pmb{\mu}_{*}$ and columns of $W_{*}$ are s-sparse, $T_0 = \tilde{O}((m \cdot s \log m)^{1/3} \sqrt{T})$ and $B \geqslant \tilde{\Omega}(m \cdot s \log m)^{1/3} T^{3/4}$ , + +$$ +\operatorname {r e g r e t} (T) \leqslant \tilde {O} \left(\left(\frac {\mathrm {O P T} _ {1}}{B} + 1\right) \sqrt {m} \sqrt {s \log m} \sqrt {T}\right) \tag {23} +$$ + +# 5. Smoothed Adversarial LinCBwK + +In this section, we consider adversarial LinCBwK where the base context vectors $\pmb{\nu}_t(a), a \in [K]$ of the smoothed contexts $\mathbf{x}_t(a) = \pmb{\nu}_t(a) + \mathbf{g}_t(a)$ are chosen by an adaptive adversary. The basic ideas behind the algorithm remain the same as in stochastic LinCBwK except for the estimation of the tradeoff parameter $Z$ which balances optimizing the reward and consumption. But unlike the stochastic setting it is not possible to estimate $\mathrm{OPT}_2$ , the reward from the optimal feasible static policy, without knowledge of the adversarially chosen contexts $\pmb{\nu}_t(a)$ over all time steps. + +# 5.1. Estimation of $Z$ + +We address this challenge by adapting a variant of the standard doubling trick in online learning (Shalev-Shwartz et al., 2012). At any stage, the algorithm has an estimate of the value of OPT and by extension $Z$ . In each time step $t$ , the realized cumulative reward is compared with the estimate + +for OPT and the algorithm updates the estimate for OPT when the realized reward is double that of the current estimate for OPT, and also updates the estimate for $Z$ . A related doubling trick adaptation is used in (Immorlica et al., 2019) for the adversarial multi-armed bandits with knapsacks problem although the algorithmic details are different. + +Similar to the stochastic setting, Algorithm 5 has a warm start phase with $T_0$ rounds. But unlike the stochastic setting the warm start phase is only required to get good estimates of the reward and constraint parameters. The exploit phase in Algorithm 5 is further subdivided into multiple epochs. Let $T_1$ denote the start time step of an epoch. Let $\omega(T_1) = (X_t, r_t, \mathbf{v}_t, a_t)_{t=1}^{T_1}$ denote data observed until $T_1$ . At the first step of the epoch, $\widehat{\mathrm{OPT}}(T_1; \omega(T_1))$ and $Z(T_1)$ are computed with data $\omega(T_1)$ as follows: + +$$ +\widehat {\mathrm {O P T}} (T _ {1}; \omega (T _ {1})) := \max _ {\pi} \sum_ {t = 1} ^ {T _ {1}} \hat {\boldsymbol {\mu}} _ {T _ {1}} ^ {\intercal} X _ {t} \pi (X _ {t}) +$$ + +$$ +\text {s . t .} \sum_ {t = 1} ^ {T _ {1}} \widehat {W} _ {T _ {1}} ^ {\intercal} X _ {t} \pi (X _ {t}) \leqslant B + R (T _ {1}), +$$ + +$$ +Z \left(T _ {1}\right) := \frac {\widehat {\operatorname {O P T}} \left(T _ {1} ; \omega \left(T _ {1}\right)\right)}{2 d B}. \tag {24} +$$ + +The value of $\widehat{\mathrm{OPT}}(T_2; \omega(T_2))$ is monitored in each time step $T_2 > T_1$ of an epoch until $\widehat{\mathrm{OPT}}(T_2; \omega(T_2)) \geqslant 2\widehat{\mathrm{OPT}}(T_1; \omega(T_1))$ at which point the epoch is terminated and a new epoch is started. Each epoch is allocated a budget $B'/2[\log T]$ . In each time step of an epoch GreedyStep (Algorithm 2) is run until a new epoch is started or when the allocated budget for any resource is exhausted. In case of budget exhaustion, an arm is chosen uniformly at random with a fixed probability until a new epoch starts. + +# 5.2. Regret Analysis + +It is evident that the $Z$ estimates improve with progression of epochs. We therefore focus on the last completed epoch and show there is sufficient reward to be collected from this epoch. Moreover we show that the greedy algorithm receives minimum $\Omega(1/(d\log T))$ fraction of the reward available in the final completed epoch. $\mathrm{OPT}_2$ denotes the reward of the optimal static policy from Lemma 3. + +Theorem 3 Assume $B \geqslant \Omega(T^{3/4})$ . Then with probability at least $1 - 6\delta$ following is a lower bound on the reward obtained by the greedy algorithm + +$$ +\operatorname {R E W} \geqslant \frac {\operatorname {O P T} _ {2}}{1 6 d \lceil \log T \rceil} - O \left(\left(\frac {\operatorname {O P T} _ {2}}{B} + 1\right) R (T)\right), \tag {25} +$$ + +where $R(T) = O\left(\frac{\left(w(A) + \sqrt{\log(Td) / \delta}\right)\beta\sqrt{T}\log K}{\sigma}\right)$ . + +Algorithm 5 Smoothed Adversarial LinCBwK +Input: Budget $B$ , number of time steps $T$ +Initialize $S_{1}, y_{1}, Q_{1} = []$ +for $t = 1$ to $T_{0}$ do + Select arm $\mathbf{x}_t(a_t)$ uniformly at random, observe noise reward $r_t(a_t)$ and consumption vector $\mathbf{v}_t(a_t)$ . Get $S_{t+1}, y_{t+1}, Q_{t+1}$ by appending $\mathbf{x}_t(a_t), r_t(a_t), \mathbf{v}_t(a_t)$ to $S_t, y_t, Q_t$ . +end for +Let $B' = B - T_0$ . +Initialize epoch $j = [\log_2 \widehat{\mathrm{OPT}}(T_0; \omega(T_0))]$ +for each epoch do + Let $T_1$ be the initial time step of epoch. Estimate $\widehat{\mathrm{OPT}}(T_1; \omega(T_1)), Z(T_1)$ using (24) + Compute budget $B_0 = \frac{B'}{2[\log T]}$ + Initialize $\theta_{T_1}$ using uniform distribution. + for each time step $T_2$ in epoch do + Recompute $\widehat{\mathrm{OPT}}(T_2; \omega(T_2))$ using (24) + if $\widehat{\mathrm{OPT}}(T_2; \omega(T_2)) \geqslant 2^{j+1}$ then + Increment $j = j + 1$ and start a new epoch + else + if any budget consumed then + Run Algorithm GreedyStep with $B = B_0$ and $Z = Z(T_1)$ . + else + Play any arm uniformly at random with probability $T^{-1/4}$ , play the no-op arm otherwise + end if + end if +end for +end for + +(Immorlica et al., 2019) obtain $O(d[\log T])$ competitive ratio for adversarial multi-armed bandits (MAB) with knapsacks and show it to be optimal. We match the bound for the linear contextual bandit setting with smoothed contexts with better additive regret rates. Note that (Immorlica et al., 2019) considered oblivious adversaries where we consider adaptive adversaries in the smoothed setting. Further, the additive regret in (Immorlica et al., 2019) is $\tilde{O}\left(KT^{7/4}/B\right)$ so for regret bounds to be meaningful requires the condition $\frac{B}{K} \mathrm{OPT} \geqslant \tilde{\Omega}(T^{7/4})$ . Our setup requires much milder assumptions. We wrap up with special cases of our result. + +Corollary 2 Assume the variance of the Gaussian noise in the smoothed setting $\sigma^2 = \Omega(1/m)$ . Let OPT be the optimal reward and $\kappa \leqslant O(d[\log T])$ . Then with probability at least $1 - O(\delta)$ , + +$$ +\cdot \operatorname {I f} J (\cdot) = \| \cdot \| _ {2} a n d B \geqslant \tilde {\Omega} \left(T ^ {3 / 4}\right), +$$ + +$$ +\mathrm {R E W} \geqslant \frac {\mathrm {O P T} _ {2}}{\kappa} - \tilde {O} \left(\left(\frac {\mathrm {O P T} _ {2}}{B} + 1\right) m \sqrt {T} \log K\right) +$$ + +- If $R(\cdot) = \|\cdot\|_1$ , $\pmb{\mu}_{*}$ and columns of $W_{*}$ are s-sparse and $B \geqslant \bar{\Omega}(T^{3/4})$ , + +$$ +\mathrm {R E W} \geqslant \frac {\mathrm {O P T} _ {2}}{\kappa} - \tilde {O} \left(\left(\frac {\mathrm {O P T} _ {2}}{B} + 1\right) \sqrt {m} \sqrt {s \log m} \sqrt {T}\right) +$$ + +# 6. Conclusion + +We considered the linear contextual bandit with knapsacks (LinCBwK) problem in the smoothed setting where the contexts chosen by nature, stochastically or adversarially, is perturbed by Gaussian noise. Such smoothed analysis, especially in the adversarial setting, is a mechanism to soften the worst case analysis and prior work has illustrated that simpler algorithms often work when avoiding the worst case. Our results in this paper continue this tradition. As the first work which analyzes smoothed adversarial LinCBwK with adaptive adversaries, we show that a combination of a greedy strategy to choose arms combined with a doubling trick gives a suitable algorithm for the setting. Scope for future work includes consideration of more flexible models for the rewards as well as budgets, including dynamic budgets. + +Acknowledgements. We would like to thank the reviewers for valuable comments and questions. The research was supported by NSF grants IIS 21-31335, OAC 21-30835, DBI 20-21898, and a C3.ai research award. + +# References + +Abernethy, J., Bartlett, P. L., and Hazan, E. Blackwell approachability and no-regret learning are equivalent. In Conference on Learning Theory, pp. 27-46. PMLR, 2011. +Agarwal, S., Wang, Z., and Ye, Y. A dynamic near-optimal algorithm for online linear programming. Operations Research, 62(4):876-890, 2014. +Agrawal, S. and Devanur, N. Linear contextual bandits with knapsacks. In Lee, D., Sugiyama, M., Luxburg, U., Guyon, I., and Garnett, R. (eds.), Advances in Neural Information Processing Systems, volume 29. Curran Associates, Inc., 2016. +Agrawal, S. and Devanur, N. R. Bandits with concave rewards and convex knapsacks. In Proceedings of the fifteenth ACM conference on Economics and computation, pp. 989-1006, 2014a. +Agrawal, S. and Devanur, N. R. Fast algorithms for online stochastic convex programming. In Proceedings of the twenty-sixth annual ACM-SIAM symposium on Discrete algorithms, pp. 1405-1424. SIAM, 2014b. +Agrawal, S., Devanur, N. R., and Li, L. An efficient algorithm for contextual bandits with knapsacks, and an + +extension to concave objectives. In Conference on Learning Theory, pp. 4-18. PMLR, 2016. +Babaioff, M., Dughmi, S., Kleinberg, R. D., and Slivkins, A. Dynamic pricing with limited supply. In ACM Transactions on Economics and Computation, volume 3, 2015. +Badanidiyuru, A., Kleinberg, R., and Singer, Y. Dynamic pricing with limited supply. In ACM Transactions on Economics and Computation, 2012. +Badanidiyuru, A., Kleinberg, R., and Slivkins, A. Bandits with knapsacks. In 2013 IEEE 54th Annual Symposium on Foundations of Computer Science, pp. 207-216. IEEE, 2013. +Badanidiyuru, A., Langford, J., and Slivkins, A. Resourceful contextual bandits. In Conference on Learning Theory, pp. 1109-1134. PMLR, 2014. +Banerjee, A., Chen, S., Fazayeli, F., and Sivakumar, V. Estimation with Norm Regularization. In Neural Information Processing Systems (NIPS), 2014. +Bastani, H., Bayati, M., and Khosravi, K. Mostly exploration-free algorithms for contextual bandits. arXiv:1704.09011, 2018. +Bertsimas, D. and Tsitsiklis, J. Introduction to Linear Optimization. Athena Scientific, 1997. +Besbes, O. and Zeevi, A. J. Blind network revenue management. Operations Research, 60(6):1537-1550, 2012. +Bietti, A., Agarwal, A., and Langford, J. Practical evaluation and optimization of contextual bandit algorithms. CoRR arXiv:1802.04064, 2018. +Bird, S., Barocas, S., Crawford, K., Diaz, F., and Wallach, H. Exploring or exploiting? social and ethical implications of autonomous experimentation. In Workshop on Fairness, Accountability, and Transparency in Machine Learning, 2016. +Boyd, S. and Vandenberghe, L. Convex Optimization. Cambridge University Press, 2005. +Buchbinder, N. and Naor, J. S. Online primal-dual algorithms for covering and packing. Mathematics of Operations Research, 34(2), 2009. +Chandrasekaran, V., Recht, B., Parrilo, P. A., and Willsky, A. S. The Convex Geometry of Linear Inverse Problems. Foundations of Computational Mathematics, 12(6):805-849, 2012. +Chu, W., Li, L., Reyzin, L., and Schapire, R. E. Contextual bandits with linear payoff functions. In International Conference on Artificial Intelligence and Statistics (AISTATS), 2011. + +Combes, R., Jiang, C., and Srikant, R. Bandits with budgets: Regret lower bounds and optimal algorithms. ACM SIGMETRICS Performance Evaluation Review, 43(1): 245-257, 2015. +Devanur, N. R. and Hayes, T. P. The adwords problem: Online keyword matching with budgeted bidders under random permutations. In ACM Conference on Electronic Commerce (ACM-EC), 2009. +Devanur, N. R., Jain, K., Sivan, B., and Wilkens, C. A. Near optimal online algorithms and fast approximation algorithms for resource allocation problems. In ACM Conference on Electronic Commerce (ACM-EC), 2011. +Feldman, J., Henzinger, M., Korula, N., Mirrokni, V. S., and Stein, C. Online stochastic packing applied to display ad allocation. In European Symposium on Algorithms (ESA), 2010. +Frank, M. and Wolfe, P. An algorithm for quadratic programming. Naval Research Logistics, 3, 1956. +Immorlica, N., Sankararaman, K. A., Schapire, R., and Slivkins, A. Adversarial bandits with knapsacks. In 2019 IEEE 60th Annual Symposium on Foundations of Computer Science (FOCS), pp. 202-219. IEEE, 2019. +Kannan, S., Morgenstern, J., Roth, A., Waggoner, B., and Wu, Z. S. A smoothed analysis of the greedy algorithm for the linear contextual bandit problem. CoRR arXiv:1801.04323, 2018. +Langford, J. and Zhang, T. The epoch-greedy algorithm for contextual multi-armed bandits. In Advances in Neural Information Processing Systems (NIPS), 2007. +Lattimore, T. and Szepesvari, C. Bandit Algorithms. Cambridge University Press (To appear), 2019. +Laurent, B. and Massart, P. Adaptive estimation of a quadratic functional by model selection. Annals of Statistics, pp. 1302-1338, 2000. +Li, L., Chu, W., Langford, J., and Schapire, R. E. A contextual-bandit approach to personalized news article recommendation. In International World Wide Web Conference (WWW), 2010. +Mehta, A. Online matching and ad allocation. Foundations and Trends in Machine Learning, 8(4):265-368, 2013. +Mehta, A., Saberi, A., Vazirani, U., and Vazirani, V. Adwords and generalized online matching. Journal of the ACM, 54(5), 2007. +Molinaro, M. and Ravi, R. Geometry of online packing linear problems. In International Colloquium on Automata, Languages and Programming (ICALP), 2012. + +Raghavan, M., Slivkins, A., Vaughan, J. W., and Wu, Z. S. The externalities of exploration and how data diversity helps exploitation. In Conference on Learning Theory (COLT), pp. 1724-1738, 2018. +Shalev-Shwartz, S. et al. Online learning and online convex optimization. Foundations and trends in Machine Learning, 4(2):107-194, 2012. +Singla, A. and Krause, A. Truthful incentives in crowdsourcing tasks using regret minimization mechanisms. In International World Wide Web Conference (WWW), 2013. +Sivakumar, V., Wu, Z. S., and Banerjee, A. Structured linear contextual bandits: A sharp and geometric smoothed analysis. arXiv:2002.11332v1, 2020. +Slivkins, A. Introduction to multi-armed bandits. Foundations and Trends in Machine Learning, 12(1-2):1-286, 2021. +Talagrand, M. The Generic Chaining. Springer Monographs in Mathematics. Springer Berlin, 2005. +Talagrand, M. Upper and Lower Bounds of Stochastic Processes. Springer, 2014. +Tibshirani, R. Regression Shrinkage and Selection via the Lasso. Journal of the Royal Statistical Society, 58(1): 267-288, 1996. +Vershynin, R. High-Dimensional Probability: An Introduction with Applications in Data Science. Cambridge Series in Statistical and Probabilistic Mathematics. Cambridge University Press, 2018. +Wainwright, M. High-Dimensional Statistics: A Non-Asymptotic Viewpoint. Cambridge University Press (To appear), 2019. +Williamson, D. P. and Shmoys, D. B. The Design of Approximation Algorithms. Cambridge University Press, 2011. + +# A. Concentration Inequalities + +We restate the following Hoeffding-type result for dependent variables from (Sivakumar et al., 2020). + +Lemma 5 (Lemma 11 from (Sivakumar et al., 2020)) Let $\{Z_t\}$ be a sub-Gaussian martingale difference sequence (MDS) and let $z_{1:t}$ denote a realization of $Z_{1:t}$ . Let $\{a_t\}$ be a sequence of random variables such that $a_t = f_t(z_{1:(t-1)})$ for some sequence function $f_t$ with $|a_t| \leqslant \alpha_t$ a.s. for suitable constants $\alpha_1, \ldots, \alpha_T$ . Then, for any $\tau > 0$ , we have + +$$ +P \left(\left| \sum_ {t = 1} ^ {T} a _ {t} z _ {t} \right| \geqslant \tau\right) \leqslant 2 \exp \left\{- \frac {\tau^ {2}}{4 c \kappa^ {2} \sum_ {t = 1} ^ {T} \alpha_ {t} ^ {2}} \right\}, \tag {26} +$$ + +for absolute constants $c > 0$ and where $\kappa$ is the $\psi_{2}$ -norm of the conditional subGaussian random variables. + +Corollary 3 Let $z_{1:T}$ denote a realization of a sub-Gaussian martingale difference sequence such that $\mathbb{E}[Z_i|z_{1:i-1}] = 0$ and $\| Z_i\|_{\psi_2} \leqslant \kappa_1$ . Then using $\tau = \sqrt{4c\kappa_1^2T\log(1/\delta)} = O(\sqrt{T\log(1/\delta)})$ , + +$$ +P \left(\left| \sum_ {t = 1} ^ {T} z _ {t} \right| \geqslant \sqrt {4 c \kappa_ {1} ^ {2} T \log (1 / \delta)}\right) \leqslant \delta . \tag {27} +$$ + +# B. Benchmark and Reward, Consumption Bounds + +Lemma 1: Let $\beta = \operatorname*{argmax}_{t\in [T],a\in [K]}\| \mathbf{x}_t(a)\| _2$ . Then with probability at least $1 - \delta$ + +$$ +\beta \leqslant O \left(1 + \sigma \sqrt {m \log (T K / \delta)}\right). \tag {28} +$$ + +Proof: We have $\mathbf{x}_t(a) = \pmb{\nu}_t(a) + \mathbf{g}_t(a)$ where $\pmb{\nu}_t(a) \in \mathbb{B}_2^m$ and $\mathbf{g}_t(a) \sim \mathcal{N}(0, \sigma^2\mathbb{I}_{m\times m})$ . Therefore we have the following, + +$$ +\left\| \mathbf {x} _ {t} (a) \right\| _ {2} \leqslant \left\| \boldsymbol {\nu} _ {t} (a) \right\| _ {2} + \left\| \mathbf {g} _ {t} (a) \right\| _ {2} \leqslant 1 + \left\| \mathbf {g} _ {t} (a) \right\| _ {2}. \tag {29} +$$ + +To obtain bounds on $\| \mathbf{g}_t(a)\| _2$ , note that $\mathbb{E}[\| \mathbf{g}_t(a)\| _2]\leqslant \sqrt{\mathbb{E}[\| \mathbf{g}_t(a)\|_2^2]} = \sigma \sqrt{m}$ . Moreover we have the following result. + +Lemma 6 (Lemma 1 from Laurent and Massart (Laurent & Massart, 2000)) Support $x \sim \chi_m^2$ , i.e., $x = \sum_{i=1}^{m} g_i^2$ for $g_i \in \mathcal{N}(0,1)$ independently, then + +$$ +P [ x \geqslant m + 2 \sqrt {m \epsilon} + 2 \epsilon ] \leqslant \exp (- \epsilon). \tag {30} +$$ + +Therefore from the above lemma the following can be deduced, + +$$ +P \left[ \| \mathbf {g} _ {t} (a) \| _ {2} \geqslant 5 \sigma \sqrt {m \epsilon} \right] \leqslant \exp (- \epsilon). +$$ + +Taking the max over all time steps by union bound argument, + +$$ +P \left[ \max _ {t \in [ T ], a \in [ K ]} \| \mathbf {g} _ {t} (a) \| _ {2} \geqslant 5 \sigma \sqrt {m \epsilon} \right] \leqslant T K \exp (- \epsilon). +$$ + +Now choosing $\epsilon = \log (TK / \delta)$ and by simple arithmetic manipulations and combining with (29) we get the stated result. + +Lemma 2: Let $\overline{\mathrm{OPT}}_1\coloneqq \mathbb{E}_{\phi (T)}[\sum_{t = 1}^T\pmb {\mu}_*^\intercal X_t p_t^* (\phi (T))]$ denote the value of the optimal feasible dynamic policy $p^*$ which knows parameters $\mu_{*},W_{*}$ and distribution $\mathcal{D}$ . Here $p_t^* (\phi (T))$ denotes the distribution over arms in the t-th time step. Then, the optimal static policy $\pi^{*}$ in (8) satisfies: $Tr(\pi^{*})\geqslant \overline{\mathrm{OPT}}_1$ and $Tv(\pi^{*})\leqslant B1$ . + +Proof: Given the dynamic policy $p^*$ , construct the following static context dependent policy $\pi^*$ as follows. + +$$ +\pi^ {*} (X) := \frac {1}{T} \sum_ {t = 1} ^ {T} \mathbb {E} _ {\phi (T)} \left[ p _ {t} ^ {*} (\phi (T)) | X \right]. +$$ + +Now by definition, + +$$ +T r (\boldsymbol {\pi} ^ {*}) = T \mathbb {E} _ {X \sim \mathcal {D}} [ \mathbf {r} ^ {\intercal} \boldsymbol {\pi} ^ {*} (X; \mathcal {D}) ] = \mathbb {E} _ {\phi (T)} [ \sum_ {t = 1} ^ {T} \mathbf {r} ^ {\intercal} p _ {t} ^ {*} (\phi (T)) ] = \overline {{\mathrm {O P T}}} _ {1} +$$ + +$$ +T \mathbf {v} (\pi^ {*}) = T \mathbb {E} _ {X \sim \mathcal {D}} [ V _ {t} \pi^ {*} (X; \mathcal {D}) ] = \mathbb {E} _ {\phi (T)} [ \sum_ {t = 1} ^ {T} V _ {t} p _ {t} ^ {*} (\phi (T)) ] \leqslant B \mathbf {1}. +$$ + +Lemma 3: Let $\overline{\mathrm{OPT}}_2\coloneqq \sum_{t = 1}^T\pmb {\mu}_*\mathbf{I}X_tp_t^* (\phi (T))$ and OPT := $\begin{array}{r}\sum_{t = 1}^{T}\pmb{\mu}_{*}^{\mathrm{T}}X_{t}\pi^{*}(X_{t};\phi (T)) \end{array}$ denote the value of the optimal feasible dynamic policy and the optimal static policy which has knowledge of the parameters $\pmb{\mu}_{*}$ $W_{*}$ . Then $\mathrm{OPT}\geqslant \overline{\mathrm{OPT}}_2$ Proof: For each context set $X$ observed in $\phi (T)$ , construct the following static context dependent policy, + +$$ +\pi^ {*} (X) := \operatorname {a v g} \left[ p _ {t} ^ {*} (\phi (T)) | X \right]. +$$ + +It therefore follows by definition that $\overline{\mathrm{OPT}}_2\coloneqq \mathrm{OPT}_2$ and $\sum_{t = 1}^{T}W_{*}^{\mathsf{T}}X_{t}\pi^{*}(X_{t};\phi (T)) = \sum_{t = 1}^{T}W_{*}^{\mathsf{T}}X_{t}p_{t}^{*}(\phi (T))\leqslant 1B.$ + +# C. Reward and Constraint Parameter Estimation + +We prove upper bounds on parameter estimation errors in each round for the reward and constraint parameters. To be concise we will directly reference results from (Sivakumar et al., 2020) wherever possible. + +# C.1. Covariance Matrix Minimum Eigenvalue + +Theorem 4 Consider any time step $t$ in Algorithm 1 when the no-op arm is not chosen. Let $\mathbf{x}_t(a_t)$ be the context corresponding to the chosen arm. The following is a lower bound on the minimum eigenvalue of the covariance matrix, + +$$ +\lambda_ {\min } \left(\mathbb {E} _ {\mathbf {x} _ {t} (a _ {t})} \left[ \mathbf {x} _ {t} (a _ {t}) \mathbf {x} _ {t} (a _ {t}) ^ {\top} \right]\right) \geqslant c _ {1} \frac {\sigma^ {2}}{\log K} \tag {31} +$$ + +Proof: Let $\mathbf{x}_t(a_t) = \pmb{\nu}_t(a_t) + \mathbf{g}_t(a_t)$ where $a_{t}:= \operatorname *{argmax}_{a\in [K]}\mathbf{x}_{t}(a)^{T}(\hat{\boldsymbol{\mu}}_{t} - Z\hat{W}_{t}\pmb{\theta}_{t})$ . Set $\phi_t = \hat{\pmb{\mu}}_t - Z\hat{W}_t\pmb {\theta}_t$ . By definition, + +$$ +\begin{array}{l} \lambda_ {\min } \left(\mathbb {E} \left[ \mathbf {x} _ {t} (a _ {t}) \mathbf {x} _ {t} (a _ {t}) ^ {\intercal} \Bigg | \mathbf {x} _ {t} (a _ {t}) = \underset {\mathbf {x} _ {t} (a)} {\operatorname {a r g m a x}} \langle \mathbf {x} _ {t} (a), \boldsymbol {\phi} _ {t} \rangle \right]\right) \\ = \min _ {\mathbf {w}: \| \mathbf {w} \| _ {2} = 1} \mathbf {w} ^ {\intercal} \left(\mathbb {E} \left[ \mathbf {x} _ {t} (a _ {t}) \mathbf {x} _ {t} (a _ {t}) ^ {\intercal} \Bigg | \mathbf {x} _ {t} (a _ {t}) = \underset {\mathbf {x} _ {t} (a)} {\operatorname {a r g m a x}} \langle \mathbf {x} _ {t} (a), \boldsymbol {\phi} _ {t} \rangle \right]\right) \mathbf {w} \\ = \min _ {\mathbf {w}: \| \mathbf {w} \| _ {2} = 1} \left(\mathbb {E} \left[ \mathbf {w} ^ {\mathsf {T}} \mathbf {x} _ {t} (a _ {t}) \mathbf {x} _ {t} (a _ {t}) ^ {\mathsf {T}} \mathbf {w} \mid \mathbf {x} _ {t} (a _ {t}) = \underset {\mathbf {x} _ {t} (a)} {\operatorname {a r g m a x}} \langle \mathbf {x} _ {t} (a), \phi_ {t} \rangle \right]\right) \\ \geqslant \min _ {\mathbf {w}: \| \mathbf {w} \| _ {2} = 1} \operatorname {V a r} \left(\left[ \left\langle \mathbf {w}, \boldsymbol {\nu} _ {t} \left(a _ {t}\right) + \mathbf {g} _ {t} \left(a _ {t}\right) \right\rangle \middle | \begin{array}{l} \mathbf {x} _ {t} \left(a _ {t}\right) = \underset {\mathbf {x} _ {t} (a)} {\arg \max } \left\langle \mathbf {x} _ {t} (a), \boldsymbol {\phi} _ {t} \right\rangle \end{array} \right]\right) \\ \geqslant \min _ {\mathbf {w}: \| \mathbf {w} \| _ {2} = 1} \operatorname {V a r} \left(\left[ \left\langle \mathbf {w}, \mathbf {g} _ {t} \left(a _ {t}\right) \right\rangle \mid \mathbf {g} _ {t} \left(a _ {t}\right) = \underset {\mathbf {g} _ {t} (a)} {\operatorname {a r g m a x}} \left\langle \boldsymbol {\nu} _ {t} (a) + \mathbf {g} _ {t} (a), \phi_ {t} \right\rangle \right]\right) \tag {32} \\ \end{array} +$$ + +Let $Q \in \mathbb{R}^{m \times m}$ be an orthogonal matrix such that $Q\phi_{t} = (\| \phi_{t}\|_{2}, 0, \ldots, 0)$ . Also let $(\mathbf{g}_{t}(a_{1}), \ldots, \mathbf{g}_{t}(a_{K})) = (Q^{\intercal}\pmb{\epsilon}_{t}(a_{1}), \ldots, Q^{\intercal}\pmb{\epsilon}_{t}(a_{K}))$ . Due to rotational invariance property of multivariate Gaussian distributions $\pmb{\epsilon}_{t}(a_{i}) \sim$ + +$N(0,\sigma^2\mathbb{I}_{m\times m})$ . The r.h.s. in (32) evaluates to the following, + +$$ +\begin{array}{l} \min _ {\mathbf {w}: \| \mathbf {w} \| _ {2} = 1} \operatorname {V a r} \left[ \langle \mathbf {g} _ {t} (a _ {t}), \mathbf {w} \rangle \left| \begin{array}{c} \mathbf {g} _ {t} (a _ {t}) = \underset {\mathbf {g} _ {t} (a)} {\operatorname {a r g m a x}} \langle \boldsymbol {\nu} _ {t} (a) + \mathbf {g} _ {t} (a), \boldsymbol {\phi} _ {t} \rangle \end{array} \right. \right] \\ = \min _ {\mathbf {w}: \| \mathbf {w} \| _ {2} = 1} \operatorname {V a r} \left[ \langle Q \mathbf {g} _ {t} (a _ {t}), Q \mathbf {w} \rangle \left| \begin{array}{l} \mathbf {g} _ {t} (a _ {t}) = \underset {\mathbf {g} _ {t} (a)} {\operatorname {a r g m a x}} \langle Q \boldsymbol {\nu} _ {t} (a) + Q \mathbf {g} _ {t} (a), Q \boldsymbol {\phi} _ {t} \rangle \end{array} \right. \right] \\ = \min _ {\mathbf {w}: \| \mathbf {w} \| _ {2} = 1} \operatorname {V a r} \left[ \langle \boldsymbol {\epsilon} _ {t} (a _ {t}), \mathbf {w} \rangle \left| \begin{array}{l} \boldsymbol {\epsilon} _ {t} (a _ {t}) = \underset {\boldsymbol {\epsilon} _ {t} (a)} {\operatorname {a r g m a x}} \langle Q \boldsymbol {\nu} _ {t} (a) + \boldsymbol {\epsilon} _ {t} (a), Q \boldsymbol {\phi} _ {t} \rangle \end{array} \right. \right] \\ = \min _ {\mathbf {w}: \| \mathbf {w} \| _ {2} = 1} \operatorname {V a r} \left[ \left\langle \boldsymbol {\epsilon} _ {t} (a _ {t}), \mathbf {w} \right\rangle \left| \begin{array}{l} \boldsymbol {\epsilon} _ {t} (a _ {t}) = \underset {\boldsymbol {\epsilon} _ {t} (a)} {\operatorname {a r g m a x}} (Q \boldsymbol {\nu} _ {t} (a) + \boldsymbol {\epsilon} _ {t} (a)) _ {1} \end{array} \right. \right] \\ = \min _ {\mathbf {w}: \| \mathbf {w} \| _ {2} = 1} \left(\mathbf {w} _ {1} ^ {2} \operatorname {V a r} \left(\boldsymbol {\epsilon} _ {t} \left(a _ {t}\right) _ {1}\right) \mid \boldsymbol {\epsilon} _ {t} \left(a _ {t}\right) = \underset {\boldsymbol {\epsilon} _ {t} (a)} {\operatorname {a r g m a x}} \left(Q \boldsymbol {\nu} _ {t} (a) + \boldsymbol {\epsilon} _ {t} (a)\right) _ {1}\right) + \\ \left(\sum_ {j = 1} ^ {m} \mathbf {w} _ {j} ^ {2} \operatorname {V a r} \left(\boldsymbol {\epsilon} _ {t} \left(a _ {t}\right) _ {j}\right) \mid \boldsymbol {\epsilon} _ {t} \left(a _ {t}\right) = \underset {\boldsymbol {\epsilon} _ {t} (a)} {\operatorname {a r g m a x}} \left(Q \boldsymbol {\nu} _ {t} (a) + \boldsymbol {\epsilon} _ {t} (a)\right) _ {1}\right) \tag {33} \\ \end{array} +$$ + +Note that in the above, $(Q\nu_{t}(a) + \epsilon_{t}(a))_{1}$ denotes the first coordinate of the vector $Q\nu_{t}(a) + \epsilon_{t}(a)$ . The below lemma establishes lower bounds on + +$$ +\left(\operatorname {V a r} (\boldsymbol {\epsilon} _ {t} (a _ {t}) _ {1}) \Bigg | \boldsymbol {\epsilon} _ {t} (a _ {t}) = \underset {\boldsymbol {\epsilon} _ {t} (a)} {\operatorname {a r g m a x}} (Q \boldsymbol {\nu} _ {t} (a) + \boldsymbol {\epsilon} _ {t} (a)) _ {1}\right) +$$ + +Lemma 7 Let $g_{1}, \ldots, g_{K}$ be independent Gaussian random variables sampled from $N(0, \sigma^2)$ . Let $b_{1}, \ldots, b_{K}$ denote $K$ random real numbers. Then, + +$$ +\left(\operatorname {V a r} \left(g _ {i}\right) \mid g _ {i} = \underset {g _ {j}} {\operatorname {a r g m a x}} \left(g _ {j} + b _ {j}\right)\right) \geqslant \left(\operatorname {V a r} \left(g _ {i}\right) \mid g _ {i} = \underset {g _ {j}} {\operatorname {a r g m a x}} g _ {j}\right) \geqslant c _ {1} \frac {\sigma^ {2}}{\log K}, \tag {34} +$$ + +for some positive constant $c_{1}$ + +We first prove the inequality $(\operatorname{Var}(g_i) \mid g_i = \underset{g_j}{\operatorname{argmax}}(g_j + b_j)) \geqslant (\operatorname{Var}(g_i) \mid g_i = \underset{g_j}{\operatorname{argmax}}g_j)$ . Let $g_{(1)}, \dots, g_{(K)}$ denote the order statistics of the Gaussian random variables such that $g_{(1)} \geqslant \dots \geqslant g_{(K)}$ . Now there are $K!$ permutations of the sum $b_i + g_{(j)}$ , $1 \leqslant i, j \leqslant K$ . Assume we have $K$ buckets $A_1, \dots, A_K$ and we partition the $K!$ permutations into the $K$ buckets such that $A_1 \cup \dots \cup A_K$ contains all the $K!$ permutations and $A_k \cap A_{k'} = \phi$ , $1 \leqslant k, k' \leqslant K, k \neq k'$ . + +Consider a single permutation when $b_{i} + g_{(j)}$ has the highest value for some $1 \leqslant i, j \leqslant K$ . Assume ties are broken randomly with equal probability. For example, if $b_{i} + g_{(j)}, b_{i'} + g_{(j')}$ , have equal values either is selected at random with equal probability. + +Case 1: If $j = K$ we assign the permutation to the bucket $A_K$ . + +Case 2: If case 1 is not satisfied, consider indices $(i', i'', j')$ such that the following conditions are satisfied: + +1. $1 \leqslant i', i'', j' < K$ , $i' \neq i''$ , $j \leqslant j'$ +2. $b_{i} + g_{(j)} \geqslant b_{i'} + g_{(j')}$ and $b_{i} + g_{(j)} > b_{i''} + g_{(j' + 1)}$ in the current permutation +3. $b_{i} + g_{(j^{\prime})} > b_{i^{\prime}} + g_{(j)}$ in the permutation derived from the current permutation by swapping $g_{(j)}, g_{(j^{\prime})}$ but $b_{i} + g_{(j^{\prime} + 1)} < b_{i^{\prime \prime}} + g_{(j)}$ in the permutation obtained by swapping $g_{(j)}, g_{(j^{\prime} + 1)}$ + +Condition 2, basically, is the assumption that $b_{i} + g_{(j)}$ has the highest value for the current permutation. Condition 3 finds an index $j' > j$ such in spite of swapping $g_{(j')}$ and $g_{(j)}$ to obtain a new permutation, $b_{i} + g_{(j')}$ has the highest value, but if + +$g_{(j' + 1)}$ and $g_{(j)}$ are swapped $b_i + g_{(j' + 1)}$ no longer has the highest value. Note that one possible assignment is $i' = i$ and $j' = j$ + +In this case we assign the permutation to bucket $A_{j'}$ . + +Now by construction, the buckets partition the $K!$ permutations, i.e., $A_{k} \cap A_{k'} = \phi$ , $k \neq k'$ . Also in bucket $A_{j}$ , $g_{(j')}$ 's are present in equal proportion $\forall j' \leqslant j$ . This is because of the following reason. Bucket $A_{j}$ has no permutation with $b_{i'} + g_{(j')}$ , $j' > j$ with highest value due to the construction above. Let $b_{i} + g_{(j)}$ have the highest value for a permutation from bucket $j$ . Then since $g_{(j')} > g_{(j)}$ , $\forall j' < j$ , the permutation obtained by swapping $g_{(j)}, g_{(j')}$ will have $b_{i} + g_{(j')}$ as the highest value and all the permutations are equally probable. + +Therefore, + +$$ +\left(\operatorname {V a r} \left(g _ {i}\right) \mid g _ {i} = \underset {g _ {j}} {\operatorname {a r g m a x}} \left(g _ {j} + b _ {j}\right)\right) = \sum_ {i = 1} ^ {K} \left(\operatorname {V a r} \left(g _ {i}\right) \mid g _ {i} \geqslant g _ {(j)}\right) P \left(A _ {j}\right), \tag {35} +$$ + +where $P(A_{j})$ is the proportion of the $K!$ permutations in bucket $j$ . Finally, we observe that $(Var(g_{i}) \mid g_{i} \geqslant g_{(j)})$ has the lowest value when $j = 1$ and hence $\sum_{i=1}^{K} (\mathrm{Var}(g_{i}) \mid g_{i} \geqslant g_{(j)}) P(A_{j})$ has the lowest value when $P(A_{1}) = 1$ and $P(A_{j}) = 0$ , $j \neq 1$ , thus proving + +$$ +\left(\operatorname {V a r} \left(g _ {i}\right) \mid g _ {i} = \underset {g _ {j}} {\operatorname {a r g m a x}} \left(g _ {j} + b _ {j}\right)\right) \geqslant \left(\operatorname {V a r} \left(g _ {i}\right) \mid g _ {i} = \underset {g _ {j}} {\operatorname {a r g m a x}} g _ {j}\right). \tag {36} +$$ + +# C.2. Reward and Constraint Parameters Estimation Error Bounds + +The following result is borrowed from (Sivakumar et al., 2020). Note that the result in (Sivakumar et al., 2020) was proved for the setting when the base vectors are chosen adversarially and by extension are also applicable to the simpler setting when the base vectors are chosen stochastically. + +Theorem 5 [Theorem 7 in (Sivakumar et al., 2020)] Consider any time step $t$ after the warm start phase. Let $T_{\mathrm{eff}}(t)$ denote the number of time steps before $t$ when the no-op arm was not chosen. Assume the rows of the design matrix in time step $t$ satisfy the following covariance minimum eigenvalue condition. + +$$ +\lambda_ {\min } \left(\mathbb {E} _ {\mathbf {x} _ {t} (a _ {t})} \left[ \mathbf {x} _ {t} (a _ {t}) \mathbf {x} _ {t} (a _ {t}) ^ {\top} \right]\right) \geqslant c _ {1} \frac {\sigma^ {2}}{\log K}. \tag {37} +$$ + +Then with probability at least $1 - \delta / T$ following is the estimation error bounds for the reward and constraint parameters. + +$$ +\left\| \hat {\boldsymbol {\mu}} _ {t} - \boldsymbol {\mu} _ {*} \right\| _ {2} \leqslant O \left(\frac {\left(w (A) + \sqrt {\log (T d / \delta)}\right) \log K}{\sigma \sqrt {T _ {\text {e f f}} (t)}}\right) \tag {38} +$$ + +$$ +\max _ {1 \leqslant j \leqslant d} \| \left(W _ {t}\right) _ {: j} - \left(W _ {*}\right) _ {: j} \| _ {2} \leqslant O \left(\frac {\left(w (A) + \sqrt {\log (T d / \delta)}\right) \log K}{\sigma \sqrt {T _ {e f f} (t)}}\right). \tag {39} +$$ + +Proof: Theorem 4 proves the covariance minimum eigenvalue condition. The parameter estimation error upper bounds can be obtained using arguments from Theorem 7 in (Sivakumar et al., 2020) with slight modifications. + +# D. Greedy Algorithm Subroutine Analysis + +We provide proof for Theorem 1. + +Theorem 1 Let $T_{stop} \leqslant T$ denote the stopping time of the algorithm. Let $\beta = \max_{t \in [T], a \in [K]} \| \mathbf{x}_t(a) \|_2$ be the maximum $\ell_2$ norm of context vectors. Then with probability at least $1 - 2\delta$ , + +$$ +\begin{array}{l} \operatorname {R E W} \geqslant \max \left[ \operatorname {O P T} \left(T _ {s t o p}\right) + Z \left(\gamma_ {a} \left(T _ {s t o p}\right) - \gamma_ {\pi} \left(T _ {s t o p}\right)\right), \right. \\ \left. Z \gamma_ {a} \left(T _ {s t o p}\right) \right] - O (Z R (T)), \\ \end{array} +$$ + +where + +$$ +\operatorname {R E W} = \sum_ {t = 1} ^ {T _ {\text {s t o p}}} \left\langle \boldsymbol {\mu} _ {*}, \mathbf {x} _ {t} \left(a _ {t}\right) \right\rangle \tag {12} +$$ + +$$ +\operatorname {O P T} \left(T _ {\text {s t o p}}\right) = \sum_ {t = 1} ^ {T _ {\text {s t o p}}} \left\langle \boldsymbol {\mu} _ {*}, X _ {t} \boldsymbol {\pi} ^ {*} \left(X _ {t}\right) \right\rangle \tag {13} +$$ + +$$ +\gamma_ {\pi} \left(T _ {s t o p}\right) = \sum_ {t = 1} ^ {T _ {s t o p}} \left\langle W _ {*} ^ {\mathsf {T}} X _ {t} \boldsymbol {\pi} ^ {*} \left(X _ {t}\right), \boldsymbol {\theta} _ {t} \right\rangle \tag {14} +$$ + +$$ +\gamma_ {a} \left(T _ {\text {s t o p}}\right) = \sum_ {t = 1} ^ {T _ {\text {s t o p}}} \left\langle W _ {*} ^ {\mathsf {T}} \mathbf {x} _ {t} \left(a _ {t}\right), \boldsymbol {\theta} _ {t} \right\rangle . \tag {15} +$$ + +and, with $\sigma^2$ being the Gaussian perturbation variance, + +$$ +R (T) = O \left(\frac {\left(w (A) + \sqrt {\log (T d / \delta)}\right) \beta \sqrt {T} \log K}{\sigma}\right). \tag {16} +$$ + +Proof: We first revise the notations that will be used in the proof. Let $T_{\mathrm{eff}} = T_{\mathrm{eff}}(T_{\mathrm{stop}})$ be the effective number of time steps where any arm other than no-op is chosen after $T$ time steps. The arm chosen by the algorithm at time step $t$ satisfies one of the following two conditions. + +1. The no-op arm is chosen by the algorithm when $\mathbf{x}_t(a_t')^\top (\widehat{\pmb{\mu}}_t - Z\widehat{W}_t\pmb {\theta}_t) < -2\zeta_t$ with $a_{t}^{\prime} = \operatorname *{argmax}_{a\in [K]}x_{t}(a)^{\top}(\widehat{\pmb{\mu}}_{t} - Z\widehat{W}_{t}\pmb{\theta}_{t})$ +2. Arm $a_{t}$ is chosen when $\mathbf{x}_t(a_t)^\intercal (\widehat{\boldsymbol{\mu}}_t - Z\widehat{W}_t\boldsymbol {\theta}_t)\geqslant -2\zeta_t$ + +where $\zeta_t = O\left(\frac{\left(w(A) + \sqrt{\log(Td / \delta)}\right)Z\beta\log K}{\sigma\sqrt{T_{\mathrm{eff}}(t)}}\right)$ . + +Let $\Upsilon_{\mathrm{no}}$ denote the set of time steps when condition 1 is triggered and $\Upsilon_{a}$ denotes the set of time steps when condition 2 is triggered. The size of the sets $|\Upsilon_{\mathrm{no}}| = T_{\mathrm{stop}} - T_{\mathrm{eff}}$ and $|\Upsilon_{a}| = T_{\mathrm{eff}}$ . + +Assume Algorithm 1 has knowledge of $\pmb{\mu}_{*}, W_{*}$ . Then in time step $t$ arm $\mathbf{x}_t(a_t^*)$ will be chosen and both of the below conditions are true, + +$$ +\begin{array}{l} \sum_ {t = 1} ^ {T _ {\text {s t o p}}} \left(\left\langle \boldsymbol {\mu} _ {*}, \mathbf {x} _ {t} \left(a _ {t} ^ {*}\right) \right\rangle - Z \left\langle W _ {*} ^ {\intercal} \mathbf {x} _ {t} \left(a _ {t} ^ {*}\right), \boldsymbol {\theta} _ {t} \right\rangle\right) \geqslant 0 \\ \sum_ {t = 1} ^ {T _ {\text {s t o p}}} \left(\left\langle \boldsymbol {\mu} _ {*}, \mathbf {x} _ {t} \left(a _ {t} ^ {*}\right) \right\rangle - Z \left\langle W _ {*} ^ {\top} \mathbf {x} _ {t} \left(a _ {t} ^ {*}\right), \boldsymbol {\theta} _ {t} \right\rangle\right) \geqslant \sum_ {t = 1} ^ {T _ {\text {s t o p}}} \left(\left\langle \boldsymbol {\mu} _ {*}, X _ {t} \pi^ {*} \left(X _ {t}\right) \right\rangle - Z \left\langle W _ {*} ^ {\top} X _ {t} \pi^ {*} \left(X _ {t}\right), \boldsymbol {\theta} _ {t} \right\rangle\right). \tag {40} \\ \end{array} +$$ + +The first line is because we have the no-op option which has 0 rewards and 0 consumption. Note that since we have knowledge of $\mu_{*}$ , $W_{*}$ we no longer need to consider the negative threshold $\zeta_{t}$ which was to account for parameter estimation errors. + +The below lemma shows that with high probability when the algorithm chooses the no-op arm in rounds in $\Upsilon_{\mathrm{no}}$ the actual arm chosen with foreknowledge of $\mu_{*}$ , $W_{*}$ will also be the no-op arm. + +Lemma 8 Denote optimal arm in each round by $a_{t}^{*}$ which is the arm that would have been chosen if the true parameters $\pmb{\mu}_{*}, W_{*}$ were known and optimal arm other than no-op in each time step by $a_{t}^{\prime *} := \operatorname*{argmax}_{a \in [K]} \mathbf{x}_{t}(a)^{\top} (\pmb{\mu}_{*} - ZW_{*}\pmb{\theta}_{t})$ . Let + +$a_{t}^{\prime}:= \operatorname*{argmax}_{a\in [K]}\mathbf{x}_{t}(a)^{\top}(\widehat{\boldsymbol{\mu}}_{t} - Z\widehat{W}_{t}\boldsymbol{\theta}_{t})$ be the optimal arm without considering no-op chosen in the Algorithm. Then for any + +round $t$ in $\Upsilon_{\mathrm{no}}$ with $\zeta_t = O\left(\frac{\left(w(A) + \sqrt{\log(Td / \delta)}\right)Z\beta\log K}{\sigma\sqrt{T_{eff}(t)}}\right)$ , we have + +$$ +\mathbf {x} _ {t} \left(a _ {t} ^ {\prime}\right) ^ {\top} \left(\widehat {\boldsymbol {\mu}} _ {t} - Z \widehat {W} _ {t} \boldsymbol {\theta} _ {t}\right) < - 2 \zeta_ {t}. \tag {41} +$$ + +Then with probability at least $1 - \frac{2\delta}{T}$ , $a_{t}^{*}$ is also the no-op arm. + +Proof: For the algorithm with knowledge of $\pmb{\mu}_{*}, W_{*}$ to choose the no-op arm we have to prove $\langle \pmb{\mu}_{*}, \mathbf{x}_t(a_t'^*) \rangle - Z\langle W_*^\top \mathbf{x}_t(a_t'^*), \pmb{\theta}_t \rangle < 0$ . + +$$ +\begin{array}{l} \langle \pmb {\mu} _ {*}, \mathbf {x} _ {t} (a _ {t} ^ {' *}) \rangle - Z \langle W _ {*} ^ {\top} \mathbf {x} _ {t} (a _ {t} ^ {' *}), \pmb {\theta} _ {t} \rangle = \langle \pmb {\mu} _ {*} - \widehat {\pmb {\mu}} _ {t}, \mathbf {x} _ {t} (a _ {t} ^ {' *}) \rangle - Z \langle (W _ {*} - \widehat {W _ {t}}) ^ {\top} \mathbf {x} _ {t} (a _ {t} ^ {' *}), \pmb {\theta} _ {t} \rangle \\ + \langle \widehat {\boldsymbol {\mu}} _ {t}, \mathbf {x} _ {t} \left(a _ {t} ^ {\prime *}\right) \rangle - Z \langle \widehat {W} _ {t} ^ {\top} \mathbf {x} _ {t} \left(a _ {t} ^ {\prime *}\right), \boldsymbol {\theta} _ {t} \rangle \\ < \langle \pmb {\mu} _ {*} - \widehat {\pmb {\mu}} _ {t}, \mathbf {x} _ {t} (a _ {t} ^ {' *}) \rangle - Z \langle (W _ {*} - \widehat {W _ {t}}) ^ {\intercal} \mathbf {x} _ {t} (a _ {t} ^ {' *}), \pmb {\theta} _ {t} \rangle \\ + \underbrace {\langle \widehat {\boldsymbol {\mu}} _ {t} , \mathbf {x} _ {t} \left(a _ {t} ^ {\prime}\right) \rangle - Z \langle \widehat {W} _ {t} ^ {\top} \mathbf {x} _ {t} \left(a _ {t} ^ {\prime}\right) , \boldsymbol {\theta} _ {t} \rangle} _ {- 2 \zeta_ {t}} \\ < \underbrace {\left\| \mathbf {x} _ {t} \left(a _ {t} ^ {\prime *}\right) \right\| _ {2} \left\| \boldsymbol {\mu} _ {*} - \widehat {\boldsymbol {\mu}} _ {t} \right\| _ {2}} _ {< \zeta_ {t}} + Z \underbrace {\left\| \mathbf {x} _ {t} \left(a _ {t} ^ {\prime *}\right) \right\| _ {2} \left\| W _ {*} - \widehat {W} _ {t} \right\| _ {\infty} \left\| \boldsymbol {\theta} _ {t} \right\| _ {1}} _ {< \zeta_ {t}} - 2 \zeta_ {t} \\ < 0 \quad \text {w i t h p r o b a b i l i t y} \quad 1 - \frac {2 \delta}{T} \\ \end{array} +$$ + +In the second line we use $\langle \hat{\pmb{\mu}}_t,\mathbf{x}_t(a_t^{'*})\rangle -Z\langle \widehat{W}_t^\top \mathbf{x}_t(a_t^{'*}),\pmb {\theta}_t\rangle \leqslant \langle \hat{\pmb{\mu}}_t,\mathbf{x}_t(a_t^{'})\rangle -Z\langle \widehat{W}_t^\top \mathbf{x}_t(a_t^{'}),\pmb {\theta}_t\rangle$ by definition. Also since the no-op arm was chosen we have $\langle \hat{\pmb{\mu}}_t,\mathbf{x}_t(a_t^{'})\rangle -Z\langle \widehat{W}_t^\top \mathbf{x}_t(a_t^{'}),\pmb {\theta}_t\rangle < - 2\zeta_t.$ In the third line we use $\| \mathbf{x}_t(a_t^*)\| _2\leqslant \beta$ from Lemma 1 and use estimation error bounds from Theorem 5. + +Now it can be deduced from Lemma 8 using a union bound argument over rounds in $\Upsilon_{\mathrm{no}}$ when the no-op arm is chosen with high probability the optimal arm is also the no-op arm. Therefore with probability $1 - \frac{2\delta(T_{\mathrm{stop}} - T_{\mathrm{eff}})}{T}$ , + +$$ +\sum_ {t \in \Upsilon_ {\mathrm {n o}}} \left\langle \boldsymbol {\mu} _ {*}, \mathbf {x} \left(a _ {t}\right) \right\rangle = \sum_ {t \in \Upsilon_ {\mathrm {n o}}} \left\langle \boldsymbol {\mu} _ {*}, \mathbf {x} \left(a _ {t} ^ {*}\right) \right\rangle = \sum_ {t \in \Upsilon_ {\mathrm {n o}}} \left\langle W _ {*} ^ {\mathsf {T}} \mathbf {x} \left(a _ {t}\right), \boldsymbol {\theta} _ {t} \right\rangle = \sum_ {t \in \Upsilon_ {\mathrm {n o}}} \left\langle W _ {*} ^ {\mathsf {T}} \mathbf {x} \left(a _ {t} ^ {*}\right), \boldsymbol {\theta} _ {t} \right\rangle = 0. \tag {42} +$$ + +The following is true for time steps in set $\Upsilon_{a}$ due to the greedy choice made in Algorithm 2. + +$$ +\begin{array}{l} \sum_ {t \in \Upsilon_ {a}} \left(\langle \widehat {\boldsymbol {\mu}} _ {t}, \mathbf {x} _ {t} (a _ {t}) \rangle - Z \langle \widehat {W} _ {t} ^ {\intercal} \mathbf {x} _ {t} (a _ {t}), \boldsymbol {\theta} _ {t} \rangle\right) \geqslant \sum_ {t \in \Upsilon_ {a}} \left(\langle \widehat {\boldsymbol {\mu}} _ {t}, \mathbf {x} _ {t} (a _ {t} ^ {*}) \rangle - Z \langle \widehat {W} _ {t} ^ {\intercal} \mathbf {x} _ {t} (a _ {t} ^ {*}), \boldsymbol {\theta} _ {t} \rangle\right) \\ \Rightarrow \sum_ {t \in \Upsilon_ {a}} \left(\langle \boldsymbol {\mu} _ {*}, \mathbf {x} _ {t} (a _ {t}) \rangle - Z \langle W _ {*} ^ {\intercal} \mathbf {x} _ {t} (a _ {t}), \boldsymbol {\theta} _ {t} \rangle\right) + \underbrace {\sum_ {t \in \Upsilon_ {a}} \langle \hat {\boldsymbol {\mu}} _ {t} - \boldsymbol {\mu} _ {*} , \mathbf {x} _ {t} (a _ {t}) - \mathbf {x} _ {t} \left(a _ {t} ^ {*}\right) \rangle} _ {\leqslant R _ {\boldsymbol {\mu}} \left(T _ {\text {s t o p}}\right)} (43) \\ - Z \underbrace {\sum_ {t \in \Upsilon_ {a}} \langle (\widehat {W} _ {t} - W _ {*}) ^ {\intercal} (\mathbf {x} _ {t} (a _ {t}) - \mathbf {x} _ {t} (a _ {t} ^ {*})), \boldsymbol {\theta} _ {t} \rangle} _ {\leqslant R _ {W} (T _ {\mathrm {s t o p}})} \\ \geqslant \sum_ {t \in \Upsilon_ {a}} \left(\left\langle \boldsymbol {\mu} _ {*}, \mathbf {x} _ {t} \left(a _ {t} ^ {*}\right) \right\rangle - Z \left\langle W _ {*} ^ {\top} \mathbf {x} _ {t} \left(a _ {t} ^ {*}\right), \boldsymbol {\theta} _ {t} \right\rangle\right) (44) \\ \end{array} +$$ + +Combining results (40), (42) and (44) leads to the following with probability at least $1 - \frac{2\delta(T_{\mathrm{stop}} - T_{\mathrm{eff}})}{T}$ . + +$$ +\underbrace{\sum_{t = 1}^{T_{\text{stop}}}\langle\boldsymbol{\mu}_{*},\mathbf{x}_{t}(a_{t})\rangle}_{\text{REW}}\geqslant \underbrace{Z\sum_{t = 1}^{T_{\text{stop}}}\langle W_{*}^{\mathsf{T}}\mathbf{x}_{t}(a_{t}),\boldsymbol{\theta}_{t}\rangle}_{\gamma_{a}\left(T_{\text{stop}}\right)} - \underbrace{\sum_{t\in\Upsilon_{a}}\langle\widehat{\boldsymbol{\mu}}_{t} - \boldsymbol{\mu}_{*},\mathbf{x}_{t}(a_{t}) - \mathbf{x}_{t}(a_{t}^{*})\rangle}_{\leqslant R_{\boldsymbol{\mu}}(T_{\text{stop}})} - Z\underbrace{\sum_{t\in\Upsilon_{a}}\langle(W_{*} - \widehat{W}_{t})^{\mathsf{T}}(\mathbf{x}_{t}(a_{t}) - \mathbf{x}_{t}(a_{t}^{*})),\boldsymbol{\theta}_{t}\rangle}_{\leqslant R_{W}(T_{\text{stop}})} +$$ + +$$ +\begin{array}{l} \underbrace{\sum_{t = 1}^{T_{\text{stop}}}\langle\boldsymbol{\mu}_{*},\mathbf{x}_{t}(a_{t})\rangle}_{\text{REW}}\geqslant \underbrace{\sum_{t = 1}^{T_{\text{stop}}}\langle\boldsymbol{\mu}_{*},X_{t}\pi^{*}(X_{t})\rangle\rangle}_{\text{OPT}(T_{\text{stop}})} - \underbrace{\sum_{t\in\Upsilon_{a}}\langle\widehat{\boldsymbol{\mu}}_{t} - \boldsymbol{\mu}_{*},\mathbf{x}_{t}(a_{t}) - \mathbf{x}_{t}(a_{t}^{*})\rangle}_{\leqslant R_{\boldsymbol{\mu}}(T_{\text{stop}})} - Z\underbrace{\sum_{t\in\Upsilon_{a}}\langle(W_{*} - \widehat{W}_{t})^{\intercal}(\mathbf{x}_{t}(a_{t}) - \mathbf{x}_{t}(a_{t}^{*})),\boldsymbol{\theta}_{t}\rangle}_{\leqslant R_{W}(T_{\text{stop}})} \\ + \underbrace {Z \sum_ {t = 1} ^ {T} \left\langle W _ {*} ^ {\mathsf {T}} \mathbf {x} _ {t} \left(a _ {t}\right) , \boldsymbol {\theta} _ {t} \right\rangle} _ {\gamma_ {a} \left(T _ {\text {s t o p}}\right)} - \underbrace {Z \sum_ {t = 1} ^ {T} \left\langle W _ {*} ^ {\mathsf {T}} X _ {t} \pi^ {*} \left(X _ {t}\right) , \boldsymbol {\theta} _ {t} \right\rangle} _ {\gamma_ {\pi} \left(T _ {\text {s t o p}}\right)}. \tag {45} \\ \end{array} +$$ + +The below lemma upper bounds the regret $R_{\mu}(T_{\mathrm{stop}}), R_W(T_{\mathrm{stop}})$ . + +Lemma 9 Let, + +$$ +R (T) = O \left(\frac {\left(w (A) + \sqrt {\log (T d / \delta)}\right) \beta \sqrt {T} \log K}{\sigma}\right), \tag {46} +$$ + +where $\beta = \max_{t\in [T],a\in [K]}\| \mathbf{x}_t(a)\| _2\leqslant O\left(1 + \sigma \sqrt{m\log(TK / \delta)}\right)$ . With probability at least $1 - \frac{2\delta T_{eff}}{T}$ , + +$$ +R _ {\mu} \left(T _ {s t o p}\right) \leqslant R (T) \quad R _ {W} \left(T _ {s t o p}\right) \leqslant R (T). \tag {47} +$$ + +Proof: Let $\Upsilon_{a}$ denote the set of time steps when any arm other than no-op was chosen. Then we have the following, + +$$ +R _ {\boldsymbol {\mu}} \left(T _ {\text {s t o p}}\right) \leqslant 2 \beta \sum_ {t \in \Upsilon_ {a}} \| \boldsymbol {\mu} _ {*} - \hat {\boldsymbol {\mu}} _ {t} \| _ {2} +$$ + +$\leqslant 2\beta \sum_{t\in \Upsilon_a}c\cdot \frac{\left(w(A) + \sqrt{\log(Td / \delta)}\right)\log K}{\sigma\sqrt{T_{\mathrm{eff}}(t)}}$ with prob. $\geqslant 1 - \frac{\delta T_{\mathrm{eff}}}{T}$ , using Theorem 5 and union bound + +$$ +\leqslant 2 \beta c \cdot \frac {\left(w (A) + \sqrt {\log (T d / \delta)}\right) \sqrt {T _ {\mathrm {e f f}} (t)} \log K}{\sigma} \leqslant R (T), \tag {48} +$$ + +where $c$ is a positive constant and in line 2 we use the reward estimation error rates from Theorem 5 together with a union bounding argument. + +Similarly for bounding the constraint regret consider the following, + +$\leqslant 2\beta \sum_{t\in P_2}c\cdot \frac{\left(w(A) + \sqrt{\log(Td / \delta)}\right)\log K}{\sigma\sqrt{T_{\mathrm{eff}}(t)}}$ with prob. $\geqslant 1 - \frac{\delta T_{\mathrm{eff}}}{T}$ , Theorem 5 and union bound + +$$ +\begin{array}{l} R _ {W} \left(T _ {\text {s t o p}}\right) \leqslant 2 \beta \sum_ {t \in \Upsilon_ {a}} \| \widehat {W} _ {t} - W _ {*} \| _ {\infty} \| \boldsymbol {\theta} \| _ {1} \\ \leqslant 2 \beta \sum_ {t \in \Upsilon_ {a}} \max _ {1 \leqslant j \leqslant d} \| (\widehat {W} _ {t}) _ {: j} - (W _ {*}) _ {: j} \| _ {2} \quad \dots . \text {s i n c e} \| \boldsymbol {\theta} \| _ {1} \leqslant 1 \\ \leqslant 2 \beta c \cdot \frac {\left(w (A) + \sqrt {\log (T d / \delta)}\right) \sqrt {T _ {\mathrm {e f f}} (t)} \log K}{\sigma} \leqslant R (T). \tag {49} \\ \end{array} +$$ + +Now from equation (45) and the result of Lemma 9 we get the advertised result with the observation that $T_{\mathrm{stop}} \leqslant T$ . + +![](images/623dfd87736f0b24fcfe83195fe743f3dacbf066800b5fd571ba2cbba4f06ce5.jpg) + +# E. Regret For Smoothed Stochastic Linear Bandits with Knapsacks + +Lemma 4 [Lemma 5 in (Agrawal & Devanur, 2016)] For $R(T_0) = O\left(\frac{(w(A) + \sqrt{\log(T_0d / \delta)})\beta\sqrt{T_0}\log K}{\sigma}\right)$ , with probability at least $1 - \delta$ + +$$ +\widehat {\mathrm {O P T}} (T; \omega (T _ {0})) \geqslant \mathrm {O P T} _ {1} - 2 \left(\frac {T}{T _ {0}}\right) R (T _ {0}) \tag {18} +$$ + +$$ +\widehat {\mathrm {O P T}} (T; \omega (T _ {0})) \leqslant \mathrm {O P T} _ {1} + 9 \left(\frac {T}{T _ {0}}\right) R (T _ {0}) \left(\frac {\mathrm {O P T} _ {1}}{B} + 1\right) \tag {18} +$$ + +Set $Z(T_0) = \frac{\left(\widehat{\mathrm{OPT}}(T;\omega(T_0))+2\left(\frac{T}{T_0}\right)R(T_0)\right)}{B} + 1$ . Then with probability $1 - O(\delta)$ , + +$$ +Z (T _ {0}) \geqslant \frac {\mathrm {O P T} _ {1}}{B} + 1 +$$ + +$$ +Z \left(T _ {0}\right) \leqslant \left(1 + \frac {1 1 \left(\frac {T}{T _ {0}}\right) R \left(T _ {0}\right)}{B}\right) \left(\frac {\mathrm {O P T} _ {1}}{B} + 1\right). \tag {19} +$$ + +Moreover if $B \geqslant \tilde{\Omega}\left(\frac{T}{\sqrt{T_0}}\frac{w(A)\log K}{\sigma}\right)$ then $Z(T_0) \leqslant O\left(\frac{\mathrm{OPT}_1}{B} + 1\right)$ . + +Proof: We borrow work from Lemma 5 in (Agrawal & Devanur, 2016). The only difference compared to (Agrawal & Devanur, 2016) is the step to bound the empirical reward and consumptions with the expectation since we have Gaussian perturbations which are no longer bounded. We have to prove the following. + +$$ +\left| \sum_ {t = 1} ^ {T _ {0}} \langle \boldsymbol {\mu} _ {*}, X _ {t} \pi (X _ {t}) \rangle - \mathbb {E} _ {X} [ \langle \boldsymbol {\mu} _ {*}, X _ {t} \pi (X _ {t}) \rangle ] \right| \leqslant R (T _ {0}) +$$ + +$$ +\max _ {1 \leqslant j \leqslant d} \left| \sum_ {t = 1} ^ {T _ {0}} \left\langle \left(W _ {*}\right) _ {: j}, X _ {t} \pi \left(X _ {t}\right) \right\rangle - \mathbb {E} _ {X} \left[ \left\langle \left(W _ {*}\right) _ {: j}, X _ {t} \pi \left(X _ {t}\right) \right\rangle \right] \right| \leqslant R \left(T _ {0}\right) \tag {50} +$$ + +This is equivalent to proving bounds on $\left|\sum_{t=1}^{T_0}\langle\pmb{\mu}_*,X_t\pi(X_t)-\mathbb{E}_X[X_t\pi(X_t)]\rangle\right| = \left|\sum_{t=1}^{T_0}z_t\right|$ where $z_t = \langle \pmb{\mu}_*,X_t\pi(X_t)-\mathbb{E}_X[X_t\pi(X_t)]\rangle$ . Note that $z_t$ are (conditionally on history) sub-Gaussian with sub-Gaussian norm $c_2(1+\sigma) = O(1)$ . This is because the base vectors of the contexts are bounded in $\mathbb{B}_2^m$ and $\sigma^2$ is the variance of the Gaussian perturbations. Therefore applying Corollary 3 we get, + +$$ +P \left( \right.\left| \sum_ {t = 1} ^ {T _ {0}} \left\langle \boldsymbol {\mu} _ {*}, X _ {t} \pi \left(X _ {t}\right) - \mathbb {E} _ {X} \left[ X _ {t} \pi \left(X _ {t}\right)\right]\right\rangle\right| \geqslant \sqrt {4 c _ {2} ^ {2} (1 + \sigma) ^ {2} \log \left(T _ {0} d / \delta\right)} \leqslant (\delta / T _ {0} d). \tag {51} +$$ + +Similarly, + +$$ +P \left(\left| \sum_ {t = 1} ^ {T _ {0}} \left\langle \left(W _ {*}\right) _ {: j}, X _ {t} \pi \left(X _ {t}\right) - \mathbb {E} _ {X} \left[ X _ {t} \pi \left(X _ {t}\right) \right] \right\rangle \right| \geqslant \sqrt {4 c _ {2} ^ {2} (1 + \sigma) ^ {2} \log \left(T _ {0} d / \delta\right)}\right) \leqslant (\delta / T _ {0} d). \tag {52} +$$ + +Now taking a union bound over all $1 \leqslant j \leqslant d$ and with the observation $\sqrt{4c_2^2(1 + \sigma)^2\log(T_0d / \delta)} \leqslant R(T_0)$ we obtain 50 with probability at least $\delta / T_0$ . The rest of the proof follows Lemma 5 in (Agrawal & Devanur, 2016) and Lemmas F.4,F.6 in (Agrawal & Devanur, 2014a). + +We provide the proof for the final regret bounds in the stochastic setting for the greedy algorithm. + +Theorem 2 Assume $B \geqslant \tilde{\Omega}\left(\max \left(T_0, \frac{T}{\sqrt{T_0}} \frac{w(A) \log K}{\sigma}\right)\right)$ . Then if $Z(T_0)$ is set as outlined in Lemma 4, we have + +$$ +\frac {\mathrm {O P T} _ {1}}{B} + 1 \leqslant Z (T _ {0}) \leqslant O \left(\frac {\mathrm {O P T} _ {1}}{B} + 1\right). \tag {20} +$$ + +Moreover with probability at least $1 - 6\delta$ , following is the regret for the greedy Algorithm 4, + +$$ +\operatorname {r e g r e t} (T) \leqslant O \left(\left(\frac {\mathrm {O P T} _ {1}}{B} + 1\right) \max \left(T _ {0}, R (T)\right)\right), \tag {21} +$$ + +where $R(T) = O\left(\frac{\left(w(A) + \sqrt{\log(Td / \delta)}\right)\beta\sqrt{T}\log K}{\sigma}\right)$ . + +Proof: The condition on $B$ and $Z(T_0)$ is a consequence of result of Lemma 4. We now focus on bounding the regret. We accrue maximum $O(\beta T_0)$ regret in the warm start phase. For characterizing regret during the exploit phase, let's start with the lower bound for REW from Theorem 1. With probability at least $1 - 2\delta$ , + +$$ +\operatorname {R E W} \geqslant \operatorname {O P T} \left(T _ {\text {s t o p}}\right) + Z \left(T _ {0}\right) \gamma_ {a} \left(T _ {\text {s t o p}}\right) - Z \left(T _ {0}\right) \gamma_ {\pi} \left(T _ {\text {s t o p}}\right) - O \left(Z \left(T _ {0}\right) \cdot R (T)\right), \tag {53} +$$ + +where + +$$ +\operatorname {R E W} = \sum_ {t = 1} ^ {T _ {\text {s t o p}}} \left\langle \boldsymbol {\mu} _ {*}, \mathbf {x} _ {t} \left(a _ {t}\right) \right\rangle \tag {54} +$$ + +$$ +\operatorname {O P T} \left(T _ {\text {s t o p}}\right) = \sum_ {t = 1} ^ {T _ {\text {s t o p}}} \left\langle \boldsymbol {\mu} _ {*}, X _ {t} \boldsymbol {\pi} ^ {*} \left(X _ {t}\right) \right\rangle \tag {55} +$$ + +$$ +\gamma_ {\pi} \left(T _ {\text {s t o p}}\right) = \sum_ {t = 1} ^ {T _ {\text {s t o p}}} \left\langle W _ {*} ^ {\mathsf {T}} X _ {t} \boldsymbol {\pi} ^ {*} \left(X _ {t}\right), \boldsymbol {\theta} _ {t} \right\rangle \tag {56} +$$ + +$$ +\gamma_ {a} \left(T _ {\text {s t o p}}\right) = \sum_ {t = 1} ^ {T _ {\text {s t o p}}} \left\langle W _ {*} ^ {\mathsf {T}} \mathbf {x} _ {t} \left(a _ {t}\right), \boldsymbol {\theta} _ {t} \right\rangle . \tag {57} +$$ + +For stochastic LinCBwK $t = 1$ references first round after warm start phase $T_0 + 1$ , and if the algorithm stops at time step $T'$ then $T_{\mathrm{stop}} = T' - T_0$ + +Taking expectations w.r.t. $X$ on both sides, with probability at least $1 - 2\delta$ + +$$ +\mathbb {E} _ {X} \left[ \operatorname {R E W} \right] \geqslant \mathbb {E} _ {X} \left[ \operatorname {O P T} \left(T _ {\text {s t o p}}\right) \right] + Z \left(T _ {0}\right) \mathbb {E} _ {X} \left[ \gamma_ {a} \left(T _ {\text {s t o p}}\right) - \gamma_ {\pi} \left(T _ {\text {s t o p}}\right) \right] - O \left(Z \left(T _ {0}\right) \cdot R (T)\right). \tag {58} +$$ + +Also using definition of optimal regret, + +$$ +\mathbb {E} _ {X} \left[ \mathrm {O P T} \left(T _ {\text {s t o p}}\right) \right] = \mathbb {E} _ {X _ {t}} \left[ \sum_ {t = 1} ^ {T _ {\text {s t o p}}} \left\langle \boldsymbol {\mu} _ {*}, X _ {t} \pi^ {*} \left(X _ {t}\right) \right\rangle \right] = \frac {T _ {\text {s t o p}}}{T} \mathrm {O P T} _ {1}. \tag {59} +$$ + +Lemma 10 Following is upper bound on $\mathbb{E}_X[\gamma_a(T_{stop}) - \gamma_\pi (T_{stop})]$ + +$$ +\mathbb {E} _ {X} \left[ \gamma_ {a} \left(T _ {\text {s t o p}}\right) - \gamma_ {\pi} \left(T _ {\text {s t o p}}\right) \right] \geqslant B \left(1 - \frac {T _ {\text {s t o p}}}{T}\right) - \beta T _ {0} - R _ {D} \left(T _ {\text {s t o p}}\right), \tag {60} +$$ + +where $R_{D}(T_{stop})$ is the regret of the OCO algorithm. + +Proof: We make the following observations. + +$$ +\begin{array}{l} \mathbb {E} _ {X} \left[ \gamma_ {a} \left(T _ {\text {s t o p}}\right) - \gamma_ {\pi} \left(T _ {\text {s t o p}}\right) \right] = \mathbb {E} _ {X} \left[ \sum_ {t = 1} ^ {T _ {\text {s t o p}}} \left\langle W _ {*} ^ {\mathsf {T}} \left(\mathbf {x} _ {t} \left(a _ {t}\right) - X _ {t} \boldsymbol {\pi} ^ {*} \left(X _ {t}\right)\right), \boldsymbol {\theta} _ {t} \right\rangle \right] (61) \\ = \sum_ {t = 1} ^ {T _ {\text {s t o p}}} \left\langle \boldsymbol {\theta} _ {t}, \underbrace {\mathbb {E} _ {X _ {t}} \left[ W _ {*} ^ {\mathsf {T}} \mathbf {x} _ {t} (a _ {t}) \mid H _ {t - 1} \right]} _ {\mathbf {v} _ {t}} - \underbrace {\mathbb {E} _ {X _ {t}} \left[ W _ {*} ^ {\mathsf {T}} X _ {t} \boldsymbol {\pi} ^ {*} (X _ {t}) \right]} _ {\leqslant \frac {B 1}{T} \text {b y d e f i n i t i o n o f} \boldsymbol {\pi} ^ {*}} \right\rangle \\ \geqslant \sum_ {t = 1} ^ {T _ {\text {s t o p}}} \left\langle \boldsymbol {\theta} _ {t}, \mathbf {v} _ {t} - \mathbf {1} \frac {B}{T} \right\rangle = \sum_ {t = 1} ^ {T _ {\text {s t o p}}} g _ {t} \left(\boldsymbol {\theta} _ {t}\right), (62) \\ \end{array} +$$ + +where $g_{t}(\pmb{\theta}_{t})$ is the objective maximized by OCO algorithm in each step. We therefore obtain lower bounds on $\sum_{t=1}^{T_{\mathrm{stop}}} g_{t}(\pmb{\theta}_{t})$ . Let $\pmb{\theta}^{*} = \underset{\|\pmb{\theta}\|_{1} \leqslant 1, \pmb{\theta}_{i} \geqslant 0}{\mathrm{argmax}} \sum_{t=1}^{T_{\mathrm{stop}}} g_{t}(\pmb{\theta})$ . If $R_{D}(T_{\mathrm{stop}})$ is the regret of the OCO algorithm up to time $T_{\mathrm{stop}}$ , the following is true, + +$$ +\sum_ {t = 1} ^ {T _ {\text {s t o p}}} g _ {t} \left(\boldsymbol {\theta} _ {t}\right) \geqslant \sum_ {t = 1} ^ {T _ {\text {s t o p}}} g _ {t} \left(\boldsymbol {\theta} ^ {*}\right) - R _ {D} \left(T _ {\text {s t o p}}\right). +$$ + +Consider the two cases, when $T_{\mathrm{stop}} < T$ and $T_{\mathrm{stop}} = T$ . + +Case 1: If $T_{\mathrm{stop}} < T$ , then $\sum_{t=1}^{T_{\mathrm{stop}}} \langle \mathbf{e}_j, \mathbf{v}_t \rangle \geqslant B' = B - \beta T_0$ for some $j = 1, \ldots, d$ . Therefore, + +$$ +\begin{array}{l} \sum_ {t = 1} ^ {T _ {\text {s t o p}}} g _ {t} \left(\boldsymbol {\theta} _ {t}\right) \geqslant \sum_ {t = 1} ^ {T _ {\text {s t o p}}} g _ {t} \left(\boldsymbol {\theta} ^ {*}\right) - R _ {D} \left(T _ {\text {s t o p}}\right) \geqslant \sum_ {t = 1} ^ {T _ {\text {s t o p}}} g _ {t} \left(\mathbf {e} _ {j}\right) - R _ {D} \left(T _ {\text {s t o p}}\right) = \sum_ {t = 1} ^ {T _ {\text {s t o p}}} \left\langle \mathbf {e} _ {j}, \mathbf {v} _ {t} - \mathbf {1} \frac {B}{T} \right\rangle - R _ {D} \left(T _ {\text {s t o p}}\right) \geqslant \\ B \left(1 - \frac {T _ {\text {s t o p}}}{T}\right) - \beta T _ {0} - R _ {D} \left(T _ {\text {s t o p}}\right). \\ \end{array} +$$ + +Case 2: If $T_{\mathrm{stop}} = T$ , then $B\left(1 - \frac{T_{\mathrm{stop}}}{T}\right) = 0$ . Therefore, + +$$ +\sum_ {t = 1} ^ {T _ {\text {s t o p}}} g _ {t} (\boldsymbol {\theta} _ {t}) \geqslant \sum_ {t = 1} ^ {T _ {\text {s t o p}}} g _ {t} (\boldsymbol {\theta} ^ {*}) - R _ {D} (T _ {\text {s t o p}}) \geqslant \sum_ {t = 1} ^ {T _ {\text {s t o p}}} g _ {t} (\mathbf {0}) - R _ {D} (T _ {\text {s t o p}}) = 0 - R _ {D} (T _ {\text {s t o p}}) = B \left(1 - \frac {T _ {\text {s t o p}}}{T}\right) - R _ {D} (T _ {\text {s t o p}}). +$$ + +Therefore, from the results for case 1 and case 2, we get, + +$$ +\sum_ {t = 1} ^ {T _ {\text {s t o p}}} g _ {t} \left(\theta_ {t}\right) \geqslant B \left(1 - \frac {T _ {\text {s t o p}}}{T}\right) - \beta T _ {0} - R _ {D} \left(T _ {\text {s t o p}}\right). \tag {63} +$$ + +Therefore from (62) and (63) we get the following advertised result, + +$$ +\mathbb {E} _ {X} \left[ \gamma_ {a} (\tau) - \gamma_ {\pi} (\tau) \right] \geqslant B \left(1 - \frac {T _ {\text {s t o p}}}{T}\right) - \beta T _ {0} - R _ {D} \left(T _ {\text {s t o p}}\right). +$$ + +From Proposition 1 we get with probability at least $1 - \delta$ + +$$ +R _ {D} \left(T _ {\text {s t o p}}\right) = O \left(\sqrt {T (\log d)}\right) \leqslant O (R (T)). \tag {64} +$$ + +Also from result of Lemma 1 with probability at least $1 - \delta$ , $\beta$ is bounded with the assumption $\sigma = \Omega(1/\sqrt{m})$ . + +$$ +\beta \leqslant O \left(1 + \sigma \sqrt {m \log (T K / \delta)}\right) \tag {65} +$$ + +From result of Lemma 4, we have with probability at least $1 - \delta$ + +$$ +\frac {\mathrm {O P T} _ {1}}{B} \leqslant Z (T _ {0}) \leqslant \left(\frac {\mathrm {O P T} _ {1}}{B} + 1\right). \tag {66} +$$ + +Therefore, from equations (58), (59), (64), (65), (66) and the result of Lemma 10, with probability at least $1 - 5\delta$ + +$$ +\mathbb {E} _ {X} \left[ \mathrm {R E W} \right] \geqslant \frac {T _ {\text {s t o p}}}{T} \mathrm {O P T} _ {1} - Z B \left(\frac {T _ {\text {s t o p}}}{T} - 1\right) - O \left(\left(\frac {\mathrm {O P T} _ {1}}{B} + 1\right) \beta T _ {0}\right) - O \left(\left(\frac {\mathrm {O P T} _ {1}}{B} + 1\right) R (T)\right). +$$ + +$$ +\mathbb {E} _ {X} [ \mathrm {R E W} ] \geqslant \mathrm {O P T} _ {1} - O \left(\left(\frac {\mathrm {O P T} _ {1}}{B} + 1\right) \beta T _ {0}\right) - O \left(\left(\frac {\mathrm {O P T} _ {1}}{B} + 1\right) R (T)\right), \tag {67} +$$ + +which is the result in expectation. To bound the actual total reward we use the result of Corollary 3 with $z_{t} = \langle \mathbf{x}_{t}(a_{t}) - \mathbb{E}_{X}[\mathbf{x}_{t}(a_{t})],\pmb{\mu}_{*}\rangle$ . The vector $\mathbf{x}_t(a_t) - \mathbb{E}_X[\mathbf{x}_t(a_t)]$ is a sub-Gaussian random vector with sub-Gaussian norm $\| \mathbf{x}_t(a_t) - \mathbb{E}_X[\mathbf{x}_t(a_t)]\|_{\psi_2} = \sup_{u\in S^{m - 1}}\| \langle \mathbf{x}_t(a_t) - \mathbb{E}_X[\mathbf{x}_t(a_t)],u\rangle \|_{\psi_2}\leqslant c_1(1 + \sigma)$ . Therefore $z_{t} = \langle \mathbf{x}_{t}(a_{t}) - \mathbb{E}_{X}[\mathbf{x}_{t}(a_{t})],\pmb{\mu}_{*}\rangle$ is a $c_{2}(1 + \sigma)$ sub-Gaussian random variable. Therefore applying Corollary 3 we get with probability at least $1 - \delta$ , + +$$ +\operatorname {R E W} \geqslant \mathbb {E} _ {X} [ \operatorname {R E W} ] - O (\sqrt {T \log (1 / \delta)}) \geqslant \mathbb {E} _ {X} [ \operatorname {R E W} ] - O (R (T)). \tag {68} +$$ + +Combining equations (67), (68) gives the advertised result. + +# F. Regret for Smoothed Adversarial Linear Bandits with Knapsacks + +Theorem 3 Assume $B \geqslant \Omega(T^{3/4})$ . Then with probability at least $1 - 6\delta$ following is a lower bound on the reward obtained by the greedy algorithm + +$$ +\operatorname {R E W} \geqslant \frac {\operatorname {O P T} _ {2}}{1 6 d [ \log T ]} - O \left(\left(\frac {\operatorname {O P T} _ {2}}{B} + 1\right) R (T)\right), \tag {25} +$$ + +where $R(T) = O\left(\frac{\left(w(A) + \sqrt{\log(Td) / \delta}\right)\beta\sqrt{T}\log K}{\sigma}\right)$ . + +Proof: We first show that by design resource consumption is not exceeded over the $T$ time steps. The algorithm allocates a budget $B_0 = B'/2\lceil \log T \rceil$ to each epoch. $\lceil \log T \rceil$ is the maximum number of epochs, so a budget of $B'/2$ is allocated for running the greedy algorithm. The other $B'/2$ budget is allocated for the random exploration rounds in each epoch once any of the resource consumption exceeds $B_0$ . In the random exploration rounds an arm is chosen uniformly at random with probability $T^{-1/4}$ . Therefore with $T$ rounds with probability $1 - \delta$ at most $T^{3/4} + 3\sqrt{T^{3/4} \log(1/\delta)}$ rounds are random exploration rounds. Therefore if $B > 4T^{3/4}$ resource consumptions are not exceeded over the $T$ time steps. + +We now focus on the last completed epoch of the algorithm from time step $T_{1}$ to $T_{2}$ . Let $\kappa$ be the value of parameter $j$ in the algorithm during time step $T_{1}$ . Therefore, we have the following relationships with $\widehat{\mathrm{OPT}}(T_{1};\omega(T_{1}))$ , $\widehat{\mathrm{OPT}}(T_{2};\omega(T_{2}))$ , $\widehat{\mathrm{OPT}}(T; \omega(T))$ denoting the maximum reward that can be obtained using only contexts before time steps $T_{1}, T_{2}, T$ respectively. + +$\widehat{\mathrm{OPT}}(T; \omega(T)) \leqslant 2^{\kappa + 2}$ since a new epoch was not started after $T_2$ + +$\widehat{\mathrm{OPT}}(T_2; \omega(T_2)) \geqslant 2^{\kappa + 1}$ a new epoch begins at time step $T_2$ + +$2^{\kappa} \leqslant \widehat{\mathrm{OPT}}(T_1; \omega(T_1)) < 2^{\kappa} + 2\beta$ a new epoch begins at time step $T_1$ , reward bounded by $\beta$ . (69) + +Also using estimation error bounds for $\widehat{\mathrm{OPT}}(T; \omega(T))$ , $\widehat{\mathrm{OPT}}(T_1; \omega(T_1))$ and $\widehat{\mathrm{OPT}}(T_2; \omega(T_2))$ from Lemma 4 with probability at least $1 - \delta$ , + +$$ +\operatorname {O P T} (T; \omega (T)) - 2 R (T) \leqslant \widehat {\operatorname {O P T}} (T; \omega (T)) \leqslant \operatorname {O P T} (T; \omega (T)) + 9 R (T) \left(\frac {\operatorname {O P T} (T ; \omega (T))}{B} + 1\right) +$$ + +$$ +\operatorname {O P T} \left(T _ {1}; \omega \left(T _ {1}\right)\right) - 2 R (T) \leqslant \widehat {\operatorname {O P T}} \left(T _ {1}; \omega \left(T _ {1}\right)\right) \leqslant \operatorname {O P T} \left(T _ {1}; \omega \left(T _ {1}\right)\right) + 9 R (T) \left(\frac {\operatorname {O P T} \left(T _ {1} ; \omega \left(T _ {1}\right)\right)}{B} + 1\right) +$$ + +$$ +\operatorname {O P T} \left(T _ {2}; \omega \left(T _ {2}\right)\right) - 2 R (T) \leqslant \widehat {\operatorname {O P T}} \left(T _ {2}; \omega \left(T _ {2}\right)\right) \leqslant \operatorname {O P T} \left(T _ {2}; \omega \left(T _ {2}\right)\right) + 9 R (T) \left(\frac {\operatorname {O P T} \left(T _ {2} ; \omega \left(T _ {2}\right)\right)}{B} + 1\right), \tag {70} +$$ + +where $\mathrm{OPT}(T;\omega (T))$ , $\mathrm{OPT}(T_1;\omega (T_1))$ , $\mathrm{OPT}(T_2;\omega (T_2))$ are the optimal values computed at time step $T, T_1, T_2$ using observed data before $T, T_1, T_2$ respectively. Also $Z(T_{1})$ for the last completed epoch is set at the beginning of round $T_{1}$ . + +$$ +Z \left(T _ {1}\right) = \frac {\widehat {\operatorname {O P T}} \left(T _ {1} ; \omega \left(T _ {1}\right)\right)}{2 d B}. \tag {71} +$$ + +We now focus on analyzing the performance of the algorithm during the last completed epoch. Let $T_{\mathrm{stop}} \leqslant T_2$ denote the stopping time. $T_{\mathrm{stop}} = T_2$ if no resource is exhausted else the first time step when any resource consumption exceeds the allocation $B_0$ . + +Case 1: $T_{\mathrm{stop}} < T_2$ + +By Theorem 1 and 9, + +$$ +\sum_ {t = T _ {1}} ^ {T _ {\text {s t o p}}} \left\langle \boldsymbol {\mu} _ {*}, \mathbf {x} _ {t} \left(a _ {t}\right) \right\rangle \geqslant \gamma_ {a} \left(T _ {1}, T _ {\text {s t o p}}\right) - O \left(Z \left(T _ {1}\right) R (T)\right), \tag {72} +$$ + +where $\gamma_{a}(T_{1}, T_{\mathrm{stop}}) = \sum_{t=T_{1}}^{T_{\mathrm{stop}}} \langle W_{*}^{\mathsf{T}} \mathbf{x}_{t}(a_{t}), \boldsymbol{\theta}_{t} \rangle$ . Since $\mathbb{E}\big[\mathbf{v}_{t}(a_{t}) | X_{t}, a_{t}, H_{t-1}\big] = W_{*}^{\mathsf{T}} \mathbf{x}_{t}(a_{t})$ and therefore by Azuma-Hoeffding $\| \sum_{t=T_{1}}^{T_{\mathrm{stop}}} \mathbf{v}_{t}(a_{t}) - W_{*}^{\mathsf{T}} \mathbf{x}_{t}(a_{t}) \|_{\infty} \leqslant R(T)$ . Therefore to bound $\gamma_{a}(T_{\mathrm{stop}})$ we will bound $\langle \mathbf{v}_{t}(a_{t}), \boldsymbol{\theta}_{t} \rangle$ . For the dual OCO algorithm with $g_{t}(\boldsymbol{\theta}_{t}) = \langle \boldsymbol{\theta}_{t}, (\mathbf{v}_{t}(a_{t}) - \frac{B_{0}}{T} \mathbf{1}) \rangle$ , let $\boldsymbol{\theta}^{*} = \underset{\boldsymbol{\theta}: \| \boldsymbol{\theta} \|_{1} = 1, \boldsymbol{\theta}_{i} \geqslant 0}{\mathrm{argmax}} \sum_{t=T_{1}}^{T_{\mathrm{stop}}} g_{t}(\boldsymbol{\theta})$ . Therefore, due to the OCO algorithm bounds with probability at least $1 - \delta$ , + +$$ +\sum_ {t = T _ {1}} ^ {T _ {\text {s t o p}}} g _ {t} \left(\boldsymbol {\theta} _ {t}\right) \geqslant \sum_ {t = T _ {1}} ^ {T _ {\text {s t o p}}} g _ {t} \left(\boldsymbol {\theta} ^ {*}\right) - R _ {D} \left(T _ {\text {s t o p}}\right) \Rightarrow \sum_ {t = T _ {1}} ^ {T _ {\text {s t o p}}} \left\langle \mathbf {v} _ {t} \left(a _ {t}\right), \boldsymbol {\theta} _ {t} \right\rangle \geqslant \sum_ {t = T _ {1}} ^ {T _ {\text {s t o p}}} \left\langle \mathbf {v} _ {t} \left(a _ {t}\right), \boldsymbol {\theta} ^ {*} \right\rangle - R _ {D} \left(T _ {\text {s t o p}}\right), \tag {73} +$$ + +where $R_{D}(T_{\mathrm{stop}})$ is the dual OCO algorithm regret. Now since $\theta^{*}$ maximizes the objective, for some $1 \leqslant i \leqslant d$ , + +$$ +\sum_ {t = T _ {1}} ^ {T _ {\text {s t o p}}} \left\langle \mathbf {v} _ {t} \left(a _ {t}\right), \boldsymbol {\theta} ^ {*} \right\rangle \geqslant \sum_ {t = T _ {1}} ^ {T _ {\text {s t o p}}} \left\langle \mathbf {v} _ {t} \left(a _ {t}\right), \mathbf {e} _ {i} \right\rangle \geqslant B _ {0}. \tag {74} +$$ + +Since $R_{D}(\tau)\leqslant R(T)$ from equation (72) we get the following, + +$$ +\sum_ {t = T _ {1}} ^ {T _ {\text {s t o p}}} \left\langle \boldsymbol {\mu} _ {*}, \mathbf {x} _ {t} \left(a _ {t}\right) \right\rangle \geqslant Z \left(T _ {1}\right) B _ {0} - O \left(Z \left(T _ {1}\right) R (T)\right). \tag {75} +$$ + +Case 2: $T_{\mathrm{stop}} = T_2$ + +Denote the total optimal reward by $\mathrm{OPT}(T_1, T_2; \omega(T_2))$ which is the optimal reward between time steps $T_1$ and $T_2$ computed with reference to time step $T_2$ using all observed data before $T_2$ . By Theorem 1 and 9, + +$$ +\operatorname {R E W} = \operatorname {O P T} \left(T _ {1}, T _ {2}; \omega \left(T _ {2}\right)\right) - Z \left(T _ {1}\right) \gamma_ {1} \left(T _ {2}\right) + Z \left(T _ {1}\right) \gamma_ {2} \left(T _ {2}\right) - O \left(Z \left(T _ {1}\right) R (T)\right). \tag {76} +$$ + +The following is always true, + +$$ +\gamma_ {1} \left(T _ {2}\right) = \sum_ {t = T _ {1}} ^ {T _ {2}} \left\langle W _ {*} X _ {t} \pi^ {*} \left(X _ {t}; \omega \left(T _ {2}\right)\right), \boldsymbol {\theta} _ {t} \right\rangle \leqslant d B. \tag {77} +$$ + +Also applying OCO regret bounds with probability at least $1 - \delta$ + +$$ +\gamma_ {1} \left(T _ {2}\right) \geqslant - R _ {D} \left(T _ {2}\right), \tag {78} +$$ + +with $R_{D}(T_{2}) = O(R(T))$ . Therefore from (76), (77) and (78), we have + +$$ +\operatorname {R E W} \geqslant \operatorname {O P T} \left(T _ {1}, T _ {2}; \omega \left(T _ {2}\right)\right) - Z \left(T _ {1}\right) d B - O \left(Z \left(T _ {1}\right) R (T)\right). \tag {79} +$$ + +Combining results (75) and (79), + +$$ +\operatorname {R E W} \geqslant \min \left(\operatorname {O P T} \left(T _ {1}, T _ {2}; \omega \left(T _ {2}\right)\right) - Z \left(T _ {1}\right) d B, Z \left(T _ {1}\right) B _ {0}\right) - O \left(Z \left(T _ {1}\right) R (T)\right). \tag {80} +$$ + +Next we focus on expressing $Z(T_{1}), \mathrm{OPT}(T_{1}, T_{2}; \omega(T_{2}))$ in terms of the optimal reward $\mathrm{OPT} = \mathrm{OPT}(T; \omega(T))$ and budget $B$ . Now consider the quantity $\mathrm{OPT}(T_{1}, T_{2}; \omega(T_{2})) - Z(T_{1}) dB$ . + +$$ +\operatorname {O P T} \left(T _ {1}, T _ {2}; \omega \left(T _ {2}\right)\right) - Z \left(T _ {1}\right) d B \geqslant \operatorname {O P T} \left(T _ {2}; \omega \left(T _ {2}\right)\right) - \operatorname {O P T} \left(T _ {1}; \omega \left(T _ {2}\right)\right) - Z \left(T _ {1}\right) d B +$$ + +$$ +\geqslant \mathrm {O P T} (T _ {2}; \omega (T _ {2})) - \widehat {\mathrm {O P T}} (T _ {1}; \omega (T _ {1})) - O (R (T)) - \frac {\widehat {\mathrm {O P T}} (T _ {1} ; \omega (T _ {1}))}{2} +$$ + +....use (71), upper bound for $\widehat{\mathrm{OPT}}(T_1; \omega(T_1))$ from (70) + +$$ +\geqslant \widehat {\mathrm {O P T}} (T _ {2}; \omega (T _ {2})) - O \left(\left(\frac {\mathrm {O P T}}{B} + 1\right) R (T)\right) - \frac {3}{2} \widehat {\mathrm {O P T}} (T _ {1}; \omega (T _ {1})) - O (R (T)) +$$ + +...use lower bound for $\mathrm{OPT}(T_2)$ from (70) + +$$ +\geqslant 2 ^ {\kappa + 1} - \frac {3}{2} 2 ^ {\kappa} - O \left(\left(\frac {\mathrm {O P T}}{B} + 1\right) R (T)\right) +$$ + +....substituting bounds from (69) + +$$ +\geqslant 2 ^ {\kappa + 2} \left(\frac {1}{2} - \frac {3}{8}\right) - O \left(\left(\frac {\mathrm {O P T}}{B} + 1\right) R (T)\right) +$$ + +$$ +\geqslant \frac {2 ^ {\kappa + 2} + O (R (T))}{8} - \frac {O (R (T))}{8} - O \left(\left(\frac {\mathrm {O P T}}{B} + 1\right) R (T)\right) +$$ + +$$ +\geqslant \frac {\mathrm {O P T}}{8} - O \left(\left(\frac {\mathrm {O P T}}{B} + 1\right) R (T)\right) +$$ + +....use upper bound for $\widehat{\mathrm{OPT}}(T; \omega(T))$ from (69), then use (70) (81) + +In the first line above the quantities $\mathrm{OPT}(T_1;\omega (T_2))$ and $\mathrm{OPT}(T_2;\omega (T_2))$ are the optimal reward at time steps $T_{1},T_{2}$ with time step $T_{2}$ as reference.. + +$$ +\pi^ {*} := \operatorname * {a r g m a x} _ {\pi} \sum_ {t = 1} ^ {T _ {2}} \boldsymbol {\mu} _ {*} ^ {\intercal} X _ {t} \pi (X _ {t}; \omega (T _ {2})) \quad \text {s . t .} \quad \sum_ {t = 1} ^ {T _ {2}} W _ {*} ^ {\intercal} X _ {t} \pi (X _ {t}; \omega (T _ {2})) \leqslant B \mathbf {1} +$$ + +$$ +\operatorname {O P T} \left(T _ {1}; \omega \left(T _ {2}\right)\right) = \sum_ {t = 1} ^ {T _ {1}} \boldsymbol {\mu} _ {*} ^ {\intercal} X _ {t} \pi^ {*} \left(X _ {t}; \omega \left(T _ {2}\right)\right) +$$ + +$$ +\operatorname {O P T} \left(T _ {2}; \omega \left(T _ {2}\right)\right) = \sum_ {t = 1} ^ {T _ {2}} \boldsymbol {\mu} _ {*} ^ {\intercal} X _ {t} \pi^ {*} \left(X _ {t}; \omega \left(T _ {2}\right)\right) +$$ + +The first line above is true because we can always assume our algorithm ends at time $T_{2}$ choosing no-op arms after $T_{2}$ . So $\mathrm{OPT}(T_2; \omega(T_2))$ is the maximum reward that can be obtained and reference optimal awards in all time steps before $T_{2}$ to time step $T_{2}$ . Also $\widehat{\mathrm{OPT}}(T_1; \omega(T_1)) \leqslant 2^{\kappa} + 2\beta$ estimated at the end of time step $T_{1}$ is the maximum reward that can be obtained by using all resources and only using contexts before time step $T_{1}$ and hence $\widehat{\mathrm{OPT}}(T_1; \omega(T_2))$ computed at reference time $T_{2}$ is always less than or equal to $2^{\kappa} + 2\beta$ . + +Next consider quantity $Z(T_{1})B_{0}$ . + +$$ +\begin{array}{l} Z (T _ {1}) B _ {0} = \frac {\widehat {\mathrm {O P T}} (T _ {1} ; \omega (T _ {1}))}{2 d B} \\ \geqslant \frac {2 ^ {\kappa}}{4 d [ \log T ]} \dots \text {u s e l o w e r b o u n d f o r} \widehat {\mathrm {O P T}} (T _ {1}; \omega (T _ {1})) \text {f r o m (6 9) ,} B _ {0} = B / 2 [ \log T ] \\ \geqslant \frac {2 ^ {\kappa + 2} + O (R (T))}{1 6 d [ \log T ]} - \frac {O (R (T))}{1 6 d [ \log T ]} \\ \geqslant \frac {2 ^ {\kappa + 2} + O (R (T))}{1 6 d [ \log T ]} - \frac {O (R (T)}{1 6 d [ \log T ]} \\ \geqslant \frac {\operatorname {O P T}}{1 6 d \left[ \log T \right]} - O (R (T)). \tag {82} \\ \end{array} +$$ + +Also, + +$$ +Z \left(T _ {1}\right) = \frac {\widehat {\mathrm {O P T}} \left(T _ {1} ; \omega \left(T _ {1}\right)\right)}{2 d B} \leqslant O \left(\frac {\mathrm {O P T}}{B} + 1\right). \tag {83} +$$ + +Therefore from equations (80), (81), (82), (83), we get + +$$ +\operatorname {R E W} \geqslant \frac {\operatorname {O P T}}{1 6 d \lceil \log T \rceil} - O \left(\left(\frac {\operatorname {O P T}}{B} + 1\right) R (T)\right). \tag {84} +$$ \ No newline at end of file diff --git a/smoothedadversariallinearcontextualbanditswithknapsacks/images.zip b/smoothedadversariallinearcontextualbanditswithknapsacks/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..73a164ea97b7f774ab26bdb0a05ba778a626c01c --- /dev/null +++ b/smoothedadversariallinearcontextualbanditswithknapsacks/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:63fbdb50fccc01733430ed30a2bd9552cc9a11d6258e70f93152df3191eabaa6 +size 1429844 diff --git a/smoothedadversariallinearcontextualbanditswithknapsacks/layout.json b/smoothedadversariallinearcontextualbanditswithknapsacks/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..3983e975805f7e3afbedeb49f54c3b6ea19af7b5 --- /dev/null +++ b/smoothedadversariallinearcontextualbanditswithknapsacks/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:952f25de73d5efcd42a97cc9abd10b3e48273366b66777637fe83679e8cc8555 +size 1321896 diff --git a/softtruncationauniversaltrainingtechniqueofscorebaseddiffusionmodelforhighprecisionscoreestimation/7a72f32c-122b-4263-8f7b-33220236a555_content_list.json b/softtruncationauniversaltrainingtechniqueofscorebaseddiffusionmodelforhighprecisionscoreestimation/7a72f32c-122b-4263-8f7b-33220236a555_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..72703a6248cbfcc35c103b8d780f2bef7c5644ed --- /dev/null +++ b/softtruncationauniversaltrainingtechniqueofscorebaseddiffusionmodelforhighprecisionscoreestimation/7a72f32c-122b-4263-8f7b-33220236a555_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5aac8f19cf0a0fec2fe217bf74866081384a7a9e9e8fa411ba2c2aec1bc4e3d3 +size 183285 diff --git a/softtruncationauniversaltrainingtechniqueofscorebaseddiffusionmodelforhighprecisionscoreestimation/7a72f32c-122b-4263-8f7b-33220236a555_model.json b/softtruncationauniversaltrainingtechniqueofscorebaseddiffusionmodelforhighprecisionscoreestimation/7a72f32c-122b-4263-8f7b-33220236a555_model.json new file mode 100644 index 0000000000000000000000000000000000000000..79356ece0e434f7056bdf4e864d1bc94686bcd07 --- /dev/null +++ b/softtruncationauniversaltrainingtechniqueofscorebaseddiffusionmodelforhighprecisionscoreestimation/7a72f32c-122b-4263-8f7b-33220236a555_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:febbb31dbee484e860f7b7796c9cb914b3ee1f1ea69932229d1066ffc315afa5 +size 210154 diff --git a/softtruncationauniversaltrainingtechniqueofscorebaseddiffusionmodelforhighprecisionscoreestimation/7a72f32c-122b-4263-8f7b-33220236a555_origin.pdf b/softtruncationauniversaltrainingtechniqueofscorebaseddiffusionmodelforhighprecisionscoreestimation/7a72f32c-122b-4263-8f7b-33220236a555_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..554deea521e1a90ef9b68a019849c2f59265611f --- /dev/null +++ b/softtruncationauniversaltrainingtechniqueofscorebaseddiffusionmodelforhighprecisionscoreestimation/7a72f32c-122b-4263-8f7b-33220236a555_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3adabff6dca1138faef1ca996bd462e4c4c33a0669406715292e04000ccd28ab +size 17814257 diff --git a/softtruncationauniversaltrainingtechniqueofscorebaseddiffusionmodelforhighprecisionscoreestimation/full.md b/softtruncationauniversaltrainingtechniqueofscorebaseddiffusionmodelforhighprecisionscoreestimation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..ef14a0dd690b2d58e0218b5ed3f5a41a3600a105 --- /dev/null +++ b/softtruncationauniversaltrainingtechniqueofscorebaseddiffusionmodelforhighprecisionscoreestimation/full.md @@ -0,0 +1,751 @@ +# Soft Truncation: A Universal Training Technique of Score-based Diffusion Model for High Precision Score Estimation + +Dongjun Kim Seungjae Shin Kyungwoo Song Wanmo Kang Il-Chul Moon + +# Abstract + +Recent advances in diffusion models bring state-of-the-art performance on image generation tasks. However, empirical results from previous research in diffusion models imply an inverse correlation between density estimation and sample generation performances. This paper investigates with sufficient empirical evidence that such inverse correlation happens because density estimation is significantly contributed by small diffusion time, whereas sample generation mainly depends on large diffusion time. However, training a score network well across the entire diffusion time is demanding because the loss scale is significantly imbalanced at each diffusion time. For successful training, therefore, we introduce Soft Truncation, a universally applicable training technique for diffusion models, that softens the fixed and static truncation hyperparameter into a random variable. In experiments, Soft Truncation achieves state-of-the-art performance on CIFAR-10, CelebA, CelebA-HQ $256 \times 256$ , and STL-10 datasets. + +# 1. Introduction + +Recent advances in generative models enable the creation of highly realistic images. One direction of such modeling is likelihood-free models (Karras et al., 2019) based on minimax training. The other direction is likelihood-based models, including VAE (Vahdat & Kautz, 2020), autoregressive models (Parmar et al., 2018), and flow models (Grcic et al., 2021). Diffusion models (Ho et al., 2020) are one of the most successful likelihood-based models, where the reverse diffusion models the generative process. The success of diffusion models achieves state-of-the-art performance in image generation (Dhariwal & Nichol, 2021). + +$^{1}$ KAIST, South Korea $^{2}$ University of Seoul, South Korea $^{3}$ Summary.AI. Correspondence to: Dongjun Kim . + +Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s). + +Previously, a model with the emphasis on Fréchet Inception Distance (FID), such as DDPM (Ho et al., 2020) and ADM (Dhariwal & Nichol, 2021), trains the score network with the variance weighting; whereas a model with the emphasis on Negative Log-Likelihood (NLL), such as ScoreFlow (Song et al., 2021a) and VDM (Kingma et al., 2021), trains the score network with the likelihood weighting. Such models, however, have the trade-off between NLL and FID: models with the emphasis on FID perform poorly on NLL, and vice versa. Instead of widely investigating the trade-off, they limit their work by separately training the score network on FID-favorable and NLL-favorable settings. This paper introduces Soft Truncation that significantly resolves the trade-off, with the NLL-favorable setting as the default training configuration. Soft Truncation reports a comparable FID against FID-favorable diffusion models while keeping NLL at the equivalent level of NLL-favorable models. + +For that, we observe that the truncation hyperparameter is a significant hyperparameter that determines the overall scale of NLL and FID. This hyperparameter, $\epsilon$ , is the smallest diffusion time to estimate the score function, and the score function beneath $\epsilon$ is not estimated. A model with small enough $\epsilon$ favors NLL at the sacrifice on FID, and a model with relatively large $\epsilon$ is preferable to FID but has poor NLL. Therefore, we introduce Soft Truncation, which softens the fixed and static truncation hyperparameter $(\epsilon)$ into a random variable $(\tau)$ that randomly selects its smallest diffusion time at every optimization step. In every mini-batch update, we sample a new smallest diffusion time, $\tau$ , randomly, and the batch optimization endeavors to estimate the score function only on $[\tau, T]$ , rather than $[\epsilon, T]$ , by ignoring beneath $\tau$ . As $\tau$ varies by mini-batch updates, the score network successfully estimates the score function on the entire range of diffusion time on $[\epsilon, T]$ , which brings an improved FID. + +There are two interesting properties of Soft Truncation. First, though Soft Truncation is nothing to do with the weighting function in its algorithmic design, surprisingly, Soft Truncation turns out to be equivalent to a diffusion model with a general weight in the expectation sense (Eq. (10)). The random variable of $\tau$ determines the weight function (Theorem 1), and this gives a partial reason why Soft Truncation is successful in FID as much as the FID-favorable train + +ing (Table 4), even though Soft Truncation only considers the truncation threshold in its implementation (Section 4.2). Second, once $\tau$ is sampled in a mini-batch optimization, Soft Truncation optimizes the log-likelihood perturbed by $\tau$ (Lemma 1). Thus, Soft Truncation could be framed by Maximum Perturbed Likelihood Estimation (MLE), a generalized concept of MLE that is specifically defined only in diffusion models (Section 4.4). + +# 2. Preliminary + +Throughout this paper, we focus on continuous-time diffusion models (Song et al., 2021b). A continuous diffusion model slowly and systematically perturbs a data random variable, $\mathbf{x}_0$ , into a noise variable, $\mathbf{x}_T$ , as time flows. The diffusion mechanism is represented as a Stochastic Differential Equation (SDE), written by + +$$ +\mathrm {d} \mathbf {x} _ {t} = \mathbf {f} \left(\mathbf {x} _ {t}, t\right) \mathrm {d} t + g (t) \mathrm {d} \mathbf {w} _ {t}, \tag {1} +$$ + +where $\mathbf{w}_t$ is a standard Wiener process. The drift (f) and the diffusion $(g)$ terms are fixed, so the data variable is diffused in a fixed manner. We denote $\{\mathbf{x}_t\}_{t=0}^T$ as the solution of the given SDE of Eq. (1), and we omit the subscript and superscript to denote $\{\mathbf{x}_t\}$ , if no confusion is arises. + +The theory of stochastic calculus indicates that there exists a corresponding reverse SDE given by + +$$ +\mathrm {d} \mathbf {x} _ {t} = \left[ \mathbf {f} \left(\mathbf {x} _ {t}, t\right) - g ^ {2} (t) \nabla \log p _ {t} \left(\mathbf {x} _ {t}\right) \right] \mathrm {d} \bar {t} + g (t) \mathrm {d} \bar {\mathbf {w}} _ {t}, \tag {2} +$$ + +where the solution of this reverse SDE exactly coincides to the solution of the forward SDE of Eq. (1). Here, $\mathrm{d}\bar{t}$ is the backward time differential; $\mathrm{d}\bar{\mathbf{w}}_t$ is a standard Wiener process flowing backward in time (Anderson, 1982); and $p_t(\mathbf{x}_t)$ is the probability distribution of $\mathbf{x}_t$ . Henceforth, we represent $\{\mathbf{x}_t\}$ as the solution of SDEs of Eqs. (1) and (2). + +The diffusion model's objective is to learn the stochastic process, $\{\mathbf{x}_t\}$ , as a parametrized stochastic process, $\{\mathbf{x}_t^\theta\}$ . A diffusion model builds the parametrized stochastic process as a solution of a generative SDE, + +$$ +\mathrm {d} \mathbf {x} _ {t} ^ {\boldsymbol {\theta}} = \left[ \mathbf {f} \left(\mathbf {x} _ {t} ^ {\boldsymbol {\theta}}, t\right) - g ^ {2} (t) \mathbf {s} _ {\boldsymbol {\theta}} \left(\mathbf {x} _ {t} ^ {\boldsymbol {\theta}}, t\right) \right] \mathrm {d} \bar {t} + g (t) \mathrm {d} \bar {\mathbf {w}} _ {t}. \tag {3} +$$ + +We construct the parametrized stochastic process by solving the generative SDE of Eq. (3) backward in time with a starting variable of $\mathbf{x}_T^\theta \sim \pi$ , where $\pi$ is an noise distribution. Throughout the paper, we denote $p_t^\theta$ as the probability distribution of $\mathbf{x}_t^\theta$ . + +A diffusion model learns the generative stochastic process by minimizing the score loss (Song et al., 2021a) of + +$$ +\mathcal {L} (\boldsymbol {\theta}; \lambda) = \frac {1}{2} \int_ {0} ^ {T} \lambda (t) \mathbb {E} _ {\mathbf {x} _ {t}} \left[ \| \mathbf {s} _ {\boldsymbol {\theta}} (\mathbf {x} _ {t}, t) - \nabla \log p _ {t} (\mathbf {x} _ {t}) \| _ {2} ^ {2} \right] d t, +$$ + +where $\lambda (t)$ is a weighting function that counts the contribution of each diffusion time on the loss function. This + +score loss is infeasible to optimize because the data score, $\nabla \log p_t(\mathbf{x}_t)$ , is intractable in general. Fortunately, $\mathcal{L}(\pmb{\theta};\lambda)$ is known to be equivalent to the (continuous) denoising NCSN loss (Song et al., 2021b; Song & Ermon, 2019), + +$$ +\begin{array}{l} \mathcal {L} _ {N C S N} (\boldsymbol {\theta}; \lambda) \\ = \frac {1}{2} \int_ {0} ^ {T} \lambda (t) \mathbb {E} _ {\mathbf {x} _ {0}, \mathbf {x} _ {t}} \left[ \| \mathbf {s} _ {\boldsymbol {\theta}} (\mathbf {x} _ {t}, t) - \nabla \log p _ {0 t} (\mathbf {x} _ {t} | \mathbf {x} _ {0}) \| _ {2} ^ {2} \right] d t, \\ \end{array} +$$ + +up to a constant that is irrelevant to $\theta$ -optimization. + +Two important SDEs are known to attain analytic transition probabilities, $\log p_{0t}(\mathbf{x}_t|\mathbf{x}_0)$ : Variance Exploding SDE (VESDE) and Variance Preserving SDE (VPSDE) (Song et al., 2021b). First, VESDE assumes $\mathbf{f}(\mathbf{x}_t,t) = 0$ and $g(t) = \sigma_{min}(\frac{\sigma_{max}}{\sigma_{min}})^t\sqrt{2\log\frac{\sigma_{max}}{\sigma_{min}}}$ . With such specific forms of $\mathbf{f}$ and $g$ , the transition probability of VESDE turns out to follow a Gaussian distribution of $p_{0t}(\mathbf{x}_t|\mathbf{x}_0) = \mathcal{N}(\mathbf{x}_t;\mu_{VE}(t)\mathbf{x}_0,\sigma_{VE}^2 (t)\mathbf{I})$ with $\mu_{VE}(t)\equiv 1$ and $\sigma_{VE}^{2}(t) = \sigma_{min}^{2}[(\frac{\sigma_{max}}{\sigma_{min}})^{2t} - 1]$ . Similarly, VPSDE takes $\mathbf{f}(\mathbf{x}_t,t) = -\frac{1}{2}\beta (t)\mathbf{x}_t$ and $g(t) = \sqrt{\beta(t)}$ , where $\beta (t) = \beta_{min} + t(\beta_{max} - \beta_{min})$ ; and its transition probability falls into a Gaussian distribution of $p_{0t}(\mathbf{x}_t|\mathbf{x}_0) = \mathcal{N}(\mathbf{x}_t;\mu_{VP}(t)\mathbf{x}_0,\sigma_{VP}^2\mathbf{I})$ with $\mu_{VP}(t) = e^{-\frac{1}{2}\int_0^t\beta (s)\mathrm{d}s}$ and $\sigma_{VP}^{2}(t) = 1 - e^{-\int_{0}^{t}\beta (s)\mathrm{d}s}$ . + +Recently, Kim et al. (2022) categorize VESDE and VPSDE as a family of linear diffusions that has the SDE of + +$$ +\mathrm {d} \mathbf {x} _ {t} = - \frac {1}{2} \beta (t) \mathbf {x} _ {t} \mathrm {d} t + g (t) \mathrm {d} \mathbf {w} _ {t}, \tag {4} +$$ + +where $\beta(t)$ and $g(t)$ are generic $t$ -functions. Under the linear diffusions, we derive the transition probability to follow a Gaussian distribution $p_{0t}(\mathbf{x}_t|\mathbf{x}_0) = \mathcal{N}(\mathbf{x}_t;\mu(t)\mathbf{x}_0,\sigma^2(t)\mathbf{I})$ for certain $\mu(t)$ and $\sigma(t)$ depending on $\beta(t)$ and $g(t)$ , respectively (see Eq. (16) of Appendix A.1). We emphasize that the suggested Soft Truncation is applicable for any SDE of Eq. (1), but we limit our focus to the family of linear SDEs of Eq. (4), particularly VESDE and VPSDE among linear SDEs, to maintain the simplicity. With such a Gaussian transition probability, the denoising NCSN loss with a linear SDE is equivalent to + +$$ +\frac {1}{2} \int_ {0} ^ {T} \frac {\lambda (t)}{\sigma^ {2} (t)} \mathbb {E} _ {\mathbf {x} _ {0}, \epsilon} \left[ \| \epsilon_ {\boldsymbol {\theta}} (\mu (t) \mathbf {x} _ {0} + \sigma (t) \boldsymbol {\epsilon}, t) - \epsilon \| _ {2} ^ {2} \right] d t, +$$ + +if $\epsilon_{\theta}(\mu(t)\mathbf{x}_0 + \sigma(t)\epsilon, t) = -\sigma(t)\mathbf{s}_{\theta}(\mu(t)\mathbf{x}_0 + \sigma(t)\epsilon, t)$ , where $\epsilon \sim \mathcal{N}(0, \mathbf{I})$ is a random perturbation, and $\epsilon_{\theta}$ is the neural network that predicts $\epsilon$ . This is the (continuous) DDPM loss (Song et al., 2021b), and the equivalence of the two losses provides a unified view of NCSN and DDPM. Hence, NCSN and DDPM are exchangeable for each other, and we take the NCSN loss as a default form of a diffusion loss throughout the paper. + +![](images/88a43f02ec87895da41c4453c16c589cee15695ec921f21e8b37dc8f31208d1f.jpg) +(a) Integrand by Time + +![](images/35b59bf70b550187fc69b4b3160d6926f6cf09b70ec0b801e14e30295993d322.jpg) +(b) Variational Bound Truncated at $\tau$ + +![](images/be46d1f0206f7342274efbfbb3a2909108f06c6bbea7638fd9b2d0024cc5149a.jpg) +(c) Test Performance by Log-Time + +The NCSN loss training is connected to the likelihood training in Song et al. (2021a) by + +$$ +\mathbb {E} _ {\mathbf {x} _ {0}} \left[ - \log p _ {0} ^ {\boldsymbol {\theta}} \left(\mathbf {x} _ {0}\right) \right] \leq \mathcal {L} _ {N C S N} \left(\boldsymbol {\theta}; g ^ {2}\right), \tag {5} +$$ + +when the weighting function is the square of the diffusion term as $\lambda (t) = g^{2}(t)$ , called the likelihood weighting. + +# 3. Training and Evaluation of Diffusion Models in Practice + +# 3.1. The Need of Truncation + +In the family of linear SDEs, the gradient of the log transition probability satisfies $\nabla \log p_{0t}(\mathbf{x}_t|\mathbf{x}_0) = -\frac{\mathbf{x}_t - \mu(t)\mathbf{x}_0}{\sigma^2(t)} = -\frac{\mathbf{z}}{\sigma(t)}$ , where $\mathbf{x}_t$ is given to $\mu (t)\mathbf{x}_0 + \sigma (t)\mathbf{z}$ with $\mathbf{z}\sim \mathcal{N}(0,\mathbf{I})$ . The denominator of $\sigma (t)$ converges to zero as $t\to 0$ , which leads $\| \mathbf{s}_{\theta}(\mathbf{x}_t,t) - \nabla \log p_{0t}(\mathbf{x}_t|\mathbf{x}_0)\| _2$ to diverge as $t\to 0$ , as illustrated in Figure 1-(a), see Appendix A.2 for details. Therefore, the Monte-Carlo estimation of the NCSN loss is under high variance, which prevents stable training of the score network. In practice, therefore, previous research truncates the diffusion time range to $[\tau ,T]$ , with a positive truncation hyperparameter, $\tau = \epsilon >0$ + +# 3.2. Variational Bound With Positive Truncation + +For the analysis for density estimation in Section 3.3, this section derives the variational bound of the log-likelihood when a diffusion model has a positive truncation because Inequality (5) holds only with zero truncation $(\tau = 0)$ . Lemma 1 provides a generalization of Inequality (5), proved by applying the data processing inequality (Gerchinovitz et al., 2020) and the Girsanov theorem (Pavon & Wakolbinger, 1991; Vargas et al., 2021; Song et al., 2021a). + +Lemma 1. For any $\tau \in [0,T]$ + +$$ +\mathbb {E} _ {\mathbf {x} _ {\tau}} \left[ - \log p _ {\tau} ^ {\boldsymbol {\theta}} (\mathbf {x} _ {\tau}) \right] \leq \mathcal {L} (\boldsymbol {\theta}; g ^ {2}, \tau) \tag {6} +$$ + +holds, where $\mathcal{L}(\pmb{\theta}; g^2, \tau) = \frac{1}{2} \int_{\tau}^{T} g^2(t) \mathbb{E}_{\mathbf{x}_0, \mathbf{x}_t} \left[ \| \mathbf{s}_{\pmb{\theta}}(\mathbf{x}_t, t) - \nabla \log p_{0t}(\mathbf{x}_t | \mathbf{x}_0) \|_2^2 \right] \mathrm{d}t$ , up to a constant, see Eq. (17). + +![](images/6eb0556ad3776795862b0f31bc6a8ab95cae60516be48bcc8ef1ac6454995bb2.jpg) +Figure 1: The contribution of diffusion time on the variational bound experimented on CIFAR-10 with DDPM++ (VP, NLL) (Song et al., 2021a). (a) The integrand of the variational bound is extremely imbalanced on $[\epsilon, T]$ . (b) The truncated variational bound only changes near $\tau \approx 0$ . (c) The truncation hyperparameter $(\epsilon)$ is a significant factor for performances. +Figure 2: The truncation time is key to enhance the microscopic sample quality. + +Lemma 1 is a generalization of Inequality (5) in that Inequality (6) collapses to Inequality (5) under the zero truncation: $\mathcal{L}_{NCSN}(\pmb {\theta};\lambda) = \mathcal{L}(\pmb {\theta};\lambda ,\tau = 0)$ . If the time range is truncated to $[\tau ,T]$ for $\tau \in [0,T]$ , then from the variational inference, the log-likelihood becomes + +$$ +\mathbb {E} _ {\mathbf {x} _ {0}} \left[ - \log p _ {0} ^ {\boldsymbol {\theta}} (\mathbf {x} _ {0}) \right] \leq \mathbb {E} _ {\mathbf {x} _ {\tau}} \left[ - \log p _ {\boldsymbol {\theta}} ^ {\boldsymbol {\theta}} \left(\mathbf {x} _ {\tau}\right) \right] + R _ {\tau} (\boldsymbol {\theta}) \tag {7} +$$ + +where + +$$ +R _ {\tau} (\boldsymbol {\theta}) = \mathbb {E} _ {\mathbf {x} _ {0}} \left[ \int p _ {0 \tau} \left(\mathbf {x} _ {\tau} \mid \mathbf {x} _ {0}\right) \log \frac {p _ {0 \tau} \left(\mathbf {x} _ {\tau} \mid \mathbf {x} _ {0}\right)}{p _ {\boldsymbol {\theta}} \left(\mathbf {x} _ {0} \mid \mathbf {x} _ {\tau}\right)} \mathrm {d} \mathbf {x} _ {\tau} \right], +$$ + +with $p_{\theta}(\mathbf{x}_0|\mathbf{x}_{\tau})$ being the probability distribution of $\mathbf{x}_0$ given $\mathbf{x}_{\tau}$ and the score estimation with $\mathbf{s}_{\theta}$ at $\tau$ . For any $\tau$ , we apply Lemma 1 to the right-hand-side of Inequality (7) to obtain the variational bound of the log-likelihood as + +$$ +\mathbb {E} _ {\mathbf {x} _ {0}} \left[ - \log p _ {0} ^ {\boldsymbol {\theta}} (\mathbf {x} _ {0}) \right] \leq \mathcal {L} (\boldsymbol {\theta}; g ^ {2}, \tau) + R _ {\tau} (\boldsymbol {\theta}). \tag {8} +$$ + +# 3.3. A Universal Phenomenon in Diffusion Training: Extremely Imbalanced Loss + +To avoid the diverging issue introduced in Section 3.1, previous works in VPSDE (Song et al., 2021a; Vahdat et al., 2021) modify the loss by truncating the integration on $[\tau, T]$ with a fixed hyperparameter $\tau = \epsilon > 0$ so that the score network does not estimate the score function on $[0, \epsilon)$ . Analogously, previous works in VESDE (Song et al., 2021b; Chen et al., 2022) approximate $\sigma_{VE}^{2}(t) \approx \sigma_{min}^{2}\left(\frac{\sigma_{max}}{\sigma_{min}}\right)^{2t}$ to truncate the minimum variance of the transition probability to be $\sigma_{min}^{2}$ . Truncating diffusion time at $\epsilon$ in VPSDE is equivalent to + +![](images/d8c46f1f4ff9150421d51a585313b9d64d9c586309c0224ff32d538ac419034d.jpg) +Figure 3: Illustration of the generative process trained on CelebA-HQ $256 \times 256$ with NCSN++ (VE) (Song et al., 2021b). The score precision on large diffusion time is key to construct the realistic overall sample quality. + +![](images/a47eba700eb76a0badd44071901d9650a41a3b0ed72c488a8a0595b094e1172a.jpg) +Figure 4: Norm of reverse drift of generative process, trained on CIFAR-10 with DDPM++ (VP, FID) (Song et al., 2021b). + +truncating diffusion variance $(\sigma_{min}^{2})$ in VESDE, so these two truncations on VE/VP SDEs have the identical effect on bounding the diffusion loss. Henceforth, this paper discusses the argument of truncating diffusion time (VPSDE) and diffusion variance (VESDE) exchangeably. + +Figure 1 illustrates the significance of truncation in the training of diffusion models. With the truncation of strictly positive $\epsilon = 10^{-5}$ , Figure 1-(a) shows that the integrand of $\mathcal{L}(\theta; g^2, \tau)$ in the Bits-Per-Dimension (BPD) scale is still extremely imbalanced. It turns out that such extreme imbalance appears to be a universal phenomenon in training a diffusion model, and this phenomenon lasts from the beginning to the end of training. + +Figure 1-(b) with the green line presents the variational bound of the log-likelihood (right-hand-side of Inequality (8)) on the $y$ -axis, and it indicates that the variational bound is sharply decreasing near the small diffusion time. Therefore, if $\epsilon$ is insufficiently small, the variational bound is not tight to the log-likelihood, and a diffusion model fails at MLE training. In addition, Figure 2 indicates that insufficiently small $\epsilon$ (or $\sigma_{min}$ ) would also harm the microscopic sample quality. From these observations, $\epsilon$ becomes a significant hyperparameter that needs to be selected carefully. + +# 3.4. Effect of Truncation on Model Evaluation + +Figure 1-(c) reports test performances on density estimation. Figure 1-(c) illustrates that both Negative Evidence Lower Bound (NELBO) and NLL monotonically decrease + +![](images/a7736299b465a3c9c63896cba6034e45c0747edc8564c6ce6a7215ebe80b2f21.jpg) +Figure 5: Regenerated samples synthesized by solving the probability flow ODE on $[\epsilon, \tau]$ backwards with the initial point of $\mathbf{x}_{\tau} = \mu(\tau)\mathbf{x}_0 + \sigma(\tau)\mathbf{z}$ for $\mathbf{z} \sim \mathcal{N}(0, \mathbf{I})$ , trained on CelebA with DDPM++ (VP, FID) (Song et al., 2021b). + +by lowering $\epsilon$ because NELBO is largely contributed by small diffusion time at test time as well as training time. Therefore, it could be a common strategy to reduce $\epsilon$ as much as possible to reduce test NELBO/NLL. + +On the contrary, there is a counter effect on FID for $\epsilon$ . Table 1, trained on CIFAR-10 (Krizhevsky et al., 2009) with NCSN++ (Song et al., 2021b), presents that FID is worsened as we take smaller hyperparameter $\sigma_{min}$ for + +Table 1: Ablation on ${\sigma }_{\min }$ . + +
σminCIFAR-10
NLL (↓)FID-10k (↓)
10-24.956.95
10-33.047.04
10-42.998.17
10-52.978.29
+ +the training. It is the range of small diffusion time that significantly contributes to the variational bound in the blue line of Figure 1-(b), so the score network with a small truncation hyperparameter, $\sigma_{min}$ or $\epsilon$ , remains unoptimized on large diffusion time. In the lens of Figure 2, therefore, the inconsistent result of Table 1 is attributed to the inaccurate score on large diffusion time. + +We design an experiment to validate the above argument in Table 2. This experiment utilizes two types of score networks: 1) + +Table 2: FID-10k scores. + +
σmin10-310-410-5
σtr=16.848.048.29
+ +three alternative networks (As) with diverse $\sigma_{min} \in \{10^{-3}, 10^{-4}, 10^{-5}\}$ trained in Table 1 experiment; 2) a network (B) with $\sigma_{min} = 10^{-5}$ (the last row of Table 1). With these score networks, we denoise the noises by either one of the first-typed As from $\sigma_{max}$ to a common and fixed $\sigma_{tr}(= 1)$ , and we use B to further denoise from $\sigma_{tr}$ to $\sigma_{min} = 10^{-5}$ . This further denoising step with model B enables us to compare the score accuracy on large diffusion time for models with diverse truncation hyperparameters in a fair resolution setting. Table 2 presents that the model with $\sigma_{min} = 10^{-3}$ has the best FID, implying that the training with too small truncation would harm the sample fidelity. + +Specifically, Figure 4 shows the Euclidean norm of $g^{2}(t)\mathbf{s}_{\theta}(\mathbf{x}_{t},t)$ , where each dot represents for a Monte-Carlo sample from $p_t(\mathbf{x}_t)$ . Here, $g^{2}(t)\mathbf{s}_{\theta}(\mathbf{x}_{t},t)$ is in the reverse drift term of the generative process, $\mathrm{d}\mathbf{x}_t^\theta = [\mathbf{f}(\mathbf{x}_t^\theta ,t) - g^2 (t)\mathbf{s}_{\theta}(\mathbf{x}_t^\theta ,t)]\mathrm{d}\bar{t} +g(t)\mathrm{d}\bar{\mathbf{w}}_t$ . Figure 4 illustrates that it is + +![](images/f7e441d8c422fd7fbe25481d57da35ef1d91451283ac38ddc72fe42640380551.jpg) +(a) Monte-Carlo Loss + +![](images/1e5950abde5da0fc7d1d4a09ff50aa1fe15f1308f8c343947817cb0c592027cf.jpg) +(b) Soft Truncation +Figure 6: The experimental result trained on CIFAR-10 with DDPM++ (VP, NLL) (Song et al., 2021a). (a) The Monte-Carlo loss for each diffusion time, $\sigma^2(t)\|\mathbf{s}_{\theta}(\mathbf{x}_t,t) - \nabla \log p_{0t}(\mathbf{x}_t|\mathbf{x}_0)\|_2^2$ . (b) The Monte-Carlo loss for each diffusion time on various truncation time. (c) The importance distribution for various truncation distributions. + +![](images/8da442e75f6275ba9379dbdb59791d6ccf2cee0ecf670addaf69c395c0d401bd.jpg) +(c) Importance Distribution + +the large diffusion time that dominates the sampling process. Therefore, a precise score network on large diffusion time is particularly important in sample generation. + +The imprecise score mainly affects the global sample context, as the denoising on small diffusion time only crafts the image in its microscopic details, illustrated in Figures 3 and 5. Figure 3 shows how the global fidelity is damaged: a man synthesized in the second row has unrealistic curly hair on his forehead, constructed on the large diffusion time. Figure 5 deepens the importance of learning a good score estimation on large diffusion time. It shows the regenerated samples by solving the generative process time reversely, starting from $\mathbf{x}_{\tau}$ (Meng et al., 2021). + +# 4. Soft Truncation: A Training Technique for a Diffusion Model + +As in Section 3, the choice of $\epsilon$ is crucial for training and evaluation, but it is computationally infeasible to search for the optimal $\epsilon$ . Therefore, we introduce a training technique that predominantly mediates the need for $\epsilon$ -search by softening the fixed truncation hyperparameter into a truncation random variable so that the truncation time varies in every optimization step. Our approach successfully trains the score network on large diffusion time without sacrificing NLL. We explain the Monte-Carlo estimation of the variational bound in Section 4.1, which is the common practice of previous research but explained to emphasize how simple (though effective) Soft Truncation is, and we subsequently introduce Soft Truncation in Section 4.2. + +# 4.1. Monte-Carlo Estimation of Truncated Variational Bound with Importance Sampling + +In this section, we fix a truncation hyperparameter to be $\tau = \epsilon$ . For every batch $\{\mathbf{x}_0^{(b)}\}_{b=1}^B$ , the Monte-Carlo estimation of the variational bound in Inequality (6) is $\mathcal{L}(\pmb{\theta}; g^2, \epsilon) \approx \hat{\mathcal{L}}(\pmb{\theta}; g^2, \epsilon) = \frac{1}{2B} \sum_{b=1}^B g^2(t^{(b)}) \|\mathbf{s}_{\pmb{\theta}}(\mathbf{x}_{t^{(b)}}, t^{(b)}) -$ + +$\nabla \log p_{0t^{(b)}}(\mathbf{x}_{t^{(b)}}|\mathbf{x}_0)\| _2^2$ up to a constant irrelevant to $\pmb{\theta}$ , where $\mathbf{x}_{t^{(b)}} = \mu (t^{(b)})\mathbf{x}_0 + \sigma (t^{(b)})\epsilon^{(b)}$ with $\{t^{(b)}\}_{b = 1}^{B}$ and $\{\epsilon^{(b)}\}_{b = 1}^{B}$ be the corresponding Monte-Carlo samples from $t^{(b)}\sim [\epsilon ,T]$ and $\epsilon^{(b)}\sim \mathcal{N}(0,\mathbf{I})$ , respectively. Note that this Monte-Carlo estimation is tractably computed from the analytic form of the transition probability as $\nabla \log p_{0t^{(b)}}(\mathbf{x}_{t^{(b)}}|\mathbf{x}_0) = \frac{\pmb{\epsilon}^{(b)}}{\sigma(t^{(b)})}$ under linear SDEs. + +Previous works (Song et al., 2021a; Huang et al., 2021) apply the importance sampling with the importance distribution of $p_{iw}(t) = \frac{g^2(t) / \sigma^2(t)}{Z_\epsilon} 1_{[\epsilon, T]}(t)$ , where $Z_\epsilon = \int_{\epsilon}^{T} \frac{g^2(t)}{\sigma^2(t)} \, \mathrm{d}t$ . It is well known (Goodfellow et al., 2016) that the Monte-Carlo variance of $\hat{\mathcal{L}}$ is minimum if the importance distribution is $p_{iw}^*(t) \propto g^2(t) L(t)$ with $L(t) = \mathbb{E}_{\mathbf{x}_0, \mathbf{x}_t} [||\mathbf{s}_\theta(\mathbf{x}_t, t) - \nabla \log p_{0t}(\mathbf{x}_t | \mathbf{x}_0)||_2^2]$ , but sampling of Monte-Carlo diffusion time from $p_{iw}^*(t)$ at every training iteration would incur $2 \times$ slower training speed, at least, because the importance sampling requires the score evaluation. Therefore, previous research approximates $L(t)$ by $\hat{L}(t) = \mathbb{E}_{\mathbf{x}_0, \mathbf{x}_t} [||\nabla \log p_{0t}(\mathbf{x}_t | \mathbf{x}_0)||_2^2] \propto 1 / \sigma^2(t)$ , and $p_{iw}(t)$ becomes the approximate importance weight. This approximation, at the expense of bias, is cheap because the closed-form of the inverse Cumulative Distribution Function (CDF) is known. Unless we train the variance directly as in Kingma et al. (2021), we believe $p_{iw}(t)$ is the maximally efficient sampler as long as the training speed matters. The importance weighted Monte-Carlo estimation becomes + +$$ +\begin{array}{l} \mathcal {L} (\boldsymbol {\theta}; g ^ {2}, \epsilon) \\ = \frac {Z _ {\epsilon}}{2} \int_ {\epsilon} ^ {T} p _ {i w} (t) \sigma^ {2} (t) \mathbb {E} \left[ \| \mathbf {s} _ {\pmb {\theta}} (\mathbf {x} _ {t}, t) - \nabla \log p _ {0 t} (\mathbf {x} _ {t} | \mathbf {x} _ {0}) \| _ {2} ^ {2} \right] \mathrm {d} t \\ \approx \frac {Z _ {\epsilon}}{2 B} \sum_ {b = 1} ^ {B} \sigma^ {2} (t _ {i w} ^ {(b)}) \left\| \mathbf {s} _ {\pmb {\theta}} (\mathbf {x} _ {t _ {i w} ^ {(b)}}, t _ {i w} ^ {(b)}) - \frac {\pmb {\epsilon} ^ {(b)}}{\sigma (t _ {i w} ^ {(b)})} \right\| _ {2} ^ {2} \\ := \hat {\mathcal {L}} _ {i w} (\boldsymbol {\theta}; g ^ {2}, \epsilon), \tag {9} \\ \end{array} +$$ + +where $\{t_{iw}^{(b)}\}_{b = 1}^{B}$ is the Monte-Carlo sample from the importance distribution, i.e., $t_{iw}^{(b)}\sim p_{iw}(t)\propto \frac{g^2(t)}{\sigma^2(t)}$ + +![](images/99ec12a933e15097be1d16aa8d71a235ce0e57bff5d41d717ccf40d2643c4957.jpg) +Figure 7: Quartile of importance weighted Monte-Carlo time of VPSDE. Red dots represent Q1/Q2/Q3/Q4 quantiles when truncated at $\tau = \epsilon = 10^{-5}$ . About $25\%$ and $50\%$ of Monte-Carlo time are located in $[\epsilon, 5 \times 10^{-3}]$ and $[\epsilon, 0.106]$ , respectively. Green dots represent Q0-Q5 quantiles when truncated at $\tau = 0.1$ . Importance weighted Monte-Carlo time with $\tau = 0.1$ is distributed much more balanced compared to the truncation at $\tau = \epsilon$ . + +The importance sampling is advantageous in both NLL and FID (Song et al., 2021a) over the uniform sampling, as the importance sampling significantly reduces the estimation variance. Figure 6-(a) illustrates the sample-by-sample loss, and the importance sampling significantly mitigates the loss scale by diffusion time compared to the scale in Figure 1-(a). However, the importance distribution satisfies $p_{iw}(t) \to \infty$ as $t \to 0$ in Figure 6-(c) blue line, and most of the importance weighted Monte-Carlo time is concentrated at $t \approx \epsilon$ in Figure 7. Hence, the use of the importance sampling has a trade-off between the reduced variance (Figure 6-(a)) versus the over-sampled diffusion time near $t \approx \epsilon$ (Figure 7). Regardless of whether to use the importance sampling or not, therefore, the inaccurate score estimation on large diffusion time appears sampling-strategic-independently, and solving this pre-matured score estimation becomes a nontrivial task. + +Instead of the likelihood weighting, previous works (Ho et al., 2020; Nichol & Dhariwal, 2021; Dhariwal & Nichol, 2021) train the denoising score loss with the variance weighting, $\lambda(t) = \sigma^2(t)$ . With this weighting, the importance distribution becomes the uniform distribution, $p_{iw}(t) = \frac{\lambda(t)}{\sigma^2(t)} \equiv 1$ , so it significantly alleviates the trade-off of using the likelihood weighting. However, the variance weighting favors FID at the sacrifice in NLL because the loss is no longer the variational bound of the log-likelihood. In contrast, the training with the likelihood weighting is leaning towards NLL than FID, so Soft Truncation is for the balanced NLL and FID, using the likelihood weighting. + +# 4.2. Soft Truncation + +Soft Truncation releases the truncation hyperparameter from a static variable to a random variable with a probability distribution of $\mathbb{P}(\tau)$ . In every mini-batch update, Soft Truncation optimizes the diffusion model with $\hat{\mathcal{L}}_{iw}(\pmb {\theta};g^2,\tau)$ in Eq. (9) for a sampled $\tau \sim \mathbb{P}(\tau)$ . In other words, for every batch $\{\mathbf{x}_0^{(b)}\}_{b = 1}^B$ , Soft Truncation optimizes the Monte-Carlo loss + +$$ +\hat {\mathcal {L}} _ {i w} (\pmb {\theta}; \lambda , \tau) = \frac {Z _ {\tau}}{2 B} \sum_ {b = 1} ^ {B} \sigma^ {2} (t _ {i w} ^ {(b)}) \left\| \mathbf {s} _ {\pmb {\theta}} \big (\mathbf {x} _ {t _ {i w} ^ {(b)}}, t _ {i w} ^ {(b)} \big) - \frac {\pmb {\epsilon} ^ {(b)}}{\sigma (t _ {i w} ^ {(b)})} \right\| _ {2} ^ {2} +$$ + +with $\{t_{iw}^{(b)}\}_{b = 1}^{B}$ sampled from the importance distribution of $p_{iw,\tau}(t) = \frac{g^2(t) / \sigma^2(t)}{Z_\tau} 1_{[\tau ,T]}(t)$ , where $Z_{\tau} := \int_{\tau}^{T}\frac{g^2(t)}{\sigma^2(t)}\mathrm{d}t$ + +Soft Truncation resolves the oversampling issue of diffusion time near $t \approx \epsilon$ , meaning that Monte-Carlo time is not concentrated on $\epsilon$ anymore. Figure 7 illustrates the quantiles of importance weighted Monte-Carlo time with Soft Truncation under $\tau = \epsilon$ and $\tau = 0.1$ . The score network is trained more equally on diffusion time when $\tau = 0.1$ , and as a consequence, the loss imbalance issue in each training step is also alleviated as in Figure 6-(b) with purple dots. This limited range of $[\tau, T]$ provides a chance to learn a score network more balanced on diffusion time. As $\tau$ is softened, such truncation level will vary by mini-batch updates: see the loss scales change by blue, green, red, and purple dots according to various $\tau$ s in Figure 6-(b). Eventually, the softened $\tau$ will provide a fair chance to learn the score network from small as well as large diffusion time. + +# 4.3. Soft Truncation Equals to A Diffusion Model With A General Weight + +In the original diffusion model, the loss estimation, $\hat{\mathcal{L}} (\pmb {\theta};g^2,\epsilon)$ , is just a batch-wise approximation of a population loss, $\mathcal{L}(\pmb {\theta};g^2,\epsilon)$ . However, the target population loss of Soft Truncation, $\mathcal{L}(\pmb {\theta};g^2,\tau)$ , is depending on a random variable $\tau$ , so the target population loss itself becomes a random variable. Therefore, we derive the expected Soft Truncation loss to reveal the connection to the original diffusion model: + +$$ +\begin{array}{l} \mathcal {L} _ {S T} (\boldsymbol {\theta}; g ^ {2}, \mathbb {P}) := \mathbb {E} _ {\mathbb {P} (\tau)} \left[ \mathcal {L} (\boldsymbol {\theta}; g ^ {2}, \tau) \right] \\ = \frac {1}{2} \int_ {\epsilon} ^ {T} \mathbb {P} (\tau) \int_ {\tau} ^ {T} g ^ {2} (t) \mathbb {E} \left[ \| \mathbf {s} _ {\boldsymbol {\theta}} - \nabla \log p _ {0 t} \| _ {2} ^ {2} \right] d t d \tau \\ = \frac {1}{2} \int_ {\epsilon} ^ {T} g _ {\mathbb {P}} ^ {2} (t) \mathbb {E} \left[ \| \mathbf {s} _ {\boldsymbol {\theta}} - \nabla \log p _ {0 t} \| _ {2} ^ {2} \right] d t, \\ \end{array} +$$ + +up to a constant, where $g_{\mathbb{P}}^2 (t) = \big(\int_0^t\mathbb{P}(\tau)\mathrm{d}\tau \big)g^2 (t)$ , by exchanging the orders of the integrations. Therefore, we conclude that Soft Truncation reduces to a diffusion model with a general weight of $g_{\mathbb{P}}^{2}(t)$ , see Appendix A.3: + +$$ +\mathcal {L} _ {S T} (\boldsymbol {\theta}; g ^ {2}, \mathbb {P}) = \mathcal {L} (\boldsymbol {\theta}; g _ {\mathbb {P}} ^ {2}, \epsilon). \tag {10} +$$ + +# 4.4. Soft Truncation is Maximum Perturbed Likelihood Estimation + +As explained in Section 4.3, Soft Truncation is a diffusion model with a general weight, in the expected sense. Reversely, this section analyzes a diffusion model with a general weight in view of Soft Truncation. Suppose we have a general weight $\lambda$ . Theorem 1 implies that this general weighted diffusion loss, $\mathcal{L}(\theta; \lambda, \epsilon)$ , is the variational bound of the perturbed KL divergence expected by $\mathbb{P}_{\lambda}(\tau)$ . Theorem 1 collapses to Lemma 1 if $\lambda(t) = cg^2(t)$ for any $c > 0^1$ . See Appendix B for the detailed statement and proof. + +Theorem 1. Suppose $\frac{\lambda(t)}{g^2(t)}$ is a nondecreasing and nonnegative absolutely continuous function on $[\epsilon, T]$ and zero on $[0, \epsilon)$ . For the probability defined by + +$$ +\mathbb {P} _ {\lambda} ([ a, b ]) = \left[ \int_ {m a x (a, \epsilon)} ^ {b} \left(\frac {\lambda (s)}{g ^ {2} (s)}\right) ^ {\prime} \mathrm {d} s + \frac {\lambda (\epsilon)}{g ^ {2} (\epsilon)} 1 _ {[ a, b ]} (\epsilon) \right] \Bigg / Z, +$$ + +where $Z = \frac{\lambda(T)}{g^2(T)}$ ; up to a constant, the variational bound of the general weighted diffusion loss becomes + +$$ +\begin{array}{l} \mathbb {E} _ {\mathbb {P} _ {\lambda} (\tau)} \left[ D _ {K L} \left(p _ {\tau} \| p _ {\tau} ^ {\boldsymbol {\theta}}\right) \right] \\ \leq \frac {1}{2 Z} \int_ {\epsilon} ^ {T} \lambda (t) \mathbb {E} _ {\mathbf {x} _ {t}} \left[ \| \mathbf {s} _ {\boldsymbol {\theta}} (\mathbf {x} _ {t}, t) - \nabla \log p _ {t} (\mathbf {x} _ {t}) \| _ {2} ^ {2} \right] d t \\ = \frac {1}{Z} \mathcal {L} (\boldsymbol {\theta}; \lambda , \epsilon) = \mathbb {E} _ {\mathbb {P} _ {\lambda} (\tau)} \left[ \mathcal {L} (\boldsymbol {\theta}; g ^ {2}, \tau) \right]. \\ \end{array} +$$ + +The meaning of Soft Truncation becomes clearer in view of Theorem 1. Instead of training the general weighted diffusion loss, $\mathcal{L}(\pmb{\theta};\lambda,\epsilon)$ , we optimize the truncated variational bound, $\mathcal{L}(\pmb{\theta};g^2,\tau)$ . This truncated loss upper bounds the perturbed KL divergence, $D_{KL}(p_{\tau}\| p_{\tau}^{\pmb{\theta}})$ by Lemma 1, and Figure 1-(c) indicates that the Inequality (6) is nearly tight. Therefore, Soft Truncation could be interpreted as the Maximum Perturbed Likelihood Estimation (MPLE), where the perturbation level is a random variable. Soft Truncation is not MLE training because the Inequality 8 is not tight as demonstrated in Figure 1-(b) unless $\tau$ is sufficiently small. + +Old wisdom is to minimize the loss variance if available for stable training. However, some optimization methods in the deep learning era (e.g., stochastic gradient descent) deliberately add noises to a loss function that eventually helps escape from a local optimum. Soft Truncation is categorized in such optimization methods that inflate the loss variance by intentionally imposing auxiliary randomness on loss estimation. This randomness is represented by the outmost expectation of $\mathbb{E}_{\mathbb{P}_{\lambda}(\tau)}$ , which controls the diffusion time range batch-wisely. Additionally, the loss with a sampled $\tau$ is the proxy of the perturbed KL divergence by $\tau$ , so the auxiliary randomness on loss estimation is theoretically tamed, meaning that it is not a random perturbation. + +# 4.5. Choice of Truncation Probability Distribution + +We parametrize the probability distribution of $\tau$ by + +$$ +\mathbb {P} _ {k} (\tau) = \frac {1 / \tau^ {k}}{Z _ {k}} 1 _ {[ \epsilon , T ]} (\tau) \propto \frac {1}{\tau^ {k}}, \tag {11} +$$ + +where $Z_{k} = \int_{\epsilon}^{T}\frac{1}{\tau^{k}}\mathrm{d}\tau$ with sufficiently small enough truncation hyperparameter. Note that it is still beneficial to remain $\epsilon$ strictly positive because a batch update with $\tau \approx 0 < \epsilon$ would drift the score network away from the optimal point. Figure 6-(c) illustrates the importance distribution of $\lambda_{\mathbb{P}_k}$ for varying $k$ . From the definition of Eq. (11), $\mathbb{P}_k(\tau)\rightarrow \delta_\epsilon (\tau)$ as $k\to \infty$ , and this limiting delta distribution corresponds to the original diffusion model with the likelihood weighting. Figure 6-(c) shows that the importance distribution of $\mathbb{P}_k$ with finite $k$ interpolates the likelihood weighting and the variance weighting. + +With the current simple form, we experimentally find that the sweet spot is $k \approx 1.0$ in VPSDE and $k = 2.0$ in VESDE with the emphasis on the sample quality. For VPSDE, the importance distribution in Figure 6-(c) is nearly equal to that of the variance weighting if $k \approx 1.0$ , so Soft Truncation with $k \approx 1.0$ improves the sample fidelity, while maintaining low NLL. On the other hand, if $k$ is too small, no $\tau$ will be sampled near $\epsilon$ , so it hurts both sample generation and density estimation. We leave further study on searching for the optimal distribution of $\tau$ as future work. + +# 5. Experiments + +This section empirically studies our suggestions on benchmark datasets, including CIFAR-10 (Krizhevsky et al., 2009), ImageNet $32 \times 32$ (Van Oord et al., 2016), STL-10 (Coates et al., 2011) $^{2}$ CelebA (Liu et al., 2015) $64 \times 64$ and CelebA-HQ (Karras et al., 2018) $256 \times 256$ . + +Soft Truncation is a universal training technique independent to model architectures and diffusion strategies. In the experiments, we test Soft Truncation on various architectures, including vanilla NCSN++, DDPM++, Unbounded NCSN++ (UNCSN++, and Unbounded DDPM++ (UD-DPM++). Also, Soft Truncation is applied to various diffusion SDEs, such as VESDE, VPSDE, and Reverse VESDE (RVESDE). Although we use continuous SDEs for the diffusion strategies, Soft Truncation with the discrete model, such as DDPM (Ho et al., 2020), is a straightforward application of continuous models. Appendix D enumerates the specifications of score architectures and SDEs. + +From Figure 1-(c), a sweet spot of the hard threshold is $\epsilon = 10^{-5}$ , in which NLL/NELBO are no longer improved under this threshold. As the diffusion model has no informa + +![](images/346d305a29a941bdf77cc8e3e30ef293499910dfa2ddbda7474896e0fe9a7ed4.jpg) +Figure 8: Soft Truncation improves FID on CelebA trained with UNCSN++ (RVE). + +Table 4: Ablation study of Soft Truncation for various weightings on CIFAR-10 and ImageNet32 with DDPM++ (VP). + +
LossSoft TruncationNLLNELBOFID ODE
CIFAR-10L(θ; g2, ε)X3.033.136.70
L(θ; σ2, ε)X3.213.343.90
L(θ; g2P1, ε)X3.063.186.11
LST(θ; g2, P1)✓3.013.083.96
LST(θ; g2, P0.9)✓3.033.133.45
ImageNet32L(θ; g2, ε)X3.923.9412.68
L(θ; σ2, ε)X3.954.009.22
L(θ; g2P1, ε)X3.933.9711.89
LST(θ; g2, P0.9)✓3.903.918.42
+ +Table 5: Ablation study of Soft Truncation for various model architectures and diffusion SDEs on CelebA. + +
SDEModelLossNLLNELBOFID
PCODE
VENCSN++L(θ; σ2, ε)3.413.423.95-
LST(θ; σ2, P2)3.443.442.68-
RVEUNCSN++L(θ; g2, ε)2.012.013.36-
LST(θ; g2, P2)1.972.021.92-
VPDDPM++L(θ; σ2, ε)2.142.213.032.32
LST(θ; σ2, P1)2.172.292.881.90
UDDPM++L(θ; σ2, ε)2.112.203.234.72
LST(θ; σ2, P1)2.162.282.221.94
DDPM++L(θ; g2, ε)2.002.095.313.95
LST(θ; g2, P1)2.002.114.502.90
UDDPM++L(θ; g2, ε)1.982.124.653.98
LST(θ; g2, P1)2.002.104.452.97
+ +tion on $[0,\epsilon)$ , we comply Kim et al. (2022) to use Inequality (7) for NLL computation and Inequality (8) for NELBO computation. Following Kim et al. (2022), we compute $\log p_{\epsilon}^{\theta}(\mathbf{x}_{\epsilon})$ , rather than $\log p_{\epsilon}^{\theta}(\mathbf{x}_0)$ . It is the common practice of continuous diffusion models (Song et al., 2021b;a; Dockhorn et al., 2022) to report their performances with $\log p_{\epsilon}^{\theta}(\mathbf{x}_0)$ , but Kim et al. (2022) show that $\log p_{\epsilon}^{\theta}(\mathbf{x}_{\epsilon})$ differs to $\log p_{\epsilon}^{\theta}(\mathbf{x}_0)$ by 0.05 in BPD scale when $\epsilon = 10^{-5}$ , which is quite significant. We use the uniform dequantization (Theis et al., 2016) as default, otherwise noted. For sample generation, we use either of Predictor-Corrector (PC) sampler or Ordinary Differential Equation (ODE) sampler (Song et al., 2021b). We denote $\mathcal{L}(\pmb {\theta};\lambda ,\epsilon)$ as the vanilla training with $\lambda$ -weighting, and $\mathcal{L}_{ST}(\pmb {\theta};g^2,\mathbb{P})$ as the training by Soft Truncation with the truncation probability of + +Table 6: Ablation study of Soft Truncation for various $\epsilon$ on CIFAR-10 with DDPM++ (VP). + +
LossεNLLNELBOFID (ODE)
L(θ; g2, ε)10-24.644.6938.82
10-33.513.526.21
10-43.053.086.33
10-53.033.136.70
LST(θ; g2, P1)10-24.654.6939.83
10-33.513.525.14
10-43.053.084.16
10-53.013.083.96
+ +Table 7: Ablation study of Soft Truncation for various $\mathbb{P}_k$ on CIFAR-10 trained with DDPM++ (VP). + +
LossNLLNELBOFID (ODE)
LST(θ; g2, P0)3.243.396.27
LST(θ; g2, P0.8)3.033.053.61
LST(θ; g2, P0.9)3.033.133.45
LST(θ; g2, P1)3.013.083.96
LST(θ; g2, P1.1)3.023.093.98
LST(θ; g2, P1.2)3.033.093.98
LST(θ; g2, P2)3.013.106.31
LST(θ; g2, P3)3.023.096.54
LST(θ; g2, P∞) = L(θ; g2, ε)3.013.096.70
+ +Table 8: Ablation study of Soft Truncation for CIFAR-10 trained with DDPM++ when a diffusion is combined with a normalizing flow in INDM (Kim et al., 2022). + +
LossNLLNELBOFID (ODE)
INDM (VP, NLL)2.982.986.01
INDM (VP, FID)3.173.233.61
INDM (VP, NLL) + ST3.013.023.88
+ +$\mathbb{P}$ . We additionally denote $\mathcal{L}_{ST}(\theta; \sigma^2, \mathbb{P})$ for updating the network by the variance weighted loss per batch-wise update. We release our code at https://github.com/Kim-Dongjun/Soft-Truncation. + +FID by Iteration Figure 8 illustrates the FID score (Heusel et al., 2017) in $y$ -axis by training steps in $x$ -axis. Figure 8 shows that Soft Truncation beats the vanilla training after 150k of training iterations. + +Ablation Studies Tables 4, 5, 6, and 7 show ablation studies on various weighting functions, model architectures, SDEs, $\epsilon$ s, and probability distributions of $\tau$ , respectively. See Appendix E.2. Table 4 shows that Soft Truncation beats or equals to the vanilla training in all performances. We highlight that Soft Truncation with $\mathbb{P}_{0.9}$ outperforms the FID-favorable model with the variance weighting with respect to FID on both CIFAR-10 and ImageNet32. + +Not only comparing with the pre-existing weighting functions, such as $\lambda = g^{2}$ or $\lambda = \sigma^2$ , Table 4 additionally reports the experimental result of a general weighting function of $\lambda = g_{\mathbb{P}_1}^2$ . From Eq. (10), Soft Truncation with $\mathbb{P}_1$ and the vanilla training with $\lambda = g_{\mathbb{P}_1}^2$ coincide in their loss functions in average, i.e., $\mathcal{L}(\pmb{\theta};g_{\mathbb{P}_1}^2,\epsilon) = \mathcal{L}_{ST}(\pmb{\theta};g^2,\mathbb{P}_1)$ . Thus, when + +Table 9: Performance comparisons on benchmark datasets. The boldfaced numbers present the best performance, and the underlined numbers present the second-best performance. We report NLL of DDPM++ on CIFAR-10, ImageNet32, and CelebA with the variational dequantization (Song et al., 2021a) to compare with the baselines in a fair setting. + +
ModelCIFAR1032 × 32ImageNet3232 × 32CelebA64 × 64CelebA-HQ256 × 256STL-1048 × 48
NLL (↓)FID (↓)IS (↑)NLLFIDISNLLFIDFIDFIDIS
Likelihood-free Models
StyleGAN2-ADA+Tuning (Karras et al., 2020)-2.9210.02---------
Styleformer (Park & Kim, 2022)-2.829.94----3.66-15.1711.01
Likelihood-based Models
ARDM-Upscale 4 (Hoogeboom et al., 2021)2.64-----------
VDM (Kingma et al., 2021)2.657.41-3.72--------
LSGM (FID) (Vahdat et al., 2021)3.432.10----------
NCSN++ cont. (deep, VE) (Song et al., 2021b)3.452.209.89---2.393.957.23---
DDPM++ cont. (deep, sub-VP) (Song et al., 2021b)2.992.419.57---------
DenseFlow-74-10 (Grcic et al., 2021)2.9834.90-3.63--1.99-----
ScoreFlow (VP, FID) (Song et al., 2021a)3.043.98-3.848.34-------
Efficient-VDVAE (Hazami et al., 2022)2.87-----1.83-----
PNDM (Liu et al., 2022)-3.26-----2.71----
ScoreFlow (deep, sub-VP, NLL) (Song et al., 2021a)2.815.40-3.7610.18-------
Improved DDPM (Lsimple) (Nichol & Dhariwal, 2021)3.372.90----------
UNCSN++ (RVE) + ST3.042.3310.11---1.971.927.167.7113.43
DDPM++ (VP, FID) + ST2.912.479.78---2.101.90----
DDPM++ (VP, NLL) + ST2.883.459.193.858.4211.821.962.90----
+ +comparing the paired experiments, Soft Truncation could be considered as an alternative way of estimating the same loss, and Table 4 implies that Soft Truncation gives better optimization than the vanilla method. This strongly implies that Soft Truncation could be a default training method for a general weighted denoising diffusion loss. + +Table 5 provides two implications. First, Soft Truncation particularly boosts FID while maintaining density estimation performances under the variation of score networks and diffusion strategies. Second, Table 5 shows that Soft Truncation is effective on CelebA even when we apply Soft Truncation on the variance weighting, i.e., $\mathcal{L}_{ST}(\pmb{\theta};\sigma^2,\mathbb{P})$ but we find that this does not hold on CIFAR-10 and ImageNet32. We leave it as a future work on this extent. + +Table 6 shows a contrastive trend of the vanilla training and Soft Truncation. The inverse correlation appears between NLL and FID in the vanilla training, but Soft Truncation monotonically reduces both NLL and FID by $\epsilon$ . This implies that Soft Truncation significantly reduces the effort of the $\epsilon$ search. Table 7 studies the effect of the probability distribution of $\tau$ in VPSDE. It shows that Soft Truncation significantly improves FID upon the experiment of $\mathcal{L}(\theta; g^2, \epsilon)$ on the range of $0.8 \leq k \leq 1.2$ . Finally, Table 8 shows that Soft Truncation also works with a nonlinear forward SDE (Kim et al., 2022), so the scope of Soft Truncation is not limited to a family of linear SDEs. + +Quantitative Comparison to SOTA Table 9 compares Soft Truncation (ST) against the current best generative models. It shows that Soft Truncation achieves the state-of-the-art sample generation performances on CIFAR-10, CelebA, + +CelebA-HQ, and STL-10, while keeping NLL intact. In particular, we have experimented thoroughly on the CelebA dataset, and we find that Soft Truncation largely exceeds the previous best FID scores by far. In FID, Soft Truncation with $\mathrm{DDPM}++$ performs 1.90, which exceeds the previous best FID of 2.92 by DDGM. Also, Soft Truncation significantly improves FID on STL-10. + +# 6. Conclusion + +This paper proposes a generally applicable training method for diffusion models. The suggested training method, Soft Truncation, is motivated from the observation that the density estimation is mostly counted on small diffusion time, while the sample generation is mostly constructed on large diffusion time. However, small diffusion time dominates the Monte-Carlo estimation of the loss function, so this imbalance contribution prevents accurate score learning on large diffusion time. Soft Truncation softens the truncation level at each mini-batch update, and this simple modification is connected to the general weighted diffusion loss and the concept of Maximum Perturbed Likelihood Estimation. + +# Acknowledgements + +This research was supported by AI Technology Development for Commonsense Extraction, Reasoning, and Inference from Heterogeneous Data(IITP) funded by the Ministry of Science and ICT(2022-0-00077). We thank Jaeyoung Byeon and Daehan Park for their fruitful mathematical advice, and Byeonghu Na for his support of the experiments. + +# References + +Anderson, B. D. Reverse-time diffusion equation models. Stochastic Processes and their Applications, 12(3):313-326, 1982. +Chen, R. T., Rubanova, Y., Bettencourt, J., and Duvenaud, D. K. Neural ordinary differential equations. Advances in neural information processing systems, 31, 2018. +Chen, T., Liu, G.-H., and Theodorou, E. Likelihood training of schrödinger bridge using forward-backward SDEs theory. In International Conference on Learning Representations, 2022. +Coates, A., Ng, A., and Lee, H. An analysis of single-layer networks in unsupervised feature learning. In Proceedings of the fourteenth international conference on artificial intelligence and statistics, pp. 215-223. JMLR Workshop and Conference Proceedings, 2011. +Dhariwal, P. and Nichol, A. Diffusion models beat gans on image synthesis. Advances in Neural Information Processing Systems, 34, 2021. +Dockhorn, T., Vahdat, A., and Kreis, K. Score-based generative modeling with critically-damped Langevin diffusion. International Conference on Learning Representations, 2022. +Evans, L. C. Partial differential equations. Graduate studies in mathematics, 19(2), 1998. +Gerchinovitz, S., Ménard, P., and Stoltz, G. Fano's inequality for random variables. Statistical Science, 35(2): 178-201, 2020. +Goodfellow, I., Bengio, Y., and Courville, A. Deep learning. MIT press, 2016. +Grcic, M., Grubišić, I., and Šegvic, S. Densely connected normalizing flows. Advances in Neural Information Processing Systems, 34, 2021. +Hazami, L., Mama, R., and Thurairatnam, R. Efficient-vdvae: Less is more. arXiv preprint arXiv:2203.13751, 2022. +Heusel, M., Ramsauer, H., Unterthiner, T., Nessler, B., and Hochreiter, S. Gans trained by a two time-scale update rule converge to a local nash equilibrium. Advances in neural information processing systems, 30, 2017. +Ho, J., Chen, X., Srinivas, A., Duan, Y., and Abbeel, P. Flow++: Improving flow-based generative models with variational dequantization and architecture design. In International Conference on Machine Learning, pp. 2722-2730. PMLR, 2019. + +Ho, J., Jain, A., and Abbeel, P. Denoising diffusion probabilistic models. Advances in Neural Information Processing Systems, 33:6840-6851, 2020. +Hoogeboom, E., Gritsenko, A. A., Bastings, J., Poole, B., Berg, R. v. d., and Salimans, T. Autoregressive diffusion models. arXiv preprint arXiv:2110.02037, 2021. +Huang, C.-W., Lim, J. H., and Courville, A. C. A variational perspective on diffusion-based generative models and score matching. Advances in Neural Information Processing Systems, 34, 2021. +Jiang, Y., Chang, S., and Wang, Z. Transgan: Two pure transformers can make one strong gan, and that can scale up. Advances in Neural Information Processing Systems, 34, 2021. +Karras, T., Aila, T., Laine, S., and Lehtinen, J. Progressive growing of gans for improved quality, stability, and variation. In International Conference on Learning Representations, 2018. +Karras, T., Laine, S., and Aila, T. 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. +Karras, T., Aittala, M., Hellsten, J., Laine, S., Lehtinen, J., and Aila, T. Training generative adversarial networks with limited data. Advances in Neural Information Processing Systems, 33:12104-12114, 2020. +Kim, D., Na, B., Kwon, S. J., Lee, D., Kang, W., and Moon, I.-C. Maximum likelihood training of implicit nonlinear diffusion models. arXiv preprint arXiv:2205.13699, 2022. +Kingma, D. P., Salimans, T., Poole, B., and Ho, J. Variational diffusion models. In Advances in Neural Information Processing Systems, 2021. +Krizhevsky, A., Hinton, G., et al. Learning multiple layers of features from tiny images. 2009. +Liu, L., Ren, Y., Lin, Z., and Zhao, Z. Pseudo numerical methods for diffusion models on manifolds. arXiv preprint arXiv:2202.09778, 2022. +Liu, Z., Luo, P., Wang, X., and Tang, X. Deep learning face attributes in the wild. In Proceedings of the IEEE international conference on computer vision, pp. 3730-3738, 2015. +Meng, C., He, Y., Song, Y., Song, J., Wu, J., Zhu, J.-Y., and Ermon, S. Sdedit: Guided image synthesis and editing with stochastic differential equations. In International Conference on Learning Representations, 2021. + +Nichol, A. Q. and Dhariwal, P. Improved denoising diffusion probabilistic models. In International Conference on Machine Learning, pp. 8162-8171. PMLR, 2021. +Oksendal, B. Stochastic differential equations: an introduction with applications. Springer Science & Business Media, 2013. +Park, J. and Kim, Y. Styleformer: Transformer based generative adversarial networks with style vector. Proceedings of the IEEE/CVF International Conference on Computer Vision, 2022. +Parmar, G., Zhang, R., and Zhu, J.-Y. On buggy resizing libraries and surprising subtleties in fid calculation. Proceedings of the IEEE/CVF International Conference on Computer Vision, 2022. +Parmar, N., Vaswani, A., Uszkoreit, J., Kaiser, L., Shazeer, N., Ku, A., and Tran, D. Image transformer. In International Conference on Machine Learning, pp. 4055-4064. PMLR, 2018. +Pavon, M. and Wakolbinger, A. On free energy, stochastic control, and schrödinger processes. In Modeling, Estimation and Control of Systems with Uncertainty, pp. 334-348. Springer, 1991. +Song, Y. and Ermon, S. Generative modeling by estimating gradients of the data distribution. Advances in Neural Information Processing Systems, 32, 2019. +Song, Y. and Ermon, S. Improved techniques for training score-based generative models. Advances in neural information processing systems, 33:12438-12448, 2020. +Song, Y., Durkan, C., Murray, I., and Ermon, S. Maximum likelihood training of score-based diffusion models. Advances in Neural Information Processing Systems, 34, 2021a. +Song, Y., Sohl-Dickstein, J., Kingma, D. P., Kumar, A., Ermon, S., and Poole, B. Score-based generative modeling through stochastic differential equations. In International Conference on Learning Representations, 2021b. +Szegedy, C., Vanhoucke, V., Ioffe, S., Shlens, J., and Wojna, Z. Rethinking the inception architecture for computer vision. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 2818-2826, 2016. +Theis, L., van den Oord, A., and Bethge, M. A note on the evaluation of generative models. In International Conference on Learning Representations (ICLR 2016), pp. 1-10, 2016. +Vahdat, A. and Kautz, J. Nvae: A deep hierarchical variational autoencoder. Advances in Neural Information Processing Systems, 33:19667-19679, 2020. + +Vahdat, A., Kreis, K., and Kautz, J. Score-based generative modeling in latent space. Advances in Neural Information Processing Systems, 34, 2021. +Van Oord, A., Kalchbrenner, N., and Kavukcuoglu, K. Pixel recurrent neural networks. In International Conference on Machine Learning, pp. 1747-1756. PMLR, 2016. +Vargas, F., Thodoroff, P., Lamacraft, A., and Lawrence, N. Solving schrödinger bridges via maximum likelihood. Entropy, 23(9):1134, 2021. +Welling, M. and Teh, Y. W. Bayesian learning via stochastic gradient Langevin dynamics. In Proceedings of the 28th international conference on machine learning (ICML-11), pp. 681-688. Citeseer, 2011. + +# A. Derivation + +# A.1. Transition Probability for Linear SDEs + +Kim et al. (2022) has classified linear SDEs as + +$$ +\mathrm {d} \mathbf {x} _ {t} = - \frac {1}{2} \beta (t) \mathbf {x} _ {t} \mathrm {d} t + g (t) \mathrm {d} \mathbf {w} _ {t}, \tag {12} +$$ + +where $\beta : \mathbb{R} \to \mathbb{R}_{\geq 0}$ and $g: \mathbb{R} \to \mathbb{R}_{\geq 0}$ are real-valued functions. VESDE has $\beta(t) \equiv 0$ and $g(t) = \sqrt{\mathrm{d}\sigma^2(t) / \mathrm{d}t} = \sigma_{min} \left( \frac{\sigma_{max}}{\sigma_{min}} \right)^t \sqrt{2 \log \frac{\sigma_{max}}{\sigma_{min}}}$ , where $\sigma_{min}$ and $\sigma_{max}$ are the minimum/maximum perturbation variances, respectively. It has the transition probability of + +$$ +p _ {0 t} (\mathbf {x} _ {t} | \mathbf {x} _ {0}) = \mathcal {N} (\mathbf {x} _ {t}; \mu_ {V E} (t) \mathbf {x} _ {0}, \sigma_ {V E} ^ {2} (t) \mathbf {I}), +$$ + +where $\mu_{VE}(t) \equiv 1$ and $\sigma_{VE}^2(t) \coloneqq \sigma_{min}^2\left[\left(\frac{\sigma_{max}}{\sigma_{min}}\right)^{2t} - 1\right]$ . VPSDE has $\beta(t) = \beta_{min} + (\beta_{max} - \beta_{min})t$ and $g(t) = \sqrt{\beta(t)}$ with the transition probability of + +$$ +p _ {0 t} (\mathbf {x} _ {t} | \mathbf {x} _ {0}) = \mathcal {N} (\mathbf {x} _ {t}; \mu_ {V P} (t) \mathbf {x} _ {0}, \sigma_ {V P} ^ {2} (t) \mathbf {I}), +$$ + +where $\mu_{VP}(t) = e^{-\frac{1}{2}\int_0^t\beta (s)\mathrm{d}s}$ and $\sigma^2 (t) = 1 - e^{-\int_0^t\beta (s)\mathrm{d}s}$ . + +Analogous to VE/VP SDEs, the transition probability of the generic linear SDE of Eq. (12) is a Gaussian distribution of $p_{0t}(\mathbf{x}_t|\mathbf{x}_0) = \mathcal{N}(\mathbf{x}_t|\mu(t)\mathbf{x}_0, \sigma^2(t)\mathbf{I})$ , where its mean and covariance functions are characterized as a system of ODEs of + +$$ +\frac {\mathrm {d} \mu (t)}{\mathrm {d} t} = - \frac {1}{2} \beta (t) \mu (t), \tag {13} +$$ + +$$ +\frac {\mathrm {d} \sigma^ {2} (t)}{\mathrm {d} t} = - \beta (t) \sigma^ {2} (t) + g ^ {2} (t), \tag {14} +$$ + +with initial conditions to be $\mu (0) = 1$ and $\sigma^2 (0) = 0$ + +Eq. (13) has its solution by + +$$ +\mu (t) = e ^ {- \frac {1}{2} \int_ {0} ^ {t} \beta (s) \mathrm {d} s}. +$$ + +If we multiply $e^{\int_0^t\beta (s)\mathrm{d}s}$ to Eq. (14), then Eq. (14) equals to + +$$ +\begin{array}{l} e ^ {\int_ {0} ^ {t} \beta (s) \mathrm {d} s} \frac {\mathrm {d} \sigma^ {2} (t)}{\mathrm {d} t} + e ^ {\int_ {0} ^ {t} \beta (s) \mathrm {d} s} \beta (t) \sigma^ {2} (t) = e ^ {\int_ {0} ^ {t} \beta (s) \mathrm {d} s} g ^ {2} (t) \\ \Longleftrightarrow \frac {\mathrm {d} \left[ e ^ {\int_ {0} ^ {t} \beta (s) \mathrm {d} s} \sigma^ {2} (t) \right]}{\mathrm {d} t} = e ^ {\int_ {0} ^ {t} \beta (s) \mathrm {d} s} g ^ {2} (t) \\ \Longleftrightarrow e ^ {\int_ {0} ^ {t} \beta (s) \mathrm {d} s} \sigma^ {2} (t) = \int_ {0} ^ {t} e ^ {\int_ {0} ^ {\tau} \beta (s) \mathrm {d} s} g ^ {2} (\tau) \mathrm {d} \tau + C \\ \Longleftrightarrow \sigma^ {2} (t) = e ^ {- \int_ {0} ^ {t} \beta (s) \mathrm {d} s} \int_ {0} ^ {t} e ^ {\int_ {0} ^ {\tau} \beta (s) \mathrm {d} s} g ^ {2} (\tau) \mathrm {d} \tau + C e ^ {- \int_ {0} ^ {t} \beta (s) \mathrm {d} s}. \tag {15} \\ \end{array} +$$ + +If we impose $\sigma^2 (0) = 0$ to Eq. (15), then the constant $C$ satisfies $C = 0$ , and the variance formula becomes + +$$ +\sigma^ {2} (t) = e ^ {- \int_ {0} ^ {t} \beta (s) \mathrm {d} s} \int_ {0} ^ {t} e ^ {\int_ {0} ^ {\tau} \beta (s) \mathrm {d} s} g ^ {2} (\tau) \mathrm {d} \tau . +$$ + +To sum up, the family of linear SDEs of $\mathrm{d}\mathbf{x}_t = -\frac{1}{2}\beta (t)\mathbf{x}_t\mathrm{d}t + g(t)\mathrm{d}\mathbf{w}_t$ gets the transition probability to be + +$$ +p _ {0 t} \left(\mathbf {x} _ {t} \mid \mathbf {x} _ {0}\right) = \mathcal {N} \left(\mathbf {x} _ {t} \Bigg | e ^ {- \frac {1}{2} \int_ {0} ^ {t} \beta (s) \mathrm {d} s} \mathbf {x} _ {0}, e ^ {- \int_ {0} ^ {t} \beta (s) \mathrm {d} s} \left(\int_ {0} ^ {t} e ^ {\int_ {0} ^ {\tau} \beta (s) \mathrm {d} s} g ^ {2} (\tau) \mathrm {d} \tau\right) \mathbf {I}\right). \tag {16} +$$ + +# A.2. Diverging Denoising Loss + +The gradient of the log transition probability, $\nabla \log p_{0t}(\mathbf{x}_t|\mathbf{x}_0) = -\frac{\mathbf{x}_t - \mu(t)\mathbf{x}_0}{\sigma^2(t)} = -\frac{\mathbf{z}}{\sigma(t)}$ , is diverging at $\mu (t)\mathbf{x}_0$ , where $\mathbf{x}_t = \mu (t)\mathbf{x}_0 + \sigma (t)\mathbf{z}$ . Below Lemma 2 indicates that $\| \mathbf{s}(\mathbf{x}_t,t) - \nabla \log p_{0t}(\mathbf{x}_t|\mathbf{x}_0)\| _2\to \infty$ for any continuous score function, s. This leads that the denoising score loss diverges as $t\rightarrow 0$ as illustrated in Figure 1-(a). + +Lemma 2. Let $\mathcal{H}_{[0,T]} = \{\mathbf{s}:\mathbb{R}^d\times [0,T]\to \mathbb{R}^d$ , $\mathbf{s}$ is locally Lipschitz}. Suppose a continuous vector field $\mathbf{v}$ defined on a subset $U$ of a compact manifold $M$ (i.e., $\mathbf{v}:U\subset M\to \mathbb{R}^d$ ) is unbounded, then there exists no $\mathbf{s}\in \mathcal{H}_{[0,T]}$ such that $\lim_{t\to 0}\mathbf{s}(\mathbf{x},t) = \mathbf{v}(\mathbf{x})$ a.e. on $U$ + +Proof of Lemma 2. Since $U$ is an open subset of a compact manifold $M$ , $\| \mathbf{x}_1 - \mathbf{x}_2 \| \leq \mathrm{diam}(M)$ for all $\mathbf{x}_1, \mathbf{x}_2 \in U$ . Also, if $t_1, t_2 \in [0, T]$ , $|t_1 - t_2|$ is bounded. Hence, the local Lipschitzness of $\mathbf{s}$ implies that there exists a positive $K > 0$ such that $\| s(\mathbf{x}_1, t_1) - s(\mathbf{x}_2, t_2) \| \leq K (\| \mathbf{x}_1 - \mathbf{x}_2 \| + |t_1 - t_2|)$ for any $\mathbf{x}_1, \mathbf{x}_2 \in U$ and $t_1, t_2 \in [0, T]$ . Therefore, for any $\mathbf{s} \in \mathcal{H}_{[0, T]}$ , there exists $C > 0$ such that $\| \mathbf{s}(\mathbf{x}, t) \| < C$ for all $\mathbf{x} \in U$ and $t \in [0, T]$ , which leads no $\mathbf{s}$ that satisfies $\mathbf{s}(\mathbf{x}, t) \to v(\mathbf{x})$ a.e. on $U$ as $t \to 0$ . + +# A.3. General Weighted Diffusion Loss + +The denoising score loss is + +$$ +\begin{array}{l} \mathcal {L} (\boldsymbol {\theta}; g ^ {2}, \tau) = \frac {1}{2} \int_ {\tau} ^ {T} g ^ {2} (t) \mathbb {E} _ {\mathbf {x} _ {0}, \mathbf {x} _ {t}} \left[ \| \mathbf {s} _ {\boldsymbol {\theta}} (\mathbf {x} _ {t}, t) - \nabla_ {\mathbf {x} _ {t}} \log p _ {0 t} (\mathbf {x} _ {t} | \mathbf {x} _ {0}) \| _ {2} ^ {2} - \| \log p _ {0 t} (\mathbf {x} _ {t} | \mathbf {x} _ {0}) \| _ {2} ^ {2} \right] d t \tag {17} \\ - \int_ {\tau} ^ {T} \mathbb {E} _ {\mathbf {x} _ {t}} \left[ \operatorname {d i v} \left(\mathbf {f} \left(\mathbf {x} _ {t}, t\right)\right) \right] d t - \mathbb {E} _ {\mathbf {x} _ {T}} \left[ \log \pi \left(\mathbf {x} _ {T}\right) \right], \\ \end{array} +$$ + +for any $\tau \in [0,T]$ . For an appropriate class of function $A(t)$ + +$$ +\begin{array}{l} \int_ {0} ^ {T} \mathbb {P} (\tau) \left(\int_ {\tau} ^ {T} A (t) \mathrm {d} t\right) \mathrm {d} \tau = \int_ {0} ^ {T} \int_ {0} ^ {T} \mathbb {P} (\tau) A (t) 1 _ {[ \tau , T ]} (t) \mathrm {d} t \mathrm {d} \tau \\ = \int_ {0} ^ {T} \int_ {0} ^ {T} \mathbb {P} (\tau) A (t) 1 _ {[ \tau , T ]} (t) d \tau d t \\ = \int_ {0} ^ {T} \int_ {0} ^ {t} \mathbb {P} (\tau) A (t) d \tau d t \\ = \int_ {0} ^ {T} \left(\int_ {0} ^ {t} \mathbb {P} (\tau) \mathrm {d} \tau\right) A (t) \mathrm {d} t \\ \end{array} +$$ + +holds by changing the order of integration. Therefore, we get + +$$ +\begin{array}{l} \mathcal {L} _ {S T} (\boldsymbol {\theta}; g ^ {2}, \mathbb {P}) := \mathbb {E} _ {\mathbb {P} (\tau)} [ \mathcal {L} (\boldsymbol {\theta}; g ^ {2}, \tau) ] \\ = \int_ {0} ^ {T} \mathbb {P} (\tau) \left[ \frac {1}{2} \int_ {\tau} ^ {T} g ^ {2} (t) \mathbb {E} _ {\mathbf {x} _ {0}, \mathbf {x} _ {t}} \left[ \| \mathbf {s} _ {\boldsymbol {\theta}} (\mathbf {x} _ {t}, t) - \nabla_ {\mathbf {x} _ {t}} \log p _ {0 t} (\mathbf {x} _ {t} | \mathbf {x} _ {0}) \| _ {2} ^ {2} - \| \log p _ {0 t} (\mathbf {x} _ {t} | \mathbf {x} _ {0}) \| _ {2} ^ {2} \right] d t \right. \\ \left. - \int_ {\tau} ^ {T} \mathbb {E} _ {\mathbf {x} _ {t}} \left[ \operatorname {d i v} (\mathbf {f} (\mathbf {x} _ {t}, t)) \right] d t - \mathbb {E} _ {\mathbf {x} _ {T}} \left[ \log \pi (\mathbf {x} _ {T}) \right] \right] d \tau \\ = \int_ {0} ^ {T} \left(\int_ {0} ^ {t} \mathbb {P} (\tau) \mathrm {d} \tau\right) \left[ \frac {1}{2} g ^ {2} (t) \mathbb {E} _ {\mathbf {x} _ {0}, \mathbf {x} _ {t}} \left[ \| \mathbf {s} _ {\boldsymbol {\theta}} (\mathbf {x} _ {t}, t) - \nabla_ {\mathbf {x} _ {t}} \log p _ {0 t} (\mathbf {x} _ {t} | \mathbf {x} _ {0}) \| _ {2} ^ {2} - \| \log p _ {0 t} (\mathbf {x} _ {t} | \mathbf {x} _ {0}) \| _ {2} ^ {2} \right] \right. \\ \left. - \mathbb {E} _ {\mathbf {x} _ {t}} \left[ \operatorname {d i v} (\mathbf {f} (\mathbf {x} _ {t}, t)) \right] \right] \mathrm {d} t - \mathbb {E} _ {\mathbf {x} _ {T}} \left[ \log \pi (\mathbf {x} _ {T}) \right] \\ = \frac {1}{2} \int_ {0} ^ {T} g _ {\mathbb {P}} ^ {2} (t) \mathbb {E} _ {\mathbf {x} _ {0}, \mathbf {x} _ {t}} \left[ \| \mathbf {s} _ {\boldsymbol {\theta}} (\mathbf {x} _ {t}, t) - \nabla_ {\mathbf {x} _ {t}} \log p _ {0 t} (\mathbf {x} _ {t} | \mathbf {x} _ {0}) \| _ {2} ^ {2} \right] d t + C, \\ \end{array} +$$ + +where + +$$ +C = - \frac {1}{2} \int_ {0} ^ {T} g _ {\mathbb {P}} ^ {2} (t) \mathbb {E} _ {\mathbf {x} _ {0}, \mathbf {x} _ {t}} \left[ \| \log p _ {0 t} (\mathbf {x} _ {t} | \mathbf {x} _ {0}) \| _ {2} ^ {2} \right] \mathrm {d} t - \int_ {0} ^ {T} \left(\int_ {0} ^ {t} \mathbb {P} (\tau) \mathrm {d} \tau\right) \mathbb {E} _ {\mathbf {x} _ {t}} \left[ \operatorname {d i v} (\mathbf {f} (\mathbf {x} _ {t}, t)) \right] \mathrm {d} t - \mathbb {E} _ {\mathbf {x} _ {T}} \left[ \log \pi (\mathbf {x} _ {T}) \right]. +$$ + +If $\mathbf{f}(\mathbf{x}_t,t) = -\frac{1}{2}\beta (t)\mathbf{x}_t$ , then we have + +$$ +C = - \frac {d}{2} \int_ {0} ^ {T} \left(\int_ {0} ^ {t} \mathbb {P} (\tau) \mathrm {d} \tau\right) \frac {g ^ {2} (t)}{\sigma^ {2} (t)} \mathrm {d} t + \frac {d}{2} \int_ {0} ^ {T} \left(\int_ {0} ^ {t} \mathbb {P} (\tau) \mathrm {d} \tau\right) \beta (t) \mathrm {d} t - \mathbb {E} _ {\mathbf {x} _ {T}} \left[ \log \pi (\mathbf {x} _ {T}) \right]. +$$ + +# B. Theorems and Proofs + +Lemma 1. For any $\tau \in [0,T]$ + +$$ +\begin{array}{l} \mathbb {E} _ {\mathbf {x} _ {\tau}} \left[ - \log p _ {\tau} ^ {\pmb {\theta}} (\mathbf {x} _ {\tau}) \right] \leq \mathcal {L} (\pmb {\theta}; g ^ {2}, \tau) = \frac {1}{2} \int_ {\tau} ^ {T} g ^ {2} (t) \mathbb {E} _ {\mathbf {x} _ {0}, \mathbf {x} _ {t}} \left[ \| \mathbf {s} _ {\pmb {\theta}} (\mathbf {x} _ {t}, t) - \nabla_ {\mathbf {x} _ {t}} \log p _ {0 t} (\mathbf {x} _ {t} | \mathbf {x} _ {0}) \| _ {2} ^ {2} \right], \\ \left. - \left\| \nabla_ {\mathbf {x} _ {t}} \log p _ {0 t} (\mathbf {x} _ {t} | \mathbf {x} _ {0}) \right\| _ {2} ^ {2} \right] \mathrm {d} t - \int_ {\tau} ^ {T} \mathbb {E} _ {\mathbf {x} _ {t}} \left[ \operatorname {d i v} (\mathbf {f} (\mathbf {x} _ {t}, t)) \right] \mathrm {d} t - \mathbb {E} _ {\mathbf {x} _ {T}} \left[ \log \pi (\mathbf {x} _ {T}) \right]. \\ \end{array} +$$ + +Proof. Suppose $\pmb{\mu}$ is the path measure of the forward SDE, and $\pmb{\nu}_{\theta}$ is the path measure of the generative SDE. The restricted measure is defined by $\pmb{\mu}|_{[\tau,T]}(\{F_t\}_{t=\tau}^T) \coloneqq \pmb{\mu}(\{F_t\}_{t=0}^T)$ , where $F_t = \mathbb{R}^d$ if $t \in [0,\tau)$ and $F_t$ is a measurable set in $\mathbb{R}^d$ otherwise. The restricted measure of $\pmb{\nu}_{\theta}$ is defined analogously. Then, by the data processing inequality, we get + +$$ +D _ {K L} \left(p _ {\tau} \| p _ {\tau} ^ {\boldsymbol {\theta}}\right) \leq D _ {K L} \left(\boldsymbol {\mu} | _ {[ \tau , T ]} \| \boldsymbol {\nu} _ {\boldsymbol {\theta}} | _ {[ \tau , T ]}\right). \tag {18} +$$ + +Now, from the chain rule of KL divergences, we have + +$$ +D _ {K L} (\boldsymbol {\mu} | _ {[ \tau , T ]} \| \boldsymbol {\nu} _ {\boldsymbol {\theta}} | _ {[ \tau , T ]}) = D _ {K L} (p _ {T} \| \pi) + \mathbb {E} _ {\mathbf {z} \sim p _ {T}} \left[ D _ {K L} \left(\boldsymbol {\mu} | _ {[ \tau , T ]} (\cdot | \mathbf {x} _ {T} = \mathbf {z}) \| \boldsymbol {\nu} _ {\boldsymbol {\theta}} | _ {[ \tau , T ]} (\cdot | \mathbf {x} _ {T} = \mathbf {z})\right) \right]. \tag {19} +$$ + +From the Girsanov theorem and the Martingale property, we get + +$$ +D _ {K L} \left(\boldsymbol {\mu} | _ {[ \tau , T ]} (\cdot | \mathbf {x} _ {T} = \mathbf {z}) \| \boldsymbol {\nu} _ {\boldsymbol {\theta}} | _ {[ \tau , T ]} (\cdot | \mathbf {x} _ {T} = \mathbf {z})\right) = \frac {1}{2} \int_ {\tau} ^ {T} \mathbb {E} _ {p _ {t} \left(\mathbf {x} _ {t}\right)} \left[ g ^ {2} (t) \| \mathbf {s} _ {\boldsymbol {\theta}} \left(\mathbf {x} _ {t}, t\right) - \nabla \log p _ {t} \left(\mathbf {x} _ {t}\right) \| _ {2} ^ {2} \right] d t, \tag {20} +$$ + +and combining Eq. (18), (19) and (20), we have + +$$ +D _ {K L} \left(p _ {\tau} \| p _ {\tau} ^ {\boldsymbol {\theta}}\right) \leq D _ {K L} \left(p _ {T} \| \pi\right) + \frac {1}{2} \int_ {\tau} ^ {T} \mathbb {E} _ {p _ {t} \left(\mathbf {x} _ {t}\right)} \left[ g ^ {2} (t) \| \mathbf {s} _ {\boldsymbol {\theta}} \left(\mathbf {x} _ {t}, t\right) - \nabla \log p _ {t} \left(\mathbf {x} _ {t}\right) \| _ {2} ^ {2} \right] d t. \tag {21} +$$ + +Now, from + +$$ +\begin{array}{l} \frac {1}{2} \int_ {\tau} ^ {T} \mathbb {E} _ {p _ {t} (\mathbf {x} _ {t})} \left[ g ^ {2} (t) [ \| \mathbf {s} _ {\boldsymbol {\theta}} (\mathbf {x} _ {t}, t) - \nabla_ {\mathbf {x} _ {t}} \log p _ {t} (\mathbf {x} _ {t}) \| _ {2} ^ {2} - \| \log p _ {t} (\mathbf {x} _ {t}) \| _ {2} ^ {2} ] \right] \mathrm {d} t \\ = \frac {1}{2} \int_ {\tau} ^ {T} \mathbb {E} _ {p _ {t} (\mathbf {x} _ {t})} \left[ g ^ {2} (t) \| \mathbf {s} _ {\boldsymbol {\theta}} (\mathbf {x} _ {t}, t) \| _ {2} ^ {2} - 2 g ^ {2} (t) \mathbf {s} _ {\boldsymbol {\theta}} (\mathbf {x} _ {t}, t) \cdot \nabla_ {\mathbf {x} _ {t}} \log p _ {t} (\mathbf {x} _ {t}) \right] \mathrm {d} t \\ = \frac {1}{2} \int_ {\tau} ^ {T} \mathbb {E} _ {p _ {t} (\mathbf {x} _ {t})} \left[ g ^ {2} (t) \| \mathbf {s} _ {\boldsymbol {\theta}} (\mathbf {x} _ {t}, t) \| _ {2} ^ {2} \right] \mathrm {d} t - \int_ {\tau} ^ {T} \int g ^ {2} (t) \mathbf {s} _ {\boldsymbol {\theta}} (\mathbf {x} _ {t}, t) \cdot \nabla_ {\mathbf {x} _ {t}} p _ {t} (\mathbf {x} _ {t}) \mathrm {d} \mathbf {x} _ {t} \mathrm {d} t \\ = \frac {1}{2} \int_ {\tau} ^ {T} \mathbb {E} _ {p _ {t} (\mathbf {x} _ {t})} [ g ^ {2} (t) \| \mathbf {s} _ {\boldsymbol {\theta}} (\mathbf {x} _ {t}, t) \| _ {2} ^ {2} ] d t - \int_ {\tau} ^ {T} \int g ^ {2} (t) \mathbf {s} _ {\boldsymbol {\theta}} (\mathbf {x} _ {t}, t) \cdot \nabla_ {\mathbf {x} _ {t}} \int p _ {r} (\mathbf {x} _ {0}) p _ {0 t} (\mathbf {x} _ {t} | \mathbf {x} _ {0}) d \mathbf {x} _ {0} d \mathbf {x} _ {t} d t \\ = \frac {1}{2} \int_ {\tau} ^ {T} \mathbb {E} _ {p _ {t} (\mathbf {x} _ {t})} \left[ g ^ {2} (t) \| \mathbf {s} _ {\boldsymbol {\theta}} (\mathbf {x} _ {t}, t) \| _ {2} ^ {2} \right] \mathrm {d} t - \int_ {\tau} ^ {T} \int g ^ {2} (t) \mathbf {s} _ {\boldsymbol {\theta}} (\mathbf {x} _ {t}, t) \cdot \int p _ {r} (\mathbf {x} _ {0}) \nabla_ {\mathbf {x} _ {t}} p _ {0 t} (\mathbf {x} _ {t} | \mathbf {x} _ {0}) \mathrm {d} \mathbf {x} _ {0} \mathrm {d} \mathbf {x} _ {t} \mathrm {d} t \\ = \frac {1}{2} \int_ {\tau} ^ {T} \mathbb {E} _ {p _ {r} (\mathbf {x} _ {0}) p _ {0 t} (\mathbf {x} _ {t} | \mathbf {x} _ {0})} \big [ g ^ {2} (t) [ \| \mathbf {s} _ {\boldsymbol {\theta}} (\mathbf {x} _ {t}, t) - \nabla_ {\mathbf {x} _ {t}} \log p _ {0 t} (\mathbf {x} _ {t} | \mathbf {x} _ {0}) \| _ {2} ^ {2} - \| \nabla_ {\mathbf {x} _ {t}} \log p _ {0 t} (\mathbf {x} _ {t} | \mathbf {x} _ {0}) \| _ {2} ^ {2} ] \big ] \mathrm {d} t, \\ \end{array} +$$ + +we can transform $\| \mathbf{s}_{\pmb{\theta}}(\mathbf{x}_t,t) - \nabla \log p_t(\mathbf{x}_t)\| _2^2$ into $\| \mathbf{s}_{\pmb{\theta}}(\mathbf{x}_t,t) - \nabla \log p_{0t}(\mathbf{x}_t|\mathbf{x}_0)\| _2^2$ , Eq. (21) is equivalent to + +$$ +\mathbb {E} _ {p _ {\tau} (\mathbf {x} _ {\tau})} \left[ - \log p _ {\tau} ^ {\boldsymbol {\theta}} (\mathbf {x} _ {\tau}) \right] \leq D _ {K L} (p _ {T} \| \pi) + \frac {1}{2} \int_ {\tau} ^ {T} \mathbb {E} _ {p _ {t} (\mathbf {x} _ {t})} \left[ g ^ {2} (t) \| \mathbf {s} _ {\boldsymbol {\theta}} (\mathbf {x} _ {t}, t) - \nabla \log p _ {t} (\mathbf {x} _ {t}) \| _ {2} ^ {2} \right] \mathrm {d} t + \mathcal {H} (p _ {\tau}) \tag {22} +$$ + +$$ +\begin{array}{l} = D _ {K L} \left(p _ {T} \| \pi\right) + \frac {1}{2} \int_ {\tau} ^ {T} \mathbb {E} _ {p _ {t} \left(\mathbf {x} _ {t}\right)} \left[ g ^ {2} (t) \| \mathbf {s} _ {\boldsymbol {\theta}} \left(\mathbf {x} _ {t}, t\right) - \nabla \log p _ {0 t} \left(\mathbf {x} _ {t} \mid \mathbf {x} _ {0}\right) \| _ {2} ^ {2} - \| \nabla \log p _ {0 t} \left(\mathbf {x} _ {t} \mid \mathbf {x} _ {0}\right) \| _ {2} ^ {2} \right] d t (23) \\ + \frac {1}{2} \int_ {\tau} ^ {T} \mathbb {E} _ {p _ {t} (\mathbf {x} _ {t})} \left[ g ^ {2} (t) \nabla \log p _ {t} (\mathbf {x} _ {t}) \| _ {2} ^ {2} \right] d t + \mathcal {H} \left(p _ {\tau}\right). (24) \\ \end{array} +$$ + +Now, directly applying Theorem 4 of Song et al. (2021a), the entropy of $\mathcal{H}(p_{\tau})$ becomes + +$$ +\mathcal {H} \left(p _ {\tau}\right) = \mathcal {H} \left(p _ {T}\right) - \frac {1}{2} \int_ {\tau} ^ {T} \mathbb {E} _ {p _ {t} \left(\mathbf {x} _ {t}\right)} \left[ 2 \operatorname {d i v} \left(\mathbf {f} \left(\mathbf {x} _ {t}, t\right)\right) + g ^ {2} (t) \| \nabla \log p _ {t} \left(\mathbf {x} _ {t}\right) \| _ {2} ^ {2} \right] d t. \tag {25} +$$ + +Therefore, from Eq. (22) and (25), we get + +$$ +\begin{array}{l} \mathbb {E} _ {p _ {\tau} (\mathbf {x} _ {\tau})} \left[ - \log p _ {\tau} ^ {\boldsymbol {\theta}} (\mathbf {x} _ {\tau}) \right] \leq \frac {1}{2} \int_ {\tau} ^ {T} \mathbb {E} _ {p _ {t} (\mathbf {x} _ {t})} \left[ g ^ {2} (t) \| \mathbf {s} _ {\boldsymbol {\theta}} (\mathbf {x} _ {t}, t) - \nabla \log p _ {0 t} (\mathbf {x} _ {t} | \mathbf {x} _ {0}) \| _ {2} ^ {2} - \| \nabla \log p _ {0 t} (\mathbf {x} _ {t} | \mathbf {x} _ {0}) \| _ {2} ^ {2} \right] d t \\ - \int_ {\tau} ^ {T} \mathbb {E} _ {\mathbf {x} _ {t}} \big [ \mathrm {d i v} (\mathbf {f} (\mathbf {x} _ {t}, t)) \big ] \mathrm {d} t - \mathbb {E} _ {\mathbf {x} _ {T}} \big [ \log \pi (\mathbf {x} _ {T}) \big ]. \\ \end{array} +$$ + +![](images/5acf3af7ed1e5b4af2581b12d4a4966d689e2fa64d6248840ff414b16aa88ad4.jpg) + +Theorem 1. Suppose $\lambda(t)$ is a weighting function of the NCSN loss. If $\frac{\lambda(t)}{g^2(t)}$ is a nondecreasing and nonnegative absolutely continuous function on $[\epsilon, T]$ and zero on $[0, \epsilon)$ , then + +$$ +\begin{array}{l} \mathcal {L} (\boldsymbol {\theta}; \lambda , \epsilon) \geq \int_ {\epsilon} ^ {T} \left(\frac {\lambda (\tau)}{g ^ {2} (\tau)}\right) ^ {\prime} \mathbb {E} _ {\mathbf {x} _ {\tau}} \left[ - \log p _ {\tau} ^ {\boldsymbol {\theta}} (\mathbf {x} _ {\tau}) \right] d \tau + \frac {\lambda (\epsilon)}{g ^ {2} (\epsilon)} \mathbb {E} _ {\mathbf {x} _ {\epsilon}} \left[ - \log p _ {\epsilon} ^ {\boldsymbol {\theta}} (\mathbf {x} _ {\epsilon}) \right] \\ + \int_ {\epsilon} ^ {T} \left(\frac {\lambda (\tau)}{g ^ {2} (\tau)} - 1\right) \mathbb {E} _ {\mathbf {x} _ {\tau}} \left[ \operatorname {d i v} \left(\mathbf {f} \left(\mathbf {x} _ {\tau}, \tau\right)\right) \right] d \tau + \left[ \frac {\lambda (T)}{g ^ {2} (T)} - 1 \right] \mathbb {E} _ {\mathbf {x} _ {T}} \left[ \log \pi \left(\mathbf {x} _ {T}\right) \right]. \\ \end{array} +$$ + +Proof. We prove the theorem by using + +$$ +\begin{array}{l} \int_ {\epsilon} ^ {T} \lambda (t) A (t) d t = \int_ {\epsilon} ^ {T} \left[ \int_ {\epsilon} ^ {t} \left(\frac {\lambda (t)}{g ^ {2} (t)}\right) ^ {\prime} d \tau + \frac {\lambda (\epsilon)}{g ^ {2} (\epsilon)} \right] g ^ {2} (t) A (t) d t \\ = \int_ {\epsilon} ^ {T} \int_ {\epsilon} ^ {T} 1 _ {[ \epsilon , t ]} (\tau) \left(\frac {\lambda (\tau)}{g ^ {2} (\tau)}\right) ^ {\prime} g ^ {2} (t) A (t) d \tau d t + \frac {\lambda (\epsilon)}{g ^ {2} (\epsilon)} \int_ {\epsilon} ^ {T} g ^ {2} (t) A (t) d t \tag {26} \\ = \int_ {\epsilon} ^ {T} \left(\frac {\lambda (\tau)}{g ^ {2} (\tau)}\right) ^ {\prime} \int_ {\tau} ^ {T} g ^ {2} (t) A (t) \mathrm {d} t \mathrm {d} \tau + \frac {\lambda (\epsilon)}{g ^ {2} (\epsilon)} \int_ {\epsilon} ^ {T} g ^ {2} (t) A (t) \mathrm {d} t. \\ \end{array} +$$ + +By plugging $A(t) = \frac{1}{2}\mathbb{E}_{\mathbf{x}_t}\left[\| \mathbf{s}_{\pmb{\theta}}(\mathbf{x}_t,t) - \nabla_{\mathbf{x}_t}\log p_t(\mathbf{x}_t)\| _2^2 -\| \log p_t(\mathbf{x}_t)\| _2^2\right]$ in Eq. (26), we have + +$$ +\begin{array}{l} \mathcal {L} (\boldsymbol {\theta}; \lambda , \epsilon) := \frac {1}{2} \int_ {\epsilon} ^ {T} \lambda (t) \mathbb {E} _ {\mathbf {x} _ {t}} \left[ \| \mathbf {s} _ {\boldsymbol {\theta}} (\mathbf {x} _ {t}, t) - \nabla_ {\mathbf {x} _ {t}} \log p _ {t} (\mathbf {x} _ {t}) \| _ {2} ^ {2} - \| \nabla_ {\mathbf {x} _ {t}} \log p _ {t} (\mathbf {x} _ {t}) \| _ {2} ^ {2} \right] d t \\ - \int_ {\epsilon} ^ {T} \mathbb {E} _ {\mathbf {x} _ {t}} \left[ \operatorname {d i v} (\mathbf {f} (\mathbf {x} _ {t}, t)) \right] d t - \mathbb {E} _ {\mathbf {x} _ {T}} \left[ \log \pi (\mathbf {x} _ {T}) \right] \\ = \int_ {\epsilon} ^ {T} \left(\frac {\lambda (\tau)}{g ^ {2} (\tau)}\right) ^ {\prime} \left[ \frac {1}{2} \int_ {\tau} ^ {T} g ^ {2} (t) \mathbb {E} _ {\mathbf {x} _ {t}} \left[ \| \mathbf {s} _ {\boldsymbol {\theta}} (\mathbf {x} _ {t}, t) - \nabla_ {\mathbf {x} _ {t}} \log p _ {t} (\mathbf {x} _ {t}) \| _ {2} ^ {2} - \| \nabla_ {\mathbf {x} _ {t}} \log p _ {t} (\mathbf {x} _ {t}) \| _ {2} ^ {2} \right] d t \right. \\ \left. - \int_ {\tau} ^ {T} \mathbb {E} _ {\mathbf {x} _ {t}} \left[ \operatorname {d i v} (\mathbf {f} (\mathbf {x} _ {t}, t)) \right] d t - \mathbb {E} _ {\mathbf {x} _ {T}} \left[ \log \pi (\mathbf {x} _ {T}) \right] \right] d \tau \\ + \frac {\lambda (\epsilon)}{g ^ {2} (\epsilon)} \left[ \frac {1}{2} \int_ {\epsilon} ^ {T} g ^ {2} (t) \mathbb {E} _ {\mathbf {x} _ {t}} \left[ \| \mathbf {s} _ {\boldsymbol {\theta}} \left(\mathbf {x} _ {t}, t\right) - \nabla_ {\mathbf {x} _ {t}} \log p _ {t} \left(\mathbf {x} _ {t}\right) \| _ {2} ^ {2} - \| \nabla_ {\mathbf {x} _ {t}} \log p _ {t} \left(\mathbf {x} _ {t}\right) \| _ {2} ^ {2} \right] d t \right. \tag {27} \\ \left. - \int_ {\epsilon} ^ {T} \mathbb {E} _ {\mathbf {x} _ {t}} \left[ \operatorname {d i v} \left(\mathbf {f} \left(\mathbf {x} _ {t}, t\right)\right) \right] \mathrm {d} t - \mathbb {E} _ {\mathbf {x} _ {T}} \left[ \log \pi \left(\mathbf {x} _ {T}\right) \right] \right] \\ + \int_ {\epsilon} ^ {T} \left(\frac {\lambda (\tau)}{g ^ {2} (\tau)}\right) ^ {\prime} \int_ {\tau} ^ {T} \mathbb {E} _ {\mathbf {x} _ {t}} \left[ \operatorname {d i v} \left(\mathbf {f} \left(\mathbf {x} _ {t}, t\right)\right) \right] d t d \tau + \left(\frac {\lambda (\epsilon)}{g ^ {2} (\epsilon)}\right) \int_ {\epsilon} ^ {T} \mathbb {E} _ {\mathbf {x} _ {t}} \left[ \operatorname {d i v} \left(\mathbf {f} \left(\mathbf {x} _ {t}, t\right)\right) \right] d t \\ \end{array} +$$ + +$$ +- \int_ {\epsilon} ^ {T} \mathbb {E} _ {\mathbf {x} _ {t}} \left[ \operatorname {d i v} (\mathbf {f} (\mathbf {x} _ {t}, t)) \right] d t + \mathbb {E} _ {\mathbf {x} _ {T}} \left[ \log \pi (\mathbf {x} _ {T}) \right] \left[ \int_ {\epsilon} ^ {T} \left(\frac {\lambda (\tau)}{g ^ {2} (\tau)}\right) ^ {\prime} d \tau + \frac {\lambda (\epsilon)}{g ^ {2} (\epsilon)} - 1 \right]. +$$ + +Also, plugging $A(t) = \frac{1}{g^2(t)}\mathbb{E}_{\mathbf{x}_t}\left[\mathrm{div}\big(\mathbf{f}(\mathbf{x}_t,t)\big)\right]$ into Eq. (26), we have + +$$ +\int_ {\epsilon} ^ {T} \frac {\lambda (t)}{g ^ {2} (t)} \mathbb {E} _ {\mathbf {x} _ {t}} [ \operatorname {d i v} (\mathbf {f} (\mathbf {x} _ {t}, t)) ] = \int_ {\epsilon} ^ {T} \left(\frac {\lambda (\tau)}{g ^ {2} (\tau)}\right) ^ {\prime} \int_ {\tau} ^ {T} \mathbb {E} _ {\mathbf {x} _ {t}} [ \operatorname {d i v} (\mathbf {f} (\mathbf {x} _ {t}, t)) ] d t d \tau + \left(\frac {\lambda (\epsilon)}{g ^ {2} (\epsilon)}\right) \int_ {\epsilon} ^ {T} \mathbb {E} _ {\mathbf {x} _ {t}} [ \operatorname {d i v} (\mathbf {f} (\mathbf {x} _ {t}, t)) ] d t. \tag {28} +$$ + +Using Eq. (27) and (28), we get + +$$ +\begin{array}{l} \mathcal {L} (\boldsymbol {\theta}; \lambda , \epsilon) = \int_ {\epsilon} ^ {T} \left(\frac {\lambda (\tau)}{g ^ {2} (\tau)}\right) ^ {\prime} \mathcal {L} (\boldsymbol {\theta}; g ^ {2}, \tau) d \tau + \frac {\lambda (\epsilon)}{g ^ {2} (\epsilon)} \mathcal {L} (\boldsymbol {\theta}; g ^ {2}, \epsilon) \tag {29} \\ + \int_ {\epsilon} ^ {T} \left(\frac {\lambda (t)}{g ^ {2} (t)} - 1\right) \mathbb {E} _ {\mathbf {x} _ {t}} \left[ \operatorname {d i v} (\mathbf {f} (\mathbf {x} _ {t}, t)) \right] d t + \left[ \frac {\lambda (T)}{g ^ {2} (T)} - 1 \right] \mathbb {E} _ {\mathbf {x} _ {T}} \left[ \log \pi (\mathbf {x} _ {T}) \right]. \\ \end{array} +$$ + +Then, applying Lemma 1 to Eq. (29) yields the desired result. + +Corollary 1. Suppose $\lambda(t)$ is a weighting function of the NCSN loss. If $\frac{\lambda(t)}{g^2(t)}$ is a nondecreasing and nonnegative continuous function on $[\epsilon, T]$ and zero on $[0, \epsilon)$ , then + +$$ +\begin{array}{l} \frac {1}{2} \int_ {\epsilon} ^ {T} \lambda (t) \mathbb {E} _ {\mathbf {x} _ {t}} \left[ \| \mathbf {s} _ {\boldsymbol {\theta}} (\mathbf {x} _ {t}, t) - \nabla_ {\mathbf {x} _ {t}} \log p _ {t} (\mathbf {x} _ {t}) \| _ {2} ^ {2} \right] d t + \frac {\lambda (T)}{g ^ {2} (T)} D _ {K L} (p _ {T} \| \pi) \\ \geq \int_ {\epsilon} ^ {T} \left(\frac {\lambda (\tau)}{g ^ {2} (\tau)}\right) ^ {\prime} D _ {K L} (p _ {\tau} \| p _ {\tau} ^ {\boldsymbol {\theta}}) \mathrm {d} \tau + \frac {\lambda (\epsilon)}{g ^ {2} (\epsilon)} D _ {K L} (p _ {\epsilon} \| p _ {\epsilon} ^ {\boldsymbol {\theta}}). \\ \end{array} +$$ + +Remark 1. A direct extension of the proof indicates that Theorem 1 still holds when $\frac{\lambda(t)}{g^2(t)}$ has finite jump on $[0, T]$ . + +Remark 2. The weight of $\frac{\lambda(T)}{g^2(T)}$ is the normalizing constant of the unnormalized truncation probability, $\mathbb{P}$ . + +Proof. By plugging $A(t) = \frac{1}{2}\mathbb{E}_{\mathbf{x}_t}\left[\| \mathbf{s}_{\boldsymbol{\theta}}(\mathbf{x}_t,t) - \nabla_{\mathbf{x}_t}\log p_t(\mathbf{x}_t)\| _2^2\right]$ in Eq. (26) and using Lemma 1, we have + +$$ +\begin{array}{l} \frac {1}{2} \int_ {\epsilon} ^ {T} \lambda (t) \mathbb {E} _ {\mathbf {x} _ {t}} \left[ \| \mathbf {s} _ {\boldsymbol {\theta}} (\mathbf {x} _ {t}, t) - \nabla_ {\mathbf {x} _ {t}} \log p _ {t} (\mathbf {x} _ {t}) \| _ {2} ^ {2} \right] d t + \frac {\lambda (T)}{g ^ {2} (T)} D _ {K L} (p _ {T} \| \pi) \\ = \int_ {\epsilon} ^ {T} \left(\frac {\lambda (\tau)}{g ^ {2} (\tau)}\right) ^ {\prime} \frac {1}{2} \int_ {\tau} ^ {T} g ^ {2} (t) \mathbb {E} _ {\mathbf {x} _ {t}} \left[ \| \mathbf {s} _ {\boldsymbol {\theta}} (\mathbf {x} _ {t}, t) - \nabla_ {\mathbf {x} _ {t}} \log p _ {t} (\mathbf {x} _ {t}) \| _ {2} ^ {2} \right] d t d \tau \\ + \left(\frac {\lambda (\epsilon)}{g ^ {2} (\epsilon)}\right) \frac {1}{2} \int_ {\epsilon} ^ {T} g ^ {2} (t) \mathbb {E} _ {\mathbf {x} _ {t}} \left[ \| \mathbf {s} _ {\boldsymbol {\theta}} (\mathbf {x} _ {t}, t) - \nabla_ {\mathbf {x} _ {t}} \log p _ {t} (\mathbf {x} _ {t}) \| _ {2} ^ {2} \right] d t + \frac {\lambda (T)}{g ^ {2} (T)} D _ {K L} (p _ {T} \| \pi) \\ \geq \int_ {\epsilon} ^ {T} \left(\frac {\lambda (\tau)}{g ^ {2} (\tau)}\right) ^ {\prime} \big [ D _ {K L} (p _ {\tau} \| p _ {\tau} ^ {\boldsymbol {\theta}}) - D _ {K L} (p _ {T} \| \pi) \big ] \mathrm {d} \tau + \frac {\lambda (\epsilon)}{g ^ {2} (\epsilon)} \big [ D _ {K L} (p _ {\epsilon} \| p _ {\epsilon} ^ {\boldsymbol {\theta}}) - D _ {K L} (p _ {T} \| \pi) \big ] + \frac {\lambda (T)}{g ^ {2} (T)} D _ {K L} (p _ {T} \| \pi) \\ = \int_ {\epsilon} ^ {T} \left(\frac {\lambda (\tau)}{g ^ {2} (\tau)}\right) ^ {\prime} D _ {K L} (p _ {\tau} \| p _ {\tau} ^ {\boldsymbol {\theta}}) \mathrm {d} \tau + \frac {\lambda (\epsilon)}{g ^ {2} (\epsilon)} D _ {K L} (p _ {\epsilon} \| p _ {\epsilon} ^ {\boldsymbol {\theta}}). \\ \end{array} +$$ + +# C. Additional Score Architectures and SDEs + +# C.1. Additional Score Architectures: Unbounded Parametrization + +From the released code of Song et al. (2021b), the NCSN++ network is modeled by $\mathbf{s}_{\theta}(\mathbf{x}_t,\log \sigma (t))$ , where the second argument is $\log \sigma (t)$ instead of $t$ . Experiments with $\mathbf{s}_{\theta}(\mathbf{x}_t,t)$ or $\mathbf{s}_{\theta}(\mathbf{x}_t,\sigma (t))$ were not as good as the parametrization of $\mathbf{s}_{\theta}(\mathbf{x}_t,\log \sigma (t))$ , and we analyze this experimental results from Lemma 2 and Proposition 1. + +![](images/415f1204ba63e2f5bc891d442ae195f52eec3fc496f7a95c8b09d0f5f88e1f6c.jpg) +(a) Approximate data score diverges. + +![](images/73e94eabfda9964f391dc5488361d53accbb030b4e4b2e5b1541f850e941d51d.jpg) +Figure 9: (a) The approximate data score, $\| \nabla_{\mathbf{x}_t}\log p_t(\mathbf{x}_t)\| _2^2 = \| \nabla_{\mathbf{x}_t}\log \int p_r(\mathbf{x}_0)p_{0t}(\mathbf{x}_t|\mathbf{x}_0)\mathrm{d}\mathbf{x}_0\| _2^2\approx$ $\| \nabla_{\mathbf{x}_t}\log p_{0t}(\mathbf{x}_t|\mathbf{x}_0)\| _2^2$ , diverges as $t\to 0$ . (b) Comparison of DDPM++ and UDDPM++ in terms of the cumulative density function of the second input. (c) Comparison of VESDE and RVESDE in terms of $\frac{\mathrm{d}}{\mathrm{d}t}\log \sigma^2$ + +![](images/fef1754fe7324bdd9853afeac8a36972c7acc55aeeb03b996ceba5c643c83326.jpg) +(b) Cumulative density function of $t$ and $\eta$ . +(c) VESDE violates geometric progression. + +Proposition 1. Let $\mathcal{H}_{[1,\infty)} = \{\mathbf{s}:\mathbb{R}^d\times [1,\infty)\to \mathbb{R}^d$ , s is locally Lipschitz}. Suppose a continuous vector field v defined on a $d$ -dimensional open subset $U$ of a compact manifold M is unbounded, and the projection of v on each axis is locally integrable. Then, there exists $\mathbf{s}\in \mathcal{H}_{[1,\infty)}$ such that $\lim_{\eta \to \infty}\mathbf{s}(\mathbf{x},\eta) = \mathbf{v}(\mathbf{x})$ a.e. on $U$ + +The gradient of the log transition probability diverges at $t \approx 0$ theoretically (Section A.2) and empirically (Figure 9-(a)). Here, in high-dimensional space, $p_{0t}(\mathbf{x}_t|\mathbf{x}_0) / p_{0t}(\mathbf{x}_t|\mathbf{x}_0)$ with $\mathbf{x}_0 \neq \mathbf{x}_0'$ is either zero or infinity. Thus, the data score is nearly identical to the gradient of the log transition probability, $\| \nabla_{\mathbf{x}_t}\log p_t(\mathbf{x}_t)\| _2^2 = \| \nabla_{\mathbf{x}_t}\log \int p_r(\mathbf{x}_0)p_{0t}(\mathbf{x}_t|\mathbf{x}_0)\mathrm{d}\mathbf{x}_0\| _2^2 \approx \|\nabla_{\mathbf{x}_t}\log p_{0t}(\mathbf{x}_t|\mathbf{x}_0)\| _2^2$ , and the observation of Figure 9-(a) is valid for the exact data score, as well. + +Although Lemma 2 is based on $\mathbf{s}_{\theta}(\mathbf{x}_t,t)$ , the identical result also holds for the parametrization of $\mathbf{s}_{\theta}(\mathbf{x}_t,\sigma (t))$ , so it indicates that both $\mathbf{s}_{\theta}(\mathbf{x}_t,t)$ and $\mathbf{s}_{\theta}(\mathbf{x}_t,\sigma (t))$ cannot estimate the data score as $t\to 0$ . On the other hand, Proposition 1 implies that there exists a score function that estimates the unbounded data score asymptotically, and Proposition 1 explains the reason why the parametrization of Song et al. (2021b), i.e., $\mathbf{s}_{\theta}(\mathbf{x}_t,\log \sigma (t))$ , is successful on score estimation. + +On top of that, we introduce another parametrization that particularly focuses on the score estimation near $t \approx 0$ . We name Unbounded NCSN++ (UNCSN++) as the network of $\mathbf{s}_{\theta}(\mathbf{x}_t, \eta(t))$ with $\eta(t) = \begin{cases} \log \sigma(t) & \text{if } \sigma(t) \geq \sigma_0 \\ -\frac{c_1}{\sigma(t)} + c_2 & \text{if } \sigma(t) < \sigma_0 \end{cases}$ and Unbounded DDPM++ (UDDPM++) as the network of $\mathbf{s}_{\theta}(\mathbf{x}_t, \eta(t))$ with $\eta(t) := \int \frac{g^2(t)}{\sigma^2(t)} \, \mathrm{d}t$ . + +In UNCSN++, $c_1, c_2$ and $\sigma_0$ are the hyperparameters. By acknowledging the parametrization of $\log \sigma(t)$ , we choose $\sigma_0$ as 0.01. Also, to satisfy the continuously differentiability of $\eta(t)$ , two hyperparameters $c_1$ and $c_2$ satisfy a system of equations with degree 2, so $c_1$ and $c_2$ are fully determined with this system of equations. + +The choice of such $\eta(t)$ for UDDPM++ is expected to enhance the score estimation near $t \approx 0$ because the input of $\eta(t)$ is distributed uniformly when we draw samples from the importance weight. Concretely, when the sampling distribution on the diffusion time is given by $p_{iw}(t) \propto \frac{g^2(t)}{\sigma^2(t)}$ , the $\eta$ -distribution from the importance sampling becomes $p(\eta) \propto 1$ , which is depicted in Figure 9-(b). + +Proof of Proposition 1. Let $h$ be a standard mollifier function. If $h_t(x) = t^{-n}h(\mathbf{x} / t)$ , then $v_{t} \coloneqq h_{t} * v$ converges to $v$ a.e. on $U$ as $t \to 0$ (Theorem 7-(ii) of Appendix C in (Evans, 1998)). Therefore, if we define $s(\mathbf{x},\eta) \coloneqq v_{1 / \eta}(\mathbf{x})$ on the domain of $v_{1 / \eta}(\mathbf{x})$ and $s(\mathbf{x},\eta) \coloneqq 0$ elsewhere, then $s(\mathbf{x},\eta) = v_{1 / \eta}(\mathbf{x}) \to v(\mathbf{x})$ a.e. on $U$ as $\eta \to \infty$ . + +Now, to show that $\mathbf{s}(\mathbf{x},\eta)$ is locally Lipschitz, let $\tilde{M}\times [\underline{\eta},\overline{\eta} ]$ be a compact subset of $\mathbb{R}^n\times [1,\infty)$ . From $\| \mathbf{s}(\mathbf{x}_1,\eta_1) - \mathbf{s}(\mathbf{x}_2,\eta_2)\| = \| v_{1 / \eta_1}(\mathbf{x}_1) - v_{1 / \eta_2}(\mathbf{x}_2)\| \leq \| v_{1 / \eta_1}(\mathbf{x}_1) - v_{1 / \eta_1}(\mathbf{x}_2)\| +\| v_{1 / \eta_1}(\mathbf{x}_2) - v_{1 / \eta_2}(\mathbf{x}_2)\|$ , if there exists $K_{1},K_{2} > 0$ such that $\| v_{1 / \eta_1}(\mathbf{x}_1) - v_{1 / \eta_1}(\mathbf{x}_2)\| \leq K_1\| \mathbf{x}_1 - \mathbf{x}_2\|$ and $\| v_{1 / \eta_1}(\mathbf{x}_1) - v_{1 / \eta_2}(\mathbf{x}_1)\| \leq K_2|\eta_1 - \eta_2|$ for all $\mathbf{x}_1,\mathbf{x}_2\in \tilde{M}$ and $\eta_1,\eta_2\in [\underline{\eta},\overline{\eta} ]$ , then $\mathbf{s}(\mathbf{x},\eta) = v_{1 / \eta}(\mathbf{x})$ is Lipschitz on $\tilde{M}\times [\underline{\eta},\overline{\eta} ]$ . + +First, since $v_{1/\eta}$ is infinitely differentiable on its domain (Theorem 7-(i) of Appendix C in (Evans, 1998)) and $\eta \in [\underline{\eta}, \overline{\eta}]$ , there exists $K_1 > 0$ such that $\| v_{1/\eta}(\mathbf{x}_1) - v_{1/\eta}(\mathbf{x}_2) \| \leq K_1 \| \mathbf{x}_1 - \mathbf{x}_2 \|$ . Second, the mollifier satisfies the uniform convergence on any compact subset of $U$ (Theorem 7-(iii) of Appendix C in (Evans, 1998)), which leads that $\| v_{1/\eta_1}(\mathbf{x}) - v_{1/\eta_2}(\mathbf{x}) \| \leq K_2 \left| \frac{1}{\eta_1} - \frac{1}{\eta_2} \right| = K_2 \frac{|\eta_1 - \eta_2|}{\eta_1 \eta_2} \leq K_3 |\eta_1 - \eta_2|$ for some $K_2, K_3 > 0$ . Therefore, $\mathbf{s}$ becomes an element of $\mathcal{H}_{[1,\infty)}$ . + +# C.2. Additional SDE: Reciprocal VESDE + +VESDE assumes $g(t) = \sigma_{min}(\frac{\sigma_{max}}{\sigma_{min}})^t\sqrt{2\log\frac{\sigma_{max}}{\sigma_{min}}}$ . Then, the variance of the transition probability $p_{0t}(\mathbf{x}_t|\mu_{VE}(t)\mathbf{x}_0,\sigma_{VE}^2 (t))$ becomes $\sigma_{VE}^{2}(t) = \int_{0}^{t}g^{2}(s)\mathrm{d}s = \sigma_{min}^{2}[(\frac{\sigma_{max}}{\sigma_{min}})^{2t} - 1]$ if the diffusion starts from $t = 0$ with the initial condition of $\mathbf{x}_0\sim p_r$ . VESDE was originally introduced in Song & Ermon (2020) in order to satisfy the geometric property for its smooth transition of the distributional shift. Mathematically, the variance is geometric if $\frac{\mathrm{d}}{\mathrm{d}t}\log \sigma_{VE}^2 (t)$ is a constant, but VESDE loses the geometric property as illustrated in Figure 9-(c). + +To attain the geometric property in VESDE, VESDE approximates the variance to be $\tilde{\sigma}_{VE}^2 (t) = \sigma_{min}^2 (\frac{\sigma_{max}}{\sigma_{min}})^{2t}$ by omitting 1 from $\sigma_{VE}^{2}(t)$ . However, this approximation leads that $\mathbf{x}_t$ is not converging to $\mathbf{x}_0$ in distribution because $\sigma_{min}^2 (\frac{\sigma_{max}}{\sigma_{min}})^{2t}\rightarrow \sigma_{min}^2\neq 0$ as $t\to 0$ . Indeed, a bit stronger claim is possible: + +Proposition 2. There is no SDE that has the stochastic process $\{\mathbf{x}_t\}_{t\in [0,T]}$ , defined by a transition probability $p_{0t}(\mathbf{x}_t|\mathbf{x}_0) = \mathcal{N}(\mathbf{x}_t;\mathbf{x}_0,\sigma_{min}^2 (\frac{\sigma_{max}}{\sigma_{min}})^{2t}\mathbf{I})$ , as the solution. + +Proposition 2 indicates that if we approximate the variance by $\sigma_{VE}^2 (t)$ , then the reverse diffusion process cannot be modeled by a generative process. + +Rigorously, however, if the diffusion process starts from $t = -\infty$ , rather than $t = 0$ , then the variance of the transition probability becomes $\sigma_{VE, - \infty}^2 (t) = \int_{-\infty}^t g^2 (s)\mathrm{d}s = \sigma_{min}^2 (\frac{\sigma_{max}}{\sigma_{min}})^{2t}$ , which is exactly the variance $\tilde{\sigma}_{VE}^{2}(t)$ . Therefore, VESDE can be considered as a diffusion process starting from $t = -\infty$ . + +From this point of view, we introduce a SDE that satisfies the geometric progression property starting from $t = 0$ . We name a new SDE as the Reciprocal VE SDE (RVESDE). RVESDE has the identical form of SDE, $\mathrm{d}\mathbf{x}_t = g_{RVE}(t)\mathrm{d}\mathbf{w}_t$ , with + +$$ +g _ {R V E} (t) := \left\{ \begin{array}{l l} \sigma_ {m a x} \big (\frac {\sigma_ {m i n}}{\sigma_ {m a x}} \big) ^ {\frac {\epsilon}{t}} \frac {\sqrt {2 \epsilon \log \big (\frac {\sigma_ {m a x}}{\sigma_ {m i n}} \big)}}{t} & \mathrm {i f} t > 0, \\ 0 & \mathrm {i f} t = 0. \end{array} \right. +$$ + +Then, the transition probability of RVESDE becomes + +$$ +p _ {0 t} (\mathbf {x} _ {t} | \mathbf {x} _ {0}) = \mathcal {N} \bigg (\mathbf {x} _ {t}; \mathbf {x} _ {0}, \sigma_ {m a x} ^ {2} \bigg (\frac {\sigma_ {m i n}}{\sigma_ {m a x}} \bigg) ^ {\frac {2 \epsilon}{t}} \mathbf {I} \bigg). +$$ + +As illustrated in Figure 9-(c), RVESDE attains the geometric property at the expense of having reciprocated time, $1 / t$ . Also, RVESDE satisfies $\sigma_{RVE}^2 (\epsilon) = \sigma_{min}^2$ and $\sigma_{RVE}^2 (T)\approx \sigma_{max}^2$ . The existence and uniqueness of solution for RVESDE is guaranteed by Theorem 5.2.1 in (Oksendal, 2013). + +# D. Implementation Details + +# D.1. Experimental Details + +Training Throughout the experiments, we train our model with a learning rate of 0.0002, warmup of 5000 iterations, and gradient clipping by 1. For UNCSN++, we take $\sigma_{min} = 10^{-3}$ , and for NCSN++, we take $\sigma_{min} = 10^{-2}$ . On ImageNet32 training of the likelihood weighting and the variance weighting without Soft Truncation, we take $\epsilon = 5 \times 10^{-5}$ , following the setting of Song et al. (2021a). Otherwise, we take $\epsilon = 10^{-5}$ . For other hyperparameters, we run our experiments according to Song et al. (2021b;a). + +On datasets of resolution $32 \times 32$ , we use the batch size of 128, which consumes about 48Gb GPU memory. On STL-10 with resolution $48 \times 48$ , we use the batch size of 192, and on datasets of resolution $64 \times 64$ , we experiment with 128 batch size. The batch size for the datasets of resolution $256 \times 256$ is 40, which takes nearly 120Gb of GPU memory. On the dataset of $1024 \times 1024$ resolution, we use the batch size of 16, which takes around 120Gb of GPU memory. We use five NVIDIA RTX-3090 GPU machines to train the model exceeding 48Gb, and we use a pair of NVIDIA RTX-3090 GPU machines to train the model that consumes less than 48Gb. + +Evaluation We apply the EMA with rate of 0.999 on NCSN++/UNCSN++ and 0.9999 on DDPM++/UDDPM++. For the density estimation, we obtain the NLL performance by the Instantaneous Change of Variable (Song et al., 2021b; Chen et al., 2018). We choose $[\epsilon = 10^{-5}, T = 1]$ to integrate the instantaneous change-of-variable of the probability flow as default, even for the ImageNet32 dataset. In spite that Song et al. (2021b;a) integrates the change-of-variable formula with the + +Table 10: Ablation study of Soft Truncation with/without the reconstruction term when training on CIFAR-10 trained with DDPM++ (VP). + +
LossSoft TruncationReconstruction Term for TrainingNLLNELBOFID
Ex0[-log pθ(x0)] (before correction)Ex[-log pθ(xε)] + R(θ) (after correction)L(θ; g2, ε) (without residual)L(θ; g2, ε) + R(θ) (with residual)ODE
L(θ; g2, ε)XX2.973.033.113.136.70
L(θ; g2, ε) + Ex0, xε[-log p(x0|xε)]X✓3.012.993.073.096.93
LST(θ; g2, P1) = EP1(τ) [L(θ; g2, τ)] = EP1(τ) [L(θ; g2, τ)]✓X2.983.013.083.083.96
EP1(τ) [L(θ; g2, τ) + R(θ)✓✓2.952.983.043.044.23
+ +starting variable to be $\mathbf{x}_0$ , Table 5 of Kim et al. (2022) analyzes that there are significant difference between starting from $\mathbf{x}_{\epsilon}$ and $\mathbf{x}_0$ , if $\epsilon$ is not small enough. Therefore, we follow Kim et al. (2022) to compute $\mathbb{E}_{\mathbf{x}_{\epsilon}}\left[-\log p_{\epsilon}^{\theta}(\mathbf{x}_{\epsilon})\right]$ . However, to compare with the baseline models, we also evaluate the way Song et al. (2021b;a) and Vahdat et al. (2021) compute NLL. We denote the way of Kim et al. (2022) as after correction and Song et al. (2021a) as before correction, throughout the appendix. We dequantize the data variable by the uniform dequantization (Ho et al., 2019) for both after-and-before corrections. In the main paper, we only report the after correction performances. + +For the sampling, we apply the Predictor-Corrector (PC) algorithm introduced in Song et al. (2021b). We set the signal-to-noise ratio as 0.16 on $32 \times 32$ datasets, 0.17 on $48 \times 48$ and $64 \times 64$ datasets, 0.075 on $256 \times 256$ sized datasets, and 0.15 on $1024 \times 1024$ . On datasets less than $256 \times 256$ resolution, we iterate 1,000 steps for the PC sampler, while we apply 2,000 steps on the other high-dimensional datasets. Throughout the experiments for VESDE, we use the reverse diffusion (Song et al., 2021b) for the predictor algorithm and the annealed Langevin dynamics (Welling & Teh, 2011) for the corrector algorithm. For VPSDE, we use the Euler-Maruyama for the predictor algorithm, and we do not use any corrector algorithm. + +We compute the FID score (Song et al., 2021b) based on the modified Inception V1 network $^3$ using the tensorflow-gan package for CIFAR-10 dataset, and we use the clean-FID (Parmar et al., 2022) based on the Inception V3 network (Szegedy et al., 2016) for the remaining datasets. We note that FID computed by (Parmar et al., 2022) reports a higher FID score compared to the original FID calculation $^4$ . + +# E. Additional Experimental Results + +# E.1. Ablation Study on Reconstruction Term + +Table 10 presents that the training with the reconstruction term outperforms the training without the reconstruction term on NLL/NELBO with the sacrifice on sample generation. If $\tau$ is fixed as $\epsilon$ , then the bound + +$$ +\mathbb {E} _ {\mathbf {x} _ {0}} \big [ - \log p _ {0} ^ {\pmb {\theta}} (\mathbf {x} _ {0}) \big ] \leq \mathcal {L} (\pmb {\theta}; g ^ {2}, \tau) + \mathbb {E} _ {\mathbf {x} _ {0}, \mathbf {x} _ {\tau}} \big [ - \log p (\mathbf {x} _ {0} | \mathbf {x} _ {\tau}) \big ] +$$ + +is tight enough to estimate the negative log-likelihood. However, if $\tau$ is a subject of random variable, then the bound is not tight to the negative log-likelihood, as evidenced in Figure 1-(b). On the other hand, if we do not count the reconstruction, then the bound becomes + +$$ +\mathbb {E} _ {\mathbf {x} _ {0}} \left[ - \log p _ {\tau} ^ {\boldsymbol {\theta}} (\mathbf {x} _ {\tau}) \right] \leq \mathcal {L} (\boldsymbol {\theta}; g ^ {2}, \tau), +$$ + +up to a constant, and this bound becomes tight regardless of $\tau$ , which is evidenced in Figure 1-(c). This is why we call Soft Truncation as Maximum Perturbed Likelihood Estimation (MPLE). + +# E.2. Full Tables + +Tables 11, 12, 13, 14, and 15 present the full list of performances for Soft Truncation. + +Table 11: Ablation study of Soft Truncation for $\mathbf{{VPG}}$ (VP). + +
DatasetLossSoft TruncationNLLNELBOFID
after correctionbefore correctionwith residualwithout residualODE
CIFAR-10L(θ; g2, ε)X3.032.973.133.116.70
L(θ; σ2, ε)X3.213.163.343.323.90
L(θ; gP1, ε)X3.063.023.183.146.11
LST(θ; g2, P1)✓3.012.983.083.083.96
ImageNet32L(θ; g2, ε)X3.923.903.943.9512.68
L(θ; σ2, ε)X3.953.964.004.019.22
L(θ; gP1, ε)X3.933.923.973.9811.89
LST(θ; g2, P1)✓3.903.873.923.929.52
LST(θ; g2, P0.9)✓3.903.883.913.918.42
+ +Table 12: Ablation study of Soft Truncation for various model architectures and diffusion SDEs on CelebA. + +
SDEModelLossNLLNELBOFID
after correctionbefore correctionwith residualwithout residualPCODE
VENCSN++L(θ; σ2, ε)3.412.373.423.963.95-
LSST(θ; σ2, P2)3.442.423.443.972.68-
RVEUNCSN++L(θ; g2, ε)2.011.962.012.173.36-
LSST(θ; g2, P2)1.971.912.022.181.92-
VPDDPM++L(θ; σ2, ε)2.142.072.212.223.032.32
LSST(θ; σ2, P1)2.172.082.292.262.881.90
UDDPM++L(θ; σ2, ε)2.112.072.202.213.234.72
LSST(θ; σ2, P1)2.162.082.282.252.221.94
DDPM++L(θ; g2, ε)2.001.932.092.095.313.95
LSST(θ; g2, P1)2.001.942.112.114.502.90
UDDPM++L(θ; g2, ε)1.981.952.122.154.653.98
LSST(θ; g2, P1)2.001.942.102.104.452.97
+ +# E.3. Generated Samples + +Figure 10 shows how images are created from the trained model, and Figures from 11 to 16 present non-cherry picked generated samples of the trained model. + +Table 13: Ablation study of Soft Truncation for various ${\sigma }_{min}$ (equivalently, $\epsilon$ ) on CIFAR-10 with UNCSN++ (RVE). + +
LossεNLLNELBOFID
after correctionbefore correctionwith residualwithout residualODE
L(θ; g2, ε)10-24.644.024.695.2038.82
10-33.513.203.523.906.21
10-43.052.983.083.246.33
10-53.032.973.133.116.70
LST(θ; g2, P1)10-24.654.034.695.2039.83
10-33.513.213.523.885.14
10-43.052.983.083.244.16
10-53.012.983.083.083.96
+ +Table 14: Ablation study of Soft Truncation for various $\mathbb{P}_k$ on CIFAR-10 trained with DDPM++ (VP). + +
LossNLLNELBOFID
after correctionbefore correctionwith residualwithout residualODE
LST(θ; g2, P0)3.243.163.393.346.27
LST(θ; g2, P0.8)3.033.003.053.053.61
LST(θ; g2, P0.9)3.032.993.133.133.45
LST(θ; g2, P1)3.012.983.083.083.96
LST(θ; g2, P1.1)3.022.993.093.103.98
LST(θ; g2, P1.2)3.032.993.093.093.98
LST(θ; g2, P2)3.012.973.103.096.31
LST(θ; g2, P3)3.022.963.093.096.54
LST(θ; g2, P∞) = L(θ; g2, ε)3.012.953.093.076.70
+ +Table 15: Ablation study of Soft Truncation for CIFAR-10 trained with DDPM++ when a diffusion is combined with a normalizing flow (Kim et al., 2022). We use $\mathbb{P}([a,b]) = \frac{1}{2} 1_{[a,b]}(\epsilon) + \frac{1}{2}\mathbb{P}_{0.9}([a,b])$ . + +
LossNLLNELBOFID
after correctionbefore correctionwith residualwithout residualODE
L(θ; g2, ε)2.972.942.972.966.06
L(θ; σ2, ε)3.173.113.233.183.61
L(θ; g2, P)3.012.983.023.013.89
+ +![](images/8fdae66d62bd705925429ffcbc2e2c779b91ca5b72b04cec5cec3bf528ffe110.jpg) +Figure 10: Image generation by denoising via predictor-corrector sampler. + +![](images/cb152635d51b8fdbd0509892eed336b561e5f32ec3d1beab1143af25afec626d.jpg) +Figure 11: Random samples of CIFAR-10. + +![](images/61e5a7ac0addf0687f44a4a55075add6e85d3d7a555d0da28877008b4e3bac93.jpg) +Figure 12: Random samples on CelebA. + +![](images/eb71970dd25bccc826456a57846c671e7d1e3175979c1b36371e5f9df1b68d37.jpg) +Figure 13: Random samples on LSUN Bedroom. + +![](images/74ab0e9ae7f2c13e34833ce8555b311ab449d857dd586bc9a56d22eb6409b512.jpg) +Figure 14: Random samples on LSUN Church. + +![](images/8504f0ebeed059899205e838d792c2934bde87747ab9dddeafff5a92ef576098.jpg) +Figure 15: Random samples on FFHQ 256. + +![](images/a503ae04b72be601f4d5bbc7f3dbb138b59a703efdb3f9e76d8eb518826c0f97.jpg) +Figure 16: Random samples on CelebA-HQ 256. \ No newline at end of file diff --git a/softtruncationauniversaltrainingtechniqueofscorebaseddiffusionmodelforhighprecisionscoreestimation/images.zip b/softtruncationauniversaltrainingtechniqueofscorebaseddiffusionmodelforhighprecisionscoreestimation/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..368dad12ea862d6f7d5500f0b5da36f5dbaf2668 --- /dev/null +++ b/softtruncationauniversaltrainingtechniqueofscorebaseddiffusionmodelforhighprecisionscoreestimation/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:119d62f2197ea5e7fed6d0b04886e69dad6b7ca7eb928a1bf15edb194ce8b715 +size 4083292 diff --git a/softtruncationauniversaltrainingtechniqueofscorebaseddiffusionmodelforhighprecisionscoreestimation/layout.json b/softtruncationauniversaltrainingtechniqueofscorebaseddiffusionmodelforhighprecisionscoreestimation/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..b24fa7283bfd4ccbc444fde26e43162b69dbab8d --- /dev/null +++ b/softtruncationauniversaltrainingtechniqueofscorebaseddiffusionmodelforhighprecisionscoreestimation/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b0ae20e5a2b761f6a3685be1fb22178c45b96695acbcaf5770ffc899f125fca9 +size 1044612 diff --git a/solvingstackelbergpredictiongamewithleastsquareslossviasphericallyconstrainedleastsquaresreformulation/e1801a6a-2554-4cd8-8b8d-a8601624dfec_content_list.json b/solvingstackelbergpredictiongamewithleastsquareslossviasphericallyconstrainedleastsquaresreformulation/e1801a6a-2554-4cd8-8b8d-a8601624dfec_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..4cd58e7c31eb041b4533c7ecdc4d37599b324571 --- /dev/null +++ b/solvingstackelbergpredictiongamewithleastsquareslossviasphericallyconstrainedleastsquaresreformulation/e1801a6a-2554-4cd8-8b8d-a8601624dfec_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0db0ff4282ec005200a41e3cb29f5e23e002040455797f3d5c2cb2c571d427dc +size 132862 diff --git a/solvingstackelbergpredictiongamewithleastsquareslossviasphericallyconstrainedleastsquaresreformulation/e1801a6a-2554-4cd8-8b8d-a8601624dfec_model.json b/solvingstackelbergpredictiongamewithleastsquareslossviasphericallyconstrainedleastsquaresreformulation/e1801a6a-2554-4cd8-8b8d-a8601624dfec_model.json new file mode 100644 index 0000000000000000000000000000000000000000..f2119f681afaecde5c900078dd81253cd71c0d85 --- /dev/null +++ b/solvingstackelbergpredictiongamewithleastsquareslossviasphericallyconstrainedleastsquaresreformulation/e1801a6a-2554-4cd8-8b8d-a8601624dfec_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5896eb935a981e8501ca44c05359af6d8c993c5552ab64704fd0d8d4a97b7fe9 +size 153247 diff --git a/solvingstackelbergpredictiongamewithleastsquareslossviasphericallyconstrainedleastsquaresreformulation/e1801a6a-2554-4cd8-8b8d-a8601624dfec_origin.pdf b/solvingstackelbergpredictiongamewithleastsquareslossviasphericallyconstrainedleastsquaresreformulation/e1801a6a-2554-4cd8-8b8d-a8601624dfec_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..d40781ce21bce3f358a79e90d9c5637b4a804b08 --- /dev/null +++ b/solvingstackelbergpredictiongamewithleastsquareslossviasphericallyconstrainedleastsquaresreformulation/e1801a6a-2554-4cd8-8b8d-a8601624dfec_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e2b1c11f44403fc4f83a2271a8f788e2ce3a22254cfc2514736c2ae56ea82042 +size 646288 diff --git a/solvingstackelbergpredictiongamewithleastsquareslossviasphericallyconstrainedleastsquaresreformulation/full.md b/solvingstackelbergpredictiongamewithleastsquareslossviasphericallyconstrainedleastsquaresreformulation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..994cef0b50f9b5c2d6a37d2d3b02f095b148a227 --- /dev/null +++ b/solvingstackelbergpredictiongamewithleastsquareslossviasphericallyconstrainedleastsquaresreformulation/full.md @@ -0,0 +1,581 @@ +# Solving Stackelberg Prediction Game with Least Squares Loss via Spherically Constrained Least Squares Reformulation + +Jiali Wang1 Wen Huang2 Rujun Jiang1 Xudong Li1 Alex L. Wang3 + +# Abstract + +The Stackelberg prediction game (SPG) is popular in characterizing strategic interactions between a learner and an attacker. As an important special case, the SPG with least squares loss (SPGLS) has recently received much research attention. Although initially formulated as a difficult bi-level optimization problem, SPG-LS admits tractable reformulations which can be polynomially globally solved by semidefinite programming or second order cone programming. However, all the available approaches are not well-suited for handling large-scale datasets, especially those with huge numbers of features. In this paper, we explore an alternative reformulation of the SPG-LS. By a novel nonlinear change of variables, we rewrite the SPG-LS as a spherically constrained least squares (SCLS) problem. Theoretically, we show that an $\epsilon$ optimal solution to the SCLS (and the SPG-LS) can be achieved in $\tilde{\mathcal{O}}(N/\sqrt{\epsilon})$ floating-point operations, where $N$ is the number of nonzero entries in the data matrix. Practically, we apply two well-known methods for solving this new reformulation, i.e., the Krylov subspace method and the Riemannian trust region method. Both algorithms are factorization free so that they are suitable for solving large scale problems. Numerical results on both synthetic and real-world datasets indicate that the SPG-LS, equipped with the SCLS reformulation, can be solved orders of magnitude faster than the state of the art. + +# 1. Introduction + +The big data era has led to an explosion in the availability of data from which to make decisions. It is thus indispensable to use machine learning techniques to gain deep insights from massive data. In practice, many classic data analytic approaches start by splitting available data into the training and test sets. Then, learning algorithms are fed with the training set and are expected to produce results which generalize well to the test set. However, this paradigm only works under the key implicit assumption that the available data in both training and test sets are independently and identically distributed, which, unfortunately, is not always the truth in practice. For example, in the context of email spam filtering, an attacker often adversarily generates spam emails based on his knowledge of the spam filter implemented by the email service provider (Brückner & Scheffer, 2011; Zhou et al., 2019). In addition to malicious attacks, sometimes the data providers may manipulate data for their own interests. For instance, health insurance policy holders may decide to modify self-reported data to reduce their premiums. On the other hand, the insurers (the "defenders" in this scenario) aim to select a good price model for the true data despite only seeing the modified data. + +In fact, these scenarios can be modeled by the Stackelberg prediction game (SPG) (Brückner & Scheffer, 2011; Shokri et al., 2012; Zhou & Kantarcioglu, 2016; Wahab et al., 2016; Zhou et al., 2019; Bishop et al., 2020) which characterizes the interactions between two players, a learner (or, a leader) and a data provider (or, a follower). In this setting, the learner makes the first move by selecting a learning model. Then the data provider, with full knowledge of the learner's model, is allowed to modify its data. The learner's goal is to minimize its own loss function under the assumption that the training data has been optimally modified from the data provider's perspective. From the above description, we see that the SPG model concerns two levels of optimization problems: The follower optimally manipulates its data and the leader makes its optimal decision taking into account the data manipulation. Formally, it is often formulated as a hierarchical mathematical problem or a bi-level optimization problem, which is generally NP-hard even in the simplest case with linear constraints and objectives (Jeroslow, 1985). + +To overcome this issue, Bishop et al. (2020) take the first step to focus on a subclass of SPGs that can be reformulated as fractional programs. Specifically, they assume that all the loss functions of the leader and the follower are least squares, and that a quadratic regularizer is added to the follower's loss to penalise its manipulation of the data. This assumption eventually turns the bi-level optimization problem into a single-level fractional optimization task which is proven to be polynomially globally solvable. Since no other assumption is made about the learner and data provider, this subclass of SPG, termed as the SPG-LS, is general enough to be applied in wide fields. However, the bisection algorithm proposed in Bishop et al. (2020) involves solving several tens of semidefinite programs (SDPs) which are computationally prohibitive in practice. Later, Wang et al. (2021b) improves over Bishop et al. (2020) by showing that the SPG-LS can be globally solved via solving only a single SDP with almost the same size as the ones in Bishop et al. (2020). Furthermore, this single SDP can be reduced to a second order cone program (SOCP). It is shown in Wang et al. (2021b) that the SOCP approach for solving SPG-LS can be over $20,000+$ times faster than the bisection method proposed in Bishop et al. (2020). Yet, the SOCP method is still not well-suited for solving large-scale SPG-LS. Indeed, the spectral decomposition in the SOCP reformulation process is time-consuming when the future dimension is high. This inevitably reduces the practical applicability of the SOCP approach for the SPG-LS. + +In this paper, we present a novel reformulation to resolve the above mentioned issues of the SOCP method. Specifically, a nonlinear change of variables is proposed to reformulate the SPG-LS as a spherically constrained least squares (SCLS) problem. Then, we prove that an optimal solution to the SPG-LS can be recovered easily from any optimal solution to the SCLS under a mild assumption. The SCLS can be seen as an equality constrained version of the trust region subproblem (Conn et al., 2000), which admits a large amount of existing research on practical algorithms and theoretical complexity analysis. Based on this, we show that an $\epsilon$ optimal solution1 of the SCLS and thus SPG-LS can be solved in $\tilde{\mathcal{O}}(N/\sqrt{\epsilon})$ flops, where $N$ denotes the number of nonzero entries of the data matrix and $\tilde{\mathcal{O}}(\cdot)$ hides the logarithmic factors. This means there exists a linear time algorithm for finding an $\epsilon$ optimal solution of the SPG-LS. Moreover, we demonstrate the empirical efficiency of our SCLS reformulation when matrix factorization free methods like the Krylov subspace method (Gould et al., 1999; Zhang & Shen, 2018) and the Riemannian trust region Newton (RTRNewton) method (Absil et al., 2007) are used as solvers. + +1We say $\bar{\mathbf{x}}$ is an $\epsilon$ optimal solution for an optimization problem $\min_{\mathbf{x}\in \mathcal{X}}f(\mathbf{x})$ , if $\bar{\mathbf{x}}\in \mathcal{X}$ and $f(\bar{\mathbf{x}})\leq \min_{\mathbf{x}\in \mathcal{X}}f(\mathbf{x}) + \epsilon$ . + +We summarise our contributions as follows: + +- We derive an SCLS reformulation for the SPG-LS that avoids spectral decomposition steps (which are expensive when the involved data matrices are large). Moreover, we show that an optimal solution to the SPGLS can be recovered from any optimal solution to the SCLS reformulation under a mild condition. +- Based on the reformulation, we show that an $\epsilon$ optimal solution for the SCLS can be found using $\tilde{\mathcal{O}}(1/\sqrt{\epsilon})$ matrix vector products. In other words, an $\epsilon$ solution can be obtained in running time $\tilde{\mathcal{O}}(N/\sqrt{\epsilon})$ , where $N$ is the number of nonzeros in the data matrix. Moreover, we show that an $\epsilon$ optimal solution of SCLS can be used to recover an $\epsilon$ optimal solution for the original SPG-LS. +- Two practically efficient algorithms, which are factorization free, are adopted to solve the SCLS reformulation. We show that the SCLS approach significantly outperforms the SOCP approach with experiments on both real and synthetic data sets. + +# 2. Preliminaries + +In this section, we elaborate on the SPG-LS problem adopting the same terminology as in Bishop et al. (2020); Wang et al. (2021b). To have a better understanding of our reformulation, a brief review of methods in Wang et al. (2021b), which is the fastest existing method for solving the SPG-LS, will also be provided. + +We assume that the learner has access to $m$ sample tuples $S = \{(\mathbf{x}_i, y_i, z_i)\}_{i=1}^m$ , where $\mathbf{x}_i \in \mathbb{R}^n$ is input data with $n$ features, $y_i$ and $z_i$ are the true output label of $\mathbf{x}_i$ and the label that the data provider would like to achieve, respectively. These samples are assumed to follow some fixed but unknown distribution $\mathcal{D}$ . The learner aims at training a linear predictor $\mathbf{w} \in \mathbb{R}^n$ to best estimate the true output label $y_i$ given the fake data. Meanwhile, the data provider, with full knowledge of the learner's predictive model $\mathbf{w}$ , selects its own strategy (i.e., the modified data $\hat{\mathbf{x}}_i$ ) to make the corresponding prediction $\mathbf{w}^T \hat{\mathbf{x}}_i$ close to the desired label $z_i$ . Note that there is also a regularizer, $\gamma > 0$ , to control the deviation from the original data $\mathbf{x}_i$ . This hyper-parameter adjusts the trade-off between data manipulation and closeness to the aimed target. + +The problem can be modeled as a Stackelberg prediction game (Brückner & Scheffer, 2011; Bishop et al., 2020). On the one hand, each data provider aims to minimize its own loss function with a regularizer that penalizes the manipulation of the data by solving the following optimization + +problem: + +$$ +\mathbf {x} _ {i} ^ {*} = \underset {\hat {\mathbf {x}} _ {i}} {\mathrm {a r g m i n}} \left\| \mathbf {w} ^ {T} \hat {\mathbf {x}} _ {i} - z _ {i} \right\| ^ {2} + \gamma \left\| \mathbf {x} _ {i} - \hat {\mathbf {x}} _ {i} \right\| _ {2} ^ {2} \quad i \in [ m ], +$$ + +where $\mathbf{w}$ is the learner's model parameter that is known to the data provider. On the other hand, the learner seeks to minimize the least squares loss with the modified data $\{\mathbf{x}_i^*\}_{i = 1}^m$ : + +$$ +\mathbf {w} ^ {*} \in \underset {\mathbf {w}} {\operatorname {a r g m i n}} \sum_ {i = 1} ^ {m} \left| \left| \mathbf {w} ^ {T} \mathbf {x} _ {i} ^ {*} - y _ {i} \right| \right| ^ {2}, +$$ + +To find the Stackelberg equilibrium of the two players, we focus on the following bi-level optimization problem + +$$ +\begin{array}{l} \min _ {\mathbf {w}} \quad \| X ^ {*} \mathbf {w} - \mathbf {y} \| ^ {2} \\ X ^ {*} = \underset {\hat {X}} {\operatorname {a r g m i n}} \| \hat {X} \mathbf {w} - \mathbf {z} \| ^ {2} + \gamma \| \hat {X} - X \| _ {F} ^ {2}, \tag {1} \\ \end{array} +$$ + +where the $i$ -th row of $X \in \mathbb{R}^{m \times n}$ is the input sample $\mathbf{x}_i$ and the $i$ -th entries of $\mathbf{y}, \mathbf{z} \in \mathbb{R}^m$ are labels $y_i$ and $z_i$ , respectively. + +In the following section, we have a quick review of single SDP and SOCP methods in Wang et al. (2021b). + +# 2.1. SDP Reformulation + +By using the Sherman-Morrison formula (Sherman & Morrison, 1950), the SPG-LS can be rewritten as a quadratic fractional program (Bishop et al., 2020) + +$$ +\inf _ {\mathbf {w}} \left\| \frac {\frac {1}{\gamma} \mathbf {z} \mathbf {w} ^ {T} \mathbf {w} + X \mathbf {w}}{1 + \frac {1}{\gamma} \mathbf {w} ^ {T} \mathbf {w}} - \mathbf {y} \right\| ^ {2}. \tag {2} +$$ + +Introducing an augmented variable $\alpha = \mathbf{w}^T\mathbf{w} / \gamma$ , we have the following quadratic fractional programming (QFP) reformulation. + +$$ +\begin{array}{l} \inf _ {\mathbf {w}, \alpha} v (\mathbf {w}, \alpha) \triangleq \left\| \frac {\alpha \mathbf {z} + X \mathbf {w}}{1 + \alpha} - \mathbf {y} \right\| ^ {2} \tag {3} \\ \begin{array}{c c} \text {s . t .} & \mathbf {w} ^ {T} \mathbf {w} = \gamma \alpha . \end{array} \\ \end{array} +$$ + +Lemma 2.1 (Theorem 3.3 in Wang et al. (2021b)). Problem (3) is equivalent to the following SDP + +$$ +\begin{array}{l l} \sup _ {\mu , \lambda} & \mu \\ \text {s . t .} & A - \mu B + \lambda C \succeq 0, \end{array} \tag {4} +$$ + +where $A = \left( \begin{array}{ccc}X^T X & X^T (\mathbf{z} - \mathbf{y}) & -X^T\mathbf{y}\\ (\mathbf{z} - \mathbf{y})^T X & \| \mathbf{z} - \mathbf{y}\| ^2 & -(\mathbf{z} - \mathbf{y})^T\mathbf{y}\\ -\mathbf{y}^T X & -\mathbf{y}^T (\mathbf{z} - \mathbf{y}) & \mathbf{y}^T\mathbf{y} \end{array} \right),B$ + +$\left( \begin{array}{cc}\mathcal{O}_n & \\ & 1 \end{array} \right)$ and $C = \left( \begin{array}{ccc}\frac{I_n}{\gamma} & & \\ & 0 & -\frac{1}{2}\\ & -\frac{1}{2} & 0 \end{array} \right)$ . Here $\mathcal{O}_n$ denotes a + +$n \times n$ matrix with all entries being zeros and $I_{n}$ denotes the $n \times n$ identity matrix. + +# 2.2. SOCP Reformulation + +Wang et al. (2021b) further constructed an invertible matrix $V$ such that $A, B$ and $C$ are simultaneously congruent to arrow matrices via the change of variables associated to $V$ , i.e., + +$$ +\tilde {A} := V ^ {T} A V = \left( \begin{array}{c c} D & \mathbf {b} \\ \mathbf {b} ^ {T} & c \end{array} \right), +$$ + +where $D = \mathrm{Diag}(d_1, \ldots, d_{n+1}) \in \mathbb{R}^{(n+1) \times (n+1)}$ , $\mathbf{b} \in \mathbb{R}^{n+1}$ and $c \in \mathbb{R}$ , and + +$$ +\tilde {B} := V B V = \left( \begin{array}{c c} \mathcal {O} _ {n + 1} & \\ & 4 \end{array} \right) a n d \tilde {C} = V ^ {T} C V = \left( \begin{array}{c c} \frac {1}{\gamma} I _ {n + 1} & \\ & - 1 \end{array} \right). +$$ + +Therefore the linear matrix inequality (LMI) constraint in (4) is equivalent to $\tilde{A} -\mu \tilde{B} +\lambda \tilde{C}\succeq 0$ . Using the generalized Schur complement, we further obtain an SOCP reformulation as follows. + +Lemma 2.2 (Theorem 4.1 in Wang et al. (2021b)). With the same notation in this section, problem (4) is equivalent to the following SOCP problem + +$$ +\begin{array}{l} \sup _ {\mu , \lambda , \mathbf {s}} \mu \\ \begin{array}{l l} \text {s . t .} & d _ {i} + \frac {\lambda}{\gamma} \geq 0, i \in [ n + 1 ], \\ & c - 4 \mu - \lambda - \sum_ {i = 1} ^ {n + 1} s _ {i} \geq 0, \end{array} \tag {5} \\ s _ {i} \left(d _ {i} + \frac {\lambda}{\gamma}\right) \geq b _ {i} ^ {2}, s _ {i} \geq 0, i \in [ n + 1 ]. \\ \end{array} +$$ + +To obtain the SOCP reformulation, we need a spectral decomposition to a matrix of order $(n + 1) \times (n + 1)$ (Wang et al., 2021b), which is expensive when the dimension is high and may lead to inaccurate solutions when the matrix is ill-conditioned. To amend this issue, we obtain in the next section a factorization free method based on a novel reformulation of problem (2). + +# 3. Main Results + +In this section, we show that using a nonlinear change of variables, we can rewrite (3) as a least squares problem over the unit sphere. This is the key observation of our paper. + +Before presenting our main results, we first make a blanket assumption on the nonemptiness of the optimal solution set of (2). + +Assumption 3.1. Assume that the optimal solution set of (2) (or equivalently, (3)) is nonempty. + +Our main result is that under Assumption 3.1, the QFP (3) can be reformulated as a spherical constrained least squares (SCLS) problem + +$$ +\begin{array}{l} \min _ {\tilde {\mathbf {w}}, \tilde {\alpha}} \quad \tilde {v} (\tilde {\mathbf {w}}, \tilde {\alpha}) \triangleq \left\| \frac {\tilde {\alpha}}{2} \mathbf {z} + \frac {\sqrt {\gamma}}{2} X \tilde {\mathbf {w}} - \left(\mathbf {y} - \frac {\mathbf {z}}{2}\right) \right\| ^ {2} \tag {6} \\ \mathrm {s . t .} \quad \tilde {\mathbf {w}} ^ {T} \tilde {\mathbf {w}} + \tilde {\alpha} ^ {2} = 1. \\ \end{array} +$$ + +A formal statement is deferred to Theorem 3.4. + +Before presenting our main results, we first introduce two lemmas that show how, given a feasible solution in (3), we can construct a feasible solution with the same objective value in (6) and vice versa (up to a minor achievability issue). + +Lemma 3.2. Suppose $(\mathbf{w},\alpha)$ is a feasible solution of (3). Then $(\tilde{\mathbf{w}},\tilde{\alpha})$ , defined as + +$$ +\tilde {\mathbf {w}} := \frac {2}{\sqrt {\gamma} (\alpha + 1)} \mathbf {w} \quad a n d \quad \tilde {\alpha} := \frac {\alpha - 1}{\alpha + 1}, \tag {7} +$$ + +is feasible to (6) and $v(\mathbf{w}, \alpha) = \tilde{v}(\tilde{\mathbf{w}}, \tilde{\alpha})$ . + +Proof. We first note that $(\tilde{\mathbf{w}},\tilde{\alpha})$ are well-defined as $\alpha \geq 0$ by the feasibility of $(\mathbf{w},\alpha)$ in (3). Next, we check feasibility of $(\tilde{\mathbf{w}},\tilde{\alpha})$ in (6): + +$$ +\begin{array}{l} \tilde {\mathbf {w}} ^ {T} \tilde {\mathbf {w}} + \tilde {\alpha} ^ {2} = \frac {4}{\gamma (\alpha + 1) ^ {2}} \mathbf {w} ^ {T} \mathbf {w} + \frac {(\alpha - 1) ^ {2}}{(\alpha + 1) ^ {2}} \\ = \frac {4 \alpha + (\alpha - 1) ^ {2}}{(\alpha + 1) ^ {2}} = 1. \\ \end{array} +$$ + +Here, the second equality follows from the fact that $\mathbf{w}^T\mathbf{w} = \gamma \alpha$ . Finally, we see that + +$$ +\begin{array}{l} \tilde {v} (\tilde {\mathbf {w}}, \tilde {\alpha}) \\ = \left\| \frac {\tilde {\alpha}}{2} \mathbf {z} + \frac {\sqrt {\gamma}}{2} X \tilde {\mathbf {w}} - (\mathbf {y} - \frac {\mathbf {z}}{2}) \right\| ^ {2} \\ = \left\| \frac {\alpha - 1}{2 (\alpha + 1)} \mathbf {z} + \frac {\sqrt {\gamma}}{2} X \frac {2}{\sqrt {\gamma} (\alpha + 1)} \mathbf {w} - (\mathbf {y} - \frac {\mathbf {z}}{2}) \right\| ^ {2} \\ = \left\| \frac {\alpha \mathbf {z} + X \mathbf {w}}{\alpha + 1} - \mathbf {y} \right\| ^ {2} = v (\mathbf {w}, \alpha). \\ \end{array} +$$ + +This completes the proof. + +![](images/c11b8239accb24d2119d9b7865ebbc5bd9b748b37895e969451026dc881b5ed6.jpg) + +Lemma 3.3. Suppose $(\tilde{\mathbf{w}},\tilde{\alpha})$ is feasible to (6) with $\tilde{\alpha}\neq 1$ Then $(\mathbf{w},\alpha)$ , defined as + +$$ +\mathbf {w} := \frac {\sqrt {\gamma}}{1 - \tilde {\alpha}} \tilde {\mathbf {w}} \quad a n d \quad \alpha := \frac {1 + \tilde {\alpha}}{1 - \tilde {\alpha}}, \tag {8} +$$ + +is feasible to (3) and $\tilde{v} (\tilde{\mathbf{w}},\tilde{\alpha}) = v(\mathbf{w},\alpha)$ + +Proof. We first note that $(\mathbf{w},\alpha)$ are well-defined as $\tilde{\alpha}\neq 1$ Next, we check feasibility of $(\mathbf{w},\alpha)$ in (2): + +$$ +\mathbf {w} ^ {T} \mathbf {w} = \frac {\gamma}{(1 - \tilde {\alpha}) ^ {2}} \tilde {\mathbf {w}} ^ {T} \tilde {\mathbf {w}} = \frac {\gamma (1 - \tilde {\alpha} ^ {2})}{(1 - \tilde {\alpha}) ^ {2}} = \frac {\gamma (1 + \tilde {\alpha})}{1 - \tilde {\alpha}} = \gamma \alpha . +$$ + +Here, the second equality follows from the fact that $\tilde{\mathbf{w}}^T\tilde{\mathbf{w}} + \tilde{\alpha}^2 = 1$ . Finally, we check the objective value of $(\mathbf{w},\alpha)$ : + +$$ +\begin{array}{l} \left\| \frac {\alpha \mathbf {z} + X \mathbf {w}}{1 + \alpha} - \mathbf {y} \right\| ^ {2} = \left\| \frac {(1 + \tilde {\alpha}) \mathbf {z} + \sqrt {\gamma} X \tilde {\mathbf {w}}}{(1 - \tilde {\alpha}) + (1 + \tilde {\alpha})} - \mathbf {y} \right\| ^ {2} \\ { = } { \left\| \frac { \tilde { \alpha } } { 2 } \mathbf { z } + \frac { \sqrt { \gamma } } { 2 } X \tilde { \mathbf { w } } - ( \mathbf { y } - \mathbf { z } / 2 ) \right\| ^ { 2 } . } \\ \end{array} +$$ + +Let $v^{*}$ and $\tilde{v}^{*}$ be the optimal values of (3) and (6), respectively. Now we are ready to present our main results. + +Theorem 3.4. Given Assumption 3.1, then there exists an optimal solution $(\tilde{\mathbf{w}},\tilde{\alpha})$ to (6) with $\tilde{\alpha}\neq 1$ . Moreover, $(\mathbf{w},\alpha)$ , defined by (8), is an optimal solution to (3) and $v^{*} = v(\mathbf{w},\alpha) = \tilde{v} (\tilde{\mathbf{w}},\tilde{\alpha}) = \tilde{v}^{*}$ . + +Proof. Since the feasible region of (6) is compact and $\tilde{v}$ is continuous, it follows from the well-known Weierstrass theorem that there exists at least one optimal solution to (6). + +Note that if $(\tilde{\mathbf{w}},\tilde{\alpha})$ with $\tilde{\alpha} = 1$ is a feasible solution in (6), we must have $\tilde{\mathbf{w}} = \mathbf{0}$ . Now we claim that $(\mathbf{0},1)$ cannot be the unique optimal solution to (6). Suppose on the contrary that $(\mathbf{0},1)$ is the unique optimal solution to (6). Let $(\mathbf{w}^{*},\alpha^{*})$ be any optimal solution to (3). Then, from Lemma 3.2, we have + +$$ +v \left(\mathbf {w} ^ {*}, \alpha^ {*}\right) = \tilde {v} \left(\tilde {\mathbf {w}} ^ {*}, \tilde {\alpha} ^ {*}\right), \tag {9} +$$ + +where $\tilde{\mathbf{w}}^{*} := \frac{2}{\sqrt{\gamma}(\alpha^{*} + 1)}\mathbf{w}^{*}$ , $\tilde{\alpha}^{*} := \frac{\alpha^{*} - 1}{\alpha^{*} + 1} < 1$ , and $(\tilde{\mathbf{w}}^{*}, \tilde{\alpha}^{*})$ is feasible to (6). Since $(\mathbf{0}, 1)$ is the unique optimal solution to (6), it holds that + +$$ +\tilde {v} \left(\tilde {\mathbf {w}} ^ {*}, \tilde {\alpha} ^ {*}\right) > \tilde {v} (\mathbf {0}, 1) = \| \mathbf {z} - \mathbf {y} \| ^ {2}. \tag {10} +$$ + +On the other hand, for any $\mathbf{w} \neq 0$ and $t > 0$ , the pair $(t\mathbf{w}, t^2\mathbf{w}^T\mathbf{w} / \gamma)$ is clearly feasible to (3) with objective value + +$$ +\begin{array}{l} v (t \mathbf {w}, t ^ {2} \mathbf {w} ^ {T} \mathbf {w} / \gamma) \\ \begin{array}{r l}=&\left\| \frac {t ^ {2} \mathbf {w} ^ {T} \mathbf {w} / \gamma}{1 + t ^ {2} \mathbf {w} ^ {T} \mathbf {w} / \gamma} \mathbf {z} + \frac {t}{1 + t ^ {2} \mathbf {w} ^ {T} \mathbf {w} / \gamma} X \mathbf {w} - \mathbf {y} \right\| ^ {2}\\\rightarrow&\| \mathbf {z} - \mathbf {y} \| ^ {2}, \text {a s} t \rightarrow \infty .\end{array}\tag {11} \\ \end{array} +$$ + +Consequently, for sufficiently large $t$ , we must have from (9), (10) and (11) that + +$$ +v \left(\mathbf {w} ^ {*}, \alpha^ {*}\right) > v \left(t \mathbf {w}, t ^ {2} \mathbf {w} ^ {T} \mathbf {w} / \gamma\right), +$$ + +which contradicts the optimality of $(\mathbf{w}^{*},\alpha^{*})$ to (3). + +The above claim shows that there exists an optimal solution $(\tilde{\mathbf{w}},\tilde{\alpha})$ to (6) with $\tilde{\alpha}\neq 1$ . Then, Lemma 3.3 yields $\tilde{v} (\tilde{\mathbf{w}},\tilde{\alpha}) = \tilde{v}^{*} = v(\mathbf{w},\alpha)\geq v^{*}$ with $(\mathbf{w},\alpha)$ defined in (8). Similarly, under Assumption 3.1, from Lemma 3.2, we see that $v^{*}\geq \tilde{v}^{*}$ . Thus, $v^{*} = \tilde{v}^{*}$ . The proof is completed. + +We remark that the other direction of above theorem also holds. That is, under Assumption 3.1, there exists an optimal solution $(\mathbf{w},\alpha)$ to (3), and, furthermore, $(\tilde{\mathbf{w}},\tilde{\alpha})$ , defined by (7), is optimal to (6). We also remark that using the relationship (8) and the equivalence of (2) and (3), an $\epsilon$ optimal solution of the SCLS can be used to recover an $\epsilon$ optimal solution of the SPG-LS. + +Letting $\hat{L} = \left(\frac{\sqrt{\gamma}}{2} X\quad \frac{\mathbf{z}}{2}\right)$ and $\mathbf{r} = (\tilde{\mathbf{w}}_{\tilde{\alpha}})$ , we can rewrite problem (6) in a more compact form + +$$ +\min _ {\mathbf {r}} q (\mathbf {r}) \quad \text {s . t .} \mathbf {r} ^ {T} \mathbf {r} = 1, \tag {12} +$$ + +where $q(\mathbf{r})$ is a least squares + +$$ +q (\mathbf {r}) = \left\| \hat {L} \mathbf {r} - \left(\mathbf {y} - \mathbf {z} / 2\right) \right\| _ {2} ^ {2} = \mathbf {r} ^ {T} H \mathbf {r} + 2 \mathbf {g} ^ {T} \mathbf {r} + p \tag {13} +$$ + +with $H = \hat{L}^T\hat{L}$ , $\mathbf{g} = \hat{L}^T(\mathbf{z}/2 - \mathbf{y})$ , $p = (\mathbf{z}/2 - \mathbf{y})^T(\mathbf{z}/2 - \mathbf{y})$ . + +In the following of this paper, we focus on solving (12). Problem (12) is closed related to the well-known trust region subproblem (TRS), where the sphere constraint is replaced by a unit ball constraint. There exist various methods for solving (12) from the literature on TRS (More & Sorensen, 1983; Gould et al., 1999; Conn et al., 2000; Hazan & Koren, 2016; Ho-Nguyen & Kilinc-Karzan, 2017; Zhang et al., 2017; 2018; Zhang & Shen, 2018; Carmon & Duchi, 2018), or the generalized trust region subproblem (GTRS) (More, 1993; Pong & Wolkowicz, 2014; Jiang & Li, 2019; 2020; Wang & Kılınc-Karzan, 2020; Wang et al., 2021a), which minimizes a (possible nonconvex) quadratic function over a (possible nonconvex) quadratic inequality or equality constraint. Note that the TRS differs from the SCLS in the constraint, and the GTRS contains the SCLS as a special case. + +# 4. Complexity and Algorithms + +In this section, we first show that in theory there exists a linear time algorithm to find an $\epsilon$ optimal solution for the SPG-LS. After that, we introduce two practically efficient algorithms to solve (12) (and thus recover a solution for the SPG-LS). + +We point out that the linear time algorithms for the TRS (Hazan & Koren, 2016; Ho- Nguyen & Kilinc-Karzan, 2017) can be adapted to design a linear time algorithm with complexity $\tilde{\mathcal{O}}(N/\sqrt{\epsilon})$ for the SCLS to achieve an $\epsilon$ optimal solution, and the linear time algorithms for the GTRS (Jiang & Li, 2020; Wang & Kılınc-Karzan, 2020; Wang et al., 2021a) indicate that the SCLS, as a special case of the GTRS, can also be solved in linear time $\tilde{\mathcal{O}}(N/\sqrt{\epsilon})$ . Here $N$ denotes the number of nonzero entries in the data matrix, and the logarithm in the runtime comes from the probability of success in Lanczos type methods for finding the smallest eigenvalue of a matrix. Once we obtain a solution $\tilde{\mathbf{r}}$ such that $\|\tilde{\mathbf{r}}\| = 1$ and $q(\tilde{\mathbf{r}}) \leq q(\mathbf{r}^*) + \epsilon$ , where $\mathbf{r}^*$ is an optimal solution of (12), we can set $\left(\frac{\tilde{\mathbf{w}}}{\tilde{\alpha}}\right) = \tilde{\mathbf{r}}$ and $(\mathbf{w}, \alpha)$ as in (8). Then $\mathbf{w}$ is an $\epsilon$ optimal solution to (2) because $v(\mathbf{w}, \alpha) = \tilde{v}(\tilde{\mathbf{w}}, \tilde{\alpha}) = q(\mathbf{r})$ and $q(\mathbf{r}^*) = v^*$ for the same reasoning. Thus, one can obtain an $\epsilon$ optimal solution to SPG-LS in runtime $\tilde{\mathcal{O}}(N/\sqrt{\epsilon})$ as the main cost is in solving the SCLS (12). + +However, in practice the computation of even an approximate minimum eigenvalue may be expensive. Instead, we will introduce two highly efficient algorithms to solve (6) + +without computing approximate eigenvalues. One is the Krylov subspace method (adapted to the spherically constrained case) proposed in Gould et al. (1999), and the other is the Riemannian trust region Newton (RTRNewton) method proposed in Absil et al. (2007). + +# 4.1. The Krylov Subspace Method + +The simplest idea of the Krylov subspace method (Section 5 in Gould et al. (1999)) solves a sequence of smaller dimensional problems in the same form of (12). Specifically, define $(k + 1)\mathrm{st}$ Krylov subspace + +$$ +\mathcal {K} _ {k} := \left\{\mathbf {g}, H \mathbf {g}, H ^ {2} \mathbf {g}, \dots , H ^ {k} \mathbf {g} \right\}. +$$ + +Let $Q_{k} = [\mathbf{q}_{0}, \mathbf{q}_{1}, \dots, \mathbf{q}_{k}] \in \mathbb{R}^{(n + 1) \times (k + 1)}$ be an orthonormal basis produced by the generalized Lanczos process. Then assuming $\dim \mathcal{K}_k = k + 1$ , we have that $Q_k^T H Q_k$ is a tridiagonal matrix with $Q_k^T Q_k = I_{k + 1}$ . Each iteration of the Krylov subspace method solves the following subproblem (adapted to the spherical constrained case) + +$$ +\min _ {r \in \mathcal {K} _ {k}, \| \mathbf {r} \| = 1} \mathbf {r} ^ {T} H \mathbf {r} + 2 \mathbf {g} ^ {T} \mathbf {r} + p. \tag {14} +$$ + +Gould et al. (1999) proved that the above subproblem can be solved efficiently in $\mathcal{O}(k)$ flops, if we use a safeguarded Newton's method, where the most expensive cost is $k$ matrix-vector products for $H^{t}\mathbf{g}$ , with $t\in [k]$ . We remark that though Gould et al. (1999) considered the case $\| \mathbf{r}\| \leq 1$ , the two cases $\| \mathbf{r}\| \leq 1$ and $\| \mathbf{r}\| = 1$ are essentially the same if the inequality in the TRS is active, which occurs if $\| (H - \lambda_{\min}I)^{\dagger}\mathbf{g}\| >1^{2}$ . Here $(\cdot)^{\dagger}$ denotes the Moore-Penrose pseudoinverse of a matrix $(\cdot)$ . + +To achieve better practical performance, Gould et al. (1999) proposed the generalized Lanczos trust-region (GLTR) method, which is an efficient implementation of the above Krylov subspace method. Based on an efficient nested restarting strategy, Zhang & Shen (2018) further proposed a nested Lanczos method for TRS (LTRSR), which is an improvement for GLTR. + +The convergence behavior of the Krylov subspace method is also well analyzed in the literature. The optimality condition of problem (12) is characterized as follows (adapted from Chapter 7 in Conn et al. (2000)) + +$$ +\begin{array}{l} (H + \lambda^ {*} I) \mathbf {r} ^ {*} = - \mathbf {g}, \\ H + \lambda^ {*} I \succeq 0, \tag {15} \\ \| \mathbf {r} ^ {*} \| = 1, \\ \end{array} +$$ + +where $\lambda^{*}$ is the corresponding Lagrangian multiplier. It is shown that there always exists an optimal solution $\mathbf{r}^{*}$ and a unique Lagrangian multiplier $\lambda^{*}$ , because different $\lambda^{*}$ s yield different values for $\| \mathbf{r}^{*}\|$ , contradicting $\| \mathbf{r}^{*}\| = 1$ . + +Define + +$$ +\kappa = \frac {\lambda_ {\max} + \lambda^ {*}}{\lambda_ {\min} + \lambda^ {*}}, \tag {16} +$$ + +for $\lambda^{*} \geq -\lambda_{\min}$ and use the convention $\frac{1}{0} = \infty$ . Here $\kappa$ is regarded as the condition number of (12) (Carmon & Duchi, 2018). Zhang & Shen (2018) and Carmon & Duchi (2018) demonstrated that when $\kappa < \infty$ , the Krylov subspace method satisfies + +$$ +f \left(\mathbf {r} _ {k}\right) - f \left(\mathbf {r} ^ {*}\right) \leq \mathcal {O} \left(\exp \left(- k / \sqrt {\kappa}\right)\right), +$$ + +where $\mathbf{r}_k$ is an optimal solution of (14), and $\mathbf{r}^*$ is an optimal solution for (12). Carmon & Duchi (2018) further proved that for all cases including $\lambda^* = -\lambda_{\mathrm{min}}$ , a variant of the Krylov subspace method where $\mathbf{g}$ is perturbed with random vector will output a solution $\mathbf{r}_k$ satisfies + +$$ +f \left(\mathbf {r} _ {k}\right) - f \left(\mathbf {r} ^ {*}\right) \leq \tilde {\mathcal {O}} \left(1 / k ^ {2}\right). +$$ + +for the SCLS (adapted from their analysis for the TRS). This indeed gives another $\tilde{\mathcal{O}}(N/\sqrt{\epsilon})$ time algorithm for solving the SPG-LS up to $\epsilon$ tolerance; see also Wang et al. (2021a) for extensions of this idea to the GTRS. + +Next we relate the existing convergence results with problem (12). + +Proposition 4.1. If $\| (H - \lambda_{\min}I)^{\dagger}\mathbf{g}\| >1$ , we must have $\lambda^{*} > - \lambda_{\mathrm{min}}$ and thus + +$$ +f \left(\mathbf {r} _ {k}\right) - f \left(\mathbf {r} ^ {*}\right) \leq \mathcal {O} \left(\exp \left(- k / \sqrt {\kappa}\right)\right), +$$ + +for $\kappa$ defined in (16). + +Proof. Note that if $\lambda^{*} = -\lambda_{\min}$ , then the first equation in (15) implies that $\mathbf{r}^{*} = -(H + \lambda^{*}I)^{\dagger}\mathbf{g}$ and thus the assumption in the proposition implies $\| \mathbf{r}^{*}\| > 1$ . However, this violates the constraint $\| \mathbf{r}^{*}\| = 1$ . Therefore we must have $\lambda^{*} > -\lambda_{\min}$ and thus $\kappa < \infty$ . + +In fact, we checked the data in the experiments in Section 5 and found that $\| \bar{\mathbf{r}}\| >1$ always holds in real-world datasets and our synthetic datasets. + +# 4.2. The Riemannian Trust Region Newton (RTRNewton) Method + +The feasible set in Problem (12) forms a unit sphere $S^n = \{\mathbf{r} \in \mathbb{R}^{n+1} : \mathbf{r}^T\mathbf{r} = 1\}$ . When $S^n$ is endowed with the Euclidean metric $\langle \mathbf{v}, \mathbf{u} \rangle = \mathbf{v}^T\mathbf{u}$ , the unit sphere is a Riemannian manifold (Absil et al., 2008). Therefore, the RTRNewton method proposed in Absil et al. (2007) can be used. The RTRNewton method for Problem (6) is summarized in Algorithm 1. + +Algorithm 1 relies on the notion of Riemannian gradient, Riemannian Hessian, and retraction. We refer to Absil et al. + +# Algorithm 1 A Riemannian Trust Region Newton Method + +Require: Initial iterate $\mathbf{r}_0$ , real numbers $\overline{\Delta} > 0$ , $\Delta_0 \in (0, \overline{\Delta})$ , $c \in (0, 0.25)$ , $\tau_1 \in (0, 1)$ , and $\tau_2 > 1$ ; + +1: for $k = 0, 1, 2, \ldots$ do +2: Obtain $s_k \in \mathbb{R}^d$ by (approximately) solving + +$$ +\mathbf {s} _ {k} \approx \underset {\| \mathbf {s} \| _ {2} \leq \Delta_ {k}} {\operatorname {a r g m i n}} m _ {k} (\mathbf {s}), \tag {17} +$$ + +where $m_{k}(\mathbf{s}) = q(\mathbf{r}_{k}) + \mathbf{s}^{T}\mathrm{grad}q(\mathbf{r}_{k})+$ $\frac{1}{2}\mathbf{s}^T\mathrm{Hess}q(\mathbf{r}_k)[\mathbf{s}]$ ,grad $q$ denotes the Riemannian gradient of $q$ in (18), and Hess $q$ denotes the Riemannian Hessian of $q$ in (19); + +3: Set $\rho_{k}\gets \frac{q(\mathbf{r}_{k}) - q(R_{\mathbf{r}_{k}}(\mathbf{s}_{k}))}{m_{k}(0) - m_{k}(\mathbf{s}_{k})}$ , where $R$ denotes the retraction in (20); + +4: if $\rho_{k} > c$ then + +5: $\mathbf{r}_{k + 1}\gets R_{\mathbf{r}_k}(\mathbf{s}_k);$ + +6: else + +7: $\mathbf{r}_{k + 1}\gets \mathbf{r}_k;$ + +8: end if + +9: if $\rho_{k} > \frac{3}{4}$ then + +10: If $\| \mathbf{s}_k\| \geq 0.8\Delta_k$ , then $\Delta_{k + 1}\gets \min (\tau_2\Delta_k,\overline{\Delta})$ otherwise $\Delta_{k + 1}\leftarrow \Delta_k$ + +11: else if $\rho_{k} < 0.1$ then + +12: $\Delta_{k + 1}\gets \tau_1\Delta_k;$ + +13: else + +14: $\Delta_{k + 1}\gets \Delta_k;$ + +15: end if + +16: end for + +(2008) for their rigorous definitions. Here, we give the Riemannian gradient, the Riemannian Hessian for Problem (12) and the used retraction. + +The Riemannian gradient of $q$ is given by + +$$ +\operatorname {g r a d} q (\mathbf {r}) = P _ {\mathrm {T r} \mathcal {S} ^ {n}} \nabla q (\mathbf {r}) = (I - \mathbf {r r} ^ {T}) (2 H \mathbf {r} + 2 \mathbf {g}), \tag {18} +$$ + +where $P_{\mathrm{T_r}\mathcal{S}^n}$ denotes the orthogonal projection onto the tangent space at $\mathbf{r}$ with $\mathrm{T_r}\mathcal{S}^n = \{\mathbf{s}:\mathbf{s}^T\mathbf{r} = 0\}$ , and $\nabla q(\mathbf{r})$ denotes the Euclidean gradient of $q$ , i.e., $\nabla q(\mathbf{r}) = 2H\mathbf{r} + 2\mathbf{g}$ . The action of the Riemannian Hessian of $q$ at $\mathbf{r}$ along $\mathbf{v} \in \mathrm{T_r}\mathcal{S}^n$ is given by + +$$ +\begin{array}{l} \operatorname {H e s s} q (\mathbf {r}) [ \mathbf {v} ] = P _ {\mathrm {T r} S ^ {n}} \left(\nabla^ {2} q (\mathbf {r}) \mathbf {v} - \mathbf {v r} ^ {T} \nabla q (\mathbf {r})\right), \\ = (I - \mathbf {r r} ^ {T}) (2 H \mathbf {v} - 2 \mathbf {v r} ^ {T} (H \mathbf {r} + \mathbf {g})), \tag {19} \\ \end{array} +$$ + +where $\nabla^2 q(\mathbf{r}) = 2H$ denotes the Euclidean Hessian of $q$ at $\mathbf{r}$ . The retraction $R$ that we use is given by + +$$ +R _ {\mathbf {r}} (\mathbf {v}) = \frac {\mathbf {r} + \mathbf {v}}{\| \mathbf {r} + \mathbf {v} \|}, \tag {20} +$$ + +where $\mathbf{r} \in S^n$ and $\mathbf{v} \in \mathrm{T}_{\mathbf{r}}S^n$ . + +The subproblem (17) is approximately solved by the truncated conjugate gradient method. We use the implementations in ROPTLIB (Huang et al., 2018). + +The global convergence and local superlinear convergence rate of RTRNewton have been established by Theorem 7.4.4 and Theorem 7.4.11 of Absil et al. (2008). We state the results in the theorem below. + +Theorem 4.2. Let $\{\mathbf{r}_k\}$ be a sequence of iterates generated by Algorithm 1. It follows that + +$$ +\lim _ {k \to \infty} \operatorname {g r a d} q (\mathbf {r} _ {k}) = 0. +$$ + +Suppose $\mathbf{r}^*$ is a nondegenerate local minimizer of $q$ , i.e., $\operatorname{grad} q(\mathbf{r}^*) = 0$ and $\operatorname{Hess} q(\mathbf{r}^*)$ is positive definite. Then there exists $c > 0$ such that for all sequence $\{\mathbf{r}_k\}$ generated by Algorithm 1 converging to $\mathbf{r}^*$ , there exists $K > 0$ such that for all $k > K$ , + +$$ +\operatorname {d i s t} \left(\mathbf {r} _ {k + 1}, \mathbf {r} ^ {*}\right) \leq c \operatorname {d i s t} \left(\mathbf {r} _ {k}, \mathbf {r} ^ {*}\right) ^ {2}. \tag {21} +$$ + +The proof for the theorem is deferred to Appendix A. The global convergence rate has also been established where the iteration complexity is $\mathcal{O}\left(\epsilon_g^{-2}\right)$ for $\| \operatorname{grad} q(x) \| \leq \epsilon_g$ . We refer interested readers to Theorem 3.9 of Boumal et al. (2019). + +# 4.3. Time complexity comparisons + +In this section, we give a theoretical worst case time complexity of different methods for solving the SPG-LS. First we point out that the RTRNewton cannot be guaranteed to converge to the global minimum of SPG-LS. In the worst case, the RTRNewton needs to solve $\mathcal{O}\left(\epsilon_g^{-2}\right)$ many trust region subproblems. This means the time complexity is much worse than the Krylov subspace method (Carmon & Duchi, 2018) studied in Section 4.1. + +Next we compare the time complexity of the Krylov subspace method and the SOCP method. In the case of dealing with a sparse data matrix, the time complexity of the Krylov subspace method is $\tilde{\mathcal{O}}(N/\sqrt{\epsilon})$ , where $N$ is the number of nonzero entries in the data matrix $X$ . Here, we use the fact that the cost of the matrix-vector product in the Krylov subspace method is $\mathcal{O}(N)$ as we can compute $H\mathbf{r}$ by $\hat{L}^T(\hat{L}\mathbf{r})$ for any given $\mathbf{r} \in \mathbb{R}^n$ . If $\kappa < \infty$ , then the complexity can be further improved to $\mathcal{O}(N\log(1/\epsilon))$ . In the dense case with $m = \mathcal{O}(n)$ , the complexity is $\tilde{\mathcal{O}}(N/\sqrt{\epsilon})$ and can be improved to $\mathcal{O}(n^2\log(1/\epsilon))$ if $\kappa < \infty$ . Next we consider the time complexity for the SOCP method, which consists of the time complexity of formulating the matrix $A$ , the spectral decomposition and the IPM for solving the SOCP. Since the spectral decomposition and the IPM can not benefit much from the data sparsity, we do not distinguish the sparse and dense cases for the SOCP method. Particularly, the cost + +of formulating the matrix $A$ is lower bounded by $\mathcal{O}(N)$ and upper bounded by $\mathcal{O}(n^2)$ and the spectral decomposition takes $O(n^{\omega})$ flops for some $\omega$ satisfying $2 < \omega < 3$ (Demmel et al., 2007). Meanwhile, the iteration complexity for solving the SOCP reformulation is $\mathcal{O}(\sqrt{n}\log(1/\epsilon))$ according to Monteiro & Tsuchiya (2000). As per iteration in cost in the IPM is $\mathcal{O}(n)$ , the total cost of the IPM is $\mathcal{O}\left(n^{\frac{3}{2}}\log(1/\epsilon)\right)$ . Therefore the worst case complexity of the SOCP method is $\mathcal{O}\left(n^{w} + n^{\frac{3}{2}}\log(1/\epsilon)\right)$ . + +Theoretically, it is hard to compare the Krylov subspace method and the SOCP method as the result depends on $\kappa$ , $N$ , $w$ and $\epsilon$ . In practice, it usually holds that $\kappa < \infty$ and the spectral decomposition step in the SOCP methods usually costs $\mathcal{O}(n^3)$ . In fact, our experiments show that the spectral decomposition step often needs more time than the IPM for the SOCP. Thus, the Krylov subspace method, which can effectively utilize the data sparsity, is much faster than the SOCP approach especially for solving large-scale problems. + +# 5. Experiment Results + +In this section, we present numerical results on both synthetic and real-world datasets to verify the superiority of our proposed reformulation in terms of computational costs. We refer a nested Lanczos Method for TRS (LTRSR) (Zhang & Shen, 2018) to perform the GLTR method, and use the implementation of Riemannian trust-region Newton (RTRNewton) (Absil et al., 2007) from Riemannian Manifold Optimization Library (ROPTLIB) (Huang et al., 2018). Similar as the setting in Wang et al. (2021b), we compare the running time of above two methods with the SDP and SOCP approaches in Wang et al. (2021b), averaged over 10 trials, to evaluate the performance of our new reformulation. All the four methods solve the SDP, SOCP or the SCLS reformulations to their default precision and the solutions to the SPG-LS are recovered accordingly. + +All simulations are implemented using MATLAB R2021b on a PC running Windows 10 Intel(R) Xeon(R) E5-2650 v4 CPU (2.2GHz) and 64GB RAM. We report the results of two real datasets and six synthetic datasets and defer other results to the supplementary material. In all following tests, the parameter $\gamma$ is set as 0.1. + +# 5.1. Real-world Dataset + +We first compare four methods on the red wine dataset (Cortez et al., 2009), which consist of 1599 instances each with 11 features. The output label is a physiochemical measurement ranged from 0 to 10, where a higher score means that the corresponding wine sample has better quality. Wine producers would like to manipulate the data to fool the learner to predict a higher score when the raw label is + +smaller than some threshold $t$ . We consider the case that there are two kinds of providers $\mathcal{A}_{\mathrm{modest}}$ and $\mathcal{A}_{\mathrm{severe}}$ , where the details of the manipulation are set the same as Wang et al. (2021b). + +![](images/b14b3fda3aeca72a74c13d8a367aa2af2ef4c37417f6b1aca644a3508d9c628b.jpg) +Figure 1. Comparison of four different algorithms on the red wine dataset. The left and right plots correspond to $\mathcal{A}_{\mathrm{modest}}$ and $\mathcal{A}_{\mathrm{severe}}$ , respectively. + +![](images/c3b9097d39dad3db142729557817bc84ead56a906b68bb5c784f91b3ccab76e1.jpg) + +![](images/390e7bfd8a5d2a517cf12310f8464817f760e2ac5b1359d81c7782cb5e2f9707.jpg) +Figure 2. Comparison of four different algorithms on the residential building dataset. The left and right plots correspond to $\mathcal{A}_{\mathrm{modest}}$ and $\mathcal{A}_{\mathrm{severe}}$ , respectively. + +![](images/9f2499edb5472ca83876a0499dad38fab06b58a7c6353c982595bd5b0f00e5dd.jpg) + +We also compare four methods on the residential building dataset3 from the UCI data repository (Dua & Graff, 2017) as well. The building dataset includes 372 samples with 107 features. Each feature reflects information of a certain session such as project date, physical and financial elements. The output label is the sale prices to real estate single-family residential apartments. We consider a scenario where the seller wants to manipulate the price to higher level. As a buyer, our task is to predict the fair price under fake data. We still consider two types of sellers: $\mathcal{A}_{\mathrm{modest}}$ with $\delta = 20$ and $\mathcal{A}_{\mathrm{severe}}$ with $\delta = 40$ . + +The computational time for both datasets is reported in Figures 1 and 2. It shows that LTRSR method outperforms others and follows by the SOCP and RTRNewton. One can also observe that RTRNewton is even more expensive than the SDP approach in Figure 1. The main reason is that in the red wine dataset, the number of features $n$ is quite small ( $n = 11$ ). Thus, the spectral decomposition step, as well as the iterations of the interior point method, in the SOCP approach is cheap. + +We then report the relative errors of objective values (MSEs) + +of the SOCP method and our methods in Table 1 for red wine and residential building datasets. Indeed, all the methods have a very high accuracy as the relative errors are only up to $3.37\mathrm{e} - 5$ . More MSE comparisons can be found in Appendix 2.1. + +Table 1. Relative error of objective values + +
Dataset(fSOCP - fLTRSR) / |fSOCP|(fSOCP - fRTRNew) / |fSOCP|
AVGMINMAXAVGMINMAX
Wine Modest6.17E-103.94E-124.23E-09-8.26E-10-4.66E-093.62E-09
Wine Severe1.32E-103.39E-121.84E-09-8.30E-11-4.07E-101.80E-09
Build Modest1.49E-071.93E-095.91E-07-2.19E-05-3.37E-05-1.28E-05
Build Severe3.02E-084.02E-101.25E-07-1.96E-06-3.06E-06-1.14E-06
+ +# 5.2. Synthetic Dataset + +From the previous subsection, we also see that SOCP, LTRSR and RTRNewton are much faster than the SDP approach. To have a comprehensive comparison on wall-clock time among SOCP, LTRSR and RTRNewton, we test these methods on synthetic experiments. + +# 5.2.1. DENSE DATA + +Table 2. Time (seconds) on synthetic data without sparsity + +
m = 2n
mnSOCP (eig time)RTRNewLTRSRRatio
200010000.585 (0.064)0.7430.03417
400020001.957 (0.317)2.4590.17711
8000400010.693 (2.758)9.2690.93111
12000600029.304 (9.444)18.8242.12014
16000800058.561 (21.634)40.7113.98215
2000010000114.376 (49.754)59.7686.09919
m = n
mnSOCP (eig time)RTRNewLTRSRRatio
100010000.454 (0.065)0.5940.01727
200020002.104 (0.325)2.6000.09722
4000400010.795 (2.698)6.9580.47823
6000600028.391 (9.481)17.8351.08326
8000800055.263 (21.555)35.5102.01127
100001000097.383 (40.091)58.0093.06532
m = 0.5n
mnSOCP (eig time)RTRNewLTRSRRatio
50010000.536 (0.059)0.5230.02224
100020001.748 (0.309)1.4320.05731
200040009.928 (2.526)6.9320.25140
3000600027.230 (8.848)19.1790.53251
4000800054.174 (20.258)28.9530.92858
50001000094.548 (37.771)52.7561.55861
+ +We first conduct experiments on dense synthetic dataset. To + +have better validation of the effectiveness of our proposed reformulation, we use the same artificial dataset in Wang et al. (2021b), which employs make_regression function in scikit-learn (Pedregosa et al., 2011) with setting the noise as 0.1 and other parameters as default. + +Table 2 summarises the comparison of time on different scales with $m = \ln$ , $l \in \{0.5,1,2\}$ . Here, "SOCP" represents total time needed for the SOCP approach (including "eig time"), "eig time" represents the spectral decomposition time in the SOCP approach, "RTRNew" represents the RTRNewton method, "LTRSR" represents the LTRSR method, "Ratio" represents the ratio of times of SOCP method and LTRSR. + +From Table 2, we find that in large scale setting, the two methods RTRNewton and LTRSR are more efficient. LTRSR is of orders faster than the other two methods. From the "Ratio" values we also see that the time cost of SOCP approach is several tens times of that of LTRSR. We also observe that the spectral decomposition time in formulating SOCP is expensive and takes about $40\%$ of total time. Indeed, the spectral decomposition time becomes much larger as $n$ increases, which is also evidenced from our experiments for the sparse data setting in Table 3 below. + +# 5.2.2. SPARSE DATA + +To further show the efficacy of our proposed reformulation, we conduct experiments on synthetic data with high feature dimension and various sparsity. We apply the sprandn function in MATLAB to obtain the data matrix $X \in \mathbb{R}^{m \times n}$ , whose $i$ -th row is input vector $\{\mathbf{x}_i\}_{i=1}^m$ . The noise measurements $\{\xi_i\}_{i=1}^m$ i.i.d from the uniform distribution $[0, 0.5]$ . Then the output label $\{y_i\}_{i=1}^m$ via $y_i = \mathbf{x}_i^T \boldsymbol{\beta} + \xi_i$ . Following Wang et al. (2021b), we set the fake output label as $z_i = \max \{y_i, y_{0.25}\}$ . + +Table 3 summarises time comparisons on synthetic datasets with different sparsity and different dimension for $m = 0.5n$ . From these tables, we find that LTRSR and RTRNewton perform much better than the dense case, and their superiority over the SOCP approach becomes larger. This is mainly because both methods are the matrix free methods that require only matrix vector products in each iteration. However, the SOCP do not benefit from sparsity as well as the other two methods. We find that, by comparing the "eig time" for different instances with the same dimension but different sparsity, the "eig time" dominates the time of SOCP approach as the spectral decomposition cannot utilize the sparsity of the data. From the "Ratio" values, we find that the outperformance of LTRSR grows considerably when the sparsity and problem size increase. In the case of $(m,n) = (15000,30000)$ and sparsity $= 0.0001$ , LTRSR takes up to $26,000+$ times faster than the SOCP approach. Moreover, our LTRSR takes less than 0.05 second for all the + +Table 3. Time (seconds) on synthetic data with sparsity + +
sparsity = 0.01
mnSOCP (eig time)RTRNewLTRSRRatio
50001000071.601 (39.432)13.1240.225318
750015000217.529 (120.456)26.5510.534407
1000020000513.751 (288.490)47.4111.049490
1250025000941.394 (539.619)69.4211.606586
15000300001539.443 (865.813)113.2232.416637
sparsity = 0.001
mnSOCP (eig time)RTRNewLTRSRRatio
50001000061.587 (45.253)1.4160.0282200
750015000153.075 (117.389)2.3790.0532888
1000020000335.956 (259.671)5.4530.1132973
1250025000638.175 (491.391)7.7150.1683799
15000300001082.261 (832.413)12.0900.2354605
sparsity = 0.0001
mnSOCP (eig time)RTRNewLTRSRRatio
50001000049.869 (45.462)0.3910.0095541
750015000141.507 (134.525)0.7160.01410108
1000020000310.991 (289.447)0.9790.02015550
1250025000587.124 (540.314)1.3010.03019571
1500030000991.070 (912.015)2.1710.03726786
+ +instances with sparsity $= 0.0001$ . More reports on relative errors of all methods are reported in Appendix 2.2. + +# 6. Conclusion + +We propose an SCLS reformulation for the SPG-LS and show its optimal solution can be used to recover an optimal solution of the SPG-LS. We further show that an $\epsilon$ optimal solution of the SPG-LS can be also recovered from an $\epsilon$ optimal solution of the SCLS. Moreover, such an $\epsilon$ optimal solution obtained in runtime $\tilde{\mathcal{O}}(N/\sqrt{\epsilon})$ . We also introduce two practical efficient methods, LTRSR and RTRNewton, for solving the SCLS. Experiments show that the SCLS approach is much faster than the existing best approach. In particular, the performance of the LTRSR dominates both RTRNewton and SOCP methods. + +# Acknowledgements + +Wen Huang is partly supported by the Fundamental Research Funds for the Central Universities 20720190060 and NSFC 12001455. Rujun Jiang is partly supported by NSFC 12171100 and 72161160340, and Natural Science Foundation of Shanghai 22ZR1405100. Xudong Li is partly supported by the "Chenguang Program" by Shanghai Education Development Foundation and Shanghai Municipal Education Commission 19CG02, and the Shanghai Science and Technology Program 21JC1400600. + +# References + +Absil, P.-A., Baker, C. G., and Gallivan, K. A. Trust-region methods on riemannian manifolds. Foundations of Computational Mathematics, 7(3):303-330, 2007. +Absil, P.-A., Mahony, R., and Sepulchre, R. Optimization algorithms on matrix manifolds. Princeton University Press, Princeton, NJ, 2008. ISBN 9780691132983. +Bishop, N., Tran-Thanh, L., and Gerding, E. Optimal learning from verified training data. In Advances in Neural Information Processing Systems 33, pp. 9520-9529. NeurIPS, 2020. +Boumal, N., Absil, P.-A., and Cartis, C. Global rates of convergence for nonconvex optimization on manifolds. IMA Journal of Numerical Analysis, 39(1):1-33, 2019. +Brückner, M. and Scheffer, T. Stackelberg games for adversarial prediction problems. In Proceedings of the 17th ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 547-555, 2011. +Carmon, Y. and Duchi, J. C. Analysis of krylov subspace solutions of regularized nonconvex quadratic problems. In Advances in Neural Information Processing Systems, pp. 10728-10738, 2018. +Conn, A. R., Gould, N. I., and Toint, P. L. Trust region methods. SIAM, 2000. +Cortez, P., Cerdeira, A., Almeida, F., Matos, T., and Reis, J. Modeling wine preferences by data mining from physicochemical properties. Decision support systems, 47(4): 547-553, 2009. +Demmel, J., Dumitriu, I., and Holtz, O. Fast linear algebra is stable. Numerische Mathematik, 108(1):59-91, 2007. +Dua, D. and Graff, C. UCI machine learning repository, 2017. URL http://archive.ics.uci.edu/ml. +Gould, N. I., Lucidi, S., Roma, M., and Toint, P. L. Solving the trust-region subproblem using the lanczos method. SIAM Journal on Optimization, 9(2):504-525, 1999. +Hazan, E. and Koren, T. A linear-time algorithm for trust region problems. Mathematical Programming, 158(1): 363-381, 2016. +Ho-Nguyen, N. and Kilinc-Karzan, F. A second-order cone based approach for solving the trust-region subproblem and its variants. SIAM Journal on Optimization, 27(3): 1485-1512, 2017. +Huang, W., Absil, P.-A., Gallivan, K. A., and Hand, P. Roptlib: an object-oriented c++ library for optimization on riemannian manifolds. ACM Transactions on Mathematical Software (TOMS), 44(4):1-21, 2018. + +Jeroslow, R. G. The polynomial hierarchy and a simple model for competitive analysis. Mathematical programming, 32(2):146-164, 1985. +Jiang, R. and Li, D. Novel reformulations and efficient algorithms for the generalized trust region subproblem. SIAM Journal on Optimization, 29(2):1603-1633, 2019. +Jiang, R. and Li, D. A linear-time algorithm for generalized trust region subproblems. SIAM Journal on Optimization, 30(1):915-932, 2020. +Monteiro, R. D. and Tsuchiya, T. Polynomial convergence of primal-dual algorithms for the second-order cone program based on the mz-family of directions. Mathematical programming, 88(1):61-83, 2000. +More, J. J. Generalizations of the trust region problem. Optimization methods and Software, 2(3-4):189-209, 1993. +More, J. J. and Sorensen, D. C. Computing a trust region step. SIAM Journal on scientific and statistical computing, 4(3):553-572, 1983. +Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B., Grisel, O., Blondel, M., Prettenhofer, P., Weiss, R., Dubourg, V., et al. Scikit-learn: Machine learning in python. the Journal of machine Learning research, 12:2825-2830, 2011. +Pong, T. K. and Wolkowicz, H. The generalized trust region subproblem. Computational optimization and applications, 58(2):273-322, 2014. +Sherman, J. and Morrison, W. J. 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. +Shokri, R., Theodorakopoulos, G., Troncoso, C., Hubaux, J.-P., and Le Boudec, J.-Y. Protecting location privacy: optimal strategy against localization attacks. In Proceedings of the 2012 ACM conference on Computer and communications security, pp. 617-627, 2012. +Wahab, O. A., Bentahar, J., Otrok, H., and Mourad, A. A stackelberg game for distributed formation of business-driven services communities. Expert Systems with Applications, 45:359-372, 2016. +Wang, A. L. and Kılınc-Karzan, F. The generalized trust region subproblem: solution complexity and convex hull results. Mathematical Programming, pp. 1-42, 2020. +Wang, A. L., Lu, Y., and Kilinc-Karzan, F. Implicit regularity and linear convergence rates for the generalized trust-region subproblem. arXiv preprint arXiv:2112.13821, 2021a. + +Wang, J., Chen, H., Jiang, R., Li, X., and Li, Z. Fast algorithms for stackelberg prediction game with least squares loss. In Proceedings of the 38th International Conference on Machine Learning, pp. 10708-10716. PMLR, 2021b. +Zhang, L.-H. and Shen, C. A nested lanczos method for the trust-region subproblem. SIAM Journal on Scientific Computing, 40(4):A2005-A2032, 2018. +Zhang, L.-H., Shen, C., and Li, R.-C. On the generalized lanczos trust-region method. SIAM Journal on Optimization, 27(3):2110-2142, 2017. +Zhang, L.-H., Yang, W. H., Shen, C., and Feng, J. Error bounds of the lanczos approach for the trust-region subproblem. Frontiers of Mathematics in China, 13(2): 459-481, 2018. +Zhou, Y. and Kantarcioglu, M. Modeling adversarial learning as nested stackelberg games. In Pacific-Asia Conference on Knowledge Discovery and Data Mining, pp. 350-362. Springer, 2016. +Zhou, Y., Kantarcioglu, M., and Xi, B. A survey of game theoretic approach for adversarial machine learning. Wiley Interdisciplinary Reviews: Data Mining and Knowledge Discovery, 9(3):e1259, 2019. + +# Appendix + +# A. Deferred proof for Theorem 4.2 + +Proof. We only need to verify the assumptions of Theorem 7.4.4 and Theorem 7.4.11 of Absil et al. (2008). + +By definition, the function $q$ is bounded below. Since the unit sphere is a compact manifold, we have that the Riemannian Hessian $q(\mathbf{r})$ is bounded above for any $\mathbf{r} \in S^n$ , that $q \circ R$ is radially Lipschitz continuously differentiable, and that $q$ is Lipschitz continuously differentiable by Proposition 7.4.5 and Corollary 7.4.6 of Absil et al. (2008). The implementation in ROPTLIB for the subproblem (17) is Algorithm 11 of Absil et al. (2008) with $\theta = 1$ . Therefore, the Cauchy decrease inequality is satisfied. It follows that all the assumptions of Theorem 7.4.4 are satisfied. + +Since Retraction (20) is second order, the assumption of (7.36) in Theorem 7.4.11 of Absil et al. (2008) holds with $\beta_{\mathcal{H}} = 0$ . Since the function $q$ is $C^\infty$ and the manifold is compact, the assumption of (7.37) in Theorem 7.4.11 of Absil et al. (2008) holds. The local quadratic convergence rate in (21) thus follows. + +# B. Additional Experiments + +In this section, we provide additional numerical results to further show the efficiency of our proposed reformulation. + +# 1. Real-world Dataset + +We demonstrate the speed of our methods on two other real-world datasets, the insurance dataset4 and the blogfeedback dataset5. Similar as the setting in previous section, we compare the wall-clock time of RTRNewton (Absil et al., 2007) and LTRSR (Zhang & Shen, 2018) approaches with the SDP and SOCP methods proposed in Wang et al. (2021b). + +We still apply four methods on the insurance dataset that has 1,338 instances with 7 features. Each feature shows information on certain aspects such as age, sex, bmi and region. The output labels are individual medical costs by buying health insurance. For model accuracy, we transform categorical features such as sex into a one-hot vector. We assume that the individuals incline to modify self-related data to reduce their insurance costs. Formally, the individual's desired outcome can be defined as $z_{i} = \max \{y_{i} + \delta, 0\}$ . We have two types of individual: $A_{\mathrm{modest}}$ with $\delta = -100$ and $A_{\mathrm{severe}}$ with $\delta = -300$ . All the hyperparameters are the same as those in Wang et al. (2021b). As an insurer, our goal is to select a good price model to predict the insurance costs as true as possible. + +To further illustrate the effectiveness of our new reformulation, we compare four methods on the blogfeedback dataset. The blog dataset contains 52,397 samples each with 281 features processed from raw feedback materials on the Internet. Each feature represents information of a certain session. The output label is the number of comments. As a learner, our task is to predict the future comments of blog. Similarly, we assume that the true output label $\mathbf{y}$ would be modified by data providers in order to achieve the goal of increasing blog comments. For example, public media intend to manipulate data to add the blog comments and enhance its news popularity. Formally, we define the altered label as $z_{i} = y_{i} + \delta$ . We still have two types of data providers: $\mathcal{A}_{\mathrm{modest}}$ with $\delta = 5$ and $\mathcal{A}_{\mathrm{severe}}$ with $\delta = 10$ . + +The wall-clock time comparison can be found in Figure 3. Similar to the previous cases, LTRSR outperforms other approaches. However, as the dimension in this problem is too small, the comparison of the other three methods does not match their performance for large scale problems. + +# 2. Synthetic Dataset + +To further demonstrate the efficiency and adaptiveness to high dimension problems of our proposed reformulation, we conduct experiments on more synthetic datasets with different hyperparameters and various dimensions and sparsity. + +![](images/ce63db3f8b68ee8ae7c7715b1a3e52a7160dc6c99bdfe05aa36016be5dff7920.jpg) +Figure 3. Performance comparison between different algorithms on the insurance and blog dataset. The left two plots correspond to the wall-clock time comparison of insurance dataset generated by $\mathcal{A}_{\mathrm{modest}}$ and $\mathcal{A}_{\mathrm{severe}}$ , whilst the right two plots correspond to the wall-clock time comparison of blog dataset generated by $\mathcal{A}_{\mathrm{modest}}$ and $\mathcal{A}_{\mathrm{severe}}$ . + +# 2.1. DENSE DATA + +We first perform experiments with $\gamma = 0.01$ on synthetic datasets without sparsity to show the superiority of our reformulation under different hyperparameter. All the other settings are the same as in Section 5.2.1. + +Table 4 shows the comparison of wall-clock time on different scales with $m = \ln$ , $l \in \{0.5,1,2\}$ , which is similar to the case of $\gamma = 0.1$ . We observed that both SCLS approaches are faster than the SOCP approach. Moreover, all the LTRSR is less than 6 seconds while the SOCP can take up to about 110 seconds. + +Table 4. Time (seconds) on synthetic data without sparsity, $\gamma = {0.01}$ + +
nm = 2nm = nm = 0.5n
SOCP (eig time)RTRNewLTRSRRatioSOCP (eig time)RTRNewLTRSRRatioSOCP (eig time)RTRNewLTRSRRatio
10000.619 (0.087)0.7120.031200.564 (0.086)0.7040.020280.466 (0.078)0.6490.01239
20002.244 (0.419)2.5190.138161.900 (0.471)1.8280.098192.438 (0.401)2.0920.06041
400012.123 (3.448)5.1790.9561311.597 (3.539)6.7890.4992311.645 (3.212)6.7780.24947
600033.093 (11.903)15.8572.1351631.262 (11.691)18.6171.0533032.812 (11.008)11.0700.56158
800066.816 (27.466)38.5013.7681863.983 (27.512)34.6551.9843259.725 (25.061)27.2010.96162
10000118.044 (49.477)59.5515.91620109.516 (50.018)54.0603.04836104.251 (47.261)39.6111.52968
+ +# 2.2. SPARSE DATA + +We proceed to perform experiments on large-scale sparse dataset of various scales $m = \ln l$ , $l \in \{1,2,3\}$ with different sparsity. All the other settings are the same as in Section 5.2.2. + +From Table 5, we observed the great superiority of our SCLS reformulation since all the LTRSR and RTRNewton method faster than SOCP method. LTRSR is of several orders faster than the SOCP approach, especially when the sparsity and dimension grow. The spectral time of decomposition in formulating SOCP is quite expensive as the problem size grows. In the case $(m,n) = (90000,30000)$ , sparsity $= 0.01$ , the decomposition time is up about 1000 seconds, while the LTRSR method only takes about 22 seconds to solve the problem. + +# C. Relative Error + +This section reports relative errors of function values and MSEs between SOCP and our methods for all our experiments in Tables 6, 7, 8 and 9. + +# 1. Real-world Dataset + +In Tables 6 and 7, we show the relative errors of MSEs on training sets and test sets, respectively. Here, abbreviations "Insur" represents insurance dataset, "Build" represents building dataset, "f" represents the function value of related methods and "M" represents its MSE. In Table 6, We observe that LTRSR is more accurate than SOCP as its relative error preserves positive. Indeed, all the methods have a very high accuracy as the relative errors are only up to $3.37\mathrm{e} - 5$ . Table 7 shows that all methods have similar test accuracy as the relative errors of the test MSEs of all the methods are up to $5.27\mathrm{e} - 4$ . + +Table 5. Time (seconds) on synthetic data with different sparsity + +
m = n
nsparsity = 0.01sparsity = 0.001sparsity = 0.0001
SOCP (eig time)RTRNewLTRSRRatioSOCP (eig time)RTRNewLTRSRRatioSOCP (eig time)RTRNewLTRSRRatio
1000084.547 (40.602)21.9470.48717456.101 (40.322)1.8920.06192041.854 (38.038)0.4990.0123488
15000254.85 (126.365)50.7971.142223160.486 (125.064)5.1660.1311225130.071 (118.582)0.5400.0187226
20000550.191 (281.018)107.3582.088264355.746 (278.687)10.9320.2221603299.496 (265.987)1.0750.02910327
250001090.231 (581.289)159.5923.502311728.118 (560.429)15.5430.3572040591.172 (509.912)1.2850.03815557
300001726.133 (963.081)248.3255.3933201240.319 (979.66)19.9470.52823491040.441 (888.321)2.3230.05618579
m = 2n
nsparsity = 0.01sparsity = 0.001sparsity = 0.0001
SOCP (eig time)RTRNewLTRSRRatioSOCP (eig time)RTRNewLTRSRRatioSOCP (eig timeRTRNewLTRSRRatio
10000108.861 (48.901)50.5081.0969964.521 (48.604)5.7650.11954245.599 (39.977)0.3260.0162850
15000316.424 (151.406)117.2172.609121173.231 (132.098)12.2300.257674148.608 (127.759)0.9470.0285307
20000643.464 (324.073)219.6225.056127379.145 (289.701)23.1990.457830338.119 (283.882)1.2410.0487044
250001149.663 (605.581)395.2027.818147720.837 (561.652)43.7180.725994684.654 (563.812)2.2540.06111224
300002026.088 (1080.883)598.46812.0221691217.779 (937.93)45.0741.10011071106.028 (899.099)3.8690.08313326
m = 3n
nsparsity = 0.01sparsity = 0.001sparsity = 0.0001
SOCP (eig time)RTRNewLTRSRRatioSOCP (eig time)RTRNewLTRSRRatioSOCP (eigtime)RTRNewLTRSRRatio
10000113.978 (51.388)76.1831.5927256.434 (41.871)8.5570.17133046.739 (39.697)0.4460.0222125
15000298.498 (143.174)200.293.93276171.902 (129.377)22.3350.396434150.666 (123.946)0.7740.0374072
20000596.182 (288.772)356.8497.75077417.155 (312.681)42.4380.718581339.114 (274.737)1.7130.0615559
250001152.428 (606.097)614.19213.59285782.197 (587.333)43.6461.151680641.319 (518.51)2.6780.0857545
300001949.035 (1039.845)948.44921.749901298.734 (971.861)93.2191.6987651085.053 (876.409)5.5260.1199118
+ +Table 6. Relative error of objective values on training sets + +
Dataset(fSOCP - fLTRSR)/|fSOCP|(fSOCP - fRTRNew)/|fSOCP|Dataset(fSOCP - fLTRSR)/|fSOCP|(fSOCP - fRTRNew)/|fSOCP|
AVGMINMAXAVGMINMAXAVGMINMAXAVGMINMAX
Wine Modest6.17E-103.94E-124.23E-09-8.26E-10-4.66E-093.62E-09Insur Modest1.01E-051.40E-063.31E-051.01E-051.40E-063.31E-05
Wine Severe1.32E-103.39E-121.84E-09-8.30E-11-4.07E-101.80E-09Insur Severe2.57E-064.90E-079.56E-062.57E-064.90E-079.56E-06
Build Modest1.49E-071.93E-095.91E-07-2.19E-05-3.37E-05-1.28E-05Blog Modest8.07E-093.33E-103.82E-088.07E-093.33E-103.82E-08
Build Severe3.02E-084.02E-101.25E-07-1.96E-06-3.06E-06-1.14E-06Blog Severe3.55E-082.80E-102.24E-073.55E-082.80E-102.24E-07
+ +Table 7. Relative error of MSEs on test sets + +
Dataset(MSOCP - MLTRSR) / |MSOCP|(MSOCP - MRTRNew) / |MSOCP|Dataset(MSOCP - MLTRSR) / |MSOCP|(MSOCP - MRTRNew) / |MSOCP|
AVGMINMAXAVGMINMAXAVGMINMAXAVGMINMAX
Wine Modest1.99E-07-9.55E-074.31E-061.74E-07-9.54E-073.99E-06Insur Modest1.05E-057.69E-074.21E-051.02E-05-7.09E-074.28E-05
Wine Severe2.03E-07-1.79E-072.57E-062.64E-07-4.55E-072.79E-06Insur Severe2.43E-06-3.36E-071.01E-052.45E-06-3.27E-071.01E-05
Build Modest-4.52E-06-1.25E-041.23E-04-1.25E-04-5.27E-045.01E-04Blog Modest-2.59E-09-5.66E-072.99E-071.92E-09-5.62E-073.03E-07
Build Severe2.65E-07-2.63E-052.54E-058.27E-06-8.02E-051.47E-04Blog Severe-2.06E-08-8.12E-073.24E-07-5.02E-09-7.81E-073.06E-07
+ +# 2. Synthetic Dataset + +# 2.1. DENSE DATA + +Table 8 summarises relative errors of objective values on synthetic datasets without sparsity. Comparing to the result in real-world dataset, we find that all the methods have high accuracy as the relative errors of the MSEs are up to $4.60\mathrm{e} - 5$ + +Table 8. Relative error on synthetic dataset without sparsity + +
γ=0.1(fSOCP - fLTRSR)/|fSOCP|(fSOCP - fRTRNew)/|fSOCP|γ=0.01(fSOCP - fLTRSR)/|fSOCP|(fSOCP - fRTRNew)/|fSOCP|
AVGMINMAXAVGMINMAXAVGMINMAXAVGMINMAX
m=2n1.01E-099.58E-113.41E-091.01E-099.58E-113.41E-09m=2n1.51E-055.39E-084.60E-051.51E-055.39E-084.60E-05
m=n2.26E-083.37E-111.34E-072.26E-083.36E-111.34E-07m=n2.11E-063.26E-077.40E-062.11E-063.26E-077.40E-06
m=0.5n8.27E-092.54E-124.82E-088.27E-092.05E-124.82E-08m=0.5n2.21E-063.44E-076.87E-062.21E-063.44E-076.87E-06
+ +# 2.2. SPARSE DATA + +Table 9 summarises relative error of objective values in synthetic dataset with different sparsity. Similar to the previous cases, both of our methods have high accuracy in terms of MSEs. These consistent results further prove the validity of our SCLS reformulation. + +Table 9. Relative error on synthetic dataset without sparsity + +
sparsity = 0.0001
γ = 0.1(fSOCP - fLTRSR) / |fSOCP|(fSOCP - fRTRNew) / |fSOCP|γ = 0.01(fSOCP - fLTRSR) / |fSOCP|(fSOCP - fRTRNew) / |fSOCP|
AVGMINMAXAVGMINMAXAVGMINMAXAVGMINMAX
m = 3n1.24E-091.48E-115.58E-091.24E-091.45E-115.58E-09m = 3n3.98E-095.27E-111.19E-083.97E-093.19E-111.19E-08
m = 2n7.49E-113.53E-131.55E-107.47E-113.20E-131.54E-10m = 2n2.25E-092.62E-124.88E-092.24E-09-3.51E-124.87E-09
m = n9.10E-109.93E-122.01E-099.10E-109.73E-122.01E-09m = n7.95E-091.83E-102.34E-087.94E-091.16E-102.34E-08
m = 0.5n3.06E-103.81E-126.60E-103.06E-103.70E-126.60E-10m = 0.5n3.07E-097.96E-136.28E-093.06E-09-4.52E-126.28E-09
sparsity = 0.001
γ = 0.1(fSOCP - fLTRSR) / |fSOCP|(fSOCP - fRTRNew) / |fSOCP|γ = 0.01(fSOCP - fLTRSR) / |fSOCP|(fSOCP - fRTRNew) / |fSOCP |
AVGMINMAXAVGMINMAXAVGMINMAXAVGMINMAX
m = 3n1.36E-095.73E-112.58E-091.36E-095.64E-112.58E-09m = 3n1.92E-085.04E-108.89E-081.92E-085.04E-108.89E-08
m = 2n1.66E-096.00E-115.06E-091.66E-095.91E-115.06E-09m = 2n5.14E-089.80E-122.05E-075.14E-089.74E-122.05E-07
m = n5.76E-101.53E-091.13E-126.19E-091.53E-09-2.03E-13m = n1.96E-081.14E-104.83E-081.96E-081.14E-104.83E-08
m = 0.5n1.90E-091.02E-106.68E-091.90E-091.01E-106.68E-09m = 0.5n4.42E-084.91E-091.34E-074.42E-084.91E-091.34E-07
sparsity = 0.01
γ = 0.1(fSOCP - fLTRSR) / |fSOCP|(fSOCP - fRTRNew) / |fSOCP|γ = 0.01(fSOCP - fLTRSR) / |fSOCP|(fSOCP - fRTRNew) / |fSOCP|
AVGMINMAXAVGMINMAXAVGMINMAXAVGMINMAX
m = 3n2.19E-082.64E-111.70E-082.19E-082.63E-111.70E-08m = 3n1.05E-072.15E-092.51E-071.05E-072.15E-092.51E-07
m = 2n8.23E-088.23E-083.74E-071.02E-074.80E-113.74E-07m = 2n6.94E-073.99E-103.10E-066.94E-073.99E-103.10E-06
m = n1.27E-089.14E-103.37E-081.27E-089.14E-103.37E-08m = n2.21E-067.78E-091.00E-052.21E-067.78E-091.00E-05
m = 0.5n1.90E-083.52E-124.50E-081.90E-083.45E-124.50E-08m = 0.5n6.52E-066.40E-082.95E-056.52E-066.40E-082.95E-05
\ No newline at end of file diff --git a/solvingstackelbergpredictiongamewithleastsquareslossviasphericallyconstrainedleastsquaresreformulation/images.zip b/solvingstackelbergpredictiongamewithleastsquareslossviasphericallyconstrainedleastsquaresreformulation/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..85aadf05adc626a4cf91b979e8e0700606d87ae4 --- /dev/null +++ b/solvingstackelbergpredictiongamewithleastsquareslossviasphericallyconstrainedleastsquaresreformulation/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:491264b220562725d7caa26242fc5c9ef414122447c9be934bb8ac01cbd3dd1d +size 1173855 diff --git a/solvingstackelbergpredictiongamewithleastsquareslossviasphericallyconstrainedleastsquaresreformulation/layout.json b/solvingstackelbergpredictiongamewithleastsquareslossviasphericallyconstrainedleastsquaresreformulation/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..db688c980fa4b978c92e8a7a6ab1436fc69ea6e4 --- /dev/null +++ b/solvingstackelbergpredictiongamewithleastsquareslossviasphericallyconstrainedleastsquaresreformulation/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ed527b730c289dbba9158a570acf0e88355ab427b2f1c037c58479d9948c9026 +size 745330 diff --git a/soqalselectiveoraclequestioningforconsistencybasedactivelearningofcardiacsignals/0d957d75-8c53-4ed3-ac75-2d65699957c3_content_list.json b/soqalselectiveoraclequestioningforconsistencybasedactivelearningofcardiacsignals/0d957d75-8c53-4ed3-ac75-2d65699957c3_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..e50c68fc47d70bd6abe066b40d909e4b6eef14fd --- /dev/null +++ b/soqalselectiveoraclequestioningforconsistencybasedactivelearningofcardiacsignals/0d957d75-8c53-4ed3-ac75-2d65699957c3_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9818673071dc7826ba1fc024c1c26085790772862715958e26cee42209acaa6b +size 181458 diff --git a/soqalselectiveoraclequestioningforconsistencybasedactivelearningofcardiacsignals/0d957d75-8c53-4ed3-ac75-2d65699957c3_model.json b/soqalselectiveoraclequestioningforconsistencybasedactivelearningofcardiacsignals/0d957d75-8c53-4ed3-ac75-2d65699957c3_model.json new file mode 100644 index 0000000000000000000000000000000000000000..14026ce41554085683fa39280e1faa8da31baaf9 --- /dev/null +++ b/soqalselectiveoraclequestioningforconsistencybasedactivelearningofcardiacsignals/0d957d75-8c53-4ed3-ac75-2d65699957c3_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d27b8f32b3528df2d1bc4b84cb583b65943a44164fa20fcc927fd3a6719766a6 +size 212227 diff --git a/soqalselectiveoraclequestioningforconsistencybasedactivelearningofcardiacsignals/0d957d75-8c53-4ed3-ac75-2d65699957c3_origin.pdf b/soqalselectiveoraclequestioningforconsistencybasedactivelearningofcardiacsignals/0d957d75-8c53-4ed3-ac75-2d65699957c3_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..ba6e49352693a3e3706cae84789a146cc299536b --- /dev/null +++ b/soqalselectiveoraclequestioningforconsistencybasedactivelearningofcardiacsignals/0d957d75-8c53-4ed3-ac75-2d65699957c3_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c21471ba88fe9b4fce0d00de8cd4b229ab978839d6048262946547cd80824ccb +size 7959024 diff --git a/soqalselectiveoraclequestioningforconsistencybasedactivelearningofcardiacsignals/full.md b/soqalselectiveoraclequestioningforconsistencybasedactivelearningofcardiacsignals/full.md new file mode 100644 index 0000000000000000000000000000000000000000..90a36bea8bfba0358c2a27fe2ad78bb1c55ddcaa --- /dev/null +++ b/soqalselectiveoraclequestioningforconsistencybasedactivelearningofcardiacsignals/full.md @@ -0,0 +1,833 @@ +# SoQal: Selective Oracle Questioning for Consistency Based Active Learning of Cardiac Signals + +Dani Kiyasseh1 Tingting Zhu2 David Clifton2 + +# Abstract + +Clinical settings are often characterized by abundant unlabelled data and limited labelled data. This is typically driven by the high burden placed on oracles (e.g., physicians) to provide annotations. One way to mitigate this burden is via active learning (AL) which involves the (a) acquisition and (b) annotation of informative unlabelled instances. Whereas previous work addresses either one of these elements independently, we propose an AL framework that addresses both. For acquisition, we propose Bayesian Active Learning by Consistency (BALC), a sub-framework which perturbs both instances and network parameters and quantifies changes in the network output probability distribution. For annotation, we propose SoQal, a sub-framework that dynamically determines whether, for each acquired unlabelled instance, to request a label from an oracle or to pseudo-label it instead. We show that BALC can outperform start-of-the-art acquisition functions such as BALD, and SoQal outperforms baseline methods even in the presence of a noisy oracle. + +# 1. Introduction + +Deep learning algorithms often need access to abundant, high-quality, labelled data. Such access, though, is a rarity within healthcare. For example, in low-resource clinical settings, data can be collected in abundance via wearable sensors however physicians, who are typically required to annotate such data, are either in low-supply or ill-trained to complete the task. As such, these settings are often characterized by abundant unlabeled data and limited labelled data. In light of this observation, we focus on the following + +$^{1}$ Department of Computing and Mathematical Sciences, California Institute of Technology, California, USA $^{2}$ Department of Engineering Science, University of Oxford, Oxford, UK. Correspondence to: Dani Kiyasseh . + +Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s). + +question: how can we design clinical algorithms that exploit abundant, unlabelled data and limited, labelled data while minimizing the labelling burden placed on physicians? + +One way to address this question is via the active learning (AL) framework (Settles, 2009) which iterates over three main steps. 1) acquisition - a learner (e.g., neural network) is tasked with acquiring unlabelled instances 2) annotation - an oracle (e.g., physician) is tasked with labelling such acquired instances, and 3) aggregation - the learner is trained on the existing and newly-labelled instances. Whereas previous work addresses either one of the first two steps of active learning, in this work, we aim to modify both. + +The acquisition of unlabelled instances is commonly performed via an acquisition function, an example of which is Bayesian Active Learning by Disagreement (BALD) (Houlsby et al., 2011). It quantifies the degree to which a network is uncertain about the classification of an instance. To do so, Monte Carlo Dropout (MCD) (Gal & Ghahramani, 2016) is exploited wherein network parameters are stochastically perturbed while an unlabelled instance is passed through a network. These parameter perturbations manifest in the form of distinct hypotheses (decision boundaries), as shown in Fig. 1 (left). However, MCD, as we later outline, can erroneously overlook informative instances for acquisition due to its misspecification of parameter perturbations. As for annotating acquired instances, it is often assumed that oracles are continuously available and sufficiently skilled to provide such annotations, an assumption that is rarely satisfied within healthcare settings. + +In this paper, we make the following contributions. First, we propose an AL framework, Monte Carlo Perturbations (MCP), that involves perturbing instances and observing concomitant changes in the network output distribution. We show that MCP performs on par with MCD in several settings. Second, we take inspiration from consistency training and propose an AL framework, Bayesian Active Learning by Consistency (BALC), that involves perturbing both instances and parameters and observing changes in the output distribution. Moving away from uncertainty-based acquisition functions, we introduce two consistency-based acquisition functions, $\mathrm{BALC}_{\mathrm{KLD}}$ and $\mathrm{BALC}_{\mathrm{JSD}}$ , and show that they can outperform state-of-the-art acquisition functions + +![](images/04ee8cde5dde59b13172edd39e5dd7012a93570962449e1598cadc4ca61b129e.jpg) +Figure 1: Perturbation frameworks used in active learning. Labelled instances from two classes and unlabelled instances (yellow) with the hypotheses of (Left) Monte Carlo Dropout (MCD), where each MC sample is a distinct hypothesis, (Centre) Monte Carlo Perturbations (MCP), with one hypothesis but several perturbed variants of the unlabelled instance, and (Right) Bayesian Active Learning by Consistency (BALC) with multiple hypotheses and perturbed instances. In this paper, we introduce MCP and Balc as alternatives to MCD in order to acquire unlabelled instances. + +![](images/18a76cbc09bd58fd2ecf10a733c24955c6a4d204800597bf9d46d1416dc29914.jpg) + +![](images/482466caf76b22e4eac51affff18a143ffd8e8505cddf65b1f05ab0a1f43a90b.jpg) + +such as BALD. Third, existing acquisition functions are static; they determine the informativeness of an instance at a single snapshot in time. Instead, we propose the simple modification of tracking the value of an acquisition function over time (epochs). We show that acquisition functions with such temporal information can outperform their static counterparts. Fourth, we take inspiration from selective classification and propose SoQal, a framework which determines whether, for each acquired unlabelled instance, to request a label from an oracle or to pseudo-label it instead. We show that SoQal outperforms state-of-the-art selective classification methods. To the best of our knowledge, we are the first to explore these avenues in the context of cardiac signals. + +# 2. Related Work + +# 2.1. Active Learning in Healthcare + +For medical images, previous work has acquired instances by measuring their distance in a latent space to images in the training set (Smailagic et al., 2018; 2020). For time-series data, researchers have acquired instances from electronic health record (EHR) (Gong et al., 2019) and electrocardiogram (ECG) (Wiens & Guttag, 2010; Pasolli & Melgani, 2010; Wang et al., 2019; Kiyasseh et al., 2021a) databases. For example, although Kiyasseh et al. (2021a) acquire cardiac signals, they do so in the context of continual learning and do not explore how to annotate such cardiac signals. More generally, Gal et al. (2017) adopt BALD (Houlsby et al., 2011) in the context of Monte Carlo Dropout to acquire instances that maximize the Jensen-Shannon divergence (JSD) across MC samples. For an in-depth review of + +active learning, we refer readers to Settles (2009). + +# 2.2. Oracles in Active Learning + +Previous work attempts to learn from multiple or imperfect oracles (Dekel et al., 2012; Zhang & Chaudhuri, 2015; Sinha et al., 2019). For example, Urner et al. (Urner et al., 2012) identify a suitable oracle to label a particular instance. In contrast to our work, they do not explore the independence of a learner from an oracle. Although Yan et al. (2016) consider oracle abstention, we place the decision of abstention under the control of the learner. To the best of our knowledge, we are the first to explore a dynamic oracle selection strategy in the context of cardiac signals. + +# 2.3. Consistency Training + +Consistency training helps enforce the smoothness assumption (McCallumzy & Nigamy, 1998; Zhu, 2005; Verma et al., 2019). For example, Xie et al. (2019) penalize networks for generating drastically different outputs in response to perturbed instances, resulting in perturbation-invariant representations. Most similar to our work is that of Gao et al. (2020) which designs a consistency-loss based on the Kullback-Leibler divergence $\mathcal{D}_{KL}$ . Whereas they actively acquire instances using the variance of the probability assigned to each class by the network in response to perturbed versions of the same instance, we design distinct consistency-based acquisition functions. + +# 2.4. Selective Classification + +Selective classification imbues a network with the ability to abstain from making predictions (Chow, 1970; El-Yaniv & Wiener, 2010; Cortes et al., 2016). Wiener & El-Yaniv (2011) use a support vector machine to rank and reject instances based on the degree of disagreement between hypotheses. In some frameworks, these are the same instances that active learning views as most informative. Although Liu et al. (2019) propose the gambler's loss to learn a selection function that determines whether instances are rejected, this approach is not implemented in the context of active learning. SelectiveNet (Geifman & El-Yaniv, 2019) introduces a multi-head architecture similar to ours, however it assumes the presence of ground-truth labels and, therefore, does not trivially extend to unlabelled instances. + +# 3. Background + +# 3.1. Active Learning + +Consider a learner $f_{\theta}: \pmb{x} \in \mathbb{R}^{D} \to \pmb{v} \in \mathbb{R}^{E}$ , parameterized by $\pmb{\theta}$ , that maps a $D$ -dimensional instance, $\pmb{x}$ , to an $E$ -dimensional representation, $\pmb{v}$ . Further consider a function, $p_{\omega}: \pmb{v} \in \mathbb{R}^{E} \to y \in \mathbb{R}^{C}$ , that maps an $E$ -dimensional + +representation, $\pmb{v}$ , to a $C$ -dimensional output, $y$ , where $C$ is the number of classes. After training on a pool of labelled data, $\mathcal{D}_L = \{\pmb{X}_L, \pmb{Y}_L\}$ for $\tau$ epochs, the learner is tasked with querying the unlabelled pool of data, $\pmb{X}_U$ , and acquiring the top $b$ fraction of instances, $\{\pmb{x}_i\}_{i=1}^b \sim \pmb{X}_U$ , that it deems to be most informative. The degree of informativeness of an instance, $\pmb{x}$ , is determined by an acquisition function, $\alpha(\pmb{x}) \in \mathbb{R}$ , such as Bayesian Active Learning by Disagreement (BALD) (Houlsby et al., 2011). These functions are typically used alongside Monte Carlo Dropout (MCD) (Gal & Ghahramani, 2016) to identify instances that lie in the region of uncertainty, a region in which hypotheses disagree the most about instances (Fig. 1 left). + +# 3.2. Consistency Training + +Consider an unlabelled instance, $\pmb{x} \sim \pmb{X}_U$ , and its perturbed counterpart, $\pmb{x}' = \pmb{x} + \epsilon$ , where $\epsilon$ is some perturbation. A network is said to be invariant to such a perturbation if its outputs, $p_{\omega}(\pmb{x})$ and $p_{\omega}(\pmb{x}')$ , are similar to one another. Consistency training is one way to encourage such an invariance. In this work, we exploit this intuition to design acquisition functions, as outlined next. + +# 4. Methods + +# 4.1. Monte Carlo Perturbations + +Acquisition functions dependent upon parameter perturbations, such as in MCD, can overlook, and thus fail to acquire, informative unlabelled instances. To see this, and without loss of generality, consider an unlabelled instance which is (a) in proximity to a decision boundary, thus deeming it informative for training (Settles, 2009) and (b) classified by a network into an arbitrary class. In this setting, a total of $T$ parameter perturbations results in $T$ hypotheses, altering the outputs of a network, $\{p_{\omega}^{i}\}_{i = 1}^{T}$ , in response to an unlabelled instance. We visualize the distribution of such outputs in Fig. 2 (red rectangle), after having applied $T = 3$ parameter perturbations. If the perturbations happen to be too small in magnitude, for example, then a network will exhibit a similar output distribution $(p_{\omega}^{1} = p_{\omega}^{2} = \dots)$ across the parameter perturbations. However, since acquisition functions assign value based on changes in the output distribution, this informative unlabelled instance (due to its proximity to decision boundary) would be erroneously deemed uninformative. + +One way to avoid missing these informative instances is by stochastically perturbing instances (instead of network parameters) and observing changes in the network outputs, a setup we refer to as Monte Carlo Perturbations (MCP). This results in a single hypothesis but multiple perturbed variants of the instance (see Fig. 1 centre). The intuition is that network outputs will differ more significantly for an + +![](images/3de4a6e556cdc4783878670b7228baa38f4631b7234b693323f924d6c54501af.jpg) +Figure 2: Scenarios demonstrating the effect of input and parameter perturbations on the behaviour of the proposed acquisition functions, $\mathrm{BALC}_{\mathrm{KLD}}$ and $\mathrm{BALC}_{\mathrm{JSD}}$ . (Scenario 1) network output variations caused primarily by input perturbations. The red rectangle illustrates how parameter perturbations alone, as with MCD, can be insufficient in causing changes to the network outputs, thus failing to acquire informative unlabelled instances. (Scenario 2) network output variations caused by both input and parameter perturbations. We show that while $\mathrm{BALC}_{\mathrm{KLD}}$ is likely to acquire instances due to input perturbations, $\mathrm{BALC}_{\mathrm{JSD}}$ considers both input and parameter perturbations when performing acquisitions. + +![](images/56b1e8e887a03cea65cd7bd7547330047a9750d84a7e35ff93630ada6d7b4367.jpg) + +instance in proximity to the decision boundary than for an instance farther away. By quantifying these output changes, as is done with almost any acquisition function, we can identify informative instances for acquisition. The main advantage of MCP over MCD is the increased control and interpretability of the applied perturbations; perturbations applied to instances are likely to be more understandable than those applied to parameters. A formal derivation of MCP can be found in Appendix B. + +# 4.2. Bayesian Active Learning by Consistency + +It could be argued that the same limitations exhibited by MCD also extend to MCP. After all, both frameworks apply perturbations to either network parameters or instances. Acknowledging this, we propose a framework, entitled Bayesian Active Learning by Consistency (BALC), in which perturbations are simultaneously applied to network parameters and instances. As such, this results in multiple decision boundaries and perturbed instances (see Fig. 1 right). BALC consists of three main steps: 1) perturb an instance, $\boldsymbol{x} \in \mathbb{R}^D$ , to generate $\boldsymbol{x}' \in \mathbb{R}^D$ , 2) perturb the network parameters, $\boldsymbol{\theta}$ , to generate $\boldsymbol{\theta}'$ , and 3) pass both instances, $\boldsymbol{x}$ and $\boldsymbol{x}'$ , through the perturbed network, generating outputs, $p(y|\boldsymbol{x},\boldsymbol{\theta}')$ and $p(y|\boldsymbol{x}',\boldsymbol{\theta}') \in \mathbb{R}^C$ , respectively. Note that we drop the explicit dependence on $\boldsymbol{\omega}$ for clarity. We perform these steps for $T$ stochastic parameter perturbations and generate two matrices of network outputs, $G(\boldsymbol{x}), G'(\boldsymbol{x}') \in \mathbb{R}^{T \times C}$ , as shown in Fig. 3. + +![](images/5605113a06df3a96d87008d94250d1c055c2e5060a87af862afe3c2fa71904da.jpg) +Figure 3: Consistency-based active-learning framework. We perturb an instance, $\pmb{x}$ , to generate, $\pmb{x}'$ , and extract their corresponding representations, $v$ . We apply a stochastic dropout mask to these representations and obtain an output distribution over the classes. When repeated $T$ times, this generates a pair of matrices, $\pmb{G}(\pmb{x})$ and $\pmb{G}'(\pmb{x}')$ , whose divergence is calculated via BALC $_{\mathrm{KLD}}$ or BALC $_{\mathrm{JSD}}$ . + +The intuition is that the greater the divergence between $G$ and $G^{\prime}$ , the closer an instance is to the decision boundary. To that end, we propose two consistency-based acquisition functions, $\mathrm{BALC}_{\mathrm{KLD}}$ and $\mathrm{BALC}_{\mathrm{JSD}}$ . + +To calculate $\mathrm{BALC}_{\mathrm{KLD}}(\pmb{x}) \in \mathbb{R}$ (1), we first empirically fit two $C$ -dimensional Gaussian distributions, $\mathcal{N}(\pmb{x})$ and $\mathcal{N}(\pmb{x}^{\prime})$ to $\pmb{G}$ and $\pmb{G}^{\prime}$ , respectively. For each such matrix, we obtain an empirical mean vector, $\pmb{\mu} = \frac{1}{T}\sum_{i}^{T}\pmb{G}_{i}$ and covariance matrix, $\pmb{\Sigma} = (\pmb{G} - \pmb{\mu})^{T}(\pmb{G} - \pmb{\mu})$ . We then quantify the $D_{KL}$ between $\mathcal{N}(\pmb{x})$ and $\mathcal{N}(\pmb{x}^{\prime})$ as follows. + +$$ +\operatorname {B A L C} _ {\mathrm {K L D}} (\boldsymbol {x}) = \mathcal {D} _ {K L} \left(\mathcal {N} (\boldsymbol {x}) \| \mathcal {N} \left(\boldsymbol {x} ^ {\prime}\right)\right) \tag {1} +$$ + +where $\mathcal{N}(\pmb {x}) = \mathcal{N}(\pmb {\mu}(\pmb {x}),\pmb {\Sigma}(\pmb {x}))$ and $\mathcal{N}(\pmb{x}^{\prime}) =$ $\mathcal{N}(\pmb {\mu}(\pmb{x}^{\prime}),\pmb {\Sigma}(\pmb{x}^{\prime}))$ + +We note that $\mathrm{BALC}_{\mathrm{KLD}}$ is likely to detect changes in the network outputs due solely to instance perturbations. To see this, consider Scenario 1 and 2 presented in Fig. 2. Changes in network outputs are caused by either instance perturbations alone (Scenario 1) or both instance and parameter perturbations (Scenario 2). In these two scenarios, $\mathrm{BALC}_{\mathrm{KLD}} \approx 1$ and 0, respectively. Since the informativeness of an instance is related to the magnitude of the acquisition function, these scenarios suggest that $\mathrm{BALC}_{\mathrm{KLD}}$ has a preference for instance perturbations. In order to detect changes in the network outputs due to both instance and parameter perturbations, we introduce $\mathrm{BALC}_{\mathrm{JSD}}$ . Support for this claim can also be found in Fig. 2. + +$\mathrm{BALC_{JSD}}(\pmb {x})\in \mathbb{R}$ (2) comprises the difference of two terms. The first term, $(\widehat{\mathbf{A}})$ , calculates the $D_{KL}$ of network outputs due to a single instance perturbation and averages this across $T$ parameter perturbations. The second term, $(\widehat{\mathbf{B}})$ , averages the network outputs across parameter perturbations independently for the original and perturbed instance before + +calculating the $D_{KL}$ of the resulting mean outputs. The full derivation of $\mathrm{BALC}_{\mathrm{JSD}}$ can be found in Appendix C. + +$$ +\begin{array}{l} \operatorname {B A L C} _ {\mathrm {J S D}} (\boldsymbol {x}) = \overbrace {\frac {1}{T} \sum_ {i = 1} ^ {T} \left[ \mathcal {D} _ {K L} \left(\boldsymbol {G} _ {i} (\boldsymbol {x}) \| \boldsymbol {G} _ {i} ^ {\prime} \left(\boldsymbol {x} ^ {\prime}\right)\right) \right]} ^ {\widehat {\text {(A)}} \text {a c r o s s p a r a m e t e r p e r t u r b a t i o n s}}} - \tag {2} \\ \overbrace {\mathcal {D} _ {K L} \left(\frac {1}{T} \sum_ {i = 1} ^ {T} G _ {i} (\boldsymbol {x}) \parallel \frac {1}{T} \sum_ {i = 1} ^ {T} G _ {i} ^ {\prime} \left(\boldsymbol {x} ^ {\prime}\right)\right)} ^ {\widehat {\mathrm {B}} \text {a c r o s s i n p u t p e r t u r b a t i o n s}} \\ \end{array} +$$ + +# 4.3. Tracked Acquisition Function + +So far, we have discussed active learning frameworks that, similar to those in the literature, quantify the informativeness of an unlabelled instance at a single snapshot in time (e.g., at a particular epoch, $\tau$ ). This static setup, however, faces two limitations. First, it depends on an appropriate choice of epoch for the acquisition of instances, which is non-trivial to identify a priori. For example, an acquisition function can be of little value if calculated when network parameters have yet to be updated sufficiently. Second, the diversity and number of hypotheses obtained via parameter perturbations can be limited by this single-epoch view. This is detrimental given the established benefit of eliminating unsuitable hypotheses at a greater rate ( $\downarrow$ version space) (Cohn et al., 1994). + +To overcome such limitations, we propose to track this acquisition function over time (e.g., epochs) before deploying it for the acquisition of instances. This is a simple extension to almost any acquisition function. In the process, we become less dependent on the choice of acquisition epoch and are likely to increase the diversity of hypotheses at our disposal. Formally, consider an acquisition function, $\alpha(\pmb{x})$ , which would ordinarily be calculated once at epoch, $\tau$ , for each instance, $\pmb{x}$ . In our formulation, we calculate $\alpha(\pmb{x}, t)$ at each epoch, $t \in [1, \tau]$ . At epoch, $\tau$ , which we refer to as an acquisition epoch, the modified acquisition function, $\mathrm{AUTAF}(\pmb{x}, \alpha) \in \mathbb{R}$ , corresponds to the area under the tracked acquisition function, approximated via the trapezoidal rule. + +$$ +\operatorname {A U T A F} (\boldsymbol {x}, \alpha) \approx \sum_ {t = 1} ^ {\tau} \left(\frac {\alpha (\boldsymbol {x} , t + \Delta t) + \alpha (\boldsymbol {x} , t)}{2}\right) \Delta t \tag {3} +$$ + +where $\Delta t$ is the interval between epochs at which acquisition values are calculated. + +# 4.4. Selective Oracle Questioning + +Up until this point, we have discussed methods that exclusively target the acquisition of unlabelled instances. We now direct our attention to the annotation of such instances with + +the goal of minimizing the labelling burden that is placed on an oracle. To do so, we design a framework that, given an acquired unlabelled instance, dynamically determines whether to request a label from an oracle or to pseudo-label that instance instead. This framework, which we refer to as selective oracle questioning in active learning, SoQal, is outlined next. + +Oracle selection network Let us first consider a learner, $g_{\phi}: \pmb{v} \in \mathbb{R}^{E} \to r \in [0,1]$ , parameterized by $\phi$ , that maps an $E$ -dimensional representation, $\pmb{v}$ , to a scalar, $r$ , as shown in Fig. 4. We refer to this learner as an oracle selection network. + +Learning a proxy for misclassifications The intuition underlying our oracle selection framework is as follows. Given an instance, a network should request a label (i.e., ask for help) from an oracle instead of pseudo-label it if the network is likely to misclassify this instance. This idea operates under the assumption that the network is able to identify whether an instance will be misclassified. While this is possible with labelled data, it is non-trivial with unlabelled data (due to absence of a ground-truth), the prime focus of active learning. As such, we need a way to identify whether an unlabelled instance would have been misclassified if it were to be pseudo-labelled by the network. In other words, we need a reliable proxy for a misclassification. + +To design this proxy, we exploit the oracle selection network $(g_{\phi})$ and its scalar output, $r$ . As we explain next, we learn $\phi$ such that higher values of $r$ correspond to misclassifications. Achieving this requires that $r$ have a supervisory ground-truth label. We choose such a label to be the zero-one loss, $e \in \mathbb{R}$ , incurred by the prediction network, $p_{\omega}$ on an instance, $\pmb{x}$ . Intuitively, when $e = 1$ , the network should request a label from an oracle. Note that this ground-truth label, $e$ , is only available while training on labelled data. We later explain how to exploit $r$ on acquired unla + +![](images/8f6141d588269efec5d2566eddf21c2be2531a6f7a1279135a920365a22e9f21.jpg) +Figure 4: Selective oracle questioning framework. Representation, $\pmb{v}$ , of instance, $\pmb{x}$ is passed through $p_{\omega}$ to generate task predictions and $g_{\phi}$ to determine whether a label is requested from an oracle. The zero-one loss of $p_{\omega}$ is the ground-truth label for $r$ . High (low) values of $r$ indicate that an instance should be labelled by an oracle (pseudo-labelled by prediction network). + +belled instances. As such, while training on labelled data, we optimize (4) with a categorical cross-entropy loss for the prediction network, $\mathcal{L}_{CPL}$ , with ground-truth class labels, $c$ , and a weighted binary cross-entropy loss for the oracle selection network, $\mathcal{L}_{OSL}$ . In the process, we learn the parameters, $\theta$ , $\omega$ , and $\phi$ in an end-to-end manner. + +$$ +\mathcal {L} = \mathcal {L} _ {C P L} + \mathcal {L} _ {O S L} \tag {4} +$$ + +$$ +\mathcal {L} _ {C P L} = - \sum_ {i = 1} ^ {B} \log \left(p _ {\boldsymbol {\omega}} \left(y _ {i} = c | \boldsymbol {x} _ {i}, \phi\right)\right) +$$ + +$$ +\mathcal {L} _ {O S L} = - \sum_ {i = 1} ^ {B} \beta e _ {i} \log g _ {\phi} (\boldsymbol {x} _ {i}) - (1 - e _ {i}) \log \left(1 - g _ {\phi} (\boldsymbol {x} _ {i})\right) +$$ + +Weighted oracle selection loss. During the early stages of training on labelled data, a network struggles to classify instances correctly. In our framework, this implies that we will encounter more terms with $e = 1$ (misclassification) than those with $e = 0$ (correct classification). The opposite is true as training progresses and the network becomes more adept at classifying instances. Therefore, regardless of the stage of training (early vs. late), there will be an imbalance in the ground-truth labels, $e$ , provided to the oracle selection network. This imbalance sends a strong supervisory signal to $g_{\phi}$ through the oracle selection loss, $\mathcal{L}_{OSL}$ , and not accounting for it would lead to systematically higher (lower) $r$ values during the early (late) stages of training. This can reduce the reliability of $r$ as a proxy for misclassifications. As such, we introduce a dynamic weight, $\beta = \frac{\sum \mathbb{1}(e=0)}{\sum \mathbb{1}(e=1)}$ , where $\mathbb{1}$ is the indicator function. As training progress, $\beta < 1 \rightarrow \beta > 1$ , as the ratio of correctly classified $(e = 0)$ to misclassified $(e = 1)$ instances within a mini-batch changes. + +Making decisions with proxy We exploit $r$ for the binary decision of whether to request a label from an oracle or to generate a pseudo-label instead. Since $r \in [0,1]$ , one simple rule would be to select an oracle if $r > 0.5$ . This threshold, however, may be sub-optimal particularly if the values of $r$ are not calibrated. Therefore, to design a robust rule, we account for the distribution of the $r$ values stratified according to the zero-one loss, $e$ , on labelled data, and the separability of such distributions. We present such empirical stratified distributions in Figs. 5a and 5b during the early and late stages of training, respectively. As expected, we find that correctly-classified instances $(e = 0)$ tend to have lower $r$ values than those which are misclassified. + +We now outline the steps involved in making the binary decision. First, after each training epoch, $t$ , we fit two unimodal Gaussian distributions, $\mathcal{N}_0(\mu_0,\sigma_0^2)$ and $\mathcal{N}_1(\mu_1,\sigma_1^2)$ corresponding to $e = 0$ and $e = 1$ , respectively, to the $r$ values (generated on the labelled data), similar to those in Fig. 5b. + +![](images/c09ec1c09720eecb6968c4921f4c0cb3e6d7bd04f24906a100b8e714279d651e.jpg) +(a) Early stage + +![](images/2a0f715759d296d2cd352b28d1edc433fe9389191d3467861339d0997e053787.jpg) +(b) Late stage + +![](images/c09f381cc16fdc7864998c633ac6921d84f00560925b2c09ca9fc4a0ec2ca365.jpg) +(c) $D_H$ +Figure 5: Components of selective oracle questioning framework. Distribution of the outputs, $r$ , of $g_{\phi}$ stratified based on the zero-one loss, $e$ during the (a) early and (b) late stages of training. (c) Hellinger distance, $D_{H}$ , between the two distributions of $r$ increases during training. + +Low separability of such distributions would suggest that the oracle selection network has yet to learn to distinguish between correctly-classified and misclassified instances, and is thus generating an unreliable proxy, $r$ . We quantify this separability via the Hellinger distance, $D_H \in [0,1]$ , a metric to which a threshold can be easily applied. In Fig. 5c, we show that indeed as training progresses, the separability of the two distributions increases, which is suggestive of an increasingly reliable proxy. Based on some user-defined threshold, $S$ , low separability (i.e., low proxy reliability) can be defined as $D_H < S$ . In such an event, we use a conservative strategy that defers labelling to the oracle. This value of $S$ can be altered depending on the relative level of trust placed in the network and oracle. + +Pseudo-labelling. High separability, defined as $D_H \geq S$ suggests that the proxy is sufficiently reliable to make decisions. As such, for each acquired unlabelled instance, $\pmb{x}_u \sim \pmb{X}_U$ , we obtain $r_u = g_\phi(\pmb{x}_u)$ and compare the values of $\mathcal{N}_0$ and $\mathcal{N}_1$ when evaluated at $r_u$ . If $\mathcal{N}_1 > \mathcal{N}_0$ , then the value of $r$ is too high (indicating a potential network misclassification), and a label is requested from an oracle. Otherwise, the instance is pseudo-labelled via $\operatorname{argmax}_c p_\omega(y = c|x)$ . The probability of requesting a label from an oracle is denoted by $p(\mathrm{A})$ . + +$$ +p (\mathrm {A}) = \left\{ \begin{array}{l l} 1, & D _ {H} < S \\ 1, & \mathcal {N} _ {1} > \mathcal {N} _ {0} \text {a n d} D _ {H} \geq S \\ 0, & \text {o t h e r w i s e} \end{array} \right. \tag {5} +$$ + +where $\mathcal{N}_1 = \mathcal{N}\left(r = r_u|\mu_1,\sigma_1^2,e = 1\right)$ and $\mathcal{N}_0 = \mathcal{N}\left(r = r_u|\mu_0,\sigma_0^2,e = 0\right)$ . We note that our oracle selection framework is independent of the acquisition of unlabeled instances, making it general enough to be used alongside almost any acquisition function. Pseudo-code for the entire pipeline can be found in Appendix F. + +# 5. Experimental Design + +# 5.1. Datasets + +We conduct our experiments1 using PyTorch (Paszke et al., 2019) on four publicly-available datasets comprising cardiac signals, such as the photoplethysmogram (PPG) and the electrocardiogram (ECG) alongside cardiac arrhythmia labels (abnormalities in the functioning of the heart). PhysioNet 2015 $(\mathcal{D}_1)$ (Clifford et al., 2015) consists of PPG data alongside 5 different classes of cardiac arrhythmia. $\mathcal{D}_2$ is similar to the first however comprises ECG data. PhysioNet 2017 $(\mathcal{D}_3)$ (Clifford et al., 2017) consists of 8,528 single-lead ECG recordings alongside 4 different classes of cardiac arrhythmia. Cardiology $(\mathcal{D}_4)$ (Hannun et al., 2019) consists of single-lead ECG data from 292 patients alongside 12 different classes of cardiac arrhythmia. + +In order to evaluate our framework in the limited data regime, we place a fraction, $F \in [0.1, 0.3, 0.5, 0.7, 0.9]$ , of the training dataset into a labelled set, $\mathcal{D}_L$ . and its complement into an unlabelled set, $X_U$ (see Table 1). Additional details about the datasets and pre-processing steps can be found in Appendix D. + +
DatasetTrainVal.Test
LabelledUnlabelled
D1401423311241435
D2401423311241435
D31,77616,4794,5825,824
D44524,1101,1311,386
+ +Table 1: Number of instances in the training, validation, and test sets. The distribution of labelled instances is shown for a fraction, $F = 0.1$ , of the original training set. This is also used for the selective oracle questioning experiments. The remaining distributions can be found in Appendix D. + +# 5.2. Network Architecture + +Our network architecture involves a lightweight convolutional network which receives a cardiac time-series segment (2500 samples or $\approx 5$ seconds in duration) as input and returns a probability distribution over cardiac arrhythmias as output. We chose this architecture based on previous research demonstrating its effectiveness in classifying cardiac arrhythmias (Kiyasseh et al., 2021b). Additional details about the network architecture can be found in Appendix E. + +# 5.3. Active Learning Scenarios + +We explore three distinct active learning scenarios characterized by the presence and quality of an oracle. Recall that the motivation behind our framework was to exploit abundant + +unlabelled and limited labelled data while alleviating (and not necessarily eliminating) the labelling burden placed on an oracle. As such, the target and realistic clinical scenario in which our framework would be deployed is one where an oracle (e.g., physician) is available in some capacity. However, to explore the extreme limits of our approach, and as a stepping stone to the target clinical scenario, we begin our experimentation without an oracle and transition to the scenarios in which an oracle is available. + +Scenario 1 - Without Oracle. we assume that a physician is unavailable to provide labels and thus evaluate the performance of our framework without an oracle. + +Scenario 2 - Noise-free Oracle. we assume that a physician is available and capable of providing accurate labels. + +Scenario 3 - Noisy Oracle. we assume that a physician is either ill-trained or unable to perform a diagnosis due to its difficulty. To simulate this setting, we introduce two types of label noise. We stochastically flip the ground-truth label (unseen by the network) of each unlabelled instance to 1) (Random) any other label randomly, or 2) (Nearest Neighbour) its nearest neighbour, in a smaller dimensional subspace, from a different class. Whereas the first form of noise is extreme, the latter is more realistic as it may reflect uncertain physician diagnoses. Furthermore, we simulate noise of different magnitude by injecting it with probability $\gamma = [0.05, 0.1, 0.2, 0.4, 0.8]$ . + +# 5.4. Baselines + +We compare our proposed acquisition functions to the state-of-the-art functions used alongside MCD. These include Var Ratio, Entropy, and BALD (Houlsby et al., 2011), definitions of which can be found in Appendix A. We also experiment with several baselines that exhibit varying degrees of oracle dependence. $\epsilon$ -greedy (Watkins, 1989) - a stochastic strategy that we adapt to exponentially decay the reliance of the network on an oracle as a function of the number of acquisition epochs. $S$ -response - assumes that high entropy predictions are indicative of instances that the network is unsure of. Therefore, we introduce a threshold, $S_{\text{Entropy}}$ , such that if it is exceeded, an oracle is requested to label the chosen instance (see Appendix E). + +# 5.5. Hyperparameters + +For all experiments, we chose the number of MC samples $T = 20$ to balance between computational complexity and accuracy of the approximation of the version space. During training, we acquire unlabelled instances at pre-defined epochs (acquisition epochs), $\tau = 5n$ , $n \in \mathbb{N}^+$ . During each acquisition epoch, we acquire $b = 2\%$ of the remaining unlabelled instances. We investigate the effect of such hyperparameters on performance in Appendices K-M. When experi + +imenting with tracked acquisition functions, we chose the temporal period, $\Delta t = 1$ , calculating the acquisition function at each epoch of training. Given the increasing trend of $D_H$ during training (see Fig. 5c), we chose $D_H \geq S = 0.15$ to balance between the reliability of the proxy and the independence of the network from an oracle. + +# 6. Experimental Results + +# 6.1. Active Learning without Oracle + +We begin by exploring the performance of active learning frameworks without an oracle. In Fig. 6a, we illustrate the validation AUC of a network that is initially exposed to $F = 0.3$ of the labelled training data of $\mathcal{D}_2$ . + +We find that a network which exploits $\mathrm{BALC}_{\mathrm{KLD}}$ learns faster than, and outperforms, those which exploit the remaining acquisition functions. For example, $\mathrm{BALC}_{\mathrm{KLD}}$ and $\mathrm{BALD}_{\mathrm{MCD}}$ achieve AUC $\approx 0.69$ after 20 and 40 epochs of training, respectively, reflecting a two-fold increase in learning efficiency. Moreover, $\mathrm{BALC}_{\mathrm{KLD}}$ and Entropy $_{\mathrm{MCD}}$ achieve a final AUC $\approx 0.72$ and $\approx 0.70$ , respectively. One hypothesis for this improved performance is that $\mathrm{BALC}_{\mathrm{KLD}}$ , as a consistency-based active learning framework, acquires unlabelled instances which may still be correctly pseudo-labelled by the network despite the absence of an oracle. This, in turn, facilitates learning Uncertainty-based acquisition functions, on the other hand, acquire unlabelled instances to which the network is most uncertain. As such, pseudo-labels for these instances are likely to be incorrect. The results for the remaining experiments can be found in Appendix G. + +We now transition to quantifying the marginal benefit of incorporating temporal information into the acquisition functions. In Fig. 6b, the panel on the left illustrates the percent change in the AUC when comparing MCP to MCD while using static acquisition functions. The panel on the right, however, depicts the results after having incorporated temporal information into the acquisition functions used alongside MCP. Hence, the naming MCP Temporal. We find that tracked acquisition functions add value when the size of the labelled dataset is small $(\downarrow F)$ (red rectangle). For example, transitioning from MCP Static to MCP Temporal when exploiting BALD at $F = 0.1$ improves the AUC by $11\%$ . Similar improvements can be seen in Appendix H. We hypothesize that this improvement is due to the increased diversity, and number, of hypotheses available when considering temporal information, thus eliminating unsuitable hypotheses at a greater rate. + +# 6.2. Active Learning with Noise-free Oracle + +Having explored the performance of active learning frameworks without an oracle, we now assume the presence of a + +![](images/3015e6d6c597f71eab915079fca728673f8255c9209081eff08d11e2c0b6d504.jpg) +(a) $\mathcal{D}_2$ at $F = 0.3$ + +![](images/41fcf99ca395f6afe7c8b398d2326d132787fa6608c6903d412d4008020b747a.jpg) +(b) Utility of tracked acquisition functions on $\mathcal{D}_1$ +Figure 6: Performance of active learning frameworks without an oracle. (a) Validation AUC on $\mathcal{D}_2$ at $F = 0.3$ . (b) Percent change in AUC when comparing MCP with static and temporal acquisition functions to MCD with static functions on $\mathcal{D}_1$ . Results are averaged across five seeds. In (a), we show that $\mathrm{BALC}_{\mathrm{KLD}}$ can outperform state-of-the-art acquisition functions. In (b), we show the marginal benefit of temporal acquisition functions. + +noise-free oracle and explore the effect of selective oracle questioning methods. In Table 2, we present the results of these experiments across all datasets at $F = 0.1$ . + +We find that SoQal consistently outperforms $S$ -response and $\epsilon$ -greedy across $\mathcal{D}_1 - \mathcal{D}_3$ . For example, when using $\mathrm{BALD}_{\mathrm{MCD}}$ on $\mathcal{D}_2$ , SoQal achieves AUC = 70.7 whereas $S$ -response and $\epsilon$ -greedy achieve AUC = 58.4 and 60.9, respectively. Such a finding suggests that SoQal is well equipped to know when a label should be requested from an oracle. This improved performance also coincides with + +
DatasetAc. Function αOracle Questioning Method
S-responseε-greedySoQal
D1BALDMCD49.6 (3.9)49.1 (2.8)62.1 (2.1)
BALMCP51.7 (4.3)50.1 (4.3)64.5 (1.5)
BALCKLD54.8 (3.4)54.8 (4.2)59.8 (5.5)
Temp. BALCKLD53.6 (4.0)52.1 (5.9)64.6 (6.7)
D2BALDMCD58.4 (4.1)60.9 (7.1)70.7 (3.8)
BALMCP63.8 (4.3)63.7 (4.4)67.7 (4.2)
BALCKLD58.2 (1.7)64.3 (3.3)67.7 (2.4)
Temp. BALCKLD61.2 (5.0)60.5 (1.9)64.8 (5.7)
D3BALDMCD58.8 (1.3)67.3 (1.5)72.1 (2.5)
BALMCP67.6 (5.8)66.5 (2.8)72.0 (4.4)
BALCKLD62.9 (0.4)64.3 (4.1)73.1 (3.3)
Temp. BALCKLD63.0 (1.4)65.4 (1.9)73.0 (2.4)
D4BALDMCD48.9 (3.0)47.4 (3.7)46.8 (2.1)
BALMCP50.4 (2.6)49.2 (2.4)49.9 (2.9)
BALCKLD50.4 (3.9)47.3 (1.0)49.5 (1.2)
Temp. BALCKLD49.6 (2.3)49.6 (2.3)50.3 (1.0)
+ +Table 2: Test AUC of oracle questioning methods with a noise-free oracle at $F = 0.1$ . Mean (standard deviation) is presented across five random seeds for $\mathcal{D}_1 - \mathcal{D}_4$ . Bold indicates top-performing method. We show that SoQal outperforms $S$ -response and $\epsilon$ -greedy across $\mathcal{D}_1 - \mathcal{D}_3$ . + +reduced dependence on an oracle (see Appendix I). We also hypothesize that the poor performance of all methods on $\mathcal{D}_4$ is due to the cold-start problem (Konyushkova et al., 2017) where network learning is hindered by the limited availability of initial labelled training data. We support this claim with further experiments in Appendix I. + +# 6.3. Active Learning with Noisy Oracle + +Building on the findings in the previous section, we now explore the performance of our oracle questioning methods with a noisy oracle. In Fig. 7, we illustrate the test AUC on $\mathcal{D}_1$ as a function of various types and levels of noise. We also present the performance with a noise-free oracle (horizontal dashed lines). + +We find that SoQal is more robust to a noisy oracle than $\epsilon$ -greedy and $S$ -response. This is evident by the $\uparrow$ AUC of the former relative to the latter across different noise types and magnitudes (except at $\gamma = 0.4$ random noise). For example, at $5\%$ random noise, SoQal achieves AUC $\approx 0.66$ whereas $\epsilon$ -greedy and $S$ -response achieve AUC $\approx 0.56$ and 0.53, respectively. We also find that SoQal, in the presence of noise, continues to outperform the baseline methods in the absence of noise. For example, at $80\%$ nearest neighbour noise, SoQal achieves AUC $\approx 0.59$ whereas $\epsilon$ -greedy and $S$ -response without label noise achieve AUC $\approx 0.50$ and 0.52, respectively. We arrive at similar conclusions for other datasets and acquisition functions (see Appendix J). One hypothesis for this improved performance is that SoQal, by appropriately deciding when to not request a label from a noisy oracle, avoids an incorrect instance annotation, and thus allows the network to learn well. + +![](images/64fdbaed37ef8660dd87639c4db9abebc46d71d8146389d9db203d003e389a70.jpg) +Figure 7: Test AUC of the oracle questioning methods with (left) random and (right) nearest neighbour label noise on $\mathcal{D}_1$ while using $\mathrm{BALD_{MCP}}$ . Horizontal dashed lines indicate performance of network without label noise. SoQal, even with a noisy oracle, outperforms baseline methods with a noise-free oracle. + +![](images/b6bae4447332a384494bb968396cc1f5e0742695c2b5309c0d47761240d8e06c.jpg) + +# 7. Discussion + +In this paper, we proposed a family of active learning frameworks which either perturb instances (Monte Carlo Perturbations) or both instances and network parameters (Bayesian Active Learning by Consistency) and observe changes in the network output distribution. We showed that BALC can outperform state-of-the-art methods such as BALD. We also found that MCP, when used alongside tracked acquisition functions, can be more favourable than MCD with static acquisition functions, particularly in low-data regimes. We also proposed SoQal, a framework that dynamically determines whether, for each acquired unlabelled instance, to request a label from an oracle or to pseudo-label it instead. We demonstrated that SoQal outperforms several baseline methods, even with a noisy oracle, while reducing a network's dependence on the oracle. + +We now outline some of the limitations of our framework. In doing so, we hope to provide guidance on when it should, and should not, be used by machine learning practitioners. First, SoQal assumed that the zero-one loss incurred by the prediction network (see Fig. 4) is a reliable signal for the oracle selection network to learn from. However, the presence of class label noise hinders the reliability of this signal, introducing an error into the oracle selection process which could manifest as misplaced under- or over-dependence on an oracle. We leave it to future work to investigate the interplay between class label noise and oracle selection. + +SoQal also assumed that the annotations provided by the oracle, when requested, are consistently reliable. However, an oracle (e.g., a physician) is likely to experience fatigue over time and exhibit undesired variability in annotation quality. Such oracle dynamics are not accounted for by our framework yet pose exciting opportunities for the future. Moreover, our framework assumed that, at most, a single oracle was available throughout the learning process. How- + +ever, clinical settings are often characterized by the presence of multiple oracles (e.g., radiologists, cardiologists, oncologists) with different areas and levels of expertise. We hope the community considers incorporating these elements into an active learning framework which would prove quite valuable given the realistic nature of such a scenario. + +# Acknowledgements + +We thank the anonymous reviewers for their insightful feedback. We also thank Wadih Al Safi for lending us his voice. David Clifton was supported by the EPSRC under Grants EP/P009824/1 and EP/N020774/1, and by the National Institute for Health Research (NIHR) Oxford Biomedical Research Centre (BRC). The views expressed are those of the authors and not necessarily those of the NHS, the NIHR or the Department of Health. Tingting Zhu was supported by the Engineering for Development Research Fellowship provided by the Royal Academy of Engineering. + +# References + +Chow, C. On optimum recognition error and reject tradeoff. IEEE Transactions on Information Theory, 16(1):41-46, 1970. +Clifford, G. D., Silva, I., Moody, B., Li, Q., Kella, D., Shahin, A., Kooistra, T., Perry, D., and Mark, R. G. The physionet/computing in cardiology challenge 2015: reducing false arrhythmia alarms in the icu. In 2015 Computing in Cardiology Conference, pp. 273-276, 2015. +Clifford, G. D., Liu, C., Moody, B., Li-wei, H. L., Silva, I., Li, Q., Johnson, A., and Mark, R. G. Af classification from a short single lead ECG recording: the phys-ionet/computing in cardiology challenge 2017. In 2017 Computing in Cardiology, pp. 1-4, 2017. + +Cohn, D., Atlas, L., and Ladner, R. Improving generalization with active learning. Machine Learning, 15(2): 201-221, 1994. +Cortes, C., DeSalvo, G., and Mohri, M. Learning with rejection. In International Conference on Algorithmic Learning Theory, pp. 67-82. Springer, 2016. +Dekel, O., Gentile, C., and Sridharan, K. Selective sampling and active learning from single and multiple teachers. Journal of Machine Learning Research, 13(Sep):2655-2697, 2012. +El-Yaniv, R. and Wiener, Y. On the foundations of noise-free selective classification. Journal of Machine Learning Research, 11(May):1605-1641, 2010. +Gal, Y. and Ghahramani, Z. Dropout as a Bayesian approximation: Representing model uncertainty in deep learning. In international Conference on Machine Learning, pp. 1050-1059, 2016. +Gal, Y., Islam, R., and Ghahramani, Z. Deep Bayesian active learning with image data. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 1183-1192. JMLR.org, 2017. +Gao, M., Zhang, Z., Yu, G., Arik, S. Ö., Davis, L. S., and Pfister, T. Consistency-based semi-supervised active learning: Towards minimizing labeling cost. In European Conference on Computer Vision, pp. 510-526. Springer, 2020. +Geifman, Y. and El-Yaniv, R. Selectivenet: A deep neural network with an integrated reject option. In International Conference on Machine Learning, pp. 2151-2159. PMLR, 2019. +Gong, W., Tschiatschek, S., Turner, R., Nowozin, S., and Hernández-Lobato, J. M. Icebreaker: element-wise active information acquisition with bayesian deep latent gaussian model. arXiv preprint arXiv:1908.04537, 2019. +Hannun, A. Y., Rajpurkar, P., Haghpanahi, M., Tison, G. H., Bourn, C., Turakhia, M. P., and Ng, A. Y. Cardiologist-level arrhythmia detection and classification in ambulatory electrocardiograms using a deep neural network. Nature Medicine, 25(1):65, 2019. +Houlsby, N., Huszar, F., Ghahramani, Z., and Lengyel, M. Bayesian active learning for classification and preference learning. arXiv preprint arXiv:1112.5745, 2011. +Kiyasseh, D., Zhu, T., and Clifton, D. A clinical deep learning framework for continually learning from cardiac signals across diseases, time, modalities, and institutions. Nature Communications, 12(1):1-11, 2021a. + +Kiyasseh, D., Zhu, T., and Clifton, D. Crocs: Clustering and retrieval of cardiac signals based on patient disease class, sex, and age. Advances in Neural Information Processing Systems, 34, 2021b. +Konyushkova, K., Sznitman, R., and Fua, P. Learning active learning from data. In Advances in Neural Information Processing Systems, pp. 4225-4235, 2017. +Liu, Z., Wang, Z., Liang, P. P., Salakhutdinov, R. R., Morency, L.-P., and Ueda, M. Deep gamblers: Learning to abstain with portfolio theory. In Advances in Neural Information Processing Systems, pp. 10622-10632, 2019. +McCallumzy, A. K. and Nigamy, K. Employing em and pool-based active learning for text classification. In Proc. International Conference on Machine Learning, pp. 359-367, 1998. +Pasolli, E. and Melgani, F. Active learning methods for electrocardiographic signal classification. IEEE Transactions on Information Technology in Biomedicine, 14(6): 1405-1416, 2010. +Paszke, A., Gross, S., Massa, F., Lerer, A., Bradbury, J., Chanan, G., Killeen, T., Lin, Z., Gimelshein, N., Antiga, L., et al. Pytorch: An imperative style, high-performance deep learning library. In Advances in Neural Information Processing Systems, pp. 8024-8035, 2019. +Settles, B. Active learning literature survey. Technical report, University of Wisconsin-Madison, Department of Computer Sciences, 2009. +Sinha, S., Ebrahimi, S., and Darrell, T. Variational adversarial active learning. In Proceedings of the IEEE International Conference on Computer Vision, pp. 5972-5981, 2019. +Smailagic, A., Costa, P., Noh, H. Y., Walawalkar, D., Khandelwal, K., Galdran, A., Mirshekari, M., Fagert, J., Xu, S., Zhang, P., et al. Medal: Accurate and robust deep active learning for medical image analysis. In IEEE International Conference on Machine Learning and Applications, pp. 481-488, 2018. +Smailagic, A., Costa, P., Gaudio, A., Khandelwal, K., Mirshekari, M., Fagert, J., Walawalkar, D., Xu, S., Galdran, A., Zhang, P., et al. O-medal: Online active deep learning for medical image analysis. Wiley Interdisciplinary Reviews: Data Mining and Knowledge Discovery, 10(4): e1353, 2020. +Urner, R., David, S. B., and Shamir, O. Learning from weak teachers. In Artificial Intelligence and Statistics, pp. 1252-1260, 2012. + +Verma, V., Lamb, A., Kannala, J., Bengio, Y., and Lopez-Paz, D. Interpolation consistency training for semisupervised learning. In Proceedings of the Twenty-Eighth International Joint Conference on Artificial Intelligence, IJCAI-19, pp. 3635-3641. International Joint Conferences on Artificial Intelligence Organization, 7 2019. doi: 10.24963/ijcai.2019/504. URL https://doi.org/10.24963/ijcai.2019/504. +Wang, G., Zhang, C., Liu, Y., Yang, H., Fu, D., Wang, H., and Zhang, P. A global and updatable ecg beat classification system based on recurrent neural networks and active learning. Information Sciences, 501:523-542, 2019. +Watkins, C. J. C. H. Learning from delayed rewards. 1989. +Wiener, Y. and El-Yaniv, R. Agnostic selective classification. In Advances in Neural Information Processing Systems, pp. 1665-1673, 2011. +Wiens, J. and Guttag, J. Active learning applied to patient-adaptive heartbeat classification. Advances in Neural Information Processing Systems, 23, 2010. +Xie, Q., Dai, Z., Hovy, E., Luong, M.-T., and Le, Q. V. Unsupervised data augmentation for consistency training. 2019. +Yan, S., Chaudhuri, K., and Javidi, T. Active learning from imperfect labelers. In Advances in Neural Information Processing Systems, pp. 2128-2136, 2016. +Zhang, C. and Chaudhuri, K. Active learning from weak and strong labelers. In Advances in Neural Information Processing Systems, pp. 703-711, 2015. +Zhu, X. J. Semi-supervised learning literature survey. Technical report, University of Wisconsin-Madison, Department of Computer Sciences, 2005. + +# A. Acquisition Functions $\alpha$ + +$$ +\text {V a r i a n c e} = 1 - \frac {1}{T} \sum_ {t = 1} ^ {T} \left(\delta \left(\underset {c} {\operatorname {a r g m a x}} p (y = c | x, \omega_ {t}) = \hat {c}\right)\right) \tag {6} +$$ + +$$ +\hat {c} = \operatorname * {a r g m a x} _ {c} \left(\operatorname * {a r g m a x} _ {c} p (y = c | x, \omega_ {t}) \forall t \in (1, T)\right) +$$ + +where $\hat{c}$ is the most common class prediction across the $T$ MC samples and $\delta$ is the Dirac delta function that evaluates to 1 if its argument is true, and 0 otherwise. + +$$ +\text {E n t r o p y} \mathrm {H} = - \sum_ {c = 1} ^ {C} p (y = c | x) \log p (y = c | x) \tag {7} +$$ + +$$ +\begin{array}{l} \operatorname {B A L D} = \operatorname {J S D} \left(p _ {1}, p _ {2}, \dots , p _ {T}\right) \tag {8} \\ = \mathrm {H} (p (y | x)) - \mathbb {E} _ {p (w | D _ {t r a i n})} [ \mathrm {H} (p (y | x, w)) ] \\ \end{array} +$$ + +where $C$ is the number of classes in the task formulation and $p(y = c|x,\omega)$ is the probability assigned by a network parameterised by $\omega$ to a particular class $c$ when given an input $x$ . + +# B. Derivation of Monte Carlo Perturbations + +$$ +\begin{array}{l} \mathrm {B A L D} _ {\mathrm {M C P}} = \mathrm {J S D} \left(p _ {1}, p _ {2}, \dots , p _ {T}\right) \tag {9} \\ = \mathrm {H} (p (y | x)) - \mathbb {E} _ {p \left(x ^ {\prime} \mid D _ {t r a i n}\right)} \left[ \mathrm {H} (p (y | x, x ^ {\prime})) \right] \\ \end{array} +$$ + +$$ +\begin{array}{l} \mathrm {H} (p (y | x)) = \mathrm {H} \left(\int p (y | x ^ {\prime}) p \left(x ^ {\prime} | x\right) d x ^ {\prime}\right) \\ = \mathrm {H} \left(\int p \left(y \mid x ^ {\prime}\right) q _ {\phi} \left(x ^ {\prime} \mid x\right) d x ^ {\prime}\right) \tag {10} \\ \approx \mathrm {H} \left(\frac {1}{T} \sum_ {t = 1} ^ {T} p (y | \hat {x ^ {\prime}} _ {t})\right) \\ \end{array} +$$ + +where $x^{\prime}$ represents the perturbed input, $T$ is the number of Monte Carlo samples, and $\hat{x'}_t \sim q_{\phi}(x'|x)$ is a sample from some perturbation generator. + +$$ +\begin{array}{l} \mathbb {E} _ {p \left(x ^ {\prime} \mid D _ {t r a i n}\right)} \left[ \mathrm {H} \left(p \left(y \mid x, x ^ {\prime}\right)\right) \right] = \mathbb {E} _ {q _ {\phi} \left(x ^ {\prime} \mid x\right)} \left[ \mathrm {H} \left(p \left(y \mid x, x ^ {\prime}\right)\right) \right] \\ \approx \frac {1}{T} \sum_ {t = 1} ^ {T} \left[ \mathrm {H} \left(p \left(y \mid \hat {x ^ {\prime}} _ {t}\right)\right) \right] \tag {11} \\ = \frac {1}{T} \sum_ {t = 1} ^ {T} \left[ - \sum_ {c = 1} ^ {C} p (y = c | \hat {x ^ {\prime}} _ {t}) \log p (y = c | \hat {x ^ {\prime}} _ {t}) \right] \\ \end{array} +$$ + +# C. Derivation of Bayesian Active Learning by Consistency + +$$ +\operatorname {B A L C} _ {\mathrm {J S D}} = \mathbb {E} _ {p (\omega | D _ {t r a i n})} \left[ \mathcal {D} _ {K L} \left(p (y | x, \omega) \| p (y | x ^ {\prime}, \omega)\right) \right] - \mathcal {D} _ {K L} \left(p (y | x) \| p (y | x ^ {\prime})\right) \tag {12} +$$ + +where $x^{\prime}$ is the perturbed version of the input and $\mathcal{D}_{KL}$ is the Kullback-Leibler divergence. + +$$ +\begin{array}{l} \mathbb {E} _ {p (\omega | D _ {t r a i n})} \left[ \mathcal {D} _ {K L} (p (y | x, \omega) \parallel p (y | x ^ {\prime}, \omega)) \right] = \mathbb {E} _ {q _ {\theta} (\omega)} \left[ \mathcal {D} _ {K L} (p (y | x, \omega) \parallel p (y | x ^ {\prime}, \omega)) \right] \\ \approx \frac {1}{T} \sum_ {t = 1} ^ {T} \left[ \mathcal {D} _ {K L} \left(p \left(y | x, \hat {\omega} _ {t} \parallel p \left(y | \hat {x}, \hat {\omega} _ {t}\right)\right) \right] \right. \tag {13} \\ = \frac {1}{T} \sum_ {t = 1} ^ {T} \left[ \sum_ {c = 1} ^ {C} p (y = c | x, \hat {\omega} _ {t}) \log \frac {p (y = c | x , \hat {\omega} _ {t})}{p (y = c | x ^ {\prime} , \hat {\omega} _ {t})} \right] \\ \end{array} +$$ + +$$ +\begin{array}{l} \mathcal {D} _ {K L} (p (y | x) | | p (y | x ^ {\prime})) = \mathcal {D} _ {K L} \left(\int p (y | \omega , x) p (\omega) d \omega \left\| \int p (y | \omega , x ^ {\prime}) p (\omega) d \omega\right) \right. \\ = \mathcal {D} _ {K L} \left(\int p (y | \omega , x) q _ {\theta} (\omega) d \omega \left\| \int p (y | \omega , x ^ {\prime}) q _ {\theta} (\omega) d \omega\right) \right. \\ \approx \mathcal {D} _ {K L} \left(\frac {1}{T} \sum_ {t = 1} ^ {T} p \left(y \mid \hat {\omega} _ {t}, x\right) \| \frac {1}{T} \sum_ {t = 1} ^ {T} p \left(y \mid \hat {\omega} _ {t}, x ^ {\prime}\right)\right) \tag {14} \\ = \frac {1}{C} \sum_ {c = 1} ^ {C} \left[ \frac {1}{T} \sum_ {t = 1} ^ {T} p (y = c | \hat {\omega} _ {t}, x) \log \frac {\frac {1}{T} \sum_ {t = 1} ^ {T} p (y = c | \hat {\omega} _ {t} , x)}{\frac {1}{T} \sum_ {t = 1} ^ {T} p (y = c | \hat {\omega} _ {t} , \hat {x})} \right] \\ \end{array} +$$ + +where the integral is approximated by $T$ Monte Carlo samples, $\hat{\omega} \sim q_{\theta}(w)$ represents the parameters sampled from the Monte Carlo distribution, and $C$ represents the number of classes in the task formulation. + +# D. Datasets + +# D.1. Data Preprocessing + +Each dataset consists of cardiac time-series waveforms alongside their corresponding cardiac arrhythmia label. Each waveform was split into non-overlapping frames of 2500 samples. + +PhysioNet 2015 PPG, $\mathcal{D}_1$ (Clifford et al., 2015). This dataset consists of photoplethysmogram (PPG) time-series waveforms sampled at $250\mathrm{Hz}$ and five cardiac arrhythmia labels: Asystole, Extreme Bradycardia, Extreme Tachycardia, Ventricular Tachycardia, and Ventricular Fibrillation. Only patients with a True Positive Alarm are considered. The PPG frames were normalized in amplitude between the values of 0 and 1. + +PhysioNet 2015 ECG, $\mathcal{D}_2$ (Clifford et al., 2015). This dataset consists of electrocardiogram (ECG) time-series waveforms sampled at $250\mathrm{Hz}$ and five cardiac arrhythmia labels: Asystole, Extreme Bradycardia, Extreme Tachycardia, Ventricular Tachycardia, and Ventricular Fibrillation. Only patients with a True Positive Alarm are considered. The ECG frames were normalized in amplitude between the values of 0 and 1. + +PhysioNet 2017 ECG, $\mathcal{D}_3$ (Clifford et al., 2017). This dataset consists of ECG time-series waveforms sampled at $300\mathrm{Hz}$ and four labels: Normal, Atrial Fibrillation, Other, and Noisy. The ECG frames were not normalized. + +Cardiology ECG, $\mathcal{D}_4$ (Hannun et al., 2019). This dataset consists of ECG time-series waveforms sampled at $200\mathrm{Hz}$ and twelve cardiac arrhythmia labels: Atrial Fibrillation, Atrio-ventricular Block, Bigeminy, Ectopic Atrial Rhythm, Idioventricular Rhythm, Junctional Rhythm, Noise, Sinus Rhythm, Supraventricular Tachycardia, Trigeminy, Ventricular Tachycardia, and Wenckebach. Sudden bradycardia cases were excluded from the data as they were not included in the original formulation by the authors. The ECG frames were not normalized. + +# D.2. Data Samples + +All datasets were split into training, validation, and test sets according to patient ID using a 60, 20, 20 configuration. In other words, patients appeared in only one of the sets. Samples in the training set were further split into a labelled and an unlabelled subset, also according to patient ID. In Tables 3 and 4, we show the number of samples and patients used in each of these sets. + +# D.2.1. CONSISTENCY-BASED ACTIVE LEARNING EXPERIMENTS + +Table 3: Sample sizes (number of patients for cardiac datasets) of train/val/test splits. Datasets $\mathcal{D}_1$ to $\mathcal{D}_4$ are defined in the main manuscript. + +
DatasetFraction FTrain LabelledTrain UnlabelledValTest
D10.1401 (18)4,233 (171)
0.31,285 (55)3,349 (134)
0.52,187 (92)2,447 (97)1,124 (47)1,435 (58)
0.73,132 (129)1,502 (60)
0.94,184 (166)450 (23)
D20.1401 (18)4,233 (171)
0.31,285 (55)3,349 (134)
0.52,187 (92)2,447 (97)1,124 (47)1,435 (68)
0.73,132 (129)1,502 (60)
0.94,184 (166)450 (23)
D30.11,776 (545)16,479 (4,914)
0.35,399 (1636)12,856 (3,823)
0.59,054 (2727)9,201 (2,732)4,582 (1,364)5,824 (1705)
0.712,733 (3818)5,522 (1,641)
0.916,365 (4909)1,890 (550)
D40.1452 (20)4,110 (181)
0.31,368 (60)3,194 (141)
0.52,280 (101)2,282 (100)1,131 (50)1,386 (62)
0.73,200 (140)1,362 (61)
0.94,079 (180)483 (21)
+ +# D.2.2. SELECTIVE ORACLE QUESTIONING EXPERIMENTS + +Table 4: Sample sizes (number of patients) of training, validation, and test sets. + +
DatasetTraining LabelledTraining UnlabelledValidationTest
D1401 (18)4233 (171)1124 (47)1435 (58)
D2401 (18)4233 (171)1124 (47)1435 (58)
D31,776 (545)16,479 (4,914)4,582 (1,364)5,824 (1,705)
D4452 (20)4,110 (181)1,131 (50)1,386 (62)
+ +# E. Implementation Details + +In this section, we outline the network architecture used for all experiments conducted in the main manuscript. We also outline the batchsize and learning rate associated with training on each of the datasets. + +# E.1. Network Architecture + +Table 5: Network architecture used for time-series experiments. $K$ , $C_{\mathrm{in}}$ , and $C_{\mathrm{out}}$ represent the kernel size, number of input channels, and number of output channels, respectively. A stride of 3 was used for Conv1D operators, respectively. +(a) Network for time-series datasets + +
Layer NumberLayer ComponentsKernel Dimension
1Conv 1D7 x 1 x 4 (K x Cin x Cout)
BatchNorm
ReLU
MaxPool(2)
Dropout(0.1)
2Conv 1D7 x 4 x 16
BatchNorm
ReLU
MaxPool(2)
Dropout(0.1)
3Conv 1D7 x 16 x 32
BatchNorm
ReLU
MaxPool(2)
Dropout(0.1)
4Linear320 x 100
ReLU
5Linear100 x C (classes)
+ +# E.2. Experiment Details + +Table 6: Batchsize and learning rates used for training with different datasets. The Adam optimizer was used for all experiments. + +
DatasetBatchsizeLearning Rate
D125610-4
D225610-4
D325610-4
D41610-4
+ +# E.3. Perturbation Details + +When conducting the MCP and BALC experiments, we perturbed each of the time-series frames with additive Gaussian noise, $\epsilon \sim \mathcal{N}(0,\sigma)$ where we chose $\sigma$ based on the specific dataset to avoid introducing too much noise. The details of these perturbations can be found in Table 7. We applied all perturbations to the input data before normalization. + +Table 7: Perturbations applied to different datasets during MCP and BALC implementations. $p$ represents the probability of applying a particular augmentation method. + +
DatasetPerturbation
D1ε ~ N(0, 100)
D2ε ~ N(0, 100)
D3ε ~ N(0, 100)
D4ε ~ N(0, 100)
+ +# E.4. Baseline Implementations + +In this section, we outline our implementation of the baseline methods used in the selective oracle questioning experiments. + +# E.4.1. ENTROPY RESPONSE, (S-RESPONSE) + +This approach is anchored around the idea that network outputs that exhibit high entropy (i.e., close to a uniform distribution) are likely to correspond to instances that the network is uncertain of. Consequently, we exploited this idea to determine whether a label is requested from an oracle or if a pseudo-label should be generated instead. More specifically, we introduced a threshold, $\mathrm{S}_{Entropy} = w \times \mathrm{S}_{Max}$ , which is a fraction of the maximum entropy possible for a particular classification problem. As mentioned, $\mathrm{S}_{Max} = \log C$ , where $C$ is the number of classes. We chose $w = 0.9$ to balance between oracle dependence and pseudo-label accuracy. This value was kept fixed during training. In our implementation, we take the mean of the network outputs as a result of the perturbations, calculate its entropy, and determine whether it exceeds the aforementioned threshold. If it does, then the uncertainty is deemed high and a label is requested from an oracle. + +# E.4.2. EPSILON GREEDY, (ε-GREEDY) + +This approach is inspired by the reinforcement learning literature and is used to decay the dependence of network on the oracle. More specifically, we define $\epsilon = e^{\frac{-\mathrm{epoch}}{k \times \tau}}$ where epoch represents the training epoch number and $\tau$ is the epoch interval at which acquisitions are performed. $\epsilon$ decays from $1 \to 0$ as training progresses. We chose $k = \tau = 5$ in order to balance between oracle dependence and pseudo-label accuracy. To determine whether a label is requested from an oracle, we generate a random number, $R \sim \mathcal{U}(0,1)$ , for a uniform distribution and check whether it is below $\epsilon$ . If this is satisfied, then an oracle is requested for a label, and a pseudo-label is generated otherwise. As designed, this approach starts off with $100\%$ dependence on an oracle and decays towards minimal dependence as training progresses. + +# F. Pseudo-code + +We elucidate the entire active learning framework in Algorithms 1 and 2 where the coloured lines indicate the components associated with the (optional) tracking of acquisition functions. It is worthwhile to note that our oracle selection framework is independent of the acquisition of unlabelled instances. As such, it is flexible enough to be used alongside other acquisition functions. + +Algorithm 1 Bayesian Active Learning by Consistency +Input: acquisition epochs $\tau$ , temporal period $\Delta t$ , labelled data $\mathcal{D}_L$ , unlabelled data $X_U$ , network parameters $\theta$ $\omega$ $\phi$ , MC samples $T$ , acquisition fraction $b$ +1: while training do +2: if epoch in $\Delta t$ then +3: for $x \sim X_U$ do +4: $x' = x + \epsilon$ , $\epsilon \sim \mathcal{N}(0, \sigma^2)$ +5: for $t$ -th MC sample in $T$ do +6: obtain $p(y|x, \theta_t)$ +7: obtain $p(y|x', \theta_t)$ +8: calculate $\alpha(x)$ using (2) or (1) +9: $\alpha(x, t) = \alpha$ +10: if epoch in $\tau$ then +11: calculate $\alpha$ using (3) +12: SortDescending( $\alpha$ ) +13: $x_b \subset X_U$ +14: $y_b = \operatorname{SoQal}(x_b)$ +15: $X_U \in (X_U \setminus (x_b, y_b))$ +16: $\mathcal{D}_L \in (\mathcal{D}_L \cup (x_b, y_b))$ + +Algorithm 2 SoQal +Input: unlabelled instances $x_{b}$ , Hellinger distance $D_{H}$ , Hellinger threshold $S$ +1: for $x_{u} \sim x_{b}$ do +2: $r_{u} = g_{\phi}(x_{u})$ +3: if $D_{H} > S$ then +4: calculate $p(\mathrm{A})$ from (5) +5: if $p(\mathrm{A}) = 1$ then +6: $y_{b} \subset Y_{U}$ +7: else +8: $y_{b} = \operatorname*{argmax}_{c} p_{\omega}(y = c | x_{u})$ +9: +10: +11: +12: +13: +14: +15: +16: +17: +18: +19: +20: +21: +22: +23: +24: +25: +26: +27: +28: +29: +30: +31: +32: +33: +34: +35: +36: +37: +38: +39: +40: +41: +42: +43: +44: +45: +46: +47: +48: +49: +50: +51: +52: +53: +54: +55: +56: +57: +58: +59: +60: +61: +62: +63: +64: +65: +66: +67: +68: +69: +70: +71: +72: +73: +74: +75: +76: +77: +78: +79: +80: +81: +82: +83: +84: +85: +86: +87: + +# G. Validation Set AUC with Non-Temporal Acquisition Functions in the Absence of Oracle + +In the main manuscript, we presented a subset of results for experiments in which oracles are absent and thus unavailable to provide annotations. Instead, unlabelled instances are pseudo-labelled based on network-generated predictions. In this section, we include an exhaustive set of results for all those experiments. More specifically, we illustrate in Figs. 8 - 11 the validation AUC of the various AL methods for datasets $\mathcal{D}_1 - \mathcal{D}_5$ . At a high level and across datasets, we find that the cold-start problem is likely to occur at low fraction values ( $\beta = 0.1$ ). We include more details in the respective sections. + +# G.1. PhysioNet 2015 PPG, $\mathcal{D}_1$ + +![](images/22d84d4f3b9966b835f61cd7c59155fe500db978ddcd73be32e563d829e119f0.jpg) + +![](images/987f1dd5943796008309cee8d2b3fa7118344333b482ce9075b31a4856bdc566.jpg) +(a) $\beta = 0.1$ + +![](images/10b1509f2c19c067829a0fed304371385d50bf05f744581f424b4e4dfcdd05a2.jpg) +(b) $\beta = 0.3$ + +![](images/51be3ad068110756badfd3dae938a4176dcc3acdd78695cc070ddb62fe6ea87e.jpg) +(c) $\beta = 0.5$ + +![](images/105cc8c6c7f0dad0e7a3c5ba536dbee49989ee8ff1039a8e49bfb55ff0eaa1d2.jpg) +(d) $\beta = 0.7$ + +![](images/eee8c47394812f8cd2c01529dbad6d9a5b91fb99494a57e99c809080a79048b7.jpg) +(e) $\beta = 0.9$ +Figure 8: Mean validation set AUC for the various methodologies and acquisition functions on $\mathcal{D}_1$ at increasing fraction levels $\beta = (0.1, 0.3, 0.5, 0.7, 0.9)$ . The no-oracle cold-start problem is observed at $\beta = 0.1$ where active learning approaches fail due to few available labelled training instances. Clear benefits of our methods can be seen at $\beta = 0.5, 0.7$ . Results are averaged across 5 seeds. + +# G.2. PhysioNet 2015 ECG, $\mathcal{D}_2$ + +![](images/ce3969b999f38edb23e8ce1141fb777fed8c5858a1dad0f760a3b5b8510f21bc.jpg) + +![](images/7c7e367cef51b23f3f91db5b14b86f6ac813dd2648bcad1a324de09006b6c092.jpg) +(a) $\beta = 0.1$ + +![](images/28e9b9e8e57ef69da4b82d3c12fe095a93b98af001c6035293053284517b2971.jpg) +(b) $\beta = 0.3$ + +![](images/7ddf19042263badb982f04e8f78a5df54ab118ad607f96cc90d347e50b6cbe7a.jpg) +(c) $\beta = 0.5$ + +![](images/aa43ae84c7b482464115bb7057afc637ee6b23de1f53d9f042bc7177477af8cc.jpg) +(d) $\beta = 0.7$ + +![](images/70a80ffe984229724ba36ef3b6b8c51b29278ccd99b702a272182806ed6c2999.jpg) +(e) $\beta = 0.9$ +Figure 9: Mean validation set AUC for the various methodologies and acquisition functions on $\mathcal{D}_2$ at increasing fraction levels $\beta = (0.1, 0.3, 0.5, 0.7, 0.9)$ . Our methods include MCP and BALC methods. The no-oracle cold-start problem is observed at $\beta = 0.1$ where active learning approaches fail due to few available labelled training instances. However, our approaches outperform all others at $\beta = 0.3, 0.5, 0.7, 0.9$ . Results are averaged across 5 seeds. + +# G.3. PhysioNet 2017 ECG, $\mathcal{D}_3$ + +![](images/1f333566786c9bebde98505ffa21a669dc5e9d160da81dfc5b33de92ccd2de50.jpg) + +![](images/d563678359538f7571cf513af911326672c5e7bf0316f2373bc490184cf965ea.jpg) +(a) $\beta = 0.1$ + +![](images/76e8877f16699867534df094ca0365257410e1dcb4cb2823468a54fa913db535.jpg) +(b) $\beta = 0.3$ + +![](images/6aba29de8a7334fee1645bd099d2acf59da384bbe11dfdeea198350d67b81c45.jpg) +(c) $\beta = 0.5$ + +![](images/0054ac7c7833c6a1faf73dbd3acfcce4f10529c337ed4a596bee16ec0f03504c.jpg) +(d) $\beta = 0.7$ + +![](images/90389953033cd800c27a9e5eb02ed2cce6bf3a18cae17ad6fcfb49fa8baacdce.jpg) +(e) $\beta = 0.9$ +Figure 10: Mean validation set AUC for the various methodologies and acquisition functions on $\mathcal{D}_3$ at increasing fraction levels $\beta = (0.1, 0.3, 0.5, 0.7, 0.9)$ . Our methods include MCP and BALC methods. The no-oracle cold-start problem is observed at $\beta = 0.1$ where active learning approaches fail due to few available labelled training instances. Most methods perform on par with the no active learning strategy for this particular dataset. Results are averaged across 5 seeds. + +# G.4.Cardiology ECG, $\mathcal{D}_4$ + +![](images/f158398d541ccc483d34f8f49574556c7d43697bb591cd2e2b1b64544eb9e9a0.jpg) + +![](images/374b22989a7720db51af5165243c23a59f590d589981c47fbace914b23f17e09.jpg) +(a) $\beta = 0.1$ + +![](images/a0511e792d74733512f34b793babdf941b1a80b20bd3b28fef08f383eb7b8530.jpg) +(b) $\beta = 0.3$ + +![](images/92a88833fa8c6e86c97100f8561fe3846452a550f3473e4f56dc94301bd1e893.jpg) +(c) $\beta = 0.5$ + +![](images/737f66659c6a1c6a7bb43635011019b8e622f058cadd1b3e1974a001bfc8d70f.jpg) +(d) $\beta = 0.7$ + +![](images/2a18d8f95b7f50118a0a838b5a8555f7728c08735c0e33695a12db51371675a9.jpg) +(e) $\beta = 0.9$ +Figure 11: Mean validation set AUC for the various methodologies and acquisition functions on $\mathcal{D}_4$ at increasing fraction levels $\beta = (0.1, 0.3, 0.5, 0.7, 0.9)$ . Our methods include MCP and BALC methods. The no-oracle cold-start problem is not observed for this dataset. Most methods perform comparably to one another at high values of $\beta$ . Results are averaged across 5 seeds. + +# H. Effect of MCP with Tracked Acquisition Functions on Performance + +In this section, we are interested in quantifying the effect of implementing a temporal acquisition function in conjunction with MCP on performance. In Fig. 12, we illustrate two columns of matrices. The first column reflects the percent change in generalization performance between implementing MCP and MCD with static temporal functions (i.e., without tracking) for three different datasets. + +We find that there are mixed results. For example, on $\text{mathcal{D}}_2$ at $\beta = 0.5$ , $\text{BALD}_{\text{MCP}}$ outperforms $\text{BALD}_{\text{MCD}}$ by $6.5\%$ . However, on $\text{mathcal{D}}_4$ at $\beta = 0.5$ , $\text{Entropy}_{\text{MCP}}$ performs worse than $\text{Entropy}_{\text{MCD}}$ by $6.7\%$ . Furthermore, upon applying tracked acquisition functions, we also obtain mixed results. In many cases, there are notable improvements. For example, on $\text{mathcal{D}}_3$ at $\beta = 0.5$ , Temporal Entropy $\text{MCP}$ improves performance by an additional $0.3 + 2.3 = 2.6\%$ . On the other hand, at $\beta = 0.7$ , Temporal Entropy $\text{MCP}$ worsens performance by $2.1\%$ . Based on these findings, we would recommend that the utility of temporal acquisition functions be determined on a case-by-case basis. + +![](images/2b13eb66e77911f27cadc61dddaef241e6c8f097a8cf02f2bfde771718f4a213.jpg) +(a) $\mathcal{D}_2$ + +![](images/68ec42a2ed9bf9882085f67e9cfc9e4f85eb5d6589cfdf6b6741ab7dcde43ec9.jpg) + +![](images/9d288ba4fdb1e65eefef0074b35ac2e04e8253e43c699dfe18412cb5120dec79.jpg) +(b) $\mathcal{D}_3$ +(c) $\mathcal{D}_4$ +Figure 12: Mean percent change in test AUC when comparing MCP with static and tracked acquisition functions to MCD with their static counterparts on (a) $\mathcal{D}_2$ and (b) $\mathcal{D}_3$ and (c) $\mathcal{D}_4$ . We show results for Var Ratio, Entropy, and BALD, at all fractions, $\beta \in [0.1, 0.3, 0.5, 0.7, 0.9]$ . + +# I. Dependence of SoQal on Oracle + +Recall that one of our original goals is to reduce the labelling burden that is placed on an oracle (e.g., physician). In this section, we look to quantify the degree to which our active learning framework is dependent on an oracle. To do so, we define a metric, which we refer to as the oracle ask rate (OAR), that quantifies the proportion of all acquired instances whose labels are requested from an oracle. For example, an OAR = 50% implies that 50% of the acquired instances had labels provided by an oracle, with the remaining 50% pseudo-labelled by the network. In Fig. 13a (left), we present the oracle ask rate of SoQal as a function of the type and magnitude of label noise. + +# I.1. Label noise and dependence on oracle + +In Fig. 13a (left), we find that SoQal alleviates the labelling burden placed on an oracle. For example, SoQal when used in conjunction with $\mathrm{BALD}_{\mathrm{MCP}}$ and without label noise, achieves OAR $\approx 0.68 < 1.0$ . This suggests that $32\%$ fewer label requests were sent to an oracle compared to an active learning framework that requests $100\%$ of its labels from an oracle. However, these fewer label requests do result in slightly lower performance compared to the $100\%$ method (see earlier Table 2). This is expected since noise-free oracle-provided labels are likely to be of higher quality than those generated by a network (via pseudo-labels). + +We also find that SoQal can become more dependent on an oracle with increased levels of noise. For example, with random + +![](images/0967c28c76cd332205d32ade2639e38a447e6e0cc5ff2d12f67c5790c2a93679.jpg) +(a) + +![](images/5944d46268e9edf6fdc3f28415f999053db54112a82b89296444352fc7f1ec01.jpg) + +![](images/182cd626278a2fe7334f10a19d226e7711e05ef32ae808f8896724d41bdff472.jpg) +(b) + +![](images/9e0c9a9b72cc7ec442b4c84b2748450f3ee5be7af804a042cf1fbf349a8c8a8b.jpg) +(c) +Figure 13: Dependence of SoQal on oracle as a function label noise, data availability, and the Hellinger threshold. (a) (left) Average oracle ask rate (OAR) as a function of various types and levels of label noise, shown for a subset of acquisition functions. (right) Correlation between oracle ask rate and generalization performance. We also present the OAR and corresponding AUC while using $\mathrm{BALD_{MCD}}$ as a function of (b) the labelled fraction, $F$ , of labelled data and (c) the Hellinger threshold, $S$ . All results are averaged across five random seeds. In (a) (right), we show that the reduced dependence of a network on an oracle can be advantageous. This is particularly true if the oracle exhibits label noise. In (b), we show that increasing the amount of labelled data increases the network's dependence on an oracle. In (c), we show that tuning $S$ provides researchers with flexibility over how often to request a label from an oracle. + +noise $\gamma = 0.05\rightarrow 0.8$ , the average OAR $\approx 0.72\to 0.80$ . This increased dependence can be problematic, particularly when the oracle is highly likely to annotate unlabelled instances incorrectly. Nonetheless, SoQal, even with extreme label noise, achieves OAR $< 1.0$ (fewer requests) while continuing to outperform the remaining questioning methods (see earlier Fig. 7). + +In Fig. 13a (right), we further explore the relationship between the oracle ask rate and generalization performance. We find that, with label noise, the decreased dependence of SoQal on an oracle is associated with improved generalization performance. This is shown by the negative correlation between the average OAR and the AUC. For example, with OAR $\approx 0.85\rightarrow 0.65$ , the AUC $\approx 0.53\to 0.63$ . This suggests that SoQal performs better while requesting fewer labels. Such a finding reaffirms the observation that SoQal appropriately learns when to request a label from an oracle or to pseudo-label instead. + +# I.2. Data availability and dependence on oracle + +The previous oracle questioning results we presented were based on experiments conducted on limited, labelled datasets (i.e., $F = 0.1$ ). In this section, we explore the dependence of SoQal on an oracle when provided with more labelled data (i.e., $F > 0.1$ ). In Fig. 13b, we present the OAR and corresponding AUC as a function of the amount of available labelled data, $F$ . As expected, we find that performance improves with more data. For example, as $F = 0.1 \rightarrow 0.9$ , AUC ≈ 0.50 → 0.65. We also find that SoQal continues to alleviate the labelling burden placed on an oracle even when more labelled data are available. For example, at $F = 0.9$ , SoQal exhibits OAR ≈ 0.67 < 1.0, reflecting a 33% reduction in labelling burden. + +# I.3. Hellinger threshold and dependence on oracle + +We claimed that the Hellinger threshold, $S$ , can be tuned according to the relative trust one has in the network and the oracle. A higher threshold $(\uparrow S)$ implies that less trust is placed in the network than in the oracle. In Fig. 13c, we present the OAR and corresponding AUC as a function of the Hellinger threshold, $S$ . + +Consistent with expectations, we find that the dependence of SoQal on the oracle increases with the threshold. For example, as $S = 0.10 \rightarrow 0.40$ , OAR ≈ 0.86 → 1.0. Such a finding suggests that researchers can set the threshold, $S$ , a priori based on the extent to which they would like to request labels from an oracle. We also find that this increased dependence sometimes results in worse performance. For example, although transitioning from $S = 0.20 \rightarrow 0.30$ leads to OAR ≈ 0.95 → 1.0, the AUC ≈ 0.77 → 0.74. We hypothesize that this worse performance is due to inherent label noise in the datasets. Therefore, a strategy which depends on an oracle 100% of the time is worse than one which delegates some of the labelling to the network instead. Such a finding provides further evidence in support of a dynamic oracle selection strategy. + +# J. Performance of Oracle Selection Strategies with Noisy Oracle + +Over-reliance on an oracle could be detrimental for an active learning algorithm if that oracle is unable to label instances accurately. In the case of physicians, this inability could arise due to poor training, fatigue, or the difficulty of a particular case being diagnosed. We simulate these scenarios by injecting label noise of various magnitude into the datasets. In this section, we illustrate the performance of three oracle selection strategies, SoQal, Epsilon Greedy, and Entropy Response, in response to label noise. The results are shown for random and nearest neighbour noise in Secs. J.1 and J.2, respectively. + +# J.1. Label Noise - Random + +Although random noise can be considered an extreme case, it is nonetheless plausible in certain scenarios where labellers are poorly trained or the task at hand is too difficult. In this section, we illustrate, in Tables 8a - 8c, the degree to which the test AUC is affected by the introduction of random label noise during the active learning procedure. + +As expected, extreme levels of noise negatively affect performance. For instance, this can be seen in Table 8a at $\mathcal{D}_2$ using $\mathrm{BALD_{MCD}}$ where increasing the level of random noise from $5\% \rightarrow 80\%$ leads to a reduction of AUC $= 0.679\rightarrow 0.556$ Across most noise levels, SoQal continues to outperform Epsilon Greedy and Entropy Response. This finding is consistent with that presented in the main manuscript and illustrates the relative robustness of SoQal to label noise. + +Table 8: Mean test AUC of oracle questioning strategies as a function of increasing levels of random label noise by the oracle. Results are shown for datasets $\mathcal{D}_1 - \mathcal{D}_5$ and all acquisition functions. Mean and standard deviation values are shown across five seeds. +(a) SoQal + +
DatasetAc. Function αRandom Noise Level
0.050.100.200.400.80
D1BALDMCD0.595 ± 0.0530.554 ± 0.0280.558 ± 0.0420.600 ± 0.0290.511 ± 0.055
BALMCP0.659 ± 0.0140.650 ± 0.0270.636 ± 0.0290.549 ± 0.0580.528 ± 0.029
BALCKLD0.564 ± 0.0580.570 ± 0.0450.562 ± 0.0670.498 ± 0.0380.477 ± 0.011
Temporal BALCKLD0.634 ± 0.0260.597 ± 0.0350.611 ± 0.0400.494 ± 0.0340.490 ± 0.026
D2BALDMCD0.679 ± 0.0170.659 ± 0.0420.646 ± 0.0440.602 ± 0.0470.556 ± 0.065
BALMCP0.643 ± 0.0200.677 ± 0.0530.637 ± 0.0420.619 ± 0.0330.602 ± 0.041
BALCKLD0.652 ± 0.0370.659 ± 0.0560.649 ± 0.0540.614 ± 0.0160.522 ± 0.032
Temporal BALCKLD0.655 ± 0.0480.701 ± 0.0290.628 ± 0.0740.594 ± 0.0410.581 ± 0.032
D3BALDMCD0.750 ± 0.0170.742 ± 0.0310.718 ± 0.0370.646 ± 0.0230.584 ± 0.017
BALMCP0.724 ± 0.0220.707 ± 0.0210.682 ± 0.0380.629 ± 0.0290.537 ± 0.025
BALCKLD0.724 ± 0.0320.725 ± 0.0280.702 ± 0.0240.651 ± 0.0460.564 ± 0.040
Temporal BALCKLD0.725 ± 0.0310.738 ± 0.0130.705 ± 0.0170.596 ± 0.0710.546 ± 0.041
D4BALDMCD0.506 ± 0.0190.479 ± 0.0220.496 ± 0.0230.490 ± 0.0100.518 ± 0.029
BALMCP0.499 ± 0.0370.508 ± 0.0220.523 ± 0.0270.495 ± 0.0230.503 ± 0.021
BALCKLD0.491 ± 0.0260.481 ± 0.0230.496 ± 0.0310.518 ± 0.0120.525 ± 0.011
Temporal BALCKLD0.522 ± 0.0160.505 ± 0.0270.501 ± 0.0210.511 ± 0.0250.515 ± 0.031
+ +(b) Epsilon Greedy + +
DatasetAc. Function αRandom Noise Level
0.050.100.200.400.80
D1BALDMCD0.496±0.0580.494±0.0290.476±0.0300.507±0.0440.501±0.056
BALMCP0.557±0.0180.549±0.0360.508±0.0320.511±0.0330.497±0.057
BALCKLD0.517±0.0140.518±0.0350.504±0.0280.506±0.0340.498±0.017
Temporal BALCKLD0.525±0.0370.512±0.0400.501±0.0250.493±0.0190.497±0.039
D2BALDMCD0.600±0.0530.628±0.0530.589±0.0370.612±0.0220.555±0.041
BALMCP0.629±0.0230.614±0.0480.536±0.0810.575±0.0290.588±0.050
BALCKLD0.619±0.0380.586±0.0540.629±0.0610.613±0.0450.582±0.067
Temporal BALCKLD0.630±0.0410.652±0.0290.579±0.0340.610±0.0360.564±0.035
D3BALDMCD0.663±0.0180.661±0.0110.632±0.0210.626±0.0120.588±0.017
BALMCP0.671±0.0170.670±0.0160.639±0.0240.623±0.0190.574±0.041
BALCKLD0.665±0.0220.650±0.0140.664±0.0130.618±0.0340.595±0.031
Temporal BALCKLD0.661±0.0120.651±0.0180.651±0.0160.629±0.0190.612±0.049
D4BALDMCD0.473±0.0300.480±0.0330.469±0.0240.468±0.0180.493±0.015
BALMCP0.508±0.0160.495±0.0190.498±0.0430.494±0.0320.497±0.015
BALCKLD0.492±0.0260.496±0.0210.481±0.0250.491±0.0200.498±0.021
Temporal BALCKLD0.514±0.0170.528±0.0170.500±0.0080.498±0.0330.504±0.037
+ +(c) Entropy Response + +
DatasetAc. Function αRandom Noise Level
0.050.100.200.400.80
D1BALDMCD0.495 ± 0.0380.497 ± 0.0570.498 ± 0.0570.486 ± 0.0440.512 ± 0.057
BALMCP0.534 ± 0.0180.584 ± 0.0730.565 ± 0.0330.619 ± 0.0220.518 ± 0.028
BALCKLD0.535 ± 0.0380.521 ± 0.0420.514 ± 0.0530.511 ± 0.0270.525 ± 0.037
Temporal BALCKLD0.526 ± 0.0400.538 ± 0.0360.504 ± 0.0280.501 ± 0.0360.500 ± 0.004
D2BALDMCD0.587 ± 0.0440.564 ± 0.0580.586 ± 0.0470.613 ± 0.0830.551 ± 0.031
BALMCP0.624 ± 0.0440.598 ± 0.0570.573 ± 0.0530.560 ± 0.0810.530 ± 0.015
BALCKLD0.616 ± 0.0430.653 ± 0.0490.624 ± 0.0510.565 ± 0.0550.579 ± 0.019
Temporal BALCKLD0.635 ± 0.0450.603 ± 0.0500.590 ± 0.0420.602 ± 0.0460.579 ± 0.041
D3BALDMCD0.592 ± 0.0150.604 ± 0.0170.603 ± 0.0160.603 ± 0.0160.605 ± 0.018
BALMCP0.694 ± 0.0470.730 ± 0.0290.666 ± 0.0340.639 ± 0.0310.599 ± 0.035
BALCKLD0.631 ± 0.0060.631 ± 0.0090.622 ± 0.0110.631 ± 0.0250.564 ± 0.046
Temporal BALCKLD0.602 ± 0.0110.622 ± 0.0180.630 ± 0.0140.618 ± 0.0400.565 ± 0.050
D4BALDMCD0.472 ± 0.0290.472 ± 0.0300.486 ± 0.0080.476 ± 0.0380.481 ± 0.038
BALMCP0.511 ± 0.0210.510 ± 0.0230.525 ± 0.0330.498 ± 0.0410.497 ± 0.017
BALCKLD0.468 ± 0.0220.472 ± 0.0290.477 ± 0.0290.483 ± 0.0180.475 ± 0.032
Temporal BALCKLD0.482 ± 0.0230.491 ± 0.0130.490 ± 0.0210.487 ± 0.0310.515 ± 0.022
+ +# J.2. Label Noise - Nearest Neighbour + +Nearest neighbour noise is more realistic than that which is random as it may simulate uncertainty in diagnoses made by physicians. In this section, we illustrate, in Tables 9a - 9c, the degree to which the test AUC is affected by the introduction of nearest neighbour label noise during the active learning procedure. + +As expected, extreme levels of noise negatively affect performance. For instance, this can be seen in Table 9a at $\mathcal{D}_3$ using $\mathrm{BALD}_{\mathrm{MCD}}$ where increasing the level of nearest neighbour noise from $5\% \rightarrow 80\%$ leads to a reduction of the AUC $= 0.744\rightarrow 0.694$ . SoQal continues to outperform Epsilon Greedy and Entropy Response across most of the noise levels. Building on the previous example, with $80\%$ nearest neighbour noise, SoQal achieves an AUC $= 0.694$ whereas Epsilon Greedy and Entropy Response achieve an AUC $= 0.632$ and 0.587, respectively. Such a finding is similar to that arrived at with Random Noise and implies that SoQal is relatively more robust to noisy oracles than these other methods. + +Table 9: Mean test AUC of oracle questioning strategies as a function of increasing levels of nearest neighbour label noise by the oracle. Results are shown for datasets $\mathcal{D}_1 - \mathcal{D}_5$ and all acquisition functions. Mean and standard deviation values are shown across five seeds. +(a) SoQal + +
DatasetAc. Function αNearest Neighbour Noise Level
0.050.100.200.400.80
D1BALDMCD0.614 ± 0.0430.571 ± 0.0370.618 ± 0.0150.557 ± 0.0420.540 ± 0.052
BALMCP0.633 ± 0.0110.617 ± 0.0950.641 ± 0.0230.632 ± 0.0260.591 ± 0.047
BALCKLD0.628 ± 0.0490.586 ± 0.0320.616 ± 0.0240.604 ± 0.0220.558 ± 0.069
Temporal BALCKLD0.557 ± 0.0450.647 ± 0.0600.620 ± 0.0360.625 ± 0.0380.577 ± 0.039
D2BALDMCD0.694 ± 0.0220.631 ± 0.0200.682 ± 0.0360.658 ± 0.0380.647 ± 0.039
BALMCP0.605 ± 0.0540.660 ± 0.0670.656 ± 0.0290.618 ± 0.0580.605 ± 0.081
BALCKLD0.655 ± 0.0150.660 ± 0.0370.671 ± 0.0780.649 ± 0.0240.678 ± 0.023
Temporal BALCKLD0.702 ± 0.0440.654 ± 0.0240.686 ± 0.0380.638 ± 0.0420.631 ± 0.020
D3BALDMCD0.744 ± 0.0230.745 ± 0.0210.709 ± 0.0280.700 ± 0.0260.694 ± 0.014
BALMCP0.706 ± 0.0290.736 ± 0.0360.727 ± 0.0230.712 ± 0.0180.682 ± 0.017
BALCKLD0.718 ± 0.0290.729 ± 0.0280.735 ± 0.0210.680 ± 0.0500.688 ± 0.009
Temporal BALCKLD0.727 ± 0.0330.725 ± 0.0330.724 ± 0.0180.700 ± 0.0220.645 ± 0.062
D4BALDMCD0.517 ± 0.0340.477 ± 0.0270.493 ± 0.0340.498 ± 0.0360.459 ± 0.035
BALMCP0.492 ± 0.0270.491 ± 0.0270.502 ± 0.0360.532 ± 0.0400.507 ± 0.042
BALCKLD0.494 ± 0.0240.494 ± 0.0160.504 ± 0.0260.506 ± 0.0310.503 ± 0.021
Temporal BALCKLD0.504 ± 0.0180.515 ± 0.0130.529 ± 0.0270.507 ± 0.0140.508 ± 0.026
+ +(b) Epsilon Greedy + +
DatasetAc. Function αNearest Neighbour Noise Level
0.050.100.200.400.80
D1BALDMCD0.503 ± 0.0400.480 ± 0.0230.514 ± 0.0500.481 ± 0.0380.456 ± 0.031
BALMCP0.501 ± 0.0140.508 ± 0.0360.522 ± 0.0520.482 ± 0.0230.496 ± 0.041
BALCKLD0.541 ± 0.0350.503 ± 0.0330.486 ± 0.0470.500 ± 0.0410.473 ± 0.026
Temporal BALCKLD0.516 ± 0.0240.523 ± 0.0440.495 ± 0.0460.491 ± 0.0130.483 ± 0.041
D2BALDMCD0.584 ± 0.0660.610 ± 0.0420.597 ± 0.0360.616 ± 0.0540.593 ± 0.054
BALMCP0.565 ± 0.0310.589 ± 0.0750.616 ± 0.0590.605 ± 0.0470.586 ± 0.047
BALCKLD0.608 ± 0.0310.607 ± 0.0400.590 ± 0.0550.538 ± 0.0370.585 ± 0.053
Temporal BALCKLD0.647 ± 0.0440.591 ± 0.0330.640 ± 0.0440.576 ± 0.0310.589 ± 0.030
D3BALDMCD0.656 ± 0.0210.655 ± 0.0140.665 ± 0.0100.643 ± 0.0210.632 ± 0.010
BALMCP0.660 ± 0.0220.657 ± 0.0230.659 ± 0.0030.664 ± 0.0230.634 ± 0.013
BALCKLD0.608 ± 0.0310.607 ± 0.0400.590 ± 0.0550.538 ± 0.0370.585 ± 0.053
Temporal BALCKLD0.644 ± 0.0160.651 ± 0.0110.658 ± 0.0130.634 ± 0.0160.627 ± 0.014
D4BALDMCD0.438 ± 0.0140.457 ± 0.0220.442 ± 0.0180.456 ± 0.0280.428 ± 0.024
BALMCP0.489 ± 0.0180.489 ± 0.0210.474 ± 0.0230.485 ± 0.0190.486 ± 0.015
BALCKLD0.485 ± 0.0290.487 ± 0.0190.495 ± 0.0230.488 ± 0.0280.481 ± 0.021
Temporal BALCKLD0.486 ± 0.0180.500 ± 0.0290.486 ± 0.0270.468 ± 0.0170.487 ± 0.028
+ +(c) Entropy Response + +
DatasetAc. Function αNearest Neighbour Noise Level
0.050.100.200.400.80
D1BALDMCD0.494 ± 0.0370.474 ± 0.0270.492 ± 0.0510.482 ± 0.0330.444 ± 0.006
BALMCP0.511 ± 0.0190.562 ± 0.0520.509 ± 0.0420.572 ± 0.0600.495 ± 0.041
BALCKLD0.513 ± 0.0200.517 ± 0.0350.504 ± 0.0340.498 ± 0.0230.487 ± 0.023
Temporal BALCKLD0.500 ± 0.0430.540 ± 0.0250.503 ± 0.0430.516 ± 0.0240.490 ± 0.024
D2BALDMCD0.585 ± 0.0450.630 ± 0.0560.600 ± 0.0450.585 ± 0.0460.586 ± 0.063
BALMCP0.633 ± 0.0600.626 ± 0.0640.618 ± 0.0550.647 ± 0.0770.619 ± 0.055
BALCKLD0.605 ± 0.0490.572 ± 0.0320.630 ± 0.0810.581 ± 0.0310.589 ± 0.061
Temporal BALCKLD0.625 ± 0.0300.599 ± 0.0240.613 ± 0.0500.614 ± 0.0520.606 ± 0.054
D3BALDMCD0.604 ± 0.0170.589 ± 0.0130.592 ± 0.0140.592 ± 0.0140.587 ± 0.012
BALMCP0.636 ± 0.0300.635 ± 0.0300.640 ± 0.0400.634 ± 0.0390.623 ± 0.032
BALCKLD0.632 ± 0.0080.633 ± 0.0080.630 ± 0.0050.629 ± 0.0040.625 ± 0.008
Temporal BALCKLD0.631 ± 0.0130.630 ± 0.0130.637 ± 0.0130.630 ± 0.0140.629 ± 0.009
D4BALDMCD0.475 ± 0.0350.493 ± 0.0250.471 ± 0.0310.468 ± 0.0270.481 ± 0.035
BALMCP0.508 ± 0.0240.512 ± 0.0200.513 ± 0.0190.499 ± 0.0120.492 ± 0.016
BALCKLD0.483 ± 0.0310.476 ± 0.0330.473 ± 0.0260.479 ± 0.0210.479 ± 0.032
Temporal BALCKLD0.490 ± 0.0120.497 ± 0.0300.466 ± 0.0130.485 ± 0.0160.500 ± 0.013
+ +# K. Effect of Number of Monte Carlo Samples, $T$ , on Performance + +The number of MC samples, $T$ , within an AL framework can be associated with an improved approximation of the version space. This, in turn, should lead to improved AL results. To quantify the effect of the number of MC samples on performance, we illustrate in Fig. 14, the validation AUC for experiments conducted with $T = (5,20,40,100)$ . We show that there does not exist a simple proportional relationship between the number of MC samples and performance. This can be seen by the relatively strong generalization performance of models when $T = 100$ in Figs. 14c, 14h, and 14i and poorer performance when $T = 100$ . This suggests that our family of methods can perform well without being computationally expensive. + +5 20 40 100 + +![](images/a2c8205587cc83c18f4afc62b53e035cd5f41ae04fb80b06ab49c88c0148f2ad.jpg) +(a) Var Ratio + +![](images/02b88d6c1859a0e7201271804d4ae2d3bcddd173cc6f49ece87526a9a547e2d5.jpg) +(b) Temporal Var Ratio + +![](images/f9789e6d0a8fc6e4986167b46999c7511bea644a8229b7eada7742162a6d8186.jpg) +(c) Entropy + +![](images/90b068c5498cba12ea06a2eecfb7edcccb0f7e4f0161fbb3d9a7af02eebbf4af.jpg) +(d) Temporal Entropy + +![](images/838fc5aa9eeb7bd1634414044d4e19f74f9f9a971ab4a8dc7b5ac03868bc3312.jpg) +(e) BALD + +![](images/ee205e0d7f8dd207135b761cdf5bd2f5bc865677e3076e137bd5c17cbefda5c4.jpg) +(f) Temporal BALD + +![](images/f3bd344c69fd579387355095cd710543271e60679b67a8a664d890fa5449fbcd.jpg) +(g) $\mathrm{BALC}_{\mathrm{KLD}}$ + +![](images/0ddecf0cc0d34a10072385f0066fa09366cb4621416df5eb8c73d76b3a808ca3.jpg) +(h) Temporal $\mathrm{BALC}_{\mathrm{KLD}}$ + +![](images/d20ccde9a0370563a27a85c5060652a53cae6864f96ea5f3ea1e5875bb5eb872.jpg) +(i) $\mathrm{BALC_{JSD}}$ + +![](images/f855b1c6ac418eabbd55d706ea04c8c5ae77039842a6d9faedd36f2695602333.jpg) +(j) Temporal BALCJSD +Figure 14: Mean validation AUC as a function of number of Monte Carlo samples $T$ for the different acquisition functions using the MCP method. The acquisition percentage and acquisition epochs were fixed at $b = 2\%$ and $\tau = 5$ , respectively. These experiments are performed on $\mathcal{D}_2$ at a fraction of $\beta = 0.5$ . Results are averaged across 5 seeds. + +# L. Effect of Acquisition Percentage, $b$ , on Performance + +The number of unlabelled instances acquired during the AL procedure can have a strong effect on the generalization performance of networks. We investigate the effect of this on our family of methods and illustrate the results in Fig. 15 when conducting experiments for $b = (1\%, 2\%, 5\%, 20\%)$ . Contrary to expectations that more acquisition is better, we show that acquiring large amounts of data is actually detrimental. This can be seen by the poorer performance attributed to $b = 20\%$ in, for instance, Figs. 15b, 15f, and 15g. We hypothesize that this is due to larger magnitude 1) distribution shifts and 2) label noise brought about by the absence of an oracle. + +![](images/051c061a54f6ed9479f20ee15a0cc5544aca6bd1173bfd7544d9847258df2336.jpg) + +![](images/39a53108f46c7bbace3251ff7c34cac8441a79c60f4202675a14145082e4d219.jpg) +(a) Var Ratio + +![](images/6f12ebf488ccc954dae5f0f75873ec0b121c1d2e72d3b02f3511a9267b375483.jpg) +(b) Temporal Var Ratio + +![](images/b45fa736c45453b9dd8fff4ea9865e202ae03e6d04fef02da1ab90e291e1feb0.jpg) +(c) Entropy + +![](images/6fdcdb999e48be36f17bd5ef0ace5bf479affd2596b01ead119ebb6a7e3a3279.jpg) +(d) Temporal Entropy + +![](images/855f974e6ec040212c5cf54c3b5f53a4a0332094bb479b3c1040813aac906f5f.jpg) +(e) BALD + +![](images/539f8d49aa0d424b029a2662bb1a8d185ecfb8fa14e36e2d9458239d12295759.jpg) +(f) Temporal BALD + +![](images/5159e1c23e31b3f5179f1d32a839a6480421c3ba9874ecf03f7e9331431c3813.jpg) +(g) $\mathrm{BALC}_{\mathrm{KLD}}$ + +![](images/b59e4348dc41841cdd2b467a30dc9d91da269213d987e24d6959491040d47136.jpg) +(h) Temporal $\mathrm{BALC}_{\mathrm{KLD}}$ + +![](images/20f9d7e0e7f9fdd2ca946b1bba74427b17cc7b395435549af519ea437879be5e.jpg) +(i) $\mathrm{BALC_{JSD}}$ + +![](images/6e482b68974161f760e39c5ff6548d54cdae07428ac31fe0e98cc4244780437f.jpg) +(j) Temporal $\mathrm{BALC_{JSD}}$ +Figure 15: Mean AUC of the validation set as a function of acquisition percentage $b$ for the different acquisition functions using the MCP method. These experiments are performed on $\mathcal{D}_2$ at a fraction $\beta = 0.5$ . MC samples and acquisition epochs were fixed at $T = 20$ and $\tau = 5$ , respectively. Results are averaged across 5 seeds. + +# M. Effect of Acquisition Epochs, $\tau$ , on Performance + +As outlined in the main manuscript, the control vs. shock trade-off must be balanced to ensure good generalization performance of an AL procedure. Acquiring instances too early and frequently can lead to instabilities in the training procedure. Conversely, inadequate sampling of unlabelled instances starves the network of much needed data. To quantify this trade-off, we illustrate in Fig. 16, the performance of our family of methods when $\tau = (5,10,15,20)$ . Although one value that guarantees best performance for all experiments does not exist, $\tau = 10$ or $\tau = 15$ seem to outperform the others, on average. + +![](images/e04f0058a349c39e9fdc333f327692d3e501574efc5f0cf2aecfee6ac39fbd96.jpg) + +![](images/df6e4222a9241a4325881269d1baa7b820534dc7d1dacc561221295fbe53f31f.jpg) +(a) Var Ratio + +![](images/9b8cb44a23c0f97355fce8aea2175bd7c7216b63d15f3d922419a391623f892d.jpg) +(b) Temporal Var Ratio + +![](images/6510ddea8738b0d03f2a93391345e70748af68798de1a05dd7a8600eb8635e0c.jpg) +(c) Entropy + +![](images/18a363ad5f81e318c725b2753ec3675428e6b8d484c40b2aaff8f0f8c18ffc16.jpg) +(d) Temporal Entropy + +![](images/1ee5a0f9ed459b3e80856e513b3690086599356a04e909cd637a8163157c34c2.jpg) +(e) BALD + +![](images/dfa70cef027804850c800fe090ae085675fd2291a1104b8f78d5e61752e67618.jpg) +(f) Temporal BALD + +![](images/65e24286524296d9ce2eda6ca5228536524563535d33e7234ff414306139af44.jpg) +(g) $\mathrm{BALC}_{\mathrm{KLD}}$ + +![](images/ec2a32daf90d2ee1e87846b96b81872aa1bd64f8a3f9ce66bb282d12fef0c40f.jpg) +(h) Temporal $\mathrm{BALC}_{\mathrm{KLD}}$ + +![](images/86ec58355d0d1ac27b10a7f275b6dd3d07e83d2646379558db6aa11c14c3b48e.jpg) +(i) $\mathrm{BALC_{JSD}}$ + +![](images/728cfb63f2313806d84917fec40f52d1d6d92b964dfaba411f84ae315edf2b90.jpg) +(j) Temporal $\mathrm{BALC_{JSD}}$ +Figure 16: Mean AUC of the validation set as a function of acquisition epochs $\tau$ for the different acquisition functions using the MCP method. MC samples and the acquisition percentage were fixed at $T = 20$ and $b = 2\%$ , respectively. These experiments are performed on $\mathcal{D}_2$ at a fraction $\beta = 0.5$ . Results are averaged across 5 seeds. \ No newline at end of file diff --git a/soqalselectiveoraclequestioningforconsistencybasedactivelearningofcardiacsignals/images.zip b/soqalselectiveoraclequestioningforconsistencybasedactivelearningofcardiacsignals/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..b31b704569a8fbc1c0e4ca9f7be85cb63f6d77ba --- /dev/null +++ b/soqalselectiveoraclequestioningforconsistencybasedactivelearningofcardiacsignals/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d910530bc178b8087585e36ed3846b0193210973ca97b5ea6a04e93c96c9fa5b +size 2448350 diff --git a/soqalselectiveoraclequestioningforconsistencybasedactivelearningofcardiacsignals/layout.json b/soqalselectiveoraclequestioningforconsistencybasedactivelearningofcardiacsignals/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..8d6d32297af31f64327641f6943969e074845fff --- /dev/null +++ b/soqalselectiveoraclequestioningforconsistencybasedactivelearningofcardiacsignals/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:91bbc1d0d6658f1be03da6a94305d157e0e6ec26fbd92d9c449cd78aedf7bbe1 +size 1127073 diff --git a/spacemapvisualizinghighdimensionaldatabyspaceexpansion/4afa7462-f5ba-4ddc-b899-6ef786936947_content_list.json b/spacemapvisualizinghighdimensionaldatabyspaceexpansion/4afa7462-f5ba-4ddc-b899-6ef786936947_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..0b0a8dcbfe249b6f355356d9995d2ff7ddb19c36 --- /dev/null +++ b/spacemapvisualizinghighdimensionaldatabyspaceexpansion/4afa7462-f5ba-4ddc-b899-6ef786936947_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:857ec8a27b253a16a5331e4d37b8874f330c6380d8cdf7161ca5405349cb6e7a +size 102085 diff --git a/spacemapvisualizinghighdimensionaldatabyspaceexpansion/4afa7462-f5ba-4ddc-b899-6ef786936947_model.json b/spacemapvisualizinghighdimensionaldatabyspaceexpansion/4afa7462-f5ba-4ddc-b899-6ef786936947_model.json new file mode 100644 index 0000000000000000000000000000000000000000..4ae98f39f99738fa0608b4cf9ca9e45273a022ea --- /dev/null +++ b/spacemapvisualizinghighdimensionaldatabyspaceexpansion/4afa7462-f5ba-4ddc-b899-6ef786936947_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cff56a69e0527abf4bba4498045a74624395ed5b351670d2963ae2787468322a +size 129899 diff --git a/spacemapvisualizinghighdimensionaldatabyspaceexpansion/4afa7462-f5ba-4ddc-b899-6ef786936947_origin.pdf b/spacemapvisualizinghighdimensionaldatabyspaceexpansion/4afa7462-f5ba-4ddc-b899-6ef786936947_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..743c90f33d8b927adaf76cf81e1778e9ded8d5d6 --- /dev/null +++ b/spacemapvisualizinghighdimensionaldatabyspaceexpansion/4afa7462-f5ba-4ddc-b899-6ef786936947_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:263019eb45f88204cd329034358756913432fe77b6f765e11653b91b3455e1b8 +size 8327509 diff --git a/spacemapvisualizinghighdimensionaldatabyspaceexpansion/full.md b/spacemapvisualizinghighdimensionaldatabyspaceexpansion/full.md new file mode 100644 index 0000000000000000000000000000000000000000..ffa1d753af2073ea892dc8b18c2cd7c21ab795ec --- /dev/null +++ b/spacemapvisualizinghighdimensionaldatabyspaceexpansion/full.md @@ -0,0 +1,489 @@ +# SpaceMAP: Visualizing High-dimensional Data by Space Expansion + +Xinrui $\mathbf{Z}\mathbf{u}^{1}$ Qian Tao + +# Abstract + +Dimensionality reduction (DR) of high-dimensional data is of theoretical and practical interest in machine learning. However, there exist intriguing, non-intuitive discrepancies between the geometry of high- and low-dimensional space. We look into such discrepancies and propose a novel visualization method called Space-based Manifold Approximation and Projection (SpaceMAP). Our method establishes an analytical transformation on distance metrics between spaces to address the "crowding problem" in DR. With the proposed equivalent extended distance (EED), we are able to match the capacity of high- and low-dimensional space in a principled manner. To handle complex data with different manifold properties, we propose hierarchical manifold approximation to model the similarity function in a data-specific manner. We evaluated SpaceMAP on a range of synthetic and real datasets with varying manifold properties, and demonstrated its excellent performance in comparison with classical and state-of-the-art DR methods. In particular, the concept of space expansion provides a generic framework for understanding nonlinear DR methods including the popular t-distributed Stochastic Neighbor Embedding (t-SNE) and Uniform Manifold Approximation and Projection (UMAP). + +# 1. Introduction + +Real-world data, including images, videos, genetic expressions, natural languages, etc., commonly have a high ambient dimension (i.e. number of pixels or measurements). The intrinsic dimension of these data, however, is typically much lower, which fact is recognized as a fundamental reason for modern machine learning to work well (Levina & Bickel, + +*Equal contribution ${}^{1}$ Department of Imaging Physics, Delft University of Technology. Correspondence to: Xinrui Zu $< \mathrm{X}.\mathrm{{Zu}} -$ 1@tudelft.nl>,Qian Tao $< \mathrm{Q}$ .Tao@tudelft.nl>. + +Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s). + +2004; Pope et al., 2021; Wright & Ma, 2022). Effective and accurate dimensionality reduction (DR) to discover the intrinsic low-dimensional data structure is of significant value for machine learning research. + +DR is also essential for data visualization, which provides valuable intuition for researchers from different disciplines dealing with high-dimensional data. A space with a dimensionality higher than 3, however, is already beyond our accustomed way of seeing data. Here we enumerate a number of challenges in visualizing high-dimensional data onto a drastically reduced dimension (2 or 3): + +Firstly, our intuition of geometry in 2- or 3-dimensional space often does not generalize to high-dimensional space. Theories on high-dimensional geometry revealed a number of intriguing, non-intuitive phenomena (Giraud, 2021), one of which is "concentration on crust". Imagine a ball with a radius $r$ in a $d$ -dimensional Euclidean space. Consider a "crust" of the $d$ -dimensional ball, which is between the surfaces of this ball and a slightly smaller concentric ball with radius $(1 - \epsilon)r$ , where $\epsilon$ is small (Fig.1 a.1). The ratio of the volume of between the "crust" $C_d(r)$ to the ball is $V_d(r)$ is $\frac{C_d(r)}{V_d(r)} = 1 - (1 - \epsilon)^d$ . Take $\epsilon = 0.01$ , it is intuitive to see that the ratio is tiny with small $d$ , however this ratio grows fast to near $100\%$ when $d$ increases, as illustrated in Fig.1 a.2. The mass of a high-dimensional ball is therefore counter-intuitively concentrated on a crust. Such concentration underlies the "crowding problem" of DR (van der Maaten & Hinton, 2008): a faithful preservation of distances of high-dimensional space would lead to crowded data points in low-dimensional space (all pairwise distances become similar as shown in Fig.1 a.3). This suggests that distances need to be defined differently in high- and low-dimensional spaces to mitigate the crowding. + +Secondly, many real-world high-dimensional datasets exhibit hierarchical structures, with sub-manifolds on large manifolds, governed by the underlying data generation process (Bengio, 2013; Abdolali & Rahmati, 2019). The state-of-the-art DR methods, such as Barnes-Hut t-distributed Stochastic Neighbor Embedding (t-SNE) (van der Maaten, 2014) and Uniform Manifold Approximation and Projection (UMAP) (McInnes et al., 2018), commonly consider a restricted $k$ -nearest neighborhood, hence part of the manifold. Isomap (Tenenbaum et al., 2000), on the other hand, + +![](images/b39333528fa952c66224e371c362a246080b16f1ce3d9a267b8d88992cb903a3.jpg) +(a.1) + +![](images/71e30beba00bab71990986b4748e85c03d0e20d705a4c9d7ff75697c729bd244.jpg) +$\chi$ -distribution + +![](images/ae38c2b414e3ae992fab95497d0ac870e7c924d02ff97a1c5f532b63388de1c0.jpg) +Figure 1. Left panel a: counter-intuitive high-dimensional geometry. (a.1) The "crust" of a ball in 3-dimensional spaces with Euclidean distance metric. (a.2) The fraction of volume between crust and ball, as a function of the dimensionality of the ball. As the dimensionality grows, the mass concentrates on the crust. (a.3) Distributions of the pairwise distances in a 2-dimensional (gray) and 300-dimensional (red) spaces. Right panel b: visualization results of three synthetic datasets (2D concentric rings, 3D Gaussian distributed point cloud, and Swiss roll with a hole), by PCA, SNE, t-SNE, UMAP, and the proposed SpaceMAP. + +takes the entire manifold into account by inferring geodesic distances on a connected graph. Empirically, t-SNE and UMAP work well on data of disjoint manifolds such as MNIST and ImageNet, while Isomap works on data of continuous manifold such as Swiss roll dataset. It remains challenging, nevertheless, for one method to succeed in both disjoint and continuous data manifolds. + +A third concern is related to the first observation, which shows that to mitigate the "crowding problem" one must define distances differently in high- and low-dimensional space. This essentially means a geometrical distortion between two spaces. By using a "heavier tail" similarity function in low-dimensional space, t-SNE and UMAP realize such distortion implicitly. However, the underlying distortion of distance metric has never been analytically expressed or validated. The simplicity in turn deters us from integrating prior information on data when it is known. For example, for the Swiss roll dataset, we know a priori that the intrinsic dimensionality of data is 2. Even for real-world datasets such as MNIST or ImageNet, a meaningful estimation of the intrinsic dimensionality can often be made (Pope et al., 2021; Ansuini et al., 2019). + +We strive to tackle the three challenges by the proposed Space-based Manifold Approximation and Projection (SpaceMAP) method. We made three contributions: + +- Space Expansion: We explicitly define, and match the "capacity" of high- and low-dimensional space, by analytical transformation of distances, and show that this transformation is justified by previous theory of + +intrinsic dimensionality estimation; + +- Hierarchical Manifold Approximation: We propose dataset-specific, hierarchical modeling of similarity, to accommodate both disjoint and continuous manifolds. +- Prior Information for $DR$ : The hyper-parameters of SpaceMAP are explainable, and amendable to integrating data prior. + +# 2. Related Work + +# 2.1. Mini Review + +We follow the categorization in van der Maaten et al. 2009 and divide DR method into full spectral and sparse spectral methods. + +Full Spectral Methods: Full spectral methods are based on eigen-decomposition of a completed matrix that captures the covariances between dimensions or pairwise similarities among all data points. The most well-known method is the principal component analysis (PCA) (Pearson, 1901), which finds a low number of principle directions that account for the largest variations in data. PCA also has nonlinear versions called kernel PCA (Ross et al., 2007; Tipping & Bishop, 1999; Zou et al., 2006). Alternatively, the similarity matrix can be based on geodesic distance (Isomap, landmark Isomap) on a manifold (Tenenbaum et al., 2000; Chen et al., 2006). Maximum variance unfolding (MVU) (Weinberger & Saul, 2006) also belongs to this category of methods. + +Sparse Spectral Methods: Different from full spectral + +methods, sparse spectral methods only focus on retaining local structure of data and solve a sparse eigen-problem. In general, preserving only local properties allows for better embedding of nonlinear manifolds (van der Maaten et al., 2009). Important work in this category include locally linear embedding (LLE), modified LLE, Hessian LLE (HLLE), Laplacian eigenmaps(LE), diffusion maps (Coifman & LaFon, 2006), local tangent space alignment (LTSA), locally linear coordination (LLC), etc (Roweis, 2000; Donoho & Grimes, 2003; Belkin & Niyogi, 2001; Weinberger & Saul, 2006; Zhang & Zha, 2004; Coifman & Lafon, 2006; Roweis et al., 2002). + +Non-convex Extensions: Instead of solving eigendecomposition problems, both category of methods extends to non-convex variants, which can be solved by gradient descent. This significantly enriches the possibilities of DR. Most of today's popular DR methods are non-convex sparse spectral methods, including the t-distributed stochastic neighbor embedding (t-SNE) (van der Maaten & Hinton, 2008) originated from stochastic neighbor embedding (SNE) (Hinton & Roweis, 2002), and its variants: Barnes-Hut t-SNE, fast Fourier-transform-accelerated interpolation-based t-SNE (van der Maaten, 2013; Linderman et al., 2019). More methods are proposed in recent years to re-formulate the similarity and loss functions, including among others LargeVis (Tang et al., 2016), uniform manifold approximation and projection (UMAP) (McInnes et al., 2018), TriMAP (Amid & Warmuth, 2019) and PaCMAP (Wang et al., 2021). PHATE (Moon et al., 2019) and multiscale PHATE (Kuchroo et al., 2022) were proposed based on diffusion probability (Coifman et al., 2005). We will expand specifically on UMAP in Section 2.2, as our proposed SpaceMAP largely inherits its framework. + +Finally, we briefly note that there also exist parametric DR methods, which amortize the computation on parameters of neural networks (NN) instead of directly on embedding. This category includes the early parametric t-SNE method (van der Maaten, 2009), autoencoder (Hinton & Salakhutdinov, 2006), deep learning multidimensional projection (Espadoto et al., 2020), and deep recursive embedding (Zhou et al., 2022). + +# 2.2. UMAP: A Contrastive Learning Perspective + +UMAP is a newly established visualization method which has gained popularity in recent years (McInnes et al., 2018). In its original presentation UMAP is rooted in the theory of Riemannian geometry and algebraic topology. The mathematical savviness however casts certain degree of opaqueness, and has initiated many discussions and debates in the community (Damrich & Hamprecht, 2021a; Kobak & Linderman, 2021; Wang et al., 2021). The core question is: what has led to UMAP's unique success in visualiza + +tion? Here we take a fresh look on UMAP from the lens of contrastive learning, a category of unsupervised learning methods that effectively learns representations without labels (Wu et al., 2018; Ye et al., 2019; He et al., 2020; Tian et al., 2020; Chen et al., 2020; Chen & He, 2021). + +Like t-SNE, UMAP starts from computing similarities, denoted as $w_{ij}$ representing the similarity between $x_i$ and $x_j$ in the high-dimensional space, and $v_{ij}$ between $y_i$ and $y_j$ in the low-dimensional space. The original loss function of UMAP is defined as: + +$$ +\mathcal {L} _ {\mathrm {u m a p}} = \sum_ {i} \sum_ {j \neq i} \left(w _ {i j} \log \frac {w _ {i j}}{v _ {i j}} + (1 - w _ {i j}) \log \frac {1 - w _ {i j}}{1 - v _ {i j}}\right) \tag {1} +$$ + +Given that $w_{ij}$ is only dependent on $x$ , not on $y$ , the effective loss to derive gradient on $y$ is: + +$$ +\mathcal {L} _ {\mathrm {u m a p}} ^ {\prime} = - \sum_ {i} \sum_ {j \neq i} \left(w _ {i j} \log v _ {i j} + \left(1 - w _ {i j}\right) \log \left(1 - v _ {i j}\right)\right) \tag {2} +$$ + +Here the first term can be interpreted as attractive force, and the second term repulsive force, realized by negative sampling (e.g. sampling the non-neighbors outside KNN) (McInnes et al., 2018).1 Negative sampling is the essence of contrastive learning: if $\boldsymbol{x}_j$ belongs to the KNN of $\boldsymbol{x}_i$ (category similar), the first term asserts that their representations $\boldsymbol{y}_i$ and $\boldsymbol{y}_j$ are also close; if $\boldsymbol{x}_j$ is outside of the KNN of $\boldsymbol{x}_i$ (category dissimilar), the second term asserts that their representations are distant. Here the representation is the 2D output $\boldsymbol{y}$ , instead of intermediate tensors in neural networks for representation learning. This hidden contrastive mechanism likely underlies the success of UMAP to a large extent. + +# 3. Method + +# 3.1. Overview + +We follow the generic framework of graph matching: first define the pairwise similarities $P_{ij}$ among the high-dimensional data points $\boldsymbol{x}_i, i = 1,\dots,N$ , and $Q_{ij}$ among the low-dimensional data points $\boldsymbol{y}_i$ , then optimize a contrastive loss function $\mathcal{L}(P_{ij},Q_{ij})$ with respect to $\boldsymbol{y}_i$ 's. The framework resembles that of UMAP; the major novelty of this work, however, is a principled and explainable way to compute similarities that construct the two graphs. + +# 3.2. SpaceMAP + +Space Expansion: The mismatch of capacity (expressiveness of data) between high- and low-dimensional space is the fundamental difficulty of DR. Here we define "capacity" as a Hausdorff measure of volume in the $D$ -dimensional space: + +Definition 3.1 (Space Capacity). Let $R_{ij} = l(\pmb{x}_i, \pmb{x}_j) \in \mathbb{R}$ be the distance between data point $\pmb{x}_i$ and $\pmb{x}_j$ in the $D$ -dimensional space. The space capacity $\mathcal{V}_D(R_{ij})$ from point $i$ to point $j$ is defined as the volume of a $D$ -dimensional ball with a radius of $R_{ij}$ . + +$l(\pmb{x}_i, \pmb{x}_j)$ can be any valid distance metric such as Euclidean, Manhattan, cosine, etc. Throughout this paper we use Euclidean distance for simplicity. In Euclidean space, the capacity $\mathcal{V}_D(R_{ij})$ is simply the volume of a D-dimensional hyper-sphere $S_D(R_{ij})$ : + +$$ +\mathcal {V} _ {D} \left(R _ {i j}\right) = \frac {\pi^ {D / 2}}{\Gamma (D / 2 + 1)} R _ {i j} ^ {D} \tag {3} +$$ + +where $\Gamma (\cdot)$ is the gamma function. + +To match capacity between two spaces of different dimensionality, we can change the definition of "distance". We hence introduce the concept of equivalent extended distance (EED): + +Definition 3.2 (Equivalent Extended Distance: EED). Let $R_{ij} = l(\pmb{x}_i, \pmb{x}_j) \in \mathbb{R}$ be the distance between data point $\pmb{x}_i$ and $\pmb{x}_j$ in the $D$ -dimensional space. The equivalent extended distance (EED) $\tilde{\mathcal{R}}_{ij,D \to d}$ is defined as the equivalent distance between $\pmb{x}_i$ and $\pmb{x}_j$ in $d$ -dimensional space such that the Space Capacity matches: $\mathcal{V}_d(\tilde{\mathcal{R}}_{ij,D \to d}) = \mathcal{V}_D(R_{ij})$ + +Example 3.1 (2-dimensional EED of Euclidean distance). Consider a $D$ -dimensional Euclidean space, the distance between two points $i$ and $j$ is $R_{ij} = \|\pmb{x}_i - \pmb{x}_j\|$ . To match capacity, the 2-dimensional EED of $R_{ij}$ is: $\tilde{\mathcal{R}}_{ij,D\to 2} = \sqrt{\frac{S_D(R_{ij})}{\pi}} = \alpha R_{ij}^{D/2}$ where $\alpha = \frac{\pi^{(D-2)/4}}{\sqrt{\Gamma(D/2+1)}}$ . + +It is straightforward to prove that when embedding $D$ -dimensional Euclidean space into $d$ -dimensional space, EED can be expressed in a simple form: + +$$ +\tilde {\mathcal {R}} _ {D \rightarrow d} = \alpha R ^ {\frac {D}{d}} \tag {4} +$$ + +where $\alpha$ is a constant determined by $D$ and $d$ . In the special case of $d = D$ , the distance definition is unchanged. + +Intrinsic Dimension Estimation: Most natural high-dimensional data lie on or near to a low-dimensional manifold $\mathcal{M}$ , with its intrinsic dimension (ID) $d \ll D$ , where $D$ is the ambient dimension. Here we briefly describe two ID estimation methods (Levina & Bickel, 2004; MacKay & Ghahramani, 2005). + +Levina & Bickel 2004 proposed the Maximum Likelihood Estimation (MLE) method to estimate the ID based on constant density assumption in a small neighborhood and the Poisson process to model the random sampling in this neighborhood. The MLE method provides a way to estimate ID at point $x_{i}$ in its $k$ -neighborhood. Let $R$ be the distance metric (e.g. Euclidean) and $R_{ij} \in \mathbb{R}$ be the distance between point $x_{i}$ and $x_{j}$ under this metric, the maximum likelihood estimation (MLE) of the ID around point $x_{i}$ , with the distance metric of $R$ , is computed as: + +$$ +\hat {d _ {k}} \left(x _ {i}; R\right) = \left(\frac {1}{k - 1} \sum_ {j = 1} ^ {k - 1} \log \frac {R _ {i k}}{R _ {i j}}\right) ^ {- 1} \tag {5} +$$ + +where the summation is over the $k$ -nearest neighbors of point $\pmb{x}_i$ . We note that $\hat{d}_k(x_i;R)$ is point-specific, dependent on $k$ and the distance metric $R$ . ID therefore uniquely characterizes the sub-manifolds around $\pmb{x}$ . + +MacKay & Ghahramani 2005 proposed a robust way to estimate global ID of the whole dataset: + +$$ +\bar {d} _ {k} = \left(\frac {1}{N} \sum_ {i = 1} ^ {N} \hat {d} _ {k} \left(x _ {i}\right) ^ {- 1}\right) ^ {- 1} \tag {6} +$$ + +where $N$ is the number of data points. We use Equation 5 to estimate the point-specific local IDs and Equation 6 to estimate the global ID. + +Our proposed EED fits in this framework of MLE ID estimation. By applying EED to the distance metric on a manifold of ID $D$ , the following Proposition holds: + +Proposition 3.1 (EED transforms ID provably). For any neighborhood size $k$ , if the MLE of the intrinsic dimension around point $x_{i}$ under the distance metric $R$ is $\hat{d}_k(x_i;R) = D$ , the MLE of the intrinsic dimension after applying EED to the distance metric is $d$ : $\hat{d}_k(x_i;\tilde{\mathcal{R}}_{D\to d}) = d$ . + +Proof. By replacing metric $R$ with the EED-transformed metric $\mathcal{R}_{D\to d}$ (Equation 4) in Equation 5, we have: + +$$ +\begin{array}{l} \hat {d} _ {k} \left(x _ {i}; \tilde {\mathcal {R}} _ {D \rightarrow d}\right) = \left(\frac {1}{k - 1} \sum_ {j = 1} ^ {k - 1} \log \frac {\alpha R _ {i k} ^ {D / d}}{\alpha R _ {i j} ^ {D / d}}\right) ^ {- 1} \\ = \left(\frac {1}{k - 1} \sum_ {j = 1} ^ {k - 1} \frac {D}{d} \log \frac {R _ {i k}}{R _ {i j}}\right) ^ {- 1} \\ = \frac {d}{D} \hat {d _ {k}} (x _ {i}; R) = \frac {d}{D} D = d \tag {7} \\ \end{array} +$$ + +![](images/d397486199c76103dd4022ebb7a5871c5665fae814e46e96a6c982d3b10644bb.jpg) + +![](images/64eab406bd4b49748d2d42819cba46ff860f5975c814d90600e158fe2a76289d.jpg) +Figure 2. (a) Illustration of a hierarchical manifold: sub-manifolds (dark blue) on a global manifold (light blue). (b) The high-dimensional similarity functions $P$ for SpaceMAP (b), UMAP (c), and t-SNE (d). SpaceMAP has subtle perception of the neighborhood in near and middle fields. + +The same holds true for the global ID in Equation 6. Therefore, when the targeted dimensionality $d$ is set to 2 for visualization, the MLE of ID under the EED-transformed distance metric will change to be exactly 2. Essentially, the validity of Proposition 3.1 is due to the exponential form in EED transformation by Equation 4, while in the MLE Equation 5 and 6 the distances are taken logarithmic. + +Hierarchical Manifold Approximation: Real-world data often exhibits a hierarchical structure, given the underlying data generation process (Bengio, 2013). The data manifold can be continuous, disjoint, or locally continuous and globally disjoint. It is informative to analyze both the near field (local neighborhood) and middle field (further range) of data to capture a meaningful range of inter-relationship. For SpaceMAP, we divide the space with respect to each data point $i$ into the near field $\mathbb{S}_{i,\mathrm{near}}$ , middle field $\mathbb{S}_{i,\mathrm{middle}}$ , and far field $\mathbb{S}_{i,\mathrm{far}}$ . Given unknown scaling of data, a common approach is to set the neighborhoods by the number (or percentage in the whole dataset) of nearest neighbors. Two numbers are empirically set: $k_{\mathrm{near}} = 20$ , and $k_{\mathrm{middle}} = 50$ . Beyond the middle field, data points are usually so distant that their similarity is trivial. + +We subsequently estimate two IDs: $d_{\mathrm{local}}$ is computed using Equation 5 for each data point using $k_{\mathrm{near}}$ , and $d_{\mathrm{global}}$ using Equation 6 for the entire dataset using $k_{\mathrm{near}} + k_{\mathrm{middle}}$ . Pseudo code for calculating $d_{\mathrm{local}}$ and $d_{\mathrm{global}}$ is provided in Appendix A.2. The two IDs characterize the hierarchical manifold $\mathcal{M}$ , and enable us to analytically compute EED. Different from t-SNE or UMAP where similarity is defined in an implicit manner, the similarities in SpaceMAP are computed from explicitly transformed distances, which provably reduces the intrinsic dimension (Proposition 3.1). Alternatively, both $d_{\mathrm{local}}$ and $d_{\mathrm{global}}$ can also be set manually with prior knowledge on data, to impose strong regularization on the DR results. + +Similarity: Similarity is typically modeled as a nonlinear function of distance. Suppose the similarity function is de + +![](images/a1d0abea8e799a1e9b23332a2af387e5a12cf2946569c09d3b7fc82d81b2dbc6.jpg) + +![](images/8ec5526349276843a23186ee4de1860e3a5d705334a216b1340dacf1443c2cf7.jpg) + +![](images/c1f894a0296fd613563635ab6ed721b4b074e1e58111226f3b05d5f5476260a5.jpg) +Figure 3. The low-dimensional similarity functions $Q$ for (a) SNE (Gaussian), (b) t-SNE (t-distribution), (c) UMAP (inverse polynomial) and (d) SpaceMAP (exponential). SpaceMAP alters the tail based on dataset-specific ID. + +![](images/b560ca5a079b208612df6d32b8afd7d52ae21ef39b7bcb89cea787248644399c.jpg) + +fined as $P = S(\cdot)$ in the $D$ -dimensional space, which is to be matched by $Q = S'(\cdot)$ in the $d$ -dimensional space. With EED (Equation 4), matching $P$ and $Q$ leads to distortion of the similarity function: $S'(R) = S\left(\left(\frac{R}{\alpha}\right)^{\frac{d}{D}}\right)$ , where $R$ is the distance metric (here Euclidean) in the $D$ -dimensional space. Given the exponential coefficient $\frac{d}{D} < 1$ , such an operation amounts to deforming the high-dimensional similarity function towards a heavier-tail one (Fig. 3 d). This is exactly the same principle as t-SNE, where the use of t-distribution with heavier tail fundamentally underlies its success. In SNE, in contrast, both spaces are treated equally in terms of distance metric. + +We take the Gaussian similarity function as in SNE, and define $P_{ij}$ and $Q_{ij}$ for SpaceMAP: + +$$ +P _ {j | i} = \left\{ \begin{array}{l l} \exp \left(- \frac {R _ {i j} ^ {2 d _ {\text {l o c a l}} / d _ {\text {g l o b a l}}}}{\sigma_ {i , \text {n e a r}}}\right), & x _ {j} \in \mathbb {S} _ {\text {n e a r}} \\ \exp \left(- \frac {(R _ {i j} - \gamma_ {i}) ^ {2}}{\sigma_ {i , \text {m i d d l e}}}\right), & x _ {j} \in \mathbb {S} _ {\text {m i d d l e}} \\ 0, & x _ {j} \in \mathbb {S} _ {\text {f a r}} \end{array} \right. +$$ + +$$ +P _ {i j} = \frac {P _ {j \mid i} + P _ {i \mid j}}{2} \tag {8} +$$ + +$$ +Q _ {i j} = \exp \left(- \left(\left\| \boldsymbol {y} _ {i} - \boldsymbol {y} _ {j} \right\| ^ {\frac {2}{d _ {\text {g l o b a l}}}}\right) ^ {2}\right) \tag {9} +$$ + +where $P_{j|i}$ denotes the conditional probability $P(x_j|x_i)$ , $R_{ij} = \|\pmb{x}_i - \pmb{x}_j\|^2$ , $d_{\mathrm{local}}$ and $d_{\mathrm{global}}$ are the estimated local + +and global ID, and $\gamma_{i}$ is a parameter to ensure continuity from near field to middle field. Equation 8 symmetrizes the conditional probability as in t-SNE (van der Maaten, 2014). $Q_{ij}$ takes a simple exponential form (note that the EED parameter $\alpha$ can be absorbed to $\pmb{y}$ hence omitted), which is favorable for gradient computation during optimization. More details on how to set up $\sigma_{i,\mathrm{near}}$ , $\sigma_{i,\mathrm{middle}}$ , and $\gamma_{i}$ are found in Appendix A.1. + +The resulting hierarchical similarity function is visually simple, as illustrated in Fig. 2, where $P$ of near, middle, and far fields are plotted for SpaceMAP (b). It can be seen that t-SNE makes no differentiation between the fields, with a single Gaussian, while UMAP better differentiates them, but with a uniform profile in the near field (1-nearest neighbor). SpaceMAP has a subtle perception of near and middle fields: the hierarchical modeling of manifold is reflected by the field-wise similarity, where exponential coefficients of $R_{ij}$ differ depending on the dataset-specific local and global ID. In the middle field, the exponential remains 2, same as in SNE and t-SNE. In the near field, however, a scaling of $d_{\mathrm{local}} / d_{\mathrm{global}}$ is applied depending on the data-specific manifold property. + +Fig. 3 shows the $Q$ function for SNE, t-SNE, UMAP, and SpaceMAP. Heavier tails can be observed in the later three methods. For SpaceMAP, heavier tail naturally arises from EED. + +Loss and Optimization: The loss function of SpaceMAP is similar to that of UMAP: + +$$ +\mathcal {L} = \sum_ {i} \sum_ {j} \left[ P _ {i j} \log \frac {P _ {i j}}{Q _ {i j}} + (1 - P _ {i j}) \log \frac {1 - P _ {i j}}{1 - Q _ {i j}} \right] \tag {10} +$$ + +where the first term exerts attractive force on similar points, and the second term repulsive force on dissimilar points. We used stochastic gradient descent and negative sampling to optimize $\mathcal{L}$ as in UMAP. For motivation of using this loss we refer to Section 2.2 and the recent publication on UMAP's true loss function (Damrich & Hamprecht, 2021b). + +# 4. Experiments and Results + +# 4.1. Datasets and Evaluation Metrics + +We benchmarked our SpaceMAP with other classical or state-of-the-art methods including PCA, Laplacian Eigenmaps, t-SNE, and UMAP. Experiments were performed on a wide range of datasets, including the standard MNIST (LeCun, 1998), Fashion-MNIST (Xiao et al., 2017), Swiss roll 1 (on the surface we dig a hole to test if visualization methods can preserve the local property on a continuous manifold), Swiss roll 2 (consisting of parallel lines to test the hierarchical manifold assumption), COIL-20 (Nene et al., 1996), RNA-seq (Tasic et al., 2018). In addition, we also tested our + +method on the extremely large GoogleNews Word2Vec 3 million dataset (Mikolov et al., 2013) and the prime-number-divisibility 1 million dataset(McInnes et al., 2018) (Results are presented in Appendix). + +For quantitative evaluation, we computed the 20-fold cross-validated KNN classification accuracy, trustworthiness, continuity, Shepard goodness, and normalized stress to evaluate both local and global structure preservation (Espadoto et al., 2021; Nonato & Aupetit, 2019). KNN accuracy measures the local structure preservation along different neighborhood size $k$ . Trustworthiness and continuity evaluate the local pattern of the embedding by calculating the true neighbor rate and missing neighbor rate. The Shepard goodness and the normalized stress are two measures of goodness in global structure preservation. Details on how to compute the metrics are found in (Espadoto et al., 2021). A newly proposed metric called DeMAP (denoised manifold affinity preservation) score (Moon et al., 2019) is also included and reported in Appendix A.9. + +# 4.2. Results + +Fig. 1 (b) shows the results of different methods on 3 synthetic datasets, on which the validity of visualization can be checked. $^{2}$ The first row illustrates the simplest situation where the ambient and intrinsic dimensionalities are both 2, the second row shows a dataset with ambient and intrinsic dimensionality 3, and the third row shows a Swill roll with a hole, with the ambient dimensionality of 3 and intrinsic dimensionality of 2. By correctly integrating prior information into the formulation of similarity, the SpaceMAP map achieves the best performance in all examples. We also note that SNE surpasses t-SNE and UMAP in unfolding the Swiss roll, as it correctly (albeit implicitly) assumes the intrinsic dimensionality to be 2. + +We further present the visualization results on two different synthetic Swiss rolls in Fig. 4. The first Swiss roll consists of parallel curves with disconnected dots, with $d_{\mathrm{local}} = 1$ and $d_{\mathrm{global}} = 2$ . t-SNE in Fig. 4 (a.2) maintains the local parallelism but fails to preserve the global continuity. UMAP (a.4) enforces local connectivity but ignores the parallelism between curves. The performance improves on larger neighborhood (a.5) but remains non-ideal. Given the local and global ID, SpaceMAP (a.6) correctly unfolds both local and global structure, surpassing t-SNE (a.3) and UMAP (a.5) with equivalent number of neighbors. For the Swiss roll with a hole, SpaceMAP (b.6) remains the only method that correctly unfolds local and global structures. Both t-SNE and UMAP tend to break around the hole. + +![](images/2e45911dc963689acd702ab2129c109abab3cb295e6f414ba847565cbc9a894f.jpg) +(a.1) + +![](images/10b99f3256ac800aabca73baed611a896c46de451d8c6b165aa023400e84b49d.jpg) +synthetic manifold d-local=1, d-global=2 +t-SNE default +(a.2) + +![](images/893f2547b773e2b9dc1c1a5c3422587de97df1b090d6c675ceac92655a1e99b5.jpg) +t-SNE perplexity=70 +(a.3) + +![](images/485fa6ba483748424f510d0dafdf7bc487203fed4d9a7eacf9adc0141e52a653.jpg) +UMAP default +(a.4) + +![](images/ccd496132788290884861921c08f00ad995d9b5ab81dd055b4864a9cd6d16f97.jpg) +UMAP +n-neighbors=70 n-near+n-middle=70 +(a.5) + +n-near+n-middle=70 + +![](images/a8b2a29a6f2b183576bef46345f33d0ce1bdb4a41e221d833a1af781392803c2.jpg) +SpaceMAP +(a.6) + +![](images/85cefddd46be61add7b53d0e10f20191a487d700625157255d9c239af4e25c63.jpg) +Swiss roll with a whole d-local=2, d-global=2 +(b.1) +Figure 4. Visualization results of the synthetic datasets by t-SNE, UMAP and SpaceMAP. Upper panel: The synthetic Swill roll with $d_{\mathrm{local}} = 1$ and $d_{\mathrm{global}} = 2$ . Lower panel: Swiss roll with a hole, with $d_{\mathrm{local}} = 2$ and $d_{\mathrm{global}} = 2$ . + +![](images/3eaf1a9407fa835031a66fced4d89e6d8eea65a579f90fe925e9dc6a9b9bfc11.jpg) +t-SNE default +(b.2) + +![](images/3cca1916bf8789803439050c54d0e2ed9224fe96b5719f89d8353292e1894d00.jpg) +t-SNE perplexity=70 +(b.3) + +![](images/1111a8dac525b3fefed606b48ed8957efd5aaa3ef137412afba932dc1440fa69.jpg) +UMAP default +(b.4) +UMAP + +![](images/f581380c60b479e273d4010615e2a9fc6618c2b733f4909e9c4aa0f33f4f5fbc.jpg) +(b.5) + +![](images/e12b7ae439f1c98b469befdc103a28bf867d38f26074947ab00de874bf57b1f9.jpg) +n-neighbors=70 n-near+n-middle=70 +SpaceMAP +(b.6) + +Table 1. Quantitative measure of visualization performance by SpaceMAP and other reference methods: $M_t$ , $M_c$ , $M_s$ and $M_\sigma$ indicate the trustworthiness, continuity, Shepard goodness and normalized stress, respectively. $M_t$ and $M_c$ are local metrics (left side of the table) while $M_s$ and $M_\sigma$ are global metrics (right side of the table). +Local Metrics $(M_t$ and $M_c)$ + +
ExperimentsPCALaplaciant-SNEUMAPSpaceMAP
MNISTMt0.740.810.980.960.97
Mc0.940.930.970.970.98
FMNISTMt0.910.890.980.980.99
Mc0.980.870.980.990.99
COIL-20Mt0.860.920.990.991.00
Mc0.930.790.990.991.00
RNA-SeqMt0.890.851.000.991.00
Mc0.980.940.991.001.00
+ +Global Metrics ( $M_{s}$ and $M_{\sigma}$ ) + +
ExperimentsPCALaplaciant-SNEUMAPSpaceMAP
MNISTMs0.500.230.350.320.35
1 - Ms0.420.330.540.530.55
FMNISTMs0.880.410.640.580.67
1 - Ms0.650.360.660.620.67
COIL-20Ms0.890.720.800.560.61
1 - Ms0.550.190.620.580.60
RNA-SeqMs0.800.110.610.220.63
1 - Ms0.600.150.590.500.52
+ +![](images/483848d833ee9a6c467dce64530163304c77d92fa5765d2ed5399fdef3283c00.jpg) +Figure 5. Visualization results by PCA, Laplacian eigenmaps, t-SNE, UMAP, and SpaceMAP, on the high-dimensional datasets MNIST, Fashion-MNIST, COIL-20, and RNA-seq. + +Fig. 5 presents 2D visualization of the real-world datasets, comparing PCA, Laplacian Eigenmap, t-SNE, UMAP, and SpaceMAP. SpaceMAP shows competitive performance on data of disjoint manifolds. We also report the quantitative metrics in Table 1, showing superior local and global metrics by SpaceMAP. We also report the estimated global ID in Table 3 for different real-world datasets. In Appendix A.6 we present the visualization results of GoogleNews Word2Vec 3M and prime-number-divisibility 1M in Fig. 10 and 11, where we observe interesting and interpretable hierarchies in the 2 gigantic datasets. Runtime is reported in Table A.8. + +# 4.3. Ablation Studies + +We present the ablation study on the hierarchical manifold assumption. By setting $d_{\mathrm{local}} = d_{\mathrm{global}}$ , we could remove the hierarchical manifold assumption, imposing the same similarity functions in near- and middle-fields. Fig. 6 shows the comparison between SpaceMAP visualization with and without hierarchy. A close examination shows that + +SpaceMAP with hierarchy reveals more subtle structures in data: the sub-clusters within the same class (e.g. different ways of writing a digit) are more pronounced. This subtle improvement is also reflected by the quantitative measure in Table 5, including the KL divergence of local similarity $(M_{\mathrm{KL}})$ in Appendix A.5, which measures the preservation of sub-manifolds in data, and local normalization stress $(M_{\sigma}^{\prime})$ , a local version of normalized stress (Espadoto et al., 2021). + +The hyper-parameters of $k_{\mathrm{near}}$ and $k_{\mathrm{middle}}$ were empirically set to 20 and 50. We show in Appendix Fig. 7 that the results are not particularly sensitive to the hyper-parameter choices, because what essentially matters is $d_{\mathrm{local}}$ and $d_{\mathrm{global}}$ , see Appendix A.2 for details. $d_{\mathrm{local}}$ is computed from $k_{\mathrm{near}}$ -NN, and the value of $d_{\mathrm{local}}$ can be stable over a range of $k_{\mathrm{near}}$ choices. $d_{\mathrm{global}}$ is a value over all data points, hence stable by nature. + +![](images/b025d1df90a17ed0fd1c8601162c90486498fec3f284e1b846c7f8840eeca491.jpg) +Figure 6. Visualization results of the ablation study on hierarchical manifold assumption in SpaceMAP with MNIST and Fashion-MNIST datasets. SpaceMAP with hierarchy reveal more details of the local pattern (i.e. sub-clusters within a class), as also quantitatively evaluated in Table 5. + +Table 2. Quantitative results of the ablation study on hierarchical manifold assumption in SpaceMAP with two quantitative metrics: KL divergence of local similarity $(M_{\mathrm{KL}})$ and local normalization stress $(M_{\sigma}^{\prime})$ . For both metrics, lower value is seen as an indicator of better local structure preservation quality. +Local structure preservation quality + +
ExperimentsUMAPSpaceMAP (no hierarchy)SpaceMAP
MNISTMKL1.00140.99610.9915
Mσ'0.94130.67140.6576
FMNISTMKL1.32391.29151.2594
Mσ'0.92770.94030.9218
+ +# 5. Discussion and Conclusions + +We proposed a new visualization method called SpaceMAP, which visualizes data of any dimensionality on a 2-dimensional map. Different from previous DR methods, we analytically derived a transformation of distance between high- and low-dimensional spaces to match their capacity. We further show that the transformation provably reduces the intrinsic dimension of high-dimensional data, within the framework of maximum likelihood intrinsic dimensionality estimation. + +We argue that all successful DR methods, including t-SNE and UMAP, make use of the rationale of space expansion to realize high-dimensional data visualization on a drastically reduced dimension. However, previous methods did + +such transformation in an implicit manner, with predefined similarity function (as long as they have a heavy tail, e.g. t-distribution for t-SNE). Despite their empirical success, it is difficult to examine the optimality or impose prior knowledge. For SpaceMAP, the capability to integrate useful data prior explains the success on all synthetic datasets evaluated in this work. + +Furthermore, SpaceMAP models similarity in a hierarchical, dataset-specific manner, hence compatible to both continuous and disjoint manifolds. Data property should be an integral part of DR methods, and SpaceMAP presents a way to incorporate it into the construction of similarity functions. + +Finally, we motivated the use of UMAP loss for SpaceMAP by showing its hidden connection to contrastive learning. Recently, contrastive learning has demonstrated substantial success in representation learning. A 2-dimensional visualization map can be regarded as representation of the original high-dimensional data; the contrastive mechanism likely explains the success of UMAP, as well as SpaceMAP. + +In conclusion, we have proposed a novel visualization method called SpaceMAP, based on a principled way to transform distances between high- and low-dimensional spaces. It further models the hierarchical structure in a dataset-specific manner based on the local and global intrinsic dimensionalities of data. Our experiments demonstrated its excellent performance on a wide range of synthetic and real-world datasets, in comparison with other state-of-the-art DR methods. + +# References + +Abdolali, M. and Rahmati, M. Neither global nor local: A hierarchical robust subspace clustering for image data. CoRR, abs/1905.07220, 2019. URL http://arxiv.org/abs/1905.07220. +Amid, E. and Warmuth, M. K. Trimap: Large-scale dimensionality reduction using triplets. arXiv preprint arXiv:1910.00204, 2019. +Ansui, A., Laio, A., Macke, J. H., and Zoccolan, D. Intrinsic dimension of data representations in deep neural networks. CoRR, abs/1905.12784, 2019. URL http://arxiv.org/abs/1905.12784. +Belkin, M. and Niyogi, P. Laplacian eigenmaps and spectral techniques for embedding and clustering. In Nips, volume 14, pp. 585-591, 2001. +Bengio, Y. Deep learning of representations: Looking forward, 2013. +Chen, T., Kornblith, S., Norouzi, M., and Hinton, G. A simple framework for contrastive learning of visual rep + +resentations. In III, H. D. and Singh, A. (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 https://proceedings.mlr.press/v119/chen20j.html. +Chen, X. and He, K. Exploring simple siamese representation learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 15750-15758, June 2021. +Chen, Y., Crawford, M., and Ghosh, J. Improved nonlinear manifold learning for land cover classification via intelligent landmark selection. In 2006 IEEE International Symposium on Geoscience and Remote Sensing. IEEE, jul 2006. doi: 10.1109/igarss.2006.144. +Coifman, R. R. and Lafon, S. Diffusion maps. Applied and Computational Harmonic Analysis, 21(1):5-30, jul 2006. doi: 10.1016/j.acha.2006.04.006. +Coifman, R. R., S. Lafon, A. B., Lee, Maggioni, M., Nadler, B., Warner, F., and Zucker, S. W. Geometric diffusions as a tool for harmonic analysis and structure definition of data: Diffusion maps. PNAS, 21:7426-7431, 2005. +Damrich, S. and Hamprecht, F. A. UMAP does not reproduce high-dimensional similarities due to negative sampling. CoRR, abs/2103.14608, 2021a. URL https://arxiv.org/abs/2103.14608. +Damrich, S. and Hamprecht, F. A. On UMAP's true loss function. In Advances in Neural Information Processing Systems, volume 15. MIT Press, 2021b. +Donoho, D. L. and Grimes, C. Hessian eigenmaps: Locally linear embedding techniques for high-dimensional data. Proceedings of the National Academy of Sciences, 100(10):5591-5596, apr 2003. doi: 10.1073/pnas.1031596100. +Espadoto, M., Hirata, N. S. T., and Telea, A. C. Deep learning multidimensional projections. Information Visualization, 19(3):247-269, may 2020. doi: 10.1177/1473871620909485. +Espadoto, M., Martins, R. M., Kerren, A., Hirata, N. S. T., and Telea, A. C. Toward a quantitative survey of dimension reduction techniques. IEEE Transactions on Visualization and Computer Graphics, 27(3):2153-2173, mar 2021. doi: 10.1109/tvcg.2019.2944182. +Giraud, C. Introduction to high-dimensional statistics. Chapman and Hall/CRC, 2021. +He, K., Fan, H., Wu, Y., Xie, S., and Girshick, R. Momentum contrast for unsupervised visual representation + +learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020. +Hinton, G. and Roweis, S. T. Stochastic neighbor embedding. In NIPS, volume 15, pp. 833-840. CiteSeer, 2002. +Hinton, G. E. and Salakhutdinov, R. R. Reducing the dimensionality of data with neural networks. Science, 313 (5786):504-507, jul 2006. doi: 10.1126/science.1127647. +Kobak, D. and Linderman, G. C. UMAP does not preserve global structure any better than t-sne when using the same initialization. Nature Biotechnology, abs/210339: 156-157, 2021. +Kuchroo, M., Huang, J., Wong, P., Grenier, J.-C., Shung, D., Tong, A., Lucas, C., Klein, J., Burkhardt, D. B., Gigante, S., Godavarthi, A., Rieck, B., Israelow, B., Simonov, M., Mao, T., Oh, J. E., Silva, J., Takahashi, T., Odio, C. D., Casanova-Massana, A., Fournier, J., Team, Y. I., Farhadian, S., Cruz, C. S. D., Ko, A. I., Hirn, M. J., Wilson, F. P., Hussin, J. G., Wolf, G., Iwasaki, A., and Krishnaswamy, S. Multiscale PHATE identifies multimodal signatures of COVID-19. Nat Biotechnol, 40:681-691, 2022. +LeCun, Y. The mnist database of handwritten digits. http://yann.lecun.com/exdb/mnist/, 1998. +Levina, E. and Bickel, P. J. Maximum likelihood estimation of intrinsic dimension. In Proceedings of the 17th International Conference on Neural Information Processing Systems, NIPS'04, pp. 777-784, Cambridge, MA, USA, 2004. MIT Press. +Linderman, G. C., Rachh, M., Hoskins, J. G., Steinerberger, S., and Kluger, Y. Fast interpolation-based t-SNE for improved visualization of single-cell RNA-seq data. Nature Methods, 16(3):243-245, feb 2019. doi: 10.1038/s41592-018-0308-4. +MacKay, D. J. and Ghahramani, Z. Comments on 'maximum likelihood estimation of intrinsic dimension' by e. levina and p. bickel (2004). 2005. URL http://www.inference.org.uk/mackay/dimension/. +McInnes, L., Healy, J., and Melville, J. Umap: Uniform manifold approximation and projection for dimension reduction. February 2018. +Mikolov, T., Sutskever, I., Chen, K., Corrado, G. S., and Dean, J. Distributed representations of words and phrases and their compositionality. In Advances in neural information processing systems, pp. 3111-3119, 2013. +Moon, K. R., van Dijk, D., Wang, Z., Gigante, S., Burkhardt, D. B., Chen, W. S., Yim, K., van den Elzen, A., Hirn, + +M. J., Coifman, R. R., Ivanova, N. B., Wolf, G., and Krishnaswamy, S. Visualizing structure and transitions in high-dimensional biological data. Nat Biotechnol, 37: 1482-1492, 2019. +Nene, S. A., Nayar, S. K., Murase, H., et al. Columbia object image library (coil-100). 1996. +Nonato, L. G. and Aupetit, M. Multidimensional projection for visual analytics: Linking techniques with distortions, tasks, and layout enrichment. IEEE Transactions on Visualization and Computer Graphics, 25(8):2650-2673, aug 2019. doi: 10.1109/tvcg.2018.2846735. +Pearson, K. On lines and planes of closest fit to systems of points in space. Philosophical Magazine, 2:559-572, 1901. +Pope, P., Zhu, C., Abdelkader, A., Goldblum, M., and Goldstein, T. The intrinsic dimension of images and its impact on learning. CoRR, abs/2104.08894, 2021. URL https://arxiv.org/abs/2104.08894. +Ross, D. A., Lim, J., Lin, R.-S., and Yang, M.-H. Incremental learning for robust visual tracking. International Journal of Computer Vision, 77(1-3):125-141, aug 2007. doi: 10.1007/s11263-007-0075-7. +Roweis, S. et al. Automatic alignment of hidden representations. In Sixteenth Annual Conference on Neural Information Processing Systems, Vancouver, Canada, volume 15, pp. 841-848, 2002. +Roweis, S. T. Nonlinear dimensionality reduction by locally linear embedding. Science, 290(5500):2323-2326, dec 2000. doi: 10.1126/science.290.5500.2323. +Tang, J., Liu, J., Zhang, M., and Mei, Q. Visualizing large-scale and high-dimensional data. In Proceedings of the 25th International Conference on World Wide Web. International World Wide Web Conferences Steering Committee, apr 2016. doi: 10.1145/2872427.2883041. +Tasic, B., Yao, Z., Graybuck, L. T., Smith, K. A., Nguyen, T. N., Bertagnolli, D., Goldy, J., Garren, E., Economomo, M. N., Viswanathan, S., Penn, O., Bakken, T., Menon, V., Miller, J., Fong, O., Hirokawa, K. E., Lathia, K., Rimorin, C., Tieu, M., Larsen, R., Casper, T., Barkan, E., Kroll, M., Parry, S., Shapovalova, N. V., Hirschstein, D., Pendergraft, J., Sullivan, H. A., Kim, T. K., Szafer, A., Dee, N., Groblewski, P., Wickersham, I., Cetin, A., Harris, J. A., Levi, B. P., Sunkin, S. M., Madisen, L., Daigle, T. L., Looger, L., Bernard, A., Phillips, J., Lein, E., Hawrylycz, M., Svoboda, K., Jones, A. R., Koch, C., and Zeng, H. Shared and distinct transcriptomic cell types across neocortical areas. Nature, 563(7729):72-78, oct 2018. doi: 10.1038/s41586-018-0654-5. + +Tenenbaum, J. B., de Silva, V., and Langford, J. C. A global geometric framework for nonlinear dimensionality reduction. Science, 290(5500):2319-2323, dec 2000. doi: 10.1126/science.290.5500.2319. +Tian, Y., Krishnan, D., and Isola, P. 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. +Tipping, M. E. and Bishop, C. M. Probabilistic principal component analysis. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 61(3):611-622, aug 1999. doi: 10.1111/1467-9868.00196. +van der Maaten, L. Learning a parametric embedding by preserving local structure. In van Dyk, D. and Welling, M. (eds.), Proceedings of the Twelfth International Conference on Artificial Intelligence and Statistics, volume 5 of Proceedings of Machine Learning Research, pp. 384-391, Hilton Clearwater Beach Resort, Clearwater Beach, Florida USA, 16-18 Apr 2009. PMLR. URL http://proceedings.mlr.press/v5/maaten09a.html. +van der Maaten, L. Barnes-hut-sne. arXiv preprint arXiv:1301.3342, 2013. +van der Maaten, L. Accelerating t-sne using tree-based algorithms. Journal of Machine Learning Research, 15 (93):3221-3245, 2014. URL http://jmlr.org/papers/v15/vandermaaten14a.html. +van der Maaten, L. and Hinton, G. Visualizing data using t-sne. Journal of Machine Learning Research, 9(86):2579-2605, 2008. URL http://jmlr.org/papers/v9/vandermaaten08a.html. +van der Maaten, L., Postma, E., and Van den Herik, J. Dimensionality reduction: a comparative review. *J Mach Learn Res*, 10:66-71, 2009. +Wang, Y., Huang, H., Rudin, C., and Shaposhnik, Y. Understanding how dimension reduction tools work: an empirical approach to deciphering t-sne, umap, trimap, and pacmap for data visualization. Journal of Machine Learning Research, 22(201):1-73, 2021. +Weinberger, K. Q. and Saul, L. K. An introduction to nonlinear dimensionality reduction by maximum variance unfolding. In AAAI, volume 6, pp. 1683-1686, 2006. +Wright, J. and Ma, Y. High-Dimensional Data Analysis with Low-Dimensional Models: Principles, Computation, and Applications. Cambridge University Press, 2022. +Wu, Z., Xiong, Y., Yu, S. X., and Lin, D. Unsupervised feature learning via non-parametric instance discrimination. + +In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2018. +Xiao, H., Rasul, K., and Vollgraf, R. Fashion-mnist: a novel image dataset for benchmarking machine learning algorithms. arXiv preprint arXiv:1708.07747, 2017. +Ye, M., Zhang, X., Yuen, P. C., and Chang, S.-F. Unsupervised embedding learning via invariant and spreading instance feature. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2019. +Zhang, Z. and Zha, H. Principal manifolds and nonlinear dimensionality reduction via tangent space alignment. SIAM Journal on Scientific Computing, 26(1):313-338, jan 2004. doi: 10.1137/s1064827502419154. +Zhou, Z., Zu, X., Wang, Y., Lelieveldt, B. P. F., and Tao, Q. Deep recursive embedding for high-dimensional data. IEEE Transactions on Visualization and Computer Graphics, 28(2):1237-1248, 2022. doi: 10.1109/TVCG.2021.3122388. +Zou, H., Hastie, T., and Tibshirani, R. Sparse principal component analysis. Journal of Computational and Graphical Statistics, 15(2):265-286, jun 2006. doi: 10.1198/106186006x113430. + +# A. Appendix + +# A.1. Parameters in SpaceMAP Similarity Functions + +We provide more details on the computation of SpaceMAP similarity in Equation 8 and 9. In Equation 8, the border point $x_{k_1}$ (the $k_1$ -nearest points to $x_i$ ) at the intersection of near field and middle field satisfies $P_{k_1|i} = \eta$ , where $\eta \in (0,1)$ is a hyper-parameter representing the conditional probability differentiating near- and middle-fields. Therefore $\sigma_{i,\mathrm{near}}$ can be computed as: + +$$ +\sigma_ {i, \text {n e a r}} = - \frac {R _ {i k _ {1}} ^ {2 d _ {\text {l o c a l}} / d _ {\text {g l o b a l}}}}{\ln \eta} \tag {11} +$$ + +The computation of $\sigma_{i,\mathrm{middle}}$ in Equation 8 follows similar rationales in UMAP (McInnes et al., 2018) to ensure that middle-field neighbors take up certain probability mass: $\sum_{j = k_1 + 1}^{k_1 + k_2}P_{j|i}(\sigma_{i,\mathrm{middle}}) = \eta \log (k_2)$ , where $k_{1}$ is the number of nearest neighbors in the near field, and $k_{2}$ is the number of nearest neighbors in the middle field. $\gamma_{i}$ in Equation 8 can be accordingly computed to satisfy continuity of $P_{ij}$ : + +$$ +\gamma_ {i} = R _ {i k _ {1}} - \sqrt {- \sigma_ {i , \mathrm {m i d d l e}} \ln \eta} \tag {12} +$$ + +# A.2. MLE Pseudo Code + +Algorithm 1 describes the maximum likelihood estimation (MLE) of the intrinsic dimensions. The inputs of Algorithm 1 are the distance function of the nearest neighbors of each point $knn\_dist$ , the number of nearest neighbors in the near field and the middle field of each data $k_{near}$ , $k_{middle}$ . The outputs of the algorithm are the MLE of the intrinsic dimensions of the local sub-manifolds and the global manifold, on which the data distributes. + +Algorithm 1 Maximum likelihood estimation (MLE) of the intrinsic dimension +1: function MLEINTRINSICDIMENSION(knn_dist, $n_{\mathrm{near}}$ , $n_{\mathrm{middle}}$ ) +2: $k_1 \gets k_{\mathrm{near}}$ +3: $k_2 \gets k_{\mathrm{near}} + k_{\mathrm{middle}}$ +4: for $i \gets 1, \dots, N$ do +5: $R_{i,k_1} \gets k_{\mathrm{nn\_dist}}[i, k_1]$ +6: $R_{i,k_2} \gets k_{\mathrm{nn\_dist}}[i, k_2]$ +7: $\hat{d}_{\mathrm{local}}[i] \gets (\frac{1}{k_1 - 1} \sum_{j = 1}^{k_1 - 1} \log \frac{R_{i,k_1}}{R_{i,j}})^{-1}$ +8: $\hat{d}_{\mathrm{middle}}[i] \gets (\frac{1}{k_2 - 1} \sum_{j = 1}^{k_2 - 1} \log \frac{R_{i,k_2}}{R_{i,j}})^{-1}$ +9: end for +10: $\hat{d}_{\mathrm{global}} \gets \left(\frac{1}{N} \sum_{i = 1}^{N} \hat{d}_{\mathrm{middle}}[i]^{-1}\right)^{-1}$ +11: return $\hat{d}_{\mathrm{local}}, \hat{d}_{\mathrm{global}}$ +12: end function + +# A.3. SpaceMAP hyper-parameters + +SpaceMAP has a small set of hyper-parameters, including the number of nearest neighbor in the near field $k_{\mathrm{near}}$ , number of nearest neighbor in the middle field $k_{\mathrm{middle}}$ , and the similarity $\eta \in (0,1)$ at the border of near- and middle-field. We present the visualization results for SpaceMAP at different numbers of these three hyper-parameters Fig. 7 and Fig. 8. We observe that the final visualization results are not particular sensitive to the choice of parameters. + +# A.4. Quantitative Evaluation of KNN Accuracy + +We compare the 20-fold cross-validated KNN classification accuracy as a function of neighborhood size $k$ on different datasets, namely, MNIST, COIL-20, RNA-seq. In general, SpaceMAP outperforms UMAP in different neighborhood sizes, while t-SNE is competitive to SpaceMAP when the neighborhood size is small. See the results in Fig. 9. + +![](images/fb5db40c0bc06f878bfa66a714f0bfc1344f5fad35004ba22ba5b00f6bb270a9.jpg) +Figure 7. Hyper-parameter selection in SpaceMAP. The influence of $n_{near}$ and $n_{middle}$ , the two main hyper-parameters of SpaceMAP. + +![](images/c184c46df3c6bae176021a6a1687d73f5a77f23e7997cecafda815454540eef6.jpg) +(a) + +![](images/0612c8f0afbd7c04ba23337f26db6fd4d71328e78a0394fc9e2f2b2345c3da25.jpg) +(b) + +![](images/f2c47c596d5aada160e27909f1d26bf1d1ed8caea790aa17d2a7fdc4b9f5d9df.jpg) +(c) +Figure 8. Hyper-parameter selection in SpaceMAP. The influence of $\eta$ , similarity at the intersection of near- and middle field. + +![](images/604e38785d7014251e856260c2a7f473abfd7e5ed14e02d8f9cf95e364eb4825.jpg) +(d) + +# A.5. KL Divergence of Local Similarity + +We introduce a new metric, called KL divergence of local similarity, to evaluate the preservation of local sub-manifolds in data. It computes the KL divergence between the KNN pairwise similarities (modeled as posterior probability) in the + +![](images/2a7af4a15a177c70cf9b3eefc6a5db87c45e71ae834a5fa9217c37c7b1db62ec.jpg) +Figure 9. 20-fold cross-validated KNN classification accuracy as a function of neighborhood size $k$ on different datasets. From left to right: MNIST, COIL-20, and RNA-seq. + +![](images/2e339e12f180fe8d65506e4839a5f61fc0b634acb2088beb8c99a9efd08189f0.jpg) + +![](images/ee1a68afdc04ec15ea8ecf064469f9983829c36b4a105ca08f70e26358d5665e.jpg) + +high-dimensional space and the embedded low-dimensional space: + +$$ +M _ {\mathrm {K L}} = \mathrm {K L} (R \| r) = \sum_ {i} \sum_ {j} R _ {i j} \log \frac {R _ {i j}}{r _ {i j}} \tag {13} +$$ + +(14) + +where $R_{ij} = \frac{\|\pmb{x}_i - \pmb{x}_j\|}{\sum_{k \neq l} \|\pmb{x}_k - \pmb{x}_l\|}$ and $r_{ij} = \frac{\|\pmb{y}_i - \pmb{y}_j\|}{\sum_{k \neq l} \|\pmb{y}_k - \pmb{y}_l\|}$ are the pairwise similarities in high-dimensional space and their embedding in low-dimensional space. This metric characterizes the local data structure preservation, better than other local metrics such as the KNN accuracy, trustworthiness, and continuity. We selected all the KNN neighbors in SpaceMAP (default setting is $k = n_{near} + n_{middle} = 20 + 50 = 70$ ) and set UMAP with $n_{neighbors} = 70$ as the baseline in Table 5. We note that this metric is defined independent of our loss function, hence unbiased. + +# A.6. Visualizing 3 Million Data + +Like UMAP, SpaceMAP has the ability to embed millions of data with high dimensionality. Figure ?? shows the embedding result of the GoogleNews Word2Vec 3 million dataset by UMAP and SpaceMAP. The dataset contains 3 million pretrained word vectors with 300 dimensions, widely used in the natural language processing (NLP) community. In the SpaceMAP result, several clear semantic clusters emerge. Zooming in the cluster with geographic words, we observed a hierarchical structure based on geographic meaning like the continental location. Some clusters even demonstrated a profound understanding on the cultural relationship among countries. For example, the South American country names are in the same sub-cluster as Spain and Portugal, and the North African country names are in the same sub-cluster as other Islamic countries. Figure 11 shows the embedding result of integers from 0 to 1,000,000 represented as binary vectors indicating their prime divisibility, inspired by McInnes et al. (2018). The result has a subtle fractal structure. + +# A.7. Intrinsic Dimensions of Real-world Datasets + +Here we provide the intrinsic dimensions of the datasets (MNIST, Fashion-MNIST, COIL-20 and RNA-Seq) as calculated by Eq. 6 in Table 3. Further information is provided in Pope et al. 2021. + +Table 3. The global intrinsic dimensions of the datasets (MNIST, Fashion-MNIST, COIL-20 and RNA-Seq) calculated by Eq. 6. + +
MNISTFashion-MNISTCOIL-20RNA-Seq
ID8.89.33.316.7
+ +![](images/d7aec6304565c595b308621359c381d0468520fa1dfd5955e8d499a73e754efa.jpg) +Figure 10. The Word Map: visualization of the GoogleNews Word2Vec 3 Million Dataset by UMAP (left) and SpaceMAP (middle). The SpaceMAP result is zoomed in for better visualization of the word semantics (right). The same data points are also marked in UMAP. We observed a better hierarchical embedding by SpaceMAP compared with UMAP. Remarkable, SpaceMAP demonstrated a profound understanding on the cultural relationship among countries. + +![](images/45ac996f405e49bca1cd9b314f941e5eb89e310a30da421c2c66b147b024bbcf.jpg) +Figure 11. The Prime Number Divisibility: SpaceMAP embeds integers from 0 to 1,000,000, as represented by the sparse binary vectors of prime number divisibility. Details are found in the original UMAP paper (McInnes et al., 2018). Sub-structures of data can be identified, which corresponds to divisibility of multiple prime numbers (zoomed-in windows). The map has a beautiful fractal structure. + +# A.8. Runtime and Implementation + +The runtime of the visualization methods (t-SNE, UMAP and SpaceMAP) are provided in Table 5. We implemented all the DR methods on a Ubuntu 20.04 LTS workstation platform with AMD 3900x 4.2GHz 12-core CPU, 64GB DDR4 RAM and NVidia RTX 3090 24GB GPU. For t-SNE, we use Scikit-learn Barnes-Hut t-SNE implementation with PCA initialization and the default perplexity is 30. For UMAP, we use the original umap-learn implementation with spectral embedding initialization, the default number of neighbors for each point is n-neighbors=15. + +Table 4. Runtime of the methods (t-SNE, UMAP and SpaceMAP) + +
datasett-SNEUMAPSpaceMAP
MNIST210s34s85s
Fashion-MNIST202s43s88s
COIL-203s3s2s
RNA-Seq44s12s39s
+ +# A.9. Manifold Preservation + +We additionally report the DeMAP (denoised manifold affinity preservation) score proposed in (Moon et al., 2019) to evaluate the manifold preservation quality by different DR methods. + +Table 5. The DeMAP score of different DR methods (PCA, t-SNE, UMAP and SpaceMAP). Higher DeMAP score indicates better manifold preservation. The synthetic Swiss roll dataset is shown in Fig. 4 a.1 + +
datasetPCAt-SNEUMAPSpaceMAP
RNA-Seq0.84150.60120.63150.7250
COIL-200.50800.60660.40860.8022
Swiss roll with a hole0.41530.57170.85130.9111
synthetic Swiss roll0.39290.43600.29690.9579
\ No newline at end of file diff --git a/spacemapvisualizinghighdimensionaldatabyspaceexpansion/images.zip b/spacemapvisualizinghighdimensionaldatabyspaceexpansion/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..fb431bfd3a5f379fadee92aef5110c313c821927 --- /dev/null +++ b/spacemapvisualizinghighdimensionaldatabyspaceexpansion/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2f93d228d05a85456828c12300a4e3025ae32e5a89ed123067dee3777074158e +size 1047962 diff --git a/spacemapvisualizinghighdimensionaldatabyspaceexpansion/layout.json b/spacemapvisualizinghighdimensionaldatabyspaceexpansion/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..5b685c56e7c5b92f250fcad976489e5fab5a39ab --- /dev/null +++ b/spacemapvisualizinghighdimensionaldatabyspaceexpansion/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:300453f13c669ce0a1d9c8143e8bacea2dd7ef68714ac815c63f8a0a6d86b59a +size 658454 diff --git a/sparsedoubledescentwherenetworkpruningaggravatesoverfitting/6cd588a1-0f44-4f5a-aff4-dcd80e673227_content_list.json b/sparsedoubledescentwherenetworkpruningaggravatesoverfitting/6cd588a1-0f44-4f5a-aff4-dcd80e673227_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..f8beeb7a68aa37b45e86314ba9c0d889d05341de --- /dev/null +++ b/sparsedoubledescentwherenetworkpruningaggravatesoverfitting/6cd588a1-0f44-4f5a-aff4-dcd80e673227_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9a38646a167d385152a267bae62add888393d56a61430745bae2157ff648a5d1 +size 143738 diff --git a/sparsedoubledescentwherenetworkpruningaggravatesoverfitting/6cd588a1-0f44-4f5a-aff4-dcd80e673227_model.json b/sparsedoubledescentwherenetworkpruningaggravatesoverfitting/6cd588a1-0f44-4f5a-aff4-dcd80e673227_model.json new file mode 100644 index 0000000000000000000000000000000000000000..62a1784057edbdd9f7c8624f2d3096baa5427cd3 --- /dev/null +++ b/sparsedoubledescentwherenetworkpruningaggravatesoverfitting/6cd588a1-0f44-4f5a-aff4-dcd80e673227_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1f6ebf7a387d5a6d23406e43fe19bc58228ef35309275ae9f5d10861a7428553 +size 173287 diff --git a/sparsedoubledescentwherenetworkpruningaggravatesoverfitting/6cd588a1-0f44-4f5a-aff4-dcd80e673227_origin.pdf b/sparsedoubledescentwherenetworkpruningaggravatesoverfitting/6cd588a1-0f44-4f5a-aff4-dcd80e673227_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..8f3bd3f7a1fa48fe5f01a68136976e12090b69cb --- /dev/null +++ b/sparsedoubledescentwherenetworkpruningaggravatesoverfitting/6cd588a1-0f44-4f5a-aff4-dcd80e673227_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4c7f67425a18b784f0153b7f72aae08d352fd1524aa30e9cdfe3a2a0c1e64b9d +size 1893832 diff --git a/sparsedoubledescentwherenetworkpruningaggravatesoverfitting/full.md b/sparsedoubledescentwherenetworkpruningaggravatesoverfitting/full.md new file mode 100644 index 0000000000000000000000000000000000000000..5cb2436e2d19b6d8ce14be90b94336bcebe22a90 --- /dev/null +++ b/sparsedoubledescentwherenetworkpruningaggravatesoverfitting/full.md @@ -0,0 +1,665 @@ +# Sparse Double Descent: Where Network Pruning Aggravates Overfitting + +Zheng He1 Zeke Xie2,3 Quanzhi Zhu1 Zengchang Qin1 + +# Abstract + +People usually believe that network pruning not only reduces the computational cost of deep networks, but also prevents overfitting by decreasing model capacity. However, our work surprisingly discovers that network pruning sometimes even aggravates overfitting. We report an unexpected sparse double descent phenomenon that, as we increase model sparsity via network pruning, test performance first gets worse (due to overfitting), then gets better (due to relieved overfitting), and gets worse at last (due to forgetting useful information). While recent studies focused on the deep double descent with respect to model overparameterization, they failed to recognize that sparsity may also cause double descent. In this paper, we have three main contributions. First, we report the novel sparse double descent phenomenon through extensive experiments. Second, for this phenomenon, we propose a novel learning distance interpretation that the curve of $\ell_2$ learning distance of sparse models (from initialized parameters to final parameters) may correlate with the sparse double descent curve well and reflect generalization better than minima flatness. Third, in the context of sparse double descent, a winning ticket in the lottery ticket hypothesis surprisingly may not always win. + +# 1. Introduction + +Deep neural networks (DNNs) have achieved great empirical success in recent years, which are usually trained with much more model parameters than training examples (LeCun et al., 2015). The extreme overparameterization gives DNNs excellent approximation as well as a prohibitively + +1Intelligent Computing and Machine Learning Lab, School of ASEE, Beihang University, Beijing, China 2The University of Tokyo 3RIKEN Center for AIP. Correspondence to: Zheng He , Zengchang Qin . + +Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s). + +large model capacity (Cybenko, 1989; Funahashi, 1989; Hornik et al., 1989; Hornik, 1993). Overparameterized DNNs can even easily memorize entire random-labeled dataset (Zhang et al., 2017), which suggests that DNNs are kind of "good at" overfitting. + +However, in practice, DNNs do not learn via pure memorization and often achieve higher generalization performance on many tasks than smaller models (Szegedy et al., 2015; Neyshabur et al., 2015; Arpit et al., 2017). Recent studies even reported an interesting deep double descent phenomenon (Belkin et al., 2019; Nakkiran et al., 2020; Loog et al., 2020; d'Ascoli et al., 2020; Yang et al., 2020) that, as the model capacity increases, test performance first gets better, then gets worse (due to classical overfitting), and gets better at last (due to relieved overfitting). Deep double descent motivated us to rethink the widely held viewpoint that network pruning reduces model capacity thus mitigates overfitting (LeCun et al., 1990; Hassibi & Stork, 1992; Molchanov et al., 2017; Hoefler et al., 2021). + +As the extreme overparameterization of DNNs may cause deep double descent, may the sparsification of DNNs also cause a double descent phenomenon symmetric to the existing "deep double descent"? Our answer is affirmative. We call such phenomenon "sparse double descent". + +Our main contributions are summarized as follows: + +- To the best of our knowledge, our work is the first to report the sparse double descent phenomenon (see Figure 1). More specifically, we demonstrate that high model sparsities may significantly mitigate overfitting, while moderate model sparsities may lead to severer overfitting. And extreme model sparsities $(\rightarrow 100\%)$ tend to lose all learned information. +- The $\ell_2$ learning distance of models (from initialized parameters to final parameters) may be correlated with a double descent curve and reflects generalization better than minima flatness for sparse models. +- Contrary to the lottery ticket hypothesis Frankle & Carbin (2019), we find the retraining a sparse model from its original initialization may not win at all time. For example, in some cases, a randomly reinitialized pruned model could largely surpass model with the + +![](images/06beb2b57871ad9495241e5aacb28a59602956862d1f96405823b68184df8b77.jpg) +Figure 1. Sparse Double Descent of LeNet-300-100 on MNIST and ResNet-18 on CIFAR with $20\%$ symmetric label noise. We evaluate how the train and test performance of networks depend on model sparsity. Left: MNIST. Middle: CIFAR-10. Right: CIFAR-100. + +![](images/7b70ea153fe8ef2589d9a694f10639fe0693d21d1711ee0f0fd9b6918b575da9.jpg) + +![](images/02745d760d3b9d345007417920718187211b10505797dad23b2c40ccb25f1d86.jpg) + +original initialization at certain sparsities. + +This paper is organized as follows. In Section 2, we demonstrate empirical evidence for sparse double descent through extensive experiments. In Section 3, we analyze how learning distance matters to the sparse double descent compared with minima flatness. In Section 4, we include further empirical analysis and discuss the relationship between our results and some related work. In Section 5, we conclude with our main work. + +# 2. Sparse Double Descent + +In this section, we conducted extensive experiments to demonstrate sparse double descent with respect to model sparsity. We also identified four phases of model sparsity in empirical results. In our experiments, we grow model sparsity gradually via network pruning, and use the train and test accuracy to demonstrate how overfitting and generalization depend on model sparsity. + +# 2.1. Overview + +Although network pruning has been widely investigated at the target of storage and computational savings (Han et al., 2015; 2016; Liu et al., 2017; Molchanov et al., 2017; Li et al., 2017; Louizos et al., 2018; Frankle & Carbin, 2019; Liu et al., 2019), a broad consensus on how pruning will act on generalization has not been achieved yet (Hoefler et al., 2021). + +Prior studies have demonstrated that networks learn simpler patterns first and are less prone to memorize noisy labels with limited capacity (Arpit et al., 2017; Li et al., 2020b). Following Occam's razor, network pruning that aims to reduce parameter counts could also be regarded as some kind of regularization on model capacity (LeCun et al., 1990; Hassibi & Stork, 1992). By restricting a subset of model parameters to a value of zero, pruning imposes sparsity constraints on neural networks and penalizes its redundant + +expressive power. Pruning is thus sometimes considered as a potential regularizer in recent works. (Molchanov et al., 2017; Ahmad & Scheinkman, 2019; Xia et al., 2021; Zhang et al., 2021) + +Moreover, there are some other conjectures on how pruning might benefit generalization, e.g., pruning creates sparsified versions of data representation, which introduce noise and encourage flatness into neural networks (Han et al., 2017; Bartoldson et al., 2020). And flatness of minima is usually correlated with good generalization (Hochreiter & Schmidhuber, 1995; 1997; Hardt et al., 2016; Keskar et al., 2017; Zhu et al., 2019; Xie et al., 2020; 2022b). Given the discussions above, it is intuitive to suppose that pruning can enhance model performance and prevent overfitting. + +However, our experimental results reveal that moderately sparse networks sometimes generalize even worse than their dense counterpart, meaning sparsity may aggravate overfitting under some circumstances. In this paper, we particularly evaluate overfitting and generalization in the presence of noisy labels. This setting is common in related work (Yang et al., 2020; Stephenson et al., 2021; Xie et al., 2021a;b), because it is helpful to understanding severe overfitting in real-world problems. As DNNs overfit easily and noisy labels exist pervasively in real-world datasets (Shankar et al., 2020; Northcutt et al., 2021a;b), learning with noisy labels has been a popular topic recently. Thus, we consider learning with noisy labels as an important problem setting to evaluate overfitting and generalization. + +We find that in the presence of label noise, the double descent phenomenon occurs through model sparsification. Namely, when noisy labels are added to the training data, the sparse double descent can be observed robustly across different datasets, architectures, pruning settings and label noise types. The existence of sparse double descent raises doubts on conventional wisdom that pruning relieves overfitting, and offers new insights into understanding the relationship between sparsity and generalization. + +![](images/84abc1390e7a70c8cd804348066e62c6656f28105a33043ce9858dc52354d3d6.jpg) +Figure 2. Sparse Double Descent of ResNet-18 on CIFAR-100 with $40\%$ symmetric label noise, pruned using different strategies. We plot the train and test accuracy against sparsity. Left: Magnitude-based pruning. Middle: Gradient-based pruning. Right: Random pruning. + +![](images/6e0ca485999809a6679ea317b6f224747c54dbf798321f3459a445a2832ce60c.jpg) + +![](images/4dc6649dbc2a7aee919a5bdbca5a9da070e4541e97e7f2268af0105987d8f9b9.jpg) + +![](images/81df639526e3d5cf0cd5d9743d9f787a30fc736eeccfb1d46e81794bf17ac7a2.jpg) +Figure 3. Sparse Double Descent of ResNet-18 on CIFAR-100 with $40\%$ symmetric label noise, and different retraining methods. We plot the train and test accuracy against sparsity. Left: Finetuning. Middle: Learning rate rewinding. Right: Scratch retraining. + +![](images/1ff076549869ebc34cb3d6046bf37f87d79f9fe07ddc7035855065dd22111cf1.jpg) + +![](images/25f62b39159f906802a416e618171ab476cde45453487138c38f40dc437af5da.jpg) + +# 2.2. Experimental Setup + +We describe the main experimental setup used throughout this paper. Particularly, we also vary several experimental choices, e.g., models and datasets, pruning strategies, retraining methods and label noise settings, to verify the generalizability of the sparse double descent phenomenon. Preliminaries, experimental details as well as more experimental results are given in the Appendix. + +Models and datasets. We train a fully-connected LeNet-300-100 (LeCun et al., 1998) on MNIST (LeCun et al., 1998), a ResNet-18 (He et al., 2016) on CIFAR-10 or CIFAR-100 (Krizhevsky et al., 2009). We use the SGD optimizer with momentum 0.9 and adopt commonly used hyperparameters for training and pruning. We repeat experiments five (on MNIST) or three (on other datasets) times with different seeds and plot the mean and standard deviation. We also test a VGG-16 (Simonyan & Zisserman, 2015) on CIFAR datasets (see Figure 20 and 27). In the context of larger model and dataset, we train a ResNet-101 on Tiny ImageNet dataset1 (see Figure 30), which is a reduced version of ImageNet (Deng et al., 2009). + +Network pruning. Pruning is an effective technique to enhance the efficiency of deep networks with limited computational budget, by removing dispensable weights, filters or other structures from neural networks (LeCun et al., 1990; Han et al., 2015; Li et al., 2017; Liu et al., 2017). In this work, we do not chase state-of-the-art accuracy nor the computing resource efficiency; thus we simply remove each weights individually (i.e., unstructured pruning), for this method can adjust easily to different tasks and architectures. + +Given a dataset $\mathcal{D} = \{(\mathbf{x}_i,\mathbf{y}_i)\}_{i = 1}^n$ , we define a neural network classifier function as $f(\mathbf{w};\mathcal{D})$ , where $\mathbf{w}\in \mathbb{R}^d$ is the set of weights, and $d$ is the total number of weights. As weight pruning removes parameters individually, we introduce a binary masks $\mathbf{m}\in \{0,1\} ^d$ as auxiliary to represent the remained weights $\mathbf{w}\odot \mathbf{m}$ . The classifier function under sparsity constraints is denoted as $f(\mathbf{w}\odot \mathbf{m};\mathcal{D})$ , where $\odot$ is the element-wise product. The model sparsity of a pruned network is defined as $1 - \sum_{i = 1}^{d}\mathbf{m}_{i} / d$ . + +Pruning strategies. We use three existing pruning heuristics summed up by Blalock et al. (2020), i.e., magnitude-based pruning, gradient-based pruning and random pruning. Magnitude-based pruning is one of the most commonly used baselines, and has been shown to achieve comparable performance to many complex techniques (Han et al., 2015; + +![](images/da46fa92cfdca9fcd5f32f22455d87c0e97b2dd6a82a58aa7544dd44d297af88.jpg) +Figure 4. Sparse Double Descent of ResNet-18 on CIFAR-10 with various symmetric label noise rate. We evaluate how the train and test performance of networks depend on model sparsity. Left: $\epsilon = 20\%$ . Middle: $\epsilon = 40\%$ . Right: $\epsilon = 80\%$ . + +![](images/9ec7665409d86aea36d5992d403c0fcafcad8b446fd0f5f0ebec4b8da4bfd295.jpg) + +![](images/330cb152c0f18554113861b0c0143b8a2f70761122ce35d83efb77ee36f7a771.jpg) + +2016; Gale et al., 2019). Gradient-based pruning preserves training dynamics and provides possibility to prune a network early in training (Lee et al., 2019; 2020). And random pruning is often regraded as a naive method, setting the performance benchmark that any elaborately designed method should surpass (Frankle et al., 2021). + +We prune weights in a network globally by comparing them across layers with the mentioned heuristics. For mainline experiments, we utilize the magnitude-based pruning if not otherwise noted. Weights with the lowest absolute magnitudes in a network will be removed after one pruning operation. + +Retraining. A common approach to recover network performance after pruning is retraining, which means training the pruned networks for some extra epochs. Along side the sparse structures induced by different pruning strategies, re-training methods also affect network performance by determining which point on the optimization landscape to start training from, i.e., near initialization or close to the final weights; or which learning rate schedule to utilize. We mainly utilized the technique lottery ticket rewinding (LTR) proposed in lottery ticket hypothesis (Frankle & Carbin, 2019) to retrain a network from near initialization. + +In addition to LTR, we also consider other existing retraining techniques like finetuning, learning rate rewinding, and scratch retraining. Interestingly, the sparse double descent phenomenon exists consistently despite different retraining settings (see Figure 3). We mainly demonstrate the results of LTR unless otherwise specified, and leave more experimental results in the Appendix. In all experiments, networks are pruned, retrained and pruned iteratively, and $20\%$ of weights will be removed during each pruning. + +Label noise settings. To verify the generalizability of our observations, we run experiments on three types of synthetic label noise, i.e., symmetric noise, asymmetric noise and pairflip noise, which are widely used in prior works (Ma et al., 2018; Li et al., 2020a; Xia et al., 2021). The noise rate + +![](images/6658bccd5aadbe9caf446ada5de75c2e44fb571da65a0720138aafe5de04765a.jpg) +Figure 5. Illustration of four phases using the result of LeNet-300-100 on MNIST with $20\%$ symmetric label noise. I: Light Phase. II: Critical Phase. III: Sweet Phase. IV: Collapsed Phase. + +$\epsilon$ is set to $20\%$ , $40\%$ and $80\%$ . Most results and discussions are based on symmetric label noise except where otherwise provided. + +# 2.3. Effect of Model Sparsity on Overfitting + +Empirical evidence of sparse double descent. From Figure 1, we empirically observe the sparse double descent for both ResNet-18 on CIFAR and LeNet-300-100 on MNIST in the presence of noisy labels. This suggests that sparse double descent may generally exist in various models and datasets, when overfitting is severe. Figures in section C.1 summarize the double descent behavior of sparse neural networks across different datasets, architectures and settings of pruning and label noise. In most cases, increasing sparsity of networks results in a first decrease then increase, and then decrease again in the test accuracy. Note that this increase is not caused by incomplete training of models, for models across all sparsities are able to converge to steady states (Figure 35, 36). Particularly, the right plot in Figure 2 shows that even random pruning may cause sparse double descent. + +Four phases of model sparsity. Given the empirical ob + +![](images/6d4a14a691842e4360c24ac1b841a528ba2753f5c353c01e6e773d467f0b12e2.jpg) +Figure 6. Accuracy as a function of epochs during sparse and re-dense training process. Results are from ResNet-18 networks trained on CIFAR-100 with $\epsilon = 40\%$ . Pruned weights are recovered and trained from zero at epoch 160. The re-dense networks are optimized using learning rate of 0.001 for another 160 epoch. From left to the right, we display results of dense model, and models in Critical Phase, Sweet Phase and Collapsed Phase respectively. + +servations, we identified four phases of model sparsity (see Figure 5). Different from previous work (Frankle et al., 2020; 2021), we define these four phases in terms of training accuracy and test accuracy. + +First, Light Phase indicates low sparsities where the network is so overparameterized that pruned network can still reach similar accuracy to the dense model. Second, Critical Phase means an interval around the interpolation threshold (Nakkiran et al., 2020) where training accuracy is going to drop and test accuracy is about to first decrease then increase as sparsity grows. Third, Sweet Phase are high sparsities where test accuracy can significantly be boosted. Fourth, Collapsed Phase are those beyond, where both training accuracy and test accuracy drops significantly. + +Here we illustrate how the sparse double descent is affected by data itself. As shown in Figure 4, increasing the fraction of label noise shifts the Critical Phase towards models with larger capacity, which is to say, lower sparsities. On the other hand, in order to combat the side effects brought by the existence of heavier labels noise, more parameters in the network need to be pruned. Thus, Sweet Phase generally moves to higher sparsities as noisy labels increase. + +The most interesting discovery is the existence of Critical Phase, where overfitting becomes the most severe. To the best of our knowledge, we are the first to report the novel Critical Phase, where pruning, no matter reasonable heuristic-based pruning or random pruning, may decrease test accuracy while maintaining training accuracy, thus hurting generalization. + +Discussion of related work. The observation that the Critical Phase may exist in random pruning contradicts with the conventional wisdom that random parameter perturbations can relieve overfitting (Harutyunyan et al., 2020; Xie et al., 2021a). On the other hand, a number of papers on sparsity (Molchanov et al., 2017; Lee et al., 2019; Hooker et al., 2019; Goel & Chen, 2021) only revealed that sparsity impairs memorization, but failed to uncover the unexpected + +![](images/798dea2b1d9612353faf8ed01b63a023d80d4be58f72447307133828a81564eb.jpg) +Figure 7. Linear interpolation plots for ResNet-18 on CIFAR-100 in Sweet Phase with $\epsilon = 40\%$ . Note that $\alpha = 0$ corresponds to sparse solutions, while $\alpha = 1$ corresponds to the re-dense solutions (see methodology in Appendix A.5). The blue lines are loss curves and the red lines are accuracy curves; solid lines are about training data and dashed lines are about testing data. + +loss of generalization performance as well. Liebenwein et al. (2021) studied the performance of pruned networks under distributional shifts, but did not reveal the nontrivial changing curve of test accuracy against sparsity. + +A recent work Chang et al. (2021) studied double descent of pruned models with respect to the number of original model parameters. However, Chang et al. (2021) still focused on how model performance depends on overparameterization of original models rather than pruned models, while our work focused on the influence of sparsity on overfitting and generalization. + +In summary, previous studies did not expect the existence of Critical Phase with respect to model sparsity, and thus, failed to discover sparse double descent. + +# 3. Why Sparse Double Descent Occurs + +In this section, we try to understand and analyze why sparse double descent occurs. We believe that the mechanism + +![](images/4062431a94d41f84f9f291b25d69889aa5c4e67c45ac6541254330a16a16abec.jpg) +Figure 8. The 1-D loss visualization of minima found by re-dense training using filter normalization (Li et al., 2018). Result is of ResNet-18 on CIFAR-100 with $\epsilon = 40\%$ . The sparsity of particular model is measured before the re-dense step. The sparser the original pruned network is, the sharper minima it might converge to after re-dense training. + +behind sparse double descent can help to understand the conventional deep double descent with respect to model overparameterization from a new perspective. + +# 3.1. Minima Flatness Cannot Explain Sparse Double Descent + +Flatness is a widely used measure to capture the generalization behavior of neural networks (Jiang et al., 2020). Flatter minima are usually believed to imply robustness to perturbations in model parameters (Xie et al., 2021a; Foret et al., 2020), low complexity (Blier & Ollivier, 2018; Xie et al., 2022a), and better generalization (Keskar et al., 2017; Wu et al., 2017; Chaudhari et al., 2019). Previous works hypothesized that pruning could encourage the optimizer to move towards flatter minima that benefit generalization (Han et al., 2017; Bartoldson et al., 2020). May such minima flatness hypothesis explain sparse double descent? + +We note that by removing a quantity of parameters, pruning restricts the movement of optimizer in low-dimension space, and drastically changes the loss landscape. Thus, measuring the minima flatness of pruned networks and comparing them across different sparsities possibly leads to unfair comparison. We are therefore motivated to seek indirect evidence that can estimate flatness with the same dimensions. + +We apply the re-dense training approach to connect a sparse network with a dense one, which is introduced in Appendix A.4: after training a sparse network to reach convergence, we recover its pruned weights, and further retrain the whole network for certain epochs. If the optimizer reaches a flat basin of loss landscape during sparse training, we may suspect that a small learning rate in the re-dense training stage will continually attract optimizer around this basin. Then the final re-dense solutions will have comparable generalization + +![](images/5e89ed4f29fb2ae602d171b212f321f66ba54f8f7302a5d5a1cf6733bb11b3ec.jpg) +Figure 9. The curve of learning distance for LeNet-300-100 on MNIST with $\epsilon = 20\%$ may explain the double descent of test accuracy. As model sparsity increases, learning distance coincides the changes of test accuracy. The blue lines refer to $\ell_2$ learning distance and the red lines are test accuracy. + +performance to the sparse ones. + +To demonstrate our points, we will focus on four model sparsities in the following analysis: 1) the zero sparsity (dense model), 2) the sparsity where the last test accuracy degrades the most (in Critical Phase), 3) the sparsity where the test accuracy reaches a peak (in Sweet Phase), and 4) the sparsity where both the train accuracy and test accuracy suffer (in Collapsed Phase). + +Figure 6 surprisingly shows that sparse solutions are not stable in dense subspace. Once the sparsity constraints are removed, the model will escape from pruned solutions and overfit severely. The phenomenon that neural networks escape from highly sparse solutions during re-dense training, even with a small learning rate, raises doubts on the conjecture regarding minima flatness. + +With linear interpolation of loss function, we find a monotonically decreasing path from the high-loss point to low-loss point in Figure 7. The existence of such path also demonstrates that these highly sparse solutions may no longer be minimizers in the loss landscape of dense model, thus allowing for the escape phenomenon during re-dense training process. Given this observation, we conjecture that sparsity may restrict the movement of optimizers, and trap them near initialization, which would be normally skipped when training dense networks. + +Furthermore, the final solutions of re-dense training do not generalize well, and even have higher sharpness than the original dense models (see the 1-D visualization of re-dense solutions at various sparsities in Figure 8). The empirical results refute that highly sparse solutions stick around flat basins of minimizers. + +![](images/9e6aa693051ddcb7104259a91fbc9f5c3537fc2a657534b830050050e8565cca.jpg) +Figure 10. Performance of ResNet-18 on CIFAR-10 with $\epsilon = 20\%$ when retrained from either the original initialization (lottery tickets), or a random reinitialization. Reinitialization results sometimes surpass lottery results. + +# 3.2. The Learning Distance Hypothesis for Sparse Double Descent + +Learning distance has been observed to be very related to generalization in deep learning (Neyshabur et al., 2019; Nagarajan & Kolter, 2019). Several studies suggested that neural networks need to move far from initialization to have large model capacity and overfit noisy labels, while avoid overfitting when staying close (Li et al., 2020b; Hu et al., 2020; Stephenson et al., 2021). And prior work Nagarajan & Kolter (2019) provided empirical and theoretical evidences that model capacity could be restricted by the $\ell_2$ distance from initialization. + +Given the failure of minima flatness hypothesis, we propose a novel learning distance hypothesis for sparse double descent that sparsity affects the learning distance, while learning distance correlates with model capacity and generalization ability. + +For illustration, we denote weights at initialization by $\mathbf{w}_{init} \in \mathbb{R}^d$ , and weights trained after the $i_{th}$ pruning by $\mathbf{w}_{learned}^{i} \in \mathbb{R}^{d}$ , where the pruned weights are regarded as zero weights. We define the learning distance $D$ as the $\ell_2$ distance from the original initialization to learned parameters, namely, $D(\mathbf{w}_{init}, \mathbf{w}_{learned}^{i}) = ||\mathbf{w}_{init} - \mathbf{w}_{learned}^{i}||_2$ . Note that, the weights at initialization refer to the initialized parameters of the original dense model, instead of the sparse initialization of the pruned model. + +In order to demonstrate the relationship between the learning distance and model performance, we plot both learning distance and test accuracy against sparsity in Figure 9. We surprisingly find that the changing curve of learning distance correlates with test accuracy. Our experimental results suggest that staying closer to initialization coincides with + +![](images/f81c4ce0dc6d0570c6d9435c2d8bc8f9774d451c1a2d935b745811b9f97f4acb.jpg) +Figure 11. The train accuracy and best test accuracy as functions of sparsities. Models are ResNet-18 on CIFAR-100 with $\epsilon = 40\%$ , pruned with three different pruning strategies. + +better robustness: in Critical Phase, sparse solutions are located farther from initialization, and present an inferior performance; while at high sparsities in Sweet Phase, sparse minimizers stay closer and manifest robustness (although in Collapsed Phase, too few parameters remain trainable that learning distance becomes less informative). Furthermore, the turning point of test accuracy from decreasing to increasing is usually consistent with a peak in learning distance. This suggests a relatively strong correlation between learning distance and sparse double descent. + +While a number of generalization measures have been studied in deep learning, previous studies rarely touched how these generalization measures including learning distance may reflect double descent in deep learning. Our finding may shed light on theoretically understanding sparse double descent from the perspective of learning distance. + +# 4. Empirical Analysis and Discussion + +In this section, we present more empirical results about spare double descent. We discuss their meaning and some related work. + +Lottery tickets may not win at all time. The lottery ticket hypothesis (Frankle & Carbin, 2019) supposes that a large network contains a subnetwork, which could be trained effectively together with the original initialization, while performs far worse if reinitialized. However, against the well-known lottery ticket hypothesis, we identify that reinitialized sparse models could outperform lottery ticket models in some circumstances (see Figure 10, 33 and 34). For the reinitialized models, the sparse double descent still holds, but with the Critical Phase and Sweet Phase both moved to left. This way, reinitialized models could beat lottery ticket models at the same sparsity but different phases. The results show that models with the same sparse structure but + +![](images/4addc03668ed8a7d6e773811a796f97975591edff5e77f3d8df755813abcdad9.jpg) +Figure 12. The $\ell_2$ learning distance and test accuracy as functions of sparsity for CIFAR-100 with $\epsilon = 20\%$ . The blue lines are $\ell_2$ learning distance curves and the red lines are accuracy curves. + +different initialization behave distinctively. Our finding suggests that a winning lottery ticket may not always win in the presence of sparse double descent. + +The best test accuracy benefits from pruning. Although the test accuracy at the last epoch shows double descent with respect to pruning, we find that the best test accuracy across all epochs in training may not possess such well-defined trend. Instead, the best accuracy might increase in general from Light Phase till early Sweet Phase before finally drops down, with only a slight drop in Critical Phase (Figure 11). So why the best test accuracy sometimes does not show a double descent trend? As deep double descent actually also depends on the number of training epochs (Nakkiran et al., 2020), we conjecture that training epochs of DNNs also plays a key role in model capacity in the context of sparse double descent. + +Does learning distance tell the whole story? Results in Figure 9, 12 and Appendix C.7 show that when sparsity is higher than critical (interpolation threshold) sparsity, learning distance of sparse networks declines continuously as pruning, and test accuracy climbs up to a peak before finally goes down. This observation supports our proposed hypothesis to some extent, and is consistent with prior theoretical studies that small distance from initialization may relieve overfitting (Nagarajan & Kolter, 2019; Li et al., 2020b). However, in Figure 12, the test accuracy of Critical Phase model is inferior to that of dense model, while the critical learning distance is not higher to the dense one (which differs from the MNIST results). It is natural to wonder why the learning distance curves of CIFAR do not present a peak in Critical Phase as distinct as those of MNIST? + +One possible reason might be the inherent property of rectified neural networks: scale invariance. As we utilize ReLU as non-linearities activation, the network remains unchanged if we multiply the weights in one layer by $t$ , and the next layer by $1 / t$ . In this way, the network's behavior remains un- + +changed but its distance from original parameters increases. Furthermore, this invariance is even more prominent when batch normalization is used, where the output of each layer will be re-scaled (Dinh et al., 2017; Li et al., 2018). In this case, the influence made by parameter removal during pruning might be offset by reparametrization effect of batch normalization, as such, changing the behavior of learning distance curve. + +We suggest the learning distance as a potentially helpful generalization measure for sparse models, because this hypothesis correlates with the sparse double descent results to a certain extent. Proving it theoretically and rigorously for sparse neural networks remains as an open question. We will leave it for future work. + +Possible explanations for the imperception of sparse double descent without label noise. We'd like to further discuss why the double descent phenomenon is rarely exhibited in existing pruning literature as well as our experiments under zero label noise (see Figure 31). Several possible explanations might account for its imperception: + +(1) The double descent phenomenon itself is not stable (Ba et al., 2020; Nakkiran et al., 2020; Yang et al., 2020). To observe it in modern network architectures, we sometimes need to inject label noise (Nakkiran et al., 2020; Yang et al., 2020). Moreover, even though a "plateau" or a small peak in test error around the interpolation point of dense models is reported on the noiseless CIFAR dataset (Nakkiran et al., 2020), it will still be too hard to distinguish from the irregular fluctuations of test accuracy in pruning cases (Frankle & Carbin, 2019; Liu et al., 2019; Renda et al., 2020). +(2) The Critical Phase often occur within quite thin sparsity ranges, and the Sweet Phase relies on relatively high sparsities (generally greater than $90\%$ under label noise). Many studies might not report enough points in the accuracy-sparsity tradeoff curve (Molchanov et al., 2017; Liu et al., 2017; Le & Hua, 2021); +(3) The regularization of pruning may come from other sources except for parameter reduction, like noise injection in model parameters(Bartoldson et al., 2020), which might offset the performance loss brought by pruning when training without label noise. + +Nevertheless, under label noise settings, we can amplify the impact of reduced capacity on model performance brought about by sparsity, and reconcile the conventional understanding and the modern practice of network pruning. + +Relation with theory of sparse learning. So far, the relationship between sparsity, learning dynamics and generalization remains as open question and has received growing + +attention from researchers. Emerging studies from the perspective of loss landscape provide enlightening insight into understanding the behaviors of sparse regimes. Evci et al. (2020) revealed that the existence of bad solutions in sparse subspace (namely, the sparsity pattern found by pruning), and illustrate the difficulty of escaping from bad solutions to good ones. And Lin et al. (2022) provide theoretical justification that sparsity can deteriorate the loss landscape by creating spurious local minima or spurious valleys. Our work is motivated by these findings, and what's more, moves a step further by empirically demonstrating that the reshaping effect on loss landscape at high sparsities by network pruning is actually beneficial in the presence of label noise. + +Connection to robust learning with label noise. While our focus has been on the characteristics of sparse neural networks under noisy labels, there are other research hot-spots concerning label-noise learning, e.g., designing state-of-the-art robust training algorithms (Han et al., 2018; Jiang et al., 2018; Li et al., 2019; 2020a). Among these methods, we find CDR proposed by Xia et al. (2021) particularly related regarding the way to hinder memorization. Using a similar criterion to gradient-based pruning, they identify non-critical parameters and penalize them during optimization. By deactivating redundant parameters, memorization of noisy labels is hindered, and test performance before early stopping is enhanced. While our results reveal that, with a large proportion of parameters being removed permanently, performance after early stopping could also be boosted greatly. + +# 5. Conclusion + +In this paper, we reassess some common beliefs concerning the generalization properties of sparse networks, and illustrate the inapplicability of these viewpoints. Instead, we report an unexpected sparse double descent phenomenon. And our proposed learning distance hypothesis correlates with previous theoretical studies, and accounts for this phenomenon to a certain extent. We provide some insight into the optimization dynamics and generalization ability of sparse regimes, which we hope will guide progress towards further understanding for the theory of both sparse learning and deep learning. + +# References + +Ahmad, S. and Scheinkman, L. How can we be so dense? the benefits of using highly sparse representations. arXiv preprint arXiv:1903.11257, 2019. +Arpit, D., Jastrzebski, S., Ballas, N., Krueger, D., Bengio, E., Kanwal, M. S., Maharaj, T., Fischer, A., Courville, A., Bengio, Y., et al. A closer look at memorization in deep networks. In International Conference on Machine + +Learning, pp. 233-242. PMLR, 2017. +Ba, J., Erdogdu, M. A., Suzuki, T., Wu, D., and Zhang, T. Generalization of two-layer neural networks: An asymptotic viewpoint. In 8th International Conference on Learning Representations, ICLR, 2020. +Bartoldson, B., Morcos, A. S., Barbu, A., and Erlebacher, G. The generalization-stability tradeoff in neural network pruning. In Advances in Neural Information Processing Systems, volume 33, pp. 20852-20864, 2020. +Belkin, M., Hsu, D., Ma, S., and Mandal, S. Reconciling modern machine-learning practice and the classical bias-variance trade-off. Proceedings of the National Academy of Sciences, 116(32):15849-15854, 2019. ISSN 0027-8424. doi: 10.1073/pnas.1903070116. +Blalock, D., Ortiz, J. J. G., Frankle, J., and Guttag, J. What is the state of neural network pruning? arXiv preprint arXiv:2003.03033, 2020. +Blier, L. and Ollivier, Y. The description length of deep learning models. In Proceedings of the 32nd International Conference on Neural Information Processing Systems, pp. 2220-2230, 2018. +Chang, X., Li, Y., Oymak, S., and Thrampoulidis, C. Provable benefits of overparameterization in model compression: From double descent to pruning neural networks. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pp. 6974-6983, 2021. +Chaudhari, P., Choromanska, A., Soatto, S., LeCun, Y., Baldassi, C., Borgs, C., Chayes, J., Sagun, L., and Zecchina, R. Entropy-sgd: Biasing gradient descent into wide valleys. Journal of Statistical Mechanics: Theory and Experiment, 2019(12):124018, 2019. +Cybenko, G. Approximation by superpositions of a sigmoidal function. Mathematics of control, signals and systems, 2(4):303-314, 1989. +Deng, J., Dong, W., Socher, R., Li, L.-J., Li, K., and Fei-Fei, L. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pp. 248-255. IEEE, 2009. +Dinh, L., Pascanu, R., Bengio, S., and Bengio, Y. Sharp minima can generalize for deep nets. In International Conference on Machine Learning, pp. 1019-1028. PMLR, 2017. +d'Ascoli, S., Refinetti, M., Biroli, G., and Krzakala, F. Double trouble in double descent: Bias and variance (s) in the lazy regime. In International Conference on Machine Learning, pp. 2280-2290. PMLR, 2020. + +Evci, U., Pedregosa, F., Gomez, A., and Elsen, E. The difficulty of training sparse neural networks, 2020. +Foret, P., Kleiner, A., Mobahi, H., and Neyshabur, B. Sharpness-aware minimization for efficiently improving generalization. In International Conference on Learning Representations, 2020. +Frankle, J. and Carbin, M. The lottery ticket hypothesis: Finding sparse, trainable neural networks. In 7th International Conference on Learning Representations, ICLR, 2019. +Frankle, J., Dziugaite, G. K., Roy, D., and Carbin, M. Linear mode connectivity and the lottery ticket hypothesis. In International Conference on Machine Learning, pp. 3259-3269. PMLR, 2020. +Frankle, J., Dziugaite, G. K., Roy, D., and Carbin, M. Pruning neural networks at initialization: Why are we missing the mark? In 9th International Conference on Learning Representations, ICLR, 2021. +Funahashi, K.-I. On the approximate realization of continuous mappings by neural networks. Neural networks, 2(3): 183-192, 1989. +Gale, T., Olsen, E., and Hooker, S. The state of sparsity in deep neural networks. CoRR, abs/1902.09574, 2019. +Goel, P. and Chen, L. On the robustness of monte carlo dropout trained with noisy labels. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 2219-2228, 2021. +Goodfellow, I. J. and Vinyals, O. Qualitatively characterizing neural network optimization problems. In Bengio, Y. and LeCun, Y. (eds.), 3rd International Conference on Learning Representations, ICLR 2015, 2015. +Han, B., Yao, Q., Yu, X., Niu, G., Xu, M., Hu, W., Tsang, I. W., and Sugiyama, M. Co-teaching: Robust training of deep neural networks with extremely noisy labels. In NeurIPS, 2018. +Han, S., Pool, J., Tran, J., and Dally, W. Learning both weights and connections for efficient neural network. Advances in Neural Information Processing Systems, 28, 2015. +Han, S., Mao, H., and Dally, W. J. Deep compression: Compressing deep neural network with pruning, trained quantization and huffman coding. In 4th International Conference on Learning Representations, ICLR, 2016. +Han, S., Pool, J., Narang, S., Mao, H., Gong, E., Tang, S., Elsen, E., Vajda, P., Paluri, M., Tran, J., Catanzaro, B., and Dally, W. J. DSD: dense-sparse-dense training for + +deep neural networks. In 5th International Conference on Learning Representations, ICLR, 2017. +Hardt, M., Recht, B., and Singer, Y. Train faster, generalize better: Stability of stochastic gradient descent. In International Conference on Machine Learning, pp. 1225-1234, 2016. +Harutyunyan, H., Reing, K., Steeg, G. V., and Galstyan, A. Improving generalization by controlling label-noise information in neural network weights. In International Conference on Machine Learning, 2020. +Hassibi, B. and Stork, D. G. Second order derivatives for network pruning: optimal brain surgeon. In Proceedings of the 5th International Conference on Neural Information Processing Systems, pp. 164-171, 1992. +He, K., Zhang, X., Ren, S., and Sun, J. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770-778, 2016. +Hochreiter, S. and Schmidhuber, J. Simplifying neural nets by discovering flat minima. In Advances in neural information processing systems, pp. 529-536, 1995. +Hochreiter, S. and Schmidhuber, J. Flat minima. Neural Computation, 9(1):1-42, 1997. +Hoefler, T., Alistarh, D., Ben-Nun, T., Dryden, N., and Peste, A. Sparsity in deep learning: Pruning and growth for efficient inference and training in neural networks. arXiv preprint arXiv:2102.00554, 2021. +Hooker, S., Courville, A., Clark, G., Dauphin, Y., and Frome, A. What do compressed deep neural networks forget? arXiv preprint arXiv:1911.05248, 2019. +Hornik, K. Some new results on neural network approximation. Neural networks, 6(8):1069-1072, 1993. +Hornik, K., Stinchcombe, M., and White, H. Multilayer feedforward networks are universal approximators. Neural networks, 2(5):359-366, 1989. +Hu, W., Li, Z., and Yu, D. Simple and effective regularization methods for training on noisily labeled data with generalization guarantee. In 8th International Conference on Learning Representations, ICLR, 2020. +Jiang, L., Zhou, Z., Leung, T., Li, L.-J., and Fei-Fei, L. Mentornet: Learning data-driven curriculum for very deep neural networks on corrupted labels. In International Conference on Machine Learning, pp. 2304-2313. PMLR, 2018. + +Jiang, Y., Neyshabur, B., Mobahi, H., Krishnan, D., and Bengio, S. Fantastic generalization measures and where to find them. In 8th International Conference on Learning Representations, ICLR, 2020. +Keskar, N. S., Mudigere, D., Nocedal, J., Smelyanskiy, M., and Tang, P. T. P. On large-batch training for deep learning: Generalization gap and sharp minima. In 5th International Conference on Learning Representations, ICLR, 2017. +Krizhevsky, A., Hinton, G., et al. Learning multiple layers of features from tiny images. 2009. +Le, D. H. and Hua, B. Network pruning that matters: A case study on retraining variants. In 9th International Conference on Learning Representations, ICLR, 2021. +LeCun, Y., Denker, J. S., and Solla, S. A. Optimal brain damage. In Advances in neural information processing systems, pp. 598-605, 1990. +LeCun, Y., Bottou, L., Bengio, Y., and Haffner, P. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278-2324, 1998. +LeCun, Y., Bengio, Y., and Hinton, G. Deep learning. nature, 521(7553):436, 2015. +Lee, N., Ajanthan, T., and Torr, P. H. S. Snip: single-shot network pruning based on connection sensitivity. In 7th International Conference on Learning Representations, ICLR, 2019. +Lee, N., Ajanthan, T., Gould, S., and Torr, P. H. S. A signal propagation perspective for pruning neural networks at initialization. In 8th International Conference on Learning Representations, ICLR, 2020. +Li, H., Kadav, A., Durdanovic, I., Samet, H., and Graf, H. P. Pruning filters for efficient convnets. In 5th International Conference on Learning Representations, ICLR, 2017. +Li, H., Xu, Z., Taylor, G., Studer, C., and Goldstein, T. Visualizing the loss landscape of neural nets. In Advances in Neural Information Processing Systems, pp. 6391-6401, 2018. +Li, J., Wong, Y., Zhao, Q., and Kankanhalli, M. S. Learning to learn from noisy labeled data. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 5051-5059, 2019. +Li, J., Socher, R., and Hoi, S. C. H. Dividemix: Learning with noisy labels as semi-supervised learning. In 8th International Conference on Learning Representations, ICLR, 2020a. + +Li, M., Soltanolkotabi, M., and Oymak, S. Gradient descent with early stopping is provably robust to label noise for overparameterized neural networks. In International conference on artificial intelligence and statistics, pp. 4313-4324. PMLR, 2020b. +Liebenwein, L., Baykal, C., Carter, B., Gifford, D., and Rus, D. Lost in pruning: The effects of pruning neural networks beyond test accuracy. Proceedings of Machine Learning and Systems, 3:93-138, 2021. +Lin, D., Sun, R., and Zhang, Z. On the landscape of one-hidden-layer sparse networks and beyond. Artificial Intelligence, pp. 103739, 2022. +Liu, Z., Li, J., Shen, Z., Huang, G., Yan, S., and Zhang, C. Learning efficient convolutional networks through network slimming. In Proceedings of the IEEE international conference on computer vision, pp. 2736-2744, 2017. +Liu, Z., Sun, M., Zhou, T., Huang, G., and Darrell, T. Rethinking the value of network pruning. In 7th International Conference on Learning Representations, ICLR, 2019. +Loog, M., Viering, T., Mey, A., Krijthe, J. H., and Tax, D. M. A brief prehistory of double descent. Proceedings of the National Academy of Sciences, 117(20):10625-10626, 2020. +Louizos, C., Welling, M., and Kingma, D. P. Learning sparse neural networks through 1.0 regularization. In 6th International Conference on Learning Representations, ICLR 2018, 2018. +Ma, X., Wang, Y., Houle, M. E., Zhou, S., Erfani, S., Xia, S., Wijewickrema, S., and Bailey, J. Dimensionality-driven learning with noisy labels. In International Conference on Machine Learning, pp. 3355-3364. PMLR, 2018. +Molchanov, D., Ashukha, A., and Vetrov, D. P. Variational dropout sparsifies deep neural networks. In Precup, D. and Teh, Y. W. (eds.), Proceedings of the 34th International Conference on Machine Learning, ICML 2017, volume 70 of Proceedings of Machine Learning Research, pp. 2498-2507. PMLR, 2017. +Nagarajan, V. and Kolter, J. Z. Generalization in deep networks: The role of distance from initialization. arXiv preprint arXiv:1901.01672, 2019. +Nakkiran, P., Kaplun, G., Bansal, Y., Yang, T., Barak, B., and Sutskever, I. Deep double descent: Where bigger models and more data hurt. In 8th International Conference on Learning Representations, ICLR, 2020. +Neyshabur, B., Tomioka, R., and Srebro, N. In search of the real inductive bias: On the role of implicit regularization in deep learning. In ICLR (Workshop), 2015. + +Neyshabur, B., Li, Z., Bhojanapalli, S., LeCun, Y., and Srebro, N. The role of over-parametrization in generalization of neural networks. In 7th International Conference on Learning Representations, ICLR, 2019. +Northcutt, C., Jiang, L., and Chuang, I. Confident learning: Estimating uncertainty in dataset labels. Journal of Artificial Intelligence Research, 70:1373-1411, 2021a. +Northcutt, C. G., Athalye, A., and Mueller, J. Pervasive label errors in test sets destabilize machine learning benchmarks. CoRR, abs/2103.14749, 2021b. +Renda, A., Frankle, J., and Carbin, M. Comparing rewind-ing and fine-tuning in neural network pruning. In 8th International Conference on Learning Representations, ICLR, 2020. +Shankar, V., Roelofs, R., Mania, H., Fang, A., Recht, B., and Schmidt, L. Evaluating machine accuracy on ImageNet. In Proceedings of the 37th International Conference on Machine Learning, volume 119 of Proceedings of Machine Learning Research, pp. 8634-8644. PMLR, 13-18 Jul 2020. +Simonyan, K. and Zisserman, A. Very deep convolutional networks for large-scale image recognition. In 3rd International Conference on Learning Representations, ICLR, 2015. +Stephenson, C., Padhy, S., Ganesh, A., Hui, Y., Tang, H., and Chung, S. On the geometry of generalization and memorization in deep neural networks. In 9th International Conference on Learning Representations, ICLR, 2021. +Szegedy, C., Liu, W., Jia, Y., Sermanet, P., Reed, S., Anguelov, D., Erhan, D., Vanhoucke, V., and Rabinovich, A. Going deeper with convolutions. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 1-9, 2015. +Wu, L., Zhu, Z., et al. Towards understanding generalization of deep learning: Perspective of loss landscapes. arXiv preprint arXiv:1706.10239, 2017. +Xia, X., Liu, T., Han, B., Gong, C., Wang, N., Ge, Z., and Chang, Y. Robust early-learning: Hinding the memorization of noisy labels. In International Conference on Learning Representations, 2021. +Xie, Z., Sato, I., and Sugiyama, M. A diffusion theory for deep learning dynamics: Stochastic gradient descent exponentially favors flat minima. In International Conference on Learning Representations, 2020. + +Xie, Z., He, F., Fu, S., Sato, I., Tao, D., and Sugiyama, M. Artificial neural variability for deep learning: On overfitting, noise memorization, and catastrophic forgetting. Neural computation, 33(8):2163-2192, 2021a. +Xie, Z., Yuan, L., Zhu, Z., and Sugiyama, M. Positive-negative momentum: Manipulating stochastic gradient noise to improve generalization. In International Conference on Machine Learning, volume 139 of Proceedings of Machine Learning Research, pp. 11448-11458. PMLR, 18-24 Jul 2021b. +Xie, Z., Tang, Q.-Y., Cai, Y., Sun, M., and Li, P. On the power-law spectrum in deep learning: A bridge to protein science. arXiv preprint arXiv:2201.13011, 2022a. +Xie, Z., Wang, X., Zhang, H., Sato, I., and Sugiyama, M. Adaptive inertia: Disentangling the effects of adaptive learning rate and momentum. In International Conference on Machine Learning, 2022b. +Yang, Z., Yu, Y., You, C., Steinhardt, J., and Ma, Y. Rethinking bias-variance trade-off for generalization of neural networks. In International Conference on Machine Learning, pp. 10767-10777. PMLR, 2020. +Zhang, C., Bengio, S., Hardt, M., Recht, B., and Vinyals, O. Understanding deep learning requires rethinking generalization. In 5th International Conference on Learning Representations, ICLR, 2017. +Zhang, D., Ahuja, K., Xu, Y., Wang, Y., and Courville, A. C. Can subnetwork structure be the key to out-of-distribution generalization? In Proceedings of the 38th International Conference on Machine Learning, ICML 2021, 18-24 July 2021, Virtual Event, volume 139 of Proceedings of Machine Learning Research, pp. 12356-12367. PMLR, 2021. +Zhu, Z., Wu, J., Yu, B., Wu, L., and Ma, J. The anisotropic noise in stochastic gradient descent: Its behavior of escaping from sharp minima and regularization effects. In Chaudhuri, K. and Salakhutdinov, R. (eds.), Proceedings of the 36th International Conference on Machine Learning, ICML, volume 97 of Proceedings of Machine Learning Research, pp. 7654-7663. PMLR, 2019. + +# A. Methodology + +Here, we introduce the methods used in this paper in detail. + +# A.1. Pruning Strategies + +We used three network pruning strategies in the paper. Unless particularly specified, results and discussions are based on the magnitude-based pruning. + +- Magnitude-based pruning: prunes the weights with the lowest absolute magnitudes $|\mathbf{w}|$ . +- Gradient-based pruning: prunes the weights with the lowest absolute values of magnitude multiplies gradient $\left| \frac{\partial L}{\partial \mathbf{w}} \odot \mathbf{w} \right|$ , with $L$ be the loss function evaluated on a random batch of inputs. +- Random pruning: issues each weight with a random score sampled independently from the uniform distribution $\mathcal{U}(0,1)$ and prunes the weights with the lowest scores. + +# A.2. Retraining Techniques + +The typical retraining based pruning procedure consists of three stages (Liu et al., 2019): 1) train a large, dense neural network to completion, 2) prune structures of the trained network according to certain heuristic, 3) retrain the network for $T$ epochs to mitigate accuracy loss. In this paper, we run experiments using the following four retraining methods to verify the robustness of sparse double descent, and implementation details like rewinding iteration and learning rate of finetuning are listed in B: + +- Lottery ticket rewinding: rewind the parameters and the learning rate of pruned network to the iteration $t$ at an early training stage, and subsequently retrain the models from there (Frankle & Carbin, 2019) for $T - t$ epochs. +- Finetuning: retrans the pruned model from the final values of parameters, for $T$ epochs (Han et al., 2015). Usually, finetuning will use a fixed small learning rate, i.e., the last learning rate of the original training schedule (Li et al., 2017; Liu et al., 2019). +- Learning rate rewinding: retrans the pruned model for $T - t$ epochs from the final parameters, but reuse the learning rate schedule from the iteration $t$ at the early training phase (Renda et al., 2020). Learning rate rewinding is kind of a hybrid between lottery ticket rewinding and finetuning. +- Scratch retraining: rewind the learning rate schedule of pruned model to the beginning, but use a random reinitialization of parameters, and retrain the model for $T$ epochs. This method is often used as baseline to make comparison with lottery ticket rewinding method. In our paper, during the pruning and scratch training iteration, we use a different initialization each time when we retrain. + +# A.3. Label Noise Types + +Here, we introduce the different types of synthetic label noise used in our paper. Following Xia et al. (2021), we manually generate symmetric, asymmetric and pairflip label noise, and the details are listed below. Most results and discussions are based on symmetric label noise unless otherwise specified. + +- Symmetric noise: generated by randomly permuted the labels for a fraction $\epsilon$ of the training data. +- Asymmetric noise: generated by flipping $\epsilon$ of labels within a set of similar classes. In our work, for MNIST, flip labels $2 \rightarrow 7, 3 \rightarrow 8, 5 \leftrightarrow 6$ . For CIFAR-10, BIRD $\rightarrow$ AIRPLANE, DEER $\rightarrow$ HORSE, TRUCK $\rightarrow$ AUTOMOBILE, CAT $\leftrightarrow$ DOG. And for CIFAR-100, all 100 classes will be divided into 20 super-classes, and then labels in every class will be flipped to the next class with the same super-class. +- Pairflip noise: generated by flipping labels in each class to its adjacent class for $\epsilon$ of training data. + +# A.4. Re-dense Training + +Pruning induces sparsity constraints into the objective function optimization problem, which move the optimization to a lower-dimension space. To empirically investigate the impact of sparsity constraints, we present studies which allow pruned + +weights to return to the model, which is motivated by DSD training (Han et al., 2017) and noted as re-dense training in this paper. + +The re-dense training follows the training process of a pruned network after $t$ epochs. During re-dense training, we recover pruned weights in the network, initialized them to zero, and retrain them together with the unpruned weights at the last epoch, for another $t$ epochs with a fixed learning rate. We set the learning rate in re-dense training equal to the last learning rate of sparse training. Other learning hyperparameters (batch size, momentum, weight decay, etc.) are kept the same as original training process. + +# A.5. 1-D Linear Interpolation. + +Visualizing the loss landscape can provide an empirical characterization of the geometry of neural network minimizers (e.g., their sharpness/flatness, or the structures of surrounding parameter space). We present linear interpolation plots of the training loss function along a line segment $\mathbf{w}$ between sparse solutions $\mathbf{w}_s$ and re-dense solutions $\mathbf{w}_r$ , using the strategy proposed by Goodfellow & Vinyals (2015). We define $\mathbf{w}(\alpha) = (1 - \alpha)\mathbf{w}_s + \alpha \mathbf{w}_r$ for $\alpha \in [0,1]$ with increment of 0.01. And we compute the loss and accuracy of model with parameters $\mathbf{w}(\alpha)$ respectively. If there exists a monotonically decreasing loss objective from sparse solutions to re-dense solutions, we may conjecture that sparsity obstructs the optimization process with less trainable parameters. + +# A.6.1-D Loss Visualization + +We also plot 1-D loss function over a center minimizer using filter-wise normalized directions, to visualize the loss curvature and make comparisons between different minimizers. More explanation about this technique can be found in Li et al. (2018). + +# B. Experimental details + +Here, we present the implementation details used in this paper. + +We adopt standard implementations of LeNet-300-100 from OpenLTH. LeNet-300-100 is a fully-connected network with 300 units in the first layer and 100 units in the second hidden layer, and ReLU activations. + +For ResNet-18 network, we utilize a modified version of PyTorch model. To adapt ResNet-18 for CIFAR-10 and CIFAR-100, the first convolutional layer is equipped with filter of size $3 \times 3$ and the max-pooling layer that follows has been eliminated. CIFAR-10 and CIFAR-100 are augmented with per-channel normalization, randomly horizontal flipping, and randomly shifting by up to four pixels in any direction. And for VGG-16 network, we follow the settings from OpenLTH. + +The ResNet-101 network for Tiny ImageNet is modified in the same way as the ResNet-18 network. Training instances in Tiny ImageNet are augmented with per-channel normalization, randomly cropping and resizing to a size of $32 \times 32$ , and randomly horizontal flipping. + +In pruning experiments, for LeNet-300-100, we consider all weights from linear layers except for the last layer as prunable parameters; for ResNets, all weights from convolutional and linear layers are set as prunable; while for VGG-16, we prune convolutional weights. We do not prune biases nor the batch normalization parameters. For convolutional and linear layers, the weights are initialized with Kaiming normal strategy and biases are initialized to be zero. Note that, all these settings are adopted from prior work Frankle & Carbin (2019) and never particularly tuned for the sake of fairness. + +We run all the MNIST and CIFAR experiments on single GPU and Tiny ImageNet experiments on four GPUs with CUDA 10.1. The training hyperparameters used in our experiments is given as follows. Our code is available in https://github.com/hezheug/sparse-double-descent. + +
NetworkDatasetEpochsBatchOpt.Mom.LRLR DropDrop FactorWeight DecayRewind IterLR(finetune)LR(re-dense)
LeNet-300-100MNIST200128SGD—0.1———00.10.1
ResNet-18CIFAR-10160128SGD0.90.180, 1200.11e-410000.0010.001
ResNet-18CIFAR-100160128SGD0.90.180, 1200.11e-410000.0010.001
VGG-16CIFAR-10160128SGD0.90.180, 1200.11e-420000.0010.001
VGG-16CIFAR-100160128SGD0.90.180, 1200.11e-420000.0010.001
ResNet-101Tiny ImageNet200512SGD0.90.2100, 1500.11e-41000——
+ +# C. Additional experiment results and discussion + +Here, we will present additional results that are not included in the main body for page limit. + +# C.1. Sparse double descent phenomenon + +![](images/e89fcba50533c53589a229317601af0bab9e0716b4978038a8a95d51f5183d3d.jpg) +Figure 13. Sparse Double descend phenomenon with different pruning strategies for LeNet-300-100 on MNIST with symmetric label noise, $\epsilon = 20\%$ . Left: Magnitude-based pruning. Middle: Gradient-based pruning. Right: Random pruning. + +![](images/3fa502c67ddf2780476e0e7936a6c189074237135828ea2954f9d0ef6e9f4654.jpg) + +![](images/7d46b88f346b4df381c358524fac64b46bc6e1d2eac1cf69a28cb06e4aff2069.jpg) + +![](images/e7cd09135b27a48e383be889bdbf2a57f7d18a63821b3c956ce6766f7d06ae97.jpg) +Figure 14. Sparse Double descend phenomenon with different pruning strategies for LeNet-300-100 on MNIST with symmetric label noise, $\epsilon = 40\%$ . Left: Magnitude-based pruning. Middle: Gradient-based pruning. Right: Random pruning. + +![](images/ee3e14dfbab0f48552cbff555846c7bbc70bdc56a29d14954419de0342f32294.jpg) + +![](images/dafed70d6dc48121d83a50c5618cc12c4dffa7d1bcb80c1c748c64d7c0415b89.jpg) + +![](images/b223d013b8ea524b57d377dcea768359f69fed2c81385193381189fbebec9e19.jpg) +Figure 15. Sparse Double descend phenomenon with different retraining methods for LeNet-300-100 on MNIST with symmetric label noise, $\epsilon = 20\%$ . Left: Finetuning. Middle: Learning Rate Rewinding. Right: Scratch retraining. + +![](images/902863b13c3e92fc84a5d5ca515d5962b5a6bfe41966575412e25597eb2df44b.jpg) + +![](images/d3bda8baf4a439b5453cd1fa394aae265c4b63ef1d60cf8e954a917024eea6e0.jpg) + +![](images/2b9f784898c7d5247826971824791be2a845dac41703bb09c0fe74ddd7a12998.jpg) +Figure 16. Sparse Double descend phenomenon with different pruning strategies for ResNet-18 on CIFAR-10 with symmetric label noise, $\epsilon = 20\%$ . Left: Magnitude-based pruning. Middle: Gradient-based pruning. Right: Random pruning. + +![](images/becfd13e11d64335826831c8e26c3782e8413d87ca1e4247ef46cd6e6443b3cc.jpg) + +![](images/15a602795db33b23de8fa73c1b6f3ec37665c6e33e3dec533d510251e6cd19b1.jpg) + +![](images/b1aa3817228216c5c793ecb3d1f7616a470a101c73022021b4fe5c608dee8477.jpg) +Figure 17. Sparse Double descend phenomenon with different pruning strategies for ResNet-18 on CIFAR-10 with symmetric label noise, $\epsilon = 40\%$ . Left: Magnitude-based pruning. Middle: Gradient-based pruning. Right: Random pruning. + +![](images/ce548ca8dd64ba03eef7cb54280e81e8f7a78c73c0a4c0a7e0f4a8762a0f5e86.jpg) + +![](images/5635b21608c9e968c4e1f4a42d8b7e5f9b0950fa66c45747c3fa347001f76f68.jpg) + +![](images/6c4a7fc2427984ad8807f8906cc9e1a5c95ec0ddbeca354103c0396c5ec37eb8.jpg) +Figure 18. Sparse Double descend phenomenon with different pruning strategies for ResNet-18 on CIFAR-10 with symmetric label noise, $\epsilon = 80\%$ . Left: Magnitude-based pruning. Middle: Gradient-based pruning. Right: Random pruning. + +![](images/f03d4f54f4d8c218f91e680140fd85dedae4d2a96e0fb01a745113db632f6275.jpg) + +![](images/629ff322eee5072d236adad61d3a0d320d17ee372e79efbbaddad044fdcfa0db.jpg) + +![](images/c251bc6d1632d52b4b80fefbce3c87f17353be6ab7fb41967e952eed91f47ea7.jpg) +Figure 19. Sparse Double descend phenomenon with different retraining methods for ResNet-18 on CIFFAR-10 with symmetric label noise, $\epsilon = 20\%$ . Left: Finetuning. Middle: Learning Rate Rewinding. Right: Scratch retraining. + +![](images/00cd7270442d7602ff9ddd53df86c9f6c831aca56823ea93a2698112e67a4a9f.jpg) + +![](images/6620d29891338178ba165362d806157e698763c7b77a583f683b321fdd994367.jpg) + +![](images/9c38ab91724f8b5f717737ecfdfe05ace34c0210701824e29a84f83b17571a5f.jpg) +Figure 20. Sparse Double descend phenomenon with different pruning strategies for VGG-16 on CIFAR-10 with symmetric label noise, $\epsilon = 20\%$ . Left: Magnitude-based pruning. Middle: Gradient-based pruning. Right: Random pruning. + +![](images/81ccec1506251a87ac8956263869b8da7d3697fe525359f3b47ef9409c7d3621.jpg) + +![](images/18e0265872f38493d1f7e1e4fc896ae7b22b539ad57a119dae603e16b506fac3.jpg) + +![](images/93e43cef2e1c6e9ae54540b9fcaffa2e775c01ce68d35b2766c57ccc076a06f1.jpg) +Figure 21. Sparse Double descend phenomenon with different pruning strategies for ResNet-18 on CIFAR-10 with asymmetric label noise, $\epsilon = 20\%$ . Left: Magnitude-based pruning. Middle: Gradient-based pruning. Right: Random pruning. + +![](images/6e0efec0b2a7dfa9c6bbae6fb144d9776cc57e6f5b9f3204cc41ad331e394e96.jpg) + +![](images/7fe3ea7cf608ed7ba1ea5e750d4416a18c3ca7b73a7bdd68553d2d48273dbd9a.jpg) + +![](images/4dc7edb15cbbba2af020776810c5f59d3c507c81790d8999bbd7d56201752fb5.jpg) +Figure 22. Sparse Double descend phenomenon with different pruning strategies for ResNet-18 on CIFAR-10 with pairflip label noise, $\epsilon = 20\%$ . Left: Magnitude-based pruning. Middle: Gradient-based pruning. Right: Random pruning. + +![](images/1bf942f965b12d0462b11e9c8106066622eff0b436b4ac17d819c3c5b174136b.jpg) + +![](images/f04df146b565907157522869954868128425053866664258ccd8755f56ccfb05.jpg) + +![](images/5a18203e4fafcefe780a353259e127bbc8d220db3ba19b35084815304d608907.jpg) +Figure 23. Sparse Double descend phenomenon with different pruning strategies for ResNet-18 on CIFAR-100 with symmetric label noise, $\epsilon = 20\%$ . Left: Magnitude-based pruning. Middle: Gradient-based pruning. Right: Random pruning. + +![](images/ac91383d79680bfd6108b2da3ccb9a4927ec7720d76ee8c17b0a721f4a858bac.jpg) + +![](images/e2c3f417358ad7335f0382a5ce936d14aa573f59b6124d6407f6bf576e916449.jpg) + +![](images/2b386d2f7a8d5673038b0b558b88886a0bc139858a3180381290696a17b4eda7.jpg) +Figure 24. Sparse Double descend phenomenon with different pruning strategies for ResNet-18 on CIFAR-100 with symmetric label noise, $\epsilon = 40\%$ . Left: Magnitude-based pruning. Middle: Gradient-based pruning. Right: Random pruning. + +![](images/494b57404a935ed0d112c87253f3099da9ea306886726b867df6eeb8ca89278a.jpg) + +![](images/0b719e69d89b5a3dcfd0ac2c1328cbfda0beece5ce9230f8d492247f0e60c27c.jpg) + +![](images/57ea770d0cfd17494d8195e1c5a2db8c80f25bb07ab74704d79bd36172c63fa6.jpg) +Figure 25. Sparse Double descend phenomenon with different pruning strategies for ResNet-18 on CIFAR-100 with symmetric label noise, $\epsilon = 80\%$ . Left: Magnitude-based pruning. Middle: Gradient-based pruning. Right: Random pruning. + +![](images/81617ba5e776cf730019abb2affaa57cafa6aba97a7ce5df3276c17c459850fb.jpg) + +![](images/7acb2fcd6103a38218e3def43597e1ad6742d7b91b8dbbf76f1c2f213533630e.jpg) + +![](images/052ff9d7250f1373ae98cd5223cfde3df2a4b3c3d8607e1c8bc67caef9370177.jpg) +Figure 26. Sparse Double descend phenomenon with different retraining methods for ResNet-18 on CIFAR-100 with symmetric label noise, $\epsilon = 40\%$ . Left: Finetuning. Middle: Learning Rate Rewinding. Right: Scratch retraining. + +![](images/be4381098ba9dbcfd578f5eeb484c77df2d728821ef6adffeb472cb2de20be63.jpg) + +![](images/c262b6ef91e2fc57286399a340e61ea7ebd59921df938b7de1cb9f66d781a7ac.jpg) + +![](images/857877edf898945a9c9bd911b2ebf9411714e5b740df4eebb1e2ea6ac2f4a9ff.jpg) +Figure 27. Sparse Double descend phenomenon with different pruning strategies for VGG-16 on CIFAR-100 with symmetric label noise, $\epsilon = 40\%$ . Left: Magnitude-based pruning. Middle: Gradient-based pruning. Right: Random pruning. + +![](images/04a172dbc9803e5ed618ee2cda9ae81eaa9b79c090a81467e0138e78ac0f9f95.jpg) + +![](images/2fb01dc0bd47ee04b7e10b6892f9a48a17b1681f13bd3e8e7510f4f23230dddb.jpg) + +![](images/eea22460de112ad7fa0af42bc61d30bf863616410944307ebe82498bb3411195.jpg) +Figure 28. Sparse Double descend phenomenon with different pruning strategies for ResNet-18 on CIFAR-100 with asymmetric label noise, $\epsilon = 40\%$ . Left: Magnitude-based pruning. Middle: Gradient-based pruning. Right: Random pruning. + +![](images/d23cb0a361b6b7372bda68206d6e52e190095b031061c37b5eac4d8fdfd41f44.jpg) + +![](images/36f8bfd80a8f5fe26a304aae4e6833de7967040df16df0c4775a1341c1105dec.jpg) + +![](images/75ec50fbed0c1d84744f2ffabbd613c56d13c0cd32d046d5287db54ba549f755.jpg) +Figure 29. Sparse Double descend phenomenon with different pruning strategies for ResNet-18 on CIFAR-100 with pairflip label noise, $\epsilon = 40\%$ . Left: Magnitude-based pruning. Middle: Gradient-based pruning. Right: Random pruning. + +![](images/434ddf0be2a668e66b126fd22762b5134ad3f20632d2f9e67374f030c4e0d883.jpg) + +![](images/4bdc93aa2a15f3aff9217a69538fedc3719fa1cce43f239da7fef98508f84b9d.jpg) + +![](images/c56be25ac06d95b2c68bc0a51a770b3b37e65192d9762edd4f0c7ede34d608df.jpg) +Figure 30. Sparse Double descend phenomenon with magnitude-based pruning for ResNet-101 on Tiny ImageNet with symmetric label noise, $\epsilon = 20\%$ . + +![](images/41b21321f97017a9c622c419643ac9a27b46f6d8d7a2b18b1ab1860efce1f4f5.jpg) +Figure 31. Results of magnitude-based pruning for ResNet-18 on CIFAR with no label noise. Left: CIFAR-10. Right: CIFAR-100. + +![](images/c5ce18a65cde37629f7f1f9e67786658cd04d155e30603dd16caf40ecc7267d4.jpg) + +![](images/d21c64f9b686f7192b2c9788186721fc6bb0a94cf62ae830b68480a2148ceef0.jpg) + +![](images/900960b292ce1706c5150c39d0adaad3393d2ca705ca20996637ae3b89e8bc95.jpg) + +![](images/bb19d19ec2d9503e257ee85345ecf97b79d66e06a44a7e495966981b8fa04de4.jpg) + +![](images/0715769c60a2f32c3edaa12fb66b09601572ce8edbba4af30d400aa01bce97d2.jpg) +Figure 32. Sparse Double Descent of LeNet-300-100 on MNIST and ResNet-18 on CIFAR with $20\%$ symmetric label noise, pruned with magnitude-based pruning, and retrained with LTR. We show how the generalization performance of networks depends on model sparsity, where generalization gap equals test error - train error. Left: MNIST. Middle: CIFAR-10. Right: CIFAR-100. + +![](images/139c7edb78f960757ee4c89a6ed3cb83eeca3eaa2f593d2b24e6a75229e55b52.jpg) + +![](images/4203c3edec82d0ca4df712992f37010aec6052365f124c31550827888695b834.jpg) + +# C.2. Comparison between Lottery Tickets and Random Initializations + +Here we compare the performance of lottery tickets and random initializations. Models at the same sparsity share the same mask structure. + +![](images/dea547b51c17fb2b511d0de200cd041b087dae26e85ff77ce119b6d634300b12.jpg) +Figure 33. Performance of ResNet-18 on CIFAR-10 when retrained from either the original initialization (lottery tickets), or a random reinitialization. Left: $\epsilon = 20\%$ . Middle: $\epsilon = 40\%$ . Right: $\epsilon = 80\%$ . + +![](images/64692ab4a483c41d85fd2387b44ea53ac14a1ab7de1385e9d2c0673dde5ec229.jpg) + +![](images/94021e8cf5e4482e1b32b834d4d00937b21e62c15492dd2a1fdb00bb6eef959c.jpg) + +![](images/dab66b5db7b8c30fb0c57b40e0784e17c3b224b14c3c8b285e432f062296d8e5.jpg) +Figure 34. Performance of ResNet-18 on CIFAR-100 when retrained from either the original initialization (lottery tickets), or a random reinitialization. Left: $\epsilon = 20\%$ . Middle: $\epsilon = 40\%$ . Right: $\epsilon = 80\%$ . + +![](images/e119d1016ee02bd7634523d731b5ea6cf3704dcc7c12076f980877048438ce43.jpg) + +![](images/3d98301f309afe44c80b40fb3d8dd6d505504e4ea7790d5027cbac631d1bbf08.jpg) + +# C.3. Training Dynamics of Sparse Models + +![](images/d402c428468b838938d9f3f747d7f4ed7ec64e7af3bfb9ae2b50df4d94b24467.jpg) +Figure 35. Training dynamics w.r.t. epochs at four sparsities across different permuted fractions. Models are LeNet-300-100 for MNIST pruned with magnitude-based strategy. Left: $\epsilon = 20\%$ . Right: $\epsilon = 40\%$ . + +![](images/627f5cb4606901ab9059eb9f7b69685e5cf95bb7b51a9fefadd94991c3bd6f43.jpg) + +![](images/b0cc58873e9ea477d7a35873c12c2bff834c06ec1dd60d3f52b1683bfcb99654.jpg) + +![](images/6dfb305c314ca72ca0a312b3cac32212a46dd46960365cadbc2c1308d3fa59c8.jpg) + +![](images/7976849b72bf2f459477f0e3a73cf0e006c9d7ea2d4b7e75c62ad8a0acb9c38a.jpg) + +![](images/265fb93abaf00300294d7831fbb03fd206e3d16b663d9ac1d54d5ffaeb6639e9.jpg) + +![](images/cceb1da2fc31230c14a0ebb4ce1ab6526a03212d1b448947d469982104e70ef3.jpg) + +![](images/06996cb6c0b76a54d71570d5a710724944739bc9bb026ef3d7106f306c26894f.jpg) + +![](images/75755acea316ae0e354a6919f44dc1f8de1c99e15fdb934bd2614f3409f36d56.jpg) + +![](images/09d5532d7f42753b9c88f937c01b73d9cd319a1087eb1b4bc9c98224a1da9927.jpg) + +![](images/1abd2c8a14f6d2275e9807597580b4948085633d6412c873114bc77dc96ee1db.jpg) + +![](images/b4639bf6e5f74c0e14873a2dcbc5ac7c9f0f8e8737d895c3e6b35207b91da35e.jpg) + +![](images/6f963bd6ffd1a6c337f4dc246cec51a07b9801bcb89f105271fba94c7b1c91bf.jpg) +(a) CIFAR-10 + +![](images/96bf5f0d7e3ce9e2e3267c559ec26373271f237b03425f0aae6e735b1bc028fd.jpg) +Figure 36. Training dynamics w.r.t. epochs at four sparsities across different permuted fractions. Datasets are CIFAR-10/CIFAR-100 and models are ResNet-18 pruned with magnitude-based strategy. Top: $\epsilon = 20\%$ . Middle: $\epsilon = 40\%$ . Bottom: $\epsilon = 80\%$ . + +![](images/51cae14c967e3f605ec916919fb4b2d5fc304645d2b8541b0f53d3beaef68c4d.jpg) +(b) CIFAR-100 + +![](images/814011e2ad58d3d0446facaf10d3feb801d732a63760eb0e94aa64886246bfc2.jpg) + +# C.4. Re-dense Training Results + +![](images/f316c31ece509421ca89db14445424ef5ea3a82800bf953f68f89433192d14d6.jpg) +Figure 37. Accuracy curve of the sparse and re-dense training process. We recover pruned weights at epoch 200, and training them from value of zero for another 200 epochs using the last learning rate of sparse training, which is 0.1 for MNIST with $\epsilon = 20\%$ , LeNet-300-100. + +![](images/743347a741d7ad95de09c809f9b25b2ef678cf73aea5444adc56ace98002581d.jpg) + +![](images/2697db2f7103e9747676ad5848fd599529ee791f15434a4d886cb1430f788c00.jpg) +Figure 38. Accuracy curve of the sparse and re-dense training process. We recover pruned weights at epoch 160, and training them from value of zero for another 160 epochs using a small learning rate of sparse training, which is 0.001 as the last epoch learning rate (the top) and 0.0001 (the bottom) for CIFAR-10 with $\epsilon = 20\%$ , ResNet-18. + +![](images/99b7f20cf4c72d57c5b4c5418c443d7e8e3003cf88b43f0326e7505a440e78de.jpg) + +![](images/3d41d37c37f85b0f3dac135bac9e1b6cf31b11eb5cf2c42da2dcb6692897f4e4.jpg) +Figure 39. Accuracy curve of the sparse and re-dense training process. We recover pruned weights at epoch 160, and training them from value of zero for another 160 epochs using a small learning rate of sparse training, which is 0.001 as the last epoch learning rate (the top) and 0.0001 (the bottom) for CIFAR-100 with $\epsilon = 40\%$ , ResNet-18. + +# C.5. Linear Interpolation Results + +![](images/aed2e23ff545adc0f73852ccc8429450ecd4e347efaa2acefa7b5be84916344a.jpg) +(a) Critical Phase +Figure 40. Linear interpolation plots. Models are LeNet-300-100 on MNIST with $\epsilon = 20\%$ . $\alpha = 0$ corresponds to sparse solutions and $\alpha = 1$ corresponds to the re-dense solutions. The blue lines are loss curves and the red lines are accuracy curves; solid lines indicate training data set and dashed lines indicate testing data set. For re-dense models, sparsity is measured before recovering weights. + +![](images/b40a268e710df0ca2c19ed89a875c422a75d5547d46e8f0c9e6e9fda523f783f.jpg) +(b) Sweet Phase + +![](images/0560c8f3e25fa96214f3ee6ac6bb75fa81cbb9095eb494c5b6fa23fcb91f9e17.jpg) +(a) Critical Phase + +![](images/798d2ae94139353f3dda5cc40e1a470dfa27d44853eb896fef80d62a7205af9e.jpg) +(b) Sweet Phase +Figure 41. Linear interpolation plots. Models are ResNet-18 on CIFAR-10 with $\epsilon = 20\%$ . $\alpha = 0$ corresponds to sparse solutions and $\alpha = 1$ corresponds to the re-dense solutions. The blue lines are loss curves and the red lines are accuracy curves; solid lines indicate training data set and dashed lines indicate testing data set. For re-dense models, sparsity is measured before recovering weights. + +![](images/7c012732590cafcfd747116d7f6d88fd08cb3662c2d988cdce636a5819ce1f85.jpg) +(a) Critical Phase + +![](images/d09f9efa628f194d659f99c8be69837e7230ab7796009ae367619995a030aea1.jpg) +(b) Sweet Phase +Figure 42. Linear interpolation plots. Models are ResNet-18 on CIFAR-100 with $\epsilon = 40\%$ . $\alpha = 0$ corresponds to sparse solutions and $\alpha = 1$ corresponds to the re-dense solutions. The blue lines are loss curves and the red lines are accuracy curves; solid lines indicate training data set and dashed lines indicate testing data set. For re-dense models, sparsity is measured before recovering weights. + +# C.6. 1-D Visualization of Re-dense Solutions + +![](images/2d15567a93ccff41f30a9a2905387573baf005e75240aeeb628b361df07489a9.jpg) +Figure 43. The 1-D loss visualization of minima found by re-dense training using filter normalization (Li et al., 2018). The sparsity of particular model is measured before the re-dense step. The sparser the original pruned network is, the sharper minima it might converge to after re-dense training. Left: ResNet-18 on CIFAR-10 with $\epsilon = 20\%$ . Right: ResNet-18 on CIFAR-100 with $\epsilon = 40\%$ . + +![](images/39658079717fc9d3c2a4ffe2a137df596d1f7d6fdcec457c6c40fe3518b5dc85.jpg) + +# C.7. Learning Distance Results + +![](images/5ba4f06992ddc0edab549a62f50c7d3980061dcd60328dfa90c981ea684476b7.jpg) +Figure 44. Learning distance for LeNet-300-100 on MNIST. The blue lines refer to $\ell_2$ learning distance and the red lines are test accuracy. Left: $\epsilon = 20\%$ . Middle: $\epsilon = 40\%$ . Right: $\epsilon = 80\%$ . + +![](images/3ab50f3184e646af6b9656eea6f32e26dd1a3d0874cebfa6c647fa09e4fb258a.jpg) + +![](images/a8cf64225bc26fefbeba5bdd18c50b15be9b02084d079147d1940ea8317bf04b.jpg) + +![](images/8b43d9b960969c535f5d8f600e8cbea38c463ffacb4024d3b21cd8485ea79e59.jpg) +Figure 45. Learning distance for LeNet-300-100 on MNIST with $\epsilon = 20\%$ . The blue lines refer to $\ell_2$ learning distance and the red lines are test accuracy. Left: Retraining using learning rate rewinding. Right: Scratch retraining. + +![](images/f8d5e653eecc24e2d64da16fdd838d48adf291170be5b9951b9c238ecd38ff35.jpg) + +![](images/3c749a953b74b64acba9941572aec5f9548df05cfb486509e5fdc60b0bdde29a.jpg) +Figure 46. Learning distance for ResNet-18 on CIFAR-10. The blue lines refer to $\ell_{2}$ learning distance and the red lines are test accuracy. Left: $\epsilon = 20\%$ . Middle: $\epsilon = 40\%$ . Right: $\epsilon = 80\%$ + +![](images/881bf64d30b88dd39e81b7367bd7aca77c5e99aa1e4d2be2d9f68a47b37902d5.jpg) + +![](images/7b292b4cdb8ca94706e74abd19faca29582ee888a1ade2d15901375e773ad9c1.jpg) + +![](images/9de14b09050145b63a091dbd3554f0cd7dcadebc53918688809a660ea333048b.jpg) +Figure 47. Learning distance for ResNet-18 on CIFAR-10 with different retraining methods. The blue lines refer to $\ell_2$ learning distance and the red lines are test accuracy. Left: Finetuning. Middle: Learning rate rewinding. Right: Scratch retraining. + +![](images/f3543dd13360ff99934f795e5296e4a8b16533d4619a3a9791ba13cae45631aa.jpg) + +![](images/ab26a99f6081d8938f2eba5055ad172532e980f2f79d8cc28afb916a54bbe416.jpg) + +![](images/58a4b3b1e069f9983a6f7daef32304ef607c4c5dd0ce686955d4cd2bcecd4705.jpg) +Figure 48. Learning distance for ResNet-18 on CIFAR-100. The blue lines refer to $\ell_2$ learning distance and the red lines are test accuracy. Left: $\epsilon = 20\%$ . Middle: $\epsilon = 40\%$ . Right: $\epsilon = 80\%$ + +![](images/0d7a463899ff2bc6d31183546491c9d57301c2147329a8538263d2464654c931.jpg) + +![](images/a79bf8fa42d1c53a73cc2fe554093af4b0df29bd85eded3c24e4552cecce960c.jpg) + +![](images/7747439e93f6f42d176cbb7bf4d6a9d1125640181cb5157a6a99d143580e0ad6.jpg) +Figure 49. Learning distance for ResNet-18 on CIFAR-100 with different retraining methods. The blue lines refer to $\ell_2$ learning distance and the red lines are test accuracy. Left: Finetuning. Middle: Learning rate rewinding. Right: Scratch retraining. + +![](images/79368886c6454f7962360eb3689baa25decf42e0ea632e7d18b17c3d24e65703.jpg) + +![](images/845352d10420420de1166c764428329c03e3796675b40c3c90051aa0ea2ea7db.jpg) \ No newline at end of file diff --git a/sparsedoubledescentwherenetworkpruningaggravatesoverfitting/images.zip b/sparsedoubledescentwherenetworkpruningaggravatesoverfitting/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..166ad723e0acf45b8f504f64bb0c0b9d5a89b9cb --- /dev/null +++ b/sparsedoubledescentwherenetworkpruningaggravatesoverfitting/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9e413095f85da0d49817d2f195c17b21a4a09d071e61c382898d3a23dbb92bc4 +size 2639210 diff --git a/sparsedoubledescentwherenetworkpruningaggravatesoverfitting/layout.json b/sparsedoubledescentwherenetworkpruningaggravatesoverfitting/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..cd9c02b26cc0f4e0769c9164f718415166f5fcda --- /dev/null +++ b/sparsedoubledescentwherenetworkpruningaggravatesoverfitting/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:177396c22b5841401db8caf5e11aabaa3f61e87e5bbaae59c382ef1b845be8d1 +size 832700 diff --git a/sparseinvariantriskminimization/9214ee32-3d9c-4c42-952f-4c646b2eb334_content_list.json b/sparseinvariantriskminimization/9214ee32-3d9c-4c42-952f-4c646b2eb334_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..5fb4437c09069f3eed023669ddc4ed23d9c67cd4 --- /dev/null +++ b/sparseinvariantriskminimization/9214ee32-3d9c-4c42-952f-4c646b2eb334_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:af7e0fe40ea2c8b6424f9fdbfdc4e12f32725a91113ca65544c073effd02cdf9 +size 167531 diff --git a/sparseinvariantriskminimization/9214ee32-3d9c-4c42-952f-4c646b2eb334_model.json b/sparseinvariantriskminimization/9214ee32-3d9c-4c42-952f-4c646b2eb334_model.json new file mode 100644 index 0000000000000000000000000000000000000000..cac05f474627b91a7db771f2d7300deb2e902d93 --- /dev/null +++ b/sparseinvariantriskminimization/9214ee32-3d9c-4c42-952f-4c646b2eb334_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c15643b927791f332afadaa2d289566fd6ca8152d5479596210c99b7e9315b6e +size 201660 diff --git a/sparseinvariantriskminimization/9214ee32-3d9c-4c42-952f-4c646b2eb334_origin.pdf b/sparseinvariantriskminimization/9214ee32-3d9c-4c42-952f-4c646b2eb334_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..064bcb8f775da9e0caeb75de845694cf5e8a90cb --- /dev/null +++ b/sparseinvariantriskminimization/9214ee32-3d9c-4c42-952f-4c646b2eb334_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7e533bd0f4f1027d2fbf5dcc053d28d614c10724cec9c6f4bb8a29b510b87747 +size 2078572 diff --git a/sparseinvariantriskminimization/full.md b/sparseinvariantriskminimization/full.md new file mode 100644 index 0000000000000000000000000000000000000000..0cea7300e5389b3bf1b70836d99ee04a02cc1cf2 --- /dev/null +++ b/sparseinvariantriskminimization/full.md @@ -0,0 +1,874 @@ +# Sparse Invariant Risk Minimization + +Xiao Zhou $^{*1}$ Yong Lin $^{*1}$ Weizhong Zhang $^{*1}$ Tong Zhang $^{12}$ + +# Abstract + +Invariant Risk Minimization (IRM) is an emerging invariant feature extracting technique to help generalization with distributional shift. However, we find that there exists a basic and intractable contradiction between the model trainability and generalization ability in IRM. On one hand, recent studies on deep learning theory indicate the importance of large-sized or even overparameterized neural networks to make the model easy to train. On the other hand, unlike empirical risk minimization that can be benefited from overparameterization, our empirical and theoretical analyses show that the generalization ability of IRM is much easier to be demolished by overfitting caused by overparameterization. In this paper, we propose a simple yet effective paradigm named Sparse Invariant Risk Minimization (SparseIRM) to address this contradiction. Our key idea is to employ a global sparsity constraint as a defense to prevent spurious features from leaking in during the whole IRM process. Compared with sparisfy-after-training prototype by prior work which can discard invariant features, the global sparsity constraint limits the budget for feature selection and enforces SparseIRM to select the invariant features. We illustrate the benefit of SparseIRM through a theoretical analysis on a simple linear case. Empirically we demonstrate the power of SparseIRM through various datasets and models and surpass state-of-the-art methods with a gap up to $29\%$ . + +# 1. Introduction + +In the last decade, deep neural networks (DNNs) have achieved unprecedented successes in numerous applications, including but not limited to computer vision (He et al., 2016; + +*Equal contribution 1The Hong Kong University of Science and Technology 2Google Research. Correspondence to: Tong Zhang . + +Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s). + +Krizhevsky et al., 2012; Simonyan & Zisserman, 2015; Sun et al., 2014) and natural language processing (Bahdanau et al., 2014; Luong et al., 2015). Most deep learning models are trained by the Empirical Risk Minimization (ERM) paradigm, under the I.I.D. assumption that the training and testing samples are independently drawn from an identical distribution. However, more and more failure cases of DNNs (Beery et al., 2018; Geirhos et al., 2020; DeGrave et al., 2021; Zhang et al., 2022b) are reported in the latest studies where the I.I.D. assumption is violated in application due to distributional shifts. + +IRM (Arjovsky et al., 2019; Creager et al., 2021; Krueger et al., 2021; Xie et al., 2020; Chang et al., 2020; Zhang et al., 2021c;b; Jin et al., 2020) is an emerging learning paradigm to enable the generalization with distributional shifts. The key idea of IRM is to learn an invariant feature representation on the datasets drawn from multiple environments, in the sense that based on this representation one should be able to learn a common classifier working well in all these environments. Due to the consistent good performance achieved in these existing environments, the generalization in new environments with unseen distributional shifts can be expected, which has been verified by the promising empirical results (Arjovsky et al., 2019; Krueger et al., 2021; Xie et al., 2020; Chang et al., 2020; Jin et al., 2020). However, IRM is found to be less effective when applied to deep models (Gulrajani & Lopez-Paz, 2020; Lin et al., 2021). In this work, we argue that the reason is that there exists a basic and intractable contradiction between the model trainability and generalization ability in the IRM paradigm: + +- On one hand, to make the model easy to train, we should use large-sized or even overparameterized DNNs (Zhang et al., 2021a), i.e., networks with massive neurons. Empirically, it is observed that such DNNs are easy to train, while small-sized ones could easily get stuck at bad local minima, that's why modern DNNs are always overparameterized. Theoretically, recent studies on deep learning theory show that DNNs behave like convex systems and their loss landscapes become smoother when the number of the neurons goes to infinity (Gu et al., 2020; Mei et al., 2018). +- On the other hand, when overparameterized, the gener + +alization ability of IRM is very easy to be demolished by over-fitting because of mistakenly using some spurious features. We theoretically proved that, when overparameterized, unlike that ERM can have good or better generalization (Zhang et al., 2021a), IRM could fail even in a simple linear case. It can be expected that IRM will collapse in more overparameterized deep neural networks because there are much more parameters than a simple linear model. The details can be seen Section 3.2. + +In this paper, we propose a simple yet effective Sparse Invariant Risk Minimization (SparseIRM) paradigm to address contradiction above. Our key idea is to employ a global sparsity constraint as a defense to prevent spurious features from leaking into the submodel we work on during the whole IRM process. Compared with the sparsify-after-training prototype adopted by prior work (Zhang et al., 2021b), which can discard invariant features misled by the undetected spurious features, our paradigm successfully sets up a barrier to spurious and random features with sparsity constraint throughout training, leading to better generalization performance. Specifically, during the training process, because of our sparsity constraint, the subnetwork we work on is too small to include all the spurious and random features, as the number of these features is always significantly larger than invariant features. Therefore, the network has to identify and focus on the invariant features to minimize the loss function. We provide our understanding of this phenomenon through theoretical analysis on a simple linear case (Theorem 1). We validate the superior performance in defending overfitting through various datasets and models, and find that we surpass state-of-the-art methods on various datasets with a gap up to $29\%$ . In addition, we perform ablation studies to verify that our method is indeed effective in removing the spurious features in Section 5.3. + +The contributions and novelties of this work are summarized as follows: + +- We demonstrate that when overparameterized, the generalization ability of IRM is easy to be demolished by overfitting because of mistakenly using some spurious features (see Section 3.2). +- We propose a sparse invariant risk minimization (SparseIRM) method which enforces sparsity constraint during the whole training process and illustrate its benefit through theoretical analysis in a simple linear case.(see Sections 4). +- We demonstrate the superiority of our method in overparameterized settings and show that the improvement over state-of-the-art methods can be up to $29\%$ in accuracy (see Section 5). + +Notations: Let $\| \cdot \| _1$ and $\| \cdot \| _2$ be the $\ell_1$ and $\ell_2$ norm of a real valued vector, respectively. We denote $\mathbf{1}^n /0^n\in \mathbb{R}^n$ to be a vector with all components equal to $1 / 0$ with length $n$ . In addition, $\{0,1\} ^n$ is the set of $n$ -dimensional vectors with each coordinate valued in $\{0,1\}$ . $\pmb{u}\circ \pmb{v}$ denotes the element-wise product between two vectors. + +# 2. Related Work + +# 2.1. Causality and invariance + +IRM (Arjovsky et al., 2019) is proposed to learn the features invariant among different environments based on the invariance priciple first raised in (Peters et al., 2016) which aims to build model on the direct cause of target. Numerous variants have been developed recently in the community. (Ahuja et al., 2020a; Jin et al., 2020) provides new perspectives by introducing game theory and regret minimization into invariant risk minimization. (Krueger et al., 2021; Xie et al., 2020; Chang et al., 2020; Xu & Jaakkola, 2021; Xu et al., 2020; 2022) propose more effective methods motivated by penalizing the variance of losses among environments, estimating the violation of invariance, improving transferability among environments, etc. (Wang et al., 2022) proposes to reweight the training samples based on influence function. (Zhou et al., 2022b) reweights the training samples to improve out-of-domain generalization. (Lin et al., 2022a) shows that IRM suffers from the overfitting problem caused by overparameterized neural networks. There are also some analyses concerning the sufficiency of invariance principle (Ahuja et al., 2021) and the relationship of IRM to out-of-distribution generalization ability based on discrepancy measures (Zhang et al., 2021c). Another line of works try to learn invariant features when explicit environment indices are not provided (Creager et al., 2021; Liu et al., 2021b;a; Lin et al., 2022b; Xu et al., 2021; Zhang et al., 2022a). (Lin et al., 2022b) proposes a mini-max framework based on auxiliary information that can provably infer the environment indexes and learn invariance. + +From the theoretical perspective, (Arjovsky et al., 2019; Rosenfeld et al., 2020; Chen et al., 2021c) investigate IRM's dependence on the environment numbers when the model is linear. (Chen et al., 2021c) proposes to take advantage of the intrinsically low dimensional structure of spurious features to identify the invariant features with logarithmic environments. (Rosenfeld et al., 2020) also studies the performance of IRM when applied to non-linear models. (Kamath et al., 2021) analyzes the success and failure cases of IRM in different scenarios and (Ahuja et al., 2020b) compares the sample complexity of IRM with ERM. In this paper we want to investigate the effectiveness of enforcing sparsity in improving generalization performance of IRM. + +# 2.2. Sparsity in Deep Neural Networks + +In the recent years, sparsity (Han et al., 2016) has been introduced into DNNs to improve the inference efficiency or reduce the model size. The key idea(Han et al., 2016; Kusupati et al., 2020; Yuan et al., 2020b;a; Lym et al., 2019; Zhou et al., 2021b; Zou et al., 2019) is to identify and remove unimportant weights from the neural networks during or after training by developing some proper pruning rules. The most typical rule is based on the weight magnitude and some others are learning based. The empirical results demonstrate that one can reduce the model size and improve the inference efficiency significantly with slight or even negligible loss on performance. This makes it possible to deploy modern DNNs on the devices with limited computational and memory budget. Most of the existing methods are developed for the neural networks trained by ERM in the I.I.D. scenarios. In this work, we will introduce sparsity into the IRM training to boost the generalization performance. + +# 2.3. Overparameterized Deep Neural Networks + +Modern neural networks are always overparameterized (He et al., 2016; Simonyan & Zisserman, 2015), that is, the number of the trainable parameters in them is always significantly larger than the training dataset size. They can be trained easily to fit a random labeling of the training data (Zhang et al., 2021a). However, in the applications of I.I.D. scenario trained with ERM, we repeatedly observed that such networks can always be trained more easily and generalize better than the small-sized networks, which can get stuck in bad local minima. That's why the community is continuing exploring larger-sized networks. Latest theoretical studies (Gu et al., 2020; Mei et al., 2018; Jacot et al., 2021; Kawaguchi et al., 2019) investigated the above phenomenon of overparameterized neural networks and suggested that DNNs behave like convex systems and their loss landscapes become smoother when the number of the neurons goes to infinity, which makes it easy to train and be able to avoid bad local minima. In this paper, we show that unlike in the applications of I.I.D. scenario, overfitting can be a catastrophic problem of overparamertized networks in the applications where distributional shifts occur. + +# 3. Investigating the Effects of Overparameterization on IRM + +In this section, we first present the formulation of IRM and then we investigate the effects of overparameterization on the generalization of IRM. + +# 3.1. Preliminaries + +Consider a set of $E$ environments $\mathcal{E} := \{e_1, e_2, \ldots, e_E\}$ in the sample space $\mathcal{X} \times \mathcal{Y}$ with different joint distribu + +tions $\operatorname{Pr}^e(\boldsymbol{x},\boldsymbol{y})$ , where $e \in \mathcal{E}$ , $\mathcal{X}$ and $\mathcal{Y}$ are the input and target spaces, respectively. Let $\mathcal{E}_{tr} \subset \mathcal{E}$ be the training environments and $\mathcal{D}^e := \left\{(\mathbf{x}_i^e,\mathbf{y}_i^e)\right\}_{i=1}^{n_e}$ be the data set drawn from $e \in \mathcal{E}_{tr}$ with $n_e$ being data set size. Based on these training data sets, the problem is to learn a robust model $f(\cdot;\boldsymbol{w}): \mathcal{X} \to \mathcal{Y}$ , in the sense that it can predict $\boldsymbol{y}$ well when given $\boldsymbol{x}$ for all $e \in \mathcal{E}$ including the unseen environments $\mathcal{E} \setminus \mathcal{E}_{tr}$ , where $\boldsymbol{w}$ is the parameters of $f$ . + +IRM first formulates the predictor $f(\cdot; \boldsymbol{w})$ as a composite function of $g(\cdot; \Phi)$ and $h(\cdot; \boldsymbol{v})$ , i.e., $f(\cdot; \boldsymbol{w}) = h(g(\cdot; \Phi); \boldsymbol{v})$ , where $\boldsymbol{w} = \{\boldsymbol{v}, \Phi\}$ are the trainable parameters. Here, $g(\cdot; \Phi): \mathcal{X} \to \mathcal{H}$ maps $\mathcal{X}$ to the representation space $\mathcal{H}$ to extract invariant features among $\mathcal{E}_{tr}$ . $h(\cdot; \boldsymbol{v}): \mathcal{H} \to \mathcal{Y}$ is the classifier, which is simultaneously optimal for all training environments. Existing IRM methods learn $g(\cdot; \Phi)$ and $h(\cdot; \boldsymbol{v})$ by solving the following minimization problem: + +$$ +\min _ {\boldsymbol {w}} \mathcal {L} (\boldsymbol {w}) := \sum_ {e \in \mathcal {E} _ {t r}} \mathcal {R} ^ {e} (\boldsymbol {w}) + \lambda \mathcal {J} (\boldsymbol {w}), \tag {1} +$$ + +where $\mathcal{R}^e (\pmb {w}) = \frac{1}{n_e}\sum_{i = 1}^{n_e}\ell (f(\mathbf{x}_i^e,\pmb {w}),\mathbf{y}_i^e)$ and $\ell$ is the loss function. $\mathcal{J}(\pmb {w})$ is the regularizer encouraging $f(\cdot ;\pmb {w})$ to be optimal in all $\mathcal{E}_{tr}$ . Different methods can have different $\mathcal{J}(\pmb {w})$ . Two representative IRM methods IRMv1 (Arjovsky et al., 2019) and REx (Krueger et al., 2021) adopt the following two regularizers: + +$$ +\mathcal {J} (\boldsymbol {w}) := \sum_ {e \in \mathcal {E} _ {t r}} \| \nabla_ {\boldsymbol {v}} \mathcal {R} ^ {e} (\boldsymbol {w}) \| _ {2} ^ {2}, \quad \tag {J-IRMv1} +$$ + +$$ +\mathcal {J} (\boldsymbol {w}) := \mathbb {V} \left[ \mathcal {R} ^ {e} (\boldsymbol {w}) \right], \tag {J-REx} +$$ + +where $\mathbb{V}[\mathcal{R}^e (\pmb {w})]$ is the variance of the losses $\mathcal{R}^e (\pmb {w})$ in $\mathcal{E}_{tr}$ . Intuitively, to encourage $f(\cdot ;\pmb {w})$ to be simultaneously optimal, the former enforces the gradients $\nabla_{\pmb{v}}\mathcal{R}^{e}(\pmb {w})$ to be 0, and the later reduces the loss variance to be 0. + +# 3.2. Analysis of Overparamterized IRM in a Linear Case + +In this section, we will show the difficulty of IRM to learn invariant features with a overparameterized linear model. We consider a anti-causal linear data generation procedure similar to (Arjovsky et al., 2019; Ahuja et al., 2020a). We will show IRM can struggle in such a simple linear case, not to mention the case with the overparameterized deep neural networks. Different from existing theoretical analysis on IRM (Arjovsky et al., 2019; Rosenfeld et al., 2020) that assume infinite samples are accessible, we consider the case that the model is with access to limited samples. Further, we consider the existence of huge amount of random features (Gaussian noise) apart from the invariant and spurious features, which is a direct consequence of model overparameterization (Jacot et al., 2018; Sagawa et al., 2020). + +[Settings]. Suppose we have two training environments, i.e., $\mathcal{E}_{tr} = \{e_1,e_2\}$ and denote $\pmb{x}^e$ to be the input feature of + +environment $e \in \mathcal{E}_{tr}$ , which is a concatenation of the invariant feature $\pmb{x}_{inv}^{e} \in \mathbb{R}^{d_{inv}}$ , the spurious $\pmb{x}_{s}^{e} \in \mathbb{R}^{d_{s}}$ and the random feature $\pmb{x}_{r}^{e} \in \mathbb{R}^{d_{r}}$ , i.e., $\pmb{x}^{e} \coloneqq [\pmb{x}_{inv}^{e}, \pmb{x}_{s}^{e}, \pmb{x}_{r}^{e}] \in \mathbb{R}^{d}$ . We consider a anti-causal setting as (Arjovsky et al., 2019; Rosenfeld et al., 2020) (Noticeably, some of our results, e.g., Proposition 1 and Corollary 1, can be immediately extended to more general data generation process). The data is generated as follows: + +$$ +y ^ {e} = \boldsymbol {\gamma} ^ {\top} \boldsymbol {x} _ {i n v} ^ {e} + \epsilon_ {i n v}, +$$ + +$$ +\boldsymbol {x} _ {s} ^ {e} = y ^ {e} \mathbf {1} ^ {\mathbf {s}} + \boldsymbol {\alpha} ^ {e} \circ \boldsymbol {\epsilon} _ {s} +$$ + +$$ +\boldsymbol {x} _ {r} ^ {e} = \boldsymbol {\epsilon} _ {r}, +$$ + +where $e \in \mathcal{E}_{tr}$ , $\epsilon_{inv}, \epsilon_s$ and $\epsilon_r$ are independent random noise that follows sub-Gaussian distributions with zero mean and bounded variance. The label $y^e$ is generated from the invariant feature $\pmb{x}_{inv}^e$ with a fixed vector $\gamma \in \mathbb{R}^{d_{inv}}$ that is invariant in $\forall e \in \mathcal{E}_{tr}$ . The spurious feature $\pmb{x}_s^e$ is generated from $y^e$ by the non-invariant vectors $\alpha^e \in \mathbb{R}^{d_s}$ that depend on the environment $e$ . More detailed setting are placed in appendix due to space limitation. + +We aim to learn a linear model to predict $y$ based on $\pmb{x}$ . To be precise, the predictor $f(\cdot; \pmb{w})$ can be expressed as: + +$$ +f (\boldsymbol {x}; \boldsymbol {w}) = (\Phi \circ \boldsymbol {x}) ^ {\top} \boldsymbol {v} + b, \tag {2} +$$ + +where $\Phi \in \{0,1\}^{d_{inv} + d_s + d_r}$ is a binary vector to perform feature selection. $\pmb{v} \in \mathbb{R}^{d_{inv} + d_s + d_r}$ is the parameter of the linear function on the top of $\Phi$ and $\circ$ stands for the element-wise product operation. We also use $\Phi (\pmb{x})$ and $\Phi \circ \pmb{x}$ interchangeably in this example's analysis when it is clear from the context. Our analysis focuses on IRMv1 as an example, with $\mathcal{R}^e (\pmb{w}) = \frac{1}{n_e}\sum_{i = 1}^{n_e}(y_i^e -(\Phi \circ \pmb{x}_i^e)^\top \pmb{v} - b)^2$ . We denote the $\hat{\mathcal{L}} (\Phi)$ as loss of a given $\Phi$ when $\pmb{v}$ is solved optimally, $\hat{\mathcal{L}} (\Phi) := \min_v\mathcal{L}(\pmb{w})$ . + +The ideal feature selector is $\Phi_{inv} = [\mathbf{1}^{d_{inv}},\mathbf{0}^{d_s + d_r}]$ , merely selecting the invariant feature $x_{inv}$ and discarding spurious features $x_{s}$ and random features $x_{r}$ . IRM learns $\pmb{w}$ by minimizing $\mathcal{L}(\pmb{w})$ , therefore, it can finally find the ideal feature selector $\Phi_{inv}$ if and only if the following condition holds + +$$ +\hat {\mathcal {L}} \left(\Phi_ {i n v}\right) < \hat {\mathcal {L}} (\Phi), \forall \Phi \neq \Phi_ {i n v}. \tag {3} +$$ + +The proposition below shows that the above condition (3) does not hold in the following conditions: + +Proposition 1. (Failure of IRM in Overparameterization Region). If $d_{inv} + d_s + d_r > n_{e_1} + n_{e_2}$ , then + +$$ +\hat {\mathcal {L}} \left(\Phi_ {a l l}\right) = 0 \leq \hat {\mathcal {L}} \left(\Phi_ {i n v}\right), \tag {4} +$$ + +where $\Phi_{all} = 1^{d_{inv} + d_s + d_r}$ + +Proposition 1 demonstrates that $\Phi_{all}$ that includes all the spurious and noisy features achieves smaller or equal loss + +than $\Phi_{inv}$ , which implies that IRM can not identify the invariant features. Notably, Proposition 1 does not impose any constraint on the structure of environments, which further indicates that whatever structure of environments (Arjovsky et al., 2019; Rosenfeld et al., 2020) can not rescue IRM as long as overparametrization occurs. + +The following corollary demonstrates that significant overparameterization can completely demolish the generalization of IRM. + +Corollary 1. (Worse Case) If $d_{s} + d_{r} > n_{e_{1}} + n_{e_{2}}$ , then + +$$ +\hat {\mathcal {L}} \left(\Phi_ {a l l}\right) = \hat {\mathcal {L}} \left(\Phi_ {s r}\right) = 0 \leq \hat {\mathcal {L}} \left(\Phi_ {i n v}\right) \tag {5} +$$ + +where $\Phi_{sr} = [\mathbf{0}^{d_{inv}},\mathbf{1}^{d_s + d_r}]$ + +Corollary 1 shows that if the model is significantly overparameterized, e.g., we have massive bad (spurious or random) features such that $d_{s} + d_{r} > n_{e_{1}} + n_{e_{2}}$ , then the objective function $\hat{\mathcal{L}}(\boldsymbol{w})$ can be reduced to 0 when predictor $f(\cdot, \boldsymbol{w})$ purely relies on the spurious and random features. This means that a totally wrong model could be learned. + +[Empirical Verification]. Figure 1 presents the training and testing accuracy of ERM, IRM (i.e., IRMv1) and Oracle (ERM trained on datasets without spurious features) on ColoredMNIST. We can see that as the hidden dimension increases, the training and testing accuracy of ERM and Oracle increases steadily. However, the testing accuracy of IRM decreases while its training accuracy increases. This verifies that IRM is indeed much easier to be demolished by overfitting originated from overparameterization. + +![](images/1055a6a23d747e276d3f542bb0b185ce1ecd4c8b545db598a4595decd0268d74.jpg) +Figure 1. The overparametrization effects on IRM. The performance of IRM drops as the model sizes become larger after hidden dimension is larger than 160. + +![](images/fc1dbd3ad17ceed62736b8031e7db98fec167c7badd7cc9a2b8dab3464bef2e9.jpg) + +![](images/ae6864cb3d16b31ca612800e96eae192df68dfed285e891273aeb97c815275a7.jpg) + +# 4. Sparse Invariant Risk Minimization + +Below, we present our SparseIRM framework and give its theoretical properties to show its superiority. + +# 4.1. SparseIRM Framework + +Sparsity is a natural idea to promote generalization ability. The previous work (Zhang et al., 2021b) applied lottery + +![](images/e043a4925b3919d69e51a3eb6089cd9fe6b9cf4206811495572b7ffdfdbfbf0b.jpg) +Figure 2. The flow charts of SparseIRM (top line) and the sparsify-after-training method MRM (Zhang et al., 2021b) (bottom line). The block filled with grey indicates the selected feature and the unfilled block indicates the unselected feature. Because the subnetwork we work on is too small to include all the spurious and random features due to sparsity constraint, SparseIRM is enforced to select the invariant features to minimize the loss function. MRM first performs dense training and little invariant features selected, making it difficult to recall invariant features back into the subnetwork. + +ticket hypothesis on IRM and preliminarily verified the success of pruning-after-training in improving the generalization ability of IRM in some cases, while earlier discussions in Proposition 1 stresses the catastrophic pitfalls under the overparameterized settings. That is, $\Phi = [\mathbf{0}^{d_{inv}},\mathbf{1}^{d_s + d_r}]$ after fully trained. In this scenario, the pruning methods (e.g., weight magnitude based rules (Han et al., 2016)) would discard the component $\mathbf{0}^{d_{inv}}$ in $\Phi$ permanently and will continually work on the model consisting of only spurious or random features, which is illustrated in the bottom line of Fig 2. Finding lottery tickets over such structure will only lead to failure in achieving any performance boost in generalization. + +To avoid such catastrophic pitfalls, we promote our SparseIRM framework. Its key idea is to employ a sparsity constraint during the whole training process as a defense to prevent the spurious and random features from leaking into the subnetwork we work on. That is, in our framework, we concurrently perform invariant risk minimization and sparse training at the same time (Fig 2). Intuitively, during the training process, because of the sparsity constraint, the subnetwork we work on is too small to include all the spurious and random features, as the number of these features is always significantly larger than invariant features. Therefore, to achieve smaller loss, the network has to identify and focus on the invariant features. We adopt the latest state-of-the-art sparse training method to solve our sparse invariant risk minimization problem. In fact, our SparseIRM framework can be integrated with most sparse training methods flexibly, and the specific choice is not the main contribution of this work. + +To be precise, we first formulate our sparse invariant risk + +minimization problem as follows: + +$$ +\min _ {\boldsymbol {w}, \boldsymbol {m}} \mathcal {L} (\{\boldsymbol {v}, \boldsymbol {m} \circ \Phi \}) \tag {6} +$$ + +$$ +s. t. \boldsymbol {w} \in \mathbb {R} ^ {d _ {w}}, \boldsymbol {m} \in \{0, 1 \} ^ {d _ {\Phi}}, \| \boldsymbol {m} \| _ {1} \leq K, +$$ + +where we associate each $\Phi_i$ with a binary mask $m_i$ , $K$ is used to control the total model size. $d_w$ and $d_{\Phi}$ are the dimensions of $\mathbf{w}$ and $\Phi$ , respectively. Due to the discrete nature of variable $\mathbf{m}$ , the problem (6) is hard to solve. Following (Zhou et al., 2021b), by reparameterizing $m_i$ to be an independent Bernoulli random variables with $s_i$ to be 1 and $1 - s_i$ to be 0, problem (6) can be relaxed into: + +$$ +\min _ {\boldsymbol {w}, \boldsymbol {s}} \mathbb {E} _ {p (\boldsymbol {m} | \boldsymbol {s})} \mathcal {L} \left(\left\{\boldsymbol {v}, \boldsymbol {m} \circ \Phi \right\}\right) \tag {7} +$$ + +$$ +s. t. \boldsymbol {w} \in \mathbb {R} ^ {d _ {w}}, \boldsymbol {s} \in \mathcal {S} := \left\{\boldsymbol {s} \in [ 0, 1 ] ^ {d _ {\Phi}}: \mathbf {1} ^ {\top} \boldsymbol {s} \leq K \right\}. +$$ + +We adopt the projected SGD with Gumbel-Softmax (Zhou et al., 2021b) to solve this minimization problem. Detailed algorithm description is placed in the appendix due to space limitation. + +# 4.2. Understanding the Benefits of SparseIRM through Theoretical Analysis + +In this section, we present our understanding on the working mechanism of SparseIRM in the same linear model in Section 3.2. We first impose a sparsity constraint on the problem: + +$$ +\min _ {\boldsymbol {v}, \Phi} \mathcal {L} (\{\boldsymbol {v}, \Phi \}) \tag {8} +$$ + +$$ +s. t. \boldsymbol {v} \in \mathbb {R} ^ {d _ {v}}, \Phi \in \{0, 1 \} ^ {d _ {\Phi}}, \| \Phi \| _ {1} \leq K. +$$ + +In fact, the problem above is exactly a specific instance of problem (6). The detailed reason can be found in the appendix. + +For problem (8), we have the following theorem: + +![](images/492f3f789469b39dbf8b99dd3a2a8ac2d716e5c56342df27dcb75a1aab305942.jpg) + +![](images/04e0465ab31df0907d89d10dfb13409a7c5fbc36d9c4ac2b2ab41b40568a1b89.jpg) + +Figure 3. Comparison of MLP on MNIST and MNISTFull with varying hidden dimensions and dataset sizes. The first row indicates comparisons on IRMv1 (Arjovsky et al., 2019) and the second row indicates comparisons on REx (Krueger et al., 2021). SparseIRM successfully deals with the serious overfitting problem in IRM and MRM, leading to a gap of up to $40\%$ . +![](images/24a3abd8951571734e705ec89d20e917bc0bfc4100944586cd37556971fbcdc1.jpg) +- - SparseIRM + +![](images/b041beb9eed794d6edd70baaaa8d32a5e846cac594451be3147bffc422b8c396.jpg) +→MRM + +![](images/bbf10443a944a4f9e9b4347f8c290dc6eccf829fd95fc73849c6c3c8dd188e2b.jpg) + +![](images/660d92ecdb0bc289e7082428c6e8c2c667fd76e4aea03428c5d67e9872907ff8.jpg) + +![](images/e62a0a6ccc1d8ebbc1196b9cd7a41bf8f52f0130ce0aa6b04269d9c4a5c5b50b.jpg) + +![](images/0e11e207f7b34f155ace4a0200cdcbb67f501fa7eb9564c57b4a27091d79d850.jpg) +IRM + +Theorem 1. Under assumptions specified in Appendix B.6.2, assume $n_{e_1} = n_{e_1} = n$ , if $n > Q_1 + Q_2\ln (d / \delta)$ and choosing $K = d_{inv}$ , then with probability at least $1 - \delta$ the following inequality holds: + +$$ +\hat {\mathcal {L}} \left(\Phi_ {i n v}\right) < \hat {\mathcal {L}} (\Phi), \forall \Phi \neq \Phi_ {i n v} a n d \| \Phi \| _ {1} \leq K, \tag {9} +$$ + +where $Q_{1}$ and $Q_{2}$ are constants specified in the appendix. + +Theorem 1 indicates that in the linear case, SparseIRM can provably find the invariant features as long as the number of the data samples is larger than a logarithmic term of spurious and random features. The intuition behind Theorem 1 is that, the sparsity constraint limits the number of features to be selected, in which way any combinations of spurious or random features not exceeding the constraint will only lead to a larger loss. In this way, only a feature mask with focus only on invariant features will lead to the minimal loss. + +We would like to point out that although in Theorem 1 we choose $K$ as $d_{inv}$ , we find that our algorithm is not sensitive to $K$ in the empirical evaluation. + +# 5. Experiment + +In this section, we conduct a series of experiments on benchmarks which are widely-used in latest studies (Arjovsky et al., 2019; Ahmed et al., 2020) to justify the superiority of our SparseIRM. We divide the experiments into three parts. In part one, we conduct detailed experiments on multi-layer-perceptrons (MLP) with varied hidden dimensions on two + +datasets ColoredMNIST (Arjovsky et al., 2019) and Full-ColoredMNIST (Ahmed et al., 2020) with varying dataset sizes. In part two, we conduct more overparameterized experiments on large-sized model ResNet-18 (He et al., 2016) on CIFARMNIST and ColoredObject datasets. In part three, we conduct ablation studies to verify the effectiveness of SparseIRM in removing spurious features. Detailed experimental configurations are placed in appendix due to space limitation. + +Table 1. Illustration of each dataset. C/FCMNIST stands for ColoredMNIST and FullColoredMNIST. Invariant and Spurious stand for the invariant and spurious features, respectively. The spurious features have strong correlations with the labels, as shown in Training samples. The correlations are reversed in the Testing samples to simulate the distributional shift. + +
DatasetInvariantSpuriousTrainingTesting
C/FCMNISTDigitColor1010
ColoredObjectObjectBackground
CIFARMNISTCIFARMNIST11
+ +The datasets and experimental settings adopted in our experiments align with common practice in previous works on IRM (Arjovsky et al., 2019; Krueger et al., 2021). In all the four datasets, the labels are generated from the invariant features. The spurious features have strong correlations with the labels in the training set but the correlation reverses + +Table 2. Comparison of MLP on ColoredMNIST50000 and FullColoredMNIST50000 with varying hidden dimensions. + +
DatasetColoredMNIST50000FullColoredMNIST50000
Dim6416025639051264064160256390512640
Oracle72.6272.9473.0073.0174.1774.5276.3876.6176.1275.8075.6475.72
ERM14.8720.1621.2722.4422.8522.5725.2526.2727.5027.6727.9328.10
SparseERM15.0320.2222.5123.4222.9723.5126.5928.9229.1528.7128.4330.11
IRMV1IRM59.8068.5066.0963.2461.8660.2156.3663.3664.9760.6259.7557.51
MRM62.0268.3368.9369.2269.6569.3262.564.6965.4962.2359.4755.91
SparseIRM63.4969.9571.0672.4873.1073.6165.0667.3068.2468.8869.2069.47
RExIRM58.3868.7569.4668.8462.3859.1146.0855.5960.2262.8364.1860.96
MRM63.5969.1970.1970.1969.8568.3453.4459.3366.7767.0866.5361.79
SparseIRM63.6069.7870.8771.0971.4071.8463.5071.2671.5471.6172.3772.83
+ +in the testing set. In each dataset there exist two training environments and one testing environment with different correlations. We combine the correlations of two training environments and one testing environment into a tuple. Label noise is added to the datasets to make the task more challenging (Arjovsky et al., 2019; Zhang et al., 2021b). + +To demonstrate the superiority of our SparseIRM method, we compare with standard empirical risk minimization (ERM), sparse empirical risk minimization without IRM loss penalty (SparseERM), two classic invariant risk minimization methods IRMv1 (Arjovsky et al., 2019) and REx (Krueger et al., 2021), the sparsify-after-training method MRM (Zhang et al., 2021b) and state-of-the-art method BayesianIRM (Lin et al., 2022a) which introduces Bayesian Inference into IRM. We include ERM trained on datasets without spurious features to serve as an upper bound (Oracle). + +# 5.1. MLP on ColoredMNIST/FullColoredMNIST + +The MLP consists of three hidden layers and the details of the structure is given in appendix. The hidden dimensions vary in the range [64, 640] and training dataset sizes vary in $\{20000, 50000\}$ . We add a number to the end of the dataset name to indicate the training set size. Intuitively, the larger hidden dimensions and smaller training set sizes, the more overparameterized the setting is. Table 2 and Figure 3 presents the Top-1 testing accuracy of Oracle, ERM, SparseERM, IRM, MRM and SparseIRM with varying hidden dimensions and dataset sizes. We achieve the following observations: + +1. SparseIRM largely surpasses MRM and IRM with an evident threshold, leading to a gap of up to $40\%$ . The gap becomes larger when the setting is more overparameterized, i.e., when the hidden dimension goes to + +640 and dataset number is 20000. + +2. IRM suffers from the overfitting problem caused by overparameterization seriously. Take the setting of IRMv1 on ColoredMNIST20000 for example, the performance gap incurred by overparameterization comes up to $27\%$ when comparing the accuracy at 160 and 640 hidden dimensions. +3. MRM preliminarily deals with the overfitting problem caused by overparameterization while still cannot achieve satisfactory performance when the setting becomes more overparameterized. Take the setting of IRMv1 on FullColoredMNIST20000 for example, the performance gap incurred by overparameterization comes up to $15\%$ when comparing the accuracy at 256 and 640 hidden dimensions. +4. SparseIRM solves the overfitting problem caused by overparameterization effectively. SparseIRM is resistant to the changes in hidden dimensions. Specifically, the Top-1 test accuracy even goes up steadily with the increment of hidden dimensions. In the experiment, we find that we effectively solve the contradiction between model trainability and generalization ability. + +# 5.2. ResNet18 on ColoredObject/CIFARMNIST + +In this section, we evaluate the performance of SparseIRM in extremely overparameterized settings. Table 3 reports the detailed Top-1 testing accuracy on ResNet-18 on ColoredObject and CIFARMNIST. We find that MRM collapsed at the ColoredObject dataset and achieves little performance boost in CIFARMNIST. The collapse of MRM can be expected, as from the previous experiments on relatively small-sized MLP, the performance of MRM drops quickly when hidden dimension increases. When the parameter size + +Table 3. Comparison of Top-1 Test Accuracy on ResNet-18 on ColoredObject and CIFARMNIST. + +
DatasetColoredObjectCIFARMNIST
Oracle87.9 ± 0.383.7 ± 1.5
ERM51.6 ± 0.539.5 ± 0.4
SparseERM54.4 ± 0.440.1 ± 0.8
BayesianIRM78.1 ± 0.659.3 ± 0.8
IRMv1IRM72.5 ± 2.351.3 ± 3.0
MRM58.4 ± 0.956.7 ± 2.3
SparseIRM87.4 ± 0.663.9 ± 0.4
RExIRM73.8 ± 1.350.1 ± 2.2
MRM55.7 ± 2.952.6 ± 1.5
SparseIRM80.3 ± 1.162.7 ± 0.6
+ +comes up to over ten million parameters in ResNet-18, the setting becomes extremely overparameterized. Therefore MRM selects massive spurious and random features during the first dense training process and then mistakenly discards invariant features misled by the spurious and random features, finally making the model collapsed. + +SparseIRM generally beats the baselines by a large margin and achieves striking results approaching the Oracle in IRMv1 in ColoredObject dataset. These results validate the effectiveness of our SparseIRM method in extremely overparameterized ResNet-18 settings. + +# 5.3. Abalation Studies + +In this section, we would like to explicitly verify whether the spurious features are removed by our SparseIRM in previous experiments through two experiments. In the first experiment, the idea is to predict the spurious features from the representation. If it cannot predict the spurious features well, it means that the extracted feature representations contain no information about spurious features. Therefore our claim is verified. In the second experiment, we visualize the difference of learned feature representations by merely flipping the value of spurious features, in order to demonstrate the little influence of spurious features to our learned representations. The MLP model is learned in the setting with 640 hidden dimensions and ColoredMNIST50000 and we take the IRMv1 for example. + +[Predicting the Spurious Features from the Representations] We generate a ColoredMNIST dataset with $50\%$ correlation across training and testing environments and then obtain the extracted feature representations by feeding images into the learned MLP model. We train a new two layer perceptron network to predict the color based on + +the extracted representations. Table 4 presents the training and testing accuracy of the color prediction problem and we find that the IRM and MRM method can still predict the color well on the training set and generalize well on testing set, with accuracy approaching $90\%$ percent. This implies that there still exists information about the color in their learned representations. In strikingly contrast, our SparseIRM achieves nearly optimal performance (both $50\%$ accuracy in training and testing set) in the color prediction task, that is, no meaningful information concerning spurious features is preserved in the learned MLP model. This is consistent with our claim that our SparseIRM can remove the spurious features successfully through the sparsify-during-training process. + +Table 4. Training and testing accuracy of the color prediction problem. SparseIRM achieves nearly optimal performance demonstrating that no information about spurious features exists in learned representations. + +
DatasetTrainingTesting
IRM89.1 ± 0.389.2 ± 1.9
MRM82.8 ± 1.183.4 ± 0.4
SparseIRM50.3 ± 0.850.0 ± 0.7
+ +[Visualize Difference of Feature Representations by Flipping Spurious Features] We randomly sample a image $I$ from the ColoredMNIST testing set. We then flip the spurious feature color of $I$ and denote it as $I'$ . We feed $I$ and $I'$ into the learned MLP model and then plot absolute value of difference of feature representations. From Figure 4, we find that the difference of extracted representations of images with different colors is largely suppressed through our SparseIRM network. In contrast, for the baselines, the difference of extracted feature representations of images with different colors is still very large considering the relatively brighter color of the matrix. This means that the models learned by IRM and MRM can still be affected by spurious features, while our SparseIRM method is invariant to spurious features, verifying its success in removing the spurious features through the sparsify-during-training process. + +# 6. Limitations + +In our method, we adopt the weight-level sparsity, which is difficult to be efficiently implemented in the general deep neral network training platforms, such as TensorFlow and PyTorch, to accelerate the training process. In the current stage of IRM study, the training speed is not a main issue as the dataset size is not too large. We will explore efficient training methods (Yuan et al., 2020b; Zhou et al., 2021a; Chen et al., 2021a) in the future. + +![](images/11b9c24ff4694e4987e67f06005007f30eb2b0ef7ca610503a51df739c9ffe53.jpg) +Figure 4. Comparison of absolute value of difference of feature representations by flipping spurious features. The dimension of feature representation 640 and we reshape it into $32 \times 20$ matrix for better visualization. + +# 7. Conclusion + +In this paper, we propose an effective sparse invariant risk minimization method named SparseIRM to address the overfitting problem in IRM originated from overparameterization. We provide some theoretical results to demonstrate the appealing properties of SparseIRM over the existing methods. Empirically we achieve surprisingly high performance on various datasets and vividly verify the effectiveness of our SparseIRM in removing spurious features in ablation studies. + +# Acknowledgements + +This work is supported by GRF 16201320. + +# References + +Ahmed, F., Bengio, Y., van Seijen, H., and Courville, A. Systematic generalisation with group invariant predictions. In International Conference on Learning Representations, 2020. +Ahuja, K., Shanmugam, K., Varshney, K., and Dhurandhar, A. Invariant risk minimization games. In International Conference on Machine Learning, pp. 145-155. PMLR, 2020a. +Ahuja, K., Wang, J., Dhurandhar, A., Shanmugam, K., and Varshney, K. R. Empirical or invariant risk minimization? a sample complexity perspective. arXiv preprint arXiv:2010.16412, 2020b. +Ahuja, K., Caballero, E., Zhang, D., Bengio, Y., Mitliagkas, I., and Rish, I. Invariance principle meets information bottleneck for out-of-distribution generalization. arXiv preprint arXiv:2106.06607, 2021. +Arjovsky, M., Bottou, L., Gulrajani, I., and Lopez-Paz, D. Invariant risk minimization. arXiv preprint arXiv:1907.02893, 2019. + +Bahdanau, D., Cho, K., and Bengio, Y. Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473, 2014. +Bai, H., Sun, R., Hong, L., Zhou, F., Ye, N., Ye, H.-J., Chan, S.-H. G., and Li, Z. Decaug: Out-of-distribution generalization via decomposed feature representation and semantic augmentation. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pp. 6705-6713, 2021a. +Bai, H., Zhou, F., Hong, L., Ye, N., Chan, S.-H. G., and Li, Z. Nas-ood: Neural architecture search for out-of-distribution generalization. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 8320-8329, 2021b. +Beery, S., Van Horn, G., and Perona, P. Recognition in terra incognita. In Proceedings of the European conference on computer vision (ECCV), pp. 456-473, 2018. +Brown, T., Mann, B., Ryder, N., Subbiah, M., Kaplan, J. D., Dhariwal, P., Neelakantan, A., Shyam, P., Sastry, G., Askell, A., et al. Language models are few-shot learners. Advances in neural information processing systems, 33: 1877-1901, 2020. +Chang, S., Zhang, Y., Yu, M., and Jaakkola, T. Invariant rationalization. In International Conference on Machine Learning, pp. 1448-1458. PMLR, 2020. +Chen, C., Shen, L., Huang, H., and Liu, W. Quantized adam with error feedback. ACM Transactions on Intelligent Systems and Technology (TIST), 12(5):1-26, 2021a. +Chen, K., Hong, L., Xu, H., Li, Z., and Yeung, D.-Y. Multisiam: Self-supervised multi-instance siamese representation learning for autonomous driving. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 7546-7554, 2021b. +Chen, Y., Rosenfeld, E., Sellke, M., Ma, T., and Risteski, A. Iterative feature matching: Toward provable domain generalization with logarithmic environments. arXiv preprint arXiv:2106.09913, 2021c. +Creager, E., Jacobsen, J.-H., and Zemel, R. Environment inference for invariant learning. In International Conference on Machine Learning, pp. 2189-2200. PMLR, 2021. +DeGrave, A. J., Janizek, J. D., and Lee, S.-I. Ai for radiographic Covid-19 detection selects shortcuts over signal. Nature Machine Intelligence, pp. 1-10, 2021. +Devlin, J., Chang, M.-W., Lee, K., and Toutanova, K. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018. + +Diao, S., Bai, J., Song, Y., Zhang, T., and Wang, Y. Zen: Pre-training chinese text encoder enhanced by n-gram representations. arXiv preprint arXiv:1911.00720, 2019. +Diao, S., Xu, R., Su, H., Jiang, Y., Song, Y., and Zhang, T. Taming pre-trained language models with n-gram representations for low-resource domain adaptation. 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. 3336-3349, 2021. +Gao, J., Zhou, Y., Yu, P. L., Joty, S., and Gu, J. Unison: Unpaired cross-lingual image captioning. 2022. +Geirhos, R., Jacobsen, J.-H., Michaelis, C., Zemel, R., Brendel, W., Bethge, M., and Wichmann, F. A. Shortcut learning in deep neural networks. Nature Machine Intelligence, 2(11):665-673, 2020. +Grill, J.-B., Strub, F., Altché, F., Tallec, C., Richemond, P. H., Buchatskaya, E., Doersch, C., Pires, B. A., Guo, Z. D., Azar, M. G., and others. Bootstrap your own latent: A new approach to self-supervised learning. arXiv:2006.07733, 2020. +Gu, J., Cai, J., Joty, S. R., Niu, L., and Wang, G. Look, imagine and match: Improving textual-visual cross-modal retrieval with generative models. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 7181-7189, 2018. +Gu, Y., Zhang, W., Fang, C., Lee, J. D., and Zhang, T. How to characterize the landscape of overparameterized convolutional neural networks. Advances in Neural Information Processing Systems, 2020. +Gulrajani, I. and Lopez-Paz, D. In search of lost domain generalization. arXiv preprint arXiv:2007.01434, 2020. +Han, S., Mao, H., and Dally, W. J. Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman coding. International Conference on Learning Representations, 2016. +He, K., Zhang, X., Ren, S., and Sun, J. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770-778, 2016. +He, K., Fan, H., Wu, Y., Xie, S., and Girshick, R. Momentum contrast for unsupervised visual representation learning. In CVPR, 2020. +Hsu, D., Kakade, S. M., and Zhang, T. Random design analysis of ridge regression. In Conference on learning theory, pp. 9-1. JMLR Workshop and Conference Proceedings, 2012. + +Huang, M., Huang, Z., Li, C., Chen, X., Xu, H., Li, Z., and Liang, X. Arch-graph: Acyclic architecture relation predictor for task-transferable neural architecture search. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 11881-11891, 2022. +Jacot, A., Gabriel, F., and Hongler, C. Neural tangent kernel: Convergence and generalization in neural networks. arXiv preprint arXiv:1806.07572, 2018. +Jacot, A., Gabriel, F., and Hongler, C. Neural tangent kernel: convergence and generalization in neural networks. In Proceedings of the 53rd Annual ACM SIGACT Symposium on Theory of Computing, pp. 6-6, 2021. +Jin, W., Barzilay, R., and Jaakkola, T. Domain extrapolation via regret minimization. arXiv preprint arXiv:2006.03908, 2020. +Kamath, P., Tangella, A., Sutherland, D., and Srebro, N. Does invariant risk minimization capture invariance? In International Conference on Artificial Intelligence and Statistics, pp. 4069-4077. PMLR, 2021. +Kawaguchi, K., Huang, J., and Kaelbling, L. P. Effect of depth and width on local minima in deep learning. Neural computation, 31(7):1462-1498, 2019. +Krizhevsky, A., Sutskever, I., and Hinton, G. E. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, pp. 1097-1105, 2012. +Krueger, D., Caballero, E., Jacobsen, J.-H., Zhang, A., Binas, J., Zhang, D., Le Priol, R., and Courville, A. Out-of-distribution generalization via risk extrapolation (rex). In International Conference on Machine Learning, pp. 5815-5826. PMLR, 2021. +Kusupati, A., Ramanujan, V., Somani, R., Wortsman, M., Jain, P., Kakade, S., and Farhadi, A. Soft threshold weight reparameterization for learnable sparsity. In Proceedings of the International Conference on Machine Learning, July 2020. +Lin, Y., Lian, Q., and Zhang, T. An empirical study of invariant risk minimization on deep models. ICML 2021 Workshop on Uncertainty and Robustness in Deep Learning, 2021. +Lin, Y., Dong, H., Wang, H., and Zhang, T. Bayesian invariant risk minimization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 16021-16030, 2022a. +Lin, Y., Zhu, S., and Cui, P. Zin: When and how to learn invariance by environment inference? arXiv preprint arXiv:2203.05818, 2022b. + +Liu, J., Hu, Z., Cui, P., Li, B., and Shen, Z. Heterogeneous risk minimization. arXiv preprint arXiv:2105.03818, 2021a. +Liu, J., Hu, Z., Cui, P., Li, B., and Shen, Z. Kernelized heterogeneous risk minimization. arXiv preprint arXiv:2110.12425, 2021b. +Liu, Y., Ott, M., Goyal, N., Du, J., Joshi, M., Chen, D., Levy, O., Lewis, M., Zettlemoyer, L., and Stoyanov, V. Roberta: A robustly optimized bert pretraining approach. arXiv preprint arXiv:1907.11692, 2019. +Liu, Z., Han, J., Chen, K., Hong, L., Xu, H., Xu, C., and Li, Z. Task-customized self-supervised pre-training with scalable dynamic routing. In AAAI, 2022. +Luo, P., Wang, X., Shao, W., and Peng, Z. Towards understanding regularization in batch normalization. arXiv preprint arXiv:1809.00846, 2018. +Luong, T., Pham, H., and Manning, C. D. Effective approaches to attention-based neural machine translation. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pp. 1412-1421, 2015. +Lym, S., Choukse, E., Zangeneh, S., Wen, W., Sanghavi, S., and Erez, M. Prunetrain: fast neural network training by dynamic sparse model reconfiguration. In Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis, pp. 1-13, 2019. +Mei, S., Montanari, A., and Nguyen, P.-M. A mean field view of the landscape of two-layer neural networks. Proceedings of the National Academy of Sciences, 115(33): E7665-E7671, 2018. +Peters, J., Buhlmann, P., and Meinshausen, N. Causal inference by using invariant prediction: identification and confidence intervals. Journal of the Royal Statistical Society. Series B (Statistical Methodology), pp. 947-1012, 2016. +Radford, A., Wu, J., Child, R., Luan, D., Amodei, D., Sutskever, I., et al. Language models are unsupervised multitask learners. OpenAI blog, 1(8):9, 2019. +Rosenfeld, E., Ravikumar, P., and Risteski, A. The risks of invariant risk minimization. arXiv preprint arXiv:2010.05761, 2020. +Sagawa, S., Raghunathan, A., Koh, P. W., and Liang, P. An investigation of why overparameterization exacerbates spurious correlations. In International Conference on Machine Learning, pp. 8346-8356. PMLR, 2020. + +Shah, H., Tamuly, K., Raghunathan, A., Jain, P., and Netrapalli, P. The pitfalls of simplicity bias in neural networks. arXiv preprint arXiv:2006.07710, 2020. +Shao, W., Meng, T., Li, J., Zhang, R., Li, Y., Wang, X., and Luo, P. Ssn: Learning sparse switchable normalization via sparsestmax. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2019. +Simonyan, K. and Zisserman, A. Very deep convolutional networks for large-scale image recognition. International Conference on Learning Representations, 2015. +Sun, Y., Wang, X., and Tang, X. Deep learning face representation from predicting 10,000 classes. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 1891-1898, 2014. +Wang, H., Wu, Z., and He, J. Training fair deep neural networks by balancing influence. arXiv preprint arXiv:2201.05759, 2022. +Xie, C., Chen, F., Liu, Y., and Li, Z. Risk variance penalization: From distributional robustness to causality. arXiv e-prints, pp. arXiv-2006, 2020. +Xu, R., Cui, P., Kuang, K., Li, B., Zhou, L., Shen, Z., and Cui, W. Algorithmic decision making with conditional fairness. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 2125-2135, 2020. +Xu, R., Cui, P., Shen, Z., Zhang, X., and Zhang, T. Why stable learning works? a theory of covariate shift generalization. arXiv preprint arXiv:2111.02355, 2021. +Xu, R., Zhang, X., Cui, P., Li, B., Shen, Z., and Xu, J. Regulatory instruments for fair personalized pricing. In Proceedings of the ACM Web Conference 2022, pp. 4-15, 2022. +Xu, Y. and Jaakkola, T. Learning representations that support robust transfer of predictors. arXiv preprint arXiv:2110.09940, 2021. +Ye, N., Li, K., Bai, H., Yu, R., Hong, L., Zhou, F., Li, Z., and Zhu, J. Ood-bench: Quantifying and understanding two dimensions of out-of-distribution generalization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 7947-7958, 2022. +Yuan, G., Shen, L., and Zheng, W.-S. A block decomposition algorithm for sparse optimization. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 275-285, 2020a. + +Yuan, X., Savarese, P. H. P., and Maire, M. Growing efficient deep networks by structured continuous sparsification. In International Conference on Learning Representations, 2020b. +Zhang, C., Bengio, S., Hardt, M., Recht, B., and Vinyals, O. Understanding deep learning (still) requires rethinking generalization. Communications of the ACM, 64(3):107-115, 2021a. +Zhang, D., Ahuja, K., Xu, Y., Wang, Y., and Courville, A. Can subnetwork structure be the key to out-of-distribution generalization? arXiv preprint arXiv:2106.02890, 2021b. +Zhang, G., Zhao, H., Yu, Y., and Poupart, P. Quantifying and improving transferability in domain generalization. arXiv preprint arXiv:2106.03632, 2021c. +Zhang, X., Xu, Z., Xu, R., Liu, J., Cui, P., Wan, W., Sun, C., and Li, C. Towards domain generalization in object detection. arXiv preprint arXiv:2203.14387, 2022a. +Zhang, X., Zhou, L., Xu, R., Cui, P., Shen, Z., and Liu, H. Nico++: Towards better benchmarking for domain generalization. arXiv preprint arXiv:2204.08040, 2022b. +Zhou, W., Zeng, Y., Diao, S., and Zhang, X. Vlue: A multi-task benchmark for evaluating vision-language models, 2022a. URL https://arxiv.org/abs/2205.15237. +Zhou, X., Zhang, W., Chen, Z., Diao, S., and Zhang, T. Efficient neural network training via forward and backward propagation sparsification. Advances in Neural Information Processing Systems, 2021a. +Zhou, X., Zhang, W., Xu, H., and Zhang, T. Effective sparsification of neural networks with global sparsity constraint. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 3599-3608, 2021b. +Zhou, X., Lin, Y., Pi, R., Zhang, W., Xu, R., Peng, C., and Zhang, T. Model agnostic sample reweighting for out-of-distribution learning. In International Conference on Machine Learning. PMLR, 2022b. +Zou, F., Shen, L., Jie, Z., Zhang, W., and Liu, W. A sufficient condition for convergences of adam and rmsprop. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 11127-11135, 2019. + +# Supplemental Material: Sparse Invariant Risk Minimization + +This appendix can be divided into 6 parts. To be precise, + +- In Section A, we give detailed descriptions of four datasets. +- In Section B.1, we give more discussion about our theoretical analysis in this work. +- In Section B.2, we verify our claim in Line 512 that Problem (8) is a specific instance of Problem (6). +- In Sections B.3 to B.6, we present the proofs of the three theorems in the main text. +- In section C, we present our detailed algorithm for solving SparseIRM. +- In Section D, we give the experimental configurations. +- In Section E, we provide some additional experimental results. +- In Section F, we present discussions on future works. + +# A. Dataset Details + +ColoredMNIST (Arjovsky et al., 2019). It contains images from MNIST and the images are labeled as 0 or 1. Each image is attached with a color as the spurious feature. Correlation tuple is $(0.9, 0.8, 0.1)$ . Noise ratio is $25\%$ . + +FullColoredMNIST (Ahmed et al., 2020). It extends ColoredMNIST to 10 classes. Correlation tuple is (0.999, 0.7, 0.1). Noise ratio is $20\%$ . + +ColoredObject (Ahmed et al., 2020; Zhang et al., 2021b). It is constructed by extracting 8 classes of objected from MSCOCO and put them onto colored backgrounds. Correlation tuple is $(0.999, 0.7, 0.1)$ . Noise ratio is $5\%$ . + +CIFARMNIST (Shah et al., 2020; Lin et al., 2021). It is constructed by concatenating images of CIFAR10 with MNIST. The CIFAR images are the invariant features and the MNIST images are the spurious features. Correlation tuple is (0.999, 0.7, 0.1). Noise ratio is $10\%$ . + +Table 5. Illustration of each dataset. C/FCMNIST stands for ColoredMNIST and FullColoredMNIST. Invariant and Spurious stand for the invariant and spurious features, respectively. The spurious features have strong correlations with the labels, as shown in Training samples. The correlations are reversed in the Testing samples to simulate the distributional shift. + +
DatasetInvariantSpuriousTrainingTesting
C/FCMNISTDigitColor
ColoredObjectObjectBackground
CIFARMNISTCIFARMNIST
+ +# B. Proofs + +# B.1. More Discussions on Our Theoretical Analysis + +In this paper, we analyze the theoretical properties of our method through a linear model for the following considerations: + +- Our main motivation is to show the superiority of our method over the baseline MRM (Zhang et al., 2021b). We show that, even for the simple linear case, MRM can be demolished by overfitting caused by overparameterization. Thus, the superiority of our method over MRM in addressing overfitting is verified. +- We would like to show some intuitive insights of our method instead of presenting thorough rigorous analysis of SparseIRM. +- Although applying IRM to deep neural networks is possible, it is hard to provide theoretical guarantees in this scenario (Rosenfeld et al., 2020). The reason is that we need to find and analyze the global optimum in the analysis of IRM, while theory on the global optimum of deep neural networks is still quite limited, making it not applicable to analyze IRM directly in the complicated setting. + +# B.2. The Relationship between Problem (6) and Problem (8) + +Below, we will show that Problem (8) is a specific instance of Problem (6) as we claimed in Line 512. + +Firstly, recall that Problem (6) takes the form of + +$$ +\min _ {\boldsymbol {w}, \boldsymbol {m}} \mathcal {L} (\left\{\boldsymbol {v}, \boldsymbol {m} \circ \Phi \right\}) \tag {10} +$$ + +$$ +s. t. \boldsymbol {w} \in \mathbb {R} ^ {d _ {w}}, \boldsymbol {m} \in \{0, 1 \} ^ {d _ {\Phi}}, \| \boldsymbol {m} \| _ {1} \leq K \}, +$$ + +By freezing $\Phi = \mathbf{1}^{d_{\Phi}}$ , it becomes + +$$ +\min _ {\boldsymbol {v}, \boldsymbol {m}} \mathcal {L} (\{\boldsymbol {v}, \boldsymbol {m} \}) \tag {11} +$$ + +$$ +s. t. \boldsymbol {v} \in \mathbb {R} ^ {d _ {v}}, \boldsymbol {m} \in \{0, 1 \} ^ {d _ {\Phi}}, \| \boldsymbol {m} \| _ {1} \leq K \}, +$$ + +Then, we change the notation of $m$ to be $\Phi$ , the problem becomes + +$$ +\min _ {\boldsymbol {v}, \Phi} \mathcal {L} (\{\boldsymbol {v}, \Phi \}) \tag {12} +$$ + +$$ +s. t. \boldsymbol {v} \in \mathbb {R} ^ {d _ {v}}, \Phi \in \{0, 1 \} ^ {d _ {\Phi}}, \| \Phi \| _ {1} \leq K \}, +$$ + +which is actually Problem (8). Thus our claim is verified. + +# B.3. Basics + +In real applications, we always have massive spurious and random features while the invariant features are usually low dimensional (Sagawa et al., 2020). So it is reasonable to let $d_{s} + d_{r} \gg d_{inv}$ . We also assume the sample size in each environment is the same, i.e., $n^{e} = n, \forall e \in \mathcal{E}$ . For any vector $v$ and linear operator $M$ , let the vector norm be $\| v \|_{M} \coloneqq \sqrt{v^{\intercal}Mv}$ . When $M$ is omitted, it is assumed to be the identity $I$ , so $\| v \| = \sqrt{v^{\intercal}v}$ . For a linear operator, let $\| M \|$ be the spectral operator norm, i.e., $\| M \| \coloneqq \sup_{v} \| Mv \| / \| v \|$ . Let $\lambda_{max}[M]$ and $\lambda_{min}[M]$ be the largest and smallest eigenvalue of $M$ , respectively. We use $\mathbb{E}^{e}$ and $\hat{\mathbb{E}}^{e}$ to denote the expectation and empirical mean in environment $e$ , e.g., + +$$ +\mathbb {E} ^ {e} [ y ] = \int y ^ {e} d \mathbb {P} (y ^ {e}), \quad \hat {\mathbb {E}} ^ {e} [ y ] = \frac {1}{n} \sum_ {i = 1} ^ {n} y _ {i} ^ {e}. +$$ + +Further, we use $\mathbb{E}$ and $\hat{\mathbb{E}}$ to denote expectation and empirical mean from all environments, e.g., + +$$ +\mathbb {E} [ y ] = \frac {1}{| \mathcal {E} |} \sum_ {e = 1} ^ {| \mathcal {E} |} \mathbb {E} ^ {e} [ y ], \quad \hat {\mathbb {E}} [ y ] = \frac {1}{| \mathcal {E} |} \sum_ {e = 1} ^ {| \mathcal {E} |} \hat {\mathbb {E}} ^ {e} [ y ]. +$$ + +Given the feature mask $\Phi$ , let $\Sigma_{\Phi}$ denote the design matrix for the environment mixture, i.e., + +$$ +\Sigma_ {\Phi} = \mathbb {E} [ \Phi (\boldsymbol {x}) \Phi (\boldsymbol {x}) ^ {\intercal} ] +$$ + +We further let $\Sigma_{\Phi}^{e}$ be the design matrix in environment $e$ and $\hat{\Sigma}_{\Phi}$ be the empirical design matrix. When it is clear from the context, we drop the subscript $\Phi$ for simplicity. Let $\beta$ achieve the minimum mean square error over all linear function, i.e., + +$$ +\beta = \underset {\boldsymbol {v}} {\arg \min } \mathbb {E} \left[ \left(y - \boldsymbol {v} ^ {\intercal} \Phi (\boldsymbol {x})\right) ^ {2} \right] \tag {13} +$$ + +We also use $\beta^{e}$ and $\hat{\beta}$ to denote the counterparts of $\beta$ similarly as defined above. + +Before providing the proofs, we first introduce the extension of IRMv1 to the minimax formulation: + +$$ +\min _ {\boldsymbol {v}, \Phi} \max _ {\boldsymbol {v} ^ {e}} \sum_ {e} \mathcal {R} ^ {e} (\boldsymbol {v}, \Phi) + \lambda \left[ \mathcal {R} ^ {e} (\boldsymbol {v}, \Phi) - \mathcal {R} ^ {e} \left(\boldsymbol {v} ^ {e}, \Phi\right) \right] \tag {14} +$$ + +Then the loss for a feature representation $\Phi$ is + +$$ +\mathcal {L} (\Phi) = \sum_ {e} \mathcal {R} ^ {e} (\beta , \Phi) + \lambda \left(\mathcal {R} ^ {e} (\beta , \Phi) - \mathcal {R} ^ {e} \left(\beta^ {e}, \Phi\right)\right), \tag {15} +$$ + +where $\beta$ and $\beta^{e}$ are defined in Eqn. (13). Further, we have: + +$$ +\left. \nabla_ {\pmb {v}} \mathcal {R} ^ {e} (\pmb {v}, \Phi) \right| _ {v = \beta^ {e}} = \mathbb {E} ^ {e} [ \Phi (\pmb {x}) (y - \Phi (\pmb {x})) ] = \mathbf {0}. +$$ + +We then have into the following: + +$$ +\begin{array}{l} \mathcal {R} ^ {e} (\boldsymbol {v}, \Phi) \\ = \mathbb {E} ^ {e} \left(y - \Phi (x) ^ {\top} \left(\boldsymbol {v} - \beta^ {e} + \beta^ {e}\right)\right) ^ {2} \\ = \mathbb {E} ^ {e} \left(\Phi (x) ^ {\top} (\boldsymbol {v} - \beta^ {e})\right) ^ {2} + \mathbb {E} ^ {e} \left((\boldsymbol {v} - \beta^ {e}) ^ {\top} \Phi (x)\right) (y - \Phi (x) ^ {\top} \beta^ {e}) + \mathbb {E} ^ {e} \left(y - \Phi (x) ^ {\top} \beta^ {e}\right)) ^ {2} \\ = \mathbb {E} ^ {e} \left(\Phi (x) ^ {\top} (\boldsymbol {v} - \beta^ {e})\right) ^ {2} + \mathcal {R} ^ {e} \left(\beta^ {e}, \Phi\right) \\ \end{array} +$$ + +So the penalty term in Eq. (14) translates into the following: + +$$ +\mathcal {R} ^ {e} (\boldsymbol {v}, \Phi) - \mathcal {R} ^ {e} \left(\beta^ {e}, \Phi\right) = \mathbb {E} ^ {e} \left(\Phi (\boldsymbol {x}) ^ {\top} \left(\boldsymbol {v} - \beta^ {e}\right)\right) ^ {2} \tag {16} +$$ + +Then IRM loss in Eq. (14) is + +$$ +\begin{array}{l} \sum_ {e} \mathcal {R} ^ {e} (\beta , \Phi) + \lambda (\mathcal {R} ^ {e} (\beta , \Phi) - \mathcal {R} ^ {e} (\beta^ {e}, \Phi)) \\ = \sum_ {e} \mathbb {E} ^ {e} \left(y - \Phi (\boldsymbol {x}) ^ {\top} \beta\right) ^ {2} + \lambda \left(\Phi (\boldsymbol {x}) ^ {\top} \left(\beta - \beta^ {e}\right)\right) ^ {2}. \tag {17} \\ \end{array} +$$ + +Comparing IRMv1 defined in Eq. (J-IRMv1) and Eq. (14), we can see that Eq. (J-IRMv1) is the first order approximation of Eq. (14) by initializing $\pmb{v}^e$ with $\beta$ and then taking a gradient step on $\mathcal{R}^e (\pmb {v},\Phi)$ by $\pmb{v}^{e}\gets \beta -\eta \nabla_{\pmb{v}^{e}}\mathcal{R}^{e}(\pmb{v}^{e},\Phi)|_{\pmb{v}^{e} = v}$ . Then + +$$ +\mathcal {R} ^ {e} (\pmb {v}, \Phi) - \mathcal {R} ^ {e} (\pmb {v} - \eta \nabla_ {\pmb {v}} \mathcal {R} ^ {e} (\pmb {v}, \Phi), \Phi) = \eta \| \nabla_ {\pmb {v}} \mathcal {R} ^ {e} (\pmb {v}, \Phi) \| ^ {2} + O (\eta^ {2}) +$$ + +In the later part, we provide the proof of our results based on the formulation in Eq. (14). + +# B.4. Proof for Proposition 1 + +Proof. Because of the condition $d_{inv} + d_s + d_r > n_{e_1} + n_{e_2}$ , we have + +$$ +\hat {\mathcal {R}} ^ {e} (\hat {\beta}, \Phi_ {a l l}) = 0, \hat {\mathcal {R}} ^ {e} (\hat {\beta} ^ {e}, \Phi_ {a l l}) = 0, \forall e \in \{e _ {1}, e _ {2} \}. +$$ + +Putting these into Eq. (15), we have + +$$ +\hat {\mathcal {L}} \left(\Phi_ {a l l}\right) = 0. \tag {18} +$$ + +On the other hand, we have the following, + +$$ +\begin{array}{l} \hat {\mathcal {L}} (\Phi_ {i n v}) = \sum_ {e} \hat {\mathcal {R}} ^ {e} (\Phi_ {i n v}) + \frac {1}{n _ {e}} \sum_ {i = 1} ^ {n _ {e}} \left(\Phi (\boldsymbol {x}) ^ {\top} (\hat {\beta} - \hat {\beta} ^ {e})\right) ^ {2} \\ \geq \sum_ {e} \hat {\mathcal {R}} ^ {e} (\Phi_ {i n v}) \\ \geq 0 \tag {19} \\ \end{array} +$$ + +The first and second inequality are due to the non-negativity of the penalty and risk. Putting Eq. (18) and Eq. (19) together, we finish the proof. + +# B.5. Proof of Corollary 1 + +Proof. The proof follows directly from that of Theorem 1 but replacing $\Phi_{all}$ with $\Phi_{sr}$ . When spurious and random feature has large dimension, $d_s + d_r > n_{e_1} + n_{e_2}$ , $\mathcal{L}(\Phi_{sr})$ will be already 0. + +# B.6. Proof of Theorem 1 + +# B.6.1. PRELIMINARIES + +Recall the data generation process in Section 3.2, by simple algebra, we know that $\mathbb{E}^e [\Phi (\pmb {x})y] = \mathbb{E}[\Phi (\pmb {x})y]$ $\mathbb{E}^e [\Phi (\pmb {x})_{inv,r}^\intercal \Phi (\pmb {x})_{inv,r}] = \mathbb{E}[\Phi (\pmb {x})_{inv,r}^\intercal \Phi (\pmb {x})_{inv,r}],\mathbb{E}^e [\Phi (\pmb {x})_{inv,r}^\intercal \Phi (\pmb {x})_s] = \mathbb{E}[\Phi (\pmb {x})_{inv,r}^\intercal \Phi (\pmb {x})_s]$ and $\mathbb{E}^e [\Phi (\pmb {x})_s^\intercal \Phi (\pmb {x})_s] =$ $\mathbb{E}^e [\Phi (\pmb {x})_s^\intercal \Phi (\pmb {x})_s] + \mathrm{Diag}\Big(\dots ,(\alpha_i^e)^2 -(\alpha_i)^2,\dots \Big),$ where $\alpha_{i} = \sqrt{\sum_{e}(\alpha_{i}^{e})^{2}},\forall i\in [d_{s}].$ Specifically, we have + +$$ +\begin{array}{l} \Sigma_ {\Phi} ^ {e} = \left( \begin{array}{c c} \mathbb {E} ^ {e} [ \Phi (\boldsymbol {x}) _ {i n v, r} ^ {\intercal} \Phi (\boldsymbol {x}) _ {i n v, r} ] & \mathbb {E} ^ {e} [ \Phi (\boldsymbol {x}) _ {i n v, r} ^ {\intercal} \Phi (\boldsymbol {x}) _ {s} ] \\ \mathbb {E} ^ {e} [ \Phi (\boldsymbol {x}) _ {s} ^ {\intercal} \Phi (\boldsymbol {x}) _ {i n v, r} ] & \mathbb {E} ^ {e} [ \Phi (\boldsymbol {x}) _ {s} ^ {\intercal} \Phi (\boldsymbol {x}) _ {s} ] \end{array} \right) \\ = \left( \begin{array}{c c} \mathbb {E} [ \Phi (\boldsymbol {x}) _ {i n v, r} ^ {\intercal} \Phi (\boldsymbol {x}) _ {i n v, r} ] & \mathbb {E} [ \Phi (\boldsymbol {x}) _ {i n v, r} ^ {\intercal} \Phi (\boldsymbol {x}) _ {s} ] \\ \mathbb {E} [ \Phi (\boldsymbol {x}) _ {s} ^ {\intercal} \Phi (\boldsymbol {x}) _ {i n v, r} ] & \mathbb {E} [ \Phi (\boldsymbol {x}) _ {s} ^ {\intercal} \Phi (\boldsymbol {x}) _ {s} ] + \left( \begin{array}{c c c c} (\alpha_ {1} ^ {e}) ^ {2} - (\alpha_ {1}) ^ {2} & 0 & \dots & 0 \\ 0 & (\alpha_ {2} ^ {e}) ^ {2} - (\alpha_ {2}) ^ {2} & \dots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \dots & (\alpha_ {(d _ {s} (\Phi))} ^ {e}) ^ {2} - (\alpha_ {d _ {s} (\Phi)}) ^ {2} \end{array} \right) \end{array} \right) \\ = \Sigma_ {\Phi} + \operatorname {D i a g} [ \underbrace {0 , \dots , 0} _ {d _ {i n v, s} (\Phi)}, (\alpha_ {1} ^ {e}) ^ {2} - (\alpha_ {1}) ^ {2}, \dots , (\alpha_ {d _ {s} (\Phi)} ^ {e}) ^ {2} - (\alpha_ {d _ {s} (\Phi)}) ^ {2} ] \\ \end{array} +$$ + +So $\Sigma^e$ and $\Sigma$ only differ by some diagonal elements corresponding to the spurious feature. Let $\{\lambda_i\}_{i=1}^d$ and $\{\lambda_i^e\}_{i=1}^d$ be the eigenvalues of $\Sigma$ and $\Sigma^e$ , respectively. Their corresponding eigenvectors are $\{\pmb{v}_i\}_{i=1}^d$ and $\{\pmb{v}_i^e\}_{i=1}^d$ . It is easy to see that $\Sigma$ and $\Sigma^e$ share the same orthonormal basis $\Pi$ , indicating $\pmb{v}_i = \pmb{v}_i^e$ , $\forall i \in [K]$ . + +$$ +\lambda_ {i} ^ {e} = \left\{ \begin{array}{l l} \lambda_ {i}, & \text {i f} i \in \left[ d _ {\text {i n v}} (\Phi) \right] \bigcup \left[ d _ {r} (\Phi) \right], \\ \lambda_ {i} + \left(\alpha_ {i} ^ {e}\right) ^ {2} - \alpha_ {i} ^ {2}, & \text {i f} i \in \left[ d _ {s} (\Phi) \right]. \end{array} \right. \tag {20} +$$ + +Assume the maximum and minimum possible eigenvalue to be $\lambda_{max}$ and $\lambda_{min} > 0$ , i.e., + +$$ +\begin{array}{l} \forall e \in \mathcal {E}, \quad \lambda_ {\min } \leq \lambda_ {i} ^ {e} \leq \lambda_ {\max }, \\ \text {a n d} \quad \lambda_ {\min } \leq \lambda_ {i} \leq \lambda_ {\max }. \\ \end{array} +$$ + +Let $\Phi_{inv}$ denote the feature mask that merely selects $K$ invariant features, $\Phi_{inv,r}$ be the feature mask that selects random features but no spurious features (the number of spurious features can be arbitrary), $\Phi_{inv,r,s}$ be the feature mask that selects spurious features (the number of random and invariant features can be arbitrary). Our goal is to show $\hat{\mathcal{L}} (\Phi_{inv}) < \hat{\mathcal{L}} (\Phi_{inv,r,s})$ and $\hat{\mathcal{L}} (\Phi_{inv}) < \hat{\mathcal{L}} (\Phi_{inv,r})$ holds with high probability. + +# B.6.2. ASSUMPTIONS AND TECHNICAL LEMMAS + +In this paper, we adopt the following standard assumptions from the existing methods (Arjovsky et al., 2019; Rosenfeld et al., 2020): + +Assumption 1. For each feature mask $\Phi$ , there exists $\rho$ such that, almost surely, + +$$ +\frac {\| (\Sigma_ {\Phi} ^ {e}) ^ {- 1 / 2} \Phi (\boldsymbol {x}) \|}{\sqrt {\mathbb {E} ^ {e} [ \| (\Sigma_ {\Phi} ^ {e}) ^ {- 1 / 2} \Phi (\boldsymbol {x}) \| ^ {2} ]}} \leq \rho , \forall e \in \mathcal {E}, a n d \frac {\| (\Sigma_ {\Phi}) ^ {- 1 / 2} \Phi (\boldsymbol {x}) \|}{\sqrt {\mathbb {E} [ \| (\Sigma_ {\Phi}) ^ {- 1 / 2} \Phi (\boldsymbol {x}) \| ^ {2} ]}} \leq \rho . +$$ + +Assumption 2. There exists finite $\sigma >0$ such that, almost surely, + +$$ +\mathbb {E} [ \exp (\eta \epsilon_ {i n v}) ] \leq \exp (\eta^ {2} \sigma^ {2}), \forall \eta \in \mathbb {R}. +$$ + +Assumption 3. There exists $s$ and $\bar{\gamma}$ , such that: + +$$ +\forall i \in [ d _ {i n v} ], | \gamma_ {i} | \geq \bar {\gamma}, a n d \mathbb {V} [ x _ {i n v, i} ] \geq s. +$$ + +Assumption 1 and 2 are a standard statistical assumption which can also be found in (Hsu et al., 2012). They can be satisfied when each $x_{inv,i}$ and $\epsilon_{inv}$ are bounded sub-Gaussian variables. Assumption 3 requires each $x_{inv}$ should explain sufficient amount of variance of $y$ + +Assumption 4. For $i$ th spurious feature, let $\alpha_{i} = \sqrt{\sum_{e}(\alpha_{i}^{e})^{2}}, \forall i \in [d_{s}]$ . There exists a constant $\Delta > 0$ , the following inequality holds for each spurious feature, + +$$ +\forall i \in [ d _ {s} ], \exists e \in \mathcal {E}, | \alpha_ {i} ^ {2} - (\alpha_ {i} ^ {e}) ^ {2} | \geq \Delta . +$$ + +Assumption 5. For each $K$ subset of feature $\mathbf{x}$ that is selected by $\Phi$ , the projection of $\mathbb{E}[\Phi(\mathbf{x})^{\top}y]$ on each basis corresponding to spurious feature is non zero, i.e., there exists a constant $C$ such that, if $\Phi(\mathbf{x})_i$ is a spurious feature, then + +$$ +\exists e \in \mathcal {E}, | \mathbb {E} ^ {e} [ \Phi (\boldsymbol {x}) y ] ^ {\intercal} \boldsymbol {v} _ {i} | \geq C > 0. +$$ + +Assumption 4 requires that the coefficient of each spurious feature exhibits a certain level of variation among the two environments. This is reasonable according to the definition of spurious feature that the conditional of target $x_{s}$ on $y$ varies in different environments, otherwise there is no way to differentiate a spurious feature from the invariant feature (Arjovsky et al., 2019; Rosenfeld et al., 2020). Assumption 5 ensures that the coefficients of a spurious feature can not be always 0, otherwise IRM can not differentiate between the spurious and invariant features, neither. + +We first present some useful lemmas from (Hsu et al., 2012). + +Lemma 1 (Excess mean squared error, Proposition 5 of (Hsu et al., 2012)). For any $v$ , + +$$ +\mathbb {E} \big [ (y - \boldsymbol {v} ^ {\intercal} \Phi (x)) ^ {2} \big ] - \mathbb {E} \big [ (y - \beta^ {\intercal} \Phi (x)) ^ {2} \big ] = \mathbb {E} \big [ ((\boldsymbol {v} - \beta) ^ {\intercal} \Phi (x)) ^ {2} \big ] = \| \boldsymbol {v} - \beta \| _ {\Sigma} +$$ + +$$ +\hat {\mathbb {E}} \left[ (y - \boldsymbol {v} ^ {\intercal} \Phi (x)) ^ {2} \right] - \hat {\mathbb {E}} \left[ (y - \hat {\beta} ^ {\intercal} \Phi (x)) ^ {2} \right] = \| \boldsymbol {v} - \hat {\beta} \| _ {\hat {\Sigma}}. +$$ + +The same arguments also hold for environment $e$ . + +Lemma 2 (Effect of errors in $\hat{\Sigma}$ , Lemma 2 and 3 of (Hsu et al., 2012)). With Assumption 1, for any $\delta \leq \min\{1, de^{-2.6}\}$ with probability at least $1 - \delta$ , + +$$ +\| \Sigma^ {- 1 / 2} (\hat {\Sigma} - \Sigma) \Sigma^ {- 1 / 2} \| \leq \sqrt {\frac {4 \rho^ {2} d (\ln d + \ln (1 / \delta))}{n}} + \frac {2 \rho^ {2} d (\ln d + \ln (1 / \delta))}{3 n}. +$$ + +Further, if $\| \Sigma^{-1 / 2}(\hat{\Sigma} -\Sigma)\Sigma^{-1 / 2}\| < 1$ , then + +$$ +\| \Sigma^ {1 / 2} \hat {\Sigma} ^ {- 1} \Sigma^ {1 / 2} \| \leq \frac {1}{1 - \| \Sigma^ {- 1 / 2} (\hat {\Sigma} - \Sigma) \Sigma^ {- 1 / 2} \|}. +$$ + +Lemma 3 (Regret Error of Empirical OLS Solution, Theorem 1 and Remark 9 of (Hsu et al., 2012)). Pick any $\delta \leq \min\{1, de^{-2.6}\}$ , by Assumption 1 and 2, with probability at least $1 - \delta$ , the following holds: + +$$ +\| \hat {\beta} - \beta \| _ {\Sigma} ^ {2} \leq \frac {\sigma^ {2} (d + 2 \sqrt {d \ln (3 / \delta)} + 2 \ln (3 / \delta))}{n} + o (1 / n), +$$ + +where $o(1 / n)$ means higher order term. + +# B.6.3. PROOF OF THE MAIN THEOREM + +Proof. The Eq. (14) can be translated into + +$$ +\begin{array}{l} \hat {\mathcal {L}} (\Phi) = \min _ {\boldsymbol {v}} \max _ {\boldsymbol {v} ^ {e}} \sum_ {e} \mathcal {R} ^ {e} (\boldsymbol {v}, \Phi) + \lambda \left[ \mathcal {R} ^ {e} (\boldsymbol {v}, \Phi) - \mathcal {R} ^ {e} (\boldsymbol {v} ^ {e}, \Phi) \right] \\ = \min _ {\pmb {v}} \max _ {\pmb {v} ^ {e}} \sum_ {e} \hat {\mathbb {E}} ^ {e} (y - \langle \pmb {v}, \Phi (\pmb {x}) \rangle) ^ {2} + \lambda \left[ \hat {\mathbb {E}} ^ {e} (y - \langle \pmb {v}, \Phi (\pmb {x}) \rangle) ^ {2} - \hat {\mathbb {E}} ^ {e} (y - \langle \pmb {v} ^ {e}, \Phi (\pmb {x}) \rangle) ^ {2} \right] \\ = \sum_ {e} \hat {\mathbb {E}} ^ {e} (y - \langle \hat {\beta}, \Phi (\pmb {x}) \rangle) ^ {2} + \lambda \left[ \hat {\mathbb {E}} ^ {e} (y - \langle \hat {\beta}, \Phi (\pmb {x}) \rangle) ^ {2} - \hat {\mathbb {E}} ^ {e} (y - \langle \hat {\beta} ^ {e}, \Phi (\pmb {x}) \rangle) ^ {2} \right], \\ \end{array} +$$ + +where $\hat{\beta}$ and $\hat{\beta}^e$ is defined as Eq. (13). The penalty term above is + +$$ +\begin{array}{l} \sum_ {e} \hat {\mathbb {E}} ^ {e} (y - \langle \hat {\beta}, \Phi (\boldsymbol {x}) \rangle) ^ {2} - \hat {\mathbb {E}} ^ {e} (y - \langle \hat {\beta} ^ {e}, \Phi (\boldsymbol {x}) \rangle) ^ {2} \\ = \underbrace {\sum_ {e} \hat {\mathbb {E}} ^ {e} (y - \langle \hat {\beta} , \Phi (\boldsymbol {x}) \rangle) ^ {2} - \mathbb {E} ^ {e} (y - \langle \beta , \Phi (\boldsymbol {x}) \rangle) ^ {2}} _ {\xi_ {a} (\Phi)} - \underbrace {\sum_ {e} \left(\hat {\mathbb {E}} ^ {e} (y - \langle \hat {\beta} ^ {e} , \Phi (\boldsymbol {x}) \rangle) ^ {2} - \mathbb {E} ^ {e} (y - \langle \beta^ {e} , \Phi (\boldsymbol {x}) \rangle) ^ {2}\right)} _ {\xi_ {b} (\Phi)} \\ + \underbrace {\sum_ {e} \mathbb {E} ^ {e} (y - \langle \beta , \Phi (\boldsymbol {x}) \rangle) ^ {2} - \mathbb {E} ^ {e} (y - \langle \beta^ {e} , \Phi (\boldsymbol {x}) \rangle) ^ {2}} _ {\xi_ {c} (\Phi)} \\ \end{array} +$$ + +We will tackle (a) - (c) one by one. First, + +$$ +\begin{array}{l} | \xi_ {b} (\Phi) | = \sum_ {e} | \hat {\mathbb {E}} ^ {e} (y - \langle \hat {\beta} ^ {e}, \Phi (\boldsymbol {x}) \rangle) ^ {2} - \hat {\mathbb {E}} ^ {e} (y - \langle \beta^ {e}, \Phi (\boldsymbol {x}) \rangle) ^ {2} + \hat {\mathbb {E}} ^ {e} (y - \langle \beta^ {e}, \Phi (\boldsymbol {x}) \rangle) ^ {2} - \mathbb {E} ^ {e} (y - \langle \beta^ {e}, \Phi (\boldsymbol {x}) \rangle) ^ {2} | \\ \leq \sum_ {e} | \hat {\mathbb {E}} ^ {e} (y - \langle \hat {\beta} ^ {e}, \Phi (\pmb {x}) \rangle) ^ {2} - \hat {\mathbb {E}} ^ {e} (y - \langle \beta^ {e}, \Phi (\pmb {x}) \rangle) ^ {2} | + | \hat {\mathbb {E}} ^ {e} (y - \langle \beta^ {e}, \Phi (\pmb {x}) \rangle) ^ {2} - \mathbb {E} ^ {e} (y - \langle \beta^ {e}, \Phi (\pmb {x}) \rangle) ^ {2} | \\ \end{array} +$$ + +One on hand, by Hoeffding's Inequality, we have with probability at least $1 - \delta / 3$ , + +$$ +\left| \hat {\mathbb {E}} ^ {e} \left(y - \left\langle \beta^ {e}, \Phi (\boldsymbol {x}) \right\rangle\right) ^ {2} - \mathbb {E} ^ {e} \left(y - \left\langle \beta^ {e}, \Phi (\boldsymbol {x}) \right\rangle\right) ^ {2} \right| \leq \sqrt {\ln (3 / \delta) / n}. \tag {21} +$$ + +On the other hand, we have + +$$ +\begin{array}{l} \left| \hat {\mathbb {E}} ^ {e} \left(y - \left\langle \hat {\beta} ^ {e}, \Phi (\boldsymbol {x}) \right\rangle\right) ^ {2} - \hat {\mathbb {E}} ^ {e} \left(y - \left\langle \beta^ {e}, \Phi (\boldsymbol {x}) \right\rangle\right) ^ {2} \right| \\ = \| \beta^ {e} - \hat {\beta} ^ {e} \| _ {\tilde {\Sigma} _ {e}} \\ = \left| \left(\beta^ {e} - \hat {\beta} ^ {e}\right) ^ {\intercal} \Sigma^ {e, - 1 / 2} \Sigma^ {e, 1 / 2} \hat {\Sigma} ^ {e, - 1} \Sigma^ {e, 1 / 2} \Sigma^ {e, - 1 / 2} \left(\beta^ {e} - \hat {\beta} ^ {e}\right) \right| \\ \leq \| (\boldsymbol {\beta} ^ {e} - \hat {\boldsymbol {\beta}} ^ {e}) ^ {\intercal} \boldsymbol {\Sigma} ^ {e, - 1 / 2} \| _ {2} ^ {2} \| \boldsymbol {\Sigma} ^ {e, 1 / 2} \hat {\boldsymbol {\Sigma}} ^ {e, - 1} \boldsymbol {\Sigma} ^ {e, 1 / 2} \| _ {2} \\ \end{array} +$$ + +The first equality is due to Lemma 1. Further, by Lemma 2 with probability at least $1 - \delta /3$ + +$$ +\left\| \Sigma^ {e, 1 / 2} \hat {\Sigma} ^ {e, - 1} \Sigma^ {e, 1 / 2} \right\| _ {2} \leq \frac {1}{1 - \kappa}, \tag {22} +$$ + +where $\kappa = \sqrt{\frac{4\rho^2K(\ln K + \ln(3 / \delta))}{n}} +\frac{2\rho^2K(\ln K + \ln(3 / \delta))}{3n}$ . Further, if we have + +$$ +n > 8 / 3 \rho^ {2} K (\ln K + \ln (3 / \delta)), \tag {23} +$$ + +then + +$$ +\kappa = \sqrt {\frac {2 \rho^ {2} K (\ln K + \ln (3 / \delta))}{3 n}} + \frac {2 \rho^ {2} K (\ln K + \ln (3 / \delta))}{3 n} \leq 1 / 2 + 1 / 2 * 1 / 6 < 3 / 4 +$$ + +By Lemma 1, with have with probability at least $1 - \delta /3$ + +$$ +\begin{array}{l} \left\| \left(\beta^ {e} - \hat {\beta} ^ {e}\right) ^ {\intercal} \Sigma^ {e, - 1 / 2} \right\| _ {2} ^ {2} (24) \\ = \left\| \beta^ {e} - \hat {\beta} ^ {e} \right\| _ {\Sigma^ {e}} (25) \\ \leq \frac {\sigma^ {2} (K + 2 \sqrt {K \ln (9 / \delta)} + 2 \ln (9 / \delta))}{n ^ {e}} + o (1 / n) \\ \leq \frac {\sigma^ {2} (2 K + 3 \ln (9 / \delta))}{n} + o (1 / n). (26) \\ \end{array} +$$ + +Putting Eq. (21), (22) and (24) together, we have with probability at least $1 - \delta$ , for all $e \in \mathcal{E}$ + +$$ +\left| \xi_ {b} (\Phi) \right| \leq \underbrace {\frac {1}{1 - \kappa} \frac {\sigma^ {2} | \mathcal {E} | (2 K + 3 \ln (9 | \mathcal {E} | / \delta))}{n} + | \mathcal {E} | \sqrt {\ln (3 | \mathcal {E} | / \delta) / n}} _ {\zeta}. \tag {27} +$$ + +Similarly, we have with probability at least $1 - \delta$ + +$$ +\left| \xi_ {a} (\Phi) \right| \leq \frac {1}{1 - \kappa} \frac {\sigma^ {2} (2 K + 3 \ln (9 / \delta))}{n | \mathcal {E} |} + \sqrt {\ln (3 / \delta) / n | \mathcal {E} |} < \zeta . \tag {28} +$$ + +by noticing that the mixture of environments can be regarded as one environment with $n|\mathcal{E}|$ samples. + +To bound $\xi_c(\Phi)$ , we have + +$$ +\begin{array}{l} \xi_ {c} (\Phi) = \sum_ {e} (\beta - \beta^ {e}) ^ {\intercal} \Sigma^ {e} (\beta - \beta^ {e}) \\ = \sum_ {e} \left(\Sigma^ {- 1} \mathbb {E} [ \Phi (\boldsymbol {x}) y ] - \Sigma^ {e, - 1} \mathbb {E} ^ {e} [ \Phi (\boldsymbol {x}) y ]\right) ^ {\intercal} \Sigma^ {e} \left(\Sigma^ {- 1} \mathbb {E} [ \Phi (\boldsymbol {x}) y ] - \Sigma^ {e, - 1} \mathbb {E} ^ {e} [ \Phi (\boldsymbol {x}) y ]\right) \\ = \sum_ {e} \mathbb {E} ^ {e} [ \Phi (\boldsymbol {x}) y ] ^ {\intercal} (\Sigma^ {- 1} - \Sigma^ {e, - 1}) ^ {\intercal} \Sigma^ {e} (\Sigma^ {- 1} - \Sigma^ {e, - 1}) \mathbb {E} ^ {e} [ \Phi (\boldsymbol {x}) y ] \\ = \sum_ {e} \mathbb {E} ^ {e} [ \Phi (\boldsymbol {x}) y ] ^ {\intercal} \Pi (\Lambda^ {- 1} - \Lambda^ {e, - 1}) ^ {\intercal} \Lambda^ {e} (\Lambda^ {- 1} - \Lambda^ {e, - 1}) \Pi^ {\intercal} \mathbb {E} ^ {e} [ \Phi (\boldsymbol {x}) y ] \\ = \sum_ {e} \sum_ {i} ^ {K} \left(\mathbb {E} ^ {e} [ \Phi (\boldsymbol {x}) y ] ^ {\intercal} \boldsymbol {v} _ {i}\right) ^ {2} \lambda_ {i} \left(\frac {1}{\lambda_ {i} ^ {e}} - \frac {1}{\lambda_ {i}}\right) ^ {2} \\ \end{array} +$$ + +The first equality is due to Lemma 1, the forth equality is by the fact that $\mathbb{E}^e [\Phi (x)y] = \mathbb{E}[\Phi (x)y]$ . So by Assumption 4 and Eq. 20, we have + +$$ +\xi_ {c} (\Phi) \left\{ \begin{array}{l l} = 0, & \text {i f} d _ {s} (\Phi) = 0, \\ \geq \frac {d _ {s} (\Phi) C ^ {2} \lambda_ {\min } \Delta^ {2}}{\lambda_ {\max } ^ {4}} \geq \frac {C ^ {2} \lambda_ {\min } \Delta^ {2}}{\lambda_ {\max } ^ {4}}, & \text {i f} d _ {s} (\Phi) \geq 1. \end{array} \right. \tag {29} +$$ + +Step 1) Comparing $\hat{\mathcal{L}} (\Phi_{inv})$ with $\hat{\mathcal{L}} (\Phi_{inv,r,s})$ . We have the following: + +$$ +\begin{array}{l} \hat {\mathcal {L}} \left(\Phi_ {i n v, r, s}\right) - \hat {\mathcal {L}} \left(\Phi_ {i n v}\right) \\ = \sum_ {e} \hat {\mathbb {E}} ^ {e} (y - \langle \hat {\beta}, \Phi_ {i n v, r, s} (\boldsymbol {x}) \rangle) ^ {2} + \lambda \left[ \hat {\mathbb {E}} ^ {e} (y - \langle \hat {\beta}, \Phi_ {i n v, r, s} (\boldsymbol {x}) \rangle) ^ {2} - \hat {\mathbb {E}} ^ {e} (y - \langle \hat {\beta} ^ {e}, \Phi_ {i n v, r, s} (\boldsymbol {x}) \rangle) ^ {2} \right] \\ \left. \right. - \left(\sum_ {e} \hat {\mathbb {E}} ^ {e} (y - \langle \hat {\beta}, \Phi_ {i n v} (\boldsymbol {x}) \rangle) ^ {2} + \lambda \left[ \hat {\mathbb {E}} ^ {e} (y - \langle \hat {\beta}, \Phi_ {i n v} (\boldsymbol {x}) \rangle) ^ {2} - \hat {\mathbb {E}} ^ {e} (y - \langle \hat {\beta} ^ {e}, \Phi_ {i n v} (\boldsymbol {x}) \rangle) ^ {2} \right]\right) \\ \geq \lambda \left[ \xi_ {a} \left(\Phi_ {i n v, r, s}\right) + \xi_ {b} \left(\Phi_ {i n v, r, s}\right) + \xi_ {c} \left(\Phi_ {i n v, r, s}\right) \right] \\ \left. - \left[ \xi_ {a} \left(\Phi_ {i n v}\right) + \mathbb {V} (\epsilon) \right] - \lambda \left[ \xi_ {a} \left(\Phi_ {i n v}\right) - \xi_ {b} \left(\Phi_ {i n v}\right) + \xi_ {c} \left(\Phi_ {i n v}\right) \right] \right. \\ \geq - (4 \lambda + 1) \zeta + \lambda \xi_ {c} \left(\Phi_ {i n v, r, s}\right) - \mathbb {V} (\epsilon) \\ \end{array} +$$ + +The first inequality is due to $\hat{\mathbb{E}}^e (y - \langle \hat{\beta},\Phi_{inv}(\pmb {x})\rangle)^2\geq 0$ and the definition of $\xi_{a}$ $\xi_{b}$ and $\xi_c$ . The second inequality is due to $|\xi_a(\Phi)|,|\xi_b(\Phi)|\leq \zeta$ (see Eq. (28) and (27)) and $\xi_c(\Phi_{inv}) = 0$ (see Eq. (29)). + +Then, by taking + +$$ +\lambda = \frac {2 \mathbb {V} (\epsilon)}{K _ {s} C ^ {2} \lambda_ {m i n} \Delta^ {2} / \lambda_ {m a x} ^ {4}} \geq \frac {2 \mathbb {V} (\epsilon)}{\xi_ {c} (\Phi_ {i n v , r , s})}, +$$ + +we have + +$$ +\hat {\mathcal {L}} (\Phi_ {i n v, r, s}) - \hat {\mathcal {L}} (\Phi_ {i n v}) > - (4 \lambda + 1) \Big (\frac {1}{1 - \kappa} \frac {2 \sigma^ {2} (2 K + 3 \ln (3 6 / \delta))}{n} + \sqrt {4 \ln (1 2 / \delta) / n} \Big) + \mathbb {V} (\epsilon) > 0 +$$ + +when the following holds + +$$ +n > \max \left\{\frac {(3 2 \lambda + 8) \sigma^ {2} (2 K + 3 \ln (3 6 / \delta))}{\mathbb {V} (\epsilon)}, \frac {(8 \lambda + 2) ^ {2} \ln (3 6 / \delta)}{\mathbb {V} (\epsilon) ^ {2}} \right\}. \tag {30} +$$ + +Step 2) Comparing $\hat{\mathcal{L}} (\Phi_{inv})$ with $\hat{\mathcal{L}} (\Phi_{inv,r})$ . Assume the absolute value of each element of $\gamma$ is lower bounded as $|\gamma_i| \geq \bar{\gamma}, \forall i \in [d_r]$ . The variance of each invariant feature is lower bounded as $\mathbb{V}(x_{inv,i}) \geq s, \forall i \in [d_r]$ . + +First, by simple algebra, we have + +$$ +\sum_ {e} \mathbb {E} ^ {e} (y - \langle \beta , \Phi_ {i n v, r} (\boldsymbol {x}) \rangle) ^ {2} - \mathbb {E} ^ {e} (y - \langle \beta , \Phi_ {i n v} (\boldsymbol {x}) \rangle) ^ {2} = \sum_ {i \in [ d _ {r} (\Phi) ]} r _ {i} \mathbb {V} (x _ {i n v, i}) +$$ + +Intuitively, to replace a feature $x_{inv,i}$ by a random feature lost a explanation component of $y$ , thus resulting in larger loss (which is equal to the variance of explanation component, $x_{inv,i}$ ). + +So with probability at least $1 - \delta$ , we have + +$$ +\begin{array}{l} \hat {\mathcal {L}} \left(\Phi_ {i n v, r}\right) - \hat {\mathcal {L}} \left(\Phi_ {i n v}\right) \\ = \Bigl(\xi_{a}(\Phi_{inv,r}) + \mathbb{V}(\epsilon) + \sum_{i\in [d_{r}(\Phi)]}r_{i}\mathbb{V}(x_{inv,i})\Bigr) + \lambda \Bigl(\xi_{a}(\Phi_{inv,r}) + \xi_{b}(\Phi_{inv,r}) + \xi_{c}(\Phi_{inv,r})\Bigr) \\ \left. - \left(\xi_ {a} \left(\Phi_ {i n v}\right) + \mathbb {V} (\epsilon)\right) - \lambda \left(\xi_ {a} \left(\Phi_ {i n v}\right) - \xi_ {b} \left(\Phi_ {i n v}\right) + \xi_ {c} \left(\Phi_ {i n v}\right)\right) \right. \\ = \Bigl ((\lambda + 1) \xi_ {a} (\Phi_ {i n v, r}) + \lambda \xi_ {b} (\Phi_ {i n v, r}) - (\lambda + 1) \xi_ {a} (\Phi_ {i n v}) - \lambda \xi_ {b} (\Phi_ {i n v}) \Bigr) + \sum_ {i \in [ d _ {r} (\Phi) ]} r _ {i} \mathbb {V} (x _ {i}) \\ \geq - (4 \lambda + 1) \zeta + \bar {\gamma} s \\ \end{array} +$$ + +The second inequality is because $\xi_c(\Phi_{inv}) = \xi_c(\Phi_{inv,r}) = 0$ . The first inequality is due to the definition of $\bar{\gamma}$ and $s$ in Assumption 3. The second inequality is due to $|\xi_a(\Phi)|, |\xi_b(\Phi)| \leq \zeta$ (see Eq. (28) and (27)) and $\xi_c(\Phi_{inv}) = 0$ (see Eq. (29)). So if + +$$ +n > \max \left\{\frac {(3 2 \lambda + 1 6) \sigma^ {2} (2 K + 3 \ln (3 6 / \delta))}{\bar {\gamma} s}, \frac {(8 \lambda + 4) ^ {2} \ln (3 6 / \delta)}{\bar {\gamma} ^ {2} s ^ {2}} \right\}, \tag {31} +$$ + +then $\hat{\mathcal{L}} (\Phi_{inv,r}) - \hat{\mathcal{L}} (\Phi_{inv}) > 0$ . Putting Eq. (23), (30) and (31) together, we have with probability at least $1 - \delta$ such if the following holds: + +$$ +\begin{array}{l} n > \underbrace {\left(2 K \sigma^ {2} (3 2 \lambda + 1 6) \left(\frac {1}{\bar {\gamma} s} + \frac {1}{\mathbb {V} [ \epsilon ]}\right) + 8 \rho^ {2} K \ln K\right)} _ {Q _ {1}} + \underbrace {\left(3 (3 2 \lambda + 1 6) ^ {2} \left(\frac {1}{\bar {\gamma} s} + \frac {1}{\bar {\gamma} ^ {2} s ^ {2}} + \frac {1}{\mathbb {V} [ \epsilon ]} + \frac {1}{\mathbb {V} [ \epsilon ] ^ {2}}\right) + 8 \rho^ {2} K\right)} _ {\tilde {Q} _ {2}} \ln (3 6 / \delta) \\ = Q _ {1} + \tilde {Q} _ {2} \ln (3 6 / \delta) \\ \end{array} +$$ + +Finally, noticing that the choices of $\Phi_{inv,r}$ and $\Phi_{inv,r}$ are no more than $2d^K$ , we then conclude that have that sparse IRM can uniquely identify $\Phi_{inv}$ if + +$$ +n > \tilde {Q} _ {1} + \tilde {Q} _ {2} \ln (7 2 d ^ {K} / \delta) > Q _ {1} + Q _ {2} \ln (d / \delta), +$$ + +where + +$$ +\tilde {Q} _ {1} = 2 K \sigma^ {2} (3 2 \lambda + 1 6) (\frac {1}{\bar {\gamma} s} + \frac {1}{\mathbb {V} [ \epsilon ]}) + 8 \rho^ {2} K \ln K, +$$ + +$$ +\tilde {Q} _ {2} = 3 (3 2 \lambda + 1 6) ^ {2} (\frac {1}{\bar {\gamma} s} + \frac {1}{\bar {\gamma} ^ {2} s ^ {2}} + + \frac {1}{\mathbb {V} [ \epsilon ]} + \frac {1}{\mathbb {V} [ \epsilon ] ^ {2}}) K + 8 \rho^ {2} K ^ {2}, +$$ + +$$ +Q _ {1} = \tilde {Q} _ {1} + \tilde {Q} _ {2} \ln (7 2), +$$ + +$$ +Q _ {2} = \tilde {Q} _ {2} K, +$$ + +$$ +\lambda = \frac {2 \mathbb {V} (\epsilon)}{K _ {s} C ^ {2} \lambda_ {\min} \Delta^ {2} / \lambda_ {\max} ^ {4}}. +$$ + +# C. Algorithm + +We present our training method for solving Problem (7) in Algorithm 1, which is adapted from the algorithm in (Zhou et al., 2021b). + +Algorithm 1 Sparse Invariant Risk Minimization (SparseIRM) +Input: target remaining ratio $k_{f} = 0.5$ , a dense network $\pmb{w}$ +1: Initialize $\pmb{w}$ , assign probabilities $\pmb{s}$ to weights $\pmb{w}$ , let $s = 1$ $K = k_{f}d_{w}$ and $\tau = 1$ +2: for training epoch $t = 1,2\dots T$ do +3: for each training iteration do +4: Sample mini batch of data $\mathcal{B} = \cup_{e\in \mathcal{E}_{tr}}\mathcal{B}^e$ with $\mathcal{B}^{e} = \{(x_{1}^{e},y_{1}^{e}),\dots ,(x_{B}^{e},y_{B}^{e})\}$ +5: Generate $\pmb{g_1}$ and $\pmb{g_0}$ with each element sampled from Gumbel(0, 1). +6: $s\gets \mathrm{proj}_C(z)$ ,with $z = s - \eta \nabla_s\mathcal{L}_B\Big(v,\sigma \big(\frac{\ln(\frac{s}{1 - s}) + g_1 - g_0}{\tau}\big)\circ \Phi \Big)$ +7: $\boldsymbol {w}\leftarrow \boldsymbol {w} - \eta \nabla_{\boldsymbol{w}}\mathcal{L}_{\mathcal{B}}\Big(\boldsymbol {v},\sigma \big(\frac{\ln(\frac{s}{1 - s}) + g_1 - g_0}{\tau}\big)\circ \Phi \Big)$ +8: end for +9: end for +output A sparse network $\{v,m\circ \Phi \}$ by sampling a mask m from the distribution $p(m|s)$ + +# D. Experimental Configurations + +
DatasetC/FCMCMCO
GPUs111
Epochs15005075
Weight OptimizerAdamSGDSGD
Weight Learning Rate0.00040.010.01
Weight Momentum-0.90.9
Probability OptimizerAdamAdamAdam
Probability Learning Rate6e-36e-36e-3
Penalty Weight100001000010000
Learning Rate SchedulerCosineCosineCosine
+ +Table 6. C/FCM stands for ColoredMNIST and FullColoredMNIST. CM stands for CIFARMNIST. CO stands for ColoredObject. + +
DatasetTraining AccuracyTesting Accuracy
Dim6416025639051264064160256390512640
Oracle74.6476.8077.8578.6379.2479.6776.3876.6176.1275.8075.6475.72
ERM84.4185.2185.6186.3186.7086.9425.2526.2727.5027.6727.9328.10
IRMv1IRM77.0478.1580.5483.4686.3389.7556.3663.3664.9760.6259.7557.51
MRM76.5676.5778.1984.5287.590.0462.564.6965.4962.2359.4755.91
SparseIRM77.2776.7478.1378.4378.0979.1665.0667.3068.2468.8869.2069.47
RExIRM72.8766.5476.1879.7483.4285.9346.0855.5960.2262.8364.1860.96
MRM68.7769.4974.6274.8672.7170.2253.4459.3366.7767.0866.5361.79
SparseIRM65.8374.6975.3176.7476.2777.2863.5071.2671.5471.6172.3772.83
+ +Table 7. Comparison of Training and Testing Accuracy of MLP on FullColoredMNIST50000 with varying hidden dimensions. + +[MLP and ResNet-18 Architectures] MLP consists of three linear layers, with weights of shape (392, hidden dimensions), (hidden dimensions, hidden dimensions) and (hidden dimensions, 1), respectively. The activation layer between linear layers is ReLU. Regular ResNet-18(He et al., 2016) architecture is adopted. + +
DatasetColoredMNIST20000FullColoredMNIST20000
Dim6416025639051264064160256390512640
Oracle66.8967.2668.9669.9770.3171.6268.3469.0769.4370.5070.9771.27
ERM23.5025.5624.3225.3824.7624.8327.8430.2931.0931.4331.1631.45
IRMv1IRM55.6262.4253.6247.2845.7336.8051.3754.1952.1346.8143.2141.18
MRM60.6965.0066.1765.5262.5653.5852.3955.4758.6652.5346.8943.42
SparseIRM64.6665.9166.5467.9268.2468.5457.9459.3459.9461.1162.3763.26
RExIRM51.9062.5162.5756.0952.0847.4345.7155.7756.3051.4844.7643.21
MRM59.3663.4965.1765.2464.6264.5250.9656.7459.4659.5458.9358.39
SparseIRM64.6267.1669.0169.7170.1070.4561.2563.0863.3563.5363.6263.74
+ +Table 8. Comparison of MLP on ColoredMNIST20000 and FullColoredMNIST20000 with varying hidden dimensions. + +# E. Additional Experimental Results + +# E.1. Training and Testing Accuracy of MLP on FullColoredMNIST50000 with varying hidden dimensions + +Following we present additional experimental results on training accuracy, in order to present the superior power of SparseIRM in preventing overfitting caused by overparameterization. From Table 7, we find that besides the better testing accuracy of SparseIRM, our method also achieves lower training accuracy than Oracle, ERM and IRM. The gap between training and testing accuracy of IRM and MRM is far larger than that of our MRM in all settings. The experimental results on training and testing accuracy further demonstrate the power of SparseIRM in reducing overfitting caused by overparameterization. + +# E.2. MLP on ColoredMNIST20000 and FullColoredMNIST20000 with Varying Hidden Dimensions + +Table 8 presents the detailed testing accuracy of MLP on ColoredMNIST20000 and FullColoredMNIST20000 with varying hidden dimensions, which are also presented in Figure 3. The results on ColoredMNIST20000 and FullColoredMNIST20000 demonstrate more superior performance compared with MRM. + +# F. Future Directions + +SparseIRM stills needs to demonstrate its applicability to NLP tasks especially on today's large pretraining language models (Devlin et al., 2018; Radford et al., 2019; Liu et al., 2019; Dao et al., 2019; Brown et al., 2020), cross-modal tasks (Gu et al., 2018; Gao et al., 2022; Zhou et al., 2022a), domain adaptation tasks (Dao et al., 2021; Huang et al., 2022), self-supervised + +learning tasks (He et al., 2020; Grill et al., 2020; Chen et al., 2021b; Liu et al., 2022). It is also interesting to explore how SparseIRM interacts with other parallel domain generalization methods (Luo et al., 2018; Bai et al., 2021a;b), how it performs when applied with other sparse training methods (Shao et al., 2019; Kusupati et al., 2020) and how it performs on more challenging benchmarks (Ye et al., 2022). \ No newline at end of file diff --git a/sparseinvariantriskminimization/images.zip b/sparseinvariantriskminimization/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..ba3d7fcfdf97c5c1cc33b8a92ef62e728b95b3fa --- /dev/null +++ b/sparseinvariantriskminimization/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3ec947dbf1ca983ae3a77bad6343790d94a078f78f1222f1095c9be59b004833 +size 1368641 diff --git a/sparseinvariantriskminimization/layout.json b/sparseinvariantriskminimization/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..6c90e962048d13eded9efd67937dbb6a58ab405b --- /dev/null +++ b/sparseinvariantriskminimization/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0ca044a15fe0e8f1daea7d71bac9989240b7bb27d6faa8029ecbc5693ab3f999 +size 909943 diff --git a/sparsemixedlinearregressionwithguaranteestaminganintractableproblemwithinvexrelaxation/e709fd08-0b59-4653-a10a-9c23d9b08987_content_list.json b/sparsemixedlinearregressionwithguaranteestaminganintractableproblemwithinvexrelaxation/e709fd08-0b59-4653-a10a-9c23d9b08987_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..8fe1e5a1a8413e0974c55fa4ad677d1695202ab8 --- /dev/null +++ b/sparsemixedlinearregressionwithguaranteestaminganintractableproblemwithinvexrelaxation/e709fd08-0b59-4653-a10a-9c23d9b08987_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:237e63de50ae7cc3b9e9b17e204b2a725df6b7828870b2fe60cfe8196a1a2408 +size 173872 diff --git a/sparsemixedlinearregressionwithguaranteestaminganintractableproblemwithinvexrelaxation/e709fd08-0b59-4653-a10a-9c23d9b08987_model.json b/sparsemixedlinearregressionwithguaranteestaminganintractableproblemwithinvexrelaxation/e709fd08-0b59-4653-a10a-9c23d9b08987_model.json new file mode 100644 index 0000000000000000000000000000000000000000..64f66e69766c1a503b5ed6cbabfddd2fa68a5d20 --- /dev/null +++ b/sparsemixedlinearregressionwithguaranteestaminganintractableproblemwithinvexrelaxation/e709fd08-0b59-4653-a10a-9c23d9b08987_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e7d8dc9fe83d66a78f51571fd4638da36590293757fbd1d257c7077843ee1583 +size 199973 diff --git a/sparsemixedlinearregressionwithguaranteestaminganintractableproblemwithinvexrelaxation/e709fd08-0b59-4653-a10a-9c23d9b08987_origin.pdf b/sparsemixedlinearregressionwithguaranteestaminganintractableproblemwithinvexrelaxation/e709fd08-0b59-4653-a10a-9c23d9b08987_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c58689f1af5ca2a750c48c4b650cbc3e0e42fd27 --- /dev/null +++ b/sparsemixedlinearregressionwithguaranteestaminganintractableproblemwithinvexrelaxation/e709fd08-0b59-4653-a10a-9c23d9b08987_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ca79b8752d647230f64e6092311f01e24fdd4791234d7caa4f2e0ab9b82b9ba7 +size 805042 diff --git a/sparsemixedlinearregressionwithguaranteestaminganintractableproblemwithinvexrelaxation/full.md b/sparsemixedlinearregressionwithguaranteestaminganintractableproblemwithinvexrelaxation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..f5df617880fa8903927417c5e9a3c26f7d50d3e2 --- /dev/null +++ b/sparsemixedlinearregressionwithguaranteestaminganintractableproblemwithinvexrelaxation/full.md @@ -0,0 +1,1013 @@ +# Sparse Mixed Linear Regression with Guarantees: Taming an Intractable Problem with Convex Relaxation + +Adarsh Barik $^{*1}$ Jean Honorio $^{*1}$ + +# Abstract + +In this paper, we study the problem of sparse mixed linear regression on an unlabeled dataset that is generated from linear measurements from two different regression parameter vectors. Since the data is unlabeled, our task is not only to figure out a good approximation of the regression parameter vectors but also to label the dataset correctly. In its original form, this problem is NP-hard. The most popular algorithms to solve this problem (such as Expectation-Maximization) have a tendency to stuck at local minima. We provide a novel invex relaxation for this intractable problem which leads to a solution with provable theoretical guarantees. This relaxation enables exact recovery of data labels. Furthermore, we recover a close approximation of the regression parameter vectors which match the true parameter vectors in support and sign. Our formulation uses a carefully constructed primal dual witnesses framework for the invex problem. Furthermore, we show that the sample complexity of our method is only logarithmic in terms of the dimension of the regression parameter vectors. + +# 1. Introduction + +In this paper, we study sparse mixed linear regression where the measurements come from one of the two regression models depending upon the unknown label $z_{i}^{*} \in \{0,1\}$ . The observation model can be described as follows: + +$$ +y _ {i} = z _ {i} ^ {*} \langle X _ {i}, \beta_ {1} ^ {*} \rangle + (1 - z _ {i} ^ {*}) \langle X _ {i}, \beta_ {2} ^ {*} \rangle + e _ {i}, \forall i \in \{1, \dots , n \}, \tag {1} +$$ + +where $X_{i}\in \mathbb{R}^{d},y_{i}\in \mathbb{R}$ and $e_i\in \mathbb{R}$ is independent additive noise. The regression parameter vectors $\beta_1^*\in \mathbb{R}^d$ $\beta_{2}^{*}\in \mathbb{R}^{d}$ + +are sparse vectors with possibly non-overlapping supports. + +Mixed linear regression models have been extensively used in a wide range of applications (Grün et al., 2007) which include but are not limited to behavioral health-care (Deb & Holmes, 2000), market segmentation (Wedel & Kamakura, 2000), music perception studies (Viele & Tong, 2002) and vehicle merging (Li et al., 2019). The main task of the problem is to estimate the regression parameter vectors and the unknown labels accurately from linear measurements. However, the problem is NP-hard without any assumptions (Yi et al., 2014). Being such a difficult problem, it also lends itself to be used as a benchmark for many non-convex optimization algorithms (Chaganty & Liang, 2013; Klusowski et al., 2019). + +Related Work. There have been many approaches to solve the mixed linear regression problem after it was introduced by (Wedel & DeSarbo, 1995). The most popular and natural approach has been to use Expectation-minimization (EM) based alternate minimization algorithms (see Ghosh & Kannan (2020) and references therein). More broadly, the problem can be modeled under the hierarchical mixtures of experts model (Jordan & Jacobs, 1994) and solved using EM based algorithms. All these methods run the risk of getting stuck at local minima (Wu, 1983) without good initialization. (Yi et al., 2014) provides a good initialization for the noiseless case under strict technical conditions, however their method does not provide any guarantees for the noisy case. Based on the recent work of (Anandkumar et al., 2014; Hsu & Kakade, 2013), (Chaganty & Liang, 2013) have proposed an approach which uses a third order moment method based on tensor decomposition. Their approach suffers from high sample complexity (up to $\mathcal{O}(d^6)$ ) due to tensor decomposition. (Städler et al., 2010) proposed an $\ell_1$ -regularized approach for the sparse case and showed the existence of a local minimizer with correct support but there are no guarantees that EM achieves this local minima. (Chen et al., 2014) provided a convex relaxation involving nuclear norms for the problem. They do not focus on providing guarantees for exact label recovery and their results only hold for bounded noise and require balanced samples (almost equal number of samples for both labels). Besides, the optimization problems involving nuclear norms are computationally heavy + +and slow. The mixed linear regression problem can also be modeled as a subspace clustering problem. But typically these problems require $\mathcal{O}(d^2)$ measurements to have a unique solution (Vidal et al., 2005; Elhamifar & Vidal, 2013). + +Contribution. Broadly, we can categorize our contribution in the following points: + +- A Combinatorial Problem: We view the problem as a combinatorial version of a mixture of sparse linear regressions. The exact label recovery is as important for us as the recovery of regression vectors. This added exact label recovery guarantee comes at no extra cost in terms of the performance. +- Invex Relaxation: We solve a non-convex problem which is known to be intractable. We propose a novel relaxation of the combinatorial problem and formally show that this relaxation is invex. +- Theoretical Guarantees: Our method solves two sparse linear regressions and a label recovery problem simultaneously with theoretical guarantees. To that end, we recover the true labels and sparse regression parameter vectors which are correct up to the sign of entries with respect to the true parameter vectors. As a side product, we propose a novel primal-dual witness construction for our invex problem and provide theoretical guarantees for recovery. The sample complexity of our method only varies logarithmically with respect to dimension of the regression parameter vector. +- A Novel Framework: It should be noted that we are providing a novel framework (not an algorithm) to solve the problem. This opens the door for many algorithms to be used for this problem. + +# 2. Problem Setup + +In this section, we collect the notations used throughout the paper and define our problem formally. We consider a problem where measurements come from a mixture of two linear regression problem. Let $y_{i} \in \mathbb{R}$ be the response variable and $X_{i} \in \mathbb{R}^{d}$ be the observed attributes. Let $z_{i}^{*} \in \{0,1\}$ denote the unknown label associated with measurement $i$ . The response $y_{i}$ is generated using the observation model (1) where $e_{i} \in \mathbb{R}$ is an independent noise term. We collect a total of $n$ linear measurements with $n_1$ measurements belonging to label 1 and $n_2$ measurements belonging to label 0. Clearly, $n = n_1 + n_2$ . We take $\| \beta_1^* \|_1 \leqslant b_1$ and $\| \beta_2^* \|_1 \leqslant b_2$ . + +Let $[d]$ denote the set $\{1,2,\dots ,d\}$ . We assume $X_{i}\in \mathbb{R}^{d}$ to be a zero mean sub-Gaussian random vector (Hsu et al., 2012) with covariance $\Sigma \in \mathbb{S}_{+}^{d}$ , i.e., there exists a $\rho >0$ , such that for all $\tau \in \mathbb{R}^d$ the following holds: + +$\mathbb{E}(\exp (\tau^{\mathsf{T}}X_{i}))\leqslant \exp (\frac{\|\tau\|_{2}^{2}\rho^{2}}{2})$ . By simply taking $\tau_{j} = r$ and $\tau_{k} = 0,\forall k\neq j$ , it follows that each entry of $X_{i}$ is sub-Gaussian with parameter $\rho$ . In particular, we will assume that $\forall j\in [d],\frac{X_{ij}}{\sqrt{\Sigma_{jj}}}$ is a sub-Gaussian random variable with parameter $\sigma >0$ . It follows trivially that $\max_{j\in [d]}\sqrt{\Sigma_{jj}}\sigma \leqslant \rho$ . We will further assume that $e_i$ is zero mean independent sub-Gaussian noise with variance $\sigma_{e}$ . Our setting works with a variety of random variables as the class of sub-Gaussian random variable includes for instance Gaussian variables, any bounded random variable (e.g., Bernoulli, multinomial, uniform), any random variable with strictly log-concave density, and any finite mixture of sub-Gaussian variables. + +The parameter vectors $\beta_1^* \in \mathbb{R}^d$ and $\beta_2^* \in \mathbb{R}^d$ are $s_1$ -sparse and $s_2$ -sparse respectively, i.e., at most $s_1$ entries of $\beta_1^*$ are non-zero whereas at most $s_2$ entries of $\beta_2^*$ are non-zero. We receive $n$ i.i.d. samples of $X_i \in \mathbb{R}^d$ and $y_i \in \mathbb{R}$ and collect them in $X \in \mathbb{R}^{n \times d}$ and $y \in \mathbb{R}^n$ respectively. Similarly, $z^* \in \{0, 1\}^n$ collects all the labels. Our goal is to recover $\beta_1^*, \beta_2^*$ and $z^*$ using the samples $(X, y)$ . + +We denote a matrix $A \in \mathbb{R}^{p \times q}$ restricted to the columns and rows in $P \subseteq [p]$ and $Q \subseteq [q]$ respectively as $A_{PQ}$ . Similarly, a vector $v \in \mathbb{R}^p$ restricted to entries in $P$ is denoted as $v_P$ . We use $\mathrm{eig}_i(A)$ to denote the $i$ -th eigenvalue (1st being the smallest) of matrix $A$ . Similarly, $\mathrm{eig}_{\max}(A)$ denotes the maximum eigenvalue of matrix $A$ . We use $\mathrm{diag}(A)$ to denote a vector containing the diagonal element of matrix $A$ . By overriding the same notation, we use $\mathrm{diag}(v)$ to denote a diagonal matrix with its diagonal being the entries in vector $v$ . We denote the inner product between two matrices (or vectors) $A$ and $B$ by $\langle A, B \rangle$ , i.e., $\langle A, B \rangle = \operatorname{trace}(A^\top B)$ , where trace denotes the trace of a matrix. The notation $A \geq B$ denotes that $A - B$ is a positive semidefinite matrix. Similarly, $A > B$ denotes that $A - B$ is a positive definite matrix. For vectors, $\| v \|_p$ denotes the $\ell_p$ -vector norm of vector $v \in \mathbb{R}^d$ , i.e., $\| v \|_p = \left( \sum_{i=1}^d |v_i|^p \right)^{\frac{1}{p}}$ . If $p = \infty$ , then we define $\| v \|_{\infty} = \max_{i=1}^d |v_i|$ . As is the tradition, we used $\| v \|_0$ to denote number of non-zero entries on vector $v$ . It should be remembered that $\ell_0$ is not a proper vector norm. For matrices, $\| A \|_p$ denotes the induced $\ell_p$ -matrix norm for matrix $A \in \mathbb{R}^{p \times q}$ . In particular, $\| A \|_2$ denotes the spectral norm of $A$ and $\| A \|_{\infty} = \max_{i \in [p]} \sum_{j=1}^q |A_{ij}|$ . For a matrix $A \in \mathbb{R}^{p \times q}$ , $A(:,) \in \mathbb{R}^{pq}$ denotes a vector which collects all entries of the matrix $A$ . We define an operator $\mathrm{sign}(A)$ for a matrix (or vector) $A$ , which returns a matrix (or a vector) with entries being the sign of the entries of $A$ . A function $f(x)$ is of order $\Omega(g(x))$ and denoted by $f(x) = \Omega(g(x))$ , if there exists a constant $C > 0$ such that for big enough $x_0$ , $f(x) \geq C g(x), \forall x \geq x_0$ . Similarly, a function $f(x)$ is of order $\mathcal{O}(g(x))$ and denoted by $f(x) = \mathcal{O}(g(x))$ , if there exists a constant $C > 0$ such that for big enough $x_0$ , $f(x) \leq C g(x), \forall x \geq x_0$ . For brevity in our notations, we + +treat any quantity independent of $d, s$ and $n$ as constant. Detailed proofs for lemmas and theorems are available in the supplementary material. + +# 3. A Novel Convex Relaxation + +In this section, we introduce a combinatorial formulation for mixed linear regression (MLR) and propose a novel invex relaxation for this problem. Since the measurements come from a true observation model (1), we can write the following optimization problem to estimate $\beta_1^*,\beta_2^*$ and $z^{*}$ + +Definition 3.1 (Standard MLR). + +$$ +\begin{array}{c c} \min _ {\beta_ {1} \in \mathbb {R} ^ {d}, \beta_ {2} \in \mathbb {R} ^ {d}, z \in \{0, 1 \} ^ {n}} & l (z, \beta_ {1}, \beta_ {2}) \\ \text {s u c h t h a t} & \| \beta_ {1} \| _ {0} = s _ {1}, \| \beta_ {2} \| _ {0} = s _ {2} \end{array} \tag {2} +$$ + +where $l(z,\beta_1,\beta_2) = \frac{1}{n}\sum_{i = 1}^{n}z_i(y_i - X_i^\top \beta_1)^2 +(1 - z_i)(y_i - X_i^\top \beta_2)^2.$ + +Even without constraints, optimization problem (2) is a nonconvex NP-hard problem (Yi et al., 2014) in its current form. In fact, a continuous relaxation of $z \in [0,1]^n$ does not help and it still remains a non-convex problem (See Appendix A). Furthermore, the sparsity constraints make it even difficult to solve. To deal with this intractability, we come up with a novel invex relaxation of the problem. + +For ease of notation, we define the following quantities: + +$$ +S _ {i} = \left[ \begin{array}{c} X _ {i} \\ - y _ {i} \end{array} \right] \left[ \begin{array}{c c} X _ {i} ^ {\intercal} & - y _ {i} \end{array} \right] = \left[ \begin{array}{c c} X _ {i} X _ {i} ^ {\intercal} & - X _ {i} y _ {i} \\ - y _ {i} X _ {i} ^ {\intercal} & y _ {i} ^ {2} \end{array} \right], \tag {3} +$$ + +We provide the following invex relaxation to the optimization problem (2). + +Definition 3.2 (Invex MLR). + +$$ +\min _ {t, W, U} \quad f (t, W, U) + \lambda_ {1} g (t, W, U) + \lambda_ {2} h (t, W, U) +$$ + +such that + +$$ +\begin{array}{c} W \succeq \mathbf {0}, U \succeq \mathbf {0} \\ W _ {d + 1, d + 1} = 1, U _ {d + 1, d + 1} = 1 \\ \| t \| _ {\infty} \leqslant 1 \end{array} \tag {4} +$$ + +where $f(t,W,U) = \sum_{i=1}^{n} \frac{1}{2} \langle S_i, W + U \rangle + \sum_{i=1}^{n} \frac{1}{2} t_i \langle S_i, W - U \rangle, g(t,W,U) = \|W(:)\|_1$ and $h(t,W,U) = \|U(:)\|_1$ and $\lambda_1$ and $\lambda_2$ are positive regularizers. + +To get an intuition behind this formulation, one can think of $W$ and $U$ as two rank-1 matrices which are defined as follows: + +$$ +W = \left[ \begin{array}{l} \beta_ {1} \\ 1 \end{array} \right] \left[ \begin{array}{l l} \beta_ {1} ^ {\intercal} & 1 \end{array} \right], U = \left[ \begin{array}{l} \beta_ {2} \\ 1 \end{array} \right] \left[ \begin{array}{l l} \beta_ {2} ^ {\intercal} & 1 \end{array} \right] \tag {5} +$$ + +The variable $t$ is simply a replacement of variable $z$ , i.e., $z_{i} = \frac{t_{i} + 1}{2}$ . An analogous transformation exists between $z_{i}^{*}$ and $t_{i}^{*}$ . Then after substituting $t, W$ and $U$ in $f(t, W, U)$ , we get back $l(z, \beta_{1}, \beta_{2})$ . The $\ell_{1}$ -regularization of $W(:,)$ and $U(:,)$ helps us ensure sparsity. Note that for fixed $t$ , optimization problem (4) is continuous and convex with respect to $W$ and $U$ . Specifically, it merges two independent regularized semidefinite programs. Unfortunately, problem (4) is not jointly convex on $t, W$ and $U$ , and thus, it might still remain difficult to solve. Next, we will provide arguments that despite being non-convex, optimization problem (4) belongs to a particular class of non-convex functions namely "invex" functions. The "invexity" of functions can be defined as a generalization of convexity (Hanson, 1981). Invexity has been recently used by (Barik & Honorio, 2021) to solve fair sparse regression problems with clustering. While, we borrow some definitions from their work to suit our context, we should emphasize that our problem is fundamentally different than their problem. They use two groups in sparse regression which have different means and they try to achieve fairness. While here, we have two groups with the same mean and there is no unfairness in the problem. We also model our parameter vectors with positive semidefinite matrices which is fundamentally different from their approach. + +Definition 3.3 (Invex function (Barik & Honorio, 2021)). Let $\phi(t)$ be a function defined on a set $C$ . Let $\eta$ be a vector valued function defined in $C \times C$ such that $\eta(t_1, t_2)^\top \nabla \phi(t_2)$ , is well defined $\forall t_1, t_2 \in C$ . Then, $\phi(t)$ is a $\eta$ -invex function if $\phi(t_1) - \phi(t_2) \geqslant \eta(t_1, t_2)^\top \nabla \phi(t_2)$ , $\forall t_1, t_2 \in C$ . + +Note that convex functions are $\eta$ -invex for $\eta(t_1, t_2) = t_1 - t_2$ . (Hanson, 1981) showed that if the objective function and constraints are both $\eta$ -invex with respect to same $\eta$ defined in $C \times C$ , then Karush-Kuhn-Tucker (KKT) conditions are sufficient for optimality, while it is well-known that KKT conditions are necessary. (Ben-Israel & Mond, 1986) showed a function is invex if and only if each of its stationarity point is a global minimum. + +In the next lemma, we show that the relaxed optimization problem (4) is indeed $\eta$ -invex for a particular $\eta$ defined in $C \times C$ and a well-defined set $C$ . Let $C = \{(t, W, U) \mid t \in [-1, 1]^n, W \succeq \mathbf{0}, U \succeq \mathbf{0}, W_{d+1,d+1} = 1, U_{d+1,d+1} = 1\}$ . + +Lemma 3.4. For $(t,W,U) \in C$ , the functions $f(t,W,U) = \sum_{i=1}^{n} \frac{1}{2}\langle S_i, W + U \rangle + \sum_{i=1}^{n} \frac{1}{2} t_i\langle S_i, W - U \rangle$ , $g(t,W,U) = \|W(\cdot)\|_1$ and $h(t,W,U) = \|U(\cdot)\|_1$ are $\eta$ -invex for $\eta(t,\tilde{t},W,\widetilde{W},U,\widetilde{U}) \triangleq \begin{bmatrix} \eta_t \\ \eta_W \\ \eta_U \end{bmatrix}$ , where $\eta_t = \mathbf{0} \in$ + +$\mathbb{R}^n$ $\eta_W = -\widetilde{W}$ and $\eta_U = -\widetilde{U}$ . We abuse the vector/matrix notation (by ignoring the dimensions) for clarity of presentation, and avoid the vectorization of matrices. + +Now that we have established that optimization problem (4) is invex, we are ready to discuss our main results in the next section. + +# 4. Main Results + +In this section, we present our main results along with the technical assumptions. Our main goal is to show that the solution to optimization problem (4) recovers the labels $t^*$ exactly and also recovers a good approximation of $\beta_1^*$ and $\beta_2^*$ . In that, we will show that the recovered $\beta_1$ and $\beta_2$ have the same support and sign as $\beta_1^*$ and $\beta_2^*$ respectively and are close to the true vectors in $\ell_2$ -norm. But before that, we will describe a set of technical assumptions which will help us in our analysis. + +# 4.1. Assumptions + +Our first assumption ensures that each sample can be assigned only one label. Formally, + +Assumption 4.1 (Identifiability). For $i \in [n]$ , $-\frac{1}{2}(y_i - X_i^\top \beta_1^*)^2 + \frac{1}{2}(y_i - X_i^\top \beta_2^*)^2 \geqslant \epsilon$ if $z_i^* = 1$ and $\frac{1}{2}(y_i - X_i^\top \beta_1^*)^2 - \frac{1}{2}(y_i - X_i^\top \beta_2^*)^2 \geqslant \epsilon$ if $z_i^* = 0$ for some $\epsilon > 0$ . + +Clearly, if Assumption 4.1 does not hold for sample $i$ , then we can reverse the label of sample $i$ without increasing objective function of optimization problem (2). Another equivalent way of expressing Assumption 4.1 is as following: for $i \in [n]$ , $\langle S_i, W^* \rangle < \langle S_i, U^* \rangle$ if $z_i^* = 1$ and $\langle S_i, W^* \rangle > \langle S_i, U^* \rangle$ if $z_i^* = 0$ where, + +$$ +W ^ {*} = \left[ \begin{array}{c} \beta_ {1} ^ {*} \\ 1 \end{array} \right] \left[ \begin{array}{l l} \beta_ {1} ^ {* \mathsf {T}} & 1 \end{array} \right], U ^ {*} = \left[ \begin{array}{c} \beta_ {2} ^ {*} \\ 1 \end{array} \right] \left[ \begin{array}{l l} \beta_ {2} ^ {* \mathsf {T}} & 1 \end{array} \right]. \tag {6} +$$ + +Let $P$ denote the support of $\beta_{1}^{*}$ , i.e., $P = \{i|\beta_{1i}^{*}\neq 0,i\in [d]\}$ and let $Q$ denote the support of $\beta_{2}^{*}$ , i.e., $Q = \{i|\beta_{2i}^{*}\neq 0,i\in [d]\}$ . Similarly, we define their complement as $P^c = \{i|\beta_{1i}^{*} = 0,i\in [d]\}$ and $Q^{c} = \{i|\beta_{2i}^{*} = 0,i\in [d]\}$ . We take $|P| = s_1,|P^c | = d - s_1,|Q| = s_2$ and $|Q^{c}| = d - s_{2}$ . For ease of notation, we define $H\triangleq \mathbb{E}(X_iX_i^\top)\forall i\in [n]$ . Let $\mathcal{I}_1\triangleq \{i|z_i^* = 1,i\in [n]\}$ and $\mathcal{I}_2\triangleq \{i|z_i^* = 0,i\in [n]\}$ . We define $\hat{H}_1\triangleq \frac{1}{n_1}\sum_{i\in \mathcal{I}_1}X_iX_i^\top$ and $\hat{H}_2\triangleq \frac{1}{n_2}\sum_{i\in \mathcal{I}_2}X_iX_i^\top$ . As our next assumption, we need the minimum eigenvalue of the population covariance matrix of $X$ restricted to rows and columns in $P$ (similarly in $Q$ ) to be greater than zero. + +Assumption 4.2 (Positive Definiteness of Hessian). $H_{PP} > 0$ and $H_{QQ} > 0$ or equivalently $\min (\mathrm{eig}_{\min}(H_{PP}),\mathrm{eig}_{\min}(H_{QQ})) = C_{\min} > 0$ . We also assume that $\mathrm{eig}_{\max}(H) = C_{\max} > 0$ . Note that $\max (\mathrm{eig}_{\max}(H_{PP}),\mathrm{eig}_{\max}(H_{QQ}))\leqslant C_{\max}$ . + +In practice, we only deal with finite samples and not populations. In the next lemma, we will show that with a sufficient + +number of samples, a condition similar to Assumption 4.2 holds with high probability in the finite-sample setting. + +Lemma 4.3. If Assumption 4.2 holds and $n_1 = \Omega \left(\frac{s_1 + \log d}{C_{\min}^2}\right)$ and $n_2 = \Omega \left(\frac{s_2 + \log d}{C_{\min}^2}\right)$ , then $\min (\mathrm{eig}_{\min}(\hat{H}_{1PP}),\mathrm{eig}_{\min}(\hat{H}_{2QQ})) \geqslant \frac{C_{\min}}{2}$ and $\max (\mathrm{eig}_{\max}(\hat{H}_{1PP}),\mathrm{eig}_{\max}(\hat{H}_{2QQ})) \leqslant \frac{3C_{\max}}{2}$ with probability at least $1 - \mathcal{O}\left(\frac{1}{d}\right)$ . + +As the third assumption, we will need to ensure that the variates outside the support of $\beta_{1}^{*}$ and $\beta_{2}^{*}$ do not exert lot of influence on the variates in the support of $\beta_{1}^{*}$ and $\beta_{2}^{*}$ respectively. For this, we use a technical condition commonly known as the mutual incoherence condition. It has been previously used in many problems related to regularized regression such as compressed sensing (Wainwright, 2009b), Markov random fields (Ravikumar et al., 2010), non-parametric regression (Ravikumar et al., 2007), diffusion networks (Daneshmand et al., 2014), among others. + +Assumption 4.4 (Mutual) Incoherence). max( $\| H_{P^c P}H_{PP}^{-1}\|_{\infty},\| H_{Q^c Q}H_{QQ}^{-1}\|_{\infty})\leqslant 1 - \xi$ for some $\xi \in (0,1]$ + +Again, we will show that with a sufficient number of samples, a condition similar to Assumption 4.4 holds in the finite-sample setting with high probability. + +Lemma 4.5. If Assumption 4.4 holds and $n_1 = \Omega\left(\frac{s_1^3(\log s_1 + \log d)}{\tau(C_{\min},\xi,\sigma,\Sigma)}\right)$ and $n_2 = \Omega\left(\frac{s_2^3(\log s_2 + \log d)}{\tau(C_{\min},\xi,\sigma,\Sigma)}\right)$ , then $\max\left(\|\hat{H}_{P^c P}\hat{H}_{PP}^{-1}\|_{\infty},\|\hat{H}_{Q^c Q}\hat{H}_{QQ}^{-1}\|_{\infty}\right) \leqslant 1 - \frac{\xi}{2}$ with probability at least $1 - \mathcal{O}\left(\frac{1}{d}\right)$ where $\tau(C_{\min},\xi,\sigma,\Sigma)$ is a constant independent of $n_1, n_2, d, s_1$ and $s_2$ . + +# 4.2. Main Theorem + +Now we are ready to state our main result. + +Theorem 4.6. If Assumptions 4.1, 4.2 and 4.4 hold, $\lambda_1 \geqslant \frac{64\rho\sigma_e}{\xi}\sqrt{n_1\log d}, \lambda_2 \geqslant \frac{64\rho\sigma_e}{\xi}\sqrt{n_2\log d}$ and $n_1 = \Omega\left(\frac{s_1^3\log^2d}{\tau_0(C_{\min},\xi,\sigma,\Sigma,\rho)}\right)$ and $n_2 = \Omega\left(\frac{s_2^3\log^2d}{\tau_0(C_{\min},\xi,\sigma,\Sigma,\rho)}\right)$ , then with probability at least $1 - \mathcal{O}\left(\frac{1}{d}\right)$ the solution to the optimization problem (4) satisfies the following properties: + +1. The labels are recovered exactly, i.e., + +$$ +t _ {i} = t _ {i} ^ {*}, \forall i \in [ n ] \tag {7} +$$ + +2. The regression parameter vectors are close to the true vectors. Formally, + +$$ +W = \left[ \begin{array}{l} \beta_ {1} \\ 1 \end{array} \right] \left[ \begin{array}{l l} \beta_ {1} ^ {\intercal} & 1 \end{array} \right], U = \left[ \begin{array}{l} \beta_ {2} \\ 1 \end{array} \right] \left[ \begin{array}{l l} \beta_ {2} ^ {\intercal} & 1 \end{array} \right] \tag {8} +$$ + +such that $\beta_{1} = \left[ \begin{array}{cc}\beta_{1_{P}} & \mathbf{0}_{P^{c}} \end{array} \right]^{\intercal}$ and $\beta_{2} = \left[ \begin{array}{cc}\beta_{2_{Q}} & \mathbf{0}_{Q^{c}} \end{array} \right]^{\intercal}$ + +and + +$$ +\left\| \beta_ {1} - \beta_ {1} ^ {*} \right\| _ {2} \leqslant \left(2 + b _ {1}\right) \frac {2 \lambda_ {1} \sqrt {s _ {1}}}{C _ {\min } n _ {1}} \tag {9} +$$ + +$$ +\left\| \beta_ {2} - \beta_ {2} ^ {*} \right\| _ {2} \leqslant \left(2 + b _ {2}\right) \frac {2 \lambda_ {2} \sqrt {s _ {2}}}{C _ {\operatorname* {m i n}} n _ {2}}. +$$ + +In order to prove Theorem 4.6, we will have to show that the labels are recovered exactly. We will also need to show that $W$ and $U$ are rank-1 matrices with eigenvectors $\left[\beta_{1} \quad 1\right]^{\mathsf{T}}$ and $\left[\beta_{2} \quad 1\right]^{\mathsf{T}}$ respectively. Moreover, we will also need to ensure that their supports match supports of the true vectors and they are close to true vectors in $\ell_{2}$ -norm. + +# 5. Theoretical Analysis + +We use primal-dual witness approach to show our results. The primal-dual witness approach was developed by (Wainwright, 2009a) for linear regression problem which has been later used in many convex problems such as Markov random fields (Ravikumar et al., 2010), non-parametric regression (Ravikumar et al., 2007), diffusion networks (Daneshmand et al., 2014) etc. The main idea is to start with a potential solution with certain properties and then later show that these properties are indeed consistent with the final solution. We extend this idea to our invex problem. To that end, we start our proof with a potential solution which has certain "consistency certificate". + +# 5.1. Consistency Certificate + +We start by taking solutions $W$ and $U$ with the following properties which we call consistency certificates: + +C1. $W$ and $U$ are sparse. In particular, they have the following sparsity structure: + +$$ +\begin{array}{l} W = \left[ \begin{array}{c c c} W _ {P P} & \mathbf {0} _ {P P ^ {c}} & W _ {P d + 1} \\ \mathbf {0} _ {P ^ {c} P} & \mathbf {0} _ {P ^ {c} P ^ {c}} & \mathbf {0} _ {P ^ {c} d + 1} \\ W _ {d + 1 P} & \mathbf {0} _ {d + 1 P ^ {c}} & W _ {d + 1, d + 1} \end{array} \right] \tag {10} \\ U = \left[ \begin{array}{c c c} U _ {Q Q} & \mathbf {0} _ {Q Q ^ {c}} & U _ {Q d + 1} \\ \mathbf {0} _ {Q ^ {c} Q} & \mathbf {0} _ {Q ^ {c} Q ^ {c}} & \mathbf {0} _ {Q ^ {c} d + 1} \\ U _ {d + 1 Q} & \mathbf {0} _ {d + 1 Q ^ {c}} & U _ {d + 1, d + 1} \end{array} \right] \\ \end{array} +$$ + +We collect all the non-zero entries of $W$ and $U$ in $\overline{W} \in \mathbb{R}^{s_1 + 1, s_1 + 1}$ and $\overline{U} \in \mathbb{R}^{s_2 + 1, s_2 + 1}$ . + +It should be noted that the consistency certificate C1 is not another assumption. In that, eventually we will have to show that it holds in the final solution. We can prove that C1 is consistent with the final solution by showing strict dual feasibility for both $W$ and $U$ which we do in subsection 5.7. + +# 5.2. A Modified Compact Convex Problem + +Once we substitute $W$ and $U$ from C1 in optimization problem (4), we get a low dimensional optimization problem. + +Definition 5.1 (Compact Invex MLR). + +$$ +\min _ {t, \bar {W}, \bar {U}} \quad \bar {f} (t, \bar {W}, \bar {U}) + \lambda_ {1} \bar {g} (t, \bar {W}, \bar {U}) + \lambda_ {2} \bar {h} (t, \bar {W}, \bar {U}) +$$ + +such that + +$$ +\overline {{W}} \succeq \mathbf {0}, \overline {{U}} \succeq \mathbf {0} +$$ + +$$ +\begin{array}{l} \overline {{W}} _ {s _ {1} + 1, s _ {1} + 1} = 1, \quad \overline {{U}} _ {s _ {2} + 1, s _ {2} + 1} = 1 \\ \| t \| _ {\infty} \leqslant 1 \tag {11} \\ \end{array} +$$ + +where $\bar{f} (t,\overline{W},\overline{U}) = \sum_{i = 1}^{n}\frac{1}{2} (\langle \overline{S}_i^P,\overline{W}\rangle +\langle \overline{S}_i^Q,\overline{U}\rangle) + \sum_{i = 1}^{n}\frac{1}{2} t_i(\langle \overline{S}_i^P,\overline{W}\rangle -\langle \overline{S}_i^Q,\overline{U}\rangle),\bar{g} (t,\overline{W},\overline{U}) = \| \overline{W} (:)\| _1,$ $\bar{h} (t,\overline{W},\overline{U}) = \| \overline{U} (:)\| _1$ and $\lambda_{1}$ and $\lambda_{2}$ are positive regularizers. + +Note that + +$$ +\bar {S} _ {i} ^ {P} = \left[ \begin{array}{c c} S _ {i _ {P, P}} & S _ {i _ {P, d + 1}} \\ S _ {i _ {d + 1, P}} & S _ {i _ {d + 1, d + 1}} \end{array} \right], \bar {S} _ {i} ^ {Q} = \left[ \begin{array}{c c} S _ {i _ {Q, Q}} & S _ {i _ {Q, d + 1}} \\ S _ {i _ {d + 1, Q}} & S _ {i _ {d + 1, d + 1}} \end{array} \right]. \tag {12} +$$ + +For clarity, we will drop the superscripts from $\overline{S}_i$ when the context is clear. Next, we list down the necessary and sufficient conditions to solve optimization problem (11). + +# 5.3. Necessary and Sufficient KKT Conditions + +First, we write the Lagrangian $L(\Theta)$ for fixed $\lambda_{1} > 0$ and $\lambda_{2} > 0$ , where $\Theta = (t,\overline{W},\overline{U};\Pi ,\Lambda ,\alpha ,\gamma ,\nu ,\mu)$ is a collection of parameters. + +$$ +\begin{array}{l} L (\Theta) = \bar {f} (t, \bar {W}, \bar {U}) + \lambda_ {1} \bar {g} (t, \bar {W}, \bar {U}) + \lambda_ {2} \bar {h} (t, \bar {W}, \bar {U}) \\ - \langle \Pi , \bar {W} \rangle - \langle \Lambda , \bar {U} \rangle + \alpha (\bar {W} _ {s _ {1} + 1, s _ {1} + 1} - 1) + \\ \gamma \left(\bar {U} _ {s _ {2} + 1, s _ {2} + 1} - 1\right) - \sum_ {i = 1} ^ {n} \nu_ {i} \left(t _ {i} + 1\right) + \sum_ {i = 1} ^ {n} \mu_ {i} \left(t _ {i} - 1\right) \tag {13} \\ \end{array} +$$ + +Here $\Pi \succeq \mathbf{0},\Lambda \succeq \mathbf{0},\alpha \in \mathbb{R},\gamma \in \mathbb{R},\nu_{i} > 0$ and $\mu_{i}>$ 0 are the dual variables (of appropriate dimensions) for optimization problem (11). Using this Lagrangian, the KKT conditions at the optimum can be written as: + +1. Stationarity conditions: + +$$ +\sum_ {i = 1} ^ {n} \frac {t _ {i} + 1}{2} \bar {S} _ {i} ^ {P} + \lambda_ {1} Z - \Pi + I _ {\alpha} = \mathbf {0} \tag {14} +$$ + +where $Z$ is an element of the subgradient set of $\| \overline{W} (:)\| _1$ , i.e., $Z\in \frac{\partial\|\overline{W}(:)\|_1}{\partial\overline{W}}$ and $\| Z(:,)\|_{\infty}\leqslant 1$ and $I_{\alpha}\in \mathbb{R}^{s_1 + 1,s_1 + 1}$ has all zero entries except $(s_{1} + 1,s_{1} + 1)$ entry which is $\alpha$ . + +$$ +\sum_ {i = 1} ^ {n} \frac {1 - t _ {i}}{2} \bar {S} _ {i} ^ {Q} + \lambda_ {2} V - \Lambda + I _ {\gamma} = \mathbf {0} \tag {15} +$$ + +where $V$ is an element of the subgradient set of $\| \overline{U} (:)\| _1$ , i.e., $V\in \frac{\partial\|\overline{U}(:)\|_1}{\partial\overline{U}}$ and $\| V(:)\|_{\infty}\leqslant 1$ and $I_{\gamma}\in \mathbb{R}^{s_2 + 1,s_2 + 1}$ has all zero entries except $(s_2 + 1,s_2 + 1)$ entry which is $\gamma$ . For all $i\in [n]$ , it holds that + +$$ +\frac {1}{2} \langle \bar {S} _ {i} ^ {P}, \bar {W} \rangle - \frac {1}{2} \langle \bar {S} _ {i} ^ {Q}, \bar {U} \rangle - \nu_ {i} + \mu_ {i} = 0 \tag {16} +$$ + +2. Complementary Slackness conditions: + +$$ +\langle \Pi , \bar {W} \rangle = 0, \quad \langle \Lambda , \bar {U} \rangle = 0 \tag {17} +$$ + +$$ +\nu_ {i} \left(t _ {i} + 1\right) = 0, \mu_ {i} \left(t _ {i} - 1\right) = 0 \forall i \in [ n ] \tag {18} +$$ + +3. Dual Feasibility conditions: + +$$ +\Pi \succeq \mathbf {0}, \quad \Lambda \succeq \mathbf {0} \tag {19} +$$ + +$$ +\nu_ {i} \geqslant 0, \mu_ {i} \geqslant 0 \forall i \in [ n ] \tag {20} +$$ + +4. Primal Feasibility conditions: + +$$ +\overline {{W}} \succeq \mathbf {0}, \quad \overline {{U}} \succeq \mathbf {0} +$$ + +$$ +\overline {{W}} _ {s _ {1} + 1, s _ {1} + 1} = 1, \quad \bar {U} _ {s _ {2} + 1, s _ {2} + 1} = 1, \quad \| t \| _ {\infty} \leqslant 1 \tag {21} +$$ + +Next, we will provide a setting for primal and dual variables which satisfies all the KKT conditions. + +# 5.4. Construction of Primal and Dual Variables + +In this subsection, we will provide a construction of primal and dual variables which satisfies the KKT conditions for optimization problem (11). To that end, we provide our first main result. + +Theorem 5.2 (Primal Dual Variables Construction). If Assumptions 4.1, 4.2 and 4.4 hold, $\lambda_1 \geqslant \frac{64\rho\sigma_e}{\xi}\sqrt{n_1\log d}$ , $\lambda_2 \geqslant \frac{64\rho\sigma_e}{\xi}\sqrt{n_2\log d}$ and $n_1 = \Omega(\frac{s_1^3\log^2d}{\tau_0(C_{\min},\xi,\sigma,\Sigma,\rho)})$ and $n_2 = \Omega(\frac{s_2^3\log^2d}{\tau_0(C_{\min},\xi,\sigma,\Sigma,\rho)})$ , then the following setting of primal and dual variables: + +- Primal Variables: + +$$ +t _ {i} = t _ {i} ^ {*}, \forall i \in [ n ] +$$ + +$$ +\overline {{W}} = \left[ \begin{array}{c} \tilde {\beta} _ {1} \\ 1 \end{array} \right] \left[ \begin{array}{c c} \tilde {\beta} _ {1} ^ {\intercal} & 1 \end{array} \right], \quad \overline {{U}} = \left[ \begin{array}{c} \tilde {\beta} _ {2} \\ 1 \end{array} \right] \left[ \begin{array}{c c} \tilde {\beta} _ {2} ^ {\intercal} & 1 \end{array} \right] +$$ + +where + +$$ +\tilde {\beta} _ {1} = \arg \min _ {\beta \in \mathbb {R} ^ {s _ {1}}} \sum_ {i = 1} ^ {n} \frac {t _ {i} ^ {*} + 1}{2} \left(y _ {i} - X _ {i _ {P}} ^ {\intercal} \beta\right) ^ {2} + +$$ + +$$ +\lambda_ {1} (\| \beta \| _ {1} + 1) ^ {2} +$$ + +and + +$$ +\tilde {\beta} _ {2} = \arg \min _ {\beta \in \mathbb {R} ^ {s _ {2}}} \sum_ {i = 1} ^ {n} \frac {1 - t _ {i} ^ {*}}{2} \left(y _ {i} - X _ {i _ {Q}} ^ {\intercal} \beta\right) ^ {2} + +$$ + +$$ +\lambda_ {2} \left(\| \beta \| _ {1} + 1\right) ^ {2} +$$ + +- Dual Variables: + +$$ +\nu_ {i} = 0, \mu_ {i} = - \frac {1}{2} \langle \bar {S} _ {i} ^ {P}, \bar {W} \rangle + \frac {1}{2} \langle \bar {S} _ {i} ^ {Q}, \bar {U} \rangle \forall i \in \mathcal {I} _ {1} +$$ + +$$ +\mu_ {i} = 0, \nu_ {i} = \frac {1}{2} \langle \overline {{S}} _ {i} ^ {P}, \overline {{W}} \rangle - \frac {1}{2} \langle \overline {{S}} _ {i} ^ {Q}, \overline {{U}} \rangle \forall i \in \mathcal {I} _ {2} +$$ + +$$ +\Pi = \sum_ {i = 1} ^ {n} \frac {t _ {i} ^ {*} + 1}{2} \bar {S} _ {i} ^ {P} + \lambda_ {1} Z + I _ {\alpha} +$$ + +$$ +\Lambda = \sum_ {i = 1} ^ {n} \frac {1 - t _ {i} ^ {*}}{2} \overline {{S}} _ {i} ^ {Q} + \lambda_ {2} V + I _ {\gamma} +$$ + +$$ +\alpha = - \langle \sum_ {i = 1} ^ {n} \frac {t _ {i} + 1}{2} \overline {{S}} _ {i} ^ {P} + \lambda_ {1} Z, \overline {{W}} \rangle +$$ + +$$ +\gamma = - \left\langle \sum_ {i = 1} ^ {n} \frac {1 - t _ {i}}{2} \bar {S} _ {i} ^ {Q} + \lambda_ {2} V, \bar {U} \right\rangle +$$ + +satisfies all the KKT conditions for optimization problem (11) with probability at least $1 - \mathcal{O}\left(\frac{1}{d}\right)$ , where $\tau_0(C_{\min}, \alpha, \sigma, \Sigma, \rho, \gamma)$ is a constant independent of $s_1, s_2, d, n_1$ and $n_2$ and thus, the primal variables are a globally optimal solution for (11). Furthermore, the above solution is also unique. + +Proof Sketch. The main idea behind our proofs is to verify that the setting of primal and dual variables in Theorem 5.2 satisfies all the KKT conditions described in subsection 5.3. We do this by proving multiple lemmas in subsequent subsections. The outline of the proof is as follows: + +- It can be trivially verified that the primal feasibility condition (21) holds. The stationarity conditions (14) and (15) hold by construction of $\Pi$ and $\Lambda$ respectively. Similarly, the stationarity condition (16) holds by choice of $\nu_{i}$ and $\mu_{i}$ . Choice of $t, \nu_{i}, \mu_{i}, \alpha$ and $\gamma$ ensure that complementary slackness conditions (17) and (18) also hold. +- In subsection 5.5, we use Lemmas 5.3, 5.5 and 5.6 to verify that the dual feasibility conditions (20) and (19) hold. We will also show in subsection subsection 5.5 that our solution is also unique. + +# 5.5. Verifying Dual Feasibility + +To verify dual feasibility, first we will show that $\mu_i \geqslant 0, \forall i \in \mathcal{I}_1$ , $\nu_i \geqslant 0, \forall i \in \mathcal{I}_2$ . We define $\Delta_1 \triangleq \tilde{\beta}_1 - \beta_{1P}^*$ and $\Delta_2 \triangleq \tilde{\beta}_2 - \beta_{2Q}^*$ . Then, the following lemma holds true. + +Lemma 5.3. If Assumptions 4.1, 4.2 and 4.4 hold, and $\lambda_1 \geqslant 8\rho\sigma_e\sqrt{n_1\log d}$ , $\lambda_2 \geqslant 8\rho\sigma_e\sqrt{n_2\log d}$ , $n_1 = \Omega\left(\frac{s_1^3\log d}{\tau(C_{\min},\xi,\sigma,\Sigma)}\right)$ , and $n_2 = \Omega\left(\frac{s_2^3\log d}{\tau(C_{\min},\xi,\sigma,\Sigma)}\right)$ then $\|\Delta_1\|_2 \leqslant (2 + b_1)\frac{2\lambda_1\sqrt{s_1}}{C_{\min}n_1}$ and $\|\Delta_2\|_2 \leqslant (2 + b_2)\frac{2\lambda_2\sqrt{s_2}}{C_{\min}n_2}$ . + +with probability at least $1 - \mathcal{O}\left(\frac{1}{d}\right)$ where $\tau (C_{\mathrm{min}},\xi ,\sigma ,\Sigma)$ is a constant independent of $s_1,s_2,d,n_1$ or $n_2$ + +Using the result of Lemma 5.3, we are going to prove that the settings for dual variables $\mu_{i}$ and $\nu_{i}$ works with high probability. + +Lemma 5.4. If Assumptions 4.1, 4.2 and 4.4 hold, and $\lambda_1 \geqslant 8\rho\sigma_e\sqrt{n_1\log d}$ , $\lambda_2 \geqslant 8\rho\sigma_e\sqrt{n_2\log d}$ , $n_1 = \Omega(\frac{s_1^3\log d}{\tau(C_{\min},\xi,\sigma,\Sigma)})$ , and $n_2 = \Omega(\frac{s_2^3\log d}{\tau(C_{\min},\xi,\sigma,\Sigma)})$ then $\mu_i \geqslant 0, \forall i \in \mathcal{I}_1$ and $\nu_i \geqslant 0, \forall i \in \mathcal{I}_2$ with probability at least $1 - \mathcal{O}(\frac{1}{d})$ where $\tau(C_{\min},\xi,\sigma,\Sigma)$ is a constant independent of $s_1, s_2, d, n_1$ or $n_2$ . + +Now we will show that $\Pi \geq 0$ and $\Lambda \geq 0$ . We will do this in two steps. The first step is to show that both $\Pi$ and $\Lambda$ have a zero eigenvalue. In particular, + +Lemma 5.5. Both $\Pi$ and $\Lambda$ have zero eigenvalues corresponding to eigenvectors $\left[ \begin{array}{c} \tilde{\beta}_1 \\ 1 \end{array} \right]$ and $\left[ \begin{array}{c} \tilde{\beta}_2 \\ 1 \end{array} \right]$ respectively. + +Next, we show that all the other eigenvalues of both $\Pi$ and $\Lambda$ are strictly positive. + +Lemma 5.6. If Assumption 4.2 holds and $n_1 = \Omega\left(\frac{s_1 + \log d}{C_{\min}^2}\right)$ and $n_2 = \Omega\left(\frac{s_2 + \log d}{C_{\min}^2}\right)$ , then the second eigenvalues of $\Pi$ and $\Lambda$ are strictly positive with probability at least $1 - \mathcal{O}\left(\frac{1}{d}\right)$ , i.e., $\mathrm{eig}_2(\Pi) > 0$ and $\mathrm{eig}_2(\Lambda) > 0$ . + +On the one hand, Lemma 5.6 ensures that $\Pi \succeq 0$ and $\Lambda \succeq 0$ , but on the other it also forces $\overline{W}$ and $\overline{U}$ to be rank-1 and unique as both $\Pi$ and $\overline{W}$ have to be positive semidefinite and $\Pi$ has exactly one vector in its nullspace (same with $\Lambda$ and $\overline{U}$ ). + +# 5.6. Going back to Convex MLR + +Now that we have the setting of $t_i, \overline{W}$ and $\overline{U}$ for Compact Convex MLR problem (11), we can extend these to the original Convex MLR problem (4). Notice that all the other entries of $W$ and $U$ are zeros, thus it readily follows that + +$$ +W = \left[ \begin{array}{l} \beta_ {1} \\ 1 \end{array} \right] \left[ \begin{array}{l l} \beta_ {1} ^ {\intercal} & 1 \end{array} \right], U = \left[ \begin{array}{l} \beta_ {2} \\ 1 \end{array} \right] \left[ \begin{array}{l l} \beta_ {2} ^ {\intercal} & 1 \end{array} \right] \tag {22} +$$ + +where $\beta_{1} = \left[ \begin{array}{c}\tilde{\beta}_{1}\\ \mathbf{0} \end{array} \right]$ and $\beta_{2} = \left[ \begin{array}{c}\tilde{\beta}_{2}\\ \mathbf{0} \end{array} \right]$ . Furthermore, result from Lemma 5.3 extends directly and gives us + +$$ +\left\| \beta_ {1} - \beta_ {1} ^ {*} \right\| _ {2} \leqslant \left(2 + b _ {1}\right) \frac {2 \lambda_ {1} \sqrt {s _ {1}}}{C _ {\min } n _ {1}} \tag {23} +$$ + +$$ +\left\| \beta_ {2} - \beta_ {2} ^ {*} \right\| _ {2} \leqslant (2 + b _ {2}) \frac {2 \lambda_ {2} \sqrt {s _ {2}}}{C _ {\mathrm {m i n}} n _ {2}}. +$$ + +The last remaining thing is to show that consistency certificate C1 indeed holds which we will do in next subsection. + +# 5.7. Validating Consistency Certificate + +Observe that once we substitute $t_i = t_i^*$ in optimization problem (4), it decouples into two independent convex optimization problems involving $W$ and $U$ respectively. Furthermore, since we established that $W$ and $U$ are rank-1, we can rewrite these independent problems in terms of $\beta_1$ and $\beta_2$ . Our task is to show that $\beta_{1P^c} = 0$ and $\beta_{2Q^c} = 0$ . It suffices to show it for $\beta_1$ as arguments for $\beta_2$ are the same. Below, we consider the simplified optimization problem in terms of $\beta_1$ : + +$$ +\beta_ {1} = \arg \min _ {\beta \in \mathbb {R} ^ {d}} \sum_ {i \in \mathcal {I} _ {1}} \left(X _ {i} ^ {\intercal} \beta - y _ {i}\right) ^ {2} + \lambda_ {1} \left(\| \beta \| _ {1} + 1\right) ^ {2} \tag {24} +$$ + +Since we are only dealing with measurements in $\mathcal{I}_1$ , we can substitute $y_{i} = X_{i}^{\top}\beta^{*} + e_{i}$ . Furthermore, $\beta_{1}$ must satisfy stationarity KKT condition which can be written as: + +$$ +\frac {1}{n _ {1}} \sum_ {i \in \mathcal {I} _ {1}} X _ {i} X _ {i} ^ {\intercal} \left(\beta_ {1} - \beta^ {*}\right) - \frac {1}{n _ {1}} \sum_ {i \in \mathcal {I} _ {1}} X _ {i} e _ {i} + \tag {25} +$$ + +$$ +\frac {1}{n _ {1}} \lambda_ {1} (\| \beta_ {1} \| _ {1} + 1) \zeta = \mathbf {0}, +$$ + +where $\zeta$ is in the subdifferential set of $\| \beta_1\| _1$ and $\| \zeta \|_{\infty}\leqslant 1$ Specifically, $\zeta_{i} = \mathrm{sign}(\beta_{1}),\forall i\in P$ and $\zeta_i\in [-1,1],\forall i\in$ $P^c$ . Our task is to show that $\zeta$ fulfills strict dual feasibility, i.e., $\| \zeta_{P^c}\|_{\infty} < 1$ . We decompose equation (25) into two parts - one corresponding to entries in $P$ and the other corresponding to entries in $P^c$ . For entries in $P$ we have + +$$ +\begin{array}{l} \frac {1}{n _ {1}} \sum_ {i \in \mathcal {I} _ {1}} X _ {i _ {P}} X _ {i _ {P}} ^ {\intercal} \left(\beta_ {1 _ {P}} - \beta_ {1 _ {P}} ^ {*}\right) - \frac {1}{n _ {1}} \sum_ {i \in \mathcal {I} _ {1}} X _ {i _ {P}} e _ {i} \tag {26} \\ + \frac {1}{n _ {1}} \lambda_ {1} (\| \beta_ {1} \| _ {1} + 1) \zeta_ {P} = \mathbf {0} \\ \end{array} +$$ + +Similarly, for entries in $P^c$ , we have + +$$ +\begin{array}{l} \frac {1}{n _ {1}} \sum_ {i \in \mathcal {I} _ {1}} X _ {i _ {P ^ {c}}} X _ {i _ {P}} ^ {\intercal} \left(\beta_ {1 _ {P}} - \beta_ {1 _ {P}} ^ {*}\right) - \frac {1}{n _ {1}} \sum_ {i \in \mathcal {I} _ {1}} X _ {i _ {P ^ {c}}} e _ {i} \\ + \frac {1}{n _ {1}} \lambda_ {1} \left(\| \beta_ {1} \| _ {1} + 1\right) \zeta_ {P ^ {c}} = \mathbf {0} \\ \end{array} +$$ + +After rearranging the terms and substituting for $(\beta_{1_P} - \beta_{1_P}^*)$ from equation (26), we get + +$$ +\begin{array}{l} \frac {\lambda_ {1}}{n _ {1}} \left(1 + \| \beta_ {1} \| _ {1}\right) \zeta_ {P ^ {c}} = - \hat {H} _ {P ^ {c} P} \hat {H} _ {P P} ^ {- 1} \left(\frac {1}{n _ {1}} \sum_ {i \in \mathcal {I} _ {1}} X _ {i P} e _ {i} - \right. \\ \frac {1}{n _ {1}} \lambda_ {1} (\| \beta_ {1} \| _ {1} + 1) \zeta_ {P}) + \frac {1}{n _ {1}} \sum_ {i \in \mathcal {I} _ {1}} X _ {i _ {P ^ {c}}} e _ {i} \\ \end{array} +$$ + +Let $\bar{\lambda}_1 = \frac{\lambda_1}{n_1}$ and note that $\| \beta_{1}\|_{1}\geqslant 0$ , using norm inequality + +![](images/e96b418efaa6bd5f358f8350d82a9b426936f880f6f32da3cef35d90aac3d951.jpg) +(a) Misidentified labels (in ratio to $n$ ) + +![](images/9ebadc99dff8211f298832416ca1b8c7ad6b0e5ae5bdb87421f3f83e3e279686.jpg) +(b) Support recovery of $\beta_{1}^{*}$ + +![](images/e8251deb64564d4df056a6030276c7d94c22ab5258b818e5ffa27959e71649e1.jpg) +(c) Support recovery of $\beta_{2}^{*}$ +Figure 1. Label and support recovery with control parameter $C_p$ . + +ties we can rewrite the above equation as: + +$$ +\begin{array}{l} \| \zeta_ {P ^ {c}} \| _ {\infty} \leqslant \| \hat {H} _ {P ^ {c} P} \hat {H} _ {P P} ^ {- 1} \| _ {\infty} \left(\| \frac {1}{\bar {\lambda} _ {1}} \frac {1}{n _ {1}} \sum_ {i \in \mathcal {I} _ {1}} X _ {i _ {P}} e _ {i} \| _ {\infty} + \| \zeta_ {P} \| _ {\infty}\right) \\ + \left\| \frac {1}{\bar {\lambda} _ {1}} \frac {1}{n _ {1}} \sum_ {i \in \mathcal {I} _ {1}} X _ {i _ {P ^ {c}}} e _ {i} \right\| _ {\infty} \\ \end{array} +$$ + +We know that $\| \hat{H}_{P^c P} \hat{H}_{PP}^{-1} \|_{\infty} \leqslant (1 - \frac{\xi}{2})$ for some $\xi \in (0, 1]$ . The following lemma provides bounds on $\| \frac{1}{\lambda_1} \frac{1}{n_1} \sum_{i \in \mathcal{I}_1} X_{i_P} e_i \|_{\infty}$ and $\| \frac{1}{n_1} \sum_{i \in \mathcal{I}_1} X_{i_{P^c}} e_i \|_{\infty}$ . + +Lemma 5.7. Let $\lambda_1 \geqslant \frac{64\rho\sigma_e}{\xi}\sqrt{n_1\log d}$ . Then the following holds true: + +$$ +\mathbb {P} \left(\| \frac {1}{\bar {\lambda} _ {1}} \frac {1}{n _ {1}} \sum_ {i \in \mathcal {I} _ {1}} X _ {i _ {P}} e _ {i} \| _ {\infty} \geqslant \frac {\xi}{8 - 4 \xi}\right) \leqslant \mathcal {O} \left(\frac {1}{d}\right), +$$ + +$$ +\mathbb {P} (\| \frac {1}{\bar {\lambda} _ {1}} \frac {1}{n _ {1}} \sum_ {i \in \mathcal {I} _ {1}} X _ {i _ {P ^ {c}}} e _ {i} \| _ {\infty} \geqslant \frac {\xi}{8}) \leqslant \mathcal {O} (\frac {1}{d}) +$$ + +It follows that $\| \zeta_{P^c}\|_{\infty}\leqslant 1 - \frac{\xi}{4}$ with probability at least $1 - \mathcal{O}(\frac{1}{d})$ . Thus, the consistency certificate C1 indeed holds with high probability. + +# 6. Experimental Validation + +Note that we are not proposing any new algorithm in our paper. However, to validate our theoretical results we performed experiments on synthetic data. We generated response $y$ using Gaussian random variables $X$ and chose regression parameter $\beta_1^*$ (or $\beta_2^*$ ) based on the label of the samples. We fixed the sparsity $s_1 = s_2 = 4$ , however supports were not necessarily the same for both the regression parameter vectors. We varied $n_1$ and $n_2$ according to our theorems, i.e., both were varied with $10^{C_p}\log^2 d$ for $d = 10, 20$ and 50 where $C_p$ is a control parameters. The regularizers were kept according to our theorem and were varied as $\mathcal{O}(\sqrt{n_1\log d})$ and $\mathcal{O}(\sqrt{n_2\log d})$ . We measured performance of our algorithm based on the label recovery (in + +ratio to supplied $n$ ) and support recovery for both parameter vectors. The experiments were run three times independently. Note how we make zero mistakes in label recovery as we increase number of samples. Similarly, support recovery (ratio of intersection and union with correct support) for both parameter vectors goes to 1 as we increase sample size. It should be noted that we do not propose any new algorithm but our method is free of any initialization requirement. As for specific algorithm for empirical verification, we use a projected subgradient method (Duchi & Singer, 2009) to check convergence for our problem which is achieved without any requirement on initialization. In fact, any algorithm which converges to a stationary point should work for our framework. + +# 7. Concluding Remarks + +We provide a novel formulation of invex MLR. We show that invexity of our optimization problem allows for a tractable solution. We provide provable theoretical guarantees for our solution. The sample complexity of our method is polynomial in terms of sparsity and logarithmic in terms of the dimension of the true parameter. Our method helps to identify labels exactly and recovers regression parameter vectors with correct support and correct sign. It would be interesting to think about extending our ideas to mixture of more than two groups of regressions in future. + +# Acknowledgements + +This material is based upon work supported by the National Science Foundation under Grant No. 2134209-DMS. + +# References + +Anandkumar, A., Ge, R., Hsu, D., Kakade, S. M., and Telgarsky, M. Tensor decompositions for learning latent variable models. Journal of machine learning research, 15:2773-2832, 2014. + +Barik, A. and Honorio, J. Fair sparse regression with clustering: An invex relaxation for a combinatorial problem. Advances in neural information processing systems, 2021. +Ben-Israel, A. and Mond, B. What is invexity? The ANZIAM Journal, 28(1):1-9, 1986. +Chaganty, A. T. and Liang, P. Spectral experts for estimating mixtures of linear regressions. In International Conference on Machine Learning, pp. 1040-1048. PMLR, 2013. +Chen, Y., Yi, X., and Caramanis, C. A convex formulation for mixed regression with two components: Minimax optimal rates. In Conference on Learning Theory, pp. 560-604. PMLR, 2014. +Daneshmand, H., Gomez-Rodriguez, M., Song, L., and Schoelkopf, B. Estimating Diffusion Network Structures: Recovery Conditions, Sample Complexity & Soft-Thresholding Algorithm. In International Conference on Machine Learning, pp. 793-801, 2014. +Deb, P. and Holmes, A. M. Estimates of use and costs of behavioural health care: a comparison of standard and finite mixture models. Health economics, 9(6):475-489, 2000. +Duchi, J. and Singer, Y. Efficient online and batch learning using forward backward splitting. The Journal of Machine Learning Research, 10:2899-2934, 2009. +Elhamifar, E. and Vidal, R. Sparse subspace clustering: Algorithm, theory, and applications. IEEE transactions on pattern analysis and machine intelligence, 35(11): 2765-2781, 2013. +Ghosh, A. and Kannan, R. Alternating minimization converges super-linearly for mixed linear regression. In International Conference on Artificial Intelligence and Statistics, pp. 1093-1103. PMLR, 2020. +Grün, B., Leisch, F., et al. Applications of finite mixtures of regression models. URL: http://cran.r-project.org/web/packages/flexmix/vignettes/regression-examples.pdf, 2007. +Hanson, M. A. On sufficiency of the kuhn-tucker conditions. Journal of Mathematical Analysis and Applications, 80 (2):545-550, 1981. +Haynsworth, E. V. Determination of the inertia of a partitioned hermitian matrix. Linear algebra and its applications, 1(1):73-81, 1968. +Horn, R. A. and Johnson, C. R. Matrix Analysis. Cambridge university press, 2012. + +Hsu, D. and Kakade, S. M. Learning mixtures of spherical gaussians: moment methods and spectral decompositions. In Proceedings of the 4th conference on Innovations in Theoretical Computer Science, pp. 11-20, 2013. +Hsu, D., Kakade, S., Zhang, T., et al. A tail inequality for quadratic forms of subgaussian random vectors. Electronic Communications in Probability, 17, 2012. +Jordan, M. I. and Jacobs, R. A. Hierarchical mixtures of experts and the em algorithm. Neural computation, 6(2): 181-214, 1994. +Klusowski, J. M., Yang, D., and Brinda, W. Estimating the coefficients of a mixture of two linear regressions by expectation maximization. IEEE Transactions on Information Theory, 65(6):3515-3524, 2019. +Li, G., Pan, Y., Yang, Z., and Ma, J. Modeling vehicle merging position selection behaviors based on a finite mixture of linear regression models. IEEE Access, 7: 158445-158458, 2019. +Ravikumar, P., Liu, H., Lafferty, J., and Wasserman, L. Spam: Sparse Additive Models. In Proceedings of the 20th International Conference on Neural Information Processing Systems, pp. 1201-1208. Curran Associates Inc., 2007. +Ravikumar, P., Wainwright, M. J., Lafferty, J. D., et al. High-dimensional using model selection using 11-regularized logistic regression. The Annals of Statistics, 38(3):1287-1319, 2010. +Ravikumar, P., Wainwright, M. J., Raskutti, G., Yu, B., et al. High-dimensional Covariance Estimation by Minimizing L1-Penalized Log-Determinant Divergence. Electronic Journal of Statistics, 5:935-980, 2011. +Stadler, N., Buhlmann, P., and Van De Geer, S. 11- penalization for mixture regression models. Test, 19(2): 209-256, 2010. +Vershynin, R. How close is the sample covariance matrix to the actual covariance matrix? Journal of Theoretical Probability, 25(3):655-686, 2012. +Vidal, R., Ma, Y., and Sastry, S. Generalized principal component analysis (gpca). IEEE transactions on pattern analysis and machine intelligence, 27(12):1945-1959, 2005. +Viele, K. and Tong, B. Modeling with mixtures of linear regressions. Statistics and Computing, 12(4):315-330, 2002. +Wainwright, M. J. Information-theoretic bounds on sparsity recovery in the high-dimensional and noisy setting. IEEE Trans. Info. Theory, 55:5728-5741, December 2009a. + +Wainwright, M. J. Sharp Thresholds for High-Dimensional and Noisy Sparsity Recovery Using L1-Constrained Quadratic Programming (Lasso). IEEE transactions on information theory, 55(5):2183-2202, 2009b. +Wainwright, M. J. High-dimensional statistics: A non-asymptotic viewpoint, volume 48. Cambridge University Press, 2019. +Wedel, M. and DeSarbo, W. S. A mixture likelihood approach for generalized linear models. Journal of classification, 12(1):21-55, 1995. +Wedel, M. and Kamakura, W. A. Market segmentation: Conceptual and methodological foundations. Springer Science & Business Media, 2000. +Wu, C. J. On the convergence properties of the em algorithm. The Annals of statistics, pp. 95-103, 1983. +Yi, X., Caramanis, C., and Sanghavi, S. Alternating minimization for mixed linear regression. In International Conference on Machine Learning, pp. 613-621. PMLR, 2014. + +# Supplementary Material: Sparse Mixed Linear Regression with Guarantees: Taming an Intractable Problem with Invex Relaxation + +# A. Continuous Relaxation of Standard MLR is non-convex + +It suffices to prove that the objective function $l(z, \beta_1, \beta_2)$ of optimization problem (2) is non-convex when $z_i$ is allowed to be between 0 and 1. We note that + +$$ +l \left(z, \beta_ {1}, \beta_ {2}\right) = \sum_ {i = 1} ^ {n} z _ {i} \left(y _ {i} - X _ {i} ^ {\top} \beta_ {1}\right) ^ {2} + \left(1 - z _ {i}\right) \left(y _ {i} - X _ {i} ^ {\top} \beta_ {2}\right) ^ {2} \tag {27} +$$ + +where $\beta_{1}\in \mathbb{R}^{d},\beta_{2}\in \mathbb{R}^{d}$ and $z_{i}\in [0,1],\forall i\in [n]$ . Let $\Theta = (z,\beta_1,\beta_2,\bar{z},\bar{\beta}_1,\bar{\beta}_2)$ . We consider the following quantity: + +$$ +F (\Theta) = f (z, \beta_ {1}, \beta_ {2}) - f (\bar {z}, \bar {\beta} _ {1}, \bar {\beta} _ {2}) - \sum_ {i = 1} ^ {n} \frac {\partial f}{\partial \bar {z} _ {i}} \left(z _ {i} - \bar {z} _ {i}\right) - \frac {\partial f}{\partial \bar {\beta} _ {1}} ^ {\text {T}} \left(\beta_ {1} - \bar {\beta} _ {1}\right) - \frac {\partial f}{\partial \bar {\beta} _ {2}} ^ {\text {T}} \left(\beta_ {2} - \bar {\beta} _ {2}\right) \tag {28} +$$ + +where + +$$ +\frac {\partial f}{\partial \bar {z} _ {i}} = \left(y _ {i} - X _ {i} ^ {\intercal} \bar {\beta} _ {1}\right) ^ {2} - \left(y _ {i} - X _ {i} ^ {\intercal} \bar {\beta} _ {2}\right) ^ {2}, \quad \forall i \in [ n ] +$$ + +$$ +\frac {\partial f}{\partial \bar {\beta} _ {1}} = \sum_ {i = 1} ^ {n} - 2 \bar {z} _ {i} X _ {i} \left(y _ {i} - X _ {i} ^ {\mathsf {T}} \bar {\beta} _ {1}\right) \tag {29} +$$ + +$$ +\frac {\partial f}{\partial \bar {\beta} _ {2}} = \sum_ {i = 1} ^ {n} - 2 (1 - \bar {z} _ {i}) X _ {i} (y _ {i} - X _ {i} ^ {\intercal} \bar {\beta} _ {2}) +$$ + +It suffices to show that $F(\Theta)$ changes sign for different feasible values of $\Theta$ . We choose the following variables: + +$$ +z _ {i} = 0, \bar {z} _ {i} = \frac {1}{2} \quad \forall i \in [ n ] +$$ + +$$ +\beta_ {1 _ {k}} = u _ {1}, \beta_ {1 _ {j}} = 0, \forall j \neq k +$$ + +$$ +\beta_ {2 _ {l}} = u _ {2}, \beta_ {2 _ {j}} = 0, \forall j \neq l \tag {30} +$$ + +$$ +\bar {\beta} _ {1 _ {k}} = w _ {1}, \bar {\beta} _ {1 _ {j}} = 0, \forall j \neq k +$$ + +$$ +\bar {\beta} _ {2 _ {l}} = w _ {2}, \bar {\beta} _ {2 _ {j}} = 0, \forall j \neq l +$$ + +$$ +u _ {1} = w _ {1} - \left(u _ {2} - w _ {2}\right) +$$ + +Note that choice of $w_{1},u_{2}$ and $w_{2}$ can be arbitrary. This simplifies $F(\Theta)$ + +$$ +F (\Theta) = \sum_ {i = 1} ^ {n} \left(y _ {i} - u _ {2} X _ {i l}\right) ^ {2} - \sum_ {i = 1} ^ {n} \left(y _ {i} - w _ {2} X _ {i l}\right) ^ {2} \tag {31} +$$ + +Consider the case when $X_{il} > 0, \forall i \in [n]$ . Then choosing $u_2 < w_2$ makes $F(\Theta) > 0$ while choosing $u_2 > w_2$ makes $F(\Theta) < 0$ . This proves our claim. + +# B. Proof of Lemma 3.4 + +Lemma 3.4 For $(t,W,U)\in C$ , the functions $f(t,W,U) = \sum_{i = 1}^{n}\frac{1}{2}\langle S_i,W + U\rangle +\sum_{i = 1}^{n}\frac{1}{2} t_i\langle S_i,W - U\rangle ,g(t,W,U) =$ $\| W(:,\| _1$ and $h(t,W,U) = \| U(:,\| _1$ are $\eta$ -invex for $\eta (t,\tilde{t},W,\widetilde{W},U,\widetilde{U})\triangleq \left[ \begin{array}{c}\eta_t\\ \eta_W\\ \eta_U \end{array} \right],$ where $\eta_t = \mathbf{0}\in \mathbb{R}^n,\eta_W = -\widetilde{W}$ and $\eta_U = -\widetilde{U}$ . We abuse the vector/matrix notation (by ignoring the dimensions) for clarity of presentation, and avoid the vectorization of matrices. + +Proof. We know $f(t,W,U) = \sum_{i=1}^{n} \frac{t_i + 1}{2} \langle S_i, W \rangle + \frac{1 - t_i}{2} \langle S_i, U \rangle$ . Then, + +$$ +\frac {\partial f}{\partial t _ {i}} = \frac {1}{2} \langle S _ {i}, W - U \rangle +$$ + +$$ +\frac {\partial f}{\partial W} = \sum_ {i = 1} ^ {n} \frac {t _ {i} + 1}{2} S _ {i} \tag {32} +$$ + +$$ +\frac {\partial f}{\partial U} = \sum_ {i = 1} ^ {n} \frac {1 - t _ {i}}{2} S _ {i} +$$ + +To prove that $f(t,W,U)$ is invex, we need to show that + +$$ +f (t, W, U) - f (\tilde {t}, \widetilde {W}, \widetilde {U}) - \sum_ {i = 1} ^ {n} \eta_ {t _ {i}} \frac {\partial f}{\partial \tilde {t} _ {i}} - \left\langle \eta_ {W}, \frac {\partial f}{\partial \widetilde {W}} \right\rangle - \left\langle \eta_ {U}, \frac {\partial f}{\partial \widetilde {U}} \right\rangle \geqslant 0 \tag {33} +$$ + +We take $\eta_t = \mathbf{0} \in \mathbb{R}^n$ , $\eta_W = -\widetilde{W}$ and $\eta_U = -\widetilde{U}$ and expand LHS of equation (33) as follows: + +$$ +\begin{array}{l} \sum_ {i = 1} ^ {n} \frac {t _ {i} + 1}{2} \langle S _ {i}, W \rangle + \frac {1 - t _ {i}}{2} \langle S _ {i}, U \rangle - \sum_ {i = 1} ^ {n} \frac {\tilde {t} _ {i} + 1}{2} \langle S _ {i}, \widetilde {W} \rangle - \frac {1 - \tilde {t} _ {i}}{2} \langle S _ {i}, \widetilde {U} \rangle + \langle \widetilde {W}, \sum_ {i = 1} ^ {n} \frac {\tilde {t} _ {i} + 1}{2} S _ {i} \rangle + \langle \widetilde {U}, \sum_ {i = 1} ^ {n} \frac {1 - \tilde {t} _ {i}}{2} S _ {i} \rangle \\ = \sum_ {i = 1} ^ {n} \frac {t _ {i} + 1}{2} \langle S _ {i}, W \rangle + \frac {1 - t _ {i}}{2} \langle S _ {i}, U \rangle \\ \geqslant 0 \tag {34} \\ \end{array} +$$ + +The last inequality holds because $S_{i}$ , $W$ and $U$ are all positive semidefinite and $t_i \in [-1, 1]$ . + +Similarly, + +$$ +\begin{array}{l} g (t, W, U) - g (\tilde {t}, \widetilde {W}, \widetilde {U}) - \sum_ {i = 1} ^ {n} \eta_ {t _ {i}} \frac {\partial g}{\partial \tilde {t} _ {i}} - \left\langle \eta_ {W}, \frac {\partial g}{\partial \widetilde {W}} \right\rangle - \left\langle \eta_ {U}, \frac {\partial g}{\partial \widetilde {U}} \right\rangle \tag {35} \\ = \| W (:) \| _ {1} - \| \widetilde {W} (:) \| _ {1} + \| \widetilde {W} (:) \| _ {1} \geqslant 0 \\ \end{array} +$$ + +and + +$$ +\begin{array}{l} h (t, W, U) - h (\tilde {t}, \widetilde {W}, \tilde {U}) - \sum_ {i = 1} ^ {n} \eta_ {t _ {i}} \frac {\partial h}{\partial \tilde {t} _ {i}} - \left\langle \eta_ {W}, \frac {\partial h}{\partial \widetilde {W}} \right\rangle - \left\langle \eta_ {U}, \frac {\partial h}{\partial \widetilde {U}} \right\rangle \tag {36} \\ = \| U (:) \| _ {1} - \| \widetilde {U} (:) \| _ {1} + \| \widetilde {U} (:) \| _ {1} \geqslant 0 \\ \end{array} +$$ + +# C. Proof of Lemma 4.3 + +Lemma 4.3 If Assumption 4.2 holds and $n_1 = \Omega\left(\frac{s_1 + \log d}{C_{\min}^2}\right)$ and $n_2 = \Omega\left(\frac{s_2 + \log d}{C_{\min}^2}\right)$ , then $\min(\mathrm{eig}_{\min}(\hat{H}_{1_{PP}}), \mathrm{eig}_{\min}(\hat{H}_{2_{QQ}})) \geqslant \frac{C_{\min}}{2}$ and $\max(\mathrm{eig}_{\max}(\hat{H}_{1_{PP}}), \mathrm{eig}_{\max}(\hat{H}_{2_{QQ}})) \leqslant \frac{3C_{\max}}{2}$ with probability at least $1 - \mathcal{O}\left(\frac{1}{d}\right)$ . + +Proof. We prove the Lemma for a general support $S$ and samples $n$ . The results follow when we substitute $S$ by $P$ and $Q$ and $n$ by $n_1$ or $n_2$ based on the context. By the Courant-Fischer variational representation (Horn & Johnson, 2012): + +$$ +\begin{array}{l} \operatorname {e i g} _ {\min } \left(\mathbb {E} \left(X _ {i} X _ {i} ^ {\top}\right) _ {S S}\right) = \min _ {\| y \| _ {2} = 1} y ^ {\top} \mathbb {E} \left(X _ {i} X _ {i} ^ {\top}\right) _ {S S} y = \min _ {\| y \| _ {2} = 1} y ^ {\top} \left(\mathbb {E} \left(X _ {i} X _ {i} ^ {\top}\right) _ {S S} - \frac {1}{n} X _ {S} ^ {\top} X _ {S} + \frac {1}{n} X _ {S} ^ {\top} X _ {S}\right) y \\ \leqslant y ^ {\intercal} \left(\mathbb {E} \left(X _ {i} X _ {i} ^ {\intercal}\right) _ {S S} - \frac {1}{n} X _ {S} ^ {\intercal} X _ {S} + \frac {1}{n} X _ {S} ^ {\intercal} X _ {S}\right) y \tag {37} \\ = y ^ {\intercal} \left(\mathbb {E} \left(X _ {i} X _ {i} ^ {\intercal}\right) _ {S S} - \frac {1}{n} X _ {S} ^ {\intercal} X _ {S}\right) y + y ^ {\intercal} \frac {1}{n} X _ {S} ^ {\intercal} X _ {S} y \\ \end{array} +$$ + +It follows that + +$$ +\operatorname {e i g} _ {\min } \left(\frac {1}{n} X _ {S} ^ {\intercal} X _ {S}\right) \geqslant C _ {\min } - \| \mathbb {E} \left(X _ {i} X _ {i} ^ {\intercal}\right) _ {S S} - \frac {1}{n} X _ {S} ^ {\intercal} X _ {S} \| _ {2} \tag {38} +$$ + +The term $\| \mathbb{E}(X_i X_i^\top)_{SS} - \frac{1}{n} X_S^\top X_S\|_2$ can be bounded using Proposition 2.1 in (Vershynin, 2012) for sub-Gaussian random variables. In particular, + +$$ +\mathbb {P} \left(\| \mathbb {E} \left(X _ {i} X _ {i} ^ {\mathsf {T}}\right) _ {S S} - \frac {1}{n} X _ {S} ^ {\mathsf {T}} X _ {S} \| _ {2} \geqslant \epsilon\right) \leqslant 2 \exp \left(- c \epsilon^ {2} n + s\right) \tag {39} +$$ + +for some constant $c > 0$ . Taking $\epsilon = \frac{C_{\min}}{2}$ , we show that $\mathrm{eig}_{\min}\left(\frac{1}{n} X_S^\top X_S\right) \geqslant \frac{C_{\min}}{2}$ with probability at least $1 - 2\exp \left(-\frac{cC_{\min}^2n}{4} + |S|\right)$ . The specific results for $n_1$ and $n_2$ follow directly. + +Remark: Similarly, it can be shown that $\mathrm{eig}_{\max}\left(\frac{1}{n} X_S^\intercal X_S\right) \leqslant \frac{3C_{\max}}{2}$ with probability at least $1 - 2\exp \left(-\frac{cC_{\max}^2n}{4} + |S|\right)$ . + +# D. Proof of Lemma 4.5 + +Lemma 4.5 If Assumption 4.4 holds and $n_1 = \Omega(\frac{s_1^3(\log s_1 + \log d)}{\tau(C_{\min}, \xi, \sigma, \Sigma)})$ and $n_2 = \Omega(\frac{s_2^3(\log s_2 + \log d)}{\tau(C_{\min}, \xi, \sigma, \Sigma)})$ , then $\max(\| \hat{H}_{P^c P} \hat{H}_{PP}^{-1} \|_{\infty}, \| \hat{H}_{Q^c Q} \hat{H}_{QQ}^{-1} \|_{\infty}) \leqslant 1 - \frac{\xi}{2}$ with probability at least $1 - \mathcal{O}\left(\frac{1}{d}\right)$ where $\tau(C_{\min}, \xi, \sigma, \Sigma)$ is a constant independent of $n_1, n_2, d, s_1$ and $s_2$ . + +Proof. We prove the Lemma for a general support $S$ (and corresponding non-support $S^c$ ) and samples $n$ . The results follow when we substitute $S$ by $P$ and $Q$ and $n$ by $n_1$ or $n_2$ based on the context. Let $|S| = s$ and $|S^c| = d - s$ . Before we prove the result of Lemma 4.5, we will prove a helper lemma. + +Lemma D.1. If Assumption 4.4 holds then for some $\delta >0$ , the following inequalities hold: + +$$ +\mathbb {P} (\| \hat {H} _ {S ^ {c} S} - H _ {S ^ {c} S} \| _ {\infty} \geqslant \delta) \leqslant 4 (d - s) s \exp (- \frac {n \delta^ {2}}{1 2 8 s ^ {2} (1 + 4 \sigma^ {2}) \max _ {l} \Sigma_ {l l} ^ {2}}) +$$ + +$$ +\mathbb {P} \left(\| \hat {H} _ {S S} - H _ {S S} \| _ {\infty} \geqslant \delta\right) \leqslant 4 s ^ {2} \exp \left(- \frac {n \delta^ {2}}{1 2 8 s ^ {2} \left(1 + 4 \sigma^ {2}\right) \max _ {l} \Sigma_ {l l} ^ {2}}\right) \tag {40} +$$ + +$$ +\mathbb {P} (\| (\hat {H} _ {S S}) ^ {- 1} - (H _ {S S}) ^ {- 1} \| _ {\infty} \geqslant \delta) \leqslant 2 \exp (- \frac {c \delta^ {2} C _ {\mathrm {m i n}} ^ {4} n}{4 s} + s) + 2 \exp (- \frac {c C _ {\mathrm {m i n}} ^ {2} n}{4} + s) +$$ + +Proof. Let $A_{ij}$ be $(i,j)$ -th entry of $\widehat{H}_{S^{\circ}S} - H_{S^{\circ}S}$ . Clearly, $\mathbb{E}(A_{ij}) = 0$ . By using the definition of the $\| \cdot \|_{\infty}$ norm, we can write: + +$$ +\begin{array}{l} \mathbb {P} \left(\| \widehat {H} _ {S ^ {c} S} - H _ {S ^ {c} S} \| _ {\infty} \geqslant \delta\right) = \mathbb {P} \left(\max _ {i \in S ^ {c}} \sum_ {j \in S} | A _ {i j} | \geqslant \delta\right) \\ \leqslant (d - s) \mathbb {P} \left(\sum_ {j \in S} | A _ {i j} | \geqslant \delta\right) \tag {41} \\ \leqslant (d - s) s \mathbb {P} (| A _ {i j} | \geqslant \frac {\delta}{s}) \\ \end{array} +$$ + +where the second last inequality comes as a result of the union bound across entries in $S^c$ and the last inequality is due to the union bound across entries in $S$ . Recall that $X_{i}, i \in [d]$ are zero mean random variables with covariance $\Sigma$ and each $\frac{X_i}{\sqrt{\Sigma_{ii}}}$ is a sub-Gaussian random variable with parameter $\sigma$ . Using the results from Lemma 1 of (Ravikumar et al., 2011), for some $\delta \in (0, s \max_l \Sigma_{ll} 8(1 + 4\sigma^2))$ , we can write: + +$$ +\mathbb {P} \left(\left| A _ {i j} \right| \geqslant \frac {\delta}{s}\right) \leqslant 4 \exp \left(- \frac {n \delta^ {2}}{1 2 8 s ^ {2} \left(1 + 4 \sigma^ {2}\right) \max _ {l} \Sigma_ {l l} ^ {2}}\right) \tag {42} +$$ + +Therefore, + +$$ +\mathbb {P} \left(\| \hat {H} _ {S ^ {c} S} - H _ {S ^ {c} S} \| _ {\infty} \geqslant \delta\right) \leqslant 4 (d - s) s \exp \left(- \frac {n \delta^ {2}}{1 2 8 s ^ {2} \left(1 + 4 \sigma^ {2}\right) \max _ {l} \Sigma_ {l l} ^ {2}}\right) \tag {43} +$$ + +Similarly, we can show that + +$$ +\mathbb {P} \left(\| \hat {H} _ {S S} - H _ {S S} \| _ {\infty} \geqslant \delta\right) \leqslant 4 s ^ {2} \exp \left(- \frac {n \delta^ {2}}{1 2 8 s ^ {2} \left(1 + 4 \sigma^ {2}\right) \max _ {l} \Sigma_ {l l} ^ {2}}\right) \tag {44} +$$ + +Next, we will show that the third inequality in (40) holds. Note that + +$$ +\begin{array}{l} \left\| \left(\hat {H} _ {S ^ {c} S}\right) ^ {- 1} - \left(H _ {S ^ {c} S}\right) ^ {- 1} \right\| _ {\infty} = \left\| \left(H _ {S S}\right) ^ {- 1} \left(H _ {S S} - \hat {H} _ {S S}\right) \left(\hat {H} _ {S S}\right) ^ {- 1} \right\| _ {\infty} \\ \leqslant \sqrt {s} \| \left(H _ {S S}\right) ^ {- 1} \left(H _ {S S} - \hat {H} _ {S S}\right) \left(\hat {H} _ {S S}\right) ^ {- 1} \| _ {2} \tag {45} \\ \leqslant \sqrt {s} \| (H _ {S S}) ^ {- 1} \| _ {2} \| (H _ {S S} - \hat {H} _ {S S}) \| _ {2} \| (\hat {H} _ {S S}) ^ {- 1} \| _ {2} \\ \end{array} +$$ + +Note that $\| H_{SS} \|_2 \geqslant C_{\min}$ , thus $\| (H_{SS})^{-1} \|_2 \leqslant \frac{1}{C_{\min}}$ . Similarly, $\| H_{SS} \|_2 \geqslant \frac{C_{\min}}{2}$ with probability at least $1 - 2 \exp \left( -\frac{cC_{\min}^2 n}{4} + s \right)$ . We also have $\| (H_{SS} - \widehat{H}_{SS}) \|_2 \leqslant \epsilon$ with probability at least $1 - 2 \exp \left( -c\epsilon^2 n + s \right)$ . Taking $\epsilon = \delta \frac{C_{\min}^2}{2\sqrt{s}}$ , we get + +$$ +\mathbb {P} \left(\| \left(H _ {S S} - \hat {H} _ {S S}\right) \| _ {2} \geqslant \delta \frac {C _ {\operatorname* {m i n}} ^ {2}}{2 \sqrt {s}}\right) \leqslant 2 \exp \left(- \frac {c \delta^ {2} C _ {\operatorname* {m i n}} ^ {4} n}{4 s} + s\right) \tag {46} +$$ + +It follows that $\| (\widehat{H}_{SS})^{-1} - (H_{SS})^{-1}\|_{\infty}\leqslant \delta$ with probability at least $1 - 2\exp (-\frac{c\delta^2C_{\min}^4n}{4s} +s) - 2\exp (-\frac{cC_{\min}^2n}{4} +s)$ . + +Now we are ready to show that the statement of Lemma 4.5 holds using the results from Lemma D.1. We will rewrite $\hat{H}_{S^c S}(\hat{H}_{SS})^{-1}$ as the sum of four different terms: + +$$ +\hat {H} _ {S ^ {c} S} \left(\hat {H} _ {S S}\right) ^ {- 1} = T _ {1} + T _ {2} + T _ {3} + T _ {4}, \tag {47} +$$ + +where + +$$ +T _ {1} \triangleq \hat {H} _ {S ^ {c} S} \left(\left(\hat {H} _ {S S}\right) ^ {- 1} - \left(H _ {S S}\right) ^ {- 1}\right) +$$ + +$$ +T _ {2} \triangleq \left(\hat {H} _ {S ^ {c} S} - H _ {S ^ {c} S}\right) \left(H _ {S S}\right) ^ {- 1} \tag {48} +$$ + +$$ +T _ {3} \triangleq (\hat {H} _ {S ^ {c} S} - H _ {S ^ {c} S}) ((\hat {H} _ {S S}) ^ {- 1} - (H _ {S S}) ^ {- 1}) +$$ + +$$ +T _ {4} \triangleq H _ {S ^ {\circ} S} \left(H _ {S S}\right) ^ {- 1}. +$$ + +Then it follows that $\| \widehat{H}_{S^c S}(\widehat{H}_{SS})^{-1}\|_{\infty}\leqslant \| T_1\|_{\infty} + \| T_2\|_{\infty} + \| T_3\|_{\infty} + \| T_4\|_{\infty}$ . Now, we will bound each term separately. First, recall that Assumption 4.4 ensures that $\| T_4\|_{\infty}\leqslant 1 - \xi$ + +Controlling $T_{1}$ . We can rewrite $T_{1}$ as, + +$$ +T _ {1} = - H _ {S ^ {\circ} S} \left(H _ {S S}\right) ^ {- 1} \left(\hat {H} _ {S S} - H _ {S S}\right) \left(\hat {H} _ {S S}\right) ^ {- 1} \tag {49} +$$ + +then, + +$$ +\begin{array}{l} \left\| T _ {1} \right\| _ {\infty} = \left\| H _ {S ^ {c} S} \left(H _ {S S}\right) ^ {- 1} \left(\hat {H} _ {S S} - H _ {S S}\right) \left(\hat {H} _ {S S}\right) ^ {- 1} \right\| _ {\infty} \\ \leqslant \| H _ {S ^ {\circ} S} (H _ {S S}) ^ {- 1} \| _ {\infty} \| (\hat {H} _ {S S} - H _ {S S}) \| _ {\infty} \| (\hat {H} _ {S S}) ^ {- 1} \| _ {\infty} \\ \leqslant (1 - \xi) \| (\widehat {H} _ {S S} - H _ {S S}) \| _ {\infty} \sqrt {s} \| (\widehat {H} _ {S S}) ^ {- 1} \| _ {2} \tag {50} \\ \leqslant (1 - \xi) \| (\hat {H} _ {S S} - H _ {S S}) \| _ {\infty} \frac {2 \sqrt {s}}{C _ {\mathrm {m i n}}} \\ \leqslant \frac {\xi}{6} \\ \end{array} +$$ + +The last inequality holds with probability at least $1 - 2\exp \left(-\frac{cC_{\min}^2n}{4} +s\right) - 4s^2\exp \left(-\frac{nC_{\min}^2\xi^2}{18432(1 - \xi)^2s^3(1 + 4\sigma^2)\max_l\Sigma_{ll}^2}\right)$ by taking $\delta = \frac{C_{\mathrm{min}}\xi}{12(1 - \xi)\sqrt{s}}$ + +**Controlling $T_{2}$ .** Recall that $T_{2} = (\hat{H}_{S^{c}S} - H_{S^{c}S})(H_{SS})^{-1}$ . Thus, + +$$ +\begin{array}{l} \left\| T _ {2} \right\| _ {\infty} \leqslant \sqrt {s} \left\| \left(H _ {S S}\right) ^ {- 1} \right\| _ {2} \| \left(\hat {H} _ {S ^ {c} S} - H _ {S ^ {c} S}\right) \| _ {\infty} \\ \leqslant \frac {\sqrt {s}}{C _ {\min }} \| \left(\hat {H} _ {S ^ {c} S} - H _ {S ^ {c} S}\right) \| _ {\infty} \tag {51} \\ \leqslant \frac {\xi}{6} \\ \end{array} +$$ + +The last inequality holds with probability at least $1 - 4(d - s)s\exp \left(-\frac{nC_{\min}^2\xi^2}{4608s^3(1 + 4\sigma^2)\max_l\Sigma_{ll}^2}\right)$ by choosing $\delta = \frac{C_{\mathrm{min}}\xi}{6\sqrt{s}}$ + +Controlling $T_{3}$ . Note that, + +$$ +\begin{array}{l} \left\| T _ {3} \right\| _ {\infty} \leqslant \left\| \left(\widehat {H} _ {S ^ {c} S} - H _ {S ^ {c} S}\right) \right\| _ {\infty} \left\| \left(\left(\widehat {H} _ {S S}\right) ^ {- 1} - \left(H _ {S S}\right) ^ {- 1}\right) \right\| _ {\infty} (52) \\ \leqslant \frac {\xi}{6} (52) \\ \end{array} +$$ + +The last inequality holds with probability at least $1 - 4(d - s)s\exp \left(-\frac{n\xi}{768s^2(1 + 4\sigma^2)\max_l\Sigma_ll^2}\right) - 2\exp \left(-\frac{c\xi C_{\min}^4n}{24s} +s\right) - 2\exp \left(-\frac{cC_{\min}^2n}{4} +s\right)$ by choosing $\delta = \sqrt{\frac{\xi}{6}}$ in the first and third inequality of equation (40). By combining all the above results, we prove Lemma 4.5. The specific results for $n_1$ and $n_2$ follow directly. + +# E. Proof of Lemma 5.3 + +Lemma 5.3. If Assumptions 4.1, 4.2 and 4.4 hold, and $\lambda_1 \geqslant 8\rho\sigma_e\sqrt{n_1\log d}$ , $\lambda_2 \geqslant 8\rho\sigma_e\sqrt{n_2\log d}$ , $n_1 = \Omega\left(\frac{s_1^3\log d}{\tau(C_{\min},\xi,\sigma,\Sigma)}\right)$ , and $n_2 = \Omega\left(\frac{s_2^3\log d}{\tau(C_{\min},\xi,\sigma,\Sigma)}\right)$ then $\|\Delta_1\|_2 \leqslant (2 + b_1)\frac{2\lambda_1\sqrt{s_1}}{C_{\min}n_1}$ and $\|\Delta_2\|_2 \leqslant (2 + b_2)\frac{2\lambda_2\sqrt{s_2}}{C_{\min}n_2}$ with probability at least $1 - \mathcal{O}\left(\frac{1}{d}\right)$ where $\tau(C_{\min},\xi,\sigma,\Sigma)$ is a constant independent of $s_1, s_2, d, n_1$ or $n_2$ . + +Proof. It suffices to prove the result for $\Delta_1$ as the result for $\Delta_2$ follows in the same way. Note, + +$$ +\begin{array}{l} \tilde {\beta} _ {1} = \arg \min _ {\beta \in \mathbb {R} ^ {s _ {1}}} \sum_ {i = 1} \frac {t _ {i} ^ {*} + 1}{2} (y _ {i} - X _ {i _ {P}} ^ {\intercal} \beta) ^ {2} + \lambda_ {1} (\| \beta \| _ {1} + 1) ^ {2} \\ = \arg \min _ {\beta \in \mathbb {R} ^ {s _ {1}}} \sum_ {i \in \mathcal {I} _ {1}} (y _ {i} - X _ {i _ {P}} ^ {\top} \beta) ^ {2} + \lambda_ {1} (\| \beta \| _ {1} + 1) ^ {2} \\ \end{array} +$$ + +The optimal $\tilde{\beta}_{1}$ must satisfy stationarity KKT condition at the optimum, i.e., + +$$ +\sum_ {i \in \mathcal {I} _ {1}} X _ {i _ {P}} (- y _ {i} + X _ {i _ {P}} ^ {\intercal} \tilde {\beta} _ {1}) + z \lambda_ {1} (z ^ {\intercal} \tilde {\beta} _ {1} + 1) = \mathbf {0} +$$ + +where $\| \tilde{\beta}_1\| _1 = z^\intercal \tilde{\beta}_1$ and $z$ is in the subdifferential set of $\| \tilde{\beta}_1\| _1$ and $\| z\|_{\infty}\leqslant 1$ . Since $i\in \mathcal{I}_1$ , we can substitute $y_{i} = X_{i_{P}}^{\top}\beta_{1_{P}}^{*} + e_{i}$ + +$$ +(\frac {1}{n _ {1}} \sum_ {i \in \mathcal {I} _ {1}} X _ {i _ {P}} X _ {i _ {P}} ^ {\intercal} + \frac {1}{n _ {1}} \lambda_ {1} z z ^ {\intercal}) (\beta_ {1 _ {P}} ^ {*} - \tilde {\beta} _ {1}) + \frac {1}{n _ {1}} (\sum_ {i \in \mathcal {I} _ {1}} X _ {i _ {P}} e _ {i}) + \frac {1}{n _ {1}} \lambda_ {1} z z ^ {\intercal} \beta_ {1 _ {P}} ^ {*} + \frac {1}{n _ {1}} \lambda_ {1} z = \mathbf {0} +$$ + +Note that $\widehat{H}_{1_{PP}} = \frac{1}{n_1}\sum_{i\in \mathcal{I}_1}X_{i_P}X_{i_P}^{\top}$ . Using norm-inequalities: + +$$ +\left\| \Delta_ {1} \right\| _ {2} \leqslant \left\| \left(\widehat {H} _ {1 P P} + \frac {\lambda_ {1}}{n _ {1}} z z ^ {\intercal}\right) ^ {- 1} \right\| _ {2} \left(\left\| \frac {1}{n _ {1}} \left(\sum_ {i \in \mathcal {I} _ {1}} X _ {i _ {P}} e _ {i}\right) \right\| _ {2} + \left\| \frac {1}{n _ {1}} \lambda_ {1} z z ^ {\intercal} \beta_ {1 P} ^ {*} \right\| _ {2} + \left\| \frac {1}{n _ {1}} \lambda_ {1} z \right\| _ {2}\right) \tag {53} +$$ + +Using Lemma 4.3, $\mathrm{eig}_{\min}(\widehat{H}_{1PP}) \geqslant \frac{C_{\min}}{2}$ , and using Weyl's inequality $\mathrm{eig}_{\min}(\widehat{H}_{1PP} + \frac{\lambda_1}{n_1} zz^{\intercal}) \geqslant \frac{C_{\min}}{2}$ . It follows that $\| (\widehat{H}_{1PP} + \frac{\lambda_1}{n_1} zz^{\intercal})^{-1} \|_2 \leqslant \frac{2}{C_{\min}}$ . + +$$ +\left\| \Delta_ {1} \right\| _ {2} \leqslant \frac {2}{C _ {\min }} \left(\left\| \frac {1}{n _ {1}} \left(\sum_ {i \in \mathcal {I} _ {1}} X _ {i _ {P}} e _ {i}\right) \right\| _ {2} + \frac {\lambda_ {1} \sqrt {s _ {1}}}{n _ {1}} \left\| \beta_ {1 _ {P}} ^ {*} \right\| _ {1} + \frac {\lambda_ {1} \sqrt {s _ {1}}}{n _ {1}}\right) \tag {54} +$$ + +We know that $\| \beta_1^*\| _1\leqslant b_1$ . Thus, + +$$ +\left\| \Delta_ {1} \right\| _ {2} \leqslant \frac {2}{C _ {\min }} \left(\left\| \frac {1}{n _ {1}} \left(\sum_ {i \in \mathcal {I} _ {1}} X _ {i _ {P}} e _ {i}\right) \right\| _ {2} + \frac {\lambda_ {1} \sqrt {s _ {1}}}{n _ {1}} b _ {1} + \frac {\lambda_ {1} \sqrt {s _ {1}}}{n _ {1}}\right) \tag {55} +$$ + +It only remains to bound $\| \frac{1}{n_1} (\sum_{i\in \mathcal{I}_1}X_{i_P}e_i)\| _2$ which we do in the following lemma. + +Lemma E.1. If $\lambda_1 \geqslant 8\rho\sigma_e\sqrt{n_1\log d}$ , then $\| \frac{1}{n_1} (\sum_{i \in \mathcal{I}_1} X_{i_P}e_i) \|_2 \leqslant \sqrt{s_1} \frac{\lambda_1}{n_1}$ with probability at least $1 - \mathcal{O}\left(\frac{1}{d}\right)$ . + +Thus, it follows that + +$$ +\left\| \Delta_ {1} \right\| _ {\infty} \leqslant \left\| \Delta_ {1} \right\| _ {2} \leqslant \left(2 + b _ {1}\right) \frac {2 \lambda_ {1} \sqrt {s _ {1}}}{C _ {\min } n _ {1}} \tag {56} +$$ + +# F. Proof of Lemma E.1 + +Lemma E.1 If $\lambda_1 \geqslant 8\rho\sigma_e\sqrt{n_1\log d}$ , then $\| \frac{1}{n_1} (\sum_{i \in \mathcal{I}_1} X_{i_P}e_i) \|_2 \leqslant \sqrt{s_1} \frac{\lambda_1}{n_1}$ with probability at least $1 - \mathcal{O}\left(\frac{1}{d}\right)$ . + +Proof. We will start with $\frac{1}{n_1}\sum_{i\in \mathcal{I}_1}X_{i_P}e_i$ . We take the $i$ -th entry of $\frac{1}{n_1}\sum_{i\in \mathcal{I}_1}X_{i_P}e_i$ for some $i\in P$ , i.e., $|\frac{1}{n}\sum_{j\in \mathcal{I}_1}X_{ji}\mathbf{e}_j|$ . Recall that $X_{ji}$ is a sub-Gaussian random variable with parameter $\rho^2$ and $e_j$ is a sub-Gaussian random variable with parameter $\sigma_e^2$ . Then, $\frac{X_{ji}}{\rho}\frac{e_j}{\sigma_e}$ is a sub-exponential random variable with parameters $(4\sqrt{2}, 2)$ . Using the concentration bounds for the sum of independent sub-exponential random variables (Wainwright, 2019), we can write: + +$$ +\mathbb {P} \left(\left| \frac {1}{n _ {1}} \sum_ {j \in \mathcal {I} _ {1}} \frac {X _ {j i}}{\rho} \frac {e _ {j}}{\sigma_ {e}} \right| \geqslant t\right) \leqslant 2 \exp \left(- \frac {n _ {1} t ^ {2}}{6 4}\right), 0 \leqslant t \leqslant 8 \tag {57} +$$ + +Taking a union bound across $i \in P$ : + +$$ +\mathbb {P} \left(\exists i \in P \mid \left| \frac {1}{n _ {1}} \sum_ {j \in \mathcal {I} _ {1}} \frac {X _ {j i}}{\rho} \frac {e _ {j}}{\sigma_ {e}} \right| \geqslant t\right) \leqslant 2 s _ {1} \exp \left(- \frac {n _ {1} t ^ {2}}{6 4}\right) \tag {58} +$$ + +$$ +0 \leqslant t \leqslant 8 +$$ + +It follows that $\| \frac{1}{n_1} (\sum_{i\in \mathcal{I}_1}X_{iP}e_i)\| _2\| _2\leqslant \sqrt{st}$ with probability at least $1 - 2s\exp (-\frac{nt^2}{64\rho^2\sigma_e^2})$ for some $0\leqslant t\leqslant 8\rho \sigma_{e}$ . Taking $t = \frac{\lambda_1}{n}$ , we get the desired result. + +# G. Proof of Lemma 5.4 + +Lemma 5.4 If Assumptions 4.1, 4.2 and 4.4 hold, and $\lambda_1 \geqslant 8\rho\sigma_e\sqrt{n_1\log d}$ , $\lambda_2 \geqslant 8\rho\sigma_e\sqrt{n_2\log d}$ , $n_1 = \Omega(\frac{s_1^3\log^2d}{\tau(C_{\min},\xi,\sigma,\Sigma)})$ and $n_2 = \Omega(\frac{s_2^3\log^2d}{\tau(C_{\min},\xi,\sigma,\Sigma)})$ then $\mu_i \geqslant 0, \forall i \in \mathcal{I}_1$ and $\nu_i \geqslant 0, \forall i \in \mathcal{I}_2$ with probability at least $1 - \mathcal{O}(\frac{1}{d})$ where $\tau(C_{\min},\xi,\sigma,\Sigma)$ is a constant independent of $s_1, s_2, d, n_1$ or $n_2$ . + +Proof. We start with the setting of $\mu_{i}$ when $i$ is in $\mathcal{I}_1$ . + +$$ +\begin{array}{l} \mu_ {i} = - \frac {1}{2} \langle \overline {{S}} _ {i} ^ {P}, \overline {{W}} \rangle + \frac {1}{2} \langle \overline {{S}} _ {i} ^ {Q}, \overline {{U}} \rangle \\ = - \frac {1}{2} (y _ {i} - X _ {i _ {P}} ^ {\intercal} \tilde {\beta} _ {1}) ^ {2} + \frac {1}{2} (y _ {i} - X _ {i _ {Q}} ^ {\intercal} \tilde {\beta} _ {2}) ^ {2} \\ = - \frac {1}{2} \left(y _ {i} - X _ {i _ {P}} ^ {\mathsf {T}} \beta_ {1 _ {P}} ^ {*} + X _ {i _ {P}} ^ {\mathsf {T}} \left(\tilde {\beta} _ {1} - \beta_ {1 _ {P}} ^ {*}\right)\right) ^ {2} + \frac {1}{2} \left(y _ {i} - X _ {i _ {Q}} ^ {\mathsf {T}} \beta_ {2 _ {Q}} ^ {*} + X _ {i _ {Q}} ^ {\mathsf {T}} \left(\tilde {\beta} _ {2} - \beta_ {2 _ {Q}} ^ {*}\right)\right) ^ {2} \tag {59} \\ = - \frac {1}{2} ((y _ {i} - X _ {i _ {P}} ^ {\mathsf {T}} \beta_ {1 _ {P}} ^ {*}) ^ {2} + (\tilde {\beta} _ {1} - \beta_ {1 _ {P}} ^ {*}) ^ {\mathsf {T}} X _ {i _ {P}} X _ {i _ {P}} ^ {\mathsf {T}} (\tilde {\beta} _ {1} - \beta_ {1 _ {P}} ^ {*}) + 2 (y _ {i} - X _ {i _ {P}} ^ {\mathsf {T}} \beta_ {1 _ {P}} ^ {*}) X _ {i _ {P}} ^ {\mathsf {T}} (\tilde {\beta} _ {1} - \beta_ {1 _ {P}} ^ {*})) + \\ \frac {1}{2} \big ((y _ {i} - X _ {i _ {Q}} ^ {\mathsf {T}} \beta_ {2 _ {Q}} ^ {*} \big) ^ {2} + (\tilde {\beta} _ {2} - \beta_ {2 _ {Q}} ^ {*}) ^ {\mathsf {T}} X _ {i _ {Q}} X _ {i _ {Q}} ^ {\mathsf {T}} (\tilde {\beta} _ {2} - \beta_ {2 _ {Q}} ^ {*}) + 2 (y _ {i} - X _ {i _ {Q}} ^ {\mathsf {T}} \beta_ {2 _ {Q}} ^ {*}) X _ {i _ {Q}} ^ {\mathsf {T}} (\tilde {\beta} _ {2} - \beta_ {2 _ {P}} ^ {*}) \big) \\ \end{array} +$$ + +Since $i\in \mathcal{I}_1$ , we can substitute $y_{i} = X_{iP}^{\top}\beta_{1P}^{*} + e_{i}$ + +$$ +\begin{array}{l} \mu_ {i} = - \frac {1}{2} (y _ {i} - X _ {i _ {P}} ^ {\intercal} \beta_ {1 _ {P}} ^ {*}) ^ {2} + \frac {1}{2} (y _ {i} - X _ {i _ {Q}} ^ {\intercal} \beta_ {2 _ {Q}} ^ {*}) ^ {2} - \frac {1}{2} \Delta_ {1} ^ {\intercal} X _ {i _ {P}} X _ {i _ {P}} ^ {\intercal} \Delta_ {1} + \frac {1}{2} \Delta_ {2} ^ {\intercal} X _ {i _ {Q}} X _ {i _ {Q}} ^ {\intercal} \Delta_ {2} - e _ {i} X _ {i _ {P}} ^ {\intercal} \Delta_ {1} + \\ \left(X _ {i _ {P}} ^ {\intercal} \beta_ {1 _ {P}} ^ {*} + e _ {i} - X _ {i _ {Q}} ^ {\intercal} \beta_ {2 _ {Q}} ^ {*}\right) X _ {i _ {Q}} ^ {\intercal} \Delta_ {2} \tag {60} \\ = - \frac {1}{2} \left(y _ {i} - X _ {i _ {P}} ^ {\intercal} \beta_ {1 _ {P}} ^ {*}\right) ^ {2} + \frac {1}{2} \left(y _ {i} - X _ {i _ {Q}} ^ {\intercal} \beta_ {2 _ {Q}} ^ {*}\right) ^ {2} - \frac {1}{2} \Delta_ {1} ^ {\intercal} X _ {i _ {P}} X _ {i _ {P}} ^ {\intercal} \Delta_ {1} + \frac {1}{2} \Delta_ {2} ^ {\intercal} X _ {i _ {Q}} X _ {i _ {Q}} ^ {\intercal} \Delta_ {2} - e _ {i} X _ {i _ {P}} ^ {\intercal} \Delta_ {1} + \\ e _ {i} X _ {i _ {Q}} ^ {\intercal} \Delta_ {2} + (\beta_ {1} ^ {*} - \beta_ {2} ^ {*}) ^ {\intercal} X _ {i} X _ {i} ^ {\intercal} (\beta_ {2} - \beta_ {2} ^ {*}) \\ \end{array} +$$ + +Using bounds on the eigenvalue of data matrix, Assumption 4.1 and bounds on $\| \Delta_1\| _2$ and $\| \Delta_2\| _2$ , we can place a bound on $\mu_{i}$ . + +$$ +\mu_ {i} \geqslant \epsilon - \frac {n _ {1} 3 C _ {\operatorname* {m a x}}}{2} \| \Delta_ {1} \| _ {2} ^ {2} + \frac {n _ {2} C _ {\min }}{2} \| \Delta_ {2} \| _ {2} ^ {2} - | e _ {i} X _ {i _ {P}} ^ {\intercal} \Delta_ {1} | - | e _ {i} X _ {i _ {Q}} ^ {\intercal} \Delta_ {2} | - \frac {n 3 C _ {\max }}{2} \| (\beta_ {1} ^ {*} - \beta_ {2} ^ {*}) \| _ {2} \| \Delta_ {2} \| _ {2} \tag {61} +$$ + +We still need bound to bound $|e_i X_{i_P}^\mathsf{T} \Delta_1|$ and $|e_i X_{i_Q}^\mathsf{T} \Delta_2|$ which we do in the following lemma. + +# Lemma G.1. The following holds: + +1. For fixed $\| \Delta_1\| _2$ $\mathbb{P}(|e_iX_{i_P}^\top \Delta_1|\leqslant \frac{\epsilon}{4})$ with probability at least $1 - \mathcal{O}(\frac{1}{d})$ +2. For fixed $\| \Delta_2\| _2$ , $\mathbb{P}(|e_iX_{i_Q}^\top \Delta_2|\leqslant \frac{\epsilon}{4})$ with probability at least $1 - \mathcal{O}\left(\frac{1}{d}\right)$ + +Proof. Recall that $X_{i_P}^{\mathsf{T}}\Delta_1$ is a sub-Gaussian random variable with parameter $\rho^2\| \Delta_1\| _2^2$ and $e_i$ is a sub-Gaussian random variable with parameter $\sigma_e^2$ . Then, $\frac{X_{i_P}^{\mathsf{T}}\Delta_1}{\rho\|\Delta_1\|_2}\frac{e_i}{\sigma_e}$ is a sub-exponential random variable with parameters $(4\sqrt{2},2)$ . Using the concentration bounds for the sum of independent sub-exponential random variables (Wainwright, 2019), we can write: + +$$ +\mathbb {P} \left(\left| \frac {X _ {i _ {P}} ^ {\top} \Delta_ {1}}{\rho \| \Delta_ {1} \| _ {2}} \frac {e _ {i}}{\sigma_ {e}} \right| \geqslant t\right) \leqslant 2 \exp \left(- \frac {t ^ {2}}{6 4}\right), 0 \leqslant t \leqslant 8 \tag {62} +$$ + +Taking $t = \frac{t}{\rho\|\Delta_1\|_2\sigma_e}$ , we get + +$$ +\mathbb {P} \left(\left| e _ {i} X _ {i _ {P}} ^ {\top} \Delta_ {1} \right| \geqslant t\right) \leqslant 2 \exp \left(- \frac {t ^ {2}}{6 4 \rho^ {2} \| \Delta_ {1} \| _ {2} ^ {2} \sigma_ {e} ^ {2}}\right), 0 \leqslant t \leqslant 8 \rho \| \Delta_ {1} \| _ {2} \sigma_ {e} \tag {63} +$$ + +We take $t = \frac{\epsilon}{4}$ , then + +$$ +\mathbb {P} \left(\left| e _ {i} X _ {i _ {P}} ^ {\top} \Delta_ {1} \right| \geqslant \frac {\epsilon}{4}\right) \leqslant 2 \exp \left(- \frac {\epsilon^ {2}}{1 6 \times 6 4 \rho^ {2} \| \Delta_ {1} \| _ {2} ^ {2} \sigma_ {e} ^ {2}}\right), 0 \leqslant \epsilon \leqslant 3 2 \rho \| \Delta_ {1} \| _ {2} \sigma_ {e} \tag {64} +$$ + +Since $\| \Delta_1\| _2$ is upper bounded with $\mathcal{O}(\frac{\lambda_1}{n_1}\sqrt{s_1})$ and $n_1$ is of order $\mathcal{O}(s_1^3\log^2 d)$ , thus $\mathbb{P}(|e_iX_{i_P}^\top \Delta_1|\leqslant \frac{\epsilon}{4})$ with probability at least $1 - \mathcal{O}(\frac{1}{d})$ . Similarly, $\mathbb{P}(|e_iX_{i_Q}^\top \Delta_2|\leqslant \frac{\epsilon}{4})$ with probability at least $1 - \mathcal{O}(\frac{1}{d})$ . + +Till now, we have considered $\| \Delta_1\| _2$ and $\| \Delta_2\| _2$ to be fixed quantity, however they are also upper bounded by $\mathcal{O}(\frac{\lambda_1}{n_1}\sqrt{s_1})$ with probability at least $1 - \mathcal{O}(\frac{1}{d})$ , thus the overall probability that $u_{i}\geqslant 0,i\in \mathcal{I}_{1}$ is at least $1 - \mathcal{O}(\frac{1}{d})$ as long as + +$$ +\epsilon \geqslant 3 n _ {1} C _ {\max } \| \Delta_ {1} \| _ {2} ^ {2} - n _ {2} C _ {\min } \| \Delta_ {2} \| _ {2} ^ {2} + 3 n C _ {\max } \| \beta_ {1} ^ {*} - \beta_ {2} ^ {*} \| _ {2} \| \Delta_ {2} \| _ {2} \tag {65} +$$ + +We need to take a union bound across entries in $\mathcal{I}_1$ which changes the probability to at least $1 - \mathcal{O}(\exp (-\log d + \log n_1))$ which is still dominated by $1 - \mathcal{O}\left(\frac{1}{d}\right)$ . + +![](images/e52d088cd4c03271100866e451ea2f1c3ed083bbb23f5e26a91bf59bdbca940e.jpg) + +# H. Proof of Lemma 5.5 + +Lemma 5.5 Both $\Pi$ and $\Lambda$ have zero eigenvalues corresponding to eigenvectors $\begin{bmatrix} \tilde{\beta}_1 \\ 1 \end{bmatrix}$ and $\begin{bmatrix} \tilde{\beta}_2 \\ 1 \end{bmatrix}$ respectively. + +Proof. It suffices to prove the result for $\Pi$ as the result for $\Lambda$ follows in the same way. Note, + +$$ +\begin{array}{l} \tilde {\beta} _ {1} = \arg \min _ {\beta \in \mathbb {R} ^ {s _ {1}}} \sum_ {i = 1} \frac {t _ {i} ^ {*} + 1}{2} (y _ {i} - X _ {i _ {P}} ^ {\intercal} \beta) ^ {2} + \lambda_ {1} (\| \beta \| _ {1} + 1) ^ {2} \\ = \arg \min _ {\beta \in \mathbb {R} ^ {s _ {1}}} \sum_ {i \in \mathcal {I} _ {1}} (y _ {i} - X _ {i _ {P}} ^ {\intercal} \beta) ^ {2} + \lambda_ {1} (\| \beta \| _ {1} + 1) ^ {2} \\ \end{array} +$$ + +The optimal $\tilde{\beta}_{1}$ must satisfy stationarity KKT condition at the optimum, i.e., + +$$ +\sum_ {i \in \mathcal {I} _ {1}} X _ {i _ {P}} (- y _ {i} + X _ {i _ {P}} ^ {\intercal} \tilde {\beta} _ {1}) + z \lambda_ {1} (z ^ {\intercal} \tilde {\beta} _ {1} + 1) = \mathbf {0} +$$ + +By little algebraic manipulation, we can rewrite the above as following: + +$$ +\left(\sum_ {i = 1} ^ {n} \frac {t _ {i} ^ {*} + 1}{2} \bar {S} _ {i} ^ {P} + \lambda_ {1} Z + I _ {\alpha}\right) \left[ \begin{array}{c} \tilde {\beta} _ {1} \\ 1 \end{array} \right] = \mathbf {0} +$$ + +where $Z = \left[ \begin{array}{l}z\\ 1 \end{array} \right]\left[ \begin{array}{ll}z^{\mathsf{T}} & 1 \end{array} \right] = \mathrm{sign}(\overline{W})$ . Clearly, + +$$ +\Pi \left[ \begin{array}{c} \tilde {\beta} _ {1} \\ 1 \end{array} \right] = \mathbf {0} +$$ + +Similarly, we can show + +$$ +\Lambda \left[ \begin{array}{c} \tilde {\beta} _ {2} \\ 1 \end{array} \right] = \mathbf {0} +$$ + +# I. Proof of Lemma 5.6 + +Lemma 5.6 If Assumption 4.2 holds and $n_1 = \Omega \left( \frac{s_1 + \log d}{C_{\min}^2} \right)$ and $n_2 = \Omega \left( \frac{s_2 + \log d}{C_{\min}^2} \right)$ , then the second eigenvalues of $\Pi$ and $\Lambda$ are strictly positive with probability at least $1 - \mathcal{O}\left(\frac{1}{d}\right)$ , i.e., $\mathrm{eig}_2(\Pi) > 0$ and $\mathrm{eig}_2(\Lambda) > 0$ . + +Proof. It suffices to prove the result for $\Pi$ as similar arguments can be used to prove the result for $\Lambda$ . We know + +$$ +\begin{array}{l} \Pi = \sum_ {i \in \mathcal {I} _ {1}} S _ {i} ^ {P} + \lambda_ {1} Z + I _ {\alpha} \\ = \sum_ {i \in \mathcal {I} _ {1}} \left[ \begin{array}{c c} X _ {i} X _ {i} ^ {\intercal} & - X _ {i} y _ {i} \\ - y _ {i} X _ {i} ^ {\intercal} & y _ {i} ^ {2} \end{array} \right] + \lambda_ {1} \left[ \begin{array}{c c} z z ^ {\intercal} & z \\ z ^ {\intercal} & 1 \end{array} \right] + I _ {\alpha} \tag {66} \\ = \left[ \begin{array}{c c} \sum_ {i \in \mathcal {I} _ {1}} X _ {i} X _ {i} ^ {\intercal} + \lambda_ {1} z z ^ {\intercal} & \sum_ {i \in \mathcal {I} _ {1}} - X _ {i} y _ {i} + \lambda_ {1} z \\ \sum_ {i \in \mathcal {I} _ {1}} - y _ {i} X _ {i} ^ {\intercal} + \lambda_ {1} z ^ {\intercal} & \sum_ {i \in \mathcal {I} _ {1}} y _ {i} ^ {2} + \lambda_ {1} + \alpha \end{array} \right] \\ \end{array} +$$ + +Also note that $\alpha = -\langle \sum_{i\in \mathcal{I}_1}S_i^P +\lambda_1Z,\overline{W}\rangle = -\sum_{i\in \mathcal{I}_1}(y_i - X_{i_P}^\top \tilde{\beta}_1)^2 +\lambda_1(\| \tilde{\beta}_1\| _1 + 1)^2$ We also know that $\tilde{\beta}_{1}$ satisfies the stationarity KKT condition, i.e., + +$$ +\begin{array}{l} \sum_ {i \in \mathcal {I} _ {1}} X _ {i _ {P}} (- y _ {i} + X _ {i _ {P}} ^ {\intercal} \tilde {\beta} _ {1}) + z \lambda_ {1} (z ^ {\intercal} \tilde {\beta} _ {1} + 1) = \mathbf {0} \\ \tilde {\beta} _ {1} = - \left(\sum_ {i \in \mathcal {I} _ {1}} X _ {i} X _ {i} ^ {\intercal} + \lambda_ {1} z z ^ {\intercal}\right) ^ {- 1} \left(\sum_ {i \in \mathcal {I} _ {1}} - X _ {i} y _ {i} + \lambda_ {1} z\right) \\ \end{array} +$$ + +Using the stationarity KKT condition, we can simplify objective function value of optimization problem (11) at $\tilde{\beta}_{1}$ to $\sum_{i\in \mathcal{I}_1}y_i^2 +(\sum_{i\in \mathcal{I}_1} - y_iX_i^\intercal +\lambda_1z^\intercal)\tilde{\beta}_1 + \lambda_1$ . Now, we invoke Haynesworth's inertia additivity formula (Haynsworth, 1968) to prove our claim. Let $R$ be a block matrix of the form $R = \left[ \begin{array}{cc}A & B\\ B^{\intercal} & C \end{array} \right]$ , then inertia of matrix $R$ , denoted by $\operatorname {In}(R)$ , is defined as the tuple $(|\mathrm{eig}_{+}(R)|,|\mathrm{eig}_{-}(R)|,|\mathrm{eig}_{0}(R)|)$ where $|\mathrm{eig}_{+}(R)|$ is the number of positive eigenvalues, $|\mathrm{eig}_{-}(R)|$ is the number of negative eigenvalues and $|\mathrm{eig}_0(R)|$ is the number of zero eigenvalues of matrix $R$ . Haynesworth's inertia additivity formula is given as: + +$$ +\operatorname {I n} (R) = \operatorname {I n} (A) + \operatorname {I n} \left(C - B ^ {\top} A ^ {- 1} B\right) \tag {67} +$$ + +We take $A = \sum_{i \in \mathcal{I}_1} X_i X_i^\top + \lambda_1 z z^\top$ , $B = \sum_{i \in \mathcal{I}_1} -X_i y_i + \lambda_1 z$ and $C = \sum_{i \in \mathcal{I}_1} y_i^2 + \lambda_1 + \alpha$ . It should be noted that $C - B^\top A^{-1} B$ evaluates to zero. Thus, + +$$ +\operatorname {I n} (\Pi) = \operatorname {I n} \left(\sum_ {i \in \mathcal {I} _ {1}} X _ {i} X _ {i} ^ {\intercal} + \lambda_ {1} z z ^ {\intercal}\right) + \operatorname {I n} (0) \tag {68} +$$ + +We note that 0 has precisely one zero eigenvalue and no other eigenvalues. Moreover, from Lemma 4.3 and Weyl's inequality: + +$$ +\operatorname {e i g} _ {\min } \left(\sum_ {i \in \mathcal {I} _ {1}} X _ {i} X _ {i} ^ {\intercal} + \lambda_ {1} z z ^ {\intercal}\right) \geqslant \frac {C _ {\min }}{2} > 0 \tag {69} +$$ + +with probability at least $1 - \mathcal{O}\left(\frac{1}{d}\right)$ as long as $n_1 = \Omega\left(\frac{s_1 + \log d}{C_{\min}^2}\right)$ . It follows that the second eigenvalue of $\Pi$ is strictly positive. Similar, arguments can be made for $\Lambda$ . + +# J. Proof of Lemma 5.7 + +Lemma 5.7 Let $\lambda_1 \geqslant \frac{64\rho\sigma_e}{\xi}\sqrt{n_1\log d}$ . Then the following holds true: + +$$ +\mathbb {P} \left(\| \frac {1}{\bar {\lambda} _ {1}} \frac {1}{n _ {1}} \sum_ {i \in \mathcal {I} _ {1}} X _ {i _ {P}} e _ {i} \| _ {\infty} \geqslant \frac {\xi}{8 - 4 \xi}\right) \leqslant \mathcal {O} \left(\frac {1}{d}\right), +$$ + +$$ +\mathbb {P} (\| \frac {1}{\bar {\lambda} _ {1}} \frac {1}{n _ {1}} \sum_ {i \in \mathcal {I} _ {1}} X _ {i _ {P ^ {c}}} e _ {i} \| _ {\infty} \geqslant \frac {\xi}{8}) \leqslant \mathcal {O} (\frac {1}{d}) +$$ + +Proof. We will start with $\frac{1}{n_1}\sum_{i\in \mathcal{I}_1}X_{i_P}e_i$ . We take the $i$ -th entry of $\frac{1}{n_1}\sum_{i\in \mathcal{I}_1}X_{i_P}e_i$ for some $i\in P$ , i.e., $|\frac{1}{n}\sum_{j\in \mathcal{I}_1}X_{ji}\mathbf{e}_j|$ . Recall that $X_{ji}$ is a sub-Gaussian random variable with parameter $\rho^2$ and $e_j$ is a sub-Gaussian random variable with parameter $\sigma_e^2$ . Then, $\frac{X_{ji}}{\rho}\frac{e_j}{\sigma_e}$ is a sub-exponential random variable with parameters $(4\sqrt{2}, 2)$ . Using the concentration bounds for the sum of independent sub-exponential random variables (Wainwright, 2019), we can write: + +$$ +\mathbb {P} \left(\left| \frac {1}{n _ {1}} \sum_ {j \in \mathcal {I} _ {1}} \frac {X _ {j i}}{\rho} \frac {e _ {j}}{\sigma_ {e}} \right| \geqslant t\right) \leqslant 2 \exp \left(- \frac {n _ {1} t ^ {2}}{6 4}\right), 0 \leqslant t \leqslant 8 \tag {70} +$$ + +Taking a union bound across $i\in P$ .. + +$$ +\mathbb {P} (\exists i \in P \mid | \frac {1}{n _ {1}} \sum_ {j \in \mathcal {I} _ {1}} \frac {X _ {j i}}{\rho} \frac {e _ {j}}{\sigma_ {e}} | \geqslant t) \leqslant 2 s _ {1} \exp \left(- \frac {n _ {1} t ^ {2}}{6 4}\right) \tag {71} +$$ + +$$ +0 \leqslant t \leqslant 8 +$$ + +Taking $t = \frac{\bar{\lambda}_1 t}{\rho \sigma_e}$ , we get: + +$$ +\mathbb {P} \left(\exists i \in P \mid \left| \frac {1}{\bar {\lambda} _ {1}} \frac {1}{n _ {1}} \sum_ {j = 1} ^ {n} X _ {j i} e _ {j} \right| \geqslant t\right) \leqslant 2 s _ {1} \exp \left(- \frac {n _ {1} \bar {\lambda} _ {1} ^ {2} t ^ {2}}{6 4 \rho^ {2} \sigma_ {e} ^ {2}}\right) \tag {72} +$$ + +$$ +0 \leqslant t \leqslant 8 \frac {\rho \sigma_ {e}}{\bar {\lambda} _ {1}} +$$ + +It follows that $\| \frac{1}{\lambda_1} \frac{1}{n_1} \sum_{i \in \mathcal{I}_1} X_{i_P} e_i \|_{\infty} \leqslant t$ with probability at least $1 - 2s_1 \exp \left( -\frac{n \bar{\lambda}_1^2 t^2}{64 \rho^2 \sigma_e^2} \right)$ . + +Using a similar argument, we can show that $\| \frac{1}{\lambda_1} \frac{1}{n_1} \sum_{i \in \mathcal{I}_1} X_{iP^c} e_i \|_{\infty} \leqslant t$ with probability at least $1 - 2(d - s_1) \exp \left( -\frac{n_1 \bar{\lambda}_1^2 t^2}{64 \rho^2 \sigma_e^2} \right)$ . Taking $t = \frac{\xi}{8 - 4\xi}$ and $\frac{\xi}{8}$ in the first and second inequality of Lemma 5.7 and choosing the provided setting of $\lambda_1$ and $n_1$ completes our proof. + +# K. Additional Experiments + +![](images/ad075acf268024e57092591aacbfc0d19eb6f9ce9f7deee184de28bba0a42077.jpg) +(a) Misidentified labels + +![](images/69a8209a8a261e8ab0f6f458b6de856aef155485a5739821aa5575cb0d2b2735.jpg) +(b) Support recovery +Figure 2. Label and support recovery with control parameter $C_p$ for high dimensional case $d = 100, 200$ . We also show that the norm error indeed goes towards 0. + +![](images/10c133a15b8093d0b1d8dc768ae65498b40e1da1e257d2f7928cb5196fbc0314.jpg) +(c) $\ell_2$ Norm error + +Following the setting mentioned in Section 6, we conduct further high dimensional ( $d = 100$ , 200) experiments to validate our theoretical results. We observe a similar trend, i.e., as we increase number of samples, we make zero mistakes in label recovery and achieve $100\%$ correct support recovery for both parameter vectors. Additionally, we also show that the norm error, i.e., $\| \beta_{j} - \beta_{j}^{*}\|_{2}, j \in \{1,2\}$ goes towards zero in our experiments. \ No newline at end of file diff --git a/sparsemixedlinearregressionwithguaranteestaminganintractableproblemwithinvexrelaxation/images.zip b/sparsemixedlinearregressionwithguaranteestaminganintractableproblemwithinvexrelaxation/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..a8400f2d736c8399a7a51372aab501324c2ef8c3 --- /dev/null +++ b/sparsemixedlinearregressionwithguaranteestaminganintractableproblemwithinvexrelaxation/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ea14c0342195780fd9b5cfb5e99c85a05e44acbc10dcb0019c537d1e58cfeb00 +size 1099104 diff --git a/sparsemixedlinearregressionwithguaranteestaminganintractableproblemwithinvexrelaxation/layout.json b/sparsemixedlinearregressionwithguaranteestaminganintractableproblemwithinvexrelaxation/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..e728573bf682157e1804944e0d2623b25060cb15 --- /dev/null +++ b/sparsemixedlinearregressionwithguaranteestaminganintractableproblemwithinvexrelaxation/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:186af605e14dda2157e446e4edd9bef317b118a628fdebe430529bbfcdeb4c9c +size 1210366 diff --git a/sparsityinpartiallycontrollablelinearsystems/2fa9f343-8eaa-492d-9ded-5078ee3fa804_content_list.json b/sparsityinpartiallycontrollablelinearsystems/2fa9f343-8eaa-492d-9ded-5078ee3fa804_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..b4e374b6a47050b6a17b0e36d65d2dcd708ae375 --- /dev/null +++ b/sparsityinpartiallycontrollablelinearsystems/2fa9f343-8eaa-492d-9ded-5078ee3fa804_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:63fef8cdf354a638bc5bd1f0379a064557eaedb3f2cc8a7ee552da5028ffb42f +size 79780 diff --git a/sparsityinpartiallycontrollablelinearsystems/2fa9f343-8eaa-492d-9ded-5078ee3fa804_model.json b/sparsityinpartiallycontrollablelinearsystems/2fa9f343-8eaa-492d-9ded-5078ee3fa804_model.json new file mode 100644 index 0000000000000000000000000000000000000000..851b96a6fa43bef1b123018c72f727dcdebec1fa --- /dev/null +++ b/sparsityinpartiallycontrollablelinearsystems/2fa9f343-8eaa-492d-9ded-5078ee3fa804_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b31f5413db5149fa737067f9299043550940d9a0331dd62aab1520f3d6f92586 +size 98796 diff --git a/sparsityinpartiallycontrollablelinearsystems/2fa9f343-8eaa-492d-9ded-5078ee3fa804_origin.pdf b/sparsityinpartiallycontrollablelinearsystems/2fa9f343-8eaa-492d-9ded-5078ee3fa804_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..4904887130e5c23f4b232aca56a21ea9b602862f --- /dev/null +++ b/sparsityinpartiallycontrollablelinearsystems/2fa9f343-8eaa-492d-9ded-5078ee3fa804_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e5499dc1b6bded3dc3002c4c9445e531c8e488ca04440f07c45059a32889c3fa +size 381591 diff --git a/sparsityinpartiallycontrollablelinearsystems/full.md b/sparsityinpartiallycontrollablelinearsystems/full.md new file mode 100644 index 0000000000000000000000000000000000000000..ed05bdd2a7177b6c3d64bbc091836979d7d15a97 --- /dev/null +++ b/sparsityinpartiallycontrollablelinearsystems/full.md @@ -0,0 +1,339 @@ +# Sparsity in Partially Controllable Linear Systems + +Yonathan Efroni1 Sham Kakade1 Akshay Krishnamurthy1 Cyril Zhang1 + +# Abstract + +A fundamental concept in control theory is that of controllability, where any system state can be reached through an appropriate choice of control inputs. Indeed, a large body of classical and modern approaches are designed for controllable linear dynamical systems. However, in practice, we often encounter systems in which a large set of state variables evolve exogenously and independently of the control inputs; such systems are only partially controllable. The focus of this work is on a large class of partially controllable linear dynamical systems, specified by an underlying sparsity pattern. Our main results establish structural conditions and finite-sample guarantees for learning to control such systems. In particular, our structural results characterize those state variables which are irrelevant for optimal control, an analysis which departs from classical control techniques. Our algorithmic results adapt techniques from high-dimensional statistics—specifically soft-thresholding and semiparametric least-squares—to exploit the underlying sparsity pattern in order to obtain finite-sample guarantees that significantly improve over those based on certainty-equivalence. We also corroborate these theoretical improvements over certainty-equivalent control through a simulation study. + +# 1. Introduction + +A recurring theme in modern sequential decision making and control applications is the presence of high-dimensional signals containing much irrelevant information. Operating on raw signals provides flexibility to learn much higher-quality policies than what may be expressed using hand-engineered inputs or features, but it poses new challenges for reinforcement learning (RL) and control. In the context of + +controls, high-dimensionality inevitably leads to many state variables that do not affect and cannot be affected by the controller inputs. Hence, these state variables are irrelevant for optimal control. In this work, we consider the question of how to efficiently learn to control partially controllable systems, while ignoring these irrelevant variables. + +Example 1 (Turbine Orientation (Stanfel et al., 2020)). Consider the problem of learning to orient turbines in a wind farm in response to sensor measurements of wind speed and direction. To learn a high-quality controller that can anticipate local wind patterns, it is desirable to collect measurements from a broad region. However geographical features such as mountains and valleys may render some of these measurements irrelevant for the control task, although this may not be known to the system designer in advance. As such, we would like our controller to efficiently learn to ignore these irrelevant sensors while relying on the relevant ones for decision making. + +Systems like this contain two challenging elements for learning to control. First, a large part of the system state — namely the wind speed and direction at all locations — is completely uncontrollable, as the wind turbines negligibly affect weather patterns. Rather, the controller must react to these state variables even though they cannot be controlled. Second, some of the uncontrollable variables may be completely irrelevant, meaning they have no bearing on the optimal control decisions. To complicate matters, which variables are controllable, uncontrollable, and irrelevant must be learned, ideally in a sample-efficient manner. + +In the broader literature, there are two well-studied approaches for addressing high dimensionality. One approach is through feature engineering or the use of kernel machines, while the other exploits sparsity to recover certain low-dimensional structural information. Both approaches have been utilized in the context of decision making, the former via dimension-free linear control (Perdomo et al., 2021) and the Kernelized Nonlinear Regulator (Deisenroth and Rasmussen, 2011; Mania et al., 2020; Kakade et al., 2020), and the latter both in RL (Agarwal et al., 2020; Hao et al., 2021) and some works on continuous control (Fattahi and Sojoudi, 2018; Wang and Yang, 2020; Sun et al., 2020). This work contributes to the latter line of work on structure recovery in continuous control. + +Our focus is on establishing non-asymptotic guarantees for learning to control in high-dimensional partially controllable systems like the wind farm example described above. We focus our attention on the problem of learning the linear quadratic regulator (LQR) in which the majority of the state variables are irrelevant. + +Technical Overview. Deferring further details and technical motivation to subsequent sections, we present a brief overview of the setup and results. Consider a dynamical system of the form $x_{t + 1} = Ax_t + Bu_t + \xi_t$ where $x_{t}\in \mathbb{R}^{d}$ is the system state, $u_{t}\in \mathbb{R}^{d_{u}}$ is the controller input, and $\xi_{t}$ is a (stochastic) disturbance. The system is said to be controllable if, in expectation, any system state can be reached through an appropriate choice of a deterministic control sequence (Formally, this condition is equivalent to the controllability matrix being full rank. See Section 3). When such a condition does not hold, we call the system partially controllable. For such systems, it is well known that there exists an invertible transformation of the state variables, such that the system can be rewritten with dynamics of the form (Klamka, 1963; Sontag, 2013): + +$$ +A = \left[ \begin{array}{c c} A _ {1} & A _ {1 2} ^ {\mathrm {P C}} \\ 0 & A _ {2} ^ {\mathrm {P C}} \end{array} \right], \qquad B = \left[ \begin{array}{c} B _ {1} \\ 0 \end{array} \right]. \tag {1} +$$ + +Here the first block of coordinates corresponds to the controllable subsystem. On the other hand, the second block of uncontrollable coordinates cannot be affected by the control inputs (due to that $B_{2} = 0$ , although it can affect the controllable subsystem (if $A_{12}^{\mathrm{PC}} \neq 0$ ) (Klamka, 1963; Zhou et al., 1996; Sontag, 2013). + +To capture the presence of irrelevant state variables that do not affect the controllable subsystem, we consider a dynamical system that is more structured than (1). In our setting, which we call the partially controllable linear-quadratic (PC-LQ) control problem, the system admits the block structure: + +$$ +A = \left[ \begin{array}{c c c} A _ {1} & A _ {1 2} & 0 \\ 0 & A _ {2} & 0 \\ 0 & A _ {3 2} & A _ {3} \end{array} \right], \qquad B = \left[ \begin{array}{c} B _ {1} \\ 0 \\ 0 \end{array} \right]. \qquad (2) +$$ + +To capture the irrelevance of state variables, our main learnability results will assume that the underlying dynamics of the system are determined by an $(A,B)$ in this form, up to a permutation of the coordinates (see below for more discussion about this assumption). As we shall see, the first two blocks make up the relevant part of the system, while the third block of coordinates are irrelevant (in the sense that if we condition on knowing the values of the coordinates in blocks 1 and 2, then the state variables in block 3 provide no further information with regards to predicting the controllable coordinates in block 1, which, as we shall see, is what is required for optimal control). We are particularly interested in the high-dimensional regime where $A_{1}\in \mathbb{R}^{s_{c}\times s_{c}}$ , $A_{2}\in \mathbb{R}^{s_{e}\times s_{e}}$ and $s_c + s_e\coloneqq s\ll d$ . + +Our Contributions. Our first theorem is a structural result characterizing which state variables are irrelevant for optimal control. The result pertains to all problems equivalent to PC-LQ control, and is proven via an invariance argument. When specialized to PC-LQ control, the theorem verifies that the third block of state variables can be ignored by the optimal controller (while it is clear that the optimal value function depends on block three). This structural result and our assumption that the relevant subsystem (blocks one and two) comprises few state variables, shows that the optimal policy is "sparse": it is determined by $\mathrm{poly}(s)$ parameters, although neither the system dynamics $A$ nor the optimal value function are sparse matrices. + +Relying on the characterization of the relevant state variables for optimal control we turn to the main contribution of our work. We derive two algorithms that incorporate ideas from high-dimensional statistics to efficiently estimate only the relevant parts of the system dynamics. In Table 1 on page 3, we summarize the main results of the paper and compare with guarantees for certainty-equivalent control. We study two settings that differ only in their assumptions on the distribution of the starting state $x_0$ . In the first setting (labeled "diagonal" in Table 1 on page 3), we assume that $x_0$ is sampled such that $\mathbb{E}[x_0] = 0$ and $\mathbb{E}[x_0x_0^\top]$ is a diagonal matrix. In this case, we show that our algorithm learns a near-optimal control with a nearly-dimension-free rate: the sample complexity scales polynomially with the sparsity $s$ and action dimension $d_u$ , but only logarithmically with the ambient dimension $d$ . + +The second setting generalizes the diagonal case to only require that $x_0$ has strictly positive definite (PD) covariance. Here our algorithm incurs a lower order polynomial dependence on the ambient dimension $d$ . In particular, for $d^2 \leq (s^2 + d_u s) / \epsilon$ this lower order term is dominated by the leading term, which yields the same sample complexity as in the diagonal case. In both settings, our bounds compare quite favorably to certainty-equivalent control, which incurs a $\mathrm{poly}(d) / \epsilon$ leading order dependence. For the second setting, our algorithmic approach relies on a reduction to a semi-parametric least squares estimation (Chernozhukov et al., 2016; 2018a; Foster and Syrgkanis, 2019). We provide a new result (see Proposition 9), which might be of independent interest, for the semi-parametric least squares estimation algorithm for the linear case. + +# 2. Preliminaries and Notation + +Linear-Quadratic Control. A linear-quadratic (LQ) control problem is specified by a tuple of matrices $L = (A, B, Q, R)$ . The state $x \in \mathbb{R}^d$ evolves according to $x_{t+1} = Ax_t + Bu_t + \xi_t$ where $u \in \mathbb{R}^{d_u}$ is the input to the system and $\xi_t$ is i.i.d. noise. The cost conditioning on the first observation to be $x_1$ is given by + +
Covariance MatrixEstimation AlgorithmSample Complexity
Positive DefiniteLeast-Squares\(\tilde{O}\left(\frac{poly(d,d_u)}{\epsilon}\right)\)
DiagonalSecond-Moment Product\(\tilde{O}\left(\frac{s^2+d_Us}{\epsilon}\right)\)
Positive DefiniteSemiparametric Least-Squares\(\tilde{O}\left(\frac{s^2+d_Us}{\epsilon}+\frac{\sqrt{(s^2+d_Us)d}}{\epsilon^{0.5}}\right)\)
+ +Table 1. Sample complexity results for learning a near-optimal controller in the PC-LQ setting. Our results, highlighted in gray, compare favorably with the classical least-squares/curtainity-equivalent control when the relevant subsystem has dimensionality $s \ll d$ . We assume the third, irrelevant, block of (2) is stable in $L_{\infty}$ norm (Assumption 1). In $\tilde{O}(\cdot)$ we only keep polynomial dependence in $\epsilon, d, s$ , and $d_u$ . See Appendix A for a thorough summary. + +$J(x_{1},\{u_{t}\}_{t\geq 1}) = \mathbb{E}\left[\sum_{t\geq 1}x_{t}^{\top}Qx_{t} + u_{t}Ru_{t}\mid x_{1}\right]$ and $J(\{u_t\}_{t\geq 1}) = \mathbb{E}\left[J(x_1,\{u_t\}_{t\geq 1})\right]$ . The cost matrices are assumed to be positive-semi definite, $Q\succ 0,R\succ 0$ . The task is to find the policy that minimizes $J\left(\{u_t\}_{t\geq 1}\right)$ . It is well-known that the optimal controller, the linear quadratic regulator (LQR), of such a system is linear in the state vector, $u_{t} = K_{\star}x_{t}$ , and the optimal value from any $x_{1}$ is given by $J_{\star}(x_1) = x_1^\top P_\star x_1$ , where $P_{\star}$ is the solution of the Riccati equation and $K_{\star} = (R + B^{T}P_{\star}B)^{-1}B^{\top}P_{\star}A$ . With some abuse of notation we let $J(K)$ be the expected cost when following taking actions according to $u = Kx$ + +In this work, we assume that $R = I_{d_u}$ , and write $L = (A,B,Q)$ for short. This can be obtained by rotating $u \to R^{-1/2}u$ , which is valid since $R \succ 0$ . We also assume the system is stabilizable, which means that there exists a matrix $K \in \mathbb{R}^{d_u \times d}$ such that $\rho(A + BK) < 1$ , where $\rho(X) = \max \{|\lambda_i(X)|\}_i$ is the spectral radius of $X$ and $\lambda_i(X)$ refers to the eigenvalues. Furthermore, we denote $A_{\max} = \max_{i,j \in [d]} |A(i,j)|$ and $B_{\max} = \max_{i \in [d], k \in [d_u]} |B(i,k)|$ . + +Notation. We denote by $K_{\star}(L)$ as the optimal policy of $L$ . We let $[n] = \{1,..,n\}$ . Given two ordered lists $\mathcal{I}_1$ and $\mathcal{I}_2$ we let $\mathcal{I}_2 / \mathcal{I}_1 = \{x\in \mathcal{I}_2|x\notin \mathcal{I}_1\}$ denote their difference. Furthermore, given a vector $x\in \mathbb{R}^d$ and a list $\mathcal{I}$ with entries in $[d]$ we let $x(\mathcal{I})$ denote the vector in $\mathbb{R}^{|\mathcal{I}|}$ which contains the coordinates of $\mathcal{I}$ , $x(\mathcal{I}) = [x(\mathcal{I}(1))\dots x(\mathcal{I}(|\mathcal{I}|))]$ . We denote $I_d$ as the identity matrix of dimension $d$ . The spectral $L_2$ norm of a matrix is denoted by $||A||_{\mathrm{op}}$ and the Frobenius norm by $||A||_F$ . We use $O(X)$ to refer to a quantity that depends on $X$ up to constants, and denote $a\vee b = \max (a,b)$ . For a square matrix $A\in \mathbb{R}^{d\times d}$ we denote $\mathrm{size}(A) = d$ . + +# 3. The Partially Controllable Linear-Quadratic Control Problem + +In this section we formally define the LQ problem we analyze and later derive sample complexity results. We focus on an LQ problem that consists of a partially controllable + +system and define an explicit notion of irrelevant state variables. Specifically, we establish that these state variables are irrelevant for optimally control this system, and, for that reason, we say the optimal controller of such a system is sparse. + +A linear system is said to be partially controllable if the controllability matrix $\mathcal{G} = \left[ \begin{array}{cccc}B & AB & \dots & A^d B \end{array} \right]$ is not of a full rank, that is $\mathrm{rank}(\mathcal{G}) = s_c < d$ (e.g., Sontag (2013)). For an LQ problem in such a system, there exists a linear transformation $T$ that transforms the system and cost function to obtain an equivalent LQ control problem $\tilde{L} = (\tilde{A},\tilde{B},\tilde{Q})$ with the block structure of (1). This representation reveals that the second block of coordinates $A_{2}^{\mathrm{PC}}$ cannot be affected by the controller inputs. As such, one might hope that $A_{12}^{\mathrm{PC}}$ and $A_{2}^{\mathrm{PC}}$ are not required for optimal control. Unfortunately, this is not the case, as we show in the next simple example. Even when $\mathrm{rank}(\mathcal{G}) = 1$ and $Q = I_d$ , the optimal policy may depend on the full dynamics of the uncontrollable subsystem (see Appendix C for detailed analysis). + +Example 2 (Necessity of uncontrollable dynamics for optimal control). Let $\rho \in \mathbb{R}^{d - 1}$ , $||\rho ||_{\infty} < 1$ + +$$ +A _ {\rho} = \left[ \begin{array}{c c c c c} 1 & 1 & 1 & \dots & 1 \\ 0 & \rho_ {1} & 0 & \dots & 0 \\ & & \vdots & & \vdots \\ 0 & 0 & \dots & 0 & \rho_ {d - 1} \end{array} \right], \quad B = \left[ \begin{array}{c} 1 \\ 0 \\ \vdots \\ 0 \end{array} \right], Q = I _ {d}, +$$ + +Let $L_{\rho} = (A_{\rho}, B, I_d)$ be a stabilizable LQ problem. Then, $K^{\star}(L_{\rho})$ is a function of $\rho$ . + +The example highlights that, without further structure, the optimal policy may depend on $\Omega(d)$ parameters of the transition dynamics $A$ even though only a small portion of the system is controllable. Intuitively, this occurs because the uncontrollable system interacts with the controllable one through matrix $A_{12}^{\mathrm{PC}}$ in (1), so the optimal controller must plan for and react to the uncontrollable state. + +On the other hand, there are many systems in which some uncontrollable state variables do not affect the controllable ones whatsoever. The following model captures this sce + +nario; we refer to this model as a Partially Controllable Linear Quadratic (PC-LQ) control problem. $^{1}$ + +$$ +A = \left[ \begin{array}{c c c} A _ {1} & A _ {1 2} & 0 \\ 0 & A _ {2} & 0 \\ 0 & A _ {3 2} & A _ {3} \end{array} \right], B = \left[ \begin{array}{c} B _ {1} \\ 0 \\ 0 \end{array} \right], Q = I _ {d}, \tag {3} +$$ + +where $A_{1} \in \mathbb{R}^{s_{c} \times s_{c}}, A_{2} \in \mathbb{R}^{s_{e} \times s_{e}}, A_{3}^{d - s \times d - s}, B_{1} \in \mathbb{R}^{s_{c} \times d_{u}}$ and $s = s_{e} + s_{c}$ . The linear system in a PC-LQ problem can be decomposed into three components: a controllable system, an uncontrollable relevant system, and an uncontrollable irrelevant system, where the latter has no interaction with the controllable system. These are the first, second, and third blocks on the diagonal, respectively. Furthermore, $A_{12}$ is a coupling that allows the uncontrollable relevant dynamics to affect the controllable ones, and $A_{32}$ is a coupling that allows the uncontrollable relevant system to affect the irrelevant one. Observe that any LQ control problem can be written in the form of (3), for some $s_{c}$ and $s_{e}$ , where, for a general stable system, with no uncontrollable irrelevant dynamics, $s_{c} + s_{e} = d$ . + +If the PC-LQ has $s < d$ , then there are variables that are essential for modeling the dynamics that are superfluous for optimal control. Indeed, as we show in the next result, the optimal policy of any PC-LQ problem does not depend on the entire transition dynamics, specifically, the optimal controller is insensitive to the dynamics of the uncontrollable irrelevant subsystem (blocks $A_{3}$ and $A_{32}$ ). On the other hand, this subsystem can exhibit a very complex temporal structure, so it is important for dynamics modeling/certainty equivalence. Thus, even though the dynamics matrix $A$ is not a low-dimensional object, when $s \ll d$ , it is thus apt to say that the optimal policy of a PC-LQ is low-dimensional. The following result explores two invariance properties of the optimal controller in a PC-LQ problem under cost and dynamics transformation (see Appendix D for the proof). + +Theorem 1 (Invariance of Optimal Policy for PC-LQ). Consider the following PC-LQ problems (as in equation (3)): + +1. Let $L_{1} = (A,B,I_{d}),L_{2} = (A,B,I_{1 + })$ be PC-LQ problems in stabilizable systems with similar dynamics. Let $I_{1 + }$ be a diagonal matrix such that (i) if $i\in [d]$ is a coordinate of the first block then $I_{1 + }(i,i) = 1$ , and, (ii) for any other $i\in [d]$ , $I_{1 + }(i,i)\in \{0,1\}$ . +2. Let $L_{1} = (A, B, I_{d})$ , $L_{2} = (\bar{A}, B, I_{d})$ be PC-LQ problems in stabilizable systems such that + +$$ +A = \left[ \begin{array}{c c c} A _ {1} & A _ {1 2} & 0 \\ 0 & A _ {2} & 0 \\ 0 & A _ {3 2} & A _ {3} \end{array} \right], \bar {A} = \left[ \begin{array}{c c c} A _ {1} & A _ {1 2} & 0 \\ 0 & A _ {2} & 0 \\ 0 & \bar {A} _ {3 2} & \bar {A} _ {3} \end{array} \right]. +$$ + +Then, for both (1) and (2), the optimal policy of $L_{1}$ and $L_{2}$ is equal, i.e., $K^{*}(L_{1}) = K^{*}(L_{2})$ . + +Of course, since $Q = I_{d}$ , the optimal value functions for $L_{1}$ and $L_{2}$ will – in general – be quite different. Since the uncontrollable blocks $A_{3}$ and $A_{32}$ of a PC-LQ are irrelevant to optimally control it, we refer to both of the block as the irrelevant blocks from this point onward. This highlights the fact that the LQR of a PC-LQ is sparse: it does not depend on the parameters of the irrelevant blocks. + +# 3.1. Characterization via controllability and the relevant disturbances matrices + +A natural question is to understand when a system is equivalent to a PC-LQ with an irrelevant subsystem. The next result provides a characterization of PC-LQ in terms of the controllability matrix and a new object that we call the relevant disturbances matrix. Recall that any LQ problem with controllability index $s_c$ can be rotated into the form (1). For brevity, denote $X_{12} = A_{12}^{\mathrm{PC}}$ and $X_2 = A_2^{\mathrm{PC}}$ . Let the relevant disturbances matrix using this representation be + +$$ +\mathcal {R D} = \left[ \begin{array}{c c c c} X _ {1 2} ^ {\top} & X _ {2} ^ {T} X _ {1 2} ^ {\top} & \dots & \left(X _ {2} ^ {T}\right) ^ {d - s _ {c}} X _ {1 2} ^ {\top} \end{array} \right]. \tag {4} +$$ + +Then, we have the following structural characterization of a PC-LQ through the controllability and relevant disturbances Krylov matrices (see Appendix E for the proof). + +Proposition 2 (Controllability characterization of PC-LQ). If $L$ has controllability index $s_c$ and $\text{rank}(\mathcal{RD}) = s_e$ then $L = (A, B, I_d)$ is rotationally equivalent to (3). + +# 3.2. Characterization via minimal invariant subspaces + +We next characterize a PC-LQ via the notion of minimal invariant subspaces. This characterization is more useful for our subsequent algorithmic development. Minimal invariant subspaces (w.r.t., an initial subspace) are formalized in the next definition. + +Definition 3 (Minimal invariant subspace w.r.t. another subspace, e.g., (Basile and Marro, 1992)). Let $K$ be a subspace and $A \in \mathbb{R}^{n \times n}$ . Subspace $V$ is an invariant subspace of $A$ w.r.t. $K$ if (i), $K \subseteq V$ , and (ii) $AV \subset V$ . $V$ is the minimal invariant subspace of $A$ w.r.t. $K$ if (i) and (ii) hold and $V$ is the subspace with the smallest dimension that satisfies both (i) and (ii). + +That is, the minimal invariant subspace of $A$ w.r.t. $K$ is the smallest subspace that contains $K$ and is closed/invariant under the action of $A$ , meaning that $Av \subset V$ for any $v \in V$ . In Appendix F we show that the minimal invariant subspace is always unique, and, thus, it is always well defined. + +The next result shows that the first and second blocks of a partially controllable system can be expressed in terms of two minimal invariant subspaces. This yields a simple + +# Algorithm 1 Learning Optimal Policy of PC-LQ + +1:Require: $\epsilon ,\delta >0$ +2: Define: $\mathrm{STh}_{\epsilon}(x) = \mathbb{I}\left\{|x| > \epsilon \right\} (x - \mathrm{sign}(x)\epsilon).$ +3: Get $\hat{A}$ and $\tilde{B}$ , an $(\epsilon, \delta)$ element-wise estimates of $A$ and $B$ , respectively. +4: Soft threshold the empirical estimates element-wise, $\bar{B} = \mathrm{Th}_{\epsilon}(\widehat{B}),\bar{A} = \mathrm{Th}_{\epsilon}(\widehat{A})$ +5: Return: Optimal policy of $\bar{L} = (\bar{A},\bar{B},I)$ + +algebraic characterization of the relevant components of the system, which we will use to develop algorithms (see Appendix E for the proof). + +Proposition 4 (PC-LQ and Minimal Invariant Subspaces). An $LQ$ problem is equivalent to PC-LQ (3) if and only if there exist projection matrices with $\mathrm{rank}(P_B)\leq \mathrm{rank}(P_c)\leq \mathrm{rank}(P_r)$ where + +1. $P_{c}$ is an invariant subspace of $A$ w.r.t. $P_B$ and $\operatorname{rank}(P_c) = s_c$ , +2. $P_r$ is an invariant subspace of $(I - P_c)A^\top$ w.r.t. $P_c$ and $\operatorname{rank}(P_r) = s_c + s_e = s$ , + +such that $A, B$ can be written as + +$$ +\begin{array}{l} A = P _ {c} A P _ {c} + P _ {r} A \left(P _ {r} - P _ {c}\right) + \left(I - P _ {r}\right) A \left(I - P _ {c}\right), \\ B = P _ {B} B. \\ \end{array} +$$ + +The subspaces $P_{c}$ and $P_{r}$ are the minimal invariant subspaces if and only if the controllability matrix is of rank $s_{c}$ and the relevant disturbances matrix is of rank $s_{e}$ . + +With the above notation, the subspace $P_{c}$ represents the first block of (3), and $P_{r}$ represents the first two blocks which are generally required for optimally control a PC-LQ. The matrix $(I - P_{r})A(I - P_{c})$ represents the irrelevant blocks of a PC-LQ which we can safely ignore by Theorem 1. + +# 4. Learning Sparse LQRs in Partially Controllable Systems + +We now turn to our main question and focus on the learnability of optimal policy in PC-LQ. We assume that the model is transformed to be in the form of (3), so it is axis-aligned up to permutations, i.e., the irrelevant state variables are not a-priori known to the algorithm designer. We further assume $\mathrm{size}(A_1) + \mathrm{size}(A_2) = s_e + s_c = s \ll d$ . Of course, as we have discussed, the dynamics matrix $A$ itself is not sparse, but the optimal policy of such system, the LQR, is sparse. Theorem 1 establishes the LQR depends only on $O(poly(s))$ parameters. Thus, we hope for sample complexity guarantees that scale primarily with the intrinsic dimension $s$ , rather than the ambient dimension $d$ . + +Remark 5 (Axis-aligned assumption). The axis-aligned assumption is a natural extension of the sparsity assumption made in sparse regression literature (e.g., (Wainwright, 2019), Chapter 7). In control problems, this assumption may be satisfied when the state variables $x$ arise from physical measurements. In this case, axis-alignment corresponds to negligible coupling between different state variables that represent measurements in different locations (as elaborated in Example 1). Furthermore, all the results generalize naturally when the rotation for which the LQ problem can be written as (3) is known. We comment that asymptotic dimension-free bounds for system identifications without the axis-aligned assumptions are impossible, due to the need to learn the rotation matrix. We leave it as an interesting future question to study whether asymptotic dimension-free bounds are possible for general PC-LQ problems. + +By Proposition 4 the optimal controller is insensitive to errors in $(I - P_r)A(I - P_c)$ , corresponding to block 3 of the dynamics matrix. However, to take advantage of this, we must first identify the zero pattern of the matrix $A$ . More formally, we seek estimates $(\bar{A},\bar{B})$ of the dynamics satisfying the following no false positive property: + +$$ +\forall i, j \in [ d ], k \in [ d _ {u} ]: A (i, j) = 0 \Rightarrow \bar {A} (i, j) = 0, \text {a n d} +$$ + +$$ +B (i, k) = 0 \Rightarrow \bar {B} (i, k) = 0. \tag {5} +$$ + +Indeed, in the presence of such a condition, we can ensure that there is no interaction between the relevant and irrelevant parts of the system in the estimated model, so that $(\bar{A},\bar{B})$ is a PC-LQ with a similar block structure to the true dynamics. + +A natural way to obtain estimates of $(A, B)$ that satisfy (5) is to perform soft-thresholding on an entrywise accurate initial estimate. Note that the soft-thresholding operation does not introduce much additional error. Since many options are available for obtaining the initial estimate, we formalize this via an oracle that we call the entrywise estimate. In Section 5, we instantiate this oracle with two different procedures and analyze their sample complexity. + +Definition 6 (Entrywise estimator). We say that $\widehat{X}$ is an $(\epsilon, \delta)$ entrywise estimator of a matrix $X \in \mathbb{R}^{d_1 \times d_2}$ if with probability at least $1 - \delta$ we have $\max_{i,j} |\widehat{X}(i,j) - X(i,j)| \leq \epsilon$ . + +Given access to such an oracle, Algorithm 1 learns an optimal policy in a PC-LQ problem. First, it estimates $(A,B)$ via the entrywise estimator, to obtain $(\hat{A},\hat{B})$ . Second, it applies a soft-thresholding to these estimates to get $\bar{A},\bar{B}$ . Finally, it returns the optimal policy of the LQ problem $\bar{L} = (\bar{A},\bar{B},I)$ . + +For the analysis, we require a technical assumption on the $L_{\infty}$ stability of the irrelevant subsystem $A_{3}$ . + +Assumption 1 ( $L_{\infty}$ -stability of irrelevant dynamics). $A_{3}$ is $L_{\infty}$ stable: $\max_i \sum_j |A_3(i,j)| = ||A_3||_{\infty} < 1$ . + +In addition, our guarantee scales with the operator norm of the optimal value function for the relevant subsystem only. Formally, let $L_{1:2} = (A_{1:2}, B_{1:2}, I_{1:2})$ be an $s$ -dimensional LQ problem defined by the first two blocks of (3) and let $P_{\star,1:2}$ be the solution to the Ricatti equation for this system. The guarantee is given as follows (see Appendix G for the proof). + +Theorem 7 (Learning the PC-LQ). Fix $\epsilon, \delta > 0$ . Assume access to an entrywise estimator of $(A, B)$ with parameters $(\sqrt{\epsilon / (2s(s + d_u))}, \delta)$ , and that Assumption 1 holds. Then, if $\epsilon < 1 / ||P_{\star,1:2}||_{\mathrm{op}}^{10}$ , with probability greater than $1 - \delta$ Algorithm 1 outputs a policy $\bar{K}$ such that + +$$ +J _ {\star} (\bar {K}) \leq J _ {\star} + O (| | P _ {\star , 1: 2} | | _ {\mathrm {o p}} ^ {8} \epsilon). +$$ + +To prove this result we utilize the machinery of Theorem 1, Proposition 4, the perturbation result of (Simchowitz and Foster, 2020), and the no-false positive property of the estimated model. + +# 5. Sample Complexity for Entrywise Estimation + +We now instantiate two entrywise estimators and establish their sample complexity guarantees in two settings. First, when the initial state $x_0$ has a diagonal covariance matrix, we show that a simple second-moment estimator suffices. In the more general setting where the initial state $x_0$ has PD covariance, we develop an estimator based on semiparametric least-squares. The first estimator has better sample complexity guarantees, while the second estimator is more general. + +# 5.1. Diagonal covariance matrix + +When the initial state $x_0$ has a diagonal covariance matrix, we analyze a simple second-moment estimator. Specifically we estimate the model with + +$$ +\widehat {A} = \frac {1}{N \sigma_ {0} ^ {2}} \sum_ {n} x _ {1, n} x _ {0, n} ^ {\top}, \quad \text {a n d} \quad \widehat {B} = \frac {1}{N} \sum_ {n} x _ {1, n} u _ {0, n} ^ {\top}, \tag {6} +$$ + +given $N$ partial trajectories $\{(x_{0,i},u_{0,i},x_{1,i})\}_{i = 1}^{N}$ where $u_{0,i}\sim \mathcal{N}(0,I_{d_u})$ . For this estimator we prove the following (see Appendix H.1 for a proof): + +Proposition 8 (Entrywise estimation with diagonal covariance). Assume that $x_0 \sim \mathcal{N}(0, \sigma_0 I_d)$ and that Assumption 1 holds. Denote $\sigma_{\mathrm{eff}} = 1 + A_{\max} \sqrt{s} + \left(1 + B_{\max} \sqrt{d_u}\right) \left(\frac{\log\left(\frac{d}{\delta}\right) \sigma_{\mathrm{eff}}^2}{\epsilon^2}\right)$ samples (6) is an entrywise estimator of $(A, B)$ with parameters $(\epsilon, \delta)$ . + +Combining with Theorem 7, we obtain the first shaded row of Table 1 on page 3. + +# 5.2. Positive definite covariance matrix + +For the second setting, we only assume that the covariance of $x_0$ is PD. This, more general setting, is of importance since the stationary measure of a policy may be quite complex, and, in particular, it may induce correlations between the irrelevant and relevant blocks (see Appendix B for further discussion on the need to handle general covariance matrices). In this case, the least-squares estimator of $A$ yields a guarantee in the Frobenius norm, which can be translated into an entrywise estimate. However, the sample complexity of this approach scales as $\mathrm{poly}(d) / \epsilon^2$ , which is too large for our purposes. Instead of using classical least-squares, our approach is based on a reduction to semiparametric least-squares (Chernozhukov et al., 2016; 2018b;a; Foster and Syrgkanis, 2019), which, as we will see, results in a sample complexity of $1 / \epsilon^2 + d / \epsilon$ for entrywise estimation. Observe that here the ambient dimension only appears in the lower order term. + +The main idea is as follows: Suppose we wish to learn the $(i,j)$ -th entry of $A$ and assume we have $(x_{1},x_{0})$ sample pairs from the model $x_{1} = Ax_{0} + \xi$ where $\xi$ is a zero-mean $\sigma$ sub-gaussian vector. Then, for any $i\in [d]$ + +$$ +x _ {1} (i) = A (i, j) x _ {0} (j) + \langle A (i, [ d ] / j), x _ {0} ([ d ] / j) \rangle + \xi_ {i}. \tag {7} +$$ + +If the first and second terms on the RHS were uncorrelated, then a linear regression of $x_{1}(i)$ onto $x_{0}(j)$ would yield an unbiased estimate of $A(i,j)$ . Unfortunately, these two terms are correlated under our assumptions, so least-squares may be biased. To remedy this, we attempt to decorrelate the two terms using a two-stage regression procedure. The first stage involves high dimensional regression problems, but these errors ultimately only appear in the lower order terms. + +Since our results for this problem may be of independent interest, we next study a generalization of the model in (7) and explain the estimator in detail. As a corollary, we obtain a sample complexity guarantee for the entrywise estimator for the PC-LQ. + +Semiparametric least-squares. As a generalization of (7), assume that $x \sim \mathcal{N}(0, \Sigma)$ where $\lambda_{\min}(\Sigma) > 0$ and $x \in \mathbb{R}^d$ and let + +$$ +y = \left\langle w _ {\star}, x _ {1} \right\rangle + \left\langle e _ {\star}, x _ {2} \right\rangle + \xi \tag {8} +$$ + +where $w_{\star},x_{1}\in \mathbb{R}^{d_{w}},e_{\star},x_{2}\in \mathbb{R}^{d_{e}},x = [x_{1},x_{2}]^{\top}$ and $\xi$ is $\sigma$ sub-Gaussian. Furthermore, $\Sigma = \mathbb{E}\left[x_2x_2^T\right]$ , and $\Sigma /\Sigma_{2}$ is the Schur complement. By observing tuples sampled from + +# Algorithm 2 Semiparametric Least Squares + +1: Require: Dataset $\mathcal{D} = \{(x_{1,n},x_{0,n})\}_{n = 1}^{2N}$ row and column indices $i,j\in [d]$ +2: Reduction to semiparametric LS: $\mathcal{D}_{SP} = \{(y_n,z_{1,n},z_{2,n})\}_{n = 1}^N$ where + +$$ +y _ {n} = x _ {1, n} (i), z _ {1, n} = x _ {0, n} (j), z _ {2, n} = x _ {0, n} ([ d ] / j). +$$ + +3: Estimate cross correlation $\widehat{L} = \left(\sum_{n=1}^{N} z_{1,n} z_{2,n}^{\top}\right) \left(\sum_{n=1}^{N} z_{2,n} z_{2,n}^{\top}\right)^{\dagger}$ . +4: Estimate conditional output $\widehat{c} = \left(\sum_{n=1}^{N} z_{2,n} z_{2,n}^{\top}\right)^{\dagger} \left(\sum_{n=1}^{N} y_n z_{2,n}\right)$ . +5: Set $\widehat{A}(i,j) = \left( \sum_{n=N+1}^{2N} (z_{1,n} - \widehat{L} z_{2,n}) (z_{1,n} - \widehat{L} z_{2,n})^\top \right)^\dagger \left( \sum_{n=N+1}^{2N} (y_n - \langle \widehat{c}, z_{2,n} \rangle) (z_{1,n} - \widehat{L} z_{2,n}) \right)$ . +6: Output: $\widehat{A}(i,j)$ + +this model $\{y_{n},x_{1,n},x_{2,n}\}_{n = 1}^{N}$ we wish to estimate only $w_{\star}$ . To do so, we first estimate $L_{\star}\in \mathbb{R}^{d_w\times d_w}$ and $c_{\star}\in \mathbb{R}^{d_e}$ , that relate $x_{2}$ to the conditional expectation $\mathbb{E}[x_1|x_2]$ and $\mathbb{E}[y|x_2]$ , with $N$ samples via standard least-squares. Due to the model Gaussian assumption, it holds that + +$$ +\mathbb {E} \left[ x _ {1} \mid x _ {2} \right] = L _ {\star} x _ {2}, \qquad \mathbb {E} \left[ y \mid x _ {2} \right] = c _ {\star} ^ {T} x _ {2}. +$$ + +When access to exact estimates of these quantities is given, we show in Appendix H.2.1, that the model (8) can be 'orthogonalized' and written as + +$$ +y = \left\langle w _ {\star}, x _ {1} - L _ {\star} x _ {2} \right\rangle + \left\langle c _ {\star}, x _ {2} \right\rangle , +$$ + +where $\mathbb{E}[(x_1 - L_\star x_2)x_2^\top ] = 0$ , so that the two terms on the right hand side are uncorrelated, unlike in the original model. Thus, given estimates $\widehat{L}_N,\widehat{c}_N$ , we regress $y - \langle \widehat{c}_N,x_2\rangle$ onto $(x_{1} - \widehat{L}_{N}x_{2})$ to get an estimate of $w_{\star}$ . See Algorithm 2 for a description of the algorithm. In the next result, we show that this estimator has leading order error scaling with $d_w$ and only a lower order error term scaling with $d_e$ . Furthermore, we get a minimal dependence in $\lambda_{\mathrm{min}}(\Sigma)$ with similar scaling as in usual OLS analysis (Hsu et al., 2012b) (see Appendix H.2.2 for proof). + +Proposition 9 (Semiparametric Least-Squares). Let $\delta \in (0, e^{-1})$ . Consider model (8) and assume that $\Sigma$ is PD. Denote $\sigma_c^2 = ||w_\star||_{\Sigma/\Sigma_2}^2 + \sigma^2$ . Then, if $N \geq O\left(\left(\sigma_c^2 / \lambda_{\min}(\Sigma)\right) \vee 1\right)$ , $dd_w \log \left(\frac{d}{\delta}\right)$ , with probability $1 - \delta$ , the semiparametric LS estimator $\hat{w}$ of $w_\star$ satisfies + +$$ +\begin{array}{l} \left| \left| w _ {\star} - \widehat {w} \right| \right| _ {2} \leq \\ O \left(\sqrt {\frac {\sigma^ {2} d _ {w} \log \left(\frac {1}{\delta}\right)}{N \lambda_ {\mathrm {m i n}} (\Sigma)}} + \frac {\left(\sigma_ {c} ^ {2} \vee \sigma_ {c}\right) d d _ {w} \log \left(\frac {d _ {w}}{\delta}\right)}{N \sqrt {\lambda_ {\mathrm {m i n}} (\Sigma)}}\right). \\ \end{array} +$$ + +Returning to the PC-LQ setting, we obtain an entrywise estimator for $A$ by applying the semiparametric LS approach on each pair $(i,j) \in [d]^2$ . To estimate $B$ , since we can sample $u_0$ with a diagonal covariance, we can apply the + +results for the diagonal covariance case. We summarize the sample complexity for entrywise estimation in the next corollary (see Appendix H.2 for proof). + +Corollary 10 (Element-wise Estimate, PD Covariance). Assume $x_0 \sim \mathcal{N}(0,\Sigma)$ and that $\lambda_{\min}(\Sigma) > 0$ . Denote $\sigma_c^2 = A_{\max}^2\lambda_{\max}(\Sigma) + \sigma^2$ . Then, if $N \geq O\left((\sigma_c^2 /\lambda_{\min}(\Sigma)\lor 1)d\log \left(\frac{d}{\delta}\right)\right)$ , and + +$N = O\left(\frac{\sigma^2\log\left(\frac{d}{\delta}\right)}{\epsilon^2\lambda_{\min}(\Sigma)} + \frac{d(\sigma_c^2\vee\sigma_c)\log\left(\frac{d}{\delta}\right)}{\epsilon\sqrt{\lambda_{\min}(\Sigma)}}\right),$ then the semiparametric LS yields an entrywise estimate of $A$ with parameters $(\epsilon, \delta)$ . + +Combining with Theorem 7, we obtain the second shaded row of Table 1 on page 3. + +# 6. Experiments + +We present a proof-of-concept empirical study, to demonstrate the end-to-end statistical advantages of leveraging sparsity in the LQR of a PC-LQ. We generate synthetic systems with marginally stable controllable blocks; the task is to learn a stabilizing controller $K$ (such that $\rho(A + BK) < 1$ ) from finite samples, in the presence of many irrelevant state coordinates (letting $d$ increase, while holding $s$ and $d_u$ constant). We compare Algorithm 1 with the certainty-equivalent controller obtained from the ordinary least-squares (OLS) estimator for the system's dynamics. + +Synthetic PC-LQ problems were generated with i.i.d. standard Gaussian entries (for all $A_{1}, A_{2}, A_{3}, A_{12}, A_{32}, B_{1}$ ); the diagonal blocks were normalized by their top singular values so that $\rho(A_{1}) = 1$ , and $\rho(A_{2}) = \rho(A_{3}) = 0.9$ . We computed $\bar{A}$ from the minimum-norm $N$ -sample OLS estimator, as well as the soft-thresholded semiparametric least-squares estimator from Algorithm 1 (with $\epsilon = 0.1$ ) and obtained certainty-equivalent controllers $\bar{K}$ by solving the Riccati equation with $\bar{L} \coloneqq (\bar{A}, B)$ . Over 100 trials in each setting, we recorded the fraction of times $\bar{K}$ stabilized the system $(\rho(A + B\bar{K}) < 1$ , and $J(\bar{K}) \leq 1.1 \cdot J(K^{*}))$ . + +![](images/eac2f35cafb13754e3eea4ff58b85e8ec9ee378cc8c002a04cbfae22d0eacb27.jpg) +Figure 1. Empirical comparison of Algorithm 1 with OLS for stabilizing a marginally stable PC-LQ. As the number of irrelevant features increases, the sample complexity of the sparsity-leveraging estimator grows much more slowly. Success frequencies (with standard deviations from the normal approximation) are measured over 100 trials. +Figure 1 summarizes our findings: keeping the relevant dimensions fixed ( $s_c = s_e = 5$ , $d_u = 1$ ) and allowing $d$ to grow, the sample complexity of stabilizing the system exhibits a far milder dependence on the ambient dimension $d$ when using our estimator. A complete description of the experimental protocol is given in Appendix J. + +# 7. Related Work + +Partial controllability in control theory. The notion of controllability and partial controllability has been well studied from many different aspects in both classical and modern control theory (Kalman, 1963; Lin, 1974; Glover and Silverman, 1976; Jurdjevic and Quinn, 1978; Zhou et al., 1996; Bashirov et al., 2007; Sontag, 2013), as well as, the relation between controllability and invariant subspaces (Klamka, 1963; Basile and Marro, 1992). In Section 3, we characterize which parts of a PC-LQ are not needed for optimal control. To the best of our knowledge, such characterization does not exist in previous literature. One may interpret the results of Section 3 as an extension of Kalman's canonical decomposition. That is, we further decompose the uncontrollable and observable system (see Kalman (1963), Page 165) into relevant and irrelevant parts for optimal control. + +Structural results in LQ. Recently, there has been a surge of interest in the learnability of LQ (Abbasi-Yadkori and Szepesvári, 2011; Dean et al., 2019; Sarkar and Rakhlin, 2019; Cohen et al., 2019; Mania et al., 2019; Simchowitz and Foster, 2020; Cassel et al., 2020; Tsiamis and Pappas, 2021). However, learning in the presence of structural properties of an LQ has been, to large extent, unexplored. Closely related to our work is the problem studied in (Fattahi and Sojoudi, 2018; Fattahi et al., 2019). There, the authors considered an LQ problem in which the dynamics itself has a sparse structure. Specifically, the dynamics was assumed to have some sparse block structure such that all elements in each block are simultaneously zero or non-zero. We do not put any such restriction on a PC-LQ. Moreover, in our case, the transition matrix $A$ need not be a sparse matrix, and may have $\Omega(d^2)$ non-zero elements. The sparsity + +utilized in our work is sparsity of the optimal controller and not of the dynamics itself. We also comment that in (Fattahi and Sojoudi, 2018; Fattahi et al., 2019) additional assumptions were made, which are not satisfied in our setting. First, the authors assume a mutual-incoherence condition on the covariance matrix. Additionally, it is assumed that $A(i,j), B(i,j) \geq \gamma > 0$ , i.e., that there is a minimal value for the entries of the dynamics. These assumptions are crucial for identification of the non-zero entries; assumptions we do not make in this work (see Appendix B for further discussion on the structure of the covariance matrix in our setting). That is, we recover a near optimal policy without the need to recover the true block structure. + +Another related work is the work of (Wang and Yang, 2020), where the authors assumed the dynamics is of low rank and fully controllable. We do not make such an assumption and allow for uncontrollable part to affect the controllable part. Lastly, in (Sun et al., 2020), the authors analyzed system identification via low-rank Hankel matrix estimation. Observe that Hankel based techniques only enable the recovery of the controllable parts of the system, as they are based on a function of $A^n B$ . However, to optimally control a stable system, knowledge of the relevant uncontrollable process is also needed (see Example 2). + +# 8. Summary and Future Work + +In this work, we studied structural and learnability aspects of the PC-LQ. We characterized an invariance property of the LQR of a PC-LQ. This revealed that the optimal controller of such systems is, in fact, a low-dimensional object. Then, given an entrywise estimator, we showed that the sample complexity of learning an axis-aligned PC-LQ has only a mild dependence on the ambient dimension, scaling primarily with the dimensionality/sparsity of the optimal controller. + +The results presented in this work opens several interesting future research avenues. First, we believe it would be interesting to study additional invariance properties of optimal policies of other control and RL problems. As stressed in this work, invariances of the optimal controller can yield statistical improvements for learning in such models. More broadly, is there a general way to characterize such invariances? Second, in this work, we assumed the PC-LQ model is sparse, or, axis-aligned. A natural question would be to study the learnability of such a model when the system is not axis-aligned, and understand the nature of possible sample complexity improvements in such systems? Lastly, extending our results to a single trajectory setting is of interest, and may require developing new tools for semiparametric least-squares analysis. + +# References + +Abbasi-Yadkori, Y. and Szepesvári, C. (2011). Regret bounds for the adaptive control of linear quadratic systems. In Proceedings of the 24th Annual Conference on Learning Theory. JMLR Workshop and Conference Proceedings. +Agarwal, A., Kakade, S., Krishnamurthy, A., and Sun, W. (2020). Flambe: Structural complexity and representation learning of low rank mdps. Advances in Neural Information Processing Systems. +Bashirov, A. E., Mahmudov, N., Šemí, N., and Etikan, H. (2007). Partial controllability concepts. International Journal of Control. +Basile, G. and Marro, G. (1992). Controlled and conditioned invariants in linear system theory. Prentice Hall Englewood Cliffs, NJ. +Cassel, A., Cohen, A., and Koren, T. (2020). Logarithmic regret for learning linear quadratic regulators efficiently. In International Conference on Machine Learning, pages 1328-1337. PMLR. +Chernozhukov, V., Chetverikov, D., Demirer, M., Duflo, E., Hansen, C., Newey, W., and Robins, J. (2018a). Double/debiased machine learning for treatment and structural parameters. +Chernozhukov, V., Escanciano, J. C., Ichimura, H., Newey, W. K., and Robins, J. M. (2016). Locally robust semiparametric estimation. arXiv preprint arXiv:1608.00033. +Chernozhukov, V., Nekipelov, D. N., Semenova, V., and Syrgkanis, V. (2018b). Plug-in regularized estimation of high-dimensional parameters in nonlinear semiparametric models. Technical report, cemmap working paper. +Cohen, A., Koren, T., and Mansour, Y. (2019). Learning linear-quadratic regulators efficiently with only $\sqrt{T}$ regret. In International Conference on Machine Learning. PMLR. +Dean, S., Mania, H., Matni, N., Recht, B., and Tu, S. (2019). On the sample complexity of the linear quadratic regulator. Foundations of Computational Mathematics. +Deisenroth, M. and Rasmussen, C. E. (2011). *Pilco: A model-based and data-efficient approach to policy search.* In Proceedings of the 28th International Conference on machine learning (ICML-11). CiteSeer. +Fattahi, S., Matni, N., and Sojoudi, S. (2019). Learning sparse dynamical systems from a single sample trajectory. In 2019 IEEE 58th Conference on Decision and Control (CDC). IEEE. + +Fattahi, S. and Sojoudi, S. (2018). Sample complexity of sparse system identification problem. arXiv preprint arXiv:1803.07753. +Foster, D. J. and Syrgkanis, V. (2019). Orthogonal statistical learning. arXiv preprint arXiv:1901.09036. +Glover, K. and Silverman, L. (1976). Characterization of structural controllability. IEEE Transactions on Automatic control. +Hao, B., Lattimore, T., Szepesvári, C., and Wang, M. (2021). Online sparse reinforcement learning. In International Conference on Artificial Intelligence and Statistics. PMLR. +Hsu, D., Kakade, S., Zhang, T., et al. (2012a). A tail inequality for quadratic forms of subgaussian random vectors. Electronic Communications in Probability. +Hsu, D., Kakade, S. M., and Zhang, T. (2012b). Random design analysis of ridge regression. In *Conference on learning theory*. JMLR Workshop and Conference Proceedings. +Jurdjevic, V. and Quinn, J. P. (1978). Controllability and stability. Journal of differential equations. +Kakade, S., Krishnamurthy, A., Lowrey, K., Ohnishi, M., and Sun, W. (2020). Information theoretic regret bounds for online nonlinear control. arXiv preprint arXiv:2006.12466. +Kalman, R. E. (1963). Mathematical description of linear dynamical systems. Journal of the Society for Industrial and Applied Mathematics, Series A: Control. +Klamka, J. (1963). Controllability of linear dynamical systems. Contrib. Theory Differ. Equ, pages 189-213. +Lancaster, P. and Rodman, L. (1995). Algebraic Riccati equations. Clarendon press. +Lin, C.-T. (1974). Structural controllability. IEEE Transactions on Automatic Control. +Mania, H., Jordan, M. I., and Recht, B. (2020). Active learning for nonlinear system identification with guarantees. arXiv preprint arXiv:2006.10277. +Mania, H., Tu, S., and Recht, B. (2019). Certainty equivalence is efficient for linear quadratic control. In Proceedings of the 33rd International Conference on Neural Information Processing Systems. +Perdomo, J. C., Simchowitz, M., Agarwal, A., and Bartlett, P. (2021). Towards a dimension-free understanding of adaptive linear control. arXiv preprint arXiv:2103.10620. + +Sarkar, T. and Rakhlin, A. (2019). Near optimal finite time identification of arbitrary linear dynamical systems. In International Conference on Machine Learning. PMLR. +Simchowitz, M. and Foster, D. (2020). Naive exploration is optimal for online lqr. In International Conference on Machine Learning. PMLR. +Smith, R. L. (1992). Some interlacing properties of the schur complement of a hermitian matrix. Linear algebra and its applications. +Sontag, E. D. (2013). Mathematical control theory: deterministic finite dimensional systems. Springer Science & Business Media. +Stanfel, P., Johnson, K., Bay, C. J., and King, J. (2020). A distributed reinforcement learning yaw control approach for wind farm energy capture maximization. In 2020 American Control Conference (ACC). IEEE. +Sun, Y., Oymak, S., and Fazel, M. (2020). Finite sample system identification: improved rates and the role of regularization. +Tropp, J. A. (2012). User-friendly tail bounds for sums of random matrices. Foundations of computational mathematics. +Tsiamis, A. and Pappas, G. J. (2021). Linear systems can be hard to learn. arXiv preprint arXiv:2104.01120. +Vershynin, R. (2010). Introduction to the non-asymptotic analysis of random matrices. arXiv preprint arXiv:1011.3027. +Wainwright, M. J. (2019). High-dimensional statistics: A non-asymptotic viewpoint. Cambridge University Press. +Wang, T. and Yang, L. F. (2020). Episodic linear quadratic regulators with low-rank transitions. arXiv preprint arXiv:2011.01568. +Zhou, K., Doyle, J. C., Glover, K., et al. (1996). Robust and optimal control, volume 40. \ No newline at end of file diff --git a/sparsityinpartiallycontrollablelinearsystems/images.zip b/sparsityinpartiallycontrollablelinearsystems/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..139d3e243714e6f582f40c7436d6a2d216148895 --- /dev/null +++ b/sparsityinpartiallycontrollablelinearsystems/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:142d8fe4b540e88c48414b782d6ae31ea422bb840956cc8149df40267d7fd0d1 +size 156369 diff --git a/sparsityinpartiallycontrollablelinearsystems/layout.json b/sparsityinpartiallycontrollablelinearsystems/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..0244fd40056cf347795645bbdca7a83bf9422d61 --- /dev/null +++ b/sparsityinpartiallycontrollablelinearsystems/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2ec0a0cb1166e14bd520ee2fa3df913562378e6ca977124bb7bf550adb38c837 +size 563348 diff --git a/spatialchanneltokendistillationforvisionmlps/11d1749c-3393-46ea-8abe-2bdf49b78ff3_content_list.json b/spatialchanneltokendistillationforvisionmlps/11d1749c-3393-46ea-8abe-2bdf49b78ff3_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..c5881d9d381fd76acce6245bf2a46fbd4b1f952a --- /dev/null +++ b/spatialchanneltokendistillationforvisionmlps/11d1749c-3393-46ea-8abe-2bdf49b78ff3_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a48597e09267b20858c4a71ee2f935623c63fd93ecf7a4791d373f37a3b291db +size 77581 diff --git a/spatialchanneltokendistillationforvisionmlps/11d1749c-3393-46ea-8abe-2bdf49b78ff3_model.json b/spatialchanneltokendistillationforvisionmlps/11d1749c-3393-46ea-8abe-2bdf49b78ff3_model.json new file mode 100644 index 0000000000000000000000000000000000000000..2ada871a2e1e38763bb35f62fcd24fa4a8219c05 --- /dev/null +++ b/spatialchanneltokendistillationforvisionmlps/11d1749c-3393-46ea-8abe-2bdf49b78ff3_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:66b3dd74f2b0226a357476346bddca36c667d859a7b7ebe219e84a53e1e1b177 +size 94253 diff --git a/spatialchanneltokendistillationforvisionmlps/11d1749c-3393-46ea-8abe-2bdf49b78ff3_origin.pdf b/spatialchanneltokendistillationforvisionmlps/11d1749c-3393-46ea-8abe-2bdf49b78ff3_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..7ed69054c85355971d358106f24d057595178ac0 --- /dev/null +++ b/spatialchanneltokendistillationforvisionmlps/11d1749c-3393-46ea-8abe-2bdf49b78ff3_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:42042e11a052001aab8b7ce8d273760bdf2ae3138a554842455be4e801c21714 +size 437936 diff --git a/spatialchanneltokendistillationforvisionmlps/full.md b/spatialchanneltokendistillationforvisionmlps/full.md new file mode 100644 index 0000000000000000000000000000000000000000..24558e607a870f7888f1e79b31a52af47d0a347a --- /dev/null +++ b/spatialchanneltokendistillationforvisionmlps/full.md @@ -0,0 +1,318 @@ +Yanxi Li 12 Xinghao Chen 2 Minjing Dong 12 Yehui Tang 23 Yunhe Wang 2 Chang Xu 1 + +# Abstract + +Recently, neural architectures with all Multi-layer Perceptrons (MLPs) have attracted great research interest from the computer vision community. However, the inefficient mixing of spatial-channel information causes MLP-like Vision Models to demand tremendous pre-training on large-scale datasets. This work solves the problem from a novel knowledge distillation perspective. We propose a novel Spatial-channel Token Distillation (STD) method, which improves the information mixing in the two dimensions by introducing distillation tokens to each of them. A mutual information regularization is further introduced to let distillation tokens focus on their specific dimensions and maximize the performance gain. Extensive experiments on ImageNet for several MLP-like architectures demonstrate that the proposed token distillation mechanism can efficiently improve the accuracy. For example, the proposed STD boosts the top-1 accuracy of Mixer-S16 on ImageNet from $73.8\%$ to $75.7\%$ without any costly pre-training on JFT-300M. When applied to stronger architectures, e.g. CycleMLP-B1 and CycleMLP-B2, STD can still harvest about $1.1\%$ and $0.5\%$ accuracy gains, respectively. + +# 1. Introduction + +In the past few decades, convolutional neural networks (CNNs; LeCun et al., 1989; Krizhevsky et al., 2012; He et al., 2016) have in fact dominated computer vision (CV) tasks. However, the recent advances of Transformers (Vaswani et al., 2017; Devlin et al., 2018; Brown et al., 2020) in natural language processing (NLP) also impact CV researchers to design pixel-level Transformers for vision tasks (Parmar + +$^{1}$ School of Computer Science, University of Sydney, Australia $^{2}$ Huawei Noah's Ark Lab $^{3}$ School of Artificial Intelligence, Peking University. Correspondence to: Yunhe Wang , Chang Xu . + +Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s). + +![](images/ac3451989e4fd3e3397976f0c07f9d977b17f8fd778ae825a5ab3edcd239c7eb.jpg) +Figure 1. Top-1 accuracy and FLOPs on ImageNet-1K of MLP-like Vision Models distilled by STD (solid lines) compared to state-of-the-art results (dotted lines). + +et al., 2018; Hu et al., 2019; Ramachandran et al., 2019; Zhao et al., 2020) and finally lead to patch-based Vision Transformer (ViT; Dosovitskiy et al., 2021). ViT splits an image into small patches and feeds them into several stacked transformer blocks to obtain the final image classification results. ViT and its variants have shown impressive performance on ImageNet (Russakovsky et al., 2015) classification as well as downstream tasks like object detection and segmentation. + +Following this line, MLP-Mixer (Tolstikhin et al., 2021) reconsiders the possibility of using pure multi-layer perceptrons (MLPs) for vision tasks and builds the pure MLP architecture by applying MLPs to both the spatial and channel dimensions of image patches, which are known as token mixing and channel mixing, respectively. Despite the simplicity of its architecture, MLP-Mixer is hard to obtain superior performance without costly pre-training on large-scale datasets, such as ImageNet-21K and JFT-300M (Hinton et al., 2015). For example, Mixer-S16 only obtains a $72.9\%$ top-1 accuracy when trained on ImageNet-1k, which is still slightly lower than that of current state-of-the-art architectures. Therefore, there are many attempts to design novel mixing methods (Hou et al., 2021; Touvron et al., 2021a; Chen et al., 2021; Guo et al., 2022). However, they could + +introduce additional complexity to the models. For example, Hou et al. (2021) permutes 3D matrices along different axes and then flattens them into 2D; and Chen et al. (2021) uses a stair-like operation implemented by deformable convolution, which is much more complex than pure MLPs. Moreover, the mixing of spatial and channel information has not been fully exploited, preventing current MLP-like Vision Models from achieving higher performance. + +In this work, we propose to improve the spatial and channel mixing from a novel knowledge distillation (KD) perspective. To be specific, we design a special KD mechanism for MLP-like Vision Models called Spatial-channel Token Distillation (STD), which improves the information mixing in both the spatial and channel dimensions of MLP blocks. Instead of modifying the mixing operations themselves, STD adds spatial and channel tokens to image patches. After forward propagation, the tokens are concatenated for distillation with the teachers' responses as targets. Each token works as an aggregator of its dimension. The objective of them is to encourage each mixing operation to extract maximal task-related information from their specific dimension. Besides, this manner also allows STD to be very flexible and to be applied to different KD settings. It supports not only single-teacher distillation and distillation of the last layer but also multi-teacher distillation and distillation of intermediate layers. A remaining obstacle is that the spatial information and channel information are highly entangled with each other in the image patches, which is contrary to the goal of our distillation. To force the tokens to focus on their specific dimensions, we further introduce a mutual information (MI) regularization. + +We perform extensive experiments for various MLP-like architectures to demonstrate that STD can efficiently distill MLP-Mixers and reach better performances than the costly pre-training. For example, Mixer-S16 with STD obtains $75.7\%$ top-1 accuracy on ImageNet-1K compared to $72.9\%$ by training from scratch and $73.8\%$ by pre-training on JFT-300M. Besides, Mixer-B16 with STD can reach $80.0\%$ top-1 accuracy, which is very close to the performance of ResMLP-B24 and CycleMLP-B2. When applied to stronger architectures, e.g. CycleMLP-B1 and CycleMLP-B2, STD can still harvest about $1.1\%$ and $0.5\%$ accuracy gains, respectively. Figure 1 further compares top-1 accuracy and FLOPs on ImageNet-1K of MLP-like Vision Models distilled by STD with state-of-the-art results. Our method reaches superior results with marginal FLOPs raising. + +# 2. Related Work + +# 2.1. Transformer-based Vision Models. + +Transformers are a family of models utilizing multi-head self-attention (MSA; Vaswani et al., 2017), which are ini + +tially designed for NLP tasks. Transformer (Vaswani et al., 2017) first introduce MSA. BERT (Devlin et al., 2018) introduces a classification token, and pre-training. The GPT series of works (Radford et al., 2018; 2019; Brown et al., 2020) highly focus on pre-training tasks. + +Inspired by those language models, there are several early successes to explore Transformer-based architectures for CV tasks. Image Transformer (Parmar et al., 2018) applies Transformer for a sequence modeling formulation of image generation tasks. Hu et al. (2019) and Zhao et al. (2020) use local multi-head dot-product self-attention blocks for image classification. Ramachandran et al. (2019) further expands self-attention for both classification and object detection. + +Recently, ViT (Dosovitskiy et al., 2021) demonstrates that applying a pure Transformer to sequences of image patches can reach state-of-the-art performance on ImageNet without any convolution. However, ViT demands costly pretraining on large-scale datasets, such as ImageNet-21K and JFT-300M. To avoid the pre-training, DeiT (Touvron et al., 2021b) replaces it with distillation. A distillation token inspired by the classification token in BERT (Devlin et al., 2018) is introduced to improve its performance. + +# 2.2. MLP-like Vision Models. + +The success of using image patches as inputs for Transformers has encouraged researchers to rethink and revive MLPs as vision models. MLP-Mixer (Tolstikhin et al., 2021) applies pure MLPs to both the spatial and channel dimensions of image patches, which are referred as token mixing and channel mixing, respectively. However, those mixing operations are inefficient. Just like its ancestor, ViT (Dosovitskiy et al., 2021), MLP-Mixer also demands costly pre-training on those large-scale datasets. + +There are several attempts to improve the efficiency of MLP-like vision models from an architecture view. ViP (Hou et al., 2021) uses various permutation of patches in parallel to improve the mixing. ResMLP (Touvron et al., 2021a) designs a residual MLP layer. CycleMLP (Chen et al., 2021) introduces a Cycle Fully-Connected layer to enlarge the receptive field. Hire-MLP (Guo et al., 2022) proposes a hierarchical rearrangement mechanism to aggregate the local and global spatial information. Wave-MLP (Tang et al., 2022) propose to represent each token as a wave function consisting of an amplitude part and a phase part for dynamical aggregation. + +# 2.3. Knowledge Distillation. + +KD is initially inspired by model compression (Bucilua et al., 2006) and introduced by Hinton et al. (2015) to transfer knowledge from a large ensemble of models into a single small model. The main idea is to let the small student network mimic the behavior of its large teachers. There are + +![](images/dbf41573e3cf5150b7f9a784439c1c60938ffc8fc00af3e024a31524f700f0ff.jpg) +Figure 2. The overall pipeline of STD. + +several explanations of why KD works. Yuan et al. (2019) explains it from a label smoothing perspective. Wei et al. (2020) argues KD is equivalent to a data augmentation. + +As for multi-teacher distillation, Hinton et al. (2015) simply uses an averaged response from all teachers. In this way, every teacher has the same importance. You et al. (2017) not only uses the responses, but also consider features from the intermediate layers. Chen et al. (2019) uses different teachers for different purposes. They use one teacher for response-based distillation and one teacher for feature-based distillation. Guo et al. (2019) designs distillation objectives regarding prediction scores and gradients of examples to enhance the robustness of student networks. Chen et al. (2020) introduces a locality preserving loss to encourage student networks to generate low-dimensional features inheriting intrinsic properties from corresponding high-dimensional teacher's features. Park & Kwak (2020) and Asif et al. (2019) add additional teacher branches to the student network to mimic the intermediate features of teachers. + +# 3. Methodology + +The proposed STD includes two major components, the spatial-channel tokens and a mutual information regularization on those tokens. We first introduce how the spatial-channel tokens are combined with MLP-like vision models and how they participate in the distillation. Then, we describe a method estimating the mutual information between the spatial and channel tokens, which is to regularize them to focus on their specific dimensions. Finally, the overall pipeline of STD is described, including multi-teacher token distillation, the token distillation of both the intermediate layer and last layer, and the overall distillation objective. The overall pipeline of STD is illustrated in Figure 2. + +# 3.1. Spatial-channel Token Distillation + +MLP-like vision models typically split an image into small patches and mix features along two dimensions: 1) the + +spatial MLP layers mix feature across different spatial locations and share weights among channels, and 2) the channel MLP layers mix features across channels at a given spatial location and share weights among locations. Given the feature $Z^{(l-1)} \in \mathbb{R}^{P \times N}$ of $P$ patches with $N$ channels, a MLP-like block can be represented by + +$$ +\boldsymbol {U} ^ {(l)} = \operatorname {M L P} _ {S} ^ {(l)} \left(\operatorname {L N} \left(\boldsymbol {Z} ^ {(l - 1)}\right)\right) + \boldsymbol {Z} ^ {(l - 1)}, \tag {1} +$$ + +$$ +\boldsymbol {Z} ^ {(l)} = \operatorname {M L P} _ {C} ^ {(l)} \left(\operatorname {L N} \left(\boldsymbol {U} ^ {(l)}\right)\right) + \boldsymbol {U} ^ {(l)}, \tag {2} +$$ + +where $l = 1,\dots ,L$ are $L$ blocks, $\mathrm{LN}(\cdot)$ is the layer normalization, and $\mathrm{MLP}_S^{(l)}$ and $\mathrm{MLP}_C^{(l)}$ are the spatial and channel MLP layers in block $l$ , respectively. Note, $\mathrm{MLP}_S^{(l)}$ and $\mathrm{MLP}_C^{(l)}$ are flexible and are not limited to be the token-mixing and channel-mixing MLPs in MLP-Mixer, but can also be other complex MLP layers. + +The spatial-channel mixing is a common paradigm widely existing in various MLP-like vision models (Tolstikhin et al., 2021; Hou et al., 2021; Touvron et al., 2021a; Chen et al., 2021; Guo et al., 2022). Based on this fundamental characteristic, we design the spatial-channel tokens for distillation of MLP-like vision models. In a previous work of Transformer-based vision models, DeiT (Touvron et al., 2021b) introduces a distillation token by adding an extra patch after all the image patches. It separates the distillation objective from the classification objective and improves the network performance, but it has limitation to be applied to MLP-like vision models. + +MLP-like vision models uses spatial and channel MLP layers instead of self-attention. If we add a new patch $T_{S} \in \mathbb{R}^{1 \times N}$ as a spatial token, it interacts with other patches in the spatial MLP layers: + +$$ +\operatorname {M L P} _ {S} ^ {(l)} \left(\boldsymbol {x} ^ {\prime}\right) _ {*, j} = \boldsymbol {W} _ {2} \sigma \left(\boldsymbol {W} _ {1} \boldsymbol {x} _ {*, j} ^ {\prime}\right), \tag {3} +$$ + +where $\sigma$ is an non-linear activation function, $\pmb{x}^{\prime}\in \mathbb{R}^{P + 1\times N}$ $j = 1,\dots ,N$ and $\pmb{x}_{P + 1,*} = T_S$ . Equation (3) only allows $T_{S}$ to capture cross-location features per channel, but cross-channel features per location are ignored. To capture the + +cross-channel features, we propose a new channel token $T_{C} \in \mathbb{R}^{P \times 1}$ . It interacts with other channels in the channel MLP layers: + +$$ +\operatorname {M L P} _ {C} ^ {(l)} \left(\boldsymbol {x} ^ {\prime \prime}\right) _ {i, *} = \boldsymbol {W} _ {4} \sigma \left(\boldsymbol {W} _ {3} \boldsymbol {x} _ {i, *} ^ {\prime \prime}\right), \tag {4} +$$ + +where $\pmb{x}^{\prime \prime}\in \mathbb{R}^{P\times N + 1},i = 1,\dots ,P$ and $\pmb{x}_{*,N + 1}^{\prime \prime} = T_{C}$ Using both Equations (3) and (4) allows us to capture per-channel and per-location features at the same time. + +As aforementioned, the classification and distillation objective are independent. Therefore, we design the spatial-channel tokens as information aggregator and do not want them copy information back to the features. This target can be achieved by slightly modifying weights in Equations (3) and (4). Let $\mathbf{W}_1 \in \mathbb{R}^{d_S \times P + 1}$ $\mathbf{W}_2 \in \mathbb{R}^{1 \times d_S}$ $\mathbf{W}_3 \in \mathbb{R}^{d_C \times N + 1}$ $\mathbf{W}_4 \in \mathbb{R}^{1 \times d_C}$ , where $d_S$ and $d_C$ is the hidden dimension of MLP layers. We can add $K$ MLP blocks for distillation in parallel with Equations (1) and (2): + +$$ +T _ {S} ^ {(k)} = \operatorname {M L P} _ {S} ^ {(k)} \left(\ln \left(\left[ \boldsymbol {Z} ^ {(l)} \right| \left| T _ {S} ^ {(k - 1)} \right]\right)\right) + T _ {S} ^ {(k - 1)} \tag {5} +$$ + +$$ +T _ {C} ^ {(k)} = \operatorname {M L P} _ {C} ^ {(k)} \left( \right.\operatorname {L N} \left( \right.\left[ \right. \boldsymbol {Z} ^ {(l)} \left. \right\| T _ {C} ^ {(k - 1)} \left. \right]\left. \right)\left. \right) + T _ {C} ^ {(k - 1)} \tag {6} +$$ + +where $Z^{(l)}$ is the output of a MLP layer $l$ from the original network, and $[\cdot ||\cdot ]$ represents concatenation. Finally, the spatial and channel tokens are concatenated as the final output $[T_S^{(K)}||T_C^{(K)}]$ for distillation. The right part of Figure 2 demonstrates how the spatial-channel token works. + +There are several differences between our token distillation for MLPs and the existing token distillation methods for Transformers, e.g. DeiT (Touvron et al., 2021b). First of all, Transformers use self-attention and do not consider spatial and channel differently. Therefore, DeiT uses only spatial tokens for distillation. However, MLP-like vision models utilize independent operations for spatial and channel mixing, so we add tokens to both dimensions. Secondly, the objective of using spatial-channel tokens is to improve the two kinds of mixing operations. To reach this goal, we further design a mutual information regularization to disentangle the spatial and channel information, which encourages the spatial and channel tokens to extract more informative features. Finally, DeiT updates the image patches, classification token, and distillation token together. We update the patches and distillation tokens separately. The distillation tokens aggregate information from patches, but do not copy the information back to them. Patches are passed to tokens by residual connections and won't be updated. This characteristic allows us to insert tokens flexibly and makes multi-teacher distillation and distillation of intermediate layers possible. + +# 3.2. Mutual Information Regularization + +Although the spatial and channel tokens are separate, they can share joint information from the features. To make them + +focus on their own dimension, we design a MI regularization term to disentangle the spatial and channel information. The MI is a measure of dependence between random variables based on the Shannon entropy. It is equivalent to the Kullback-Leibler (KL-) divergence between the joint distribution and the product of the marginal distribution of the random variables. Given two random variables $X$ and $Y$ , the MI can be calculated by + +$$ +I (X; Y) := D _ {K L} \left(\mathbb {P} _ {X Y} | | \mathbb {P} _ {X} \otimes \mathbb {P} _ {Y}\right), \tag {7} +$$ + +where $D_{KL}(\mathbb{P}||\mathbb{Q})\coloneqq \mathbb{E}_{\mathbb{P}}\left[\log \frac{d\mathbb{P}}{d\mathbb{Q}}\right]$ is the KL-divergence. The direct calculation of Equation (7) is costly. To efficiently measure the MI, we use a estimation called mutual information neural estimation (MINE) (Belghazi et al., 2018). + +Algorithm 1 describes how MINE is used to regularize our spatial-channel token. MINE uses a statistics network $\psi_{\theta}: \mathcal{X} \times \mathcal{Y} \to \mathbb{R}$ parameterized by $\theta \in \Theta$ to estimate a neural information measure as + +$$ +I _ {\Theta} (X; Y) = \sup _ {\theta \in \Theta} \mathbb {E} _ {\mathbb {P} _ {X Y}} [ \psi_ {\theta} ] - \log \left(\mathbb {E} _ {\mathbb {P} _ {X} \otimes \mathbb {P} _ {Y}} [ e ^ {\psi_ {\theta}} ]\right). \tag {8} +$$ + +Equation (8) is a supremum of expectation, and it can be empirically calculated by maximizing + +$$ +\frac {1}{b} \sum_ {i = 1} ^ {b} \psi_ {\boldsymbol {\theta}} \left(\boldsymbol {x} ^ {(i)}, \boldsymbol {y} ^ {(i)}\right) - \log \left(\frac {1}{b} \sum_ {i = 1} ^ {b} e ^ {\psi_ {\boldsymbol {\theta}} \left(\boldsymbol {x} ^ {(i)}, \bar {\boldsymbol {y}} ^ {(i)}\right)}\right) \tag {9} +$$ + +with gradient ascent on $\theta \in \Theta$ , where $(\pmb{x}^{(i)},\pmb{y}^{(i)})\sim$ $\mathbb{P}_{XY},i = 1,\dots ,b$ are samples from a joint distribution of $X$ and $Y$ , and $\bar{\pmb{y}}^{(i)}\sim \mathbb{P}_Y,i = 1,\dots ,b$ are samples from a marginal distribution of $Y$ . In practice, we use paired spatial and channel tokens $(T_{S}^{(i)},T_{C}^{(i)})$ from the image $\pmb{x}_i$ as the joint distribution and use unpaired tokens $(T_{S}^{(i)},T_{C}^{(j)})$ from random images $\pmb{x}_i$ and $\pmb{x}_j$ as the marginal distribution. Then, we can minimize Equation (9) by optimizing the spatial-channel token for minimal mutual information. + +# 3.3. The Overall Pipeline of STD + +Multi-teacher Distillation with Tokens. Distillation with multiple teachers has turned out to be effective to improve the performance of students than using a single teacher (Hinton et al., 2015; Sau & Balasubramanian, 2016; You et al., 2017), because different teacher networks can provide their unique information. We also consider multi-teacher distillation with our spatial-channel tokens. To achieve multi-teacher distillation, we only need to add extra tokens into Equations (5) and (6). This allows each teacher to correspond to a specific latent representation in the student network. An intuitive way to utilize those teachers is using the averaged response from them (Hinton et al., 2015). However, we argue that different teachers have various importance. Therefore, we further introduce an entropy-based + +Algorithm 1 The mutual information regularization on spatial-channel tokens. + +Input: the vision model $f$ and parameters $\omega$ , the MINE network $\psi$ and parameters $\theta$ , input images $x$ , the number of samples $b$ , the number of epochs $T$ + +1: for $t = 1$ to $T$ do +2: Get the vision model outputs: $(\hat{y}, T_S, T_C) \gets f_{\omega}(\pmb{x})$ +3: Draw random pairs $(\pmb{T}_S^{(1)},\pmb{T}_C^{(1)}),\dots ,(\pmb{T}_S^{(b)},\pmb{T}_C^{(b)})$ from $(T_{S},T_{C})$ as the joint distribution; +4: Draw random samples $\bar{\pmb{T}}_C^{(1)},\dots,\bar{\pmb{T}}_C^{(b)}$ from $T_{C}$ as the marginal distribution; +5: Calculate Equation (9): $\mathcal{V}(\pmb{\theta}) \gets \frac{1}{b}\sum_{i=1}^{b}\psi_{\pmb{\theta}}(\pmb{T}_{S}^{(i)},\pmb{T}_{C}^{(i)}) - \log\left(\frac{1}{b}\sum_{i=1}^{b}e^{\psi_{\pmb{\theta}}(\pmb{T}_{S}^{(i)},\bar{\pmb{T}}_{C}^{(i)})}\right)$ ; +6: Calculate $g_{\theta} = \nabla_{\theta}\mathcal{V}(\theta)$ and update $\theta$ by gradient ascent: $\theta \gets \theta + g_{\theta}$ ; +7: Calculate $g_{\omega} = \nabla_{\omega}\mathcal{V}(\theta)$ and update $\omega$ by gradient descent: $\omega \gets \omega - g_{\omega}$ ; +8: end for + +confidence re-weighting term. The losses regarding different teachers are re-weighted by their confidence about a sample. We use the negative entropy (Wan, 1990; Zaragoza & d'Alché Buc, 1998) of the softmax distribution of a teacher network to measure its confidence score: + +$$ +S \left(g _ {i}\right) = - \sum_ {i = 1} ^ {K} P \left[ g _ {i} (\boldsymbol {x}) | \boldsymbol {x} \right] \cdot \log P \left[ g _ {i} (\boldsymbol {x}) | \boldsymbol {x} \right], \tag {10} +$$ + +where $K$ is the number of class, and $g_{i}$ is the $i$ -th teacher network. Finally, the multi-teacher distillation loss re-weighted by 10 is calculated. The confidence score for each teacher is normalized by softmax to ensure the range of the final loss is proper. The overall multi-teacher distillation loss, therefore, is + +$$ +\mathcal {L} _ {\text {d i s t}} = \sum_ {i = 1} ^ {M} \left(\sigma \left(\left[ S \left(g _ {j}\right) \right] _ {j = 1, \dots , M}\right) ^ {(i)} \cdot \ell_ {\mathrm {C E}} (f (\boldsymbol {x}), g _ {i} (\boldsymbol {x}))\right), \tag {11} +$$ + +where $M$ is the number of teachers, $\sigma$ is the softmax function, and $\ell_{\mathrm{CE}}$ is the cross-entropy loss. + +The Spatial-channel Token Distillation Network. An image is first split into patches and embedded to the target dimension. The patches are then passed through MLP blocks. As aforementioned, the proposed method can be used for both last layer distillation and intermediate layer distillation. To distill intermediate layers, the nature of STD allows us to directly add tokens to the target layers. Because STD only back-propagates gradients to the previous layers and does not propagate outputs to the following layers, we can safely use it in the middle of a network without worrying it conflicts with tokens for the distillation of the last layer. In our practice, we find distilling shallow layers with a small teacher, e.g. ResNet-50 (He et al., 2016), and deep layers with a large teacher, e.g. ResNet-101, can outperform distilling the whole network with the same two networks. For the classification head, we use a global average pooling (GAP) before the fully-connected classification head. To get the final prediction, we follow DeiT (Touvron et al., + +2021b) and use the average of the distillation head(s) and classification head for the final prediction. + +The Overall Distillation Objective. Finally, the concatenated distillation tokens are fed to fully connected classification heads. The predictions are used for hard-label distillation, where the hard decisions of teachers are the targets of the student. Letting the teacher $g_{i}(\cdot)$ in Equations (10) and (11) outputs the argmax of its classification head, we can have its hard decisions. The objective associated with this hard label distillation is: + +$$ +\mathcal {L} = (1 - \alpha) \mathcal {L} _ {\text {c l a s s}} + \alpha \mathcal {L} _ {\text {d i s t}}, \tag {12} +$$ + +where $\mathcal{L}_{\mathrm{class}} = \ell_{\mathrm{CE}}(f(\boldsymbol{x}),y)$ is the classification loss regarding the ground truth labels, and $\mathcal{L}_{\mathrm{dist}}$ is the distillation loss calculated by Equation (11). + +# 4. Experiments + +In this section, we demonstrate the performance of STD with several popular architectures for MLP-like vision models. We first compare models distilled by STD and trained with the origin schema. Then, we discuss the distillation settings in STD. Finally, we perform extensive ablation studies to evaluate each component in STD. + +Table 1. The throughput of various MLP-like architectures tested on ImageNet-1K with $8 \times$ NVIDIA V100 GPUs. We use the largest possible batch size to evaluate the maximal speed. + +
ArchitectureVariantPatch SizeOver-lappingThroughput (images/s)
MixerS1616×962.45
ResMLPS2416×733.59
CycleMLPB17✓822.39
MixerB1616×562.80
ResMLPB2416×346.09
CycleMLPB27✓664.14
+ +Table 2. Comparison between STD and SOTA methods. We compare models distilled by STD with models trained from scratch on ImageNet-1K and models pre-trained on large-scale datasets and then fine-tuned on ImageNet-1K. + +
ModelParams (M)FLOPs (G)Top-1 Acc. (%)
CNN
ResNet-18 (He et al., 2016)12.51.869.8
ResNet-50 (He et al., 2016)22.04.178.9
RSB-ResNet-18 (Wightman et al., 2021)12.51.871.5
RSB-ResNet-50 (Wightman et al., 2021)22.04.180.4
Transformer-based
ViT-B/16/384 (Dosovitskiy et al., 2021)86.0-77.9
ViT-L/16/384 (Dosovitskiy et al., 2021)307.0-76.5
DeiT-Ti (Touvron et al., 2021b)6.0-74.5
DeiT-S (Touvron et al., 2021b)22.0-81.2
DeiT-B (Touvron et al., 2021b)87.0-83.4
MLP-like
Mixer-S16 (Tolstikhin et al., 2021)18.53.872.9
+ JFT-300M18.53.873.8 (+0.9)
+ DeiT Distillation (Touvron et al., 2021b)20.03.874.2 (+1.3)
+ STD (ours)22.24.375.7 (+2.8)
Mixer-B16 (Tolstikhin et al., 2021)59.912.776.4
+ JFT-300M59.912.780.0 (+3.6)
+ ImageNet-21K59.912.780.6 (+4.2)
+ STD (ours)66.713.780.0 (+3.6)
ResMLP-S24 (Touvron et al., 2021a)30.06.079.4
+ STD (ours)32.56.280.0 (+0.6)
ResMLP-B24 (Touvron et al., 2021a)115.723.081.0
+ STD (ours)122.624.182.4 (+1.4)
CycleMLP-B1 (Chen et al., 2021)15.22.178.9
+ STD (ours)18.42.280.0 (+1.1)
CycleMLP-B2 (Chen et al., 2021)26.83.981.6
+ DeiT Distillation (Touvron et al., 2021b)28.63.981.9 (+0.3)
+ STD (ours)30.14.082.1 (+0.5)
+ +# 4.1. Setup + +Datasets. We use the ImageNet-1K (Russakovsky et al., 2015) dataset for both distillation and evaluation. It has 1.3 million images covering 1,000 classes. One of our baselines, MLP-Mixer, uses additional datasets, including ImageNet-21K and JFT-300M (Sun et al., 2017), for pre-training. ImageNet-21K is a superset of ImageNet-1K, which contains 14 million images covering 21,000 classes. JFT-300M is a private dataset, which contains 300 million images covering 18,000 classes. We do not use any extra images or labels from them. + +Student Networks. We evaluate STD with various MLP-like architectures, including MLP-Mixer (Tolstikhin et al., 2021), ResMLP (Touvron et al., 2021a) and CycleMLP (Chen et al., 2021). Each architecture has multiple variants, we compare the variants with a similar throughput. The throughput is tested on ImageNet-1K with $8 \times$ NVIDIA V100 GPUs and is listed in Table 1. The first group includes Mixer-S16, ResMLP-S24, and CycleMLP-B1, and + +the second group includes Mixer-B16, ResMLP-B24, and CycleMLP-B2. + +Teacher Networks. We mainly use CNNs as the teacher networks. We consider two variants of ResNet (He et al., 2016), including ResNet-50 and ResNet-101. They have $79.6\%$ and $80.7\%$ top-1 accuracy on ImageNet-1K, respectively. We also perform an ablation study by distilling with a Transformer-based vision model, Swin-Transformer (Liu et al., 2021), as a teacher. We use Swin-B pre-trained on ImageNet-22K with the identical $224 \times 224$ resolution to ResNets. It has $85.2\%$ top-1 accuracy on ImageNet-1K. + +# 4.2. Comparison with State-of-the-Art Methods + +We compare with three kinds of SOTA MLP-like vision models, including models trained from scratch on ImageNet-1K, models pre-trained with large-scale datasets (e.g., JFT-300M and ImageNet-21K) and fine-tuned on ImageNet-1K, and models distilled with prior methods, such as DeiT. We + +Table 3. The top-1 accuracy on ImageNet-1K of CycleMLP-B2 distilled with various selections of teachers. + +
TeachersStudent
ArchitectureResNet-50ResNet-101Swin-B/224Top-1 Acc. (%)
Params (M)25.5844.5787.77
FLOPs (G)4.368.0915.14
Selection✓✗✗81.47
✗✗✓81.91
✓✓✗81.96
+ +also compare to Transformer-based vision models both with and without distillation. The results are reported in Table 2. + +Compared to MLP-Mixers, models distilled with our STD without additional datasets obtain consistently better performance. With the proposed STD, Mixer-S16 can reach $75.7\%$ top-1 accuracy, which is $1.0\%$ higher than the model pretrained on JFT-300M. As for Mixer-B16 with STD, it can reach $80.0\%$ , which is higher than the models pre-trained on ImageNet-1K and JFT-300M and is competitive to the model pre-trained on ImageNet-21K. Besides, we find that if there is no pre-training, even though Mixer-S16 is 3 times smaller than Mixer-B16 in terms of FLOPs and parameters, Mixer-S16+STD can still reach a competitive performance to Mixer-B16 trained from scratch. It demonstrates the difficulty of optimizing MLP-Mixers from scratch and the effectiveness of our STD. + +As for stronger architectures, e.g. ResMLP and CycleMLP, if Mixer-B16 is pre-trained on ImageNet-1K instead of the two large datasets, JFT-300M and ImageNet-21K, the performance of it is consistently lower than ResMLP and CycleMLP regardless of the model size. By distilling Mixer-B16 with STD, it can outperform ResMLP-S24 nad CycleMLP-B1 and reach very close to ResMLP-B24 and CycleMLP-B2. When applying to ResMLP and CycleMLP, STD can further improve their performance. Among them, STD reaches the maximal accuracy gain of $1.1\%$ on CycleMLP-B1. + +Compared with DeiT, it can improve the accuracy of Mixer-S16 to $74.2\%$ , which is still lower than DeiT-Ti. In contrast, STD can improve Mixer-S16 to be better than DeiT-Ti by $1.2\%$ . The larger MLP-Mixer, Mixer-B16, performs lower than both ViTs. When applying STD to it, it can reach $2.1\%$ and $3.5\%$ higher accuracy than ViT-B/16/384 and ViT-L/16/384, respectively. + +# 4.3. Distillation Settings + +In this subsection, we discuss our distillation setting, including the selection of teachers, the spatial-channel tokens, the distillation of the intermediate layer, and the manner of prediction. We use the CycleMLP-B2 as the student, whose + +Table 4. The top-1 accuracy on ImageNet-1K of CycleMLP-B2 distilled with and without the propsoed spatial-channel tokens. + +
TeachersS+C TokensStudent
ResNet-50ResNet-101Top-1 Acc. (%)
✓✗✗81.40
✓✗✓81.47
✓✓✗81.89
✓✓✓81.96
+ +accuracy is the best among our models in Table 2. + +Different Teachers. We first consider the selection of teachers for STD. There are three different options in Table 3, including a small teacher (i.e. ResNet-50), a large teacher (i.e. Swin-B/224), and the combination of two small teachers (i.e. ResNet-50 and ResNet-101). Even though it is no surprise that the large Swin-B/224 can distill a better student than the small ResNet-50, we find the combination of two small teachers can reach competitive performance to one large teacher. The Swin-B/224 has 87.77M parameters and 15.14G FLOPs, yet the combination of ResNet-50 and ResNet-101 only has 70.15M parameters and 12.45G FLOPs. Besides, both of the two ResNets have lower accuracy than Swin-B/224 (79.6% and 80.7% vs. 85.2%). Nevertheless, distilling with the two ResNets reaches 81.96% top-1 accuracy on ImageNet-1K, which is slightly higher than the accuracy by distilling with Swin-B/224. + +Besides, we find the student network can outperform its teachers by distilling with ResNet-50 or the combination of two ResNets. Although Swin-B/224 has higher accuracy than both of the ResNets, its student has much lower performance than it. This advantage does not maximize the benefit of its student. We argue this could be caused by the huge gap between the model sizes of CycleMLP-B2 and Swin-B/224. The student only has 30.1M parameters and 4.0G FLOPs, which is about three times smaller than the teacher. + +Spatial-channel Tokens. Then, we study the impacts of our spatial-channel token, under both single teacher distillation and multi-teacher distillation. ResNet-50 is used for the single teacher distillation, and the combination of ResNet-50 and ResNet-101 is used for the multi-teacher distillation. As can be seen in Table 4, the spatial-channel tokens can obtain consistent performance gains. + +Intermediate Layer Distillation. We evaluate the intermediate layer distillation. Instead of distilling different layers with the same teacher, we consider the multi-teacher setting, whose performance is the best in Table 3. We use the + +Table 5. The top-1 accuracy on ImageNet-1K of CycleMLP-B2 distilled at the last layer and at multiple positions. + +
TeachersStudent
ArchitectureResNet-50ResNet-101Top-1 Acc. (%)
PositionLast InterLast Last81.96 82.09
+ +Table 6. Ablation study on using different prediction methods, including using the averaged response, using the classification head, and using distillation heads. + +
ModelNo DistMeanClass HeadDist Head
Mixer-S1672.975.7475.40 (-0.34)75.70 (-0.04)
Mixer-B1676.480.0578.78 (-1.27)80.05 (-0.00)
CycleMLP-B178.979.9679.59 (-0.37)79.92 (-0.04)
CycleMLP-B281.682.1182.01 (-0.10)81.97 (-0.14)
+ +ResNet-50 to distill the intermediate layer and the ResNet101 to distill the last layer. The intermediate distillation tokens are inserted into the $2/3$ position of the network Table 5 demonstrates distilling both the intermediate layer and last layer can improve the accuracy by $0.13\%$ . + +Prediction Heads. As aforementioned, we follow DeiT (Touvron et al., 2021b) and use the averaged response from the classification head and distillation heads. We also perform an ablation study to evaluate this prediction manner with both MLP-Mixer and CycleMLP. The results are reported in Table 6. As can be seen, the accuracy always drops whether the classification head or distillation heads are used alone. Although the distillation heads perform better than the classification head in most cases, neither of them is necessarily better. A possible explanation of this phenomenon is that the classification head learns ground-truth labels, and distillation heads learn teachers' outputs. They can learn different hypothesis. Using them together is similar to ensemble learning, which can improve the predictive performance. It is also worth noting that both of the heads in networks distilled by STD can reach a better performance than the networks without distillation, which demonstrates the effectiveness of STD. + +# 4.4. Spatial-channel Token Distillation + +We perform ablation studies on different components in STD, including the teachers' confidence, spatial-channel tokens, and mutual information regularization. Models trained from scratch and pre-trained on JFT-300M are considered as baselines. The results are reported in Table 7. In this experiment, we use Mixer-S16 as the student and distill it with + +the two default CNN teachers in our work, i.e. ResNet-50 and ResNet-101. + +Teachers' Confidence Weights. We first consider the teachers' confidence weights, which can always be applied to multi-teacher distillation regardless of the use of tokens. Whether distilling without any token, with spatial tokens, or with spatial-channel tokens, the confidence weights can always increase the accuracy by around $0.12\%$ to $0.14\%$ . + +Distillation Tokens. As for the distillation tokens, we consider three different settings: distilling without any token, distilling with spatial tokens only, and distilling with our spatial-channel tokens. Firstly, we find even vanilla distillation can indeed improve the performance of MLP-Mixer. By distilling without any token, the accuracy is increased by $1.11\%$ compared to pre-training on JFT-300M and $2.07\%$ compared to training from scratch. However, distilling with spatial tokens only reduces the performance gain. By adding spatial tokens, the accuracy drops $0.26\%$ . Our spatial-channel token can improve the accuracy by $0.72\%$ and reach $75.66\%$ . This is an increase of $1.83\%$ compared to JFT-300M and $2.79\%$ compared to from scratch. + +Besides, we also find the classification token can harm the performance of MLP-like vision models, even though it works well in DeiT. Distilling with spatial tokens in this experiment is similar to DeiT, but we use a GAP before the classification head instead of a classification token like them. Comparing with the accuracy of Mixer-S16 distilled with the DeiT's distillation method reported in Table 2, Mixer-S16 can reach $75.56\%$ top-1 accuracy with spatial distillation token and GAP classification head, which is about $0.4\%$ higher than the former. + +Mutual Information Regularization. Because the mutual information regularization is between the spatial and channel tokens, it does not apply to distillation without any token or with the spatial tokens only. Therefore, we mainly study its impacts on STD. As can be seen, the accuracy of STD can further increase to $75.74\%$ , which is $1.91\%$ higher than the pre-training on JFT-300M. The computational cost of MINE is also marginal. We use a three-layer MLP with 512 dimensions as the MINE network. It has only 0.003G FLOPs and 0.84M parameters, which is much smaller than the models. + +# 5. Conclusion + +In this work, we propose a distillation mechanism designed for MLP-like vision models, namely Spatial-channel Token Distillation (STD). STD adds distillation tokens into both the spatial and channel dimension of MLP blocks. Those tokens are designed to improve the spatial and channel mix + +Table 7. Ablation studies on components in STD with Mixer-S16 as the student network. + +
MethodPre-trainingDistillationTokenTeachers' ConfidenceMIRTop-1 Acc. (%)
NoneXX---72.87
Pre-trainingJFT-300MX---73.83
Other DistillationX✓XX-74.80
X✓X✓-74.94
X✓SX-74.56
X✓S✓-74.68
STD (ours)X✓S + CXX75.52
X✓S + C✓X75.66
X✓S + C✓✓75.74
+ +ings. We also introduce a mutual information regularization to disentangle the spatial and channel information. The proposed spatial-channel tokens are not only suitable for last layer distillation but also applicable for the distillation of intermediate layers. By inserting additional pairs of tokens, STD also supports multi-teacher distillation. Extensive experiments demonstrate that STD can improve the performance of MLP-like vision models. Ablation studies show that distilling with the spatial-channel tokens can outperform vanilla distillation without any token and DeiT's distillation with spatial tokens only. + +# Acknowledgements + +The authors would like to thank the area chairs and the reviewers for their constructive comments. This work was supported in part by the Australian Research Council under Project DP210101859 and the University of Sydney SOAR Prize. + +# References + +Asif, U., Tang, J., and Harrer, S. Ensemble knowledge distillation for learning improved and efficient networks. arXiv preprint arXiv:1909.08097, 2019. +Belghazi, M. I., Baratin, A., Rajeswar, S., Ozair, S., Bengio, Y., Courville, A., and Hjelm, R. D. Mine: mutual information neural estimation. In Proceedings of the 35th International Conference on Machine Learning, pp. 531-540. PMLR, 2018. +Brown, T. B., Mann, B., Ryder, N., Subbiah, M., Kaplan, J., Dhariwal, P., Neelakantan, A., Shyam, P., Sastry, G., Askell, A., et al. Language models are few-shot learners. arXiv preprint arXiv:2005.14165, 2020. +Bucilua, C., Caruana, R., and Niculescu-Mizil, A. Model compression. In Proceedings of the 12th ACM SIGKDD + +international conference on Knowledge discovery and data mining, pp. 535-541, 2006. +Chen, H., Wang, Y., Xu, C., Xu, C., and Tao, D. Learning student networks via feature embedding. IEEE Transactions on Neural Networks and Learning Systems, 32(1): 25-35, 2020. +Chen, S., Xie, E., Ge, C., Liang, D., and Luo, P. Cycle.mp: A mlp-like architecture for dense prediction. arXiv preprint arXiv:2107.10224, 2021. +Chen, X., Su, J., and Zhang, J. A two-teacher framework for knowledge distillation. In International Symposium on Neural Networks, pp. 58–66. Springer, 2019. +Devlin, J., Chang, M.-W., Lee, K., and Toutanova, K. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018. +Dosovitskiy, A., Beyer, L., Kolesnikov, A., Weissenborn, D., Zhai, X., Unterthiner, T., Dehghani, M., Minderer, M., Heigold, G., Gelly, S., et al. An image is worth 16x16 words: Transformers for image recognition at scale. In International Conference on Learning Representations, 2021. +Guo, J., Tang, Y., Han, K., Chen, X., Wu, H., Xu, C., Xu, C., and Wang, Y. Hire-mlp: Vision mlp via hierarchical rearrangement. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2022. +Guo, T., Xu, C., He, S., Shi, B., Xu, C., and Tao, D. Robust student network learning. IEEE transactions on neural networks and learning systems, 31(7):2455-2468, 2019. +He, K., Zhang, X., Ren, S., and Sun, J. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770-778, 2016. + +Hinton, G., Vinyals, O., and Dean, J. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015. +Hou, Q., Jiang, Z., Yuan, L., Cheng, M.-M., Yan, S., and Feng, J. Vision permutator: A permutable mlp-like architecture for visual recognition. arXiv preprint arXiv:2106.12368, 2021. +Hu, H., Zhang, Z., Xie, Z., and Lin, S. Local relation networks for image recognition. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 3464-3473, 2019. +Krizhevsky, A., Sutskever, I., and Hinton, G. E. Imagenet classification with deep convolutional neural networks. Advances in neural information processing systems, 25: 1097-1105, 2012. +LeCun, Y., Boser, B., Denker, J. S., Henderson, D., Howard, R. E., Hubbard, W., and Jackel, L. D. Backpropagation applied to handwritten zip code recognition. Neural computation, 1(4):541-551, 1989. +Liu, Z., Lin, Y., Cao, Y., Hu, H., Wei, Y., Zhang, Z., Lin, S., and Guo, B. Swin transformer: Hierarchical vision transformer using shifted windows. arXiv preprint arXiv:2103.14030, 2021. +Park, S. and Kwak, N. Feature-level ensemble knowledge distillation for aggregating knowledge from multiple networks. In ECAI 2020, pp. 1411-1418. IOS Press, 2020. +Parmar, N., Vaswani, A., Uszkoreit, J., Kaiser, L., Shazeer, N., Ku, A., and Tran, D. Image transformer. In International Conference on Machine Learning, pp. 4055-4064. PMLR, 2018. +Radford, A., Narasimhan, K., Salimans, T., and Sutskever, I. Improving language understanding with unsupervised learning. 2018. +Radford, A., Wu, J., Child, R., Luan, D., Amodei, D., Sutskever, I., et al. Language models are unsupervised multitask learners. OpenAI blog, 1(8):9, 2019. +Ramachandran, P., Parmar, N., Vaswani, A., Bello, I., Levskaya, A., and Shlens, J. Stand-alone self-attention in vision models. arXiv preprint arXiv:1906.05909, 2019. +Russakovsky, O., Deng, J., Su, H., Krause, J., Satheesh, S., Ma, S., Huang, Z., Karpathy, A., Khosla, A., Bernstein, M., Berg, A. C., and Fei-Fei, L. ImageNet Large Scale Visual Recognition Challenge. International Journal of Computer Vision (IJCV), 115(3):211-252, 2015. doi: 10.1007/s11263-015-0816-y. + +Sau, B. B. and Balasubramanian, V. N. Deep model compression: Distilling knowledge from noisy teachers. arXiv preprint arXiv:1610.09650, 2016. +Sun, C., Shrivastava, A., Singh, S., and Gupta, A. Revisiting unreasonable effectiveness of data in deep learning era. In Proceedings of the IEEE international conference on computer vision, pp. 843-852, 2017. +Tang, Y., Han, K., Guo, J., Xu, C., Li, Y., Xu, C., and Wang, Y. An image patch is a wave: Phase-aware vision mlp. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2022. +Tolstikhin, I., Houlsby, N., Kolesnikov, A., Beyer, L., Zhai, X., Unterthiner, T., Yung, J., Keysers, D., Uszkoreit, J., Lucic, M., et al. Mlp-mixer: An all-mlx architecture for vision. arXiv preprint arXiv:2105.01601, 2021. +Touvron, H., Bojanowski, P., Caron, M., Cord, M., El-Nouby, A., Grave, E., Izacard, G., Joulin, A., Synnaeve, G., Verbeek, J., et al. Resmlp: Feedforward networks for image classification with data-efficient training. arXiv preprint arXiv:2105.03404, 2021a. +Touvron, H., Cord, M., Douze, M., Massa, F., Sablayrolles, A., and Jégou, H. Training data-efficient image transformers & distillation through attention. In International Conference on Machine Learning, pp. 10347-10357. PMLR, 2021b. +Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, L., and Polosukhin, I. Attention is all you need. In Advances in neural information processing systems, pp. 5998-6008, 2017. +Wan, E. A. Neural network classification: a bayesian interpretation. IEEE Transactions on Neural Networks, 1(4): 303-305, 1990. +Wei, L., Xiao, A., Xie, L., Zhang, X., Chen, X., and Tian, Q. Circumventing outliers of autoaugment with knowledge distillation. In Computer Vision-ECCV 2020: 16th European Conference, Glasgow, UK, August 23-28, 2020, Proceedings, Part III 16, pp. 608-625. Springer, 2020. +Wightman, R., Touvron, H., and Jégou, H. Resnet strikes back: An improved training procedure in timm. In Proceedings of the 35th Conference on Neural Information Processing Systems, 2021. +You, S., Xu, C., Xu, C., and Tao, D. Learning from multiple teacher networks. In Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 1285-1294, 2017. +Yuan, L., Tay, F. E., Li, G., Wang, T., and Feng, J. Revisit knowledge distillation: a teacher-free framework. 2019. + +Zaragoza, H. and d'Alché Buc, F. Confidence measures for neural network classifiers. In Proceedings of International Conference on Information Processing and Management of Uncertainty in Knowledge-Based Systems, volume 9, 1998. +Zhao, H., Jia, J., and Koltun, V. Exploring self-attention for image recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 10076-10085, 2020. \ No newline at end of file diff --git a/spatialchanneltokendistillationforvisionmlps/images.zip b/spatialchanneltokendistillationforvisionmlps/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..86bf924d3812dcc04766e18bc866604bccd4f5a7 --- /dev/null +++ b/spatialchanneltokendistillationforvisionmlps/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2d8772cc9eeaccf7c79c6024766e07fd966b06d39526bcdb142e154f474b2985 +size 404522 diff --git a/spatialchanneltokendistillationforvisionmlps/layout.json b/spatialchanneltokendistillationforvisionmlps/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..7effe6796e53000edc0f0c9606145040ad9b1217 --- /dev/null +++ b/spatialchanneltokendistillationforvisionmlps/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1a2d2a940ccd6f2f510369af77c5f3ca33b6d0fc1c3404e853328bd8a164544c +size 387975 diff --git a/spectralrepresentationofrobustnessmeasuresforoptimizationunderinputuncertainty/91562aad-d8f1-4a23-9ddb-efb44847e8ba_content_list.json b/spectralrepresentationofrobustnessmeasuresforoptimizationunderinputuncertainty/91562aad-d8f1-4a23-9ddb-efb44847e8ba_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..aa24806c4db84b0becac77ea8efb2d9790210e7c --- /dev/null +++ b/spectralrepresentationofrobustnessmeasuresforoptimizationunderinputuncertainty/91562aad-d8f1-4a23-9ddb-efb44847e8ba_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:80645f6d1d4ef62fc8c95a5942c5b14f550cfc13ce59f6a0b447d8d2c37afbbc +size 184000 diff --git a/spectralrepresentationofrobustnessmeasuresforoptimizationunderinputuncertainty/91562aad-d8f1-4a23-9ddb-efb44847e8ba_model.json b/spectralrepresentationofrobustnessmeasuresforoptimizationunderinputuncertainty/91562aad-d8f1-4a23-9ddb-efb44847e8ba_model.json new file mode 100644 index 0000000000000000000000000000000000000000..9ce1e479ed1e2237baba2fc5a8cbf7d5b837eefd --- /dev/null +++ b/spectralrepresentationofrobustnessmeasuresforoptimizationunderinputuncertainty/91562aad-d8f1-4a23-9ddb-efb44847e8ba_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b5a93e6ea51d8116e20d39643cdba1183ca6ebd04f3c05fb33fdd8849f985b5c +size 216347 diff --git a/spectralrepresentationofrobustnessmeasuresforoptimizationunderinputuncertainty/91562aad-d8f1-4a23-9ddb-efb44847e8ba_origin.pdf b/spectralrepresentationofrobustnessmeasuresforoptimizationunderinputuncertainty/91562aad-d8f1-4a23-9ddb-efb44847e8ba_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c88c0c9328a3f27c9a4e1d572fded8453e6ae7f7 --- /dev/null +++ b/spectralrepresentationofrobustnessmeasuresforoptimizationunderinputuncertainty/91562aad-d8f1-4a23-9ddb-efb44847e8ba_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a3993aa8875836680a16a544f36390f20ec93c31d43cbb41e086cb8371c60829 +size 9650519 diff --git a/spectralrepresentationofrobustnessmeasuresforoptimizationunderinputuncertainty/full.md b/spectralrepresentationofrobustnessmeasuresforoptimizationunderinputuncertainty/full.md new file mode 100644 index 0000000000000000000000000000000000000000..72ad3cf43b3b36c51e51f7806847fb16b10929e6 --- /dev/null +++ b/spectralrepresentationofrobustnessmeasuresforoptimizationunderinputuncertainty/full.md @@ -0,0 +1,827 @@ +# Spectral Representation of Robustness Measures for Optimization Under Input Uncertainty + +Jixiang Qing1 Tom Dhaene1 Ivo Couckuyt1 + +# Abstract + +We study the inference of mean-variance robustness measures to quantify input uncertainty under the Gaussian Process (GP) framework. These measures are widely used in applications where the robustness of the solution is of interest, for example, in engineering design. While the variance is commonly used to characterize the robustness, Bayesian inference of the variance using GPs is known to be challenging. In this paper, we propose a Spectral Representation of Robustness Measures based on the GP's spectral representation, i.e., an analytical approach to approximately infer both robustness measures for normal and uniform input uncertainty distributions. We present two approximations based on different Fourier features and compare their accuracy numerically. To demonstrate their utility and efficacy in robust Bayesian Optimization, we integrate the analytical robustness measures in three standard acquisition functions for various robust optimization formulations. We show their competitive performance on numerical benchmarks and real-life applications. + +# 1. Introduction + +Bayesian Optimization (BO) is a well-established approach for solving expensive non-convex black-box optimization problems efficiently (Frazier, 2018; Shahriari et al., 2015). Its agnostic treatment of black-box functions has made it applicable in many real-life application domains. Starting with a limited number of training data, BO constructs a probabilistic surrogate model, with a Gaussian Process (GP) as the common choice (Rasmussen, 2003), to provide + +$^{1}$ Ghent University, - imec, IDLab, Department of Information Technology (INTEC), Tech Lane - Zwijnaarde 126, 9052 Ghent, Belgium. Correspondence to: Jixiang Qing . + +Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s). + +a computationally efficient approximation to the problem. By leveraging an acquisition function based on the model posterior, BO is able to efficiently quantify the potential of candidate solutions and will only query the most interesting candidate(s) using the expensive black-box function. After querying the new data, BO updates the posterior of the surrogate model and searches for the next most interesting candidate(s). Eventually, the deemed optimal solution is recommended to the practitioners. + +Living in a chaotic world full of undetermined events, we strive for, yet are far from, obtaining an exact representation of the world. When ignored, uncertainties can degrade the performance of the chosen optimal solutions significantly. Among different types of uncertainties, input uncertainties, for instance, robotics position error (Nogueira et al., 2016), manufacturing tolerances (Cui et al., 2021), and imprecise measurements (Wu et al., 2021), are of practical interest in this work. To mitigate the side effects of uncertainties and aim for providing a robust solution, a sensible approach is robust optimization. In robust optimization, the goal is to maximize an objective function which is formulated upon robustness measure(s), and, thus, that is able to take uncertainty into account (Beyer & Sendhoff, 2007). + +Two common robustness measures (Manfredi & Trinchero, 2021; Wauters et al., 2020; Hoque & Low, 2020; Markowitz & Todd, 2000) are the mean (a.k.a., Bayes risk, expected regret (Beland & Nair, 2017; Oliveira et al., 2019)) and the variance, representing the first raw moment and second central moment of the objective function distribution induced by input uncertainty, respectively. Without loss of generality, they can be defined as1: + +$$ +\begin{array}{l} \mathbb {J} _ {\boldsymbol {\xi}} (f) = \mathbb {E} _ {\boldsymbol {\xi}} (f (\boldsymbol {x} + \boldsymbol {\xi})) \\ \mathbb {V} _ {\boldsymbol {\xi}} (f) = \mathbb {E} _ {\boldsymbol {\xi}} \left(f ^ {2} (\boldsymbol {x} + \boldsymbol {\xi})\right) - \left[ \mathbb {E} _ {\boldsymbol {\xi}} \left(f (\boldsymbol {x} + \boldsymbol {\xi})\right) \right] ^ {2} \tag {1} \\ \end{array} +$$ + +where the random variable $\xi$ denotes a pre-defined additive + +input uncertainty $^2$ on candidate $x$ and $f$ represents the black-box objective function. + +Pursuing optimal solutions being robust against input uncertainties is of practical interest in Bayesian Optimization, which we term as Robust Bayesian Optimization (RBO). In this context, a proper approach to infer these non-observable robustness measures is of immediate interest. Unfortunately, while it has been well-known that the posterior of the mean3 is tractable under the GP framework (O'Hagan, 1991; Papoulis & Pillai, 2002), the variance is much more difficult to infer. Practitioners have commonly used a degenerated variance approximation, i.e., performing Monte Carlo sampling on the GP posterior mean (e.g., Rivier & Congedo (2018)) to approximate the variance as a point estimation. Nevertheless, as we will theoretically elaborate later, it is unfortunately a biased estimation of the variance distribution's first moment. + +Contribution We provide an effective inference scheme for the mean and the variance distributions under the GP framework, supporting normal and uniform input uncertainty distribution forms. This has been achieved using an analytical calculation of the robustness measures through the spectral representation of the GP, which is based on the kernel approximation using Fourier features. We derive two different expressions for the robustness measures based on Fourier features (FF) methods, namely Random Fourier Features (RFF) (Rahimi et al., 2007) and Quadrature Fourier Features (QFF) (Mutny & Krause, 2019), as shown in Fig. 1. We empirically compare their accuracy through synthetic uncertainty calibration experiments. As a direct application of this scheme, we elaborate on how to utilize these robustness measures in RBO. To that end, we extend three standard acquisition functions for handling robustness, corresponding to three common robust optimization formulations. We provide empirical and real-life benchmarking of these acquisition functions, demonstrating their competitive performance against relevant methods for recommending robust optimal solutions. + +Related Work Bayesian inference of the mean $\mathbb{J}_{\xi}(f)$ and variance $\mathbb{V}_{\xi}(f)$ is of practical interest in the GP literature. Pioneer works (Girard et al., 2002; McHutchon & Rasmussen, 2011) focus on approximating the propagated objective function distribution. However, the objective function distribution generally does not disentangle the model and input uncertainties. Regarding variance inference, O'Hagan (2011) provides an approach to calculate its first two mo + +It is straightforward to extend this formulation, as well as our approaches proposed subsequently, to more generic problems containing environmental variables, see discussion in appendix E. +3For clarity, we use $GP$ posterior mean and $GP$ posterior variance to represent the mean and the variance of the conditional distribution of the GP posterior. + +ments, though expressions still rely on approximating a set of integrals. Iwazaki et al. (2021) consider the task of performing robust pool-based active learning under environmental uncertainty, where confidence intervals for both mean and variance are derived and utilized in the formulation of acquisition functions. However, the confidence interval does not provide a principled way of inspecting the distribution form (e.g., through sampling the distribution). In addition, while an extension for continuous input spaces is proposed, the continuous input uncertainty scenario is not considered. + +Fruitful RBO research has been conducted solely based on the mean distribution as it is preserved as a GP. Regarding the acquisition functions for RBO, the expected improvement (Beland & Nair, 2017), its modified formulation (Nogueira et al., 2016), and other common acquisition functions (Oliveira et al., 2019; Wang et al., 2020a) are considered. Fröhlich et al. (2020) also sample an expression for the mean using Fourier features in entropy search, but is restricted to independent normal uncertainty distributions, while we derive an extended expression for generic multivariate normal input uncertainties. Besides the common mean measure, input uncertainty has also been considered in more conservative approaches such as the adversarial form (Bogunovic et al., 2018; Sessa et al., 2020; Weichert & Kister, 2021), quantile form (Torossian et al., 2020) value-at-risk and conditional value-at-risk form (Cakmak et al., 2020; Nguyen et al., 2021a;b). + +Other types of robustness are also extensively investigated in RBO such as the robustness to model mis-specification (Bogunovic & Krause, 2021; Neiswanger & Ramdas, 2021). Finally, more generic types of input uncertainties are also investigated in (Kirschner et al., 2020; Rahimian & Mehrotra, 2019), and heteroscedastic noise is considered in (Makarova et al., 2021). + +# 2. Preliminaries + +# 2.1. Weight-Space Approximations of Gaussian Process + +GP is well-known to be a generalization of a parametric Bayesian linear model in weight-space (Rasmussen, 2003; Wilson et al., 2020). Starting with a linear model $f(\pmb{x}) = \phi(\pmb{x})^T\pmb{\theta}$ , where $\phi(\pmb{x})$ represents the feature mapping function with weights $\pmb{\theta}$ , the kernel trick (Schölkopf et al., 2002) can be utilized to replace a feature mapping function with infinite features by a kernel. This transformation has endowed advantages, including the freedom of parametric feature functions and flexible expressivity scaling with training data. Nevertheless, mainly encouraged by avoiding the expensive kernel inversion in big data scenarios, one may still want to look back to its weight-space formulation (Lázaro-Gredilla et al., 2010), + +![](images/022a82b76fc256fdcd427c95c5680519d7e6b3c0914edea2792045e6663daaa5.jpg) + +![](images/42257a5ffbe18fa27c402e8847154d991cb30da46e93d3f57caa621aa46d2a4b.jpg) + +![](images/3e110c8116b688130dc612c219201c4a2ca56a779930ea3fe57ff66c08b6425d.jpg) + +![](images/c485666e8af50fb95a036de2f860e0fe0d5c4cd0fc752d1980fad42f953bc630.jpg) +Figure 1. Comparison of different sample trajectories based on Fourier features (RFF and QFF) on a synthetic function: $f = -20\left[0.5 - 0.8\exp \left(-\left(\frac{x - 0.35}{0.25}\right)^{2}\right) - \exp \left(-\left(\frac{x - 0.8}{0.05}\right)^{2}\right)\right]$ . With 256 Fourier features and uniform input uncertainty $\xi \sim U(-0.05, 0.05)$ . Black crosses are training data, dashed line represents GP posterior mean, shaded areas are 95 confidence intervals of GP posterior, and the plotted trajectories represent posterior samples based on Fourier features. + +![](images/faf8b76da047fc870d2d6fda94f0ee8243221b07560a79a3846540869ffdce7b.jpg) + +![](images/67066e1b1632dc5c2d78a892b263784ce14d416d7045e5660876e4f619e15658.jpg) + +Fourier Feature based Kernel Approximation The common way of looking back to weight-space is through degenerate kernels in a parametric form through approximation. We remark that Bochner's theorem (e.g., Stein (1999)) implies that any stationary kernel $k$ and its spectral density $S(\omega)$ are Fourier dual as shown in the r.h.s. of Eq. 2. After scaling $S(\omega)$ to a probability distribution (Lázaro-Gredilla et al., 2010), the expectation integral can be approximated by a finite number of Fourier features and subsequently be written as an inner product (Rahimi et al., 2007): + +$$ +\begin{array}{l} k (\boldsymbol {x}, \boldsymbol {x} ^ {t}) = \int S (\boldsymbol {\omega}) e ^ {j \boldsymbol {\omega} ^ {T} L (\boldsymbol {x} - \boldsymbol {x} ^ {t})} d \boldsymbol {\omega} \\ = \sigma^ {2} \int p (\boldsymbol {\omega}) \cos \left(\boldsymbol {\omega} ^ {T} L \left(\boldsymbol {x} - \boldsymbol {x} ^ {\prime}\right)\right) d \boldsymbol {\omega} \tag {2} \\ \approx \boldsymbol {\phi} ^ {T} (\boldsymbol {x}) \boldsymbol {\phi} (\boldsymbol {x} ^ {\prime}) \\ \end{array} +$$ + +where $\phi (\pmb {x})\coloneqq [\phi_1(\pmb {x}),\phi_2(\pmb {x}),\dots,\phi_{N_f}(\pmb {x})]^T$ represents the stacked $N_{f}$ parametric feature functions approximating the integration, $L:\mathrm{diag}(\ell)^{-1}\in \mathbb{R}^{d\times d}$ built upon the kernel lengthscales $\ell$ represents the Automatic Relevance Detection (ARD) (Rasmussen, 2003). + +Spectral Representation of a Gaussian Process With this formulation, one can subsequently obtain an asymptotic approximation of the GP posterior in weight-space as a Bayesian linear model (Hernández-Lobato et al., 2014; Wilson et al., 2020), also known as the spectral representation of GPs (Hensman et al., 2017): + +$$ +\mathcal {G P} (f) \dot {\sim} \phi (\boldsymbol {x}) ^ {T} \boldsymbol {\theta} \tag {3} +$$ + +where $\dot{\sim}$ represents an approximation of distributions. The posterior of the weights $\pmb {\theta}\in \mathbb{R}^{N_f}$ , given prior $\mathcal{N}(\mathbf{0},I)$ and $N_{D}$ observations $D = \{(x_i,y_i)\}_{i\leq N_D}$ , where $\pmb {y}_i\sim$ + +$\mathcal{N}(f(\pmb{x}_i), \sigma_n^2)$ , is multivariate normal: + +$$ +\pmb {\theta} \sim \mathcal {N} \big (\Phi^ {T} \Phi + \sigma_ {n} ^ {2} I \big) ^ {- 1} \Phi^ {T} \pmb {y}, \big (\Phi^ {T} \Phi + \sigma_ {n} ^ {2} I \big) ^ {- 1} \sigma_ {n} ^ {2} \big) (4) +$$ + +where $\Phi := [\phi(\pmb{x}_1), \phi(\pmb{x}_2), \dots, \phi(\pmb{x}_{N_D})]$ represent stacked feature function values for all training inputs, and $\sigma_n^2$ represents the noise likelihood variance. The spectral representation of a GP has been extensively investigated (Lázaro-Gredilla et al., 2010; Hensman et al., 2017) as it has mitigated the $\mathcal{O}(N_D^3)$ complexity. Moreover, there is another advantage which enjoys growing interest in BO (Hernández-Lobato et al., 2014; Mutny & Krause, 2019; Suzuki et al., 2020; Fröhlich et al., 2020). It provides a deterministic approach to sample GP posterior trajectories, which is useful for inference of interesting quantities. + +# 2.2. Robust Bayesian Optimization + +Problem Formulation Let $f: \mathcal{X} \to \mathbb{R}$ be a time-consuming black-box function, we can observe $y = f(\boldsymbol{x}) + \eta$ , where $\eta$ is independent Gaussian observation noise with variance $\sigma_n^2$ . Assuming $\xi$ is additive noise generated from a known distribution $p(\xi)$ specified by the practitioner, the goal of RBO is to maximize $\mathbb{J}_{\xi}(f)$ and minimize $\mathbb{V}_{\xi}(f)$ simultaneously in a bounded space $\mathcal{X} \subset \mathbb{R}^d$ . The most common formulations include: + +Multi-Objective Formulation Multi-objective optimization is a common formulation, for instance, in finances (Iwazaki et al., 2021) and engineering (Tang & Péraux, 2012). Under this formulation, RBO is performed by treating the mean and the variance as a bi-objective optimization + +problem, + +$$ +\underset {\boldsymbol {x} \in \mathcal {X}} {\text {m a x i m i z e}} (\mathbb {J} (\boldsymbol {x}), - \mathbb {V} (\boldsymbol {x})) \tag {5} +$$ + +where one seeks a Pareto frontier $\mathcal{F}_{MV}^{*} := \{\pmb{f}_{MV} \in \mathbb{F}_{MV} | \{\pmb{f}_{MV}' \in \mathbb{F}_{MV} | \pmb{f}_{MV}' > \pmb{f}_{MV}\} = \emptyset\}$ , where $\mathbb{F}_{MV} := \{\pmb{f}_{MV} \in \mathbb{R}^2 | \pmb{f}_{MV} = [\mathbb{J}(\pmb{x}), -\mathbb{V}(\pmb{x})], \pmb{x} \in \mathcal{X}\}$ , represents the standard dominance operator (see, e.g., Section 1 of Daulton et al. (2020)). + +Variance as Constraint Another scenario is performing the optimization, while make sure that the deviation of the final optimal solution with respect to input uncertainty is acceptable. This can be formulated as: + +$$ +\underset {x \in \mathcal {X}} {\text {m a x i m i z e}} \mathbb {J} (\boldsymbol {x}) +$$ + +$$ +\mathrm {s . t .} \mathbb {V} (\boldsymbol {x}) \leq C _ {v} +$$ + +where $C_v \in \mathbb{R}$ is a pre-specified constraint threshold, the goal is to locate the feasible maximum $\mathbb{J}_{\mathrm{Fea}}^*$ . + +Scalarization Formulation Scalarization (also known as Multi-Task (Iwazaki et al., 2021)) aggregates multiple objectives into a single cost function. For instance, a straightforward aggregation is linear scalarization (e.g., Paria et al. (2020)): + +$$ +\psi_ {M V} := \underset {\boldsymbol {x} \in \mathcal {X}} {\operatorname {m a x i m i z e}} \mathbb {J} (\boldsymbol {x}) - \alpha \mathbb {V} (\boldsymbol {x}) \tag {7} +$$ + +where $\alpha \geq 0$ is the pre-specified scalarization coefficient. + +Finally, we like to point out the interchangeability between the above formulations through the following remark: + +Remark 2.1. Given $f, \xi$ 's distribution and their corresponding $\mathcal{F}_{MV}^{*}$ : + +1. $\forall \pmb{f}_{MV} \in \mathcal{F}_{MV}^{*}, \exists C_{v}^{\prime} \geq 0$ s.t. $\mathbb{J}_{\mathrm{Fea}}^{*}|C_{v}^{\prime} = \pmb{f}_{MV}$ +2. If $\mathcal{F}_{MV}^{*}$ is concave: $\forall f_{MV} \in \mathcal{F}_{MV}^{*}, \exists \alpha' \geq 0$ s.t. $\psi_{MV}|_{\alpha'} = f_{MV}$ . + +# 3. Spectral Representation of Robustness Measures + +Motivation The calculation of robustness measures in Eq. 1 expects a continuous $f$ to be handled appropriately by the expectation operation. Nevertheless, the standard GP predictive posterior depends on a finite number of discrete test input which makes the analytical calculation of the expectation non-trivial. Hence, we propose to degenerate the GP to its spectral representation of Eq. 3. This sheds light on an analytical expression of Eq. 1. + +Definition 3.2. (Spectral representation of robustness measure) With the Fourier feature based approximation of the kernel, we are able to reach the following Bayesian + +robustness measures approximation $\tilde{\mathbb{J}} (\mathcal{GP}(f))|\phi ,\theta$ and $\hat{\mathbb{V}} (\mathcal{GP}(f))|\phi ,\theta$ + +$$ +\mathbb {J} (\mathcal {G P} (f)) \dot {\sim} \tilde {\mathbb {J}} (\mathcal {G P} (f)) | \phi , \theta = \mathbb {E} _ {\boldsymbol {\xi}} [ \phi (\boldsymbol {x} + \boldsymbol {\xi}) ^ {T} ] \boldsymbol {\theta} +$$ + +$$ +\mathbb {V} (\mathcal {G P} (f)) \div \tilde {\mathbb {V}} (\mathcal {G P} (f)) | \phi , \boldsymbol {\theta} +$$ + +$$ +\begin{array}{l} = \boldsymbol {\theta} ^ {T} \mathbb {E} _ {\boldsymbol {\xi}} [ \phi (\boldsymbol {x} + \boldsymbol {\xi}) \phi (\boldsymbol {x} + \boldsymbol {\xi}) ^ {T} ] \boldsymbol {\theta} \tag {8} \\ \left. - \left[ \mathbb {E} _ {\boldsymbol {\xi}} \left[ \phi (\boldsymbol {x} + \boldsymbol {\xi}) ^ {T} \right] \boldsymbol {\theta} \right] ^ {2} \right. \\ \end{array} +$$ + +It can be seen that under finite parameterization, the mean expression is a normal distribution. The variance conditional distribution is the difference of two correlated generalized $\chi^2$ distributions. + +With these spectral representations, we are also able to provide their first moments through the following theorem: + +Theorem 3.3. Given $\mathcal{GP}(f) \doteq \phi(\boldsymbol{x})^T\boldsymbol{\theta}$ , where $\boldsymbol{\theta} \sim \mathcal{N}(\boldsymbol{\mu}_{\boldsymbol{\theta}}, \boldsymbol{\Sigma}_{\boldsymbol{\theta}})$ , the robustness measure's first moments are: + +$$ +\begin{array}{l} \mathbb {E} _ {\boldsymbol {\theta}} \left[ \tilde {\mathbb {J}} (\mathcal {G P} (f)) \right] = \mathbb {E} _ {\boldsymbol {\xi}} \left[ \phi \left(\boldsymbol {x} + \boldsymbol {\xi}\right) ^ {T} \right] \boldsymbol {\mu} _ {\boldsymbol {\theta}} \\ \mathbb {E} _ {\boldsymbol {\theta}} \left[ \tilde {\mathbb {V}} (\mathcal {G P} (f)) \right] = \boldsymbol {\mu} _ {\boldsymbol {\theta}} ^ {T} \mathbb {E} _ {\boldsymbol {\xi}} \left[ \phi (\boldsymbol {x} + \boldsymbol {\xi}) \phi (\boldsymbol {x} + \boldsymbol {\xi}) ^ {T} \right] \boldsymbol {\mu} _ {\boldsymbol {\theta}} \\ - \left[ \mathbb {E} _ {\boldsymbol {\xi}} \left[ \phi \left(\boldsymbol {x} + \boldsymbol {\xi}\right) ^ {T} \right] \boldsymbol {\mu} _ {\boldsymbol {\theta}} \right] ^ {2} \tag {9} \\ + \operatorname {t r} \left(\mathbb {E} _ {\boldsymbol {\xi}} \left[ \phi (\boldsymbol {x} + \boldsymbol {\xi}) \phi (\boldsymbol {x} + \boldsymbol {\xi}) ^ {T} \right] \Sigma_ {\boldsymbol {\theta}}\right) \\ \left. - \operatorname {t r} \left(\mathbb {E} _ {\boldsymbol {\xi}} \left[ \phi (\boldsymbol {x} + \boldsymbol {\xi}) ^ {T} \right] \Sigma_ {\boldsymbol {\theta}} \mathbb {E} _ {\boldsymbol {\xi}} \left[ \phi (\boldsymbol {x} + \boldsymbol {\xi}) \right]\right) \right. \\ \end{array} +$$ + +Theorem 3.3 provides the first moments of the parametric robustness measures5. It also indicates why the degenerate approximation of the variance on the GP posterior mean is not unbiased with regard to its first moment, which we further illustrate through the following proposition. + +Proposition 3.4. Denoting the $\mathcal{GP}$ posterior mean as $\mu (f)$ , define $\mathbb{E}_{\theta}[\mathbb{V}(\mathcal{GP}(f))] = \lim_{N_f\to \infty}\tilde{\mathbb{V}} (\mathcal{GP}(f))$ to represent the variance's mean under the $\mathcal{GP}$ , one has $\mathbb{E}_{\theta}[\mathbb{V}(\mathcal{GP}(f))] > \mathbb{V}(\mu (f))$ . + +This states that the degenerate variance approximation is an underestimation compared to the variance's first moment under a GP. In fact, this holds for arbitrary Bayesian linear models with a normal prior on $\theta$ (see appendix B.1). + +In the following, we discuss two different approaches for constructing the Fourier feature mapping $\phi$ , resulting in two different spectral representing forms. Each with its advantages and drawbacks. + +Table 1. Random Fourier feature based robustness measures + +
ξ distributionEξ[φ(x+ξ)Tm](Mean)Eξ[φ(x+ξ)mφ(x+ξ)n]
N(0,Σ)√2σ2/Nf cos[ωmT Lx + bm]·e-1/2ωmLT ΣLωm∑O∈{+,−} [σ2/Nf cos[(ωmT○ωnT)Lx + (bm○bn)]·e-1/2(ωmT○ωnT)LT ΣL(ωm○ωm)]
U(-δ,δ)√2σ2/Nf cos(ωmT Lx + bm)·sin ωmT Lδ/ωmT Lδ∑O∈{+,−} [σ2/Nf cos[(ωmT○ωnT)Lx + (bm○bn)]·sin((ωmT○ωnT)Lδ)/(ωmT○ωnT)Lδ]
+ +# 3.1. Fourier Feature based Robustness Measures + +# 3.1.1. RANDOM FOURIER FEATURES + +In order to generate the feature mapping function, a common approach is to draw the Fourier features randomly, known as Random Fourier Features (RFF) (Rahimi et al., 2007). Consider the following inner product form: + +$$ +\begin{array}{l} k \left(\boldsymbol {x}, \boldsymbol {x} ^ {\prime}\right) \\ = \sigma^ {2} \mathbb {E} _ {\boldsymbol {\omega}, b} \left[ \cos \left(\boldsymbol {\omega} ^ {T} L \boldsymbol {x} + b\right) \cos \left(\boldsymbol {\omega} ^ {T} L \boldsymbol {x} ^ {\prime} + b\right) \right] \tag {10} \\ \approx \boldsymbol {\phi} ^ {T} (\boldsymbol {x}) \boldsymbol {\phi} (\boldsymbol {x} ^ {\prime}) \\ \end{array} +$$ + +For the $m$ th feature function, we can decompose $\pmb{x}$ and $\pmb{x}^{\prime}$ into an inner product form as $\phi (\pmb {x})_m = \sqrt{\frac{2\sigma^2}{N_f}}\cos (\pmb {\omega}_m^T L\pmb {x}) + b_m)\in \mathbb{R}$ using the sum of angle formula, where $\pmb {x}\in \mathbb{R}^{d}$ , $\sigma^2$ represents the kernel variance, $\pmb {\omega}_m\in \mathbb{R}^d\sim p(\pmb {\omega}),b_m\sim U(0,2\pi)$ . + +Definition 3.5. (RFF-Mean, RFF-Variance) Given the RFF based kernel approximation using the decomposition of Eq. 10, the spectral robustness measures, using the expressions in Table 1, are called RFF-Mean and RFF-Variance. + +RFF-Mean and RFF-Variance share the advantage of flexibility regarding the specification of their Fourier feature number $N_{f}$ . Unfortunately, RFF is known to have variance starvation (Wang et al., 2018; Mutny & Krause, 2019; Wilson et al., 2020): its kernel approximation can lead to inaccurate GP posterior approximations if the training data size is huge. This inaccuracy will affect the robustness measures' posterior as well (see RFF based robustness measure + +trajectory samples using algorithm 1 in Fig. 1). To mitigate this potential issue, we can utilize quasi-Monte Carlo to sample from common kernels' spectral densities (Yang et al., 2014). In order to provide a more accurate inference of the robustness measures, we introduce a numerical quadrature-based Fourier features constructing technique and demonstrate how we can build robustness measures on top of it. + +# 3.1.2. QUADRATURE FOURIER FEATURES + +In order to mitigate the variance starvation problem, Mutny & Krause (2019) propose to make use of a numerical quadrature technique. For stationary kernels with decomposable spectral density, one can expect a much more accurate approximation of Eq. 2 with the same $N_{f}$ , by utilizing numerical quadrature based Fourier features. This can be achieved by an alternative decomposition of the kernel (Rahimi et al., 2007) and can be written as: + +$$ +\begin{array}{l} k (\boldsymbol {x}, \boldsymbol {x} ^ {\prime}) \\ = \sigma^ {2} \mathbb {E} _ {\boldsymbol {\omega}} \left[ \left[ \begin{array}{l} \cos \left(\boldsymbol {\omega} ^ {T} L \boldsymbol {x}\right) \\ \sin \left(\boldsymbol {\omega} ^ {T} L \boldsymbol {x}\right) \end{array} \right] ^ {T} \left[ \begin{array}{l} \cos \left(\boldsymbol {\omega} ^ {T} L \boldsymbol {x} ^ {\prime}\right) \\ \sin \left(\boldsymbol {\omega} ^ {T} L \boldsymbol {x} ^ {\prime}\right) \end{array} \right] \right] \tag {11} \\ \approx \phi^ {T} (\boldsymbol {x}) \phi \left(\boldsymbol {x} ^ {\prime}\right) \\ \end{array} +$$ + +For the common Squared Exponential (SE) kernel, its normalized spectral density is decomposable as product of independent normal factors. Hence, the multidimensional integration in Eq. 11 can be approximated using a multivariate Gauss-Hermit quadrature, which results in the feature mapping expression $\phi \in \mathbb{R}^{2N_f}$ represented as: + +$$ +\begin{array}{l} \phi_ {j} (\boldsymbol {x}) \\ = \left\{ \begin{array}{l l} \sqrt {\sigma^ {2} v \left(\omega_ {j}\right)} \cos \left(\omega_ {j} ^ {T} L \boldsymbol {x}\right) & j \leq N _ {f}, \\ \sqrt {\sigma^ {2} v \left(\omega_ {j - N _ {f}}\right)} \sin \left(\omega_ {j - N _ {f}} ^ {T} L \boldsymbol {x}\right) & N _ {f} < j \leq 2 N _ {f} \end{array} \right. \tag {12} \\ \end{array} +$$ + +where $v(\omega_j)$ , $v(\omega_{j-N_f})$ represents the quadrature weights on integration node $\omega_j$ , $\omega_{j-N_f}$ respectively, which has been generated on a Cartesian product grid: assuming $N_f = \overline{m}^d$ , $\overline{m} \in \mathbb{N}$ , defining the set $\zeta = \{v(\omega_1), \dots, v(\omega_{\overline{m}})\}$ representing one-dimensional quadrature weights, we have $v(\omega_j) \in \zeta^d$ , where $\zeta^d$ represents $d$ times Cartesian product over $\zeta$ . We refer to (Mutny & Krause, 2019) for a more thorough discussion and show our robustness measure's expression based on QFF below. + +Definition 3.6. (QFF-Mean, QFF-Variance) Substituting Eq. 12 into Eq. 8, the mean and the variance robustness measures using the expressions in Table 2 (in the appendix D.1) are defined as QFF-Mean and QFF-Variance. + +We demonstrate the QFF-Mean and Variance based sample trajectories using algorithm 1 in Fig. 1. It can be seen that, with this kind of technique, the variance starvation can be effectively suppressed and hence provide an accurate approximation of uncertainty, even with densely sampled training data. + +# Algorithm 1 Sampling Robustness Measure's Trajectories + +1: Input: Stacked feature function $\Phi$ , training data $D$ , sample size $N$ . +2: Calculate $\theta$ 's posterior distribution parameter: $\mu_{\theta},\Sigma_{\theta}$ (Eq. 4). +3: for $i = 1$ to $N$ do +4: $\pmb{\theta}_i\sim \mathcal{N}(\pmb {\mu}_\pmb {\theta},\Sigma_\pmb {\theta})$ +5: Construct $\mathbb{J}_i(\mathcal{GP}(f))|\phi, \theta_i$ trajectory sample. (RFF: Eq. 1 use Table 1, QFF: Eq. 1 use Table 2) +6: Construct $\bar{\mathbb{V}}_i(\mathcal{GP}(f))|\phi, \theta_i$ trajectory sample. (RFF: Eq. 1 use Table 1, QFF: Eq. 1 use Table 2) +7: end for + +We remark the main limitations of QFF based robustness measures are twofold: 1) the quadrature utilized in (Mutny & Krause, 2019) depends on the decomposable assumption of the kernel's spectral density. 2) the Fourier feature number $N_{f}$ grows exponentially with the input dimensionality due to the Cartesian form of integration nodes, hence restricting the application of this strategy to small to medium scale (see appendix F for a discussion of computational complexity). + +We summarize that a fully Bayesian posterior can be obtained by marginalizing out the kernel hyperparameters, which is the same as for the GPs (Simpson et al., 2020; Lalchand & Rasmussen, 2020; Filippone & Girolami, 2014). Meanwhile, we highlight one advantage of this spectral robustness measure representation is its utilization in posterior sampling, as deterministic posterior trajectory samples are available through sampling the weights $\theta$ . This property is readily useful in RBO through different forms of acquisition functions, we will discuss several of the main forms in the next section. + +# 4. Application in Robust Bayesian Optimization + +We elaborate on how the Bayesian inference of the robustness measures can be utilized in different RBO formulations. More specifically, we provide modified myopic acquisition functions (Daulton et al., 2021; Letham et al., 2019; Jones et al., 1998) to take the robustness measures into account. + +Mean-Variance based Multi-Objective Approach We provide Fourier Feature based, Mean Variance considered, Expected HyperVolume Improvement acquisition function (FF-MV-EHVI) to search for the optimal Pareto front $\mathcal{F}_{MV}^{*}$ . + +$\alpha_{\mathrm{FF - MV - EHVI}}$ + +$$ +\begin{array}{l} = \int_ {\boldsymbol {F} _ {M V}} \int_ {\mathbb {J}, \mathbb {V}} \operatorname {H V I} (\mathbb {J}, \mathbb {V}, \mathcal {F} _ {M V} ^ {*}) p (\mathbb {J}, \mathbb {V} | \boldsymbol {F} _ {M V}) \\ p \left(\boldsymbol {F} _ {M V} | \boldsymbol {X}\right) d \mathbb {J} d \mathbb {V} d \boldsymbol {F} _ {M V} \tag {13} \\ \approx \frac {1}{N} \sum_ {i = 1} ^ {N} \operatorname {H V I} \left(\tilde {\mathbb {J}} _ {i}, \tilde {\mathbb {V}} _ {i}, \tilde {\mathcal {F}} _ {M V _ {i}} ^ {*} \mid \boldsymbol {\theta} _ {i}, D\right) \\ \end{array} +$$ + +where $X:\{\pmb {x}_i\}_{i\leq N_D}$ represents the training data's input, $\pmb{F}_{MV}$ represents the corresponding output in $\mathbb{F}_{MV}$ , HVI represents the hypervolume improvement (see e.g., Definition 2 of Daulton et al. (2020)) based on the current Pareto frontier $\mathcal{F}_{MV}^{*}$ . Since this quantity is not directly observed in our scenario, we propose using a Monte Carlo approach to approximately integrate $\mathcal{F}_{MV}^{*}$ similar as Daulton et al. (2021), this can be easily achieved within the Fourier feature based robustness measures, as jointly sample $\tilde{\mathbb{J}}_i,\tilde{\mathbb{V}}_i,\tilde{\mathcal{F}}_{MV_i}^*$ can be achieved by simply sampling $\theta^6$ + +Variance as Constraint Assuming the objective is to perform RBO by considering the variance to be lower than a specified threshold $C_v$ . Based on (Letham et al., 2019), we propose the Fourier Feature based, Mean Variance considered, Expected Constrained Improvement acquisition function (FF-MV-ECI): + +$$ +\begin{array}{l} \alpha_ {\mathrm {F F - M V - E C I}} \\ = \int_ {\mathbb {J} _ {F e a} ^ {*}} \int_ {\mathbb {J}, \mathbb {V}} l (\mathbb {J}, \mathbb {J} _ {F e a} ^ {*}) \mathbb {I} ^ {-} (\mathbb {V} - C _ {v}) \\ p (\mathbb {J}, \mathbb {V} | \mathbb {J} _ {F e a} ^ {*}) p (\mathbb {J} _ {F e a} ^ {*} | D) d \mathbb {J} d \mathbb {V} d \mathbb {J} _ {F e a} ^ {*} \tag {14} \\ \approx \frac {1}{N} \sum_ {i = 1} ^ {N} \left[ l (\tilde {\mathbb {J}} _ {i}, \tilde {\mathbb {J}} _ {F e a _ {i}} ^ {*} | \pmb {\theta} _ {i}, D) \sigma_ {s} \left(\frac {C _ {v} - \tilde {\mathbb {V}} _ {i} | \pmb {\theta} _ {i}}{\tau}\right) \right] \\ \end{array} +$$ + +![](images/49e33939cc8f7755721a581e7b88ada22192df2eaae0f5aaf7fa0bb14d49c35f.jpg) +Figure 2. Uncertainty calibration comparison between RFF and QFF based robustness measures. Dashed lines represent normal input uncertainty: $\pmb{\xi} \sim \mathcal{N}(\mathbf{0}, \sigma^2 I)$ and solid lines represent uniform: $\pmb{\xi} \sim U(-\mathbf{1}\delta, \mathbf{1}\delta)$ . We use {orange, blue} to represent {QFF, RFF}, respectively. We use $\{\bigcirc, \bigtriangledown, \bigstar\}$ to represent $\sigma^2 = \{0.001, 0.005, 0.01\}$ for normal and $\delta = \{0.05, 0.1, 0.2\}$ for uniform uncertainty respectively. + +![](images/f123937e2f36f9bbb06d4edefd8092175964740870cd1ea1c097ed266e86b1ab.jpg) + +![](images/87be11915ec7b37428a9a0961548d898038b3258ba35fdd4643a8e0ed861e539.jpg) + +![](images/0e78b07ebdef95dc129a89319471fc2ce577da23d0d381ad384bc386c6102de2.jpg) + +The utility function $l$ is defined as: $l(\tilde{\mathbb{J}}_i, \tilde{\mathbb{J}}_{Fea_i}^* | \boldsymbol{\theta}_i) := \max (\tilde{\mathbb{J}}_i - \tilde{\mathbb{J}}_{Fea_i}^*, 0)$ . For the constraint handling, we relax the original indicator function $\mathbb{I}^-$ to a sigmoid function $\sigma_s(\cdot)$ with a small positive temperature parameter $\tau$ to ensure differentiability (Wilson et al., 2018; Maddison et al., 2016). + +Scalarization based Approach Finally, the Fourier Feature based, Mean Variance considered, Expected Improvement acquisition function (FF-MV-EI) is: + +$$ +\begin{array}{l} \alpha_ {\mathrm {F F - M V - E I}} \\ = \int_ {\psi^ {*}} \int_ {\mathbb {J}, \mathbb {V}} l (\mathbb {J} - \alpha \mathbb {V}, \psi^ {*}) p (\mathbb {J}, \mathbb {V} | \psi^ {*}) p (\psi^ {*} | D) d \psi^ {*} d \mathbb {J} d \mathbb {V} \\ \approx \frac {1}{N} \sum_ {i = 1} ^ {N} l \left(\tilde {\mathbb {J}} _ {i} - \alpha \tilde {\mathbb {V}} _ {i}, \tilde {\psi} _ {i} ^ {*} \mid \boldsymbol {\theta} _ {i}, D\right) \tag {15} \\ \end{array} +$$ + +where $\tilde{\psi}_i^*$ is extracted from the training data, $l(\tilde{\mathbb{J}} - \alpha \tilde{\mathbb{V}}, \tilde{\psi}^*, \boldsymbol{\theta}_i) := \max(\tilde{\mathbb{J}} - \alpha \tilde{\mathbb{V}} - \tilde{\psi}^*, 0)$ . + +Other Extensions We restricted ourselves to three examples using the Bayesian robustness measures. Nevertheless, the strength of this work is that one could easily extend it to any acquisition function like Thompson sampling (Bradford et al., 2018) or non-myopic acquisition functions. We discuss in appendix G that a batch extension of the above acquisition functions can be easily achieved. + +# 5. Experiments + +# Benchmarking of Uncertainty Calibration + +We conduct multiple experiments to investigate the accuracy of the spectral representation of the robustness measures7. We also benchmark their performance for RBO, using the three proposed acquisition functions. The code is implemented using the open-source library Trieste (Berkeley et al., 2021)8. + +We first present an empirical uncertainty calibration study to investigate the inference accuracy of the RFF and QFF based robustness measures for guiding real-life applications. A data set of $10d$ samples is drawn from a GP prior based on a SE kernel. Afterwards, a GP is constructed and we compare the robustness measure distributions (based on RFF and QFF) at different input locations with an exhaustive Monte Carlo approach, which is regarded as the ground-truth. The difference between distributions is measured using the 1-Wasserstein distance (Ramdas et al., 2017), and we report the average of the 1-Wasserstein distance across eight runs in Fig. 2. As expected, given the same Fourier Feature numbers, QFF provides more accurate distributions. + +Robust Bayesian Optimization The proposed FF-MV-EHVI, FF-MV-ECI and FF-SMV-EI acquisition functions are benchmarked on different synthetic functions and real-life problems. For each problem, $5d$ initial randomly generated data are used. For multi-objective formulation, we compare against MO-MVA-BO (Iwazaki et al., 2021). For the variance as constraint formulation, we compare against CoMVA-BO (Iwazaki et al., 2021). Finally, in the scalarization approach we benchmark against MT-MBA-BO (Iwazaki et al., 2021) $^9$ . These acquisition functions are known demonstrating the state-of-the-art performance in active learning. Besides, we also compare with Uncertainty Sampling (US) (Iwazaki et al., 2021) and random search for all three formulations. We adopt the log-hypervolume difference (Daulton et al., 2020), utility gap (Hernandez-Lobato et al., 2016) and simple regret for multi-objective, constraint and scalarization formulation, respectively, to indicate the performance. We conduct the optimal solutions recommendation based on model inference. For the comparing methods, we use their corresponding optimal solution extracting strategies. For the GP constructing, the SE ARD kernel is used with a log-normal prior on lengthscales, where the kernel hyperparameter is inferred using maximum a posteriori estimation. Each experiment is repeated 30 times. + +![](images/9c936f3eb373441b5b591d7956e6997b35aed5c2687537c887246608961019b0.jpg) + +![](images/88ab69c1b370680684eb146860f53dd99e3a9da9e30643e56b112655ac3b392d.jpg) + +![](images/763a56a05be893c7e15575680f93bedfc3f47ce142dfb5f6924d9fe33253c347.jpg) + +![](images/c3472eb75500dbb0fc5ed25ac96f5790fb0a763df0e54fcfc23740b800d72677.jpg) + +![](images/301e5e0afdcfe7286d2565a9a5225d0b80e24fff5dd52920a01e9336b5a2ff4a.jpg) + +![](images/e664f5401ea140f012dc2a4af7a1704d7974282bedafc47813e084060ee0d492.jpg) + +![](images/ba6136866a652c88aa57ced8ff4702ca90a2e19e115dafcb86c96c321b9efed4.jpg) + +![](images/97487925db0bbaeecbdaa18ff67554bc6efc0a638733f1ef0fa2aa42353e9ad5.jpg) + +![](images/7e22f99aced57f59c8994ef0945ecbe1d6caa20e37918e5b65158257e59538f1.jpg) +Figure 3. Numerical experiment results on synthetic functions shown through median performances and interquartile ranges, where $\Sigma_{\xi} = \left[ \begin{array}{ccc}0.01 & 0.009 & -0.009\\ 0.009 & 0.01 & -0.008\\ -0.009 & -0.008 & 0.01 \end{array} \right]$ . Each row represents one formulation of the objective functions. + +![](images/544b702a2257ab995188c3e70edb0c40fc3b706427213def8da1b83ae3683189.jpg) + +![](images/17e7e3bad8e0c7ccef6c744c74b40d1a686894ab64845c2ab5a16225c0e41bb1.jpg) + +![](images/60c669df17828f639d3ae69da525bbc679e07f32d7c2ae782f2793d6b44b3fd6.jpg) + +Synthetic Experiments We conduct RBO on common synthetic benchmark functions and report the normal input uncertainty results in Fig. 3, as well as the uniform input uncertainty results in appendix H.5. It can be seen that both QFF and RFF based acquisition functions demonstrate competitive performance. Intriguingly, while the QFF robustness measure is expected to provide a more accurate robustness measure, the RFF based approach also seems to have competitive performance on most problems. + +# Conceptual Low Drag Wing Design + +![](images/44a6629cc183b93c141a540a65a9643a3b1ff6b500a3a4e6d31914958507511d.jpg) +Figure 4. Conceptual Aircraft Low Drag Wing Design + +We perform RBO on a two-dimensional conceptual design problem of an aircraft's rectangular wing in level flight condition. The goal is to find the optimal wing geometry, i.e., the wing span $b$ and chord length $c$ (see Fig. 4), to + +achieve a realistic wing geometry with high aerodynamic efficiency. + +In practice, this geometric parameters can easily get shifted not only because of fabrication errors, but also the deformation due to aerodynamic force during flight. Hence, in order to have a wing configuration that endows high aerodynamic efficiency even under slight geometry change, we consider a multi-objective formulation on this problem in the input space: $(b,c)\in [1,3]\times [0.05,1]$ under the input uncertainty of the form $(b,c)\sim \mathcal{N}(0,\left[ \begin{array}{ccc}0.004 & 0.0\\ 0.0 & 0.00045125 \end{array} \right])$ . The objective function definition is provided in appendix H.4. We remark that the multi-objective formulation provides a lot of flexibility to the practitioner, which is especially useful in engineering design as the designer is able to choose among the Pareto optimal solutions according to his own preference. The log-Hypervolume convergence curve is shown in Fig. 4, both QFF and RFF based MV-EHVI demonstrate a faster convergence speed. + +# Pre-Image Learning in Robot Pushing + +Lastly, a deterministic version of pre-image learning for a robot pushing task (Kaelbling & Lozano-Pérez, 2017) is used in a RBO setting10. The goal of the robot pushing prob- + +lem is to find a good pre-image to stop at a target location (Wang & Jegelka, 2017). The three-dimensional problem takes the initial object's position $(r_{\pmb{x}_1}, r_{\pmb{x}_2}) \in [-5, 5]^2$ , as well as the pushing time $r_t \in [1, 30]$ as input, and the objective function is the Euclidean distance between the object stop location and the target location $(g_{\pmb{x}_1}, g_{\pmb{x}_2})$ . A normal input noise $\xi \sim \mathcal{N}(0, \mathrm{diag}(0.004, 0.004, 0.002))$ is specified on the input parameters, and the goal location is set as $(g_{\pmb{x}_1}, g_{\pmb{x}_2}) = [4, 3]$ . + +![](images/116b6b589a698d0e7aa991441e400c92b3924abfec5a411c9d97110a8d0f164a.jpg) +Figure 5. Results of robot pushing problem using scalarization and variance as constraint formulations. + +![](images/37d52bf5992173f370d5a8282412a59757e2a180793215b559988c606ec328a3.jpg) + +We consider both variance as constraint and scalarization formulations for this problem. The results are shown in Fig. 5. It can be seen that for both formulations, our methods tend to converge well in practice. For the scalarization formulation, MT-MVA-BO demonstrates a faster convergence speed after 10 iterations. For the variance as constraint formulation, both QFF and RFF based EI demonstrate clear advantages. + +# 6. Conclusions + +A spectral approximation of two robustness measures is introduced based on the GP's weight-space approximation, in which we provide two versions of the robustness measures using different kernel approximations. We compare these two formulations on uncertainty calibration. We also elaborate on how these robustness measures can be utilized in robust Bayesian Optimization by extending three well-known acquisition functions, and we demonstrate their competitive performance through synthetic problems and real-life applications. + +Limitations and Future work Since the spectral representation is based on kernel approximation through the finite number of feature mapping function, a larger feature numbers are expected in higher dimensions for an accurate approximation, hence our robustness measures. As a unfavorable result, practitioners have to make a trade off between approximation accuracy, computation time and memory footprint. Future work will be focused on two aspects: (i) provide a more accurate and efficient approximation of the robustness measures, which is crucial for scaling to a higher number of input dimensions, and (ii) different acquisition functions and robustness measures shall be considered, tailored to specific robust Bayesian Optimization problems and formulations. + +# Acknowledgement + +This research receives funding from the Flemish Government under the "Onderzoekprogramma Artificièle Intelligente (AI) Vlaanderen" programme and the "Fonds Wetenschappelijk Onderzoek (FWO)" programme, and Chinese Scholarship Council (grant number 201906290032). We sincerely thank Xin Wang and Bin Chen for useful discussions. We also gratefully thank our colleague Nasrulloh Loka and anonymous reviewers for providing extensive comments for improving the paper. + +# References + +Balandat, M., Karrer, B., Jiang, D. R., Daulton, S., Letham, B., Wilson, A. G., and Bakshy, E. Botorch: A framework for efficient monte-carlo bayesian optimization. arXiv preprint arXiv:1910.06403, 2019. +Beland, J. J. and Nair, P. B. Bayesian optimization under uncertainty. In NIPS BayesOpt 2017 workshop, 2017. +Berkeley, J., Moss, H. B., Artemev, A., Pascual-Diaz, S., Granta, U., Stojic, H., Couckuyt, I., Qing, J., Satrio, L., and Picheny, V. Trieste, 8 2021. URL https://github.com/secondmind-labs/trieste. +Beyer, H.-G. and Sendhoff, B. Robust optimization-a comprehensive survey. Computer methods in applied mechanics and engineering, 196(33-34):3190-3218, 2007. +Bogunovic, I. and Krause, A. Misspecified gaussian process bandit optimization. Advances in Neural Information Processing Systems, 34, 2021. +Bogunovic, I., Scarlett, J., Jegelka, S., and Cevher, V. Adversarily robust optimization with gaussian processes. arXiv preprint arXiv:1810.10775, 2018. +Bradford, E., Schweidtmann, A. M., and Lapkin, A. Efficient multiobjective optimization employing gaussian processes, spectral sampling and a genetic algorithm. Journal of global optimization, 71(2):407-438, 2018. +Cakmak, S., Astudillo, R., Frazier, P., and Zhou, E. Bayesian optimization of risk measures. arXiv preprint arXiv:2007.05554, 2020. +Cui, L.-j., Sun, M.-y., Cao, Y.-l., Zhao, Q.-j., Zeng, W.-h., and Guo, S.-r. A novel tolerance geometric method based on machine learning. Journal of Intelligent Manufacturing, 32(3):799-821, 2021. +Daulton, S., Balandat, M., and Bakshy, E. Differentiable expected hypervolume improvement for parallel multi-objective bayesian optimization. arXiv preprint arXiv:2006.05078, 2020. +Daulton, S., Balandat, M., and Bakshy, E. Parallel bayesian optimization of multiple noisy objectives with expected hypervolume improvement. arXiv preprint arXiv:2105.08195, 2021. +Filippone, M. and Girolami, M. Pseudo-marginal bayesian inference for gaussian processes. IEEE Transactions on Pattern Analysis and Machine Intelligence, 36(11):2214-2226, 2014. +Frazier, P. I. A tutorial on bayesian optimization. arXiv preprint arXiv:1807.02811, 2018. + +Fröhlich, L. P., Klenske, E. D., Vinogradska, J., Daniel, C., and Zeilinger, M. N. Noisy-input entropy search for efficient robust bayesian optimization. arXiv preprint arXiv:2002.02820, 2020. +Girard, A., Rasmussen, C., Candela, J. Q., and Murray-Smith, R. Gaussian process priors with uncertain inputs application to multiple-step ahead time series forecasting. Advances in neural information processing systems, 15, 2002. +Gramacy, R. B. and Lee, H. K. H. Optimization under unknown constraints, 2010. +Graybill, F. A. Matrices with applications in statistics. Number 512.896 G7 1983. 1983. +Hensman, J., Durrande, N., Solin, A., et al. Variational fourier features for gaussian processes. *J. Mach. Learn.* Res., 18(1):5537-5588, 2017. +Hernández-Lobato, J. M., Hoffman, M. W., and Ghahrami, Z. Predictive entropy search for efficient global optimization of black-box functions. arXiv preprint arXiv:1406.2541, 2014. +Hernández-Lobato, J. M., Gelbart, M. A., Adams, R. P., Hoffman, M. W., and Ghahramani, Z. A general framework for constrained bayesian optimization using information-based search. 2016. +Hoque, M. E. and Low, S.-W. Industry risk factors and stock returns of malaysian oil and gas industry: A new look with mean semi-variance asset pricing framework. Mathematics, 8(10):1732, 2020. +Iwazaki, S., Inatsu, Y., and Takeuchi, I. Mean-variance analysis in bayesian optimization under uncertainty. In International Conference on Artificial Intelligence and Statistics, pp. 973-981. PMLR, 2021. +Jones, D. R., Schonlau, M., and Welch, W. J. Efficient global optimization of expensive black-box functions. Journal of Global optimization, 13(4):455-492, 1998. +Kaelbling, L. P. and Lozano-Pérez, T. Learning composable models of parameterized skills. In 2017 IEEE International Conference on Robotics and Automation (ICRA), pp. 886-893. IEEE, 2017. +Kapinchev, K., Bradu, A., Barnes, F., and Podoleanu, A. Gpu implementation of cross-correlation for image generation in real time. In 2015 9th International Conference on Signal Processing and Communication Systems (IC-SPCS), pp. 1-6. IEEE, 2015. +Keane, A., Forrester, A., and Sobester, A. Engineering design via surrogate modelling: a practical guide. American Institute of Aeronautics and Astronautics, Inc., 2008. + +Kirschner, J., Bogunovic, I., Jegelka, S., and Krause, A. Distributionally robust bayesian optimization. In International Conference on Artificial Intelligence and Statistics, pp. 2174-2184. PMLR, 2020. +Knudde, N., van der Herten, J., Dhaene, T., and Couckuyt, I. Gpflowopt: A bayesian optimization library using tensorflow. arXiv preprint arXiv:1711.03845, 2017. +Lalchand, V. and Rasmussen, C. E. Approximate inference for fully bayesian gaussian process regression. In Symposium on Advances in Approximate Bayesian Inference, pp. 1-12. PMLR, 2020. +Langley, P. Crafting papers on machine learning. In Langley, P. (ed.), Proceedings of the 17th International Conference on Machine Learning (ICML 2000), pp. 1207-1216, Stanford, CA, 2000. Morgan Kaufmann. +Lázaro-Gredilla, M., Quinonero-Candela, J., Rasmussen, C. E., and Figueiras-Vidal, A. R. Sparse spectrum gaussian process regression. The Journal of Machine Learning Research, 11:1865-1881, 2010. +Letham, B., Karrer, B., Ottoni, G., Bakshy, E., et al. Constrained bayesian optimization with noisy experiments. Bayesian Analysis, 14(2):495-519, 2019. +Maddison, C. J., Mnih, A., and Teh, Y. W. The concrete distribution: A continuous relaxation of discrete random variables. arXiv preprint arXiv:1611.00712, 2016. +Makarova, A., Usmanova, I., Bogunovic, I., and Krause, A. Risk-averse heteroscedastic bayesian optimization. Advances in Neural Information Processing Systems, 34, 2021. +Manfredi, P. and Trinchero, R. A probabilistic machine learning approach for the uncertainty quantification of electronic circuits based on gaussian process regression. IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems, 2021. +Markowitz, H. M. and Todd, G. P. Mean-variance analysis in portfolio choice and capital markets, volume 66. John Wiley & Sons, 2000. +McHutchon, A. and Rasmussen, C. E. Gaussian process training with input noise. In Advances in Neural Information Processing Systems, pp. 1341-1349, 2011. +Mutny, M. and Krause, A. Efficient high dimensional bayesian optimization with additivity and quadrature fourier features. Advances in Neural Information Processing Systems 31, pp. 9005-9016, 2019. +Neiswanger, W. and Ramdas, A. Uncertainty quantification using martingales for misspecified gaussian processes. + +In Algorithmic Learning Theory, pp. 963-982. PMLR, 2021. +Nguyen, Q. P., Dai, Z., Low, B. K. H., and Jaillet, P. Optimizing conditional value-at-risk of black-box functions. Advances in Neural Information Processing Systems, 34, 2021a. +Nguyen, Q. P., Dai, Z., Low, B. K. H., and Jaillet, P. Value-at-risk optimization with gaussian processes. arXiv preprint arXiv:2105.06126, 2021b. +Nogueira, J., Martinez-Cantin, R., Bernardino, A., and Jamone, L. Unscented bayesian optimization for safe robot grasping. In 2016 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), pp. 1967-1972. IEEE, 2016. +O'Hagan, A. Bayes-hermite quadrature. Journal of statistical planning and inference, 29(3):245-260, 1991. +Oliveira, R., Ott, L., and Ramos, F. Bayesian optimisation under uncertain inputs. In The 22nd International Conference on Artificial Intelligence and Statistics, pp. 1177-1184. PMLR, 2019. +O'Hagan, A. Uncertainty analysis: the variance of the variance. Managing Uncertainty in Complex Models, Research Councils UK, Swindon, UK. http://www.mucm.ac.uk/Pages/Downloads/Technical%20Reports/10-12%20AOH% 20UVarVar, 200611, 2011. +Papoulis, A. and Pillai, S. Probability, Random Variables, and Stochastic Processes. McGraw-Hill series in electrical engineering: Communications and signal processing. McGraw-Hill, 2002. ISBN 9780070486584. URL https://books.google.be/books?id=g6eUoWolcQMC. +Paria, B., Kandasamy, K., and Póczos, B. A flexible framework for multi-objective bayesian optimization using random scalarizations. In Uncertainty in Artificial Intelligence, pp. 766-776. PMLR, 2020. +Rahimi, A., Recht, B., et al. Random features for large-scale kernel machines. In NIPS, volume 3, pp. 5. CiteSeer, 2007. +Rahimian, H. and Mehrotra, S. Distributionally robust optimization: A review. arXiv preprint arXiv:1908.05659, 2019. +Ramdas, A., Trillos, N. G., and Cuturi, M. On Wasserstein two-sample testing and related families of nonparametric tests. Entropy, 19(2):47, 2017. +Rasmussen, C. E. Gaussian processes in machine learning. In Summer school on machine learning, pp. 63-71. Springer, 2003. + +Rivier, M. and Congedo, P. M. Surrogate-Assisted Bounding-Box Approach Applied to Constrained Multi-Objective Optimisation Under Uncertainty. PhD thesis, Inria Saclay Ile de France, 2018. +Schölkopf, B., Smola, A. J., Bach, F., et al. Learning with kernels: support vector machines, regularization, optimization, and beyond. MIT press, 2002. +Seber, G. A. and Lee, A. J. Linear regression analysis, volume 329. John Wiley & Sons, 2012. +Sessa, P. G., Bogunovic, I., Kamgarpour, M., and Krause, A. Mixed strategies for robust optimization of unknown objectives. In International Conference on Artificial Intelligence and Statistics, pp. 2970-2980. PMLR, 2020. +Shahriari, B., Swersky, K., Wang, Z., Adams, R. P., and De Freitas, N. Taking the human out of the loop: A review of bayesian optimization. Proceedings of the IEEE, 104 (1):148-175, 2015. +Simpson, F., Lalchand, V., and Rasmussen, C. E. Marginalised gaussian processes with nested sampling. arXiv preprint arXiv:2010.16344, 2020. +Stein, M. L. Interpolation of spatial data: some theory for kriging. Springer Science & Business Media, 1999. +Suzuki, S., Takeno, S., Tamura, T., Shitara, K., and Karasuyama, M. Multi-objective bayesian optimization using pareto-frontier entropy. In International Conference on Machine Learning, pp. 9279-9288. PMLR, 2020. +Tang, Z. and Périaux, J. Uncertainty based robust optimization method for drag minimization problems in aerodynamics. Computer methods in applied mechanics and engineering, 217:12-24, 2012. +Torossian, L., Picheny, V., and Durrande, N. Bayesian quantile and expectile optimisation. arXiv preprint arXiv:2001.04833, 2020. +Wang, H., Yuan, J., and Ng, S. H. Gaussian process based optimization algorithms with input uncertainty. IISE Transactions, 52(4):377-393, 2020a. +Wang, J., Clark, S. C., Liu, E., and Frazier, P. I. Parallel bayesian global optimization of expensive functions. Operations Research, 68(6):1850-1865, 2020b. +Wang, Z. and Jegelka, S. Max-value entropy search for efficient bayesian optimization. In International Conference on Machine Learning (ICML), 2017. +Wang, Z., Gehring, C., Kohli, P., and Jegelka, S. Batched large-scale bayesian optimization in high-dimensional spaces. In International Conference on Artificial Intelligence and Statistics, pp. 745-754. PMLR, 2018. + +Wauters, J., Couckuyt, I., Knudde, N., Dhaene, T., and Degroote, J. Multi-objective optimization of a wing fence on an unmanned aerial vehicle using surrogate-derived gradients. Structural and Multidisciplinary Optimization, 61(1):353-364, 2020. +Weichert, D. and Kister, A. Bayesian optimization for min max optimization. arXiv preprint arXiv:2107.13772, 2021. +Wilson, J., Borovitskiy, V., Terenin, A., Mostowsky, P., and Deisenroth, M. Efficiently sampling functions from gaussian process posteriors. In International Conference on Machine Learning, pp. 10292-10302. PMLR, 2020. +Wilson, J. T., Hutter, F., and Deisenroth, M. P. Maximizing acquisition functions for bayesian optimization. arXiv preprint arXiv:1805.10196, 2018. +Wu, X., Marshall, L., and Sharma, A. Quantifying input error in hydrologic modeling using the bayesian error analysis with reordering (bear) approach. Journal of Hydrology, 598:126202, 2021. +Yang, J., Sindhwani, V., Avron, H., and Mahoney, M. Quasimonte carlo feature maps for shift-invariant kernels. In International Conference on Machine Learning, pp. 485-493. PMLR, 2014. + +# Appendix Contents + +A The Moments of the Spectral Robustness Measures 13 + +A.1 Deriving the First Moments 13 +A.2 Second Moments 14 + +B Proof of Proposition. 3.4 14 +C Spectral Robustness Measures based on Random Fourier Features 15 + +C.1 Derivation for Normal Distributed Input Uncertainty 15 +C.2 Derivation for Uniform Distributed Input Uncertainty 16 + +D Spectral Robustness Measures based on Quadrature Fourier Features 17 + +D.1 Quadrature Fourier Feature based Robustness Measure 17 +D.2 Derivation for Normal Distributed Input Uncertainty 19 +D.3 Derivation for Uniform Distributed Input Uncertainty 20 + +E Spectral Robustness Measures Supporting Continuous Environmental Variable 21 +F Computational Complexity 21 +G Batch Query Support for the Acquisition Functions 22 + +H Additional Experiments 22 + +H.1 Comparison of the First Moments of the Robustness Measures 22 +H.2 Overview of the Acquisition Functions for Comparison 23 +H.3 Experimental Setup for the Robust Bayesian Optimization 23 +H.4 Details of the Conceptual Low Drag Wing Design Problem 24 +H.5 Results for Uniform Distributed Input Uncertainty 25 + +# A. The Moments of the Spectral Robustness Measures + +# A.1. Deriving the First Moments + +Lemma A.1. Let $\pmb{x} \sim \mathcal{N}(\pmb{\mu}, \Sigma) \in \mathbb{R}^d$ , let $\pmb{A} \in \mathbb{R}^{d \times d}$ is a symmetric matrix, one have $\mathbb{E}\left[\pmb{x}^T\pmb{A}\pmb{x}\right] = \pmb{\mu}^T\pmb{A}\pmb{\mu} + \mathrm{tr}(\pmb{A}\Sigma)$ . + +Proof see Theorem 1.5 of Seber & Lee (2012). + +Now we begin the proof of Theorem 3.3: + +Proof. + +$$ +\begin{array}{l} \mathbb {E} _ {\boldsymbol {\theta}} \left[ \boldsymbol {\theta} ^ {T} \mathbb {E} _ {\boldsymbol {\xi}} \left[ \phi (\boldsymbol {x} + \boldsymbol {\xi}) \phi (\boldsymbol {x} + \boldsymbol {\xi}) ^ {T} \right] \boldsymbol {\theta} - \left[ \mathbb {E} _ {\boldsymbol {\xi}} \left[ \phi (\boldsymbol {x} + \boldsymbol {\xi}) ^ {T} \right] \boldsymbol {\theta} \right] ^ {2} \right] \tag {16} \\ = \mathbb {E} _ {\boldsymbol {\theta}} \left[ \boldsymbol {\theta} ^ {T} \mathbb {E} _ {\boldsymbol {\xi}} \left[ \phi (\boldsymbol {x} + \boldsymbol {\xi}) \phi (\boldsymbol {x} + \boldsymbol {\xi}) ^ {T} \right] \boldsymbol {\theta} \right] - \mathbb {E} _ {\boldsymbol {\theta}} \left[ \left[ \mathbb {E} _ {\boldsymbol {\xi}} \left[ \phi (\boldsymbol {x} + \boldsymbol {\xi}) ^ {T} \right] \boldsymbol {\theta} \right] ^ {2} \right] \\ \end{array} +$$ + +The first part is a quadratic form of $\theta$ , with Lemma A.1 its expectation can hence be written as: + +$$ +\mathbb {E} _ {\boldsymbol {\theta}} \left[ \boldsymbol {\theta} ^ {T} \mathbb {E} _ {\boldsymbol {\xi}} \left[ \phi (\boldsymbol {x} + \boldsymbol {\xi}) \phi (\boldsymbol {x} + \boldsymbol {\xi}) ^ {T} \right] \boldsymbol {\theta} \right] = \operatorname {t r} \left(\mathbb {E} _ {\boldsymbol {\xi}} \left[ \phi (\boldsymbol {x} + \boldsymbol {\xi}) \phi (\boldsymbol {x} + \boldsymbol {\xi}) ^ {T} \right] \Sigma_ {\boldsymbol {\theta}}\right) + \boldsymbol {\mu} _ {\boldsymbol {\theta}} ^ {T} \mathbb {E} _ {\boldsymbol {\xi}} \left[ \phi (\boldsymbol {x} + \boldsymbol {\xi}) \phi (\boldsymbol {x} + \boldsymbol {\xi}) ^ {T} \right] \boldsymbol {\mu} _ {\boldsymbol {\theta}} +$$ + +For the second term, since $\mathbb{E}_{\pmb{\xi}}[\phi (\pmb {x} + \pmb {\xi})^T ]\pmb {\theta}\sim \mathcal{N}\left(\mathbb{E}_{\pmb{\xi}}[\phi (\pmb {x} + \pmb {\xi})^T ]\pmb {\mu}_{\pmb{\theta}},\mathbb{E}_{\pmb{\xi}}[\phi (\pmb {x} + \pmb {\xi})^T ]\Sigma_{\pmb{\theta}}\mathbb{E}_{\pmb{\xi}}[\phi (\pmb {x} + \pmb {\xi})]\right)$ , with the same lemma it is: + +$$ +\mathbb {E} _ {\boldsymbol {\theta}} \left[ \left[ \mathbb {E} _ {\boldsymbol {\xi}} \left[ \phi (\boldsymbol {x} + \boldsymbol {\xi}) ^ {T} \right] \boldsymbol {\theta} \right] ^ {2} \right] = \left[ \mathbb {E} _ {\boldsymbol {\xi}} \left[ \phi (\boldsymbol {x} + \boldsymbol {\xi}) ^ {T} \right] \boldsymbol {\mu} _ {\boldsymbol {\theta}} \right] ^ {2} + \operatorname {t r} \left(\mathbb {E} _ {\boldsymbol {\xi}} \left[ \phi (\boldsymbol {x} + \boldsymbol {\xi}) ^ {T} \right] \boldsymbol {\Sigma} _ {\boldsymbol {\theta}} \mathbb {E} _ {\boldsymbol {\xi}} \left[ \phi (\boldsymbol {x} + \boldsymbol {\xi}) \right]\right) \tag {18} +$$ + +Hence the proof complete. + +# A.2. Second Moments + +The second moments for both robustness measures are provided through the following theorem. + +Theorem A.2. Given $\mathcal{GP}(f)\approx \phi (\pmb {x})^T\pmb{\theta}$ , where $\pmb {\theta}\sim \mathcal{N}(\pmb {\mu}_{\pmb{\theta}},\Sigma_{\pmb{\theta}})$ , the second moments of the robustness measures are: + +$$ +\mathbb {V} _ {\boldsymbol {\theta}} \left[ \tilde {\mathbb {J}} (f) \right] = \mathbb {E} _ {\boldsymbol {\xi}} \left[ \phi (\boldsymbol {x} + \boldsymbol {\xi}) ^ {T} \right] \Sigma_ {\boldsymbol {\theta}} \mathbb {E} _ {\boldsymbol {\xi}} \left[ \phi (\boldsymbol {x} + \boldsymbol {\xi}) \right] \tag {19} +$$ + +$$ +\begin{array}{l} \mathbb {V} _ {\pmb {\theta}} [ \tilde {\mathbb {V}} (f) ] = \mathbb {V} _ {\pmb {\theta}} \left[ \pmb {\theta} ^ {T} \mathbb {E} _ {\pmb {\xi}} [ \phi (\pmb {x} + \pmb {\xi}) \phi (\pmb {x} + \pmb {\xi}) ^ {T} ] \pmb {\theta} - \pmb {\theta} ^ {T} \mathbb {E} _ {\pmb {\xi}} [ \phi (\pmb {x} + \pmb {\xi}) ] \mathbb {E} _ {\pmb {\xi}} [ \phi (\pmb {x} + \pmb {\xi}) ^ {T} ] \pmb {\theta} \right] \\ = 2 \operatorname {t r} \left[ \Lambda_ {1} \Sigma_ {\boldsymbol {\theta}} \Lambda_ {1} \Sigma_ {\boldsymbol {\theta}} \right] + 4 \boldsymbol {\mu} _ {\boldsymbol {\theta}} ^ {T} \Lambda_ {1} \Sigma_ {\boldsymbol {\theta}} \Lambda_ {1} \boldsymbol {\mu} _ {\boldsymbol {\theta}} + 2 \operatorname {t r} \left[ \Lambda_ {2} \Sigma_ {\boldsymbol {\theta}} \Lambda_ {2} \Sigma_ {\boldsymbol {\theta}} \right] + 4 \boldsymbol {\mu} _ {\boldsymbol {\theta}} ^ {T} \Lambda_ {2} \Sigma_ {\boldsymbol {\theta}} \Lambda_ {2} \boldsymbol {\mu} _ {\boldsymbol {\theta}} - \tag {20} \\ 4 \operatorname {t r} \left[ \Lambda_ {1} \Sigma_ {\boldsymbol {\theta}} \Lambda_ {2} \Sigma_ {\boldsymbol {\theta}} \right] - 8 \boldsymbol {\mu} _ {\boldsymbol {\theta}} ^ {T} \Lambda_ {1} \Sigma_ {\boldsymbol {\theta}} \Lambda_ {2} \boldsymbol {\mu} _ {\boldsymbol {\theta}} \\ \end{array} +$$ + +where $\Lambda_1 \coloneqq \mathbb{E}_{\pmb{\xi}}[\phi(\pmb{x} + \pmb{\xi})\phi(\pmb{x} + \pmb{\xi})^T]$ , $\Lambda_2 \coloneqq \mathbb{E}_{\pmb{\xi}}[\phi(\pmb{x} + \pmb{\xi})]\mathbb{E}_{\pmb{\xi}}[\phi(\pmb{x} + \pmb{\xi})^T]$ . + +We remark the second moment of the variance measure (Eq. 20) is calculated as the variance of difference of two quadrature forms with respect to random variable $\theta$ , which is known to have an analytical form (see e.g., Theorem 10.9.11 of Graybill (1983)). + +# B. Proof of Proposition. 3.4 + +Lemma B.1. For any Bayesian linear regression model: $f = \phi^T(\pmb{x})\pmb{\theta}$ , $\phi \in \mathbb{R}^{N_f}$ , $N_f \in N^+$ , if $\pmb{\theta} \sim \mathcal{N}(\mu_{\pmb{\theta}}, \Sigma_{\pmb{\theta}})$ . Define its mean function as $\mu = \phi^T(\pmb{x})\pmb{\mu}_{\pmb{\theta}}$ and for random variable $\pmb{\xi}$ we have $\mathbb{E}_{\pmb{\theta}}\left[\mathbb{V}_{\pmb{\xi}}(f(\pmb{x} + \pmb{\xi}))\right] \geq \mathbb{V}_{\pmb{\xi}}(\mu(\pmb{x} + \pmb{\xi}))$ . + +Proof. + +$$ +\begin{array}{l} \mathbb {E} _ {\boldsymbol {\theta}} \left[ \mathbb {V} _ {\boldsymbol {\xi}} (f (\boldsymbol {x} + \boldsymbol {\xi})) \right] - \mathbb {V} _ {\boldsymbol {\xi}} (\mu (\boldsymbol {x} + \boldsymbol {\xi})) \\ = \boldsymbol {\mu} _ {\boldsymbol {\theta}} ^ {T} \mathbb {E} _ {\boldsymbol {\xi}} \left[ \phi (\boldsymbol {\xi}) \phi (\boldsymbol {x} + \boldsymbol {\xi}) ^ {T} \right] \boldsymbol {\mu} _ {\boldsymbol {\theta}} - \left[ \mathbb {E} _ {\boldsymbol {\xi}} \left[ \phi (\boldsymbol {x} + \boldsymbol {\xi}) ^ {T} \right] \boldsymbol {\mu} _ {\boldsymbol {\theta}} \right] ^ {2} - \left[ \mathbb {E} _ {\boldsymbol {\xi}} \left[ \mu^ {2} \right] - \mathbb {E} _ {\boldsymbol {\xi}} \left[ \mu \right] ^ {2} \right] \\ \left. \right. + \left[ \operatorname {t r} \left(\mathbb {E} _ {\boldsymbol {\xi}} \left[ \phi (\boldsymbol {x} + \boldsymbol {\xi}) \phi (\boldsymbol {x} + \boldsymbol {\xi}) ^ {T} \right] \Sigma_ {\boldsymbol {\theta}}\right) - \operatorname {t r} \left(\mathbb {E} _ {\boldsymbol {\xi}} \left[ \phi (\boldsymbol {x} + \boldsymbol {\xi}) ^ {T} \right] \Sigma_ {\boldsymbol {\theta}} \mathbb {E} _ {\boldsymbol {\xi}} \left[ \phi (\boldsymbol {x} + \boldsymbol {\xi}) \right]\right)\right] \tag {21} \\ = \left[ \operatorname {t r} \left(\mathbb {E} _ {\boldsymbol {\xi}} \left[ \phi (\boldsymbol {x} + \boldsymbol {\xi}) \phi (\boldsymbol {x} + \boldsymbol {\xi}) ^ {T} \right] \Sigma_ {\boldsymbol {\theta}}\right) - \operatorname {t r} \left(\mathbb {E} _ {\boldsymbol {\xi}} \left[ \phi (\boldsymbol {x} + \boldsymbol {\xi}) ^ {T} \right] \Sigma_ {\boldsymbol {\theta}} \mathbb {E} _ {\boldsymbol {\xi}} \left[ \phi (\boldsymbol {x} + \boldsymbol {\xi}) \right]\right) \right] \\ = \operatorname {t r} \left(\left[ \mathbb {E} _ {\boldsymbol {\xi}} [ \phi (\boldsymbol {x} + \boldsymbol {\xi}) \phi (\boldsymbol {x} + \boldsymbol {\xi}) ^ {T} ] - \mathbb {E} _ {\boldsymbol {\xi}} [ \phi (\boldsymbol {x} + \boldsymbol {\xi}) ] \mathbb {E} _ {\boldsymbol {\xi}} [ \phi (\boldsymbol {x} + \boldsymbol {\xi}) ^ {T} ] \right] \Sigma_ {\boldsymbol {\theta}}\right) \\ \end{array} +$$ + +Define $Z \in \mathbb{R}^{N_f}$ , and $\lambda = Z^T\phi(\pmb{x} + \pmb{\xi})$ . Then we have, + +$$ +\begin{array}{l} \mathbb {V} _ {\boldsymbol {\xi}} [ \lambda ] = \underset {T _ {1} - T _ {2}} {\mathbb {E} _ {\boldsymbol {\xi}}} \left[ \left(Z ^ {T} \phi (\boldsymbol {x} + \boldsymbol {\xi})\right) ^ {2} \right] - \left[ \underset {T _ {3} - T _ {4}} {\mathbb {E} _ {\boldsymbol {\xi}}} \left[ \left(Z ^ {T} \phi (\boldsymbol {x} + \boldsymbol {\xi})\right) \right] \right] ^ {2} \tag {22} \\ = Z ^ {T} \mathbb {E} _ {\boldsymbol {\xi}} \left[ \phi (\boldsymbol {x} + \boldsymbol {\xi}) \phi (\boldsymbol {x} + \boldsymbol {\xi}) ^ {T} \right] Z - Z ^ {T} \mathbb {E} _ {\boldsymbol {\xi}} \left[ \phi (\boldsymbol {x} + \boldsymbol {\xi}) \right] \mathbb {E} _ {\boldsymbol {\xi}} \left[ \phi (\boldsymbol {x} + \boldsymbol {\xi}) \right] ^ {T} Z \\ \end{array} +$$ + +By substituting $Z = \mathbf{1}$ , Eq. 21 results in $\operatorname{tr}\left(\mathbb{V}_{\boldsymbol{\xi}}[\lambda]\operatorname{tr}(\Sigma_{\boldsymbol{\theta}})\right)$ , hence the prove complete. We remark the equality can only be achieved when all the entries of $\phi$ are constant, which is not the case for almost all the realistic Bayesian linear models. + +This also leads to the proof of proposition. 3.4. As the first line of r.h.s. of Eq. 21 is zero when $N_{f} \to \infty$ , The remaining proof is the same as above. + +# C. Spectral Robustness Measures based on Random Fourier Features + +# C.1. Derivation for Normal Distributed Input Uncertainty + +Lemma C.1. Given $\xi \sim \mathcal{N}(\pmb{\mu},\Sigma),\pmb{\xi}\in \mathbb{R}^{D},C\in \mathbb{R}$ , the following expression holds: + +$$ +\mathbb {E} _ {\boldsymbol {\xi}} \left[ \sin \left(\boldsymbol {t} ^ {T} \boldsymbol {\xi} + C\right) \right] = \left[ \sin (\boldsymbol {\mu} t) \cos (C) + \cos (\boldsymbol {\mu} t) \sin (C) \right] e ^ {- \frac {1}{2} \boldsymbol {t} ^ {T} \boldsymbol {\Sigma} \boldsymbol {t}} \tag {23} +$$ + +$$ +\mathbb {E} _ {\boldsymbol {\xi}} \left[ \cos (\boldsymbol {t} ^ {T} \boldsymbol {\xi} + C) \right] = \left[ \cos (\boldsymbol {\mu} \boldsymbol {t}) \cos (C) - \sin (\boldsymbol {\mu} \boldsymbol {t}) \sin (C) \right] e ^ {- \frac {1}{2} \boldsymbol {t} ^ {T} \boldsymbol {\Sigma} \boldsymbol {t}} \tag {24} +$$ + +where $\pmb {t}\in \mathbb{R}^D$ + +Proof. Recall that $\mathbb{E}[e^{it^T\pmb{\xi}}] = \mathbb{E}_{\pmb{\xi}}[\cos (\pmb{t}^T\pmb {\xi})] + i\mathbb{E}_{\pmb{\xi}}[\sin (\pmb{t}^T\pmb {\xi})]$ , and that the characteristic function of $\pmb{\xi}$ is $\varphi (\pmb {\xi}) = \mathbb{E}_{\pmb{\xi}}[e^{it^T\pmb{\xi}}] = e^{it^T\pmb {\mu} - \frac{1}{2} t^T\Sigma t}$ , we have: + +$$ +\begin{array}{l} \mathbb {E} _ {\boldsymbol {\xi}} \left[ e ^ {i \boldsymbol {t} ^ {T} \boldsymbol {\xi}} \right] = e ^ {i \boldsymbol {t} ^ {T} \boldsymbol {\mu} - \frac {1}{2} \boldsymbol {t} ^ {T} \Sigma \boldsymbol {t}} \\ = \cos (\boldsymbol {t} ^ {T} \boldsymbol {\xi}) e ^ {- \frac {1}{2} \boldsymbol {t} ^ {T} \Sigma \boldsymbol {t}} + i \sin (\boldsymbol {t} ^ {T} \boldsymbol {\xi}) e ^ {- \frac {1}{2} \boldsymbol {t} ^ {T} \Sigma \boldsymbol {t}} \tag {25} \\ = \mathbb {E} _ {\boldsymbol {\xi}} \left[ \cos \left(\boldsymbol {t} ^ {T} \boldsymbol {\xi}\right) \right] + i \mathbb {E} _ {\boldsymbol {\xi}} \left[ \sin \left(\boldsymbol {t} ^ {T} \boldsymbol {\xi}\right) \right] \\ \end{array} +$$ + +then the proof can be finished by using the sum of angle identity. + +![](images/493480d14e7d38424a28b39d2917b3acc03804d486fd5c731485b5bd05564fd7.jpg) + +Now we are able to give the main expression for RFF-Mean and RFF-Variance when $\xi$ is normal distributed: + +$$ +\mathbb {E} _ {\boldsymbol {\xi}} \left[ \phi_ {m} \left(\boldsymbol {x} + \boldsymbol {\xi}\right) ^ {T} \right] = \sqrt {\frac {2 \sigma^ {2}}{N _ {f}}} \mathbb {E} _ {\boldsymbol {\xi}} \left[ \cos \left(\omega_ {m} ^ {T} L \boldsymbol {\xi} + \omega_ {m} ^ {T} L \boldsymbol {x} + b _ {m}\right) \right] \tag {26} +$$ + +With Lemma. C.1, we have: + +$$ +\mathbb {E} _ {\boldsymbol {\xi}} \left[ \phi_ {m} (\boldsymbol {x} + \boldsymbol {\xi}) ^ {T} \right] = \sqrt {\frac {2 \sigma^ {2}}{N _ {f}}} \cos \left(\boldsymbol {\omega} _ {m} ^ {T} L \boldsymbol {x} + b _ {m}\right) e ^ {- \frac {1}{2} \boldsymbol {\omega} _ {m} ^ {T} L \boldsymbol {\Sigma} L ^ {T} \boldsymbol {\omega} _ {m}} \tag {27} +$$ + +We now derive the first part of the variance expression in Eq. 8. For any $m, n$ element of the feature function, its expectation with respect to input uncertainty can be calculated using the product-to-sum rule as: + +$$ +\begin{array}{l} \mathbb {E} _ {\boldsymbol {\xi}} \left[ \phi_ {m} (\boldsymbol {x} + \boldsymbol {\xi}) \phi_ {n} (\boldsymbol {x} + \boldsymbol {\xi}) \right] \\ = \frac {2 \sigma^ {2}}{N _ {f}} \mathbb {E} _ {\pmb {\xi}} [ \cos (\pmb {\omega} _ {m} ^ {T} L \pmb {\xi} + \pmb {\omega} _ {m} ^ {T} L \pmb {x} + b _ {m}) \cos (\pmb {\omega} _ {n} ^ {T} L \pmb {\xi} + \pmb {\omega} _ {n} ^ {T} L \pmb {x} + b _ {n}) ] \\ = \frac {\sigma^ {2}}{N _ {f}} \mathbb {E} _ {\boldsymbol {\xi}} \left[ \cos \left(\left(\boldsymbol {\omega} _ {m} ^ {T} + \boldsymbol {\omega} _ {n} ^ {T}\right) L \boldsymbol {\xi} + \left(\boldsymbol {\omega} _ {m} ^ {T} + \boldsymbol {\omega} _ {n} ^ {T}\right) L \boldsymbol {x} + \left(b _ {m} + b _ {n}\right)\right) \right] + \\ \frac {\sigma^ {2}}{N _ {f}} \mathbb {E} _ {\boldsymbol {\xi}} \left[ \cos \left(\left(\boldsymbol {\omega} _ {m} ^ {T} - \boldsymbol {\omega} _ {n} ^ {T}\right) L \boldsymbol {\xi} + \left(\boldsymbol {\omega} _ {m} ^ {T} - \boldsymbol {\omega} _ {n} ^ {T}\right) L \boldsymbol {x} + \left(b _ {m} - b _ {n}\right)\right) \right] \tag {28} \\ = \frac {\sigma^ {2}}{N _ {f}} \cos [ (\boldsymbol {\omega} _ {m} ^ {T} + \boldsymbol {\omega} _ {n} ^ {T}) L \boldsymbol {x} + (b _ {m} + b _ {n}) ] e ^ {- \frac {1}{2} (\boldsymbol {\omega} _ {m} ^ {T} + \boldsymbol {\omega} _ {n} ^ {T}) L \Sigma L ^ {T} (\boldsymbol {\omega} _ {m} + \boldsymbol {\omega} _ {m})} + \\ \frac {\sigma^ {2}}{N _ {f}} \cos [ (\pmb {\omega} _ {m} ^ {T} - \pmb {\omega} _ {n} ^ {T}) L \pmb {x} + (b _ {m} - b _ {n}) ] e ^ {- \frac {1}{2} (\pmb {\omega} _ {m} ^ {T} - \pmb {\omega} _ {n} ^ {T}) L \Sigma L ^ {T} (\pmb {\omega} _ {m} - \pmb {\omega} _ {m})} \\ \end{array} +$$ + +# C.2. Derivation for Uniform Distributed Input Uncertainty + +We derive the analytical expression of expectation through Fourier feature mapping under uniform uncertainty. As each of the input dimensionality is independent, we perform the integration in each dimension separately using the same derivation trick of (Fröhlich et al., 2020): + +$$ +\begin{array}{l} \mathbb {E} _ {\boldsymbol {\xi}} \big [ \phi_ {m} \big (\boldsymbol {x} + \boldsymbol {\xi} \big) ^ {T} \big ] \\ = \mathbb {E} _ {\boldsymbol {\xi} _ {\neg d}} \mathbb {E} _ {\boldsymbol {\xi} _ {d}} \left[ \cos \left(\left(\boldsymbol {\omega} _ {m} ^ {T} L\right) _ {d} \left(\boldsymbol {x} _ {d} + \boldsymbol {\xi} _ {d}\right) + \underbrace {\left(\boldsymbol {\omega} _ {m} ^ {T} L\right) _ {\neg d} \boldsymbol {x} _ {\neg d} + b _ {m}} _ {c _ {d}}\right) \right] \tag {29} \\ \end{array} +$$ + +where $d$ represents the $d$ th input dimensionality and $\neg d$ is its complement. Note that the inner expectation is a cross-correlation between $\phi$ and the complex conjugate of $\pmb{\xi}_d$ 's probability density function $p: (\overline{p} \star \phi_d)(\pmb{x}_d)$ . As the conjugate of $p$ is itself, the integral can be calculated with the property of cross-correlation (Kapinchev et al., 2015): + +$$ +\begin{array}{l} (p \star \phi_ {m, d}) (\boldsymbol {x} _ {d}) = \mathcal {F} ^ {- 1} \left\{\mathcal {F} \left(\overline {{p (- \boldsymbol {\xi} _ {d})}}\right) \cdot \mathcal {F} \left(\phi_ {m, d}\right) \right\} \tag {30} \\ = \mathcal {F} ^ {- 1} \left\{\mathcal {F} (p) \cdot \mathcal {F} \left(\phi_ {m, d}\right) \right\} \\ \end{array} +$$ + +where $\mathcal{F}$ represents a Fourier transformation and $\mathcal{F}^{-1}$ is its inverse. + +The standard Fourier transformation (i.e., $\int f(t)e^{-j\omega t}dt$ ) of a uniform distribution: $u \sim [\delta_{l_d}, \delta_{\pmb{u}_d}]$ , by assuming the distribution is symmetric (i.e., $\delta_{\pmb{u}_d} = -\delta_{l_d} \coloneqq \delta_d$ ), can be given as: + +$$ +\mathcal {F} \left(\frac {1}{2 \delta_ {d}}\right) = \frac {\sin (\omega \delta_ {d})}{\omega \delta_ {d}} \tag {31} +$$ + +For convenience, the standard Fourier transform of $\phi$ is provided here as well: + +$$ +\begin{array}{l} \mathcal {F} (\phi_ {m, d}) \\ = \sqrt {\frac {2 \sigma^ {2}}{N _ {f}}} \mathcal {F} (\cos ((\omega_ {m, d} L _ {d, d}) \pmb {x} _ {d} + c _ {d})) \\ = \sqrt {\frac {2 \sigma^ {2}}{N _ {f}}} \int \frac {e ^ {j c _ {d}} e ^ {j \left(\omega_ {m , d} L _ {d , d} \boldsymbol {x} _ {d}\right)} + e ^ {- j c _ {d}} e ^ {- j \left(\omega_ {m , d} L _ {d , d} \boldsymbol {x} _ {d}\right)}}{2} e ^ {- j \omega \boldsymbol {x} _ {d}} \boldsymbol {x} _ {d} \tag {32} \\ = \sqrt {\frac {2 \sigma^ {2}}{N _ {f}}} \pi \left(e ^ {j c _ {d}} \delta (\omega - \omega_ {m, d} L _ {d, d}) + e ^ {- j c _ {d}} \delta (\omega + \omega_ {m, d} L _ {d, d})\right) \\ \end{array} +$$ + +Finally, multiplying Eq. 31 and Eq. 32 and applying the inverse Fourier transformation leads to: + +$$ +\begin{array}{l} \int \mathcal {F} \left(\frac {1}{2 \delta_ {d}}\right) \cdot \mathcal {F} \left(\phi_ {m, d}\right) e x p (j \omega x _ {d}) d \omega \\ = \frac {1}{2 \pi} \int \sqrt {\frac {2 \sigma^ {2}}{N _ {f}}} \pi \left(e ^ {j c _ {d}} \delta (\omega - \omega_ {m, d} L _ {d, d}) + e ^ {- j c _ {d}} \delta (\omega + \omega_ {m, d} L _ {d, d})\right) \frac {\sin (\omega \delta_ {d})}{\omega \delta_ {d}} e ^ {j \omega x _ {d}} d \omega \\ = \sqrt {\frac {2 \sigma^ {2}}{N _ {f}}} \frac {\sin \omega_ {m , d} L _ {d , d} \delta_ {d}}{\omega_ {m , d} L _ {d , d} \delta_ {d}} \frac {1}{2} \left[ e ^ {(j (\omega_ {m, d} L _ {d, d} x _ {d} + c _ {d}))} + e ^ {(- j (\omega_ {m, d} L _ {d, d} x _ {d} + c _ {d}))} \right] \tag {33} \\ = \frac {\sin \omega_ {m , d} L _ {d , d} \delta_ {d}}{\omega_ {m , d} L _ {d , d} \delta_ {d}} \sqrt {\frac {2 \sigma^ {2}}{N _ {f}}} \cos (\omega_ {m, d} L _ {d, d} x _ {d} + c _ {d}) \\ = \frac {\sin \omega_ {m , d} L _ {d , d} \delta_ {d}}{\omega_ {m , d} L _ {d , d} \delta_ {d}} \phi_ {m, d} \\ \end{array} +$$ + +extending to an arbitrary input dimensionality $D$ , this leads to: + +$$ +\mathbb {E} _ {\boldsymbol {\xi}} \left[ \phi_ {m} \left(\boldsymbol {x} + \boldsymbol {\xi}\right) ^ {T} \right] = \phi_ {m} (\boldsymbol {x}) \prod_ {d = 1} ^ {D} \frac {\sin \left(\omega_ {m , d} L _ {d , d} \delta_ {d}\right)}{\omega_ {m , d} L _ {d , d} \delta_ {d}} = \phi_ {m} \frac {\sin \left(\omega_ {m} L \boldsymbol {\delta}\right)}{\omega_ {m} L \boldsymbol {\delta}} \tag {34} +$$ + +Similarly, we can calculate the following integration when $\xi$ is uniformly distributed: + +$$ +\begin{array}{l} \mathbb {E} _ {\boldsymbol {\xi}} \left[ \phi_ {m} (\boldsymbol {x} + \boldsymbol {\xi}) \phi_ {n} (\boldsymbol {x} + \boldsymbol {\xi}) \right] \\ = \frac {2 \sigma^ {2}}{N _ {f}} \mathbb {E} _ {\boldsymbol {\xi}} \left[ \cos \left(\boldsymbol {\omega} _ {m} ^ {T} L \boldsymbol {\xi} + \boldsymbol {\omega} _ {m} ^ {T} L \boldsymbol {x} + b _ {m}\right) \cos \left(\boldsymbol {\omega} _ {n} ^ {T} L \boldsymbol {\xi} + \boldsymbol {\omega} _ {n} ^ {T} L \boldsymbol {x} + b _ {n}\right) \right] \\ = \frac {\sigma^ {2}}{N _ {f}} \mathbb {E} _ {\pmb {\xi}} [ \cos ((\pmb {\omega} _ {m} ^ {T} + \pmb {\omega} _ {n} ^ {T}) L \pmb {\xi} + (\pmb {\omega} _ {m} ^ {T} + \pmb {\omega} _ {n} ^ {T}) L \pmb {x} + (b _ {m} + b _ {n})) ] + \\ \frac {\sigma^ {2}}{N _ {f}} \mathbb {E} _ {\boldsymbol {\xi}} \left[ \cos \left(\left(\boldsymbol {\omega} _ {m} ^ {T} - \boldsymbol {\omega} _ {n} ^ {T}\right) L \boldsymbol {\xi} + \left(\boldsymbol {\omega} _ {m} ^ {T} - \boldsymbol {\omega} _ {n} ^ {T}\right) L \boldsymbol {x} + \left(b _ {m} - b _ {n}\right)\right) \right] \tag {35} \\ = \frac {\sigma^ {2}}{N _ {f}} \cos ((\boldsymbol {\omega} _ {m} ^ {T} - \boldsymbol {\omega} _ {n} ^ {T}) L \boldsymbol {x} + (b _ {m} - b _ {n})) \frac {\sin ((\boldsymbol {\omega} _ {m} ^ {T} - \boldsymbol {\omega} _ {n} ^ {T}) L \boldsymbol {\delta})}{(\boldsymbol {\omega} _ {m} ^ {T} - \boldsymbol {\omega} _ {n} ^ {T}) L \boldsymbol {\delta}} + \\ \frac {\sigma^ {2}}{N _ {f}} \cos ((\pmb {\omega} _ {m} ^ {T} + \pmb {\omega} _ {n} ^ {T}) L \pmb {x} + (b _ {m} + b _ {n})) \frac {\sin ((\pmb {\omega} _ {m} ^ {T} + \pmb {\omega} _ {n} ^ {T}) L \pmb {\delta})}{(\pmb {\omega} _ {m} ^ {T} + \pmb {\omega} _ {n} ^ {T}) L \pmb {\delta}} \\ \end{array} +$$ + +# D. Spectral Robustness Measures based on Quadrature Fourier Features + +# D.1. Quadrature Fourier Feature based Robustness Measure + +Table 2: Expressions of quadrature Fourier features based robustness measures + +
ξ distributionEξ[φ(x+ξ)m](Mean)Eξ[φ(x+ξ)mφ(x+ξ)n]
N(0,Σ)1°m≤Nf:1°m≤Nf,n≤Nf:
σ√∑i=1dvmωmd)cos(ωmTlx)e-1/2ωmTLΣLTωm2Nf< m≤2Nf:σ2/2√∑i=1dvmωmd)v(ωm,d)·cos[(ωmT+ωnT)Lx]·e-1/2(ωm+ωnT)LΣLT(ωm+ωm)+cos[(ωmT-ωnT)Lx]·e-1/2(ωm-TωnT)LΣLT(ωm-ωm)2°Nf< m≤2Nf,n≤Nf:
σ√∑i=1dvmωm-Nf,d)·sin(ωm-TNx)e-1/2ωm-NfTLΣLTωm-Nfσ2/2√∑i=1dvmωm-Nf,d)·v(ωm-Nf,d)·e-1/2(ωm-TωnT)LΣLT(ωm-Nf+ωn)+sin((ωm-T-ωnT)Lx)·e-1/2(ωm-TωnT)-ωnT)LΣLT(ωm-Nf-ωn)3°m≤Nf,Nf< n≤2Nf:
σ2/2√ ∏d i=1 sin((ωm,T + ωn-Tf)Lx)e-1/2(ωm,T+ωn-Tf)LTΣL(ωm+ωn-Tf)+sin((-ωm,T+ωn-Tf)Lx)e-1/2(-ωm,T+ωn-Tf)LΣLT(-ωm+ωn-Tf)4°Nf< m ≤ 2Nf, Nf< n ≤ 2Nf:
σ2/2√ ∏d i=1 v(ωm-Nf,d) v(ωn-Nf,d)·[cos((ωm-Tf-Lx)e-1/2(ωm-Tf-Lx)Lx)-cos((ωm-Tf-Lx)Lx)e-1/2(ωm-Tf+ωn-Tf)LΣLT(ωm-Nf+ωn-Nf)]
U(-δ,δ)1°m< Nf1°m≤ Nf, n≤ Nf:
σ√ ∏d i=1 d v(ωm,d)·cos(ωmTx)Lx/ωmLδσ2/2√ ∏d i=1 v(ωm-Nf,d) v(ωn,d)·[cos((ωm-Tf-Lx)e-1/2(ωm-Tf-Lx)Lx)/ωmLδ]
2°Nf< m ≤ 2Nf:2°m≤ Nf, Nf< n≤ 2Nf:
σ√ ∏d i=1 d v(ωm-Nf,d)·sin(ωm-Tf,Lx)/ωm-NfLδσ2/2√ ∏d i=1 v(ωm-Nf,d) v(ωn,d)·[sin((ωm-Tf-Lx)e-1/2(ωm-Tf-Lx)Lx)/ωmLδ]
sin((ωm-Tf-Lx)e-1/2(ωm-Tf-Lx)Lx)/ωmLδ+sin((ωm-Tf-Lx)e-1/2(ωm-Tf-Lx)Lx)
sin((ωm-Tf-Lx)e-1/2(ωm-Tf-Lx)Lx)/ωmLδ+sin((ωm-Tf-Lx)e-1/2(ωm-Tf-Lx)Lx)
3°Nf< m ≤ 2Nf, n≤ Nf:
+ +
σ2/2√ ∏d i=1 sin((ωm-Nf,d) v(ωn,d))·[
sin((ωTm-Nf+ωn)T)Lx)
sin((ωTm-Nf+ωn)T)Lδ)/(ωTm-Nf+ωn)T)Lδ+
sin((-ωTm-Nf+ωn)T)Lx)·
sin((-ωTm-Nf+ωn)T)Lδ)/(-ωTm-Nf+ωn)T)Lδ]
4°Nf<m≤2Nf,Nf<n≤2Nf:
σ2/2√ ∏d i=1 sin(v(ωm-Nf,d) v(ωn,d))·[
cos((ωTm-Nf-ωn-T)Lx)·
sin((ωTm-Nf-ωn-T)Lδ)/(ωTm-Nf-ωn-T)Lδ-
cos((ωTm-Nf+ωn-T)Lx)
(sin(ωTm-Nf+ωn-T)Lδ)/(ωTm-Nf+ωn-T)Lδ]
+ +# D.2. Derivation for Normal Distributed Input Uncertainty + +To get the mean expression, when $m \leq N_f$ in Eq. 11, the expression from Eq. 27 can be reused: + +$$ +\begin{array}{l} \mathbb {E} _ {\boldsymbol {\xi}} \left[ \phi_ {m} \left(\boldsymbol {x} + \boldsymbol {\xi}\right) ^ {T} \right] = \sigma \sqrt {\prod_ {i = 1} ^ {d} v \left(\omega_ {m , d}\right)} \mathbb {E} _ {\boldsymbol {\xi}} \left[ \cos \left(\omega_ {m} ^ {T} L \boldsymbol {x} + \omega_ {m} ^ {T} L \boldsymbol {\xi}\right) \right] \tag {36} \\ = \sigma \sqrt {\prod_ {i = 1} ^ {d} v (\omega_ {m , d})} \cos (\boldsymbol {\omega} _ {m} ^ {T} L \boldsymbol {x}) e ^ {- \frac {1}{2} \boldsymbol {\omega} _ {m} ^ {T} L \Sigma L ^ {T} \boldsymbol {\omega} _ {m}} \\ \end{array} +$$ + +When $m > N_{f}$ + +$$ +\begin{array}{l} \mathbb {E} _ {\boldsymbol {\xi}} \left[ \phi_ {m} \left(\boldsymbol {x} + \boldsymbol {\xi}\right) ^ {T} \right] = \sigma \sqrt {\prod_ {i = 1} ^ {d} v \left(\omega_ {m - N _ {f} , d}\right)} \mathbb {E} _ {\boldsymbol {\xi}} \left[ \sin \left(\omega_ {m - N _ {f}} ^ {T} L \boldsymbol {x} + \omega_ {m - N _ {f}} ^ {T} L \boldsymbol {\xi}\right) \right] \tag {37} \\ = \sigma \sqrt {\prod_ {i = 1} ^ {d} v (\omega_ {m - N _ {f} , d})} \sin (\omega_ {m - N _ {f}} ^ {T} L \pmb {x}) e ^ {- \frac {1}{2} \pmb {\omega} _ {m - N _ {f}} ^ {T} L \Sigma L ^ {T} \pmb {\omega} _ {m - N _ {f}}} \\ \end{array} +$$ + +For the expectation of $\mathbb{E}_{\pmb{\xi}}[\phi (\pmb {x} + \pmb {\xi})_m\phi (\pmb {x} + \pmb {\xi})_n^T ]$ , when $N_{f} < m\leq 2N_{f}$ and $n\leq N_f$ , we have: + +$$ +\begin{array}{l} \mathbb {E} _ {\boldsymbol {\xi}} \left[ \phi_ {m} (\boldsymbol {x} + \boldsymbol {\xi}) \phi_ {n} (\boldsymbol {x} + \boldsymbol {\xi}) \right] \\ = \sigma^ {2} \sqrt {\prod_ {i = 1} ^ {d} v (\omega_ {m - N _ {f} , d}) v (\omega_ {n , d})} \cdot \mathbb {E} _ {\pmb {\xi}} \left[ \sin (\omega_ {m - N _ {f}} ^ {T} L \pmb {\xi} + \omega_ {m - N _ {f}} ^ {T} L \pmb {x}) \cos (\omega_ {n} ^ {T} L \pmb {\xi} + \omega_ {n} ^ {T} L \pmb {x}) \right] \\ = \frac {\sigma^ {2}}{2} \sqrt {\prod_ {i = 1} ^ {d} v \left(\omega_ {m - N _ {f} , d}\right) v \left(\omega_ {n , d}\right)} \sin \left(\left(\boldsymbol {\omega} _ {m - N _ {f}} ^ {T} + \boldsymbol {\omega} _ {n} ^ {T}\right) L \boldsymbol {x}\right) e ^ {- \frac {1}{2} \left(\boldsymbol {\omega} _ {m - N _ {f}} ^ {T} + \boldsymbol {\omega} _ {n} ^ {T}\right) L \Sigma L ^ {T} \left(\boldsymbol {\omega} _ {m - N _ {f}} + \boldsymbol {\omega} _ {n}\right)} + \tag {38} \\ \frac {\sigma^ {2}}{2} \sqrt {\prod_ {i = 1} ^ {d} v \left(\omega_ {m - N _ {f} , d}\right) v \left(\omega_ {n , d}\right)} \sin \left(\left(\boldsymbol {\omega} _ {m - N _ {f}} ^ {T} - \boldsymbol {\omega} _ {n} ^ {T}\right) L \boldsymbol {x}\right) e ^ {- \frac {1}{2} \left(\boldsymbol {\omega} _ {m - N _ {f}} ^ {T} - \boldsymbol {\omega} _ {n} ^ {T}\right) L \Sigma L ^ {T} \left(\boldsymbol {\omega} _ {m - N _ {f}} - \boldsymbol {\omega} _ {n}\right)} \\ \end{array} +$$ + +The other three conditions can be derived in the same fashion. + +# D.3. Derivation for Uniform Distributed Input Uncertainty + +We need the Fourier transformation of $\cos (\cdot)\sin (\cdot)$ and $\sin (\cdot)\sin^{\prime}(\cdot)$ , $\cos (\cdot)\cos^{\prime}(\cdot)$ . By making use of the product-to-summation rule, we, in fact, only need the Fourier transformation of sin function. Starting from Eq. 36 and Eq. 37: + +$$ +\begin{array}{l} \mathbb {E} _ {\pmb {\xi}} [ \boldsymbol {\phi} _ {m} (\pmb {x} + \pmb {\xi}) ^ {T} ] = \sigma \sqrt {\prod_ {i = 1} ^ {d} v (\omega_ {m , d})} \mathbb {E} _ {\pmb {\xi}} \left[ \cos (\omega_ {m} ^ {T} L \pmb {x} + \omega_ {m} ^ {T} L \pmb {\xi}) \right] \\ = \sigma \sqrt {\prod_ {i = 1} ^ {d} v \left(\omega_ {m , d}\right)} \cos \left(\omega_ {m} ^ {T} L \boldsymbol {x}\right) \mathbb {E} _ {\boldsymbol {\xi}} \left[ \cos \left(\omega_ {m} ^ {T} L \boldsymbol {\xi}\right) \right] \tag {39} \\ = \sigma \sqrt {\prod_ {i = 1} ^ {d} v (\omega_ {m , d})} \cos (\boldsymbol {\omega} _ {m} ^ {T} L \boldsymbol {x}) \frac {\sin (\omega_ {m} L \boldsymbol {\delta})}{\omega_ {m} L \boldsymbol {\delta}} \\ \end{array} +$$ + +When $m > N_{f}$ + +$$ +\mathbb {E} _ {\boldsymbol {\xi}} \left[ \phi_ {m} (\boldsymbol {x} + \boldsymbol {\xi}) ^ {T} \right] = \sigma \sqrt {\prod_ {i = 1} ^ {d} v \left(\omega_ {m - N _ {f} , d}\right)} \sin \left(\omega_ {m - N _ {f}} ^ {T} L \boldsymbol {x}\right) \frac {\sin \left(\omega_ {m} L \boldsymbol {\delta}\right)}{\omega_ {m} L \boldsymbol {\delta}} \tag {40} +$$ + +For the expectation of $\mathbb{E}_{\pmb{\xi}}[\phi (\pmb {x} + \pmb {\xi})_m\phi (\pmb {x} + \pmb {\xi})_n^T ]$ , with $N_{f} < m\leq 2N_{f}$ and $n\leq N_f$ , we have: + +$$ +\begin{array}{l} \mathbb {E} _ {\boldsymbol {\xi}} \left[ \phi_ {m} (\boldsymbol {x} + \boldsymbol {\xi}) \phi_ {n} (\boldsymbol {x} + \boldsymbol {\xi}) \right] \\ = \sigma^ {2} \sqrt {\prod_ {i = 1} ^ {d} v \left(\omega_ {m - N _ {f} , d}\right) v \left(\omega_ {n , d}\right)} \cdot \mathbb {E} _ {\boldsymbol {\xi}} \left[ \sin \left(\omega_ {m - N _ {f}} ^ {T} L \boldsymbol {\xi} + \omega_ {m - N _ {f}} ^ {T} L \boldsymbol {x}\right) \cos \left(\omega_ {n} ^ {T} L \boldsymbol {\xi} + \omega_ {n} ^ {T} L \boldsymbol {x}\right) \right] \\ = \frac {\sigma^ {2}}{2} \sqrt {\prod_ {i = 1} ^ {d} v \left(\omega_ {m - N _ {f} , d}\right) v \left(\omega_ {n , d}\right)} \sin \left(\left(\boldsymbol {\omega} _ {m - N _ {f}} ^ {T} + \boldsymbol {\omega} _ {n} ^ {T}\right) L \boldsymbol {x}\right) \frac {\sin \left(\left(\boldsymbol {\omega} _ {m - N _ {f}} ^ {T} + \boldsymbol {\omega} _ {n} ^ {T}\right) L \boldsymbol {\delta}\right)}{\left(\boldsymbol {\omega} _ {m - N _ {f}} ^ {T} + \boldsymbol {\omega} _ {n} ^ {T}\right) L \boldsymbol {\delta}} + \tag {41} \\ \frac {\sigma^ {2}}{2} \sqrt {\prod_ {i = 1} ^ {d} v (\omega_ {m - N _ {f} , d}) v (\omega_ {n , d})} \sin \left((\boldsymbol {\omega} _ {m - N _ {f}} ^ {T} - \boldsymbol {\omega} _ {n} ^ {T}) L \boldsymbol {x}\right) \frac {\sin \left(\boldsymbol {\omega} _ {m - N _ {f}} ^ {T} - \boldsymbol {\omega} _ {n} ^ {T}\right) L \boldsymbol {\delta}}{(\boldsymbol {\omega} _ {m - N _ {f}} ^ {T} - \boldsymbol {\omega} _ {n} ^ {T}) L \boldsymbol {\delta}} \\ \end{array} +$$ + +The rest of the cases can be obtained in a similar fashion. + +# E. Spectral Robustness Measures Supporting Continuous Environmental Variable + +In real-life applications, another commonly investigated problem is the robustness with respect to environmental variables (e.g., Beland & Nair (2017)). Let $f: \mathcal{X} \times \Gamma \to \mathbb{R}$ , where $\gamma$ represents the environmental variable defined in a bounded space $\Gamma$ . In these kinds of problems, We are interested in the following extended robustness measures: + +$$ +\begin{array}{l} \mathbb {J} _ {\gamma , \xi} (\mathcal {G P} (f)) \approx \tilde {\mathbb {J}} (\mathcal {G P} (f)) | \phi , \theta = \mathbb {E} _ {\gamma , \xi} [ \phi (\gamma , x + \xi) ^ {T} ] \theta \\ \mathbb {V} _ {\gamma , \xi} (\mathcal {G P} (f)) \approx \hat {\mathbb {V}} (\mathcal {G P} (f)) | \phi , \theta \tag {42} \\ = \boldsymbol {\theta} ^ {T} \mathbb {E} _ {\gamma , \boldsymbol {\xi}} [ \phi (\gamma , \boldsymbol {x} + \boldsymbol {\xi}) \phi (\gamma , \boldsymbol {x} + \boldsymbol {\xi}) ^ {T} ] \boldsymbol {\theta} - \left[ \mathbb {E} _ {\gamma , \boldsymbol {\xi}} [ \phi (\gamma , \boldsymbol {x} + \boldsymbol {\xi}) ^ {T} ] \boldsymbol {\theta} \right] ^ {2} \\ \end{array} +$$ + +Assuming we are able query $f(\pmb{x}, \pmb{\gamma})$ exactly, e.g., in a simulating scenario. It turns out that this problem can be regarded as a special case of Eq. 1, where the environmental variable is reformulated as a design variable located at the center of $\Gamma$ with uniform distributed input uncertainty $\xi$ . + +Hence, for RFF based robustness measures, we give their expressions in Table 3. + +Table 3. Expression of the RFF based robustness measures supporting environmental variables + +
γ distributionEγ,ξ[φ(x+ξ,γ)Tm](Mean)Eγ,ξ[φ(x+ξ,γ)mφ(x+ξ,γ)nT]
U(Γl, Γu)√2σ2/Nf cos(ωmxT Lx x + ωmγT Lγ Γ + bm) · sin(ωmγLγδγ + ωmxxLxδx) / (ωmγLγδγ + ωmxxLxδx)∑O∈{+, -} [σ2/Nf cos[(ωmxT Oωnx) Lx x + (ωmγ T Oγnx) Lγ Γ + (bmObn)] · sin[(ωmxT Oωnx) Lγδγ + (ωmxT Oωnx) Lxδx] / (ωmxT Oωnx) Lγδγ + (ωmxT Oωnx) Lxδx
+ +where $\delta_{\gamma} = (\Gamma_u - \Gamma_l) / 2$ , $\overline{\Gamma} = (\Gamma_u + \Gamma_l) / 2$ . We remark the same strategy can be utilized for QFF based robustness measures under environmental uncertainty. + +# F. Computational Complexity + +Table 4. Inference complexity of RFF and QFF based robustness measures. + +
CategoryMethodComputation Cost
Point Estimation (Theorem 3.3)RFF-ER[tildeJ]Nfd
RFF-ER[tildeV]N2fd
QFF-ER[tildeJ]2Nfd
QFF-ER[tildeV]4N2fd
Bayesian InferenceRFF-MeanInit: N3fd, Query: Nfd
QFF-MeanInit: 8N3fd, Query: 2Nfd
RFF-VarianceInit: N3fd, Query: N2fd
QFF-VarianceInit: 8N3fd, Query: 4N2fd
+ +We provide inference complexity on sample trajectories in Table 4. The Initialization cost is the Cholesky decomposition of $\theta$ posterior covariance matrix (i.e., Eq. 4). At this stage, given the same Fourier feature number $N_{f}$ , the QFF based strategies are 8 times more expensive than the corresponding RFF based strategies. For the query stage, the variance inference's complexity for both Fourier features scales quadratic with the number of Fourier features. Besides, we also remark that if + +only utilizing the posterior mean of the robustness measure (i.e., Theorem 3.3), one could avoid the cubic initialization cost. We note a sequential strategy can be used through test data for memory-efficient inference. + +# G. Batch Query Support for the Acquisition Functions + +Parallel computation resources can be available in real-life applications, where a practitioner can be interested in query more than one point per iteration to booster the optimization process. We remark that the joint posterior distribution condition on multiple candidate points is supported in the spectral robustness measure representation. Hence, all of the Fourier feature-based acquisition functions we described can easily be extended in this scenario, that is, one can easily obtain FF-MV-qEHVI, FF-MV-qECI and FF-MV-qEI acquisition functions ( $q$ is commonly given as a representation of acquisition function is supported for batch query, e.g., Daulton et al. (2020); Wang et al. (2020b)). For FF-MV-EHVI, the calculation of $\mathrm{HVI}(\tilde{\mathbb{J}}_i,\tilde{\mathbb{V}}_i,\tilde{\mathcal{F}}_{MV_i}^* |\boldsymbol {\theta}_i,D)$ behaves naturally as the cached box decomposition (Daulton et al., 2021). For FF-MV-ECI and FF-MV-EI, Fourier feature-based posterior supports batch evaluation on the differentiable trajectories, which acts similar to the sample average approximation (Balandat et al., 2019). We leave such an extension and thorough performance assessment as future work. + +# H. Additional Experiments + +# H.1. Comparison of the First Moments of the Robustness Measures + +![](images/17759a9e8a417c55553614d672ed331df7d98c79d27d0fa393ac39cb355031e2.jpg) + +![](images/5c8638dbe709a51c9ce0e4ccd6eb7926f149828fbf6928e17631a8d511c327b0.jpg) + +![](images/a276340a56b20c28f22a4fafaa0dd2083d52763027e151e24d361dfe47e2f7a9.jpg) + +![](images/ba275a8eecf96d6fb6acb7cc49fef574b39ec4e013119f2a9dc928e2ef8616d0.jpg) +Figure 6. Comparison of robustness measure model accuracy through MC in input space vs on spectral density on the first moments $(\mathbb{J},\mathbb{V})$ . Dashed lines represent normal input uncertainty: $\pmb{\xi} \sim \mathcal{N}(\mathbf{0},\sigma I)$ and the solid line rest represents uniform: $\pmb{\xi} \sim U(-1\delta,1\delta)$ . We use {orange, blue, green} to represent {QFF, RFF, MC} respectively. We use $\{\bigcirc, \bigtriangledown, \star\}$ to represent $\sigma = \{0.001,0.005,0.01\}$ for normal and $\delta = \{0.05,0.1,0.2\}$ for uniform uncertainty respectively. + +![](images/c7d7eabaedcca78c7384d05a3249e8f6a0f66d46036f98b0b0b3cd7b16a82267.jpg) + +![](images/292dec246272e7ca6fdcdc6d6ec237d3880744f9c59f139f52b1cd9893bf2aa7.jpg) + +Estimating the robustness measure through MC sampling in the input space on the GP posterior mean is a common non-Bayesian strategy (i.e., a point estimation) used in the robust optimization community (e.g., Rivier & Congedo (2018)). Since we also provide the first moment of robustness measures through Fourier features, we conduct empirical experiments comparing the model accuracy of robustness measures between the two approaches (i.e., we compare how well our approaches approximate $\overline{\mathbb{J}}\coloneqq \mathbb{E}_f[\mathbb{J}(\mathcal{GP}(f))]$ and $\overline{\nabla}\coloneqq \mathbb{E}_f[\mathbb{V}(\mathcal{GP}(f))]$ ). We conduct experiment on synthetic functions (GMM function is from (Nogueira et al., 2016)) ranging from $1 - 3$ input dimensionality. For each synthetic problem, we use $20d$ training data to construct a GP with SE kernel. This number is chosen to avoid either an inaccurate model (i.e., the GP posterior collapses into its prior) or an overconfident model (the model uncertainty vanishes). Then, we compare the modeling error of the robustness measures between MC in the input space and using spectral density (i.e., Fourier feature based approximation). For a fair comparison, we use the same MC sample numbers11. + +The benchmark results are provided in Fig. 6. For each experiment, we calculate the Root-Mean-Squared-Error (RMSE) + +between the approximation and the ground truth extracted from the GP posterior $^{12}$ based on a $20 * 2^{d}$ test sample size. The experiments are conducted for a different number of Fourier features, and each experiment is repeated 64 times for robustness. It can be seen that, especially for the QFF robustness measure, its first moment can reach a better accuracy, provided there are enough MC samples. + +# H.2. Overview of the Acquisition Functions for Comparison + +We provide an overview of the acquisition functions from Iwazaki et al. (2021) in this section. As the second objective $F_{2}$ (Eq. 3 of (Iwazaki et al., 2021)) represents negative standard deviation, we modify it to be the variance to compare in the same setting. As a result, the upper and lower bound for variance can be calculated as: + +$$ +l _ {t} ^ {F _ {2}} (\boldsymbol {x}) = \int \tilde {l} _ {t} ^ {s q} (\boldsymbol {x} + \boldsymbol {\xi}) p (\boldsymbol {\xi}) d \boldsymbol {\xi} \tag {43} +$$ + +$$ +u _ {t} ^ {F _ {2}} (\boldsymbol {x}) = \int \tilde {u} _ {t} ^ {s q} (\boldsymbol {x} + \boldsymbol {\xi}) p (\boldsymbol {\xi}) d \boldsymbol {\xi} \tag {44} +$$ + +where $\tilde{l}_t^{sq},\tilde{u}_t^{sq}$ are defined the same as in (Iwazaki et al., 2021), we use $200\mathrm{MC}$ samples to approximate the integration. As the code is not open-sourced yet, we implement their acquisition function for numerical comparison. + +We remark that at iteration $t$ , one is optimizing the following two-stage acquisition optimization process (see appendix B.2 of (Iwazaki et al., 2021)) and evaluate $f(\tilde{\boldsymbol{x}}_t + \tilde{\boldsymbol{\xi}}_t)$ : + +$$ +\tilde {\boldsymbol {x}} _ {t} = \underset {\boldsymbol {x} \in \mathcal {X}} {\arg \max } \alpha_ {t} (\boldsymbol {x}) \tag {45} +$$ + +$$ +\tilde {\boldsymbol {\xi}} _ {t} = \underset {\boldsymbol {\xi} \in \Delta} {\arg \max } \sigma_ {t} (\tilde {\boldsymbol {x}} _ {t} + \boldsymbol {\xi}) p (\boldsymbol {\xi}) \tag {46} +$$ + +where $\sigma_{t}$ represents the standard deviation of the GP posterior. For the definition of $\Delta$ , since the original paper does not mention an extension to the input uncertainty scenario, we define it as: $\Delta := [-\delta, \delta]$ when $\xi \sim U[-\delta, \delta]$ . When $\xi$ is normal distributed, then $\Delta := [-\mathrm{CI}_{.025}, \mathrm{CI}_{.975}]$ , $\mathrm{CI}_{.975_d} := Q(0.975|\xi_d)$ , where $Q$ is the quantile function built upon marginal distribution $\xi_d$ . For all acquisition functions, we use $\beta_t = 2$ as suggested in the original paper. + +MO-MVA-BO is originally proposed in the active learning settings (Iwazaki et al., 2021). In order to make use of it in a continuous input space, we discretize the input space $\mathcal{X}$ evenly using a space segmentation parameter $\tau = \{0.001, 0.05, 0.05\}$ for input dimensionality $d = \{1, 2, 3\}$ respectively. We make a post recommendation based on $\hat{\Pi}_t$ , which is extracted from the discretized input set $\tilde{\mathcal{X}}$ as the same setting in the origin paper. Nevertheless, we remark the comparison is not fair as this recommendation is an out-of-sample strategy: which is potentially better, especially at the beginning as the candidate size can be larger than the in-sample data size. + +CO-MVA-BO We follow the same discretization approach as for MO-MVA-BO. For both FF-MV-ECI and CO-MVA-BO acquisition functions, if the feasible candidates set is empty $(St = \emptyset)$ , we use a small pseudo constant value as the current best value keeping the acquisition function operating as defined. We use arg max $l_t^{F_1}$ for making recommendations. + +$\pmb{x}\in \tilde{\mathcal{X}}$ + +Uncertainty Sampling For the 2nd stage, instead of performing Eq. 46, we only optimize the standard deviation $\sigma_t$ . We make optimal recommendations based on in-sample evaluations that are in $\mathcal{X}$ . + +# H.3. Experimental Setup for the Robust Bayesian Optimization + +Number of Fourier features Since Fourier feature-based acquisition functions need to specify the number of features explicitly, we use $\{128, 900, 1000\}$ for $\{1d, 2d, 3d\}$ problems, respectively, for both RFF and QFF. + +Recommendations for optimal solutions At the end of the optimization process, we need to provide the optimal candidate for the practitioner. In our problem scenario, both robustness measures are not observable. To extract the optimal solution, one can either perform an in-sample recommendation (i.e., extracting optimal recommendations based on queried data $\mathbf{X}$ ), or perform an out-of-sample recommendation (see, e.g., Daulton et al. (2021); Fröhlich et al. (2020)). Since out-of-sample strategies require performing another optimization process to extract optimal solutions, which makes the computation cost even higher, we focus on the in-sample strategy in this paper. We recommend the optimal candidate based on the inferred robustness measures for the scalarization and multi-objective formulations. For the variance as constraint approach, we use $\boldsymbol{x}^{*} = \arg \max_{\boldsymbol{x} \in \boldsymbol{F}} \mathbb{J}(\boldsymbol{x})$ for conservative recommendations in case the constraint is expected to be satisfied with high priority (e.g., the Utility Gap metric), where $\boldsymbol{F} := \{\boldsymbol{x} \in \boldsymbol{X} | Pr(\tilde{\nabla}(\boldsymbol{x}) \leq C_v) \geq p\}$ . $p$ can be specified by practitioners and this probability can be approximated by MC sampling of $\tilde{\nabla}(\boldsymbol{x})$ , we use $p = 0.8$ in our numerical experiments. We alternatively recommend $\underset{\boldsymbol{x} \in \boldsymbol{X}}{\arg \max} Pr(\tilde{\nabla}(\boldsymbol{x}) \leq C_v)$ in case $\boldsymbol{F} = \varnothing$ . + +Reference point setting For hypervolume based multi-objective optimization approaches, a reference point is needed to partition the non-dominated region into hypercubes. In this paper, we follow the strategy by keeping an automatically updated reference point as an agnostic treatment of the Pareto front. + +We use a fixed reference point extracted from a reference Pareto front to calculate the log-hypervolume metric. We provide the corresponding reference point setting in Table $5^{13}$ which is calculated as Knudde et al. (2017): $\mathcal{F}_{MV_{ref}} = \min_r(\mathcal{F}_MV^*) - 2\left(\max_r(\mathcal{F}_MV^*) - \min_r(\mathcal{F}_MV^*)\right) / |\mathcal{F}_MV^|,$ where the operator $\max_r() := [\max_{f_{MV} \in \mathcal{F}_MV^*} f_{MV}^{(1)}, \max_{f_{MV} \in \mathcal{F}_MV^*} f_{MV}^{(2)}]$ , $\min_r() := [\min_{f_{MV} \in \mathcal{F}_MV^*} f_{MV}^{(1)}, \min_{f_{MV} \in \mathcal{F}_MV^*} f_{MV}^{(2)}]$ . + +Table 5. Reference Point Setting + +
ProblemInput Uncertaintyξ distributionReference point
SineLinear (Fröhlich et al., 2020)N(0,0.001)[0.03003507, 0.07371671]
U(-0.05, 0.05),[0.03320457, 0.02952188]
Forrester (Keane et al., 2008)N(0,0.005)[0.15948319, 5.8976241]
U(-0.1, 0.1),[0.17751173, 1.79019393]
BraninN(0,0.01I2)[15.77117159, 84.70987466]
U(-[0.1, 0.01], [0.1, 0.01]),[19.4079212, 10.30334723]
Hartmann3N(0,0.01I3)[0.11863389, 0.46989925]
U(-[0.15, 0.15, 0.15], [0.15, 0.15, 0.15]),[0.12358115, 0.21843887]
Conceptual Low Drag Wing DesignN(0, [0.0040.00045125])[3.10164206, 0.24411262]
U(-[0.08, 0.02], [0.08, 0.02])[3.13006765, 0.07853147]
+ +# H.4. Details of the Conceptual Low Drag Wing Design Problem + +We perform RBO on a two-dimensional conceptual low drag wing design problem in level flight conditions. The goal is to find the optimal wing geometry (i.e., wingspan $b$ and chord length $c$ ) to achieve a low drag coefficient $C_D$ , which is usually represented by lift-to-drag ratio $\frac{C_L}{C_D}$ . In practice, besides the low drag requirement, we also favor a light aircraft, and the wing geometry cannot be too long span-wise (i.e., large $b$ ) while too short in chord-wise (i.e., small $c$ ), which may impose difficulties for structural design. Moreover, the lift coefficient $C_L$ is preferably not too big, as otherwise it may impose difficulties for airfoil design. Hence, the objective function is defined as: + +$$ +\underset {\{b, c \in \mathcal {X} \}} {\arg \max } - l o g \left[ - \left(5 \frac {C _ {L}}{C _ {D}} - \max (A - 1 0, 0) - 1 0 0 * \max (C _ {L} - 0. 9, 0) - 0. 4 W - 5\right) \right] \tag {47} +$$ + +where $A = \frac{b}{c}$ represents the aspect ratio. The drag coefficient is defined as: + +$$ +C _ {D} = \frac {0 . 0 3 0 6 2 7 0 2}{S} + k C _ {f} \frac {S _ {w e t}}{S} + \frac {C _ {L} ^ {2}}{\pi A e} \tag {48} +$$ + +where the wing area $S = bc$ , friction drag coefficient $C_f = \frac{0.074}{Re^{0.2}}$ , Reynolds number $Re = \frac{\rho Vc}{\mu}$ . For design specified weight $W$ and speed $V$ , the lift coefficient required in steady level flight can be determined by: + +$$ +C _ {L} = \frac {2 W}{\rho V ^ {2} S} \tag {49} +$$ + +where $\rho = 1.29$ is the air density. The aircraft weight is $W = W_{0} + W_{w}$ , where $W_{w}$ represents the weight of the wing, which can be determined by: + +$$ +W _ {w} = 4 5. 4 2 S + 8. 7 1 \times 1 0 ^ {- 5} \frac {N _ {u l t} b ^ {3} \sqrt {W _ {0} W}}{S (t / c)} \tag {50} +$$ + +The remaining parameters are defined as follows: + +Table 6. Parameters for steady level flight + +
ParameterValueUnitNotes
W018Naircraft weight (excluding weight of the wing)
t/c0.12NAaverage thickness-to-chord ratio
Nult2.5NAultimate load factor
Swet2.05Sm2wing wetted area
μ17.8 × 10-6kg/(m sec)air viscosity
k1.2NAform factor
e0.96NAOswald efficiency number
+ +# H.5. Results for Uniform Distributed Input Uncertainty + +We provide the additional experiments for uniformly distributed input uncertainty $\xi$ in Fig. 7. For the conceptual wing design problem, the settings for the input uncertainty are provided in Table 5. For the robot pushing problem, input uncertainty $\xi$ 's distribution is specified as $U(-[0.2, 0.2, 0.58], [0.2, 0.2, 0.58])$ and $U(-[0.3, 0.3, 0.29], [0.3, 0.3, 0.29])$ for scalarization and variance as constraint formulation, respectively. + +![](images/5c8589f412593029e323cd723d26390e588ce5ee2b23e650566c828db2139a54.jpg) + +![](images/af4fa1aec7e18e503ae5f3a67beebe8c724f74e50d56c5ccc73a4e10e9046132.jpg) + +![](images/ea2afa467da332e690c251102035eec41ba02221deb541a61a9ecd488bf75011.jpg) + +![](images/5c812fe6af272bd4b2882a00a16cbccb6e5a29bb0ffef90bc2412c013bdf7beb.jpg) + +![](images/cbf8d6518eb7800bcd4202324cb5c177c94947aafdb1daad79d3d54857bdf601.jpg) + +![](images/91d3e166f40a45328b5d34b72ad44a8a06c90fc58e9426e06a0b1ad098501de9.jpg) + +![](images/1316adff77d1ec218fd4f88eb9eaca9defb6e2850f1e2eaebf16dadd03fe6942.jpg) + +![](images/6039517403bc3928284cbb6031c08db2e6fce2223610da47aca15a3fdbf0eb91.jpg) + +![](images/4b6a2fb7acdcaf30b8ffa2df7425c9e08d3a7b120920f135ca608bf39280b49b.jpg) + +![](images/ca017f1f8f071c35fb943f2d40fc983ecb3bc58d981329fccd558f2e0a18cfc4.jpg) + +![](images/d9d3fe7dee55437f166229ac4205ea669a77cf6467b00c048580a0c1aaba3f8c.jpg) + +![](images/7eedf659012d6a0ac5e47d11e807022590c0e96d70d68cf7b773649cda6bb11c.jpg) + +![](images/f38e51510f1a1d4a0e60e91190b5bb6cceb11a06211146ddcba174055a5adbaa.jpg) +Figure 7. Experiment results on synthetic functions and real-life applications for uniform distributed input uncertainty. + +![](images/846dba27a0955abfcef2f25e87b0341ae48aba1fe5b8d11322526e55469cbf40.jpg) + +![](images/d268946ecc105047d80fb5338a90bb3e9da0d1b0428d444ec826e7c0b5189955.jpg) \ No newline at end of file diff --git a/spectralrepresentationofrobustnessmeasuresforoptimizationunderinputuncertainty/images.zip b/spectralrepresentationofrobustnessmeasuresforoptimizationunderinputuncertainty/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..2a81c38deaadca8b52c1ae290c0ea2baad6b0527 --- /dev/null +++ b/spectralrepresentationofrobustnessmeasuresforoptimizationunderinputuncertainty/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e31742f077b02085cd1f9f244f5b34bc05f9552f0f6148f1bc05fd7cae5dd0b0 +size 1902708 diff --git a/spectralrepresentationofrobustnessmeasuresforoptimizationunderinputuncertainty/layout.json b/spectralrepresentationofrobustnessmeasuresforoptimizationunderinputuncertainty/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..8407db23cb26e71b719e0188816c2a54e7fa6500 --- /dev/null +++ b/spectralrepresentationofrobustnessmeasuresforoptimizationunderinputuncertainty/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0a5988ac2b595d16ded71769b9257a17b94ab90339f9805f8a613859859a91e3 +size 940905 diff --git a/speqnetssparsityawarepermutationequivariantgraphnetworks/f28c4540-8022-4820-92c2-a7effabd5ba6_content_list.json b/speqnetssparsityawarepermutationequivariantgraphnetworks/f28c4540-8022-4820-92c2-a7effabd5ba6_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..e83c115bce19651c8e617e55d308c381c87ae517 --- /dev/null +++ b/speqnetssparsityawarepermutationequivariantgraphnetworks/f28c4540-8022-4820-92c2-a7effabd5ba6_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d40598edd6e634d9a16171333d671ed81723340e768885ba6e4159ef5fe3470f +size 195761 diff --git a/speqnetssparsityawarepermutationequivariantgraphnetworks/f28c4540-8022-4820-92c2-a7effabd5ba6_model.json b/speqnetssparsityawarepermutationequivariantgraphnetworks/f28c4540-8022-4820-92c2-a7effabd5ba6_model.json new file mode 100644 index 0000000000000000000000000000000000000000..646b32c3e861b68583d78d087f236fb1087feabe --- /dev/null +++ b/speqnetssparsityawarepermutationequivariantgraphnetworks/f28c4540-8022-4820-92c2-a7effabd5ba6_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b018c752e198ad3c6dccf926c1b8fb9ca481db7e3c50014d6eabb0b1dd552216 +size 243608 diff --git a/speqnetssparsityawarepermutationequivariantgraphnetworks/f28c4540-8022-4820-92c2-a7effabd5ba6_origin.pdf b/speqnetssparsityawarepermutationequivariantgraphnetworks/f28c4540-8022-4820-92c2-a7effabd5ba6_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..764f4b29e953f889f43b056446276e8f720130b8 --- /dev/null +++ b/speqnetssparsityawarepermutationequivariantgraphnetworks/f28c4540-8022-4820-92c2-a7effabd5ba6_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7d7497ccacaf23afccef979ca662f8639b44472caa12ec0a60a2eb301e16cb61 +size 606714 diff --git a/speqnetssparsityawarepermutationequivariantgraphnetworks/full.md b/speqnetssparsityawarepermutationequivariantgraphnetworks/full.md new file mode 100644 index 0000000000000000000000000000000000000000..72bd267176c4dd68a7bf21c5ee7d1dd20b586283 --- /dev/null +++ b/speqnetssparsityawarepermutationequivariantgraphnetworks/full.md @@ -0,0 +1,871 @@ +# SpeqNets: Sparsity-aware Permutation-equivariant Graph Networks + +Christopher Morris $^{1,2,3}$ Gaurav Rattan $^{1}$ Sandra Kiefer $^{4}$ Siamak Ravanbkash $^{2,3}$ + +# Abstract + +While message-passing graph neural networks have clear limitations in approximating permutation-equivariant functions over graphs or general relational data, more expressive, higher-order graph neural networks do not scale to large graphs. They either operate on $k$ -order tensors or consider all $k$ -node subgraphs, implying an exponential dependence on $k$ in memory requirements, and do not adapt to the sparsity of the graph. By introducing new heuristics for the graph isomorphism problem, we devise a class of universal, permutation-equivariant graph networks, which, unlike previous architectures, offer a fine-grained control between expressivity and scalability and adapt to the sparsity of the graph. These architectures lead to vastly reduced computation times compared to standard higher-order graph networks in the supervised node- and graph-level classification and regression regime while significantly improving standard graph neural network and graph kernel architectures in terms of predictive performance. + +# 1. Introduction + +Graph-structured data is ubiquitous across application domains ranging from chemo- and bioinformatics (Barabasi & Oltvai, 2004; Jumper et al., 2021; Stokes et al., 2020) to image (Simonovsky & Komodakis, 2017) and social-network analysis (Easley & Kleinberg, 2010). To develop successful machine-learning models in these domains, we need techniques that exploit the rich information inherent in the graph structure and the feature information within nodes and edges. In recent years, numerous approaches have + +*Equal contribution $^{1}$ Department of Computer Science, RWTH Aachen University, Aachen, Germany $^{2}$ Department of Computer Science, McGill University, Montreal, Canada $^{3}$ Mila, Quebec AI Institute $^{4}$ Max Planck Institute for Software Systems, Saarland Informatics Campus, Germany. Correspondence to: Christopher Morris . + +Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s). + +been proposed for machine learning with graphs—most notably, approaches based on graph kernels (Borgwardt et al., 2020; Kriege et al., 2020) or using graph neural networks (GNNs) (Chami et al., 2020; Gilmer et al., 2017; Grohe, 2021; Morris et al., 2021). Here, graph kernels based on the 1-dimensional Weisfeiler-Leman algorithm (1-WL) (Weisfeiler & Leman, 1968), a simple heuristic for the graph isomorphism problem, and corresponding GNNs (Morris et al., 2019; Xu et al., 2019) have recently advanced the state-of-the-art in supervised node- and graph-level learning. However, the 1-WL operates via simple neighborhood aggregation, and the purely local nature of the related approaches misses important patterns in the given data. Moreover, they are only applicable to binary structures and therefore cannot deal with general structures containing relations of higher arity, e.g., hypergraphs. A more powerful algorithm for graph isomorphism testing is the $k$ -dimensional Weisfeiler-Leman algorithm ( $k$ -WL) (Babai, 1979; Cai et al., 1992). The algorithm captures more global, higher-order patterns by iteratively computing a coloring or labeling for $k$ -tuples defined over the set of nodes of a given graph based on a certain notion of adjacency between tuples. See (Kiefer, 2020b) for a survey and more background. However, since the algorithm considers all $n^k$ many $k$ -tuples of an $n$ -node graph, it does not scale to large real-world graphs. Moreover, the cardinality of the considered neighborhood is always $k \cdot n$ . Hence, a potential sparsity of the input graph does not reduce the running time. + +New neural architectures that possess the same power as the $k$ -WL in terms of separating non-isomorphic graphs (Azizian & Lelarge, 2020; Geerts, 2020; Maron et al., 2019b) suffer from the same drawbacks, i.e., their memory requirement is lower-bounded by $n^k$ for an $n$ -node graph, and they have to resort to dense matrix multiplication. Recently, Morris et al. (2020b) introduced the local variant ( $\delta$ - $k$ -LWL) of the $k$ -WL considering only a subset of the neighborhoods in $k$ -WL. However, like the original algorithm, the local variant operates on the set of all possible $k$ -tuples, again resulting in the same (exponential) memory requirements, rendering the algorithm not practical for large, real-world graphs. + +Present work To address the described drawbacks, we introduce a new set of heuristics for the graph isomorphism problem, denoted $(k,s)$ -LWL, which only considers a subset of all $k$ -tuples, namely those inducing subgraphs with at most $s$ connected components. We study the effect of $k$ and $s$ on the expressive power of the heuristics. Specifically, we show that the $(k,1)$ -LWL induces a hierarchy of provably expressive heuristics for the graph isomorphism problem, i.e., with increasing $k$ , the algorithm becomes strictly more expressive. Additionally, we prove that the $(k,2)$ -LWL is strictly more expressive than the $(k,1)$ -LWL. Further, we separate the $(k,2)$ -LWL and $(k,k)$ -LWL by showing that the $(k,k)$ -LWL is strictly more expressive than the $(k,2)$ -LWL. Building on these combinatorial insights, we derive corresponding provably expressive, permutation-equivariant neural architectures, denoted $(k,s)$ -SpeqNets, which offer a more fine-grained trade-off between scalability and expressivity compared to previous architectures based on the $k$ -WL, see Figure 1 for a high-level overview of the theoretical results. Empirically, we show how our architectures offer vastly reduced computation times while beating baseline GNNs and other higher-order graph networks in terms of predictive performance on well-known node- and graph-level prediction benchmark datasets. + +# 1.1. Related work + +In the following, we review related work from graph kernels, GNNs and graph theory, see Appendix A for an extended discussion. + +Graph kernels Historically, kernel methods—which implicitly or explicitly map graphs to elements of a Hilbert space—have been the dominant approach for supervised learning on graphs. Important early work in this area includes random-walk based kernels (Gartner et al., 2003; Kashima et al., 2003; Kriege et al., 2017) and kernels based on shortest paths (Borgwardt & Kriegel, 2005). More recently, developments in the field have emphasized scalability, focusing on techniques that bypass expensive Gram matrix computations by using explicit feature maps, see, e.g., (Shervashidze et al., 2011). Morris et al. (2017) devised a local, set-based variant of the $k$ -WL and a corresponding kernel. However, the approach is (provably) weaker than the tuple-based algorithm. Further, Morris et al. (2020a) proposed kernels based on the $\delta-k$ -LWL. + +Yanardag & Vishwanathan (2015a) successfully employed Graphlet (Shervashidze et al., 2009), and Weisfeiler-Leman kernels within frameworks for smoothed (Yanardag & Vishwanathan, 2015a) and deep graph kernels (Yanardag & Vishwanathan, 2015b). Other recent work focuses on assignment-based (Johansson & Dubhashi, 2015; Kriege et al., 2016; Nikolentzos et al., 2017), spectral (Kondor & Pan, 2016; Verma & Zhang, 2017), graph decomposi + +tion (Nikolentzos et al., 2018), randomized binning approaches (Heimann et al., 2019), and the extension of kernels based on the 1-WL (Rieck et al., 2019; Togninalli et al., 2019). For a theoretical investigation of graph kernels, see (Kriege et al., 2018), and for a thorough survey of graph kernels, see (Borgwardt et al., 2020; Kriege et al., 2020). + +GNNs Recently, GNNs (Gilmer et al., 2017; Scarselli et al., 2009) emerged as an alternative to graph kernels. Notable instances of this architecture include, e.g., (Duvenaud et al., 2015; Hamilton et al., 2017; Velicković et al., 2018), which can be subsumed under the message-passing framework introduced in (Gilmer et al., 2017). Also, approaches based on spectral information were introduced in, e.g., (Deferrard et al., 2016; Bruna et al., 2014; Kipf & Welling, 2017; Monti et al., 2017)—all of which descend from early work in (Kireev, 1995; Baskin et al., 1997; Micheli & Sesto, 2005; Merkwirth & Lengauer, 2005; Micheli, 2009; Sperduti & Starita, 1997; Scarselli et al., 2009). + +Limits of GNNs and more expressive architectures Recently, connections of GNNs to Weisfeiler-Leman type algorithms have been shown (Azizian & Lelarge, 2020; Barceló et al., 2020; Chen et al., 2019b; Geerts et al., 2020; Geerts, 2020; Maehara & NT, 2019; Maron et al., 2019a; Morris et al., 2019; Xu et al., 2019). Specifically, (Morris et al., 2019; Xu et al., 2019) showed that the expressive power of any possible GNN architecture is limited by the 1-WL in terms of distinguishing non-isomorphic graphs. + +Triggered by the above results, a large set of papers proposed architectures to overcome the expressivity limitations of the 1-WL. Morris et al. (2019) introduced $k$ -dimensional GNNs ( $k$ -GNN) which rely on a message-passing scheme between subgraphs of cardinality $k$ . Similar to (Morris et al., 2017), the paper employed a local, set-based (neural) variant of the $k$ -WL. Later, this was refined in (Maron et al., 2019a; Azizian & Lelarge, 2020) by introducing $k$ -order folklore graph neural networks ( $k$ -FGNN), which are equivalent to the folklore or oblivious variant of the $k$ -WL (Grohe, 2021; Morris et al., 2021) in terms of distinguishing non-isomorphic graphs. Subsequently, Morris et al. (2020b) introduced neural architectures based on the $\delta-k$ -LWL, which only considers a subset of the neighborhood from the $k$ -WL, taking sparsity of the underlying graph (to some extent) into account. Although more scalable, the algorithm reaches computational exhaustion on large-scale graphs since it considers all $n^k$ tuples of size $k$ . Chen et al. (2019b) connected the theory of universal approximations of permutation-invariant functions and the graph isomorphism viewpoint and introduced a variation of the 2-WL. See (Morris et al., 2021) for an in-depth survey on this topic. + +Recent works have extended the expressive power of GNNs, + +![](images/0786baeb5159a2793922d225b434f5eb9ee64c28c61ecfe03f2ef9be06244295.jpg) +Figure 1. Overview of the expressive power of the proposed algorithms and neural architectures. The green and red nodes represent algorithms proposed in the present work. Forward arrows point to more powerful algorithms or neural architectures. \*Proven in (Morris et al., 2020b). $A\sqsubset B$ $(A\equiv B)$ : algorithm $A$ is strictly more powerful than (equally powerful as) $B$ + +e.g., by encoding node identifiers (Murphy et al., 2019; Vignac et al., 2020), leveraging random features (Abboud et al., 2020; Dasoulas et al., 2020; Sato et al., 2020), subgraph information (Bevilacqua et al., 2021; Bouritsas et al., 2020; Cotta et al., 2021; Papp et al., 2021; Thiede et al., 2021; You et al., 2021; Zhang & Li, 2021; Zhao et al., 2021), homomorphism counts (Barceló et al., 2021; NT & Maehara, 2020), spectral information (Balcilar et al., 2021), simplicial and cellular complexes (Bodnar et al., 2021b;a), random walks (Tönshoff et al., 2021), graph decompositions (Talak et al., 2021), distance (Li et al., 2020) and directional information (Beaini et al., 2020). + +However, all of the above approaches mentioned in the previous paragraph only overcome limitations of the 1-WL, 2-WL, or 3-WL, and do not induce a hierarchy of provably powerful, permutation-equivariant neural architectures aligned with the $k$ -WL hierarchy. + +See Appendix A for an overview of the properties of $k$ -WL. + +# 2. Preliminaries + +We briefly describe the Weisfeiler-Leman algorithm and, along the way, introduce our notation, see Appendix B for details. We let $[n] := \{1, \ldots, n\} \subset \mathbb{N}$ for $n \geq 1$ , and use $\{\ldots\}$ to denote multiset. We also use standard concepts from graph theory (such as graphs, directed graphs, neighbors, trees, and so on). The vertex and the edge set of a graph $G$ are denoted by $V(G)$ and $E(G)$ , respectively. The neighborhood of $v$ in $V(G)$ is $\delta(v) = \{u \in V(G) \mid (v, u) \in E(G)\}$ . We say that two graphs $G$ and $H$ are isomorphic ( $G \simeq H$ ) if there exists a bijection $\varphi: V(G) \to V(H)$ preserving the adjacency relation, i.e., $(u, v)$ is in $E(G)$ if and only if $(\varphi(u), \varphi(v))$ is in $E(H)$ , call $\varphi$ an isomorphism from $G$ to $H$ . If the graphs have vertex or edges labels, the isomorphism is additionally required to match these labels. Let $\mathbf{v}$ be a tuple in $V(G)^k$ for $k > 0$ , then $G[\mathbf{v}]$ is the subgraph induced by the elements of $\mathbf{v}$ , where the nodes are labeled with integers from $\{1, \ldots, k\}$ corresponding to their positions in $\mathbf{v}$ . A connected component of a graph $G$ is an inclusion-wise maximal subgraph of $G$ in which every two nodes are connected by paths. + +# 2.1. Node-refinement algorithms + +In the following, we review the Weisfeiler-Leman algorithm and related variants (Morris et al., 2020b). Let $k$ be a fixed positive integer and let $V(G)^k$ denote the set of $k$ -tuples of nodes of the graph $G$ . A coloring of $V(G)^k$ is a mapping $C \colon V(G)^k \to \mathbb{N}$ , i.e., we assign a number (color) to every tuple in $V(G)^k$ . The initial coloring $C_0$ of $V(G)^k$ is specified by the atomic types of the tuples, i.e., two tuples $\mathbf{v}$ and $\mathbf{w}$ in $V(G)^k$ have the same initial color iff the mapping $v_i \mapsto w_i$ induces an isomorphism between the labeled subgraphs $G[\mathbf{v}]$ and $G[\mathbf{w}]$ . Note that, given a tuple $\mathbf{v}$ in $V(G)^k$ , we can upper-bound the running time of the computation of this initial coloring for $\mathbf{v}$ by $\mathcal{O}(k^2)$ . A color class corresponding to a color $c$ is the set of all tuples colored $c$ , i.e., the set $C^{-1}(c)$ . + +For $j$ in $[k]$ and $w$ in $V(G)$ , let $\phi_j(\mathbf{v}, w)$ be the $k$ -tuple obtained by replacing the $j$ th component of $\mathbf{v}$ with the node $w$ . That is, $\phi_j(\mathbf{v}, w) = (v_1, \ldots, v_{j-1}, w, v_{j+1}, \ldots, v_k)$ . If $\mathbf{w} = \phi_j(\mathbf{v}, w)$ for some $w$ in $V(G)$ , call $\mathbf{w}$ a $j$ -neighbor of $\mathbf{v}$ . The neighborhood of $\mathbf{v}$ is the set of all $\mathbf{w}$ such that $\mathbf{w} = \phi_j(\mathbf{v}, w)$ holds for some $j$ in $[k]$ and a $w$ in $V(G)$ . + +The refinement of a coloring $C\colon V(G)^k\to \mathbb{N}$ , denoted by $\widehat{C}$ , is a coloring $\widehat{C}\colon V(G)^k\to \mathbb{N}$ defined as follows. For each $j$ in $[k]$ , collect the colors of the $j$ -neighbors of $\mathbf{v}$ in a multiset $S_{j} = \{\{C(\phi_{j}(\mathbf{v},w))\mid w\text{in} V(G)\}\}$ . Then, for a tuple $\mathbf{v}$ , define + +$$ +\widehat {C} (\mathbf {v}) := (C (\mathbf {v}), M (\mathbf {v})), +$$ + +where $M(\mathbf{v})$ is the $k$ -tuple $(S_1, \ldots, S_k)$ . For consistency, the strings $\widehat{C}(\mathbf{v})$ thus obtained are lexicographically sorted and renamed as fresh integers, i.e., ones that have not been used in previous iterations. Observe that the new color $\widehat{C}(\mathbf{v})$ of $\mathbf{v}$ is solely dictated by the color histogram of the neighborhood of $\mathbf{v}$ . In general, a different mapping $M(\cdot)$ could be used, depending on the neighborhood information that we would like to aggregate. We will refer to such $M(\cdot)$ as aggregation maps. + +$k$ -dimensional Weisfeiler-Leman For $k \geq 2$ , the $k$ -WL computes a coloring $C_{\infty} : V(G)^{k} \to \mathbb{N}$ of a given graph + +$G$ , as follows.2 To begin with, the initial coloring $C_0$ is computed. Then, starting with $C_0$ , successive refinements $C_{i + 1} = \widehat{C_i}$ are computed until convergence. That is, + +$$ +C _ {i + 1} (\mathbf {v}) = \left(C _ {i} (\mathbf {v}), M _ {i} (\mathbf {v})\right), +$$ + +where + +$$ +\begin{array}{l} M _ {i} (\mathbf {v}) := \left(\left\{\left. C _ {i} \left(\phi_ {1} (\mathbf {v}, w)\right) \mid w \in V (G) \right\} \right\}, \dots , \right. \\ \left. \right.\left\{ \right.\left. C _ {i} \left(\phi_ {k} (\mathbf {v}, w)\right) \mid w \in V (G) \right\}\left. \right). \\ \end{array} +$$ + +The successive refinement steps are also called rounds or iterations. Since the color classes form a partition of $V(G)^k$ , there must exist a finite $\ell \leq |V(G)|^k$ such that $C_\ell = \widehat{C_\ell}$ , i.e., the partition induced by $C_\ell$ is not refined further. The $k$ -WL outputs $C_\ell$ as the stable coloring $C_\infty$ . + +The $k$ -WL distinguishes two graphs $G$ and $H$ if, upon running the $k$ -WL on their disjoint union $G \dot{\cup} H$ , there exists a color $c$ in $\mathbb{N}$ in the stable coloring such that the corresponding color class $S_{c}$ satisfies + +$$ +\left| V (G) ^ {k} \cap S _ {c} \right| \neq \left| V (H) ^ {k} \cap S _ {c} \right|, +$$ + +i.e., the numbers of $c$ -colored tuples in $V(G)^k$ and $V(H)^k$ differ. Two graphs distinguished by the $k$ -WL must be non-isomorphic, because the algorithm is defined in an isomorphism-invariant way. + +Local $\delta$ - $k$ -dimensional Weisfeiler-Leman algorithm Morris et al. (2020b) introduced a more efficient modification of the $k$ -WL, namely the local $\delta$ - $k$ -dimensional Weisfeiler-Leman algorithm ( $\delta$ - $k$ -LWL). In contrast to the $k$ -WL, the $\delta$ - $k$ -LWL considers only a subset of the entire neighborhood of a node tuple. Let the tuple $\mathbf{w} = \phi_j(\mathbf{v}, w)$ be a $j$ -neighbor of $\mathbf{v}$ . We say that $\mathbf{w}$ is a local $j$ -neighbor of $\mathbf{v}$ if $w$ is adjacent to the replaced node $v_j$ . Otherwise, the tuple $\mathbf{w}$ is a global $j$ -neighbor of $\mathbf{v}$ . The $\delta$ - $k$ -LWL considers only local neighbors during the neighborhood aggregation process, and discards any information about the global neighbors. Formally, the $\delta$ - $k$ -LWL algorithm refines a coloring $C_i^{k,\delta}$ , obtained after $i$ rounds of $\delta$ - $k$ -LWL, via the aggregation map, + +$$ +\begin{array}{l} M _ {i} ^ {\delta} (\mathbf {v}) := \left(\left\{\left\{C _ {i} ^ {k, \delta} \left(\phi_ {1} (\mathbf {v}, w)\right) \mid w \in \delta (v _ {1}) \right\} \right\}, \dots , \right. \\ \left. \left\{\left. C _ {i} ^ {k, \delta} \left(\phi_ {k} (\mathbf {v}, w)\right) \mid w \in \delta \left(v _ {k}\right) \right\} \right\}\right), \\ \end{array} +$$ + +hence considering only the local $j$ -neighbors of the tuple $\mathbf{v}$ in each iteration. The coloring function for the $\delta-k$ -LWL is then defined by + +$$ +C _ {i + 1} ^ {k, \delta} (\mathbf {v}) := \left(C _ {i} ^ {k, \delta} (\mathbf {v}), M _ {i} ^ {\delta} (\mathbf {v})\right). +$$ + +We define the 1-WL to be the $\delta$ -1-LWL, which is commonly known as Color Refinement or Naive Node Classification. Hence, we can equivalently define + +$$ +C _ {i + 1} ^ {1, \delta} (v) = \left(C _ {i} ^ {1, \delta} (v), \{\{C _ {i} ^ {1, \delta} (w) \mid w \in \delta (v) \} \}\right). +$$ + +for a node $v$ in $V(G)$ . Morris et al. (2020b) also defined the $\delta - k$ -LWL $^{\ddagger}$ , a minor variation of the $\delta - k$ -LWL. Formally, the $\delta - k$ -LWL $^{\ddagger}$ refines a coloring $C_i$ (obtained after $i$ rounds) via the aggregation function $M^{\delta, +}(\mathbf{v}) =$ + +$$ +\begin{array}{l} \left(\left\{\left(C _ {i} ^ {k, \delta} \left(\phi_ {1} (\mathbf {v}, w)\right), \# _ {i} ^ {1} \left(\mathbf {v}, \phi_ {1} (\mathbf {v}, w)\right)\right) \mid w \in \delta \left(v _ {1}\right) \right\}, \dots , \right. \\ \left. \left\{\left(C _ {i} ^ {k, \delta} \left(\phi_ {k} (\mathbf {v}, w)\right), \# _ {i} ^ {k} \left(\mathbf {v}, \phi_ {k} (\mathbf {v}, w)\right)\right) \mid w \in \delta \left(v _ {k}\right) \right\} \right\}, \\ \end{array} +$$ + +instead of the $\delta$ - $k$ -LWL aggregation defined in Equation (4). Here, we set + +$$ +\# _ {i} ^ {j} (\mathbf {v}, \mathbf {x}) := | \left\{\mathbf {w}: \mathbf {w} \sim_ {j} \mathbf {v}, C _ {i} ^ {k, \delta} (\mathbf {w}) = C _ {i} ^ {k, \delta} (\mathbf {x}) \right\} |, +$$ + +where $\mathbf{w} \sim_{j} \mathbf{v}$ denotes that $\mathbf{w}$ is a $j$ -neighbor of $\mathbf{v}$ , for $j$ in $[k]$ . Essentially, $\#_{i}^{j}(\mathbf{v}, \mathbf{x})$ counts the number of (local or global) $j$ -neighbors of $\mathbf{v}$ which have the same color as $\mathbf{x}$ under the coloring $C_{i}$ (i.e., after $i$ rounds). Morris et al. (2020b) showed that the $\delta-k-\mathsf{LWL}^{\perp}$ is slightly more powerful than the $k$ -WL in distinguishing non-isomorphic graphs. + +Comparing $k$ -WL variants Let $A_{1}$ and $A_{2}$ denote two node-refinement algorithms. We write $A_{1} \sqsubseteq A_{2}$ if $A_{1}$ distinguishes between all non-isomorphic pairs that $A_{2}$ distinguishes, and $A_{1} \equiv A_{2}$ if both $A_{1} \sqsubseteq A_{2}$ and $A_{2} \sqsubseteq A_{1}$ hold. The corresponding strict relation is denoted by $\square$ . For example, following Morris et al. (2020b), it holds that $\delta-k$ -LWL $^{\perp}$ $\sqsubset$ $k$ -WL. + +The Weisfeiler-Leman hierarchy and permutation-invariant function approximation The Weisfeiler-Leman hierarchy is a purely combinatorial algorithm for testing graph isomorphism. However, the graph isomorphism function, mapping non-isomorphic graphs to different values, is the hardest to approximate permutation-invariant function. Hence, the Weisfeiler-Leman hierarchy has strong ties to GNNs' capabilities to approximate permutation-invariant or equivariant functions over graphs. For example, Morris et al. (2019); Xu et al. (2019) showed that the expressive power of any possible GNN architecture is limited by 1-WL in terms of distinguishing non-isomorphic graphs. Azizian & Lelarge (2020) refined these results by showing that if an architecture is capable of simulating $k$ -WL and allows the application of universal + +neural networks on vertex features, it will be able to approximate any permutation-equivariant function below the expressive power of $k$ -WL; see also (Chen et al., 2019b). Hence, if one shows that one architecture distinguishes more graphs than another, it follows that the corresponding GNN can approximate more functions. + +Kernels based on node-refinement algorithms After running the $k$ -WL (and the other node-refinement algorithms), the concatenation of the histogram of colors in each iteration can be used as a feature vector in a kernel computation. Specifically, in the histogram, for every color $c$ in $\mathbb{N}$ , an entry contains the number of nodes or $k$ -tuples colored $c$ . + +# 3. The $(k,s)$ -LWL algorithm + +Since both $k$ -WL and its local variant $\delta - k$ -LWL consider all $k$ -tuples of a graph, they do not scale to large graphs for larger $k$ . Specifically, for an $n$ -node graph, the memory requirement is in $\Omega(n^k)$ . Further, since the $k$ -WL considers the graph structure only at initialization, it does not adapt to its sparsity, i.e., it does not run faster on sparser graphs. To address this issue, we introduce the $(k, s)$ -LWL. The algorithm offers more fine-grained control over the trade-off between expressivity and scalability by only considering a subset of all $k$ -tuples, namely those inducing subgraphs with at most $s$ connected components. This combinatorial algorithm will be the basis of the permutation-equivariant neural architectures of Section 4. + +Let $G$ be a graph. Then $\# \operatorname{com}(G)$ denotes the number of (connected) components of $G$ . Further, let $k \geq 1$ and $1 \leq s \leq k$ , then + +$$ +V (G) _ {s} ^ {k} := \left\{\mathbf {v} \in V (G) ^ {k} \mid \# \operatorname {c o m} (G [ \mathbf {v} ]) \leq s \right\} +$$ + +is the set of $(k,s)$ -tuples of nodes, i.e., $k$ -tuples which induce (sub-)graphs with at most $s$ (connected) components. + +In contrast to the algorithms of Appendix B.1, the $(k,s)$ -LWL colors tuples from $V(G)_s^k$ instead of the entire $V(G)^k$ . Hence, analogously to Appendix B.1, a coloring of $V(G)_s^k$ is a mapping $C^{k,s}: V(G)_s^k \to \mathbb{N}$ , assigning a number (color) to every tuple in $V(G)_s^k$ . The initial coloring $C_0^{k,s}$ of $V(G)_s^k$ is defined in the same way as before, i.e., specified by the isomorphism types of the tuples, see Appendix B.1. Subsequently, the coloring is updated using the $\delta$ - $k$ -LWL aggregation map, see Equation (4). Hence, the $(k,s)$ -LWL is a variant of the $\delta$ - $k$ -LWL considering only $(k,s)$ -tuples, i.e., Equation (4) is replaced with $M_i^{\delta,k,s}(\mathbf{v}) :=$ + +$$ +\begin{array}{c} \big (\{\{C _ {i} ^ {k, s} (\phi_ {1} (\mathbf {v}, w)) \mid w \in \delta (v _ {1}) \text {a n d} \phi_ {1} (\mathbf {v}, w) \in V (G) _ {s} ^ {k} \} \}, \\ \dots , \{\{C _ {i} ^ {k, s} (\phi_ {k} (\mathbf {v}, w)) \mid w \in \delta (v _ {k}) \text {a n d} \phi_ {k} (\mathbf {v}, w) \in V (G) _ {s} ^ {k} \} \} \big), \end{array} +$$ + +i.e., $M_i^\delta(\mathbf{v})$ restricted to colors of $(k, s)$ -tuples. The stable coloring $C_\infty^{k,s}$ is defined analogously to the stable coloring $C_\infty^k$ . In the following two subsections, we investigate the properties of the algorithm in detail. Analogously to the $\delta-k-\mathsf{LWL}^+$ , we also define the $(k, s)$ - $\mathsf{LWL}^+$ , see Appendix B for details. + +# 3.1. Expressivity + +Here, we investigate the expressivity of the $(k,s)$ -LWL, i.e., its ability to distinguish non-isomorphic graphs, for different choices of $k$ and $s$ . In Section 4, we will leverage these results to devise universal, permutation-equivariant graph networks. We start off with the following simple observation. Since the $(k,k)$ -LWL colors all $k$ -tuples, it is equal to the $\delta-k$ -LWL. + +Observation 1. Let $k \geq 1$ , then + +$$ +(k, k) \text {- L W L} \equiv \delta - k \text {- L W L}, \text {a n d} +$$ + +$$ +(1, 1) - \mathrm {L W L} \equiv \delta - k - \mathrm {L W L} \equiv 1 - \mathrm {W L}. +$$ + +The following result shows that the $(k,1)$ -LWL form a hierarchy, i.e., the algorithm becomes more expressive as $k$ increases. + +Theorem 1. Let $k\geq 1$ , then + +$$ +(k + 1, 1) \text {- L W L} \sqsubset (k, 1) \text {- L W L}. +$$ + +Moreover, we also show that the $(k,2)$ -LWL is more expressive than the $(k,1)$ -LWL. + +Proposition 2. For $k \geq 2$ , it holds that + +$$ +(k, 2) \text {- L W L} \square (k, 1) \text {- L W L}. +$$ + +Further, the following theorem yields that increasing the parameter $s$ results in higher expressivity. Formally, we show that the $(k,k)$ -LWL is strictly more expressive than the $(k,2)$ -LWL. + +Theorem 3. For $k \geq 2$ , it holds that + +$$ +(k, k) \text {- L W L} \sqsubset (k, 2) \text {- L W L}. +$$ + +See Appendix C.1 for an analysis of the asymptotic running time of the $(k,s)$ -LWL, showing that it only depends on $k$ , $s$ , and the sparsity of the graph. In particular, the running time of the $(k,s)$ -LWL on an $n$ -vertex graph of bounded degree is $\tilde{\mathcal{O}}(n^s)$ instead of the usual $\tilde{\mathcal{O}}(n^k)$ for the $k$ -WL, for fixed $k$ and $s$ . + +# 4. SpeqNets + +We can now leverage the above combinatorial insights to derive sparsity-aware, permutation-equivariant graph networks, denoted $(k,s)$ -SpeqNets. Given a node-labeled + +graph $G$ , let each $(k, s)$ -tuple $\mathbf{v}$ in $V(G)_s^k$ be annotated with an initial feature $f^{(0)}(\mathbf{v})$ determined by its (labeled) isomorphism type, e.g., a one-hot encoding. Alternatively, we can also use some application-specific, real-valued feature. In each layer $t > 0$ , we compute a new feature $f^{(t)}(\mathbf{v})$ as + +$$ +\begin{array}{l} f _ {\operatorname {m r g}} ^ {W _ {1}} \left(f ^ {(t - 1)} (\mathbf {v}), f _ {\operatorname {a g g}} ^ {W _ {2}} \left(\left\{\{f ^ {(t - 1)} \left(\phi_ {i} (\mathbf {v}, w)\right) \right. \right. \right. \mid \tag {1} \\ \left. w \in \delta (v _ {i}) \text {a n d} \phi_ {i} (\mathbf {v}, w) \in V (G) _ {s} ^ {k} \Bigr \} \big) _ {i \in [ k ]}\right)\Bigg), \\ \end{array} +$$ + +in $\mathbb{R}^{1\times e}$ , where $W_1^{(t)}$ and $W_2^{(t)}$ are learnable parameter matrices from $\mathbb{R}^{d\times e}$ . Here, $f_{\mathrm{mrg}}^{W_2}$ and $f_{\mathrm{agg}}^{W_1}$ are arbitrary differentiable functions, responsible for merging and aggregating the relevant feature information, respectively. Note that we can naturally handle discrete node and edge labels as well as directed graphs. The following result demonstrates the expressive power of $(k,s)$ -SpeqNets, in terms of distinguishing non-isomorphic graphs. + +Theorem 4. Let $(V,E,\ell)$ be a labeled graph, and let $k\geq 1$ and $s$ in $[k]$ . Then, for all $t\geq 0$ , there exists a sequence of weights $\mathbf{W}^{(t)}$ such that + +$$ +C _ {t} ^ {k, s} (\mathbf {v}) = C _ {t} ^ {k, s} (\mathbf {w}) \iff f ^ {(t)} (\mathbf {v}) = f ^ {(t)} (\mathbf {w}). +$$ + +Hence, for all $k \geq 1$ , the following holds: + +$$ +(k, s) \text {- S p e q N e t} \equiv (k, s) \text {- L W L}. +$$ + +Note that it is not possible to come up with an architecture and weight assignments of $f_{\mathrm{mrg}}^{W_1}$ and $f_{\mathrm{agg}}^{W_2}$ , such that it becomes more powerful than the $(k, s)$ -LWL, see (Morris et al., 2019). However, all results from the previous section can be lifted to the neural setting. Analogously to GNNs, the above architecture can naturally handle continuous node and edge labels. By using the tools developed in (Azizian & Lelarge, 2020), it is straightforward to show that the above architecture is universal, i.e., it can approximate any continuous, bounded, permutation-invariant function over graphs up to an arbitrarily small additive error. + +# 4.1. Node-, edge-, and subgraph-level learning tasks + +The above architecture computes representations for $(k,s)$ -tuples, making it mostly suitable for graph-level learning tasks, e.g., graph classification or regression. However, it is also possible to derive neural architectures based on the $(k,s)$ -LWL for node- and edge-level learning tasks, e.g., node or link prediction. Given a graph $G$ , to learn a node feature for node $v$ , we can simply pool over the features learned for $(k,s)$ -tuples containing the node $v$ as a component. That is, let $t > 0$ , then we consider the multiset + +$$ +m ^ {t} (v) _ {i} = \{\{f ^ {(t - 1)} (\mathbf {t}) \mid \mathbf {t} \in V (G) _ {s} ^ {k} \text {a n d} t _ {i} = v \} \} \tag {2} +$$ + +for $i$ in $[k]$ . Hence, to compute a vectorial representation of the node $v$ , we compute a vectorial representation of $m^t(v)_i$ for $i$ in $[k]$ , e.g., using a neural architecture for multi-sets, see (Wagstaff et al., 2021), followed by learning a joint vectorial representation for the node $v$ . Again, by (Azizian & Lelarge, 2020), it is straightforward to show that the above architecture is universal, i.e., it can approximate any continuous, bounded, permutation-equivariant function over graphs up to an arbitrarily small additive error. Note that the above approach can be directly generalized to learn subgraph representations on an arbitrary number of vertices. + +# 5. Experimental evaluation + +Here, we aim to empirically investigate the learning performance of the kernel, see Appendix B.1, and neural architectures, see Section 4, based on the $(k,s)$ -LWL, compared with standard kernel and (higher-order) GNN baselines. Concretely, we aim to answer the following questions. + +Q1 Do the $(k,s)$ -LWL-based algorithms, both kernel and neural architectures, lead to improved classification and regression scores on real-world, graph-level benchmark datasets compared with dense algorithms and standard baselines? +Q2 How does the $(k,s)$ -SpecqNet architecture compare to standard GNN baselines on node-classification tasks? +Q3 To what extent does the $(k,s)$ -LWL reduce computation times compared with architectures induced by the $k$ -WL? +Q4 What is the effect of $k$ and $s$ with respect to computation times and predictive performance? + +The source code of all methods and evaluation procedures is available at https://www.github.com/ chrysler/speqnets. + +Datasets To compare the $(k,s)$ -LWL-based kernels, we used the well-known graph-classification benchmark datasets from (Morris et al., 2020a), see Table 3 for dataset statistics and properties.5 To compare the $(k,s)$ -SpeqNet architecture with GNN baselines, we used the ALCHEMY (Chen et al., 2019a) and the QM9 (Ramakrishnan et al., 2014; Wu et al., 2018) graph regression datasets, again see Table 1 for dataset statistics and properties. Following (Morris et al., 2020b), we opted for not using the 3D-coordinates of the ALCHEMY dataset to solely show the benefits of the (sparse) higher-order structures concerning graph structure and discrete labels. To investigate the performance of the architecture for node classification, + +we used the WEBKB datasets (Pei et al., 2020), see Table 4 for dataset statistics and properties. + +Kernels We implemented the $(k,s)$ -LWL and $(k,s)$ -LWL $^+$ for $k$ in $\{2,3\}$ and $s$ in $\{1,2\}$ . We compared our kernels to the Weisfeiler-Leman subtree kernel (1-WL) (Shervashidze et al., 2011), the Weisfeiler-Leman Optimal Assignment kernel (WLOA) (Kriege et al., 2016), the graphlet kernel (GR) (Shervashidze et al., 2009), and the shortest-path kernel (Borgwardt & Kriegel, 2005) (SP). Further, we implemented the higher-order kernels $\delta-k$ -LWL, $\delta-k$ -LWL $^+$ , $\delta-k$ -WL, and $k$ -WL kernel for $k$ in $\{2,3\}$ as outlined in (Morris et al., 2020b). All kernels were (re-)implemented in $\mathrm{C}++11$ . For the graphlet kernel, we counted (labeled) connected subgraphs of size 3. We followed the evaluation guidelines outlined in (Morris et al., 2020a). + +Neural architectures We used the GIN- $\varepsilon$ and Gin- $\varepsilon$ -JK architectures (Xu et al., 2019) as neural baselines. For data with (continuous) edge features, we used a 2-layer MLP to map them to the same number of components as the node features and combined them using summation (GINE and GINE- $\varepsilon$ ). For the evaluation of the $(k,s)$ -SpeqNet neural architectures of Section 4, we implemented them using PYTORCH GEOMETRIC (Fey & Lenssen, 2019), using a Python-wrapped $\mathrm{C}^{++}11$ preprocessing routine to compute the computational graphs for the higher-order GNNs. We used the GIN- $\varepsilon$ layer to express $f_{\mathrm{mrg}}^{W_1}$ and $f_{\mathrm{agg}}^{W_2}$ of Equation (1). For the GNN baseline for the QM9 dataset, following (Gilmer et al., 2017), we used a complete graph, computed pairwise $\ell_2$ distances based on the 3D coordinates, and concatenated them to the edge features. We note here that our intent is not the beat state-of-the-art, physical knowledge-incorporating architectures, e.g., DimeNet (J. Klicpera, 2020) or Cormorant (Anderson et al., 2019), but to solely show the benefits of the local, sparse higher-order architectures compared to the corresponding (1-dimensional) GNN. For the $(k,s)$ -SpeqNet architectures, in the case of the QM9 dataset, to compute the initial features, for each $(k,s)$ -tuple, we concatenated the node and edge features, computed pairwise $\ell_2$ distances based on the 3D coordinates, and a one-hot encoding of the (labeled) isomorphism type. Finally, we used a 2-layer MLP to learn a joint, initial vectorial representation. For the node-classification experiments, we used mean pooling to implement Equation (2) and a standard GCN or GIN layer for all experiments, including the $(k,s)$ -SpeqNet architectures. Further, we used the architectures (SDRF) outlined in (Topping et al., 2021) as baselines. + +For the kernel experiments, we computed the (cosine) normalized Gram matrix for each kernel. We computed the classification accuracies using the $C$ -SVM implementation of LIBSVM (Chang & Lin, 2011), using 10-fold cross + +validation. We repeated each 10-fold cross-validation ten times with different random folds and report average accuracies and standard deviations. + +Following the evaluation method proposed in (Morris et al., 2020a), the $C$ -parameter was selected from $\{10^{-3}, 10^{-2}, \ldots, 10^{2}, 10^{3}\}$ using a validation set sampled uniformly at random from the training fold (using $10\%$ of the training fold). Similarly, the numbers of iterations of the $(k, s)$ -LWL, $(k, s)$ -LWL $^+$ , 1-WL, WLOA, $\delta$ - $k$ -LWL, $\delta$ - $k$ -LWL $^+$ , and $k$ -WL were selected from $\{0, \ldots, 5\}$ using the validation set. Moreover, for the $(k, s)$ -LWL $^+$ and $\delta$ - $k$ -LWL $^+$ , we only added the label function \# on the last iteration to prevent overfitting. We report computation times for the $(k, s)$ -LWL, $(k, s)$ -LWL $^+$ , WLOA, $\delta$ - $k$ -LWL, $\delta$ - $k$ -LWL $^+$ , and $k$ -WL with five refinement steps. + +All kernel experiments were conducted on a workstation with 791GB of RAM using a single core. Moreover, we used the GNU C++ Compiler 4.8.5 with the flag -O2. + +For comparing the kernel approaches to GNN baselines, we used 10-fold cross-validation and again used the approach outlined in (Morris et al., 2020a). The number of components of the (hidden) node features in $\{32,64,128\}$ and the number of layers in $\{1,2,3,4,5\}$ of the GIN and GIN- $\varepsilon$ layer were again selected using a validation set sampled uniformly at random from the training fold (using $10\%$ of the training fold). We used mean pooling to pool the learned node embeddings to a graph embedding and used a 2-layer MLP for the final classification, using a dropout layer with $p = 0.5$ after the first layer of the MLP. We repeated each 10-fold cross-validation ten times with different random folds and report the average accuracies and standard deviations. Due to the different training methods, we do not provide computation times for the GNN baselines. + +For the larger molecular regression tasks ALCHEMY and QM9, we closely followed the hyperparameters found in (Chen et al., 2019a) and (Gilmer et al., 2017), respectively, for the GINE- $\varepsilon$ layers. That is, we used six layers with 64 (hidden) node features and a set2seq layer (Vinyals et al., 2016) for graph-level pooling, followed by a 2-layer MLP for the joint regression of the twelve targets. We used the same architecture details and hyperparameters for the $(k,s)$ -SpeqNet. For the ALCHEMY, we used the subset of 12 000 graphs from (Morris et al., 2020b). For both datasets, we uniformly and at random sampled $80\%$ of the graphs for training, and $10\%$ for validation and testing, respectively. Moreover, following (Chen et al., 2019a; Gilmer et al., 2017), we normalized the targets of the training split to zero mean and unit variance. We used a single model to predict all targets. Following (J. Klicpera, 2020, Appendix C), we report mean standardized MAE and mean standardized logMAE. We repeated each experiment five times and report average scores and standard deviations. We used + +Table 1. Classification accuracies in percent and standard deviations, OOT—Computation did not finish within one day, OOM—Out of memory. + +
MethodDataset
ENZYMESIMDB-BINARYIMDB-MULTIMUTAGNCI1PROTEINSPTC_MRREDDIT-BINARY
BaselineGR29.9 ±0.859.3 ±0.939.2 ±0.672.5 ±1.766.2 ±0.271.5 ±0.556.6 ±1.359.7 ±0.5
SP40.3 ±0.958.7 ±0.639.7 ±0.381.7 ±1.574.1 ±0.275.8 ±0.759.6 ±1.584.5 ±0.2
1-WL50.6 ±1.272.5 ±0.850.0 ±0.875.9 ±2.084.4 ±0.373.1 ±0.659.3 ±2.173.4 ±0.9
WLOA57.1 ±0.873.2 ±0.449.8 ±0.483.4 ±1.285.2 ±0.273.0 ±0.960.3 ±1.988.3 ±0.4
GNNGin-ε38.7 ±1.572.9 ±0.749.7 ±0.784.1 ±1.477.7 ±0.872.2 ±0.655.2 ±1.789.8 ±0.4
Gin-ε-JK39.3 ±1.673.0 ±1.149.6 ±0.783.4 ±2.078.3 ±0.372.2 ±0.756.0 1.3±90.4 ±0.4
k-WL2-WL37.0 ±1.068.1 ±1.747.5 ±0.785.7 ±1.666.9 ±0.375.2 ±0.460.5 ±1.1OOM
3-WL42.3 ±1.167.1 ±1.546.8 ±0.885.4 ±1.5OOTOOT59.0 ±2.0OOM
δ-2-LWL55.9 ±1.073.0 ±0.750.1 ±0.985.6 ±1.484.6 ±0.375.1 ±0.561.7 ±2.489.4 ±0.6
δ-2-LWL+53.9 ±1.475.6 ±1.062.7 ±1.484.1 ±2.191.3 ±0.379.2 ±1.261.6 ±1.391.4 ±0.4
δ-3-LWL58.2 ±1.272.6 ±0.949.0 ±1.284.1 ±1.683.2 ±0.4OOM60.7 ±2.2OOM
δ-3-LWL+56.5 ±1.476.1 ±1.264.3 ±1.285.4 ±1.882.7 ±0.4OOM61.5 ±1.8OOM
(k,s)-LWL(2,1)-LWL53.7 ±1.773.5 ±0.850.8 ±0.784.2 ±1.782.8 ±0.373.2 ±0.655.9 ±2.476.9 ±0.6
(2,1)-LWL+51.6 ±1.873.7 ±1.155.4 ±0.979.6 ±3.481.9 ±0.376.0 ±0.960.2 ±2.194.7 ±0.3
(3,1)-LWL53.4 ±1.474.6 ±1.051.3 ±0.685.3 ±2.481.4 ±0.572.9 ±1.160.2 ±1.7OOM
(3,1)-LWL+57.0 ±1.987.1 ±0.667.1 ±1.179.2 ±1.589.8 ±0.481.2 ±0.859.2 ±2.0OOM
(3,2)-LWL56.4 ±0.773.5 ±0.549.7 ±0.686.4 ±2.684.9 ±0.475.1 ±0.961.9 ±2.4OOM
(3,2)-LWL+55.8 ±1.778.1 ±1.459.5 ±1.084.5 ±1.989.4 ±0.378.8 ±0.662.3 ±3.3OOM
+ +the provided ten training, validation, and test splits for the node-classification datasets. All neural experiments were conducted on a workstation with one GPU card with 32GB of GPU memory. + +To compare training and testing times between the $(2,1)$ -SpeqNet, $(2,2)$ -SpeqNet, GINE- $\varepsilon$ architectures, we trained all three models on ALCHEMY (10K) and QM9 to convergence, divided by the number of epochs, and calculated the ratio with respect to the average epoch computation time of the $(2,1)$ -SpeqNet (average computation time of dense or baseline layer divided by average computation time of the $(2,1)$ -SpeqNet). Contrary to the kernel timing experiments, we did not take into account the time of the preprocessing routine to compute the computational graphs to focus purely on the neural component of the architecture. Clearly, the time for the preprocessing of $(k,s)$ -SpeqNet with small $s$ is much smaller than that of, e.g., the $\delta-k$ -WL. + +# 5.1. Results and discussion + +In the following, we answer questions Q1 to Q4. + +A1 Kernels See Table 1. The $(k,s)$ -LWL for $k, s$ in $\{2,3\}$ significantly improves the classification accuracy compared to the $k$ -WL and the $\delta-k$ -WL, and the other kernel baselines, while being on par with or better than the $\delta-2$ -LWL and $\delta-3$ -LWL. The $(k,s)$ -LWL and $(k,s)$ -LWL+ achieve a new state-of-the-art on five out of eight datasets. Our algorithms also perform vastly better than the neural baselines. + +Neural architectures See Table 2. On both datasets, all + +$(k, s)$ -SpeqNet architectures beat the GNN baseline. On the ALCHEMY dataset, the $(2, 2)$ -SpeqNet and $(3, 1)$ -SpeqNet perform best, while on the QM9 dataset, the $(2, 2)$ -SpeqNet performs best by a large margin. + +A2 See Table 2. Over all three datasets, the $(k,s)$ -SpeqNet architectures improve over the GCN baseline. Specifically, over all datasets, the $(2,1)$ -SpeqNet and the $(2,2)$ -SpeqNet lead to an increase of at least $7\%$ in accuracy. For example, both architectures beat the GCN and GIN baseline by at least $17\%$ on the WISCONSIN dataset. Further, the $(k,s)$ -SpeqNet architectures lead to better accuracies compared to the SDRF architecture, e.g., improving on it by more than $10\%$ on the CORNELL dataset. Hence, node-level tasks also benefit from higher-order information. However, increasing $k$ more does not result in increased accuracies. + +A3 Kernels See Table 5. Clearly, for the same $k$ and $s < k$ , the $(k,s)$ -LWL improves over the $k$ -WL and its (local) variants. For example, on the ENZYMES dataset, the $(2,1)$ -LWL is more than 20 times faster in terms of computation times compared to the $\delta$ -2-LWL. The speed up is even more significant for the non-local 2-WL. This speed-up factor increases more as $k$ increases, e.g., the $(3,1)$ -LWL is more than 1700 times faster compared to the 3-WL, whereas the $(3,2)$ -LWL is still more than 87 times faster, while giving better accuracies. Similar speed-up factors can be observed over all datasets. + +Neural architectures See Table 6. The (2,1)-SpecqNet + +
MethodDataset
ALCHEMY (10K)QM9
GINE-ε0.180 ±0.006 -1.958 ±0.0470.079 ±0.003 -3.430 ±0.080
(2,1)-SpeqNet0.169 ±0.005 -2.010 ±0.0560.078 ±0.007 -2.947 ±0.171
(2,2)-SpeqNet0.115 ±0.001 -2.722 ±0.0540.029 ±0.001 -4.081 ±0.058
(3,1)-SpeqNet0.180 ±0.011 -1.914 ±0.0970.068 ±0.003 -3.397 ±0.086
(3,2)-SpeqNet0.115 ±0.002 -2.767 ±0.079OOT
+ +(a) Mean MAE (mean std. MAE, logMAE) on large-scale (multi-target) molecular regression tasks. + +
MethodDataset
CORNELLTEXASWISCONSIN
GCN56.5 ±0.958.2 ±0.850.9 ±0.7
GIN51.9 ±1.155.3 ±2.748.4 ±1.6
SDRF + Undirected57.5 ±0.370.4 ±0.661.6 ±0.9
(2,1)-SpeqNet63.9 ±1.766.8 ±0.967.7 ±2.2
(2,2)-SpeqNet67.9 ±1.767.3 ±2.068.4 ±2.2
(3,1)-SpeqNet61.8 ±3.368.3 ±1.360.4 ±2.8
+ +(b) Classification accuracies and standard deviations for node classification. + +Table 2. Additional experimental results for graph regression and node classification. + +severely speeds up the computation time across both datasets. Specifically, on the ALCHEMY dataset, the (2,1)-SpeqNet is 1.3 times faster compared to the (2,2)-SpeqNet, while requiring twice the computation time of the GINE-ε but achieving a lower MAE. More interestingly, on the QM9 dataset, the (2,1)-SpeqNet is 3.4 times faster compared to the (2,2)-SpeqNet, while also being 1.3 times faster compared to the GINE-ε. The speed-up over GINE-ε is most likely due to the latter considering the complete graph to compute all pairwise $\ell_2$ distances, whereas the (2,1)-SpeqNet only considers connected node pairs. + +A4 See Tables 1 and 2. The $(2,1)$ -LWL, $(2,1)$ -LWL $^+$ , and $(3,1)$ -LWL $^+$ beat the 1-WL on six out of eight datasets. Going from the $(3,1)$ -LWL to the $(3,2)$ -LWL often leads to a slight increase in accuracy, e.g., on the ENZYMES and MUTAG datasets, while sometimes leading to a drop in accuracy, e.g., on the IMDB-BINARY dataset. Hence, a better understanding of the model's generalization performance with respect to $s$ needs to be investigated in future work. The effect is less pronounced for the neural architectures; however, all higher-order models beat the GNN baseline. Reducing $s$ leads to a vast reduction in computation time. For example, on the ENZYMES dataset, going from the $(3,2)$ -LWL to the $(3,1)$ -LWL leads to a speed-up factor of more than 18, while only inducing a small drop in terms of accuracy, whereas the $(3,1)$ -LWL $^+$ beats the $(3,2)$ -LWL while only increasing the computation time by one second. Similar observations can be made across all datasets. + +Increasing $s$ often leads to a better performance on the graph regression tasks. For example, on the ALCHEMY dataset, going from a (2,1)-SpeqNet to a (2,2)-SpeqNet architecture reduces the MAE by 0.054. Similar effects can be observed for the QM9 dataset, and when going from a (3,1)-SpeqNet to a (3,2)-SpeqNet architecture. On the node-classification datasets, reducing $s$ leads to a slight drop in accuracy, between 0.5 and $4\%$ , while increasing $k$ beyond 2 often results in a drop in accuracy. + +# 6. Conclusion + +To circumvent the exponential running time requirements of $k$ -WL, we introduced a new heuristic for the graph isomorphism problem, namely the $(k, s)$ -LWL. By varying the parameters $k$ and $s$ , the $(k, s)$ -LWL offers a tradeoff between scalability and expressivity and, unlike the $k$ -WL, takes into account the potential sparsity of the graph. Based on these combinatorial insights, we designed provably expressive machine-learning architectures, $(k, s)$ -SpeqNets, suitable for node-, subgraph-, and graph-level prediction tasks. Empirically, we showed that such architectures lead to state-of-the-art results in node- and graph-level classification regimes while obtaining promising results on graph-level regression tasks. We believe that this principled approach paves the way for designing new permutation-equivariant architectures to overcome the limitation of current graph neural networks. + +# Acknowledgements + +Christopher Morris is in part supported by the German Academic Exchange Service (DAAD) through a DAAD IFI postdoctoral scholarship (57515245), a RWTH Junior Principal Investigator Fellowship, and a DFG Emmy Noether grant (468502433). Gaurav Rattan is supported by the DFG Research Grants Program-RA 3242/1-1-411032549. Sia-mak Ravanbakhsh's research is in part supported by CIFAR AI Chairs program. Computational resources were provided by Mila. + +# References + +Abboud, R., Ceylan, I. I., Grohe, M., and Lukasiewicz, T. The surprising power of graph neural networks with random node initialization. CoRR, abs/2010.01179, 2020. +Anderson, B. M., Hy, T., and Kondor, R. Cormorant: Covariant molecular neural networks. In Advances in Neural Information Processing Systems 32, pp. 14510-14519, + +2019. +Arvind, V., Köbler, J., Rattan, G., and Verbitsky, O. On the power of color refinement. In International Symposium on Fundamentals of Computation Theory, pp. 339-350, 2015. +Arvind, V., Fuhlbrück, F., Köbler, J., and Verbitsky, O. On Weisfeiler-Leman invariance: Subgraph counts and related graph properties. In International Symposium on Fundamentals of Computation Theory, pp. 111-125, 2019. +Atserias, A. and Maneva, E. N. Sherali-adams relaxations and indistinguishability in counting logics. SIAM Journal on Computing, 42(1):112-137, 2013. +Atserias, A., Mancinska, L., Roberson, D. E., Sámal, R., Severini, S., and Varvitsiotis, A. Quantum and non-signalling graph isomorphisms. Journal of Combinatorial Theory, Series B, 136:289-328, 2019. +Azizian, W. and Lelarge, M. Characterizing the expressive power of invariant and equivariant graph neural networks. CoRR, abs/2006.15646, 2020. +Babai, L. Lectures on graph isomorphism. University of Toronto, Department of Computer Science. Mimeographed lecture notes, October 1979, 1979. +Babai, L. Graph isomorphism in quasipolynomial time. In ACM SIGACT Symposium on Theory of Computing, pp. 684-697, 2016. +Balcilar, M., Héroux, P., Gaüzère, B., Vasseur, P., Adam, S., and Honeine, P. Breaking the limits of message passing graph neural networks. In International Conference on Machine Learning, pp. 599-608, 2021. +Barabasi, A.-L. and Oltvai, Z. N. Network biology: Understanding the cell's functional organization. Nature Reviews Genetics, 5(2):101-113, 2004. +Barceló, P., Kostylev, E. V., Monet, M., Pérez, J., Reutter, J. L., and Silva, J. P. The logical expressiveness of graph neural networks. In International Conference on Learning Representations, 2020. +Barceló, P., Geerts, F., Reutter, J. L., and Ryschkov, M. Graph neural networks with local graph parameters. CoRR, abs/2106.06707, 2021. +Baskin, I. I., Palyulin, V. A., and Zefirov, N. S. A neural device for searching direct correlations between structures and properties of chemical compounds. Journal of Chemical Information and Computer Sciences, 37(4): 715-721, 1997. + +Beaini, D., Passaro, S., Létourneau, V., Hamilton, W. L., Corso, G., and Lio, P. Directional graph networks. CoRR, abs/2010.02863, 2020. +Berkholz, C., Bonsma, P. S., and Grohe, M. Tight lower and upper bounds for the complexity of canonical colour refinement. Theory of Computing Systems, 60(4):581-614, 2017. +Bevilacqua, B., Frasca, F., Lim, D., Srinivasan, B., Cai, C., Balamurugan, G., Bronstein, M. M., and Maron, H. Equivariant subgraph aggregation networks. CoRR, abs/2110.02910, 2021. +Bodnar, C., Frasca, F., Otter, N., Wang, Y. G., Liò, P., Montúfar, G., and Bronstein, M. M. Weisfeiler and Lehman go cellular: CW networks. CoRR, abs/2106.12575, 2021a. URL https://arxiv.org/abs/2106.12575. +Bodnar, C., Frasca, F., Wang, Y., Otter, N., Montufar, G. F., Lió, P., and Bronstein, M. Weisfeiler and Lehman go topological: Message passing simplicial networks. In International Conference on Machine Learning, pp. 1026-1037, 2021b. +Borgwardt, K. M. and Kriegel, H.-P. Shortest-path kernels on graphs. In IEEE International Conference on Data Mining, pp. 74-81, 2005. +Borgwardt, K. M., Ghisu, M. E., Llinares-López, F., O'Bray, L., and Rieck, B. Graph kernels: State-of-the-art and future challenges. Foundations and Trends in Machine Learning, 13(5-6), 2020. +Bouritsas, G., Frasca, F., Zafeiriou, S., and Bronstein, M. M. Improving graph neural network expressivity via subgraph isomorphism counting. CoRR, abs/2006.09252, 2020. +Bruna, J., Zaremba, W., Szlam, A., and LeCun, Y. Spectral networks and deep locally connected networks on graphs. In International Conference on Learning Representation, 2014. +Busacker, R. G. and Saaty, T. L. Finite graphs and networks: an introduction with applications. McGraw-Hill, 1965. +Cai, J., Fürer, M., and Immerman, N. An optimal lower bound on the number of variables for graph identifications. Combinatorica, 12(4):389-410, 1992. +Chami, I., Abu-El-Haija, S., Perozzi, B., Ré, C., and Murphy, K. Machine learning on graphs: A model and comprehensive taxonomy. CoRR, abs/2005.03675, 2020. +Chang, C.-C. and Lin, C.-J. LIBSVM: A library for support vector machines. ACM Transactions on Intelligent Systems and Technology, 2:27:1-27:27, 2011. ACM. + +Chen, G., Chen, P., Hsieh, C., Lee, C., Liao, B., Liao, R., Liu, W., Qiu, J., Sun, Q., Tang, J., Zemel, R. S., and Zhang, S. Alchemy: A quantum chemistry dataset for benchmarking AI models. CoRR, abs/1906.09427, 2019a. +Chen, Z., Villar, S., Chen, L., and Bruna, J. On the equivalence between graph isomorphism testing and function approximation with GNNs. In Advances in Neural Information Processing Systems, pp. 15868-15876, 2019b. +Chen, Z., Chen, L., Villar, S., and Bruna, J. Can graph neural networks count substructures? CoRR, abs/2002.04025, 2020. +Cotta, L., Morris, C., and Ribeiro, B. Reconstruction for powerful graph representations. In Advances in Neural Information Processing Systems, 2021. +Dasoulas, G., Santos, L. D., Scaman, K., and Virmaux, A. Coloring graph neural networks for node disambiguation. In International Joint Conference on Artificial Intelligence, pp. 2126-2132, 2020. +Defferrard, M., X., B., and Vandergheynst, P. Convolutional neural networks on graphs with fast localized spectral filtering. In Advances in Neural Information Processing Systems, pp. 3844-3852, 2016. +Dell, H., Grohe, M., and Rattan, G. Lovász meets Weisfeiler and Leman. In International Colloquium on Automata, Languages, and Programming, pp. 40:1-40:14, 2018. +Duvenaud, D. K., Maclaurin, D., Iparraguirre, J., Bombarell, R., Hirzel, T., Aspuru-Guzik, A., and Adams, R. P. Convolutional networks on graphs for learning molecular fingerprints. In Advances in Neural Information Processing Systems, pp. 2224-2232, 2015. +Easley, D. and Kleinberg, J. Networks, Crowds, and Markets: Reasoning About a Highly Connected World. Cambridge University Press, 2010. +Fey, M. and Lenssen, J. E. Fast graph representation learning with PyTorch Geometric. In International Conference on Learning Representations, Workshop on Representation Learning on Graphs and Manifolds, 2019. +Fürer, M. On the combinatorial power of the Weisfeiler-Lehman algorithm. In International Conference on Algorithms and Complexity, pp. 260-271, 2017. +Gartner, T., Flach, P., and Wrobel, S. On graph kernels: Hardness results and efficient alternatives. In Learning Theory and Kernel Machines, pp. 129-143. Springer, 2003. +Geerts, F. The expressive power of kth-order invariant graph networks. CoRR, abs/2007.12035, 2020. + +Geerts, F., Mazowiecki, F., and Pérez, G. A. Let's agree to degree: Comparing graph convolutional networks in the message-passing framework. CoRR, abs/2004.02593, 2020. +Gilmer, J., Schoenholz, S. S., Riley, P. F., Vinyals, O., and Dahl, G. E. Neural message passing for quantum chemistry. In International Conference on Machine Learning, 2017. +Grohe, M. Descriptive Complexity, Canonisation, and Definable Graph Structure Theory. Cambridge University Press, 2017. +Grohe, M. Word2vec, Node2vec, Graph2vec, X2vec: Towards a theory of vector embeddings of structured data. CoRR, abs/2003.12590, 2020. +Grohe, M. The logic of graph neural networks. In ACM/IEEE Symposium on Logic in Computer Science, pp. 1-17, 2021. +Grohe, M. and Otto, M. Pebble games and linear equations. Journal of Symbolic Logic, 80(3):797-844, 2015. +Grohe, M., Schweitzer, P., and D. W. Deep Weisfeiler +Leman. CoRR, abs/2003.10935, 2020. +Hamilton, W. L., Ying, R., and Leskovec, J. Inductive representation learning on large graphs. In Advances in Neural Information Processing Systems, pp. 1025-1035, 2017. +Heimann, M., Safavi, T., and Koutra, D. Distribution of node embeddings as multiresolution features for graphs. In IEEE International Conference on Data Mining, pp. 289-298, 2019. +Immerman, N. and Lander, E. Describing graphs: A first-order approach to graph canonization. In Complexity Theory Retrospective: In Honor of Juris Hartmanis on the Occasion of His Sixtieth Birthday, July 5, 1988, pp. 59-81, 1990. +J. Klicpera, J. Groß, S. G. Directional message passing for molecular graphs. In International Conference on Learning Representations, 2020. +Johansson, F. D. and Dubhashi, D. Learning with similarity functions on graphs using matchings of geometric embeddings. In ACM Knowledge and Data Knowledge Discovery Conference, pp. 467-476, 2015. +Jumper, J., Evans, R., Pritzel, A., Green, T., Figurnov, M., Ronneberger, O., Tunyasuvunakool, K., Bates, R., Zidek, A., Potapenko, A., Bridgland, A., Meyer, C., Kohl, S. A. A., Ballard, A. J., Cowie, A., Romero-Paredes, B., Nikolov, S., Jain, R., Adler, J., Back, T., Petersen, S., + +Reiman, D., Clancy, E., Zielinski, M., Steinegger, M., Pacholska, M., Berghammer, T., Bodenstein, S., Silver, D., Vinyals, O., Senior, A. W., Kavukcuoglu, K., Kohli, P., and Hassabis, D. Highly accurate protein structure prediction with AlphaFold. Nature, 2021. +Kashima, H., Tsuda, K., and Inokuchi, A. Marginalized kernels between labeled graphs. In International Conference on Machine Learning, pp. 321-328, 2003. +Kiefer, S. Power and Limits of the Weisfeiler-Leman Algorithm. PhD thesis, Department of Computer Science, RWTH Aachen University, 2020a. +Kiefer, S. The Weisfeiler-Leman algorithm: an exploration of its power. ACM SIGLOG News, 7(3):5-27, 2020b. +Kiefer, S. and McKay, B. D. The iteration number of Colour Refinement. In International Colloquium on Automata, Languages, and Programming, pp. 73:1-73:19, 2020. +Kiefer, S. and Schweitzer, P. Upper bounds on the quantifier depth for graph differentiation in first order logic. In ACM/IEEE Symposium on Logic in Computer Science, pp. 287-296, 2016. +Kiefer, S., Schweitzer, P., and Selman, E. Graphs identified by logics with counting. In International Symposium on Mathematical Foundations of Computer Science, pp. 319-330, 2015. +Kiefer, S., Ponomarenko, I., and Schweitzer, P. The Weisfeiler-Leman dimension of planar graphs is at most 3. Journal of the ACM, 66(6):44:1-44:31, 2019. +Kipf, T. N. and Welling, M. Semi-supervised classification with graph convolutional networks. In International Conference on Learning Representations, 2017. +Kireev, D. B. Chemnet: A novel neural network based method for graph/property mapping. Journal of Chemical Information and Computer Sciences, 35(2):175-180, 1995. ACS. +Kondor, R. and Pan, H. The multiscale Laplacian graph kernel. In Advances in Neural Information Processing Systems, pp. 2982-2990, 2016. +Kriege, N. M., Giscard, P.-L., and Wilson, R. C. On valid optimal assignment kernels and applications to graph classification. In Advances in Neural Information Processing Systems, pp. 1615-1623, 2016. +Kriege, N. M., Neumann, M., Morris, C., Kersting, K., and Mutzel, P. A unifying view of explicit and implicit feature maps for structured data: Systematic studies of graph kernels. CoRR, abs/1703.00676, 2017. Accepted for publication in Data Mining and Knowledge Discovery. + +Kriege, N. M., Morris, C., Rey, A., and Sohler, C. A property testing framework for the theoretical expressivity of graph kernels. In International Joint Conference on Artificial Intelligence, pp. 2348-2354, 2018. +Kriege, N. M., Johansson, F. D., and Morris, C. A survey on graph kernels. Applied Network Science, 5(1):6, 2020. +Li, P., Wang, Y., Wang, H., and Leskovec, J. Distance encoding: Design provably more powerful neural networks for graph representation learning. Advances in Neural Information Processing Systems, 2020. +Lichter, M., Ponomarenko, I., and Schweitzer, P. Walk refinement, walk logic, and the iteration number of the Weisfeiler-Leman algorithm. In ACM/IEEE Symposium on Logic in Computer Science, pp. 1-13, 2019. +Maehara, T. and NT, H. A simple proof of the universality of invariant/equivariant graph neural networks. CoRR, abs/1910.03802, 2019. +Malkin, P. N. Sherali-adams relaxations of graph isomorphism polytopes. Discrete Optimization, 12:73-97, 2014. +Maron, H., Ben-Hamu, H., Serviansky, H., and Lipman, Y. Provably powerful graph networks. CoRR, abs/1905.11136, 2019a. +Maron, H., Fetaya, E., Segol, N., and Lipman, Y. On the universality of invariant networks. In International Conference on Machine Learning, pp. 4363-4371, 2019b. +Merkwirth, C. and Lengauer, T. Automatic generation of complementary descriptors with molecular graph networks. Journal of Chemical Information and Modeling, 45(5):1159-1168, 2005. +Micheli, A. Neural network for graphs: A contextual constructive approach. IEEE Transactions on Neural Networks, 20(3):498-511, 2009. +Micheli, A. and Sestito, A. S. A new neural network model for contextual processing of graphs. In *Italian Workshop on Neural Nets Neural Nets and International Workshop on Natural and Artificial Immune Systems*, volume 3931 of Lecture Notes in Computer Science, pp. 10-17. Springer, 2005. +Monti, F., Boscaini, D., Masci, J., Rodolà, E., Svoboda, J., and Bronstein, M. M. Geometric deep learning on graphs and manifolds using mixture model CNNs. In IEEE Conference on Computer Vision and Pattern Recognition, pp. 5425-5434, 2017. +Morris, C., Kersting, K., and Mutzel, P. Glocalized Weisfeiler-Lehman kernels: Global-local feature maps of graphs. In IEEE International Conference on Data Mining, pp. 327-336, 2017. + +Morris, C., Ritzert, M., Fey, M., Hamilton, W. L., Lenssen, J. E., Rattan, G., and Grohe, M. Weisfeiler and leman go neural: Higher-order graph neural networks. In AAAI Conference on Artificial Intelligence, pp. 4602-4609, 2019. +Morris, C., Kriege, N. M., Bause, F., Kersting, K., Mutzel, P., and Neumann, M. TUDataset: A collection of benchmark datasets for learning with graphs. CoRR, abs/2007.08663, 2020a. +Morris, C., Rattan, G., and Mutzel, P. Weisfeiler and Le man go sparse: Towards higher-order graph embeddings. In Advances in Neural Information Processing Systems, 2020b. +Morris, C., L., Y., Maron, H., Rieck, B., Kriege, N. M., Grohe, M., Fey, M., and Borgwardt, K. Weisfeiler and Leman go machine learning: The story so far. CoRR, abs/2112.09992, 2021. +Murphy, R. L., Srinivasan, B., Rao, V. A., and Ribeiro, B. Relational pooling for graph representations. In International Conference on Machine Learning, volume 97, pp. 4663-4673, 2019. +Nikolentzos, G., Meladianos, P., and Vazirgiannis, M. Matching node embeddings for graph similarity. In AAAI Conference on Artificial Intelligence, pp. 2429-2435, 2017. +Nikolentzos, G., Meladianos, P., Limnios, S., and Vazirgian-nis, M. A degeneracy framework for graph similarity. In International Joint Conference on Artificial Intelligence, pp. 2595-2601, 2018. +NT, H. and Maehara, T. Graph homomorphism convolution. CoRR, abs/2005.01214, 2020. +Papp, P. A., K. Martinkus, L. F., and Wattenhofer, R. DropGNN: Random dropouts increase the expressiveness of graph neural networks. In Advances in Neural Information Processing Systems, 2021. +Pei, H., Wei, B., Chang, K. C., Lei, Y., and Yang, B. Geom-GCN: Geometric graph convolutional networks. In International Conference on Learning Representations, 2020. +Ramakrishnan, R., Dral, P., O., Rupp, M., and von Lilienfeld, O. A. Quantum chemistry structures and properties of 134 kilo molecules. *Scientific Data*, 1, 2014. Nature. +Rieck, B., Bock, C., and Borgwardt, K. M. A persistent Weisfeiler-Lehman procedure for graph classification. In International Conference on Machine Learning, pp. 5448-5458, 2019. + +Sato, R., Yamada, M., and Kashima, H. Random features strengthen graph neural networks. CoRR, abs/2002.03155, 2020. +Scarselli, F., Gori, M., Tsoi, A. C., Hagenbuchner, M., and Monfardini, G. The graph neural network model. IEEE Transactions on Neural Networks, 20(1):61-80, 2009. +Shervashidze, N., Vishwanathan, S. V. N., Petri, T. H., Mehlhorn, K., and Borgwardt, K. M. Efficient graphlet kernels for large graph comparison. In International Conference on Artificial Intelligence and Statistics, pp. 488-495, 2009. +Shervashidze, N., Schweitzer, P., van Leeuwen, E. J., Mehlhorn, K., and Borgwardt, K. M. Weisfeiler-Lehman graph kernels. Journal of Machine Learning Research, 12:2539-2561, 2011. +Simonovsky, M. and Komodakis, N. Dynamic edge-conditioned filters in convolutional neural networks on graphs. In IEEE Conference on Computer Vision and Pattern Recognition, pp. 29-38, 2017. +Sperduti, A. and Starita, A. Supervised neural networks for the classification of structures. IEEE Transactions on Neural Networks, 8(2):714-35, 1997. IEEE. +Stokes, J., Yang, K., Swanson, K., Jin, W., Cubillos-Ruiz, A., Donghia, N., MacNair, C., French, S., Carfrae, L., Bloom-Ackerman, Z., Tran, V., Chiappino-Pepe, A., Badran, A., Andrews, I., Chory, E., Church, G., Brown, E., Jaakkola, T., Barzilay, R., and Collins, J. A deep learning approach to antibiotic discovery. Cell, 180:688-702.e13, 02 2020. +Talak, R., Hu, S., Peng, L., and Carlone, L. Neural trees for learning on graphs. CoRR, abs/2105.07264, 2021. +Thiede, E. H., Zhou, W., and Kondor, R. Autobahn: Automorphism-based graph neural nets. CoRR, abs/2103.01710, 2021. +Togninalli, M., Ghisu, M. E., Llinares-López, F., Rieck, B., and Borgwardt, K. M. Wasserstein Weisfeiler-Lehman graph kernels. In Advances in Neural Information Processing Systems, pp. 6436-6446, 2019. +Tönshoff, J., Ritzert, M., Wolf, H., and Grohe, M. Graph learning with 1D convolutions on random walks. CoRR, abs/2102.08786, 2021. +Topping, J., Giovanni, F. D., Chamberlain, B. P., Dong, X., and Bronstein, M. M. Understanding over-squashing and bottlenecks on graphs via curvature. CoRR, abs/2111.14522, 2021. +Valiente, G. Algorithms on Trees and Graphs. Springer, 2002. + +Veličković, P., Cucurull, G., Casanova, A., Romero, A., L. P., and Bengio, Y. Graph attention networks. In International Conference on Learning Representations, 2018. +Verma, S. and Zhang, Z. Hunt for the unique, stable, sparse and fast feature learning on graphs. In Advances in Neural Information Processing Systems 30, pp. 88-98, 2017. +Vignac, C., Loukas, A., and Frossard, P. Building powerful and equivariant graph neural networks with structural message-passing. In Advances in Neural Information Processing Systems, 2020. +Vinyals, O., Bengio, S., and Kudlur, M. Order matters: Sequence to sequence for sets. In International Conference on Learning Representations, 2016. +Wagstaff, E., Fuchs, F. B., Engelcke, M., Osborne, M. A., and Posner, I. Universal approximation of functions on sets. CoRR, abs/2107.01959, 2021. +Weisfeiler, B. On Construction and Identification of Graphs. Lecture Notes in Mathematics, Vol. 558. Springer, 1976. +Weisfeiler, B. and Leman, A. The reduction of a graph to canonical form and the algebra which appears therein. Nauchno-Technicheskaya Informatsia, 2 (9):12-16, 1968. English translation by G. Ryabov is available at https://www.iti.zcu.cz/wl2018/pdf/wl_paper Translation.pdf. +Wu, Z., Ramsundar, B., Feinberg, E. N., Gomes, J., Geniesse, C., Pappu, A. S., Leswing, K., and Pande, V. MoleculeNet: A benchmark for molecular machine learning. Chemical Science, 9:513-530, 2018. +Xu, K., Hu, W., Leskovec, J., and Jegelka, S. How powerful are graph neural networks? International Conference on Machine Learning, 2019. +Yanardag, P. and Vishwanathan, S. V. N. A structural smoothing framework for robust graph comparison. In Advances in Neural Information Processing Systems, pp. 2125-2133, 2015a. +Yanardag, P. and Vishwanathan, S. V. N. Deep graph kernels. In Knowledge Discovery and Data Mining Conference, pp. 1365-1374, 2015b. +You, J., Gomes-Selman, J., Ying, R., and Leskovec, J. Identity-aware graph neural networks. CoRR, abs/2101.10320, 2021. +Zhang, M. and Li, P. Nested graph neural networks. CoRR, abs/2110.13197, 2021. +Zhao, L., Jin, W., Akoglu, L., and Shah, N. From stars to subgraphs: Uplifting any GNN with local structure awareness. CoRR, abs/2110.03753, 2021. + +# Appendix + +# A. Related work (extended) + +In the following, we review related work from graph theory. + +Theorem The Weisfeiler-Leman algorithm constitutes one of the earliest and most natural approaches to isomorphism testing (Weisfeiler, 1976; Weisfeiler & Leman, 1968), having been heavily investigated by the theory community over the last few decades (Grohe, 2017). Moreover, the fundamental nature of the $k$ -WL is evident from a variety of connections to other fields such as logic, optimization, counting complexity, and quantum computing. The power and limitations of $k$ -WL can be neatly characterized in terms of logic and descriptive complexity (Babai, 1979; Immerman & Lander, 1990), Sherali-Adams relaxations of the natural integer linear program for the graph isomorphism problem (Atserias & Maneva, 2013; Grohe & Otto, 2015; Malkin, 2014), homomorphism counts (Dell et al., 2018), and quantum isomorphism games (Atserias et al., 2019). In their seminal paper, Cai et al. (1992) showed that, for each $k$ , there exists a pair of non-isomorphic graphs of size $\mathcal{O}(k)$ that are not distinguished by the $k$ -WL. (Kiefer, 2020a,b) gives a thorough survey of these results. For $k = 1$ , the power of the algorithm has been completely characterized (Arvind et al., 2015; Kiefer et al., 2015). Moreover, upper bounds on the running time (Berkholz et al., 2017) and the number of iterations for $k = 1$ (Kiefer & McKay, 2020) and for the folklore $k = 2$ (Kiefer & Schweitzer, 2016; Lichter et al., 2019) have been shown. For $k$ in $\{1,2\}$ , Arvind et al. (2019) studied the abilities of the (folklore) $k$ -WL to detect and count fixed subgraphs, extending the work of Fürer (2017). The former was refined in (Chen et al., 2020). Kiefer et al. (2019) showed that the folklore 3-WL completely captures the structure of planar graphs. The algorithm (for logarithmic $k$ ) plays a prominent role in the recent result of (Babai, 2016) improving the best-known running time for the graph isomorphism problem. Recently, Grohe et al. (2020) introduced the framework of Deep Weisfeiler-Leman algorithms, which allow the design of a more powerful graph isomorphism test than Weisfeiler-Leman type algorithms. Finally, the emerging connections between the Weisfeiler-Leman paradigm and graph learning are described in two recent surveys (Grohe, 2020; Morris et al., 2021). + +# B. Preliminaries + +As usual, let $[n] := \{1, \ldots, n\} \subset \mathbb{N}$ for $n \geq 1$ , and we use $\{\{\ldots\}\}$ to denote multisets, i.e., the generalization of sets allowing for multiple instances for each of its elements. + +Graphs A graph $G$ is a pair $(V(G), E(G))$ with finite sets of nodes $V(G)$ and edges $E(G) \subseteq \{\{u, v\} \subseteq V \mid u \neq v\}$ . If not otherwise stated, we set $n := |V(G)|$ . For ease of notation, we denote the edge $\{u, v\}$ in $E(G)$ by $(u, v)$ or $(v, u)$ . In the case of directed graphs, $E \subseteq \{(u, v) \in V \times V \mid u \neq v\}$ . A labeled graph $G$ is a triple $(V, E, \ell)$ with a label function $\ell: V(G) \cup E(G) \to \mathbb{N}$ . Then $\ell(v)$ is a label of $x$ for $x$ in $V(G) \cup E(G)$ . The neighborhood of $v$ in $V(G)$ is denoted by $\delta(v) = \{u \in V(G) \mid (v, u) \in E(G)\}$ and the degree of a node $v$ is $|\delta(v)|$ . Let $S \subseteq V(G)$ then $G[S] = (S, E_S)$ is the subgraph induced by $S$ , where $E_S = \{(u, v) \in E(G) \mid u, v \in S\}$ . A connected component of a graph $G$ is an inclusion-wise maximal subgraph of $G$ in which every two nodes are connected by paths. A tree is a connected graph without cycles. A rooted tree is an oriented tree with a designated node called root, in which the edges are directed away from the root. Let $p$ be a node in a rooted tree. Then we call its out-neighbors children with parent $p$ . We denote an undirected cycle on $k$ nodes by $C_k$ . Given two graphs $G$ and $H$ with disjoint node sets, we denote their disjoint union by $G \dot{\cup} H$ . + +Two graphs $G$ and $H$ are isomorphic and we write $G \simeq H$ if there exists a bijection $\varphi \colon V(G) \to V(H)$ preserving the adjacency relation, i.e., $(u, v)$ is in $E(G)$ if and only if $(\varphi(u), \varphi(v))$ is in $E(H)$ . Then $\varphi$ is an isomorphism between $G$ and $H$ . Moreover, we call the equivalence classes induced by $\simeq$ isomorphism types, and denote the isomorphism type of $G$ by $\tau_G$ . In the case of labeled graphs, we additionally require that $\ell(v) = \ell(\varphi(v))$ for $v$ in $V(G)$ and $\ell((u, v)) = \ell((\varphi(u), \varphi(v)))$ for $(u, v)$ in $E(G)$ . Let $\mathbf{v}$ be a tuple in $V(G)^k$ for $k > 0$ , then $G[\mathbf{v}]$ is the subgraph induced by the multiset of elements of $\mathbf{v}$ , where the nodes are labeled with integers from $\{1, \ldots, k\}$ corresponding to their positions in $\mathbf{v}$ . + +Equivalence For $n > 0$ , let $S_{n}$ denote the set of all permutations of $[n]$ , i.e., the set of all bijections from $[n]$ to itself. For $\sigma$ in $S_{n}$ and a graph $G$ such that $V(G) = [n]$ , let $G_{\sigma} = \sigma \cdot G$ be the graph such that $V(\sigma \cdot G) = \{v_{\sigma^{-1}(1)}, \ldots, v_{\sigma^{-1}(n)}\}$ and $E(G_{\sigma}) = \{(v_{\sigma^{-1}(i)}, v_{\sigma^{-1}(j)}) \mid (v_i, v_j) \in E(G)\}$ . That is, applying the permutation $\sigma$ reorders the nodes. Hence, for two isomorphic graphs $G$ and $H$ on the same vertex set, i.e., $G \simeq H$ , there exists $\sigma$ in $S_{n}$ such that $\sigma \cdot G = H$ . + +Let $\mathcal{G}$ denote the set of all graphs, and let $\mathcal{G}_n$ denote the set of all graphs on $n$ nodes. A function $f\colon \mathcal{G}\to \mathbb{R}$ is invariant if for every $n > 0$ and every $\sigma$ in $S_{n}$ and graph $G$ , $f(\sigma \cdot G) = f(G)$ . A function $f\colon \mathcal{G}\mapsto \mathcal{G}$ is equivariant if for every $n > 0$ , $f(\mathcal{G}_n)\subseteq \mathcal{G}_n$ and for every $\sigma$ in $S_{n}$ , $f(\sigma \cdot G) = \sigma \cdot f(G)$ . + +Kernels A kernel on a non-empty set $\mathcal{X}$ is a symmetric, positive semidefinite function $k\colon \mathcal{X}\times \mathcal{X}\to \mathbb{R}$ . Equivalently, a function $k\colon \mathcal{X}\times \mathcal{X}\to \mathbb{R}$ is a kernel if there is a feature map $\phi \colon \mathcal{X}\to \mathcal{H}$ to a Hilbert space $\mathcal{H}$ with inner product $\langle \cdot ,\cdot \rangle$ , such that $k(x,y) = \langle \phi (x),\phi (y)\rangle$ for all $x$ and $y$ in $\mathcal{X}$ . A graph kernel is a kernel on the set $\mathcal{G}$ of all graphs. + +# B.1. Node-refinement algorithms (extended) + +In the following, we briefly describe the Weisfeiler-Leman algorithm and related variants (Morris et al., 2020b). Let $k$ be a fixed positive integer. There exist two definitions of the $k$ -WL, the so-called oblivious $k$ -WL and folklore or non-oblivious $k$ -WL, in literature, see, e.g., (Grohe, 2021). There is a subtle difference in how they aggregate neighborhood information. Within the graph learning community, it is customary to abbreviate the oblivious $k$ -WL as $k$ -WL, a convention that we follow in this paper. + +We proceed to the definition of the $k$ -WL. Let $V(G)^{k}$ denote the set of $k$ -tuples of nodes of the graph $G$ . A coloring of $V(G)^{k}$ is a mapping $C \colon V(G)^{k} \to \mathbb{N}$ , i.e., we assign a number (color) to every tuple in $V(G)^{k}$ . The initial coloring $C_{0}$ of $V(G)^{k}$ is specified by the atomic types of the tuples, i.e., two tuples $\mathbf{v}$ and $\mathbf{w}$ in $V(G)^{k}$ have the same initial color iff mapping $v_{i} \mapsto w_{i}$ induces an isomorphism between the labeled subgraphs $G[\mathbf{v}]$ and $G[\mathbf{w}]$ . Note that, given a tuple $\mathbf{v}$ in $V(G)^{k}$ , we can upper-bound the running time of the computation of this initial coloring for $\mathbf{v}$ by $\mathcal{O}(k^{2})$ . A color class corresponding to a color $c$ is the set of all tuples colored $c$ , i.e., the set $C^{-1}(c)$ . + +For $j$ in $[k]$ and $w$ in $V(G)$ , let $\phi_j(\mathbf{v}, w)$ be the $k$ -tuple obtained by replacing the $j$ th component of $\mathbf{v}$ with the node $w$ . That is, $\phi_j(\mathbf{v}, w) = (v_1, \ldots, v_{j-1}, w, v_{j+1}, \ldots, v_k)$ . If $\mathbf{w} = \phi_j(\mathbf{v}, w)$ for some $w$ in $V(G)$ , call $\mathbf{w}$ a $j$ -neighbor of $\mathbf{v}$ . The neighborhood of $\mathbf{v}$ is the set of all $\mathbf{w}$ such that $\mathbf{w} = \phi_j(\mathbf{v}, w)$ for some $j$ in $[k]$ and a $w \in V(G)$ . + +The refinement of a coloring $C\colon V(G)^k\to \mathbb{N}$ , denoted by $\widehat{C}$ , is a coloring $\widehat{C}\colon V(G)^k\to \mathbb{N}$ defined as follows. For each $j$ in $[k]$ , collect the colors of the $j$ -neighbors of $\mathbf{v}$ in a multiset $S_{j} = \{\{C(\phi_{j}(\mathbf{v},w))\mid w\in V(G)\}\}$ . Then, for a tuple $\mathbf{v}$ , define + +$$ +\widehat {C} (\mathbf {v}) := (C (\mathbf {v}), M (\mathbf {v})), +$$ + +where $M(\mathbf{v})$ is the $k$ -tuple $(S_1, \ldots, S_k)$ . For consistency, the strings $\widehat{C}(\mathbf{v})$ thus obtained are lexicographically sorted and renamed as integers, not used in previous iterations. Observe that the new color $\widehat{C}(\mathbf{v})$ of $\mathbf{v}$ is solely dictated by the color histogram of the neighborhood of $\mathbf{v}$ . In general, a different mapping $M(\cdot)$ could be used, depending on the neighborhood information that we would like to aggregate. We will refer to a mapping $M(\cdot)$ as an aggregation map. + +$k$ -dimensional Weisfeiler-Leman For $k \geq 2$ , the $k$ -WL computes a coloring $C_{\infty} \colon V(G)^{k} \to \mathbb{N}$ of a given graph $G$ , as follows. To begin with, the initial coloring $C_0$ is computed. Then, starting with $C_0$ , successive refinements $C_{i+1} = \widehat{C_i}$ are computed until convergence. That is, + +$$ +C _ {i + 1} (\mathbf {v}) = (C _ {i} (\mathbf {v}), M _ {i} (\mathbf {v})), +$$ + +where + +$$ +M _ {i} (\mathbf {v}) = \left(\left\{\left\{C _ {i} \left(\phi_ {1} (\mathbf {v}, w)\right) \mid w \in V (G) \right\} \right\}, \dots , \left\{\left\{C _ {i} \left(\phi_ {k} (\mathbf {v}, w)\right) \mid w \in V (G) \right\} \right\}\right). \tag {3} +$$ + +The successive refinement steps are also called rounds or iterations. Since the disjoint union of the color classes form a partition of $V(G)^k$ , there must exist a finite $\ell \leq |V(G)|^k$ such that $C_\ell = \widehat{C_\ell}$ , i.e., the partition induced by $C_\ell$ cannot be refined further. The $k$ -WL outputs $C_\ell$ as the stable coloring $C_\infty$ . + +The $k$ -WL distinguishes two graphs $G$ and $H$ if, upon running the $k$ -WL on their disjoint union $G \dot{\cup} H$ , there exists a color $c$ in $\mathbb{N}$ in the stable coloring such that the corresponding color class $S_{c}$ satisfies + +$$ +| V (G) ^ {k} \cap S _ {c} | \neq | V (H) ^ {k} \cap S _ {c} |, +$$ + +i.e., there the numbers of $c$ -colored tuples in $V(G)^k$ and $V(H)^k$ differ. Two graphs that are distinguished by the $k$ -WL must be non-isomorphic, because the algorithm is defined in an isomorphism-invariant way. + +Finally, the application of different aggregation maps $M(\cdot)$ yield related versions of $k$ -WL. For example, setting $M(\cdot)$ to be + +$$ +M ^ {F} (\mathbf {v}) = \{\left\{\left(C \left(\phi_ {1} (\mathbf {v}, w)\right), \dots , C \left(\phi_ {k} (\mathbf {v}, w)\right)\right) \mid w \in V (G) \right\}, +$$ + +yields the so-called folklore-version of $k$ -WL (see e.g. (Cai et al., 1992)). It is known that the oblivious version of the $k$ -WL is as powerful as the folklore version of the $(k - 1)$ -WL (Grohe, 2021). + +Local $\delta$ - $k$ -dimensional Weisfeiler-Leman algorithm Morris et al. (2020b) introduced a more efficient variant of the $k$ -WL, namely the local $\delta$ - $k$ -dimensional Weisfeiler-Leman algorithm ( $\delta$ - $k$ -LWL). In contrast to the $k$ -WL, the $\delta$ - $k$ -LWL considers only a subset of the entire neighborhood of a node tuple. Let the tuple $\mathbf{w} = \phi_j(\mathbf{v}, w)$ be a $j$ -neighbor of $\mathbf{v}$ . We say that $\mathbf{w}$ is a local $j$ -neighbor of $\mathbf{v}$ if $w$ is adjacent to the replaced node $v_j$ . Otherwise, the tuple $\mathbf{w}$ is a global $j$ -neighbor of $\mathbf{v}$ . The $\delta$ - $k$ -LWL considers only local neighbors during the neighborhood aggregation process, and discards any information about the global neighbors. Formally, the $\delta$ - $k$ -LWL algorithm refines a coloring $C_i^{k,\delta}$ (obtained after $i$ rounds of $\delta$ - $k$ -LWL) via the aggregation function, + +$$ +M _ {i} ^ {\delta} (\mathbf {v}) = \left(\left\{\left\{C _ {i} ^ {k, \delta} \left(\phi_ {1} (\mathbf {v}, w)\right) \mid w \in \delta \left(v _ {1}\right) \right\} \right\}, \dots , \left\{\left\{C _ {i} ^ {k, \delta} \left(\phi_ {k} (\mathbf {v}, w)\right) \mid w \in \delta \left(v _ {k}\right) \right\} \right\}\right), \tag {4} +$$ + +hence considering only the local $j$ -neighbors of the tuple $\mathbf{v}$ in each iteration. The coloring function for the $\delta - k$ -LWL is then defined by + +$$ +C _ {i + 1} ^ {k, \delta} (\mathbf {v}) = \left(C _ {i} ^ {k, \delta} (\mathbf {v}), M _ {i} ^ {\delta} (\mathbf {v})\right). \tag {5} +$$ + +We define the 1-WL to be the $\delta$ -1-LWL, which is commonly known as Color Refinement or Naive Node Classification. Hence, we can equivalently define + +$$ +C _ {i + 1} ^ {1, \delta} (v) = \left(C _ {i} ^ {1, \delta} (v), \{\{C _ {i} ^ {1, \delta} (w) \mid w \in \delta (v) \}\}\right). \tag {6} +$$ + +for a node $v$ in $V(G)$ + +Morris et al. (2020b) also defined the $\delta - k$ -LWL $^{\perp}$ , a minor variation of the $\delta - k$ -LWL. Formally, the $\delta - k$ -LWL $^{\perp}$ refines a coloring $C_i$ (obtained after $i$ rounds) via the aggregation function + +$$ +\begin{array}{l} M ^ {\delta , +} (\mathbf {v}) = \left(\left\{\left(C _ {i} ^ {k, \delta} \left(\phi_ {1} (\mathbf {v}, w)\right), \# _ {i} ^ {1} (\mathbf {v}, \phi_ {1} (\mathbf {v}, w))\right) \mid w \in \delta (v _ {1}) \right\}, \dots , \right. \\ \left. \left\{\left(C _ {i} ^ {k, \delta} \left(\phi_ {k} (\mathbf {v}, w)\right), \# _ {i} ^ {k} \left(\mathbf {v}, \phi_ {k} (\mathbf {v}, w)\right)\right) \mid w \in \delta \left(v _ {k}\right) \right\} \right\}, \tag {7} \\ \end{array} +$$ + +instead of the $\delta$ - $k$ -LWL aggregation defined in Equation (4). Here, we set + +$$ +\# _ {i} ^ {j} (\mathbf {v}, \mathbf {x}) := | \left\{\mathbf {w}: \mathbf {w} \sim_ {j} \mathbf {v}, C _ {i} ^ {k, \delta} (\mathbf {w}) = C _ {i} ^ {k, \delta} (\mathbf {x}) \right\} |, \tag {8} +$$ + +where $\mathbf{w} \sim_{j} \mathbf{v}$ denotes that $\mathbf{w}$ is a $j$ -neighbor of $\mathbf{v}$ , for $j$ in $[k]$ . Essentially, $\#_i^j(\mathbf{v}, \mathbf{x})$ counts the number of $j$ -neighbors (local or global) of $\mathbf{v}$ which have the same color as $\mathbf{x}$ under the coloring $C_i$ (i.e., after $i$ rounds). Morris et al. (2020b) showed that the $\delta-k-LW^+$ is slightly more powerful than the $k$ -WL in distinguishing non-isomorphic graphs. + +# C. The $(k, s)$ -LWL algorithm (extended) + +Since both $k$ -WL and its local variant $\delta$ - $k$ -LWL consider all $k$ -tuples of a graph, they do not scale to large graphs for larger $k$ . Specifically, for an $n$ -node graph, the memory requirement is $\Omega(n^k)$ . Further, since the $k$ -WL considers the graph structure only at initialization, it does not adapt to its sparsity, i.e., it does not run faster for sparser graphs. To address this issue, we introduce the $(k, s)$ -LWL. The algorithm offers more fine-grained control over the trade-off between expressivity and scalability by only considering a subset of all $k$ -tuples, namely those inducing subgraphs with at most $s$ connected components. This combinatorial algorithm will be the basis of the permutation-equivariant neural architectures of Section 4. + +Formally, let $G$ be a graph, then $\# \operatorname{com}(G)$ denotes the number of (connected) components of $G$ . Further, let $k \geq 1$ and $1 \leq s \leq k$ , then + +$$ +V (G) _ {s} ^ {k} := \left\{\mathbf {v} \in V (G) ^ {k} \mid \# \operatorname {c o m} (G [ \mathbf {v} ]) \leq s \right\} +$$ + +is the set of $(k,s)$ -tuples of nodes, i.e., $k$ -tuples which induce (sub-)graphs with at most $s$ (connected) components. + +In contrast to the algorithms of Appendix B.1, the $(k,s)$ -LWL colors tuples from $V(G)_s^k$ instead of the entire $V(G)^k$ . Hence, analogously to Appendix B.1, a coloring of $V(G)_s^k$ is a mapping $C_i^{k,s}: V(G)_s^k \to \mathbb{N}$ for $i \geq 0$ , assigning a number (color) to every tuple in $V(G)_s^k$ . The initial coloring $C_0^{k,s}$ of $V(G)_s^k$ is defined in the same way as before, i.e., specified by the isomorphism types of the tuples. Subsequently, the coloring is updated using the $\delta$ - $k$ -LWL aggregation map, see Equation (4). Hence, the $(k,s)$ -LWL is a variant of the $\delta$ - $k$ -LWL considering only $(k,s)$ -tuples, i.e., Equation (4) is replaced with + +$$ +\begin{array}{l} M _ {i} ^ {\delta , k, s} (\mathbf {v}) := \left(\left\{\left\{C _ {i} ^ {k, s} \left(\phi_ {1} (\mathbf {v}, w)\right) \mid w \in \delta \left(v _ {1}\right) \text {a n d} \phi_ {1} (\mathbf {v}, w) \in V (G) _ {s} ^ {k} \right\}, \right. \right. \tag {9} \\ \ldots , \left\{\left. C _ {i} ^ {k, s} \left(\phi_ {k} (\mathbf {v}, w)\right) \mid w \in \delta \left(v _ {k}\right) \text {a n d} \phi_ {k} (\mathbf {v}, w) \in V (G) _ {s} ^ {k} \right\} \right\}, \\ \end{array} +$$ + +i.e., $M_i^\delta(\mathbf{v})$ restricted to colors of $(k, s)$ -tuples. The stable coloring $C_\infty^{k,s}$ is defined analogously to the stable coloring $C_\infty^k$ . In the following two subsections, we investigate the properties of the algorithm in detail. + +Analogously to the $\delta -k$ -LWL $^+$ , we also define the $(k,s)$ -LWL $^+$ using + +$$ +\begin{array}{l} M ^ {\delta , +} (\mathbf {v}) = \left(\left\{\left(C _ {i} ^ {k, s} \left(\phi_ {1} (\mathbf {v}, w)\right), \# _ {i, s} ^ {1} (\mathbf {v}, \phi_ {1} (\mathbf {v}, w))\right) \mid w \in \delta (v _ {1}) \text {a n d} \phi_ {1} (\mathbf {v}, w) \in V (G) _ {s} ^ {k} \right\}, \dots , \right. \\ \left. \left\{\left(C _ {i} ^ {k, s} \left(\phi_ {k} (\mathbf {v}, w)\right), \# _ {i, s} ^ {k} \left(\mathbf {v}, \phi_ {k} (\mathbf {v}, w)\right)\right) \mid w \in \delta \left(v _ {k}\right) \text {a n d} \phi_ {k} (\mathbf {v}, w) \in V (G) _ {s} ^ {k} \right\}\right), \\ \end{array} +$$ + +where the function + +$$ +\# _ {i, s} ^ {j} (\mathbf {v}, \mathbf {x}) = \left| \left\{\mathbf {w}: \mathbf {w} \sim_ {j} \mathbf {v}, C _ {i} ^ {k, s} (\mathbf {w}) = C _ {i} ^ {k, s} (\mathbf {x}) \text {a n d} \mathbf {w} \in V (G) _ {s} ^ {k} \right\} \right|, +$$ + +restricts $\#_i^j (\mathbf{v},\mathbf{x})$ to $(k,s)$ -tuples. + +Here, we investigate the expressivity of the $(k,s)$ -LWL, i.e., its ability to distinguish non-isomorphic graphs, for different choices of $k$ and $s$ . In Section 4, we will leverage these results to devise universal, permutation-equivariant graph networks. We start off with the following simple observation. Since the $(k,k)$ -LWL colors all $k$ -tuples, it is equal to the $\delta$ - $k$ -LWL. + +Observation 2. Let $k \geq 1$ , then + +$$ +(k, k) \text {- L W L} \equiv \delta - k \text {- L W L} \quad \text {a n d} \quad (1, 1) \text {- L W L} \equiv \delta - k \text {- L W L} \equiv 1 \text {- W L}. +$$ + +The following result shows that the $(k,1)$ -LWL form a hierarchy, i.e., the algorithm becomes more expressive as $k$ increases. + +Theorem 5. Let $k\geq 1$ , then + +$$ +(k + 1, 1) - \mathrm {L W L} \sqsubset (k, 1) - \mathrm {L W L}. +$$ + +Moreover, we also show that the $(k,2)$ -LWL is more expressive than the $(k,1)$ -LWL. + +Proposition 6. For $k \geq 2$ , it holds that + +$$ +(k, 2) \text {- L W L} \square (k, 1) \text {- L W L}. +$$ + +Further, the following theorem yields that increasing the parameter $s$ results in higher expressivity. Formally, we show that the $(k,k)$ -LWL is strictly more expressive than the $(k,2)$ -LWL. + +Theorem 7. For $k \geq 2$ , it holds that + +$$ +(k, k) - \mathrm {L W L} \square (k, 2) - \mathrm {L W L}. +$$ + +See Appendix C.1 for an analysis of the asymptotic running time of the $(k,s)$ -LWL, showing that it only depends on $k$ , $s$ , and the sparsity of the graph. In particular, the running time of the $(k,s)$ -LWL on an $n$ -vertex graph of bounded degree is $\tilde{\mathcal{O}}(n^s)$ instead of the usual $\tilde{\mathcal{O}}(n^k)$ for the $k$ -WL, for fixed $k$ and $s$ . + +# C.0.1. PROOFS OF THEOREMS 1 AND 3 AND PROPOSITION 2 + +To prove Theorem 1, we introduce the $(k,s)$ -tuple graph. It essentially contains all $(k,s)$ -tuples as nodes, where each node $v_{\mathbf{t}}$ is labeled by the isomorphism type of the $(k,s)$ -tuple $\mathbf{t}$ . We join two nodes by an edge, labeled $j$ , if the underlying $(k,s)$ -tuples are $j$ -neighbors. The formal definition of the $(k,s)$ -tuple graph is as follows. Recall that $\tau$ denotes an isomorphism type. + +![](images/ed25475afa9783f097bb073d9e3415a2b9ebdf69badbb1bcb1dfd24b3a71e676.jpg) +(a) +Figure 2. Illustration of the unrolling operation around the node $a$ for $i = 2$ . + +![](images/9c69e1ec95f0af507d88d83f4fd87bfc7b6b0a70037d6f39b6de4056a58c7410.jpg) +(b) + +Definition 8. Let $G$ be a graph and let $k \geq 1$ , and $s$ in $[k]$ . Further, let $\mathbf{s}$ and $\mathbf{t}$ be tuples in $V(G)_s^k$ . Then the directed, labeled $(k,s)$ -tuple graph $T_s^k(G) = (V_T, E_T, \ell_T)$ has node set $V_T = \{v_{\mathbf{t}} \mid \mathbf{t} \in V(G)_s^k\}$ , and + +$$ +\left(v _ {\mathbf {s}}, v _ {\mathbf {t}}\right) \in E _ {T} \Longleftrightarrow \mathbf {t} = \phi_ {j} (\mathbf {s}, w) \text {h o l d s f o r s o m e} j \text {i n} [ k ] \text {a n d s o m e} w \text {i n} V (G). \tag {10} +$$ + +We set $\ell_T((v_{\mathbf{s}}, v_{\mathbf{t}})) \coloneqq j$ if $\mathbf{t}$ is a local $j$ -neighbor of $\mathbf{s}$ , and let $\ell_T(v_{\mathbf{s}}) \coloneqq \tau_{G[\mathbf{s}]}$ . + +Given a graph $G$ and the corresponding $(k,s)$ -tuple graph $T_{s}^{k}(G)$ , we define a variant of the 1-WL, which takes into account edge labels. Namely, for $v_{\mathbf{t}}$ in $V_{T}$ , the new algorithm uses the colorings $C_0^{1,\delta,*}(v_{\mathbf{t}}) = \tau_{G[\mathbf{t}]}$ and + +$$ +C _ {i + 1} ^ {1, \delta , *} (v _ {\mathbf {t}}) = \left(C _ {i} ^ {1, \delta , *} (v _ {\mathbf {t}}), \{\left\{\left(C _ {i} ^ {1, \delta , *} (v _ {\mathbf {s}}), \ell \left(v _ {\mathbf {t}}, v _ {\mathbf {s}}\right)\right) \mid v _ {\mathbf {s}} \in \delta \left(v _ {\mathbf {t}}\right) \right\} \right. \} \tag {11} +$$ + +for $i > 0$ . Note that the 1-WL, see Equation (6), and the variant defined via Equation (11) have the same asymptotic running time. The following lemma states that the $(k,s)$ -LWL can be simulated on the $(k,s)$ -tuple graph using the above variant of the 1-WL. + +Lemma 9. Let $G$ be a graph, $k \geq 1$ , and $s$ in $[k]$ . Then + +$$ +C _ {i} ^ {k, s} (\mathbf {t}) = C _ {i} ^ {k, s} (\mathbf {u}) \iff C _ {i} ^ {1, \delta , *} (v _ {\mathbf {t}}) = C _ {i} ^ {1, \delta , *} (v _ {\mathbf {u}}), +$$ + +for all $i\geq 0$ , and all $(k,s)$ -tuples $\mathbf{t}$ and $\mathbf{u}$ in $V(G)_s^k$ + +Proof sketch. Induction on the number of iterations using Definition 8. + +The unrolling of a neighborhood around a node of a given graph to a tree is defined as follows, see Figure 2 for an illustration. + +Definition 10. Let $G = (V, E, \ell)$ be a labeled (directed) graph and let $v$ be in $V$ . Then $U_{G,v}^{i} = (W_{i}, F_{i}, l_{i})$ for $i \geq 0$ denotes the unrolled tree $G$ around $v$ at depth $i$ , where + +$$ +W _ {i} = \left\{ \begin{array}{l l} \{v _ {(0, v)} \} & \quad \text {i f i = 0} \\ W _ {i - 1} \cup \{u _ {(i, w _ {(i - 1, p)})} \mid u \in \delta (w) \text {f o r} w _ {(i - 1, p)} \in W _ {i - 1} \} & \quad \text {o t h e r w i s e}, \end{array} \right. +$$ + +and + +$$ +F _ {i} = \left\{ \begin{array}{l l} \emptyset & \text {i f i = 0} \\ F _ {i - 1} \cup \{(w _ {(i - 1, p)}, u _ {(i, w)}) \mid u \in \delta (w) \text {f o r} w _ {(i - 1, p)} \in W _ {i - 1} \} & \text {o t h e r w i s e .} \end{array} \right. +$$ + +The label function is defined as $l_{i}(u_{(j,p)}) = \ell(u)$ for $u$ in $V$ , and $l_{i}(u_{(j,w)}) = \ell((w,u))$ . For notational convenience, we usually omit the subscript $i$ . + +In the following, we use the unrolled tree for the above defined $(k,s)$ -tuple graph. For $k\geq 2$ and $s$ in $[k]$ , we denote the directed, unrolled tree of the $(k,s)$ -tuple graph of $G$ around the node $v_{\mathbf{t}}$ at depth $i$ for the tuple $\mathbf{t}$ in $V(G)_s^k$ by $\mathbf{U}_{T_s^k (G),v_{\mathbf{t}}}^i$ . For notational convenience, we write $\mathbf{U}_{T,v_{\mathbf{t}}}^{i}$ for $\mathbf{U}_{T_s^k (G),v_{\mathbf{t}}}^i$ . Further, for two $(k,s)$ -tuples $\mathbf{t}$ and $\mathbf{u}$ , we write + +$$ +\mathbf {U} _ {T, v _ {\mathbf {t}}} ^ {i} \simeq_ {v _ {\mathbf {t}} \rightarrow v _ {\mathbf {u}}} \mathbf {U} _ {T, v _ {\mathbf {u}}} ^ {i} \tag {12} +$$ + +![](images/c1484948a8d8158f273983e7c4a1a4621a4c777dbd994dac42312033b05eebfa.jpg) +(a) + +![](images/1cd4881f6c299463ddc5691f246c4c02ca9c70739ac08e0753608fcdb8253a33.jpg) +(b) +Figure 3. The graphs $A_{k + 2}$ and $B_{k + 2}$ for $k = 4$ . + +if there exists a (labeled) isomorphism $\varphi$ between the two unrolled trees, mapping the (root) node $v_{\mathbf{t}}$ to $v_{\mathbf{u}}$ . Moreover, we need the following two results. + +Theorem 11 ((Busacker & Saaty, 1965; Valiente, 2002)). The 1-WL distinguishes any two directed, labeled non-isomorphic trees. + +Using the first result, the second one states that the $(k,s)$ -LWL can be simulated by the variant of the 1-WL of Equation (11) on the unrolled tree of the $(k,s)$ -tuple graph, and hence can be reduced to a tree-isomorphism problem. + +Lemma 12. Let $G$ be a connected graph, then the $(k,s)$ -LWL colors the tuples $\mathbf{t}$ and $\mathbf{u}$ in $V(G)_s^k$ equally if and only if the corresponding unrolled $(k,s)$ -tuple trees are isomorphic, i.e., + +$$ +C _ {i} ^ {k, s} (\mathbf {t}) = C _ {i} ^ {k, s} (\mathbf {u}) \iff \mathbf {U} _ {T, v _ {\mathbf {t}}} ^ {i} \simeq_ {v _ {\mathbf {t}} \to v _ {\mathbf {u}}} \mathbf {U} _ {T, v _ {\mathbf {u}}} ^ {i}, +$$ + +for all $i\geq 0$ + +Proof sketch. First, by Lemma 9, we can simulate the $(k,s)$ -LWL for the graph $G$ using the $(k,s)$ -tuple graph $T_s^k(G)$ . Secondly, consider a node $v_t$ in the $(k,s)$ -tuple graph $T_s^k(G)$ and a corresponding node in the unrolled tree around $v_t$ . Observe that the neighborhoods for both nodes are identical. By definition, this holds for all nodes (excluding the leaves) in the unrolled tree. Hence, by Lemma 9, we can simulate the $(k,s)$ -LWL for each tuple $t$ by running the 1-WL in the unrolled tree around $v_t$ in the $(k,s)$ -tuple graph. Since the 1-WL decides isomorphism for trees, see Theorem 11, the result follows. + +The following lemma shows that the $(k + 1,1)$ -LWL is strictly more expressive than the $(k,1)$ -LWL for every $k \geq 2$ . + +Lemma 13. Let $k \geq 2$ . Let $G \coloneqq C_{2(k + 2)}$ and $H \coloneqq C_{(k + 2)} \dot{\cup} C_{(k + 2)}$ . Then, the graphs $G$ and $H$ are distinguished by $(k + 1, 1)$ -LWL, but they are not distinguished by $(k, 1)$ -LWL. + +Proof. We first show that the $(k + 1,1)$ -LWL distinguishes the graphs $G$ and $H$ . Let $\mathbf{v}$ in $V(G)_{1}^{k + 1}$ be a tuple $(v_{1},\ldots ,v_{k + 1})$ such that $v_{1},\ldots ,v_{k + 1}$ is a path of length $k$ in $G$ . Let $\mathbf{w}$ in $V(H)_{1}^{k + 1}$ be a tuple $(w_{1},\ldots ,w_{k + 1})$ such that $w_{1},\ldots ,w_{k + 1}$ is a path of length $k$ in $H$ . By the structure of $H$ , there exists a vertex $w_{k + 2}$ in $V(H)$ such that $w_{1},\ldots ,w_{k + 2}$ forms a cycle of length $k + 2$ . We claim that $\mathbf{v}$ does not have any local 1-neighbor $\mathbf{x}$ in $V(G)_{1}^{k + 1}$ such that $\mathbf{x}$ is non-repeating, i.e., every vertex in $\mathbf{x}$ is distinct. This holds because replacing the first vertex of $\mathbf{v}$ with any other vertex of $G$ will yield a disconnected tuple. On the other hand, $\mathbf{w}$ admits a non-repeating, local 1-neighbor, obtained by replacing the first vertex $w_{1}$ by $w_{k + 2}$ . Hence, the $(k + 1,1)$ -LWL distinguishes $G$ and $H$ . + +Next, we show that the $(k,1)$ -LWL does not distinguish the graphs $G$ and $H$ . Indeed, for every $j$ in $[k]$ , every $k$ -tuple $\mathbf{x}$ in $V(G)_1^k$ or $V(H)_1^k$ has exactly two local $j$ -neighbors, corresponding to the two neighbors $y, z$ of the vertex $x_j$ . The exact number of local $j$ -neighbors of $\mathbf{x}$ which additionally lie in $V(G)_1^k$ (or $V(H)_1^k$ ) depends only on the atomic type of $\mathbf{x}$ , since the length of cycles in $G$ and $H$ is at least $k + 2$ . Hence, the $(k,1)$ -LWL neighborhood of every tuple in $G$ or $H$ depends only on its atomic type. This implies that the $(k,1)$ -LWL does not refine the initial coloring for $G$ as well as $H$ , and hence it does not distinguish $G$ and $H$ . + +Although Lemma 13 already implies Theorem 1, the construction hinges on the fact that the graphs $G$ and $H$ are not connected. To address this, for $k \geq 2$ , we introduce two connected graphs $A_{k+2}$ and $B_{k+2}$ defined as follows. The graph $A_{k+2}$ has $2(k+2)$ nodes and $2(k+2)+1$ edges, and consists of two disjoint cycles on $k+2$ nodes connected by a single edge. The graph $B_{k+2}$ also has the same number of nodes and edges, and consists of two cycles on $k+3$ nodes, each, + +sharing exactly two adjacent nodes. See Figure 3 for an illustration of the graphs $A_{k + 2}$ and $B_{k + 2}$ for $k = 4$ . We obtain the following result for the two graphs. + +Lemma 14. For $k \geq 2$ , the $(k,1)$ -LWL does not distinguish the graphs $A_{k+2}$ and $B_{k+2}$ , while the $(k+1,1)$ -LWL does. + +Proof. We first show the second part, i.e., that the $(k + 1,1)$ -LWL distinguishes the graphs $A_{k + 2}$ and $B_{k + 2}$ . Without loss of generality, assume that $V(A_{k + 2}) = \{a_1,\ldots ,a_{2(k + 2)}\}$ and that $E(A_{k + 2})$ consists of the edges $(a_i,a_{i + 1})$ for $1\leq i\leq k + 1$ , $(a_{1},a_{(k + 2)})$ , $(a_{i},a_{i + 1})$ for $(k + 3)\leq i\leq 2(k + 2) - 1$ , and $(a_{k + 3},a_{2(k + 2)})$ . The two cycles are connected by the edge $(a_{(k + 2)},a_{(k + 3)})$ in $E(A_{k + 2})$ . Further, assume $V(B_{k + 2}) = \{b_1,\dots,b_{2(k + 2)}\}$ where $(b_i,b_{i + 1})$ in $E(B_{k + 2})$ for $1\leq i\leq 2(k + 2) - 1$ and $(b_1,b_{2(k + 2) + 2})$ in $E(B_{k + 2})$ . Finally, the edge $(b_1,b_{k + 3})\in E(B_{k + 2})$ is shared by the two cycles of length $k + 3$ each. + +Now, let $\mathbf{t} = (a_{1},\dots ,a_{k + 1})$ in $V(A_{k + 2})_1^{k + 1}$ . Observe that the tuple $(a_{1},\ldots ,a_{k + 2})$ is a $(k + 1)$ -neighbor of the tuple $\mathbf{t}$ , inducing a graph on $k + 1$ nodes. Further, since the two cycles in the graph $B_{k + 2}$ have length $k + 3$ , there is no tuple without repeated nodes that has a $(k + 1)$ -neighbor without repeated nodes. Hence, the two graphs are distinguished by $(k + 1,1)$ -LWL. + +We now show that the $(k,1)$ -LWL does not distinguish the graphs $A_{k+2}$ and $B_{k+2}$ . First, we construct a bijection $\theta \colon V(A_{k+2}) \to V(B_{k+2})$ as induced by the following coloring: + +![](images/1927a4a7d0acf1daadcd6adf695bb2a3c0792e5acdae44339bb0d98e7d397b1b.jpg) + +![](images/858c5fa17b9a7ab8e986387a90f4d70b4c1b272f1c0771ced2243487abb50649.jpg) + +Based on the bijection $\theta$ , we define the bijection $\theta^k: V(A_{k+2})_1^k \to (A_{B+2})_1^k$ , by applying $\theta$ component-wise to $(k, s)$ -tuples. Observe that $G[\mathbf{s}] \simeq G[\theta^k(\mathbf{s})]$ for $\mathbf{s}$ in $V(A_{k+2})_1^k$ . + +Claim 15. Let $\mathbf{s}$ be a tuple in $V(G)_1^k$ and $\mathbf{t} = \theta^k (\mathbf{s})$ in $V(H)_1^k$ . Let $N_{j}(\mathbf{s})$ and $N_{j}(\mathbf{t})$ be the $j$ -neighbors of the tuple $\mathbf{s}$ and $\mathbf{t}$ , respectively, for $j$ in $[k]$ . Then $\theta^k$ yields a one-to-one correspondence between $N_{j}(\mathbf{s})$ and $N_{j}(\mathbf{t})$ . Consequently, $G[\mathbf{u}] \simeq G[\theta^k (\mathbf{u})]$ for $\mathbf{u}$ in $N_{j}(\mathbf{s})$ and $\theta^k (\mathbf{u})$ in $N_{j}(\mathbf{t})$ . + +Proof. The desired claim follows by observing that the bijective map $\theta \colon V(A_{k + 2})\to V(B_{k + 2})$ preserves neighborhoods, i.e. for every $x$ in $V(A_{k + 2})$ , $\theta (N_F(x)) = N_K(\theta (x))$ . + +We now again leverage the above claim to show that $C_i^{k,s}(\mathbf{s}) = C_i^{k,s}(\theta^k (\mathbf{s}))$ for $i\geq 0$ , implying the required result. By a straightforward inductive argument, using Claim 15, we can inductively construct a tree isomorphism between the unrolled trees around the node $v_{s}$ and $v_{t}$ in the corresponding $(k,s)$ -tuple graph such that $\mathbf{U}_{T,v_{\mathbf{s}}}^{i}\simeq_{v_{\mathbf{s}}\to v_{\mathbf{t}}}\mathbf{U}_{T,v_{\mathbf{t}}}^{i}$ . By Lemma 12, this implies $C_i^{k,s}(\mathbf{s}) = C_i^{k,s}(\theta (\mathbf{t}))$ for $i\geq 0$ . This shows that the $(k,s)$ -LWL does not distinguish $A_{k + 2}$ and $B_{k + 2}$ . + +Hence, Theorem 1 directly follows from Lemma 14. Moreover, we also show that the $(k,2)$ -LWL is more expressive than the $(k,1)$ -LWL. + +Proposition 16. Let $k \geq 2$ . Then + +$$ +(k, 2) \text {- L W L} \square (k, 1) \text {- L W L}. +$$ + +Proof. As in Lemma 13, let $G \coloneqq C_{2(k + 2)}$ and $H \coloneqq C_{(k + 2)} \dot{\cup} C_{(k + 2)}$ . By Lemma 13, $G$ and $H$ are not distinguished by the $(k,1)$ -LWL for $k \geq 2$ . We claim that the $(k,2)$ -LWL distinguishes $G$ and $H$ for $k = 2$ already. Since the $(k,2)$ -LWL is at least as powerful as the $(2,2)$ -LWL, this yields the desired claim. + +With respect to the $(2,2)$ -LWL, observe that the $(2,2)$ -tuple graph $T_2^2 (H)$ consists of four connected components while the $(2,2)$ -tuple graph $T_2^2 (G)$ consists of a single connected component. More precisely, there exist two connected components of $T_2^2 (H)$ that consist only of 2-tuples containing two non-adjacent nodes which are in the same connected component of the graph $H$ . Note that none of these 2-tuples is adjacent to any 2-tuples in $V(H)_1^2$ . Moreover, there exists no such connected component in $T_2^2 (G)$ . Also, note that the number of neighbors of each 2-tuple of the graphs is exactly 4, excluding self loops. Hence, the $(2,2)$ -LWL will distinguish the two graphs. + +Moreover, the following result shows that increasing the parameter $s$ results in higher expressivity. Formally, we show that the $(k,k)$ -LWL is strictly more expressive than the $(k,2)$ -LWL. Note that we use vertex-colored graphs (rather than simple undirected graphs) in our proofs. + +Theorem 17. Let $k \geq 2$ , then + +$$ +(k, k) - \mathrm {L W L} \square (k, 2) - \mathrm {L W L}. +$$ + +For the proof of Theorem 17, we modify the construction employed in (Morris et al., 2020b), Appendix C.1.1., where they provide an infinite family of graphs $(G_{k},H_{k})_{k\in \mathbb{N}}$ such that (a) $k$ -WL does not distinguish $G_{k}$ and $H_{k}$ , although (b) $\delta$ - $k$ -LWL distinguishes $G_{k}$ and $H_{k}$ . Since our proof closely follows theirs, let us recall some relevant definitions from their paper. + +Construction of $G_{k}$ and $H_{k}$ . Let $K$ denote the complete graph on $k + 1$ vertices (without any self-loops). The vertices of $K$ are indexed from 0 to $k$ . Let $E(v)$ denote the set of edges incident to $v$ in $K$ : clearly, $|E(v)| = k$ for all $v$ in $V(K)$ . We call the elements of $V(K)$ base vertices, and the elements of $E(K)$ base edges. Define the graph $G_{k}$ as follows: + +1. For the vertex set $V(G_{k})$ , we add + +(a) $(v, S)$ for each $v$ in $V(K)$ and for each even subset $S$ of $E(v)$ , +(b) two vertices $e^1, e^0$ for each edge $e$ in $E(K)$ . + +2. For the edge set $E(G_{k})$ , we add + +(a) an edge $\{e^0,e^1\}$ for each $e$ in $E(K)$ +(b) an edge between $(v, S)$ and $e^1$ if $v$ in $e$ and $e$ in $S$ , +(c) an edge between $(v, S)$ and $e^0$ if $v$ in $e$ and $e$ not in $S$ , + +For every $v$ in $K$ , the set of vertices of the form $(v, S)$ is called the vertex cloud for $v$ . Similarly, for every edge $e$ in $E(K)$ , the set of vertices of the form $\{e^0, e^1\}$ is called the edge cloud for $e$ . + +Define a companion graph $H_{k}$ , in a similar manner to $G_{k}$ , with the following exception: in Step 1(a), for the vertex 0 in $V(K)$ , we choose all odd subsets of $E(0)$ . Counting vertices, we find that $|V(G)| = |V(H)| = (k + 1)\cdot 2^{k - 1} + \binom{k + 1}{2}\cdot 2$ . This finishes the construction of the graphs $G$ and $H$ . We set $G_{k}\coloneqq G$ and $H_{k}\coloneqq H$ . + +Distance-two-cliques. A set $S$ of vertices is said to form a distance-two-clique if the distance between any two vertices in $S$ is exactly 2. The following results were shown in (Morris et al., 2020b). + +Lemma 18 ((Morris et al., 2020b)). The following holds for the graphs $G_{k}$ and $H_{k}$ defined above. + +- There exists a distance-two-clique of size $(k + 1)$ inside $G_{k}$ . +- There does not exist a distance-two-clique of size $(k + 1)$ inside $H_{k}$ . + +Hence, $G_{k}$ and $H_{k}$ are non-isomorphic. + +Lemma 19 ((Morris et al., 2020b)). The $\delta$ - $k$ -LWL distinguishes $G_{k}$ and $H_{k}$ . On the other hand, $k$ -WL does not distinguish $G_{k}$ and $H_{k}$ . + +We are ready to present the proof of Theorem 17. + +Proof of Theorem 17. Observe that the $(k,k)$ -LWL is the same as the $\delta$ - $k$ -LWL. Hence, it suffices to show an infinite family of graphs $(X_{k},Y_{k})$ , $k$ in $\mathbb{N}$ , such that (a) $(k,2)$ -LWL does not distinguish $X_{k}$ and $Y_{k}$ , although (b) $\delta$ - $k$ -LWL distinguishes $X_{k}$ and $Y_{k}$ . + +Let $X_{k}$ be the graph obtained from the graph $G_{k}$ as follows. First, for every base vertex $v$ in $V(K)$ , every vertex of $V(G_{k})$ in the vertex cloud for $v$ receives a color $\mathrm{Red}_{v}$ . Hence, vertex clouds form color classes, where each such class has a distinct color. Similarly, for every base edge $e$ in $E(K)$ , every vertex of $V(G_{k})$ in the edge cloud for $e$ receives a color $\mathrm{Blue}_{e}$ . Finally, let $\Delta > 3k$ . Then, we replace every edge $e$ in $G_{k}$ by a path of length $\Delta$ , such that every vertex on this path is colored with the color $(\{c, c'\})$ , where $c$ and $c'$ are the colors of the endpoints of $e$ in $G_{k}$ . We call such path vertices auxiliary vertices. The graph $Y_{k}$ is obtained from $H_{k}$ by an identical construction. + +First, we show that the $(k,2)$ -LWL does not distinguish the graphs $X_{k}$ and $Y_{k}$ . We use a modified version of the bijective $k$ -pebble game (Grohe, 2017): (a) we enforce the $k$ pebbles to form at most two components at any point during the game, + +and (b) when the Spoiler and Duplicator pick the $i^{th}$ pebble from each graph, the Duplicator is required to exhibit a bijection only between the position- $i$ local neighbourhoods of the two pebbling configuration tuples $\pmb{x} \in X_k^k$ and $\pmb{y} \in Y_k^k$ , instead of a bijection between the vertex sets of $X_k$ and $Y_k$ . Observe that there can be at most two vertices out of $k + 1$ vertices in $V(K)$ such that the corresponding vertex clouds contain a tupled vertex, by our choice of $\Delta$ . Hence, in the usual parlance of Cai-Fürer-Immerman games (Cai et al., 1992), the twisted edge can always be hidden among the remaining $(k - 1)$ vertices of $K$ . This ensures that for all $i \in [k]$ , a partial isomorphism between $\pmb{x} \backslash \pmb{x}_i$ and $\pmb{y} \backslash \pmb{y}_i$ can always be extended to a bijective mapping between the $i$ -local-neighborhoods of $\pmb{x}$ and $\pmb{y}$ . Hence, the Duplicator cannot win this pebble game and therefore, (k, 2)-LWL cannot distinguish the graphs $X_k$ and $Y_k$ . + +Next, we show that the $\delta$ - $k$ -LWL distinguishes the graphs $X_{k}$ and $Y_{k}$ . Our proof closely follows the corresponding proof in (Morris et al., 2020b). Instead of showing a discrepancy in the number of distance-two-cliques, we instead use colored-distance- $(2\Delta + 1)$ -cliques defined as follows. Let $S$ be a set of vertices belonging to the vertex clouds. The set $S$ is said to form a colored-distance- $(2\Delta + 1)$ -clique if any two vertices in $S$ are connected by a path of exactly $2\Delta + 1$ vertices, of which $2\Delta$ are auxiliary vertices and one vertex is a vertex from an edge cloud. Analogously to their proof, it can be shown that (a) there exists a colored-distance- $(2\Delta + 1)$ -clique of size $(k + 1)$ inside $X_{k}$ , and (b) there does not exist a colored-distance- $(2\Delta + 1)$ -clique of size $(k + 1)$ inside $Y_{k}$ , and hence, (c) $X_{k}$ and $Y_{k}$ are non-isomorphic. Finally, we claim that the $\delta$ - $k$ -LWL is powerful enough to detect colored-distance- $(2\Delta + 1)$ -cliques. The proof is analogous to (Morris et al., 2020b, Appendix C.1.1, Proof of Lemma 9). This yields that the $\delta$ - $k$ -LWL distinguishes the graphs $X_{k}$ and $Y_{k}$ . + +# C.1. Asymptotic running time + +In the following, we bound the asymptotic running time of the $(k,s)$ -LWL. Due to Lemma 9, we can upper-bound the running time of the $(k,s)$ -LWL for a given graph by upper-bounding the time to construct the $(k,s)$ -tuple graph and running the 1-WL variant of Equation (11) on top. Proposition 21 establishes an upper bound on the asymptotic running time for constructing the $(k,s)$ -tuple graph from a given graph. Thereto, we assume a $d$ -bounded-degree graph $G$ , for $d \geq 1$ , i.e., each node has at most $d$ neighbors. + +To prove the proposition, we define $(k,s)$ -multisets. Let $G$ be a graph, $k\geq 1$ , and $s$ in $[k]$ , then the set of $(k,s)$ -multisets + +$$ +S (G) _ {s} ^ {k} = \left\{\left\{\left\{v _ {1}, \dots , v _ {k} \right\} \right\} \mid \mathbf {v} \in V (G) _ {s} ^ {k} \right\} +$$ + +contains the set of multisets inducing subgraphs of $G$ on at most $k$ nodes with at most $s$ components. The following results upper-bounds the running time for the construction of $S(G)_s^k$ . + +Algorithm 1 Generate $(k,s)$ -multisets +Input: Graph $G, k, s,$ and $S(G)^s$ +Output: $(k, s)$ -multiset $S(G)^k$ +1: Let $R$ be an empty set data structure +2: for $M \in S(G)^s$ do +3: Let $S$ be a queue data structure containing only $(M, s)$ +4: while $S$ not empty do +5: Pop $(T, c)$ from queue $S$ +6: if $c + 1 \leq k$ then +7: for $t \in T$ do +8: for $u \in \delta(t) \cup \{t\}$ do +9: Add $(T \cup \{u\}, c + 1)$ to $S$ +10: else +11: Add $T$ to $R$ +12: return $R$ + +Proposition 20. Let $G$ be a $d$ -bounded-degree graph, $k \geq 2$ , and $s$ in $[k - 1]$ . Then Algorithm 1 computes $S_s^k(G)$ in time $\tilde{\mathcal{O}}(n^s \cdot k^{k-s}(d + 1)^{k-s})$ . + +Proof. Let $c < k$ and let $T'$ be an element in $S(G)_s^{c+1}$ . By definition of $S(G)_s^c$ and $S(G)_s^{c+1}$ , there exists a $c$ -element multiset $T$ in $S(G)_s^c$ such that $T' = T \cup \{v\}$ is in $S(G)_s^{c+1}$ for a node $v$ in $V(G)$ . Since $s$ is fixed, $v$ is either in the + +neighborhood $\delta(w)$ for $w$ in $T$ or $v = w'$ for $w'$ in $T$ . Hence, lines 7 to 9 in Algorithm 1 generate $S(G)_s^{c+1}$ from $S(G)_s^c$ . The set data structure $R$ makes sure that the final solution will not contain duplicates. The running time follows directly when using, e.g., a red-black tree, to represent the set $R$ . + +Based on the above result, we can easily construct $T_{s}^{k}(G)$ from $S_{s}^{k}(G)$ , implying the following result. + +Proposition 21. Let $G$ be a $d$ -bounded-degree graph, $k \geq 3$ , and $s$ in $[k - 1]$ . Then we can compute $T_s^k(G)$ in time $\tilde{\mathcal{O}}(n^s \cdot k^{k-s}(d + 1)^{k-s+1} \cdot k! \cdot k)$ . + +Proof. The running time follows directly from Proposition 20. That is, from $S_{s}^{k}(G)$ , we can generate the set $V_{s}^{k}(G)$ by generating all permutations of each element in the former. By iterating over each resulting $(k,s)$ -tuple and each component of such $(k,s)$ -tuple, we can construct the needed adjacency information. + +Hence, unlike for the $k$ -WL, the running time of the $(k,s)$ -LWL does not depend on $n^k$ for an $n$ -node graph and is solely dictated by $s, k$ , and the sparsity of the graph. + +Moreover, observe that the upper bound given in Proposition 21, by leveraging Lemma 9, also upper-bounds the asymptotic running time for one iteration of the $(k,s)$ -LWL. + +# D. SpeqNets: Sparse, permutation-equivariant graph networks + +We can now leverage the above combinatorial insights to derive sparsity-aware, permutation-equivariant graph networks, denoted $(k,s)$ -SpeqNet. Given a labeled graph $G$ , let each $(k,s)$ -tuple $\mathbf{v}$ in $V(G)_s^k$ be annotated with an initial feature $f^{(0)}(\mathbf{v})$ determined by its (labeled) isomorphism type, e.g., a one-hot encoding of $\tau_{G[\mathbf{v}]}$ . Alternatively, we can also use some application-specific, real-valued feature. In each layer $t > 0$ , we compute a new feature $f^{(t)}(\mathbf{v})$ as + +$$ +\begin{array}{l} f _ {\operatorname {m r g}} ^ {W _ {1}} \left(f ^ {(t - 1)} (\mathbf {v}), f _ {\operatorname {a g g}} ^ {W _ {2}} \left(\{\{f ^ {(t - 1)} \left(\phi_ {1} (\mathbf {v}, w)\right) \mid w \in \delta (v _ {1}) \text {a n d} \phi_ {1} (\mathbf {v}, w) \in V (G) _ {s} ^ {k} \}\}, \dots , \right. \right. \\ \left. \left\{\left. f ^ {(t - 1)} \left(\phi_ {k} (\mathbf {v}, w)\right) \mid w \in \delta \left(v _ {k}\right) \text {a n d} \phi_ {k} (\mathbf {v}, w) \in V (G) _ {s} ^ {k} \right\} \right.\right), \\ \end{array} +$$ + +in $\mathbb{R}^{1\times e}$ , where $W_1^{(t)}$ and $W_2^{(t)}$ are learnable parameter matrices from $\mathbb{R}^{d\times e}$ for some $d,e > 0$ . Here, $f_{\mathrm{mrg}}^{W_2}$ and $f_{\mathrm{agg}}^{W_1}$ are arbitrary differentiable functions, responsible for merging and aggregating the relevant feature information, respectively. Note that we can naturally handle discrete node and edge labels as well as directed graphs. The following result demonstrates the expressive power of the $(k,s)$ -SpeqNet, in terms of distinguishing non-isomorphic graphs. + +Theorem 22. Let $(V,E,\ell)$ be a labeled graph, and let $k\geq 1$ and $s$ in $[k]$ . Then for all $t\geq 0$ , there exists weights $W_{1}^{(t)}$ and $W_{2}^{(t)}$ such that + +$$ +C _ {t} ^ {k, s} (\mathbf {v}) = C _ {t} ^ {k, s} (\mathbf {w}) \iff f ^ {(t)} (\mathbf {v}) = f ^ {(t)} (\mathbf {w}). +$$ + +Hence, the following holds for all $k \geq 1$ : + +$$ +(k, s) \text {- S p e q N e t} \equiv (k, s) \text {- L W L}. +$$ + +Proof sketch. First, observe that the $(k,s)$ -LWL can be simulated on an appropriate node- and edge-labeled graph, see Lemma 9. Secondly, following the proof of (Morris et al., 2019, Theorem 2), there exists a parameter matrix $W_2^{(t)}$ such that we can injectively map each multiset in Equation (1), representing the local $j$ -neighbors for $j$ in $[k]$ , to a $d$ -dimensional vector. Moreover, we concatenate $j$ to each such vector to distinguish between different neighborhoods. Again, by (Morris et al., 2019, Theorem 2), there exists a parameter matrix $W_1^{(t)}$ such that we can injectively map the set of resulting $k$ vectors to a unique vector representation. Alternatively, one can concatenate the resulting $k$ vectors and use a multi-layer perceptron to learn a joint lower-dimensional representation. + +It is not possible to come up with an architecture, i.e., instantiations of $f_{\mathrm{mrg}}^{W_1}$ and $f_{\mathrm{agg}}^{W_2}$ such that it becomes more powerful than the $(k,s)$ -LWL, see (Morris et al., 2019). However, all results from the previous section can be lifted to the neural setting, see also Section 2.1. Analogously to GNNs, the above architecture can naturally handle continuous node and edge labels. By using the tools developed in (Azizian & Lelarge, 2020), it is straightforward to show that the above architecture is universal, i.e., it can approximate any possible permutation-invariant function over graphs up to an arbitrarily small additive error. + +# E. Additional experimental results + +Table 3. Dataset statistics and properties for graph-level prediction tasks, ${}^{ \dagger }$ —Continuous vertex labels following (Gilmer et al.,2017),the last three components encode 3D coordinates. + +
DatasetProperties
Number of graphsNumber of classes/targetsØ Number of nodesØ Number of edgesNode labelsEdge labels
ENZYMES600632.662.1✓✗
IMDB-BINARY1000219.896.5✗✗
IMDB-MULTI1500313.065.9✗✗
MUTAG188217.919.8✓✗
NCI14110229.932.3✓✗
PTC_FM349214.114.5✓✗
PROTEINS1113239.172.8✓✗
REDDIT-BINARY20002429.6497.8✗✗
ALCHEMY2025791210.110.4✓✓
QM91294331218.018.6✓(13+3D)†✓(4)
+ +Table 4. Dataset statistics and properties for node-level prediction tasks. + +
DatasetProperties
Number of nodesNumber of edgesNumber of node features
CORNELL1832951703
TEXAS1833091703
WISCONSIN2514901703
+ +Table 5. Overall computation times for selected datasets in seconds (Number of iterations for WL-based methods: 5), OOT—Computation did not finish within one day (24h), OOM—Out of memory. + +
Graph KernelDataset
ENZYMESIMDB-BINARYIMDB-MULTIMUTAGNCI1PTC_MR
Glob.1-WL<1<1<1<11.9<1
2-WL225.991.238.34.31127.810.7
3-WL55242.717565.24977.1259.8OOT1324.2
δ-2-LWL25.227.319.8<182.21.1
δ-2-LWL+25.626.118.5<1108.31.2
δ-3-LWL3519.03560.31957.536.515207.389.9
δ-3-LWL+3674.93636.52162.343.615945.6111.1
(k,s)-LWL(2,1)-LWL1.612.011.0<15.8<1
(2,1)-LWL+1.712.611.0<16.7<1
(3,1)-LWL51.11040.21112.21.4111.31.9
(3,1)-LWL+52.11049.41238.71.6120.12.0
(3,2)-LWL937.92571.12252.619.03502.629.6
(3,2)-LWL+1046.12937.82572.222.43888.734.4
+ +Table 6. Average speed-up ratios over all epochs (training and testing). + +
MethodDataset
ALCHEMY (10K)QM9
GINE-ε0.51.3
(2,1)-SpeqNet1.01.0
(2,2)-SpeqNet1.33.4
\ No newline at end of file diff --git a/speqnetssparsityawarepermutationequivariantgraphnetworks/images.zip b/speqnetssparsityawarepermutationequivariantgraphnetworks/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..30b7092f68f7321ad74bd584c7cb3120882982f8 --- /dev/null +++ b/speqnetssparsityawarepermutationequivariantgraphnetworks/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9ee4e2c6139e8fe37efff941ce9312b2ac38389feaabc864ea53ceba6f27aff5 +size 762815 diff --git a/speqnetssparsityawarepermutationequivariantgraphnetworks/layout.json b/speqnetssparsityawarepermutationequivariantgraphnetworks/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..c9da80c24da536524d12e63d4541b19695d6b462 --- /dev/null +++ b/speqnetssparsityawarepermutationequivariantgraphnetworks/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dfc628ef8328299dce0d4d71fcf835df488852cfe4b6541a05de3f363d9d8073 +size 1999229 diff --git a/stabilitybasedgeneralizationboundsforexponentialfamilylangevindynamics/ed62c938-b68d-4d11-99c1-0818c77f77b7_content_list.json b/stabilitybasedgeneralizationboundsforexponentialfamilylangevindynamics/ed62c938-b68d-4d11-99c1-0818c77f77b7_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..7ec58deef6d451d2fc8ef2c68657672a320c6015 --- /dev/null +++ b/stabilitybasedgeneralizationboundsforexponentialfamilylangevindynamics/ed62c938-b68d-4d11-99c1-0818c77f77b7_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d21cd2191e9245656b98488a626626f9c0cbdd10ae61d95049628737ac8fc71c +size 287897 diff --git a/stabilitybasedgeneralizationboundsforexponentialfamilylangevindynamics/ed62c938-b68d-4d11-99c1-0818c77f77b7_model.json b/stabilitybasedgeneralizationboundsforexponentialfamilylangevindynamics/ed62c938-b68d-4d11-99c1-0818c77f77b7_model.json new file mode 100644 index 0000000000000000000000000000000000000000..d1b89bdc3294d6fa058aaec83b755c7e61f87b53 --- /dev/null +++ b/stabilitybasedgeneralizationboundsforexponentialfamilylangevindynamics/ed62c938-b68d-4d11-99c1-0818c77f77b7_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cb7ce625e93c01bf3f78ea83d17c0453883b6bde0a9df46e291342f27e80540e +size 331102 diff --git a/stabilitybasedgeneralizationboundsforexponentialfamilylangevindynamics/ed62c938-b68d-4d11-99c1-0818c77f77b7_origin.pdf b/stabilitybasedgeneralizationboundsforexponentialfamilylangevindynamics/ed62c938-b68d-4d11-99c1-0818c77f77b7_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..0186124e8245ecf11bd08a227c48193b2252ff35 --- /dev/null +++ b/stabilitybasedgeneralizationboundsforexponentialfamilylangevindynamics/ed62c938-b68d-4d11-99c1-0818c77f77b7_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c160bd25fc302b48771db1d2e38b7b565b7d93999844fe412f5ef6d169996b4c +size 2424390 diff --git a/stabilitybasedgeneralizationboundsforexponentialfamilylangevindynamics/full.md b/stabilitybasedgeneralizationboundsforexponentialfamilylangevindynamics/full.md new file mode 100644 index 0000000000000000000000000000000000000000..9c69c7a018e87c1e8d493dff45ced335402ca9e7 --- /dev/null +++ b/stabilitybasedgeneralizationboundsforexponentialfamilylangevindynamics/full.md @@ -0,0 +1,1382 @@ +# Stability Based Generalization Bounds for Exponential Family Langevin Dynamics + +Arindam Banerjee $^{1}$ Tiancong Chen $^{2}$ Xinyan Li $^{2}$ Yingxue Zhou $^{2}$ + +# Abstract + +Recent years have seen advances in generalization bounds for noisy stochastic algorithms, especially stochastic gradient Langevin dynamics (SGLD) based on stability (Mou et al., 2018; Li et al., 2020) and information theoretic approaches (Xu & Raginsky, 2017; Negrea et al., 2019; Steinke & Zakynthinou, 2020). In this paper, we unify and substantially generalize stability based generalization bounds and make three technical contributions. First, we bound the generalization error in terms of expected (not uniform) stability which arguably leads to quantitatively sharper bounds. Second, as our main contribution, we introduce Exponential Family Langevin Dynamics (EFLD), a substantial generalization of SGLD, which includes noisy versions of Sign-SGD and quantized SGD as special cases. We establish data-dependent expected stability based generalization bounds for any EFLD algorithm with a $O(1/n)$ sample dependence and dependence on gradient discrepancy rather than the norm of gradients, yielding significantly sharper bounds. Third, we establish optimization guarantees for special cases of EFLD. Further, empirical results on benchmarks illustrate that our bounds are non-vacuous, quantitatively sharper than existing bounds, and behave correctly under noisy labels. + +# 1. Introduction + +Recent years have seen renewed interest in characterizing generalization performance of learning algorithms in terms of stability which considers change in performance of a learning algorithm based on change of a single training + +$^{1}$ Department of Computer Science, University of Illinois Urbana-Champaign $^{2}$ Department of Computer Science, University of Minnesota, Twin Cities. Correspondence to: Tiancong Chen . + +Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s). + +point (Hardt et al., 2016; Bousquet & Elisseeff, 2002; Li et al., 2020; Mou et al., 2018). For stochastic gradient descent (SGD), Hardt et al. (2016) established generalization bounds based on uniform stability (Bousquet & Elisseeff, 2002), although the analysis needed rather small step sizes $\eta_t = 1 / t$ which is arguably not useful in practice. While improving the stability analysis for SGD has remained a challenge, advances have been made on noisy SGD algorithms, especially stochastic gradient Langevin dynamics (SGLD) (Welling & Teh, 2011; Mou et al., 2018; Li et al., 2020) which adds Gaussian noise to the stochastic gradients. In parallel, there has been key developments on related information-theoretic generalization bounds applicable to SGLD type algorithms (Negrea et al., 2019; Haghifam et al., 2020; Xu & Raginsky, 2017; Russo & Zou, 2016; Pensia et al., 2018; Wang et al., 2021b). + +While these developments have led to advances in analyzing generalization of noisy SGD algorithms, and we elaborate on these developments in Appendix A, they each have certain limitations, e.g., dependence on global Lipschitz constant $L$ (Mou et al., 2018), tiny $O(1 / L)$ step sizes (Li et al., 2020), $O(1 / \sqrt{n})$ sample dependence (Mou et al., 2018; Negrea et al., 2019), dependence on gradient norms (Li et al., 2020), restrictions on nature of mini-batching (Wang et al., 2021b), etc. Further, most prior work primarily focuses on SGLD and cannot be readily extended to popular variants such as noisy versions of Sign-SGD or quantized SGD (Bernstein et al., 2018a; Alistarh et al., 2017; Jiang & Agrawal, 2018). In this paper, we build on the core strengths of such existing approaches, most notably (a) the $O(1 / n)$ sample dependence of stability based bounds (Mou et al., 2018; Li et al., 2020), (b) the dependence on some measures of gradient discrepancy rather than the norm of gradients (Negrea et al., 2019; Haghifam et al., 2020), and (c) no dependence on the global Lipschitz constant $L$ , and develop a framework (Section 2) for establishing generalization bounds for a general family of noisy stochastic iterative algorithms which includes SGLD as a special case. Our framework considers generalization based on the concept of expected stability, rather than uniform stability (Hardt et al., 2016; Bousquet & Elisseeff, 2002; Bousquet et al., 2020; Mou et al., 2018; Farghly & Rebeschini, 2021), and yields distribution dependent generalization bounds which avoid + +the worst-case setting of uniform stability. Recall that for any data domain $\mathcal{Z}$ and a distribution $D$ over the domain, uniform stability considers the worst case difference in loss over two datasets $S_{n}, S_{n}^{\prime} \in \mathcal{Z}^{n}$ of size $n$ which differ by one point, i.e., over $\sup_{S_{n}, S_{n}^{\prime}, |S_{n} \Delta S_{n}^{\prime}| = 1} \cdots$ (Bousquet & Elisseeff, 2002; Hardt et al., 2016). In Section 2, we show that one gets a valid generalization bound for stochastic algorithms by replacing the supremum sup by an expectation $\mathbb{E}_{S_{n}, S_{n}^{\prime}}$ , where $S_{n} \sim D^{n}$ and, without loss of generality, $S_{n}^{\prime}$ shares the first $(n - 1)$ samples with $S_{n}$ with the $n$ -th sample $z_{n}^{\prime} \sim D$ . Replacing sup by $\mathbb{E}$ makes the bound distribution dependent and arguably leads to quantitatively sharper and computable bounds with less assumptions. Further, we show that expected stability of general noisy stochastic iterative algorithms can be bounded by the expectation of a Le Cam Style Divergence (LSD) between distributions over parameters obtained from $S_{n}$ and $S_{n}^{\prime}$ . Thus, getting an expected stability based generalization bound for a specific stochastic algorithm reduces to that of bounding the expected LSD. + +In Section 3, we introduce Exponential Family Langevin Dynamics (EFLD), a family of noisy stochastic gradient descent algorithms based on exponential family noise. Special cases of EFLD include SGLD and noisy versions of Sign-SGD or quantized SGD algorithms (Bernstein et al., 2018a;b; Jin et al., 2020; Alistarh et al., 2017). Our main result provides an expected stability based generalization bound for any EFLD algorithm with several aforementioned desirable properties: (a) a $O(1/n)$ sample dependence, (b) a dependence on the gradient discrepancy, a variant of gradient incoherence (Negrea et al., 2019), rather than a dependence on the norm of gradients, (c) no dependence on the global Lipschitz constant $L$ , and (d) step sizes $\eta_t$ need not be tiny, i.e., $\eta_t = O(1/L)$ is not needed. Existing generalization bounds for SGLD (Li et al., 2020; Negrea et al., 2019) usually use properties of the Gaussian distribution, and do not generalize to EFLD. Our proof technique is new, and uses properties of exponential family distributions. We also provide optimization guarantees for EFLD, i.e., convergence results for noisy Sign-SGD and SGLD. + +In Section 4, we present experimental results on benchmark datasets. We illustrate that our bounds for SGLD are nonvacuous and quantitatively tighter than existing bounds (Li et al., 2020; Negrea et al., 2019) due to the desirable dependence on sample size and gradient discrepancy norms, which are empirically shown to be orders of magnitude smaller than gradient norms. We also report results on random labels (Zhang et al., 2017) where as the training error goes to zero, our bound correctly captures the increase in generalization error due to increasing fraction of random labels. We also present results for Noisy Sign-SGD and illustrate that our bounds give a quantitatively tight upper bound on the empirical test error across epochs. + +# 2. Expected Stability based Generalization + +In the setting of statistical learning, there is an instance space $\mathcal{Z}$ , a hypothesis space $\mathcal{W}$ , and a loss function $\ell: \mathcal{W} \times \mathcal{Z} \mapsto \mathbb{R}_+$ . Let $D$ be an unknown distribution of $\mathcal{Z}$ and let $S_n \sim D^n$ be $n$ i.i.d. draws from $D$ . For any specific hypothesis $\mathbf{w} \in \mathcal{W}$ , the population and empirical loss are respectively given by $L_D(\mathbf{w}) \triangleq \mathbb{E}_{z \sim D}[\ell(\mathbf{w}, z)]$ , and $L_S(\mathbf{w}) \triangleq \frac{1}{n} \sum_{i=1}^{n} \ell(\mathbf{w}, z_i)$ . For any distribution $P$ over the hypothesis space, we respectively denote the expected population and empirical loss as $L_D(P) \triangleq \mathbb{E}_{z \sim D} \mathbb{E}_{\mathbf{w} \sim P}[\ell(\mathbf{w}, z)]$ , and $L_S(P) \triangleq \frac{1}{n} \sum_{i=1}^{n} \mathbb{E}_{\mathbf{w} \sim P}[\ell(\mathbf{w}, z_i)]$ . We consider a randomized algorithm $A$ which works with $S_n = \{z_1, \ldots, z_n\} \sim D^n$ and creates a distribution over the hypothesis space $\mathcal{W}$ . For convenience, we will denote the distribution as $A(S_n)$ . The focus of our analysis is to bound the generalization error of $A$ defined as: $\mathrm{gen}(A(S_n)) \triangleq L_D(A(S_n)) - L_S(A(S_n))$ . We will assume $A$ is permutation invariant, i.e., the ordering of samples in $S_n$ do not modify $A(S_n)$ , an assumption satisfied by most learning algorithms. All technical proofs for results in this section are in Appendix B. + +# 2.1. Bounds based on Expected Stability + +We start our analysis by noting that the expected generalization error can be upper bounded by expected stability based on the Hellinger divergence $H(P\| P')$ between two distributions given by (Sason & Verdu, 2016; Li et al., 2020): $H^{2}(P\| P^{\prime}) = \frac{1}{2}\int_{\mathbf{w}}(\sqrt{p(\mathbf{w})} -\sqrt{p^{\prime}(\mathbf{w})})^{2}d\mathbf{w}.$ + +Proposition 1. Let $S_{n} \sim D^{n}$ and let $S_{n}^{\prime}$ be a dataset obtained by replacing $z_{n} \in S_{n}$ with $z_{n}^{\prime} \sim D$ . Let $A(S_{n}), A(S_{n}^{\prime})$ respectively denote the distributions over the hypothesis space $\mathcal{W}$ obtained by running randomized algorithm $A$ on $S_{n}, S_{n}^{\prime}$ . Assume that for all $S_{n} \in \mathcal{Z}^{n}, z \in \mathcal{Z}, \mathbb{E}_{W \sim A(S_{n})}[\ell^{2}(W,z)] \leq c_{0}^{2}/4$ for some constant $c_{0} > 0$ . With $H(\cdot, \cdot)$ denoting the Hellinger divergence, we have + +$$ +\begin{array}{l} \left. \left| \mathbb {E} _ {S _ {n} \sim D ^ {n}} \left[ L _ {D} \left(A \left(S _ {n}\right)\right) - L _ {S} \left(A \left(S _ {n}\right)\right) \right] \right| \right. \\ \leq c _ {0} \mathbb {E} _ {S _ {n} \sim D ^ {n}} \mathbb {E} _ {z _ {n} ^ {\prime} \sim D} \sqrt {2 H ^ {2} (A (S _ {n}) , A (S _ {n} ^ {\prime}))}. \tag {1} \\ \end{array} +$$ + +Remark 2.1. Proposition 1 does not need bounded losses. The second moment of $\ell(W, z), W \sim A(S_n), \forall S_n, z$ need to be bounded. In comparison, recent information theoretic bounds (Haghifam et al., 2020; Xu & Raginsky, 2017) assume $\ell(\mathbf{w}, Z), Z \sim D, \forall \mathbf{w} \in \mathcal{W}$ to be sub-Gaussian. + +Remark 2.2. The bound in Proposition 1 is in terms of expected stability where we consider $\mathbb{E}_{S_n\sim D^n}\mathbb{E}_{z_n'\sim D}[\dots ]$ an important departure from bounds based on uniform stability (Elisseeff et al., 2005; Bousquet & Elisseeff, 2002; Mou et al., 2018; Bousquet et al., 2020) where one considers $\sup_{S_n,S_n'\in \mathcal{Z}^n,|S_n\Delta S_n'| = 1}[\dots ]$ . Replacing sup by $\mathbb{E}$ makes the bounds distribution dependent, avoids the worst + +case analysis associated with uniform stability, and arguably leads to quantitatively tighter bounds. + +# 2.2. Expected Stability of Noisy Iterative Algorithms + +We consider a general family of noisy stochastic iterative (NSI) algorithms. Given $S_{n} \sim D^{n}$ , such iterative algorithms have two (additional) sources of randomness in each iteration $t$ : (a) a stochastic mini-batch of samples $S_{B_t}$ , with $|S_{B_t}| = b \leq n$ , drawn uniformly at random with replacement from $S_{n}$ ; and (b) noise $\xi_{t}$ suitably included in the iterative update. Given a trajectory (realization) of past iterates $W_{0:(t-1)} = \mathbf{w}_{0:(t-1)}$ , the new iterate $W_{t}$ is drawn from a distribution $P_{B_t, \xi_t | \mathbf{w}_{0:(t-1)}}$ over $\mathcal{W}$ : + +$$ +W _ {t} \sim P _ {B _ {t}, \boldsymbol {\xi} _ {t} | \mathbf {w} _ {0: (t - 1)}} (W). \tag {2} +$$ + +We will often drop conditioning $\mathbf{w}_{0:t - 1}$ to avoid clutter. + +Let $\bar{S}_{n + 1}\sim D^{n + 1}$ with $\bar{S}_{n + 1} = \{z_1,\dots ,z_{n + 1}\}$ . Let $S_0 = \{z_1,\ldots ,z_{n - 1}\}$ . $S_{n},S_{n}^{\prime}$ are size $n$ subsets of $\bar{S}_{n + 1}$ with $S_{n} = S_{0}\cup \{z_{n}\}$ and $S_n^\prime = S_0\cup \{z_n^\prime \}$ , where $z_{n}^{\prime} = z_{n + 1}$ . The algorithms we consider use a mini-batch of size $b$ in each iteration uniformly sampled from $S_{n}$ or $S_{n}^{\prime}$ . Let $G,G_{0},G_{1}$ respectively denote the set of all minibatches of size $b$ drawn from $\bar{S}_{n + 1}$ , the set only drawn from $S_{0}$ , and the set which includes the last sample, viz. $z_{n}$ for $S_{n}$ and $z_{n}^{\prime}$ for $S_{n}^{\prime}$ . Note that $|G_0| = \binom{n-1}{b}, |G_1| = \binom{n-1}{b-1}$ , and $|G_0| + |G_1| = \binom{n-1}{b} + \binom{n-1}{b-1} = \binom{n}{b} = |G|$ . + +Based on (2), let $P_{0:(t-1)}$ denote the joint distribution over $W_{0:(t-1)} = (W_0, \ldots, W_{t-1})$ , and let $P_{t|} := P_{B_t, \pmb{\xi}_t | \mathbf{w}_{0:t-1}}$ compactly denote the conditional distribution on $W_t$ . Let $P_T, P_T'$ denote the marginal distributions over hypotheses $\mathbf{w} \in \mathcal{W}$ after $T$ steps of the algorithm based on $S_n, S_n'$ respectively. For randomized algorithms of the form (2), from Proposition 1 we first bound the Hellinger divergence with KL-divergence, i.e., $2H^2(P_T, P_T') \leq KL(P_T, P_T')$ (Proposition 2 in Appendix B), and then use the following chain rule (Pensia et al., 2018; Negrea et al., 2019; Haghifam et al., 2020) to bound the KL-divergence between $P_T$ and $P_T'$ : $KL(P_T \| P_T') \leq KL(P_{0:T} \| P_{0:T}') = \sum_{t=1}^{T} \mathbb{E}_{P_{0:t-1}}[KL(P_t | \| P_t'))$ . We can bound the per-step conditional KL-divergences $KL(P_t | \| P_t')$ in terms of a Le Cam Style Divergence (LSD). While the classical Le Cam divergence (Sason & Verdu, 2016) is $LSD(P \| P') \triangleq \frac{1}{2} \int \frac{(dP - dP')^2}{dP + dP'}$ (where $dP$ denotes the density), our bounds are in terms of + +$$ +\begin{array}{l} L S D \left(P _ {t} | | | P _ {t} ^ {\prime}\right) := \underset {B _ {t} \in G _ {1}} {\mathbb {E}} \underset {A _ {t} \in G _ {0}} {\mathbb {E}} \left[ \Lambda \left(B _ {t}, A _ {t}\right) \right], \\ \Lambda \left(B _ {t}, A _ {t}\right) := \int_ {\boldsymbol {\xi} _ {t}} \frac {\left(d P _ {B _ {t} , \boldsymbol {\xi} _ {t}} - d P _ {B _ {t} , \boldsymbol {\xi} _ {t}} ^ {\prime}\right) ^ {2}}{d P _ {A _ {t} , \boldsymbol {\xi} _ {t}}} d \boldsymbol {\xi} _ {t}. \tag {3} \\ \end{array} +$$ + +Note that $P_{B_t,\pmb{\xi}_t}$ and $P_{B_t,\pmb{\xi}_t}'$ represent the conditional distribution of $W_t$ for $S_n$ and $S_n'$ respectively since the mini + +batch $S_{B_t}$ of $S_n$ and $S_n'$ differs in the $n$ -th sample. Then, we have the following LSD based generalization bound. + +Lemma 1. In the setting of Proposition 1 consider a noisy stochastic iterative algorithms of the form (2) with minibatch size $b \leq n / 2$ . Then, with $c_{1} = \sqrt{2} c_{0}$ (with $c_{0}$ as in Proposition 1) and $\Lambda(B_{t}, A_{t})$ as in (3), we have + +$$ +\begin{array}{l} | \mathbb {E} _ {S _ {n}} [ L _ {D} (A (S _ {n})) - L _ {S} (A (S _ {n})) ] | \\ \leq c _ {1} \frac {b}{n} \mathbb {E} _ {S _ {n}} \mathbb {E} _ {z _ {n} ^ {\prime}} \sqrt {\sum_ {t = 1} ^ {T} \mathbb {E} _ {W _ {0 : (t - 1)}} \mathbb {E} _ {B _ {t} \in G _ {1}} \mathbb {E} _ {A _ {t} \in G _ {0}} [ \Lambda (B _ {t} , A _ {t}) ]}. \tag {4} \\ \end{array} +$$ + +Remark 2.3. Though not stated explicitly, Li et al. (2020) essentially has this result for SGLD and inspired our work. Our proofs are significantly simpler, does not make any additional assumptions, and illustrates applicability to general noisy iterative algorithms of the form (2). + +Remark 2.4. The bound depends on expectations over samples $S_{n}, z_{n}^{\prime}$ , trajectories $W_{0:t-1}$ , and mini-batches $B_{t}, A_{t}$ . Unlike uniform stability and other worst case analysis, there is no sup over samples, trajectories, or mini-batches. + +Remark 2.5. The bound seems to worsen with $b$ , the size of the mini-batch. As we show in Section 3, the LSD terms have a $\frac{1}{b^2}$ dependence for SGLD and its generalizations we introduce, so the leading $b$ is neutralized. + +Remark 2.6. A high probability version of the result based on an exponential version of the Efron-Stein inequality (Boucheron et al., 2013) is presented in Appendix B.2. + +# 3. Exponential Family Langevin Dynamics + +Recent years have seen advances in establishing generalization bounds for SGLD (Li et al., 2020; Pensia et al., 2018; Negrea et al., 2019; Haghifam et al., 2020) which adds isotropic Gaussian noise at every step of SGD: + +$$ +\mathbf {w} _ {t + 1} = \mathbf {w} _ {t} - \eta_ {t} \nabla \ell \left(\mathbf {w} _ {t}, S _ {B _ {t}}\right) + \mathcal {N} \left(0, \sigma_ {t} ^ {2} \mathbb {I}\right), \tag {5} +$$ + +where $\nabla \ell (\mathbf{w}_t,S_{B_t})$ is the stochastic gradient on mini-batch $B_{t}$ $\eta_t$ is the step size, and $\sigma_t^2$ is noise vairance. We introduce a substantial generalization of SGLD called Exponential Family Langevin Dynamics (EFLD) which uses general exponential family noise in noisy iterative updates of the form (2). In addition to being a mathematical generalization of the popular SGLD, the proposed EFLD provides flexibility to use noisy gradient algorithms with different representation of the gradient, e.g., skewed Rademacher noise for Sign-SGD, discrete distribution for quantized or finite precision SGD, etc. (Canonne et al., 2020; Alistarh et al., 2017; Jiang & Agrawal, 2018; Yang et al., 2019). All technical proofs for results in this section are in Appendix C. + +# 3.1. Exponential Family Langevin Dynamics (EFLD) + +Exponential families (Barndorff-Nielsen, 2014; Brown, 1986; Wainwright & Jordan, 2008) constitute a large family of parametric distributions which include Gaussian, Bernoulli, gamma, Poisson, Dirichlet, etc., as special cases. Exponential families are typically represented in terms of natural parameters $\theta$ , and we consider component-wise independent distributions with scaled natural parameter $\theta_{\alpha} = \theta / \alpha$ with scaling $\alpha > 0$ , i.e., + +$$ +\begin{array}{l} p _ {\psi} (\boldsymbol {\xi}, \boldsymbol {\theta} _ {\alpha}) = \exp \left(\left\langle \boldsymbol {\xi}, \boldsymbol {\theta} _ {\alpha} \right\rangle - \psi \left(\boldsymbol {\theta} _ {\alpha}\right)\right) \pi_ {0, \alpha} (\boldsymbol {\xi}) \\ = \prod_ {j = 1} ^ {p} \exp (\xi_ {j} \theta_ {j \alpha} - \psi_ {j} (\theta_ {j \alpha})) \pi_ {0, \alpha} (\xi_ {j}), \\ \end{array} +$$ + +where $\pmb{\xi} \in \mathbb{R}^p$ is the sufficient statistic, $\psi(\pmb{\theta}_{\alpha}) = \sum_{j=1}^{p} \psi_j(\theta_{j\alpha})$ is the log-partition function, and $\pi_{0,\alpha}(\xi) = \prod_{j=1}^{p} \pi_{0,\alpha}(\xi_j)$ is the base measure. $\psi$ is a smooth convex function by construction (Barndorff-Nielsen, 2014; Banerjee et al., 2005; Wainwright & Jordan, 2008) which implies $\nabla_{\pmb{\theta}_{\alpha}}^{2} \psi(\pmb{\theta}_{\alpha}) \leq c_2 \mathbb{I}$ for some constant $c_2 > 0$ . + +Exponential family Langevin dynamics (EFLD) uses noisy stochastic gradient updates similar to SGLD, but using exponential family noise rather than Gaussian noise as in SGLD. In particular, for mini-batch $S_{B_t}$ , EFLD updates are as follows: with step size $\rho_t > 0$ + +$$ +\mathbf {w} _ {t} = \mathbf {w} _ {t - 1} - \rho_ {t} \boldsymbol {\xi} _ {t}, \quad \boldsymbol {\xi} _ {t} \sim p _ {\psi} (\boldsymbol {\xi}; \boldsymbol {\theta} _ {B _ {t}, \alpha_ {t}}), \tag {6} +$$ + +where + +$$ +\begin{array}{l} p _ {\psi} \left(\boldsymbol {\xi}; \boldsymbol {\theta} _ {B _ {t}, \alpha_ {t}}\right) = \exp \left(\left\langle \boldsymbol {\xi}, \boldsymbol {\theta} _ {B _ {t}, \alpha_ {t}} \right\rangle - \psi \left(\boldsymbol {\theta} _ {B _ {t}, \alpha_ {t}}\right)\right) \boldsymbol {\pi} _ {0, \alpha} (\boldsymbol {\xi}), \\ \boldsymbol {\theta} _ {B _ {t}, \alpha_ {t}} \triangleq \frac {\boldsymbol {\theta} _ {B _ {t}}}{\alpha_ {t}} = \frac {\nabla \ell \left(\mathbf {w} _ {t - 1} , S _ {B _ {t}}\right)}{\alpha_ {t}}. \tag {7} \\ \end{array} +$$ + +For EFLD, the natural parameter $\theta_{B_t,\alpha_t}$ at step $t$ is simply a scaled version of the mini-batch gradient $\nabla \ell (\mathbf{w}_{t - 1},S_{B_t})$ . EFLD becomes SGLD when the exponential family is Gaussian with $\pmb{\theta}_{B_t} = \pmb{\mu}_{B_t} = \nabla \ell (\mathbf{w}_{t - 1},S_{B_t})$ , i.e., the (unscaled) mean $\pmb{\mu}_{B_t}$ is the mini-batch gradient, since the natural and expectation parameters are equal for Gaussians (Barndorff-Nielsen, 2014; Banerjee et al., 2005). EFLD becomes noisy sign-SGD (Bernstein et al., 2018a;b) when the exponential family is a skewed Rademacher distribution over $\{-1, + 1\}$ with $P(\xi_j = +1) = \frac{\exp(\nabla\ell_j)}{\exp(-\nabla\ell_j) + \exp(\nabla\ell_j)}, P(\xi_j = -1) = 1 - P(\xi_j = +1)$ where $\nabla \ell_{j} = [\nabla \ell (\mathbf{w}_{t - 1},S_{B_{t}}) / \alpha_{t}]_{j}$ which becomes Sign-SGD as $\alpha_{t}\rightarrow 0$ (Appendix C.1). + +# 3.2. Expected Stability of EFLD + +From Lemma 1, conditioned on a trajectory $W_{0:(t - 1)} = \mathbf{w}_{0:(t - 1)}$ , mini-batches $S_{B_t}, S_{A_t}$ , we can get an expected stability based generalization bound by suitably bounding the expected LSD $\mathbb{E}[\Lambda(B_t, A_t)]$ as in (3). For EFLD, we have the following bound on the per step LSD $\Lambda(B_t, A_t)$ . + +Theorem 1. For a given set $\bar{S}_{n + 1}\sim D^{n + 1}$ and $\mathbf{w}_{t - 1}$ at iteration $(t - 1)$ , let $\Delta_{t|\mathbf{w}_{t - 1}}(\bar{S}_{n + 1}) = \max_{z,z^{\prime}\in \bar{S}_{n + 1}}\| \nabla \ell (\mathbf{w}_{t - 1},z) - \nabla \ell (\mathbf{w}_{t - 1},z^{\prime})\| _2$ . Further, for a $c_{2}$ -smooth log-partition function $\psi$ , let the scaling $\alpha_{t|\mathbf{w}_{t - 1}}$ be data-dependent such that $\alpha_{t|\mathbf{w}_{t - 1}}^2\geq 8c_2\Delta_t^2 (\bar{S}_{n + 1})$ . Then, for $\Lambda (A_t,B_t)$ as in (3) we have + +$$ +\begin{array}{l} \Lambda \left(A _ {t}, B _ {t}\right) \leq 5 c _ {2} \left\| \boldsymbol {\theta} _ {B _ {t}, \alpha_ {t}} - \boldsymbol {\theta} _ {B _ {t} ^ {\prime}, \alpha_ {t}} \right\| _ {2} ^ {2} \\ = \frac {5 c _ {2}}{2 \alpha_ {t | \mathbf {w} _ {t - 1}} ^ {2}} \left[ \left\| \nabla \ell (\mathbf {w} _ {t - 1}, S _ {B _ {t}}) - \nabla \ell (\mathbf {w} _ {t - 1}, S _ {B _ {t}} ^ {\prime}) \right\| _ {2} ^ {2} \right]. \\ \end{array} +$$ + +Remark 3.1. Theorem 1 shows that per step LSD $\Lambda(B_t, A_t)$ can be bounded by the (scaled) mini-batch gradient discrepancy. The result holds for all EFLD algorithms of the form (6)-(7). + +Remark 3.2. Since $S_{B_t}$ and $S_{B_t}'$ only differ at samples $z_n$ and $z_n' = z_{n+1}$ , $\nabla \ell(\mathbf{w}_{t-1}, S_{B_t}) - \nabla \ell(\mathbf{w}_{t-1}, S_{B_t}') = \frac{1}{b} (\nabla \ell(\mathbf{w}_{t-1}, z_n) - \nabla \ell(\mathbf{w}_{t-1}, z_n'))$ . The $1/b$ scale factor neutralizes the leading $b$ term in Lemma 1. + +Theorem 1 can now be directly applied to Lemma 1 to get expected stability based generalization bounds for EFLD. + +Theorem 2. In the setting of Proposition 1 consider an exponential family Langevin dynamics (EFLD) algorithm of the form (6)-(7) with a $c_{2}$ -smooth log-partition function $\psi$ . Then, for mini-batch size $b \leq n/2$ , with $c = c_{0}\sqrt{5c_{2}}$ (with $c_{0}$ as in Proposition 1) and $\alpha_{t|}^{2} \geq 8c_{2}\Delta_{t|}^{2}(\bar{S}_{n+1})$ (as in Theorem 1, with the conditioning on $\mathbf{w}_{t-1}$ hidden to avoid clutter), we have + +$$ +\left. \right.\left| \mathbb {E} _ {S} \left[ L _ {D} (A (S)) - L _ {S} (A (S)) \right]\right| \leq +$$ + +$$ +\frac {c}{n} \underset {\tilde {S} _ {n + 1}} {\mathbb {E}} \sqrt {\sum_ {t = 1} ^ {T} \underset {W _ {0 : (t - 1)}} {\mathbb {E}}} \frac {\left\| \nabla \ell \left(\mathbf {w} _ {t - 1} , z _ {n}\right) - \nabla \ell \left(\mathbf {w} _ {t - 1} , z _ {n} ^ {\prime}\right) \right\| _ {2} ^ {2}}{\alpha_ {t} ^ {2}}. \tag {8} +$$ + +Remark 3.3. The key term in the bound is the expected gradient discrepancy only on the sample $z_{n}, z_{n}^{\prime}$ where $S_{n}, S_{n}^{\prime}$ differ. Further, the only dependence on the specific exponential family is through the smoothness constant $c_{2}$ . + +Remark 3.4. Since SGLD is a special case of EFLD, Theorem 2 gives a generalization bound for SGLD. The bound has effectively the same dependence on $n$ and $T$ as the bound in Li et al. (2020). However, the bound is quantitatively much sharper since the gradient norm term $\frac{1}{n}\sum_{z\in S}\|\nabla\ell(\mathbf{w}_t,z)\|^2$ in Li et al. (2020) gets replaced by the gradient discrepancy term $\|\nabla\ell(\mathbf{w}_t,z) - \nabla\ell(\mathbf{w}_t,z')\|^2$ . As illustrated in our experiments (Section 4), the gradient discrepancy is orders of magnitude smaller than the gradient norm. The bound in Negrea et al. (2019) depends on a related gradient incoherence which we found to be empirically smaller than gradient discrepancy in our experiments (Section 4). However, their bound has a $1/\sqrt{n}$ sample dependence, which is worse than the $1/n$ dependence in our + +bound. Wang et al. (2021b) also obtained a $1/n$ rate in their bound depending on the sum of gradient variances. However, their bound scales inversely with $b$ , since gradient variance increases as $b$ decreases. In contrast, our bound is suitable for small batch size as well. Lei & Ying (2020) considered "on average stability" based generalization bounds, but has a dependence either on $L$ or on some form of convexity. Our bound does not depend on $L$ , and works for any non-convex and non-smooth loss. + +Remark 3.5. Our bounds hold for non-convex and/or non-smooth loss functions. Hardt et al. (2016) developed uniform stability based generalization bounds for SGD for smooth losses. To compare with Hardt et al. (2016) for the non-convex case, note that by construction, $\gamma_t^2 \coloneqq \frac{\|\nabla\ell(w,z_n) - \nabla\ell(w,z_n')\|_2^2}{\alpha^2} \leq \frac{\Delta^2(\bar{S}_{n+1})}{\alpha^2} \leq \frac{1}{8c_2}$ , so that our bound in Theorem 2 can be upper bounded by $\frac{c}{n}\mathbb{E}_{\bar{S}_{n+1}}\sqrt{\sum_{t=1}^{T}\mathbb{E}_{W_{0:(t-1)}}\left[\frac{1}{8c_2}\right]} \leq \frac{\sqrt{5}c_0\sqrt{T}}{2\sqrt{2}}\frac{n}{n}$ , since $c = c_0\sqrt{5c_2}$ . For a $\beta = 1$ smooth loss, with step size $\eta_t = 1/t$ , Hardt et al. (2016) gets a $O(\sqrt{T}/n)$ bound by their Theorem 3.12. However, we do not need the loss to be smooth and we work with constant step sizes. Their results do not extend to non-smooth losses or constant step sizes. + +Remark 3.6. EFLD can be extended to work with anisotropic noise by using $\pmb{\theta}_{B_t,\pmb{\alpha}_t} = \nabla \ell (\mathbf{w}_{t - 1},S_{B_t})\oslash \pmb{\alpha}_t$ in (7) where $\pmb{\alpha}_t\in \mathbb{R}^p$ determines different scaling for each dimension and $\varnothing$ denotes Hadamard division. Theorems 1 and 2 can be extended to such anisotropic noise by using $\pmb{\alpha}$ -scaled norms for the gradient discrepancy, i.e., $\| \mathbf{g} - \mathbf{g}'\|_{2,\pmb {\alpha}}^2 = \sum_j(g_j - g_j')^2 /\alpha_j^2$ + +Remark 3.7. The lower bound on $\alpha_{t}$ in Theorem 2 is a data-dependent quantity $\Delta_{t|}(\bar{S}_{n+1})$ . For SGLD in (5), the condition implies $\eta_{t} \leq \sigma_{t} / c_{3} \Delta_{t|}(\bar{S}_{n+1})$ , a much more benign (and computable) condition on the step size compared to those in the related work (Mou et al., 2018; Li et al., 2020; Hardt et al., 2016) which require step size to be bounded by $\sigma_{t} / L$ , where $L$ is the global Lipschitz constant for the loss $\ell$ . Note that $\Delta_{t|}(\bar{S}_{n+1}) \ll L$ because $L$ is a uniform bound. Further, $\Delta_{t|}(\bar{S}_{n+1})$ is expected to decrease over iterations, i.e., as $t$ increases, and gradients get smaller. + +3.3. Proof Sketches of Main Results: Theorems 1 and 2 We focus on Theorem 1. To avoid clutter, we drop the subscript $t$ for the analysis and note that the analysis holds for any step $t$ . When the densities $dP_{B,\pmb{\xi}} = p_{\psi}(\pmb{\xi}; \pmb{\theta}_{B,\alpha})$ and $dP_{B,\pmb{\xi}}' = p_{\psi}(\pmb{\xi}; \pmb{\theta}_{B,\alpha}')$ , i.e., densities in the same exponential family but with different parameters $\pmb{\theta}_{B,\alpha}$ and $\pmb{\theta}_{B,\alpha}'$ because of the difference in the mini-batches, by mean-value theorem, for each $\pmb{\xi}$ , we have + +$$ +p _ {\psi} (\boldsymbol {\xi}; \boldsymbol {\theta} _ {B, \alpha}) - p _ {\psi} (\boldsymbol {\xi}; \boldsymbol {\theta} _ {B, \alpha} ^ {\prime}) = \left\langle \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {B, \alpha} ^ {\prime}, \nabla_ {\tilde {\boldsymbol {\theta}} _ {B, \alpha}} p _ {\psi} (\boldsymbol {\xi}; \tilde {\boldsymbol {\theta}} _ {B, \alpha}) \right\rangle +$$ + +for some $\tilde{\pmb{\theta}}_{B,\alpha} = \gamma_{\pmb{\xi}}\pmb{\theta}_{B,\alpha} + (1 - \gamma_{\pmb{\xi}})\pmb{\theta}_{B,\alpha}^{\prime}$ where $\gamma_{\pmb{\xi}}\in [0,1]$ with the subscript $\pmb{\xi}$ illustrating dependence on $\pmb{\xi}$ . Then, + +$$ +\begin{array}{l} \Lambda_ {A, B} = \int_ {\boldsymbol {\xi}} \frac {\left(p _ {\psi} (\boldsymbol {\xi} ; \boldsymbol {\theta} _ {B , \alpha}) - p _ {\psi} (\boldsymbol {\xi} ; \boldsymbol {\theta} _ {B , \alpha} ^ {\prime})\right) ^ {2}}{p _ {\psi} (\boldsymbol {\xi} ; \boldsymbol {\theta} _ {A , \alpha})} d \boldsymbol {\xi} \\ = \int_ {\boldsymbol {\xi}} \frac {\left\langle \boldsymbol {\theta} _ {B , \alpha} - \boldsymbol {\theta} _ {B , \alpha} ^ {\prime} , \nabla_ {\tilde {\boldsymbol {\theta}} _ {B , \alpha}} p _ {\psi} (\boldsymbol {\xi} ; \tilde {\boldsymbol {\theta}} _ {B , \alpha}) \right\rangle^ {2}}{p _ {\psi} (\boldsymbol {\xi} ; \boldsymbol {\theta} _ {A , \alpha})} d \boldsymbol {\xi} \\ = \int_ {\boldsymbol {\xi}} \frac {\left\langle \boldsymbol {\theta} _ {B , \alpha} - \boldsymbol {\theta} _ {B , \alpha} ^ {\prime} , \boldsymbol {\xi} - \nabla_ {\tilde {\boldsymbol {\theta}} _ {B , \alpha}} \psi (\boldsymbol {\xi}; \tilde {\boldsymbol {\theta}} _ {B , \alpha}) \right\rangle^ {2} p _ {\psi} ^ {2} (\boldsymbol {\xi}; \tilde {\boldsymbol {\theta}} _ {B , \alpha})}{p _ {\psi} (\boldsymbol {\xi}; \boldsymbol {\theta} _ {A , \alpha})} d \boldsymbol {\xi}, \tag {9} \\ \end{array} +$$ + +$$ +\begin{array}{l} \begin{array}{c c c c c} \text {w h e r e s i n c e} & p _ {\psi} (\boldsymbol {\xi}; \tilde {\boldsymbol {\theta}} _ {B, \alpha}) & = & \exp (\langle \boldsymbol {\xi}, \tilde {\boldsymbol {\theta}} _ {B, \alpha} \rangle & - \\ \psi (\tilde {\boldsymbol {\theta}} _ {B, \alpha})) \pi_ {0} (\boldsymbol {\xi}) & \text {w e} & \text {h a v e} & \nabla_ {\tilde {\boldsymbol {\theta}} _ {B, \alpha}} p _ {\psi} (\boldsymbol {\xi}; \tilde {\boldsymbol {\theta}} _ {B, \alpha}) & = \end{array} \\ \left(\boldsymbol {\xi} - \nabla_ {\tilde {\boldsymbol {\theta}} _ {B, \alpha}} \psi (\boldsymbol {\xi}; \tilde {\boldsymbol {\theta}} _ {B, \alpha})\right) p _ {\psi} (\boldsymbol {\xi}; \tilde {\boldsymbol {\theta}} _ {B, \alpha}). \\ \end{array} +$$ + +Handling Distributional Dependence of $\tilde{\theta}_{B,\alpha}$ . Note that it is difficult to proceed with the analysis with the density term depending on parameter $\tilde{\theta}_{B,\alpha}$ since $\tilde{\theta}_{B,\alpha}$ depends on $\xi$ and there is an outside integral over $\xi$ in (9). So, we first bound the density term depending on $\tilde{\theta}_{B,\alpha}$ in terms of exponential family densities with parameters $\theta_{B,\alpha}$ and $\theta_{B,\alpha}^{\prime}$ essentially using $c_2$ -smoothness of $\psi$ . + +Lemma 2. With $\tilde{\pmb{\theta}}_{B,\alpha} = \gamma_{\pmb{\xi}}\pmb{\theta}_{B,\alpha} + (1 - \gamma_{\pmb{\xi}})\pmb{\theta}_{B,\alpha}^{\prime}$ for some $\gamma_{\pmb{\xi}}\in [0,1]$ , we have + +$$ +\begin{array}{l} \frac {\exp \left[ \langle \boldsymbol {\xi} , \tilde {\boldsymbol {\theta}} _ {B , \alpha} \rangle - \psi (\tilde {\boldsymbol {\theta}} _ {B , \alpha}) \right]}{\max \left(\exp \left[ \langle \boldsymbol {\xi} , \boldsymbol {\theta} _ {B , \alpha} \rangle - \psi (\boldsymbol {\theta} _ {B , \alpha}) \right] , \exp \left[ \langle \boldsymbol {\xi} , \boldsymbol {\theta} _ {B , \alpha} ^ {\prime} \rangle - \psi (\boldsymbol {\theta} _ {B , \alpha} ^ {\prime}) \right]\right)} \\ \leq \exp \left[ c _ {2} \| \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {B, \alpha} ^ {\prime} \| _ {2} ^ {2} \right]. \\ \end{array} +$$ + +In other words, for any $\xi$ we have + +$$ +\begin{array}{l} p _ {\psi} (\boldsymbol {\xi}; \tilde {\boldsymbol {\theta}} _ {B, \alpha}) \leq \\ \exp \left[ c _ {2} \| \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {B, \alpha} ^ {\prime} \| _ {2} ^ {2} \right] \max \left(p _ {\psi} (\boldsymbol {\xi}; \boldsymbol {\theta} _ {B, \alpha}), p _ {\psi} (\boldsymbol {\xi}; \boldsymbol {\theta} _ {B, \alpha} ^ {\prime})\right). \\ \end{array} +$$ + +Since the parameters $\theta_{B,\alpha},\theta_{B,\alpha}^{\prime}$ in the right-hand-side depend on $\xi$ , the outside integral over $\xi$ in (9) will not pose any unusual challenges. + +Bounding the Density Ratio. Next we focus on the density ratio $p_{\psi}^{2}(\pmb{\xi}, \tilde{\pmb{\theta}}_{B,\alpha}) / p_{\psi}(\pmb{\xi}; \pmb{\theta}_{A,\alpha})$ in (9). By Lemma 2, it suffices to focus on $p_{\psi}^{2}(\pmb{\xi}, \pmb{\theta}_{B,\alpha}) / p_{\psi}(\pmb{\xi}; \pmb{\theta}_{A,\alpha})$ or the equivalent term for $\pmb{\theta}_{B,\alpha}'$ . We show that the density ratio can be bounded by another distribution in the same exponential family $p_{\psi}$ with parameters $(2\pmb{\theta}_{B,\alpha} - \pmb{\theta}_{A,\alpha})$ . + +Lemma 3. For any $\xi$ , we have + +$$ +\begin{array}{l} \frac {\exp \left[ \langle \boldsymbol {\xi} , 2 \boldsymbol {\theta} _ {B , \alpha} \rangle - 2 \psi (\boldsymbol {\theta} _ {B , \alpha}) \right]}{\exp \left[ \langle \boldsymbol {\xi} , \boldsymbol {\theta} _ {A , \alpha} \rangle - \psi (\boldsymbol {\theta} _ {A , \alpha}) \right]} \leq \exp \left[ 2 c _ {2} \| \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {A, \alpha} \| _ {2} ^ {2} \right] \\ \times \exp \left[ \langle \boldsymbol {\xi}, (2 \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {A, \alpha} \rangle - \psi (2 \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {A, \alpha}) \right]. \\ \end{array} +$$ + +In other words, for any $\xi$ we have + +$$ +\frac {p _ {\psi} ^ {2} (\boldsymbol {\xi} , \boldsymbol {\theta} _ {B , \alpha})}{p _ {\psi} (\boldsymbol {\xi} ; \boldsymbol {\theta} _ {A , \alpha})} \leq \exp \left[ 2 c _ {2} \| \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {A, \alpha} \| _ {2} ^ {2} \right] p _ {\psi} (\boldsymbol {\xi}; 2 \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {A, \alpha}). +$$ + +The analysis for the term $p_{\psi}^{2}(\pmb{\xi}, \pmb{\theta}_{B,\alpha}') / p_{\psi}(\pmb{\xi}; \pmb{\theta}_{A,\alpha})$ is exactly the same. + +Bounding the Integral. Ignoring multiplicative terms which do not depend on $\xi$ for the moment, the analysis needs to bound an integral term of the form + +$$ +\int_ {\boldsymbol {\xi}} \left\langle \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {B, \alpha} ^ {\prime}, \boldsymbol {\xi} - \nabla \psi (\boldsymbol {\xi}; \tilde {\boldsymbol {\theta}} _ {B, \alpha}) \right\rangle^ {2} p _ {\psi} (\boldsymbol {\xi}; 2 \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {A, \alpha}) d \boldsymbol {\xi}, +$$ + +and a similar term with $p_{\psi}(\xi ;2\theta_{B,\alpha}^{\prime} - \theta_{A,\alpha})$ .First, note that $\nabla \psi (\pmb {\xi};\tilde{\pmb{\theta}}_{B,\alpha}) = \tilde{\pmb{\mu}}_{B,\alpha}$ , the expectation parameter for $p_{\psi}(\pmb {\xi};\tilde{\pmb{\theta}}_{B,\alpha})$ (Wainwright & Jordan, 2008; Banerjee et al., 2005). The integral, however, is with respect to $p_{\psi}(\xi ;2\theta_{B,\alpha} - \theta_{A,\alpha})$ , not $p_{\psi}(\xi ;\tilde{\theta}_{B,\alpha})$ . We handle this discrepancy by using + +$$ +\begin{array}{l} \left\langle \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {B, \alpha} ^ {\prime}, \boldsymbol {\xi} - \nabla \psi (\boldsymbol {\xi}; \tilde {\boldsymbol {\theta}} _ {B, \alpha}) \right\rangle^ {2} \\ = \left\langle \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {B, \alpha} ^ {\prime}, (\boldsymbol {\xi} - \mathbb {E} [ \boldsymbol {\xi} ]) + (\mathbb {E} [ \boldsymbol {\xi} ] - \nabla \psi (\boldsymbol {\xi}; \tilde {\boldsymbol {\theta}} _ {B, \alpha})) \right\rangle^ {2} \\ \leq 2 \left\langle \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {B, \alpha} ^ {\prime}, \boldsymbol {\xi} - \mathbb {E} [ \boldsymbol {\xi} ] \right\rangle^ {2} \\ + 2 \left\langle \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {B, \alpha} ^ {\prime}, \mathbb {E} [ \boldsymbol {\xi} ] - \nabla \psi (\boldsymbol {\xi}; \tilde {\boldsymbol {\theta}} _ {B, \alpha}) \right\rangle^ {2}, \\ \end{array} +$$ + +where the expectation $\mathbb{E}[\pmb{\xi}]$ is with respect to $p_{\psi}(\pmb{\xi}; 2\pmb{\theta}_{B,\alpha} - \pmb{\theta}_{A,\alpha})$ . Quadratic form for the first term yields the covariance $\mathbb{E}[(\pmb{\xi} - \mathbb{E}[\pmb{\xi}])(\pmb{\xi} - \mathbb{E}[\pmb{\xi}])^T] = \nabla^2\psi(\pmb{\theta}_{2\pmb{\theta}_{B,\alpha} - \pmb{\theta}_{A,\alpha}}) \leq c_2\mathbb{I}$ , by smoothness and since the covariance matrix of an exponential family is the Hessian of the log-partition function (Wainwright & Jordan, 2008). Since $\mathbb{E}[\pmb{\xi}] = \nabla \psi(2\pmb{\theta}_{B,\alpha} - \pmb{\theta}_{A,\alpha})$ , the second term depends on the difference of gradients $\nabla \psi(2\pmb{\theta}_{B,\alpha} - \pmb{\theta}_{A,\alpha}) - \nabla \psi(\tilde{\pmb{\theta}}_{B,\alpha})$ which, using smoothness and additional analysis, can be bounded by the norm of $(\pmb{\theta}_{B,\alpha} - \pmb{\theta}_{A,\alpha})$ . All the pieces can be put together to get the bound in Theorem 1, which when used in Lemma 1 yields Theorem 2. + +# 3.4. Optimization Guarantees for EFLD + +We now establish optimization guarantees for two examples of EFLD, i.e., Noisy Sign-SGD with skewed Rademacher noise over $\{-1, +1\}$ and SGLD with Gaussian noise. The details and the proof for results in this subsection are relegated in Appendix D. + +Noisy Sign-SGD. For noisy Sign-SGD with mini-batch $B_{t}$ and scaling $\alpha_{t}$ , mini-batch Noisy Sign-SGD updates as $\mathbf{w}_t = \mathbf{w}_{t - 1} - \eta_t\pmb {\xi}_t$ , where each component $j\in [p]$ + +$$ +\pmb {\xi} _ {t, j} \sim p _ {\pmb {\theta} _ {B _ {t}, \alpha_ {t}, j}} (\xi_ {j}) = \frac {\exp (\xi_ {j} \theta_ {B _ {t} , \alpha_ {t} , j})}{\exp (- \theta_ {B _ {t} , \alpha_ {t} , j}) + \exp (\theta_ {B _ {t} , \alpha_ {t} , j})}, +$$ + +where $\xi_{j}\in \{-1, + 1\}$ and $\theta_{B_t,\alpha_t} = \nabla \ell (\mathbf{w}_{t - 1},S_{B_t}) / \alpha_t$ is the scaled mini-batch gradient. The full-batch version uses parameters $\theta_{B_t,\alpha_t} = \nabla L_S(\mathbf{w}_{t - 1}) / \alpha_t$ . For full batch gradient descent, we assume that the loss is smooth. + +Assumption 1. The loss function $L_{S}(\mathbf{w}) = \frac{1}{n}\sum_{i=1}^{n}\ell(\mathbf{w},z_{i})$ satisfies: $\forall \mathbf{w},\mathbf{w}',$ for some nonnegative constants $\vec{K} := [K_1,\dots,K_p]$ , we have $L_{S}(\mathbf{w}) \leq L_{S}(\mathbf{w}') + \nabla L_{S}(\mathbf{w}')^{T}(\mathbf{w} - \mathbf{w}') + \frac{1}{2}\sum_{i}K_{i}(w_{i} - w_{i}')^{2}$ . + +For mini-batch analysis, we assume the mini-batch gradients are unbiased, symmetric, and sub-Gaussian. + +Assumption 2. Given $\mathbf{w}_{t - 1}$ the mini-batch gradient $\nabla \ell (\mathbf{w}_{t - 1},S_{B_t})$ is (a) unbiased, i.e., $\mathbb{E}_{B_t|\mathbf{w}_{t - 1}}\nabla \ell (\mathbf{w}_{t - 1},S_{B_t}) = \nabla L_S(\mathbf{w}_{t - 1});(b)$ symmetric, i.e., the density $p_{B_t|\mathbf{w}_{t - 1}}(\pmb {\xi})$ of $\pmb {\xi}\equiv \nabla \ell (\mathbf{w}_{t - 1},S_{B_t})$ is symmetric and (c) sub-Gaussian, i.e., for any $\lambda >0$ any v s.t. $\| \mathbf{v}\| _2 = 1$ $\mathbb{E}_{B_t|\mathbf{w}_{t - 1}}[\exp \lambda \langle \mathbf{v},\nabla \ell (\mathbf{w}_{t - 1},S_{B_t})-\nabla L_S(\mathbf{w}_{t - 1}))]\leq \exp (\lambda^2\kappa_t^2 /2)$ ,for some constant $\kappa_{t} > 0$ + +The smoothness assumption in Assumption 1 is standard in non-convex optimization especially for sign-SGD literature (Bernstein et al., 2018a;b). Assumption 2 for the mini-batch setting helps the theoretical analysis, where (a) is satisfied when the batches $S_{B_t}$ are taken uniformly from samples $S$ as the standard training does; (b) assumes symmetry of the mini-batch gradients; and (c) is similar and stronger assumption compared to Assumption 3 in Bernstein et al. (2018a), where they assume bounded variance for stochastic gradient and our assumption implies suitably bounded higher moments of $\nabla \ell(\mathbf{w}_{t-1}, S_{B_t}) - \nabla L_S(\mathbf{w}_{t-1})$ , which is referred as the minibatch noise in recent noisy SGD literature e.g. Damian et al. (2021). Similar to such literature, if we consider mini-batch stochastic gradient be modeled as the average of $|B_t|$ calls to the full-batch gradient, from concentration property $\kappa_t$ is scaled by $1 / \sqrt{|B_t|}$ . + +Based on the assumptions, we have following optimization guarantee for mini-batch noisy Sign-SGD, the full-batch version can be found in Appendix D. + +Theorem 3. The following holds for any $S$ , any initialization $\mathbf{w}_0$ , and the expectation is taken over the randomness of algorithm: if Assumption 1 and 2 hold, for mini-batch noisy Sign-SGD with step size $\eta_t = 1 / \sqrt{T}$ , and $\alpha_{t}$ satisfying $c\geq \alpha_{t}\geq \max [\sqrt{2}\kappa_{t},4\| \nabla L_{S}(\mathbf{w}_{t})\|_{\infty}]$ , we have + +$$ +\mathbb {E} \| \nabla L _ {S} (\mathbf {w} _ {R}) \| _ {2} ^ {2} \leq O \left(\frac {1}{\sqrt {T}}\right) + O \left(\frac {\| \vec {K} \| _ {1}}{\sqrt {T}}\right), +$$ + +where $\mathbf{w}_R$ is uniformly randomly sampled from $\{\mathbf{w}_t\}_{t=1}^T$ . + +Stochastic Gradient Langevin Dynamics (SGLD). We acknowledge that following optimization result for SGLD exists in various forms, as noisy gradient descent algorithms with Gaussian noise have been studied in literature such as differential privacy, where SGLD can be viewed as DP-SGD (Bassily et al., 2014; Wang & Xu, 2019) and the proof technique boils down to bounding the stochastic variance of the noisy gradient (Shamir & Zhang, 2013). + +![](images/90a3b57cf2fef9db6cdb374732dd2428958920d5de5bfd63cc5a710f867e0c22.jpg) +(a) MNIST, $\alpha_{t}^{2}\approx 0.1$ + +![](images/3dcec359cef1a379c6077808a62b637987555083bdcb86efb1bcc303f72a14ce.jpg) +(b) CIFAR-10, $\alpha_{t}^{2}\approx 0.1$ + +![](images/cf4e0a8248730fa899508820a6d24451c7129f14881899b17cdd4f6bf98465f3.jpg) +(c) Fashion, $\alpha_{t}^{2}\approx 0.1$ + +![](images/4c8174b0aea362662728973a6a89b5ff6a6ca53681275b7478515be445168d43.jpg) +(d) Fashion, $\alpha_{t}^{2}\approx 0.01$ + +![](images/7c478f8821caa3a1fa1fd69542848a3e11e85d58aa4241d6d09a48927eebef4c.jpg) +(e) MNIST, $\alpha_t^2\approx 0.1$ + +![](images/82f561c63d96e16d28ef8a701dba386ee22f1e0720655d92fffd4a604622f731.jpg) +(f) CIFAR-10, $\alpha_{t}^{2}\approx 0.1$ + +![](images/5e0ec37644a58deaf4a122a961d7b41631fbc106e29efc72e4f70039bbbe1af9.jpg) +(g) Fashion, $\alpha_{t}^{2}\approx 0.1$ +Figure 1. Results for training CNN using SGLD on MNIST, Fashion-MNIST and CIFAR-10. (a)-(d) shows our bound is non-vacuous and can be used to bound the empirical test error. (e)-(h) compare our bound with the existing bounds and show the effect on $\alpha_{t}^{2}$ . Our bounds are numerically sharper than existing bounds, and larger $\alpha_{t}^{2}$ leads to tighter generalization bounds which is consistent with Theorem 2. + +![](images/6bf4fe6a1085b39d7f0749258e3ca0964cab101c0ce882d966b2ce19ad3f71c9.jpg) +(h) Fashion, $\alpha_{t}^{2}\approx 0.01$ + +Theorem 4. The following holds for any $S$ , any initialization $\mathbf{w}_0$ , and the expectation is taken over the randomness of algorithm: under Assumptions 1 and 2 with $K_{i} = K, \forall i \in [p]$ , SGLD, i.e., EFLD with Gaussian noise, $\rho_{t} = \eta_{t}$ , $\alpha_{t} = \sigma_{t} / \eta_{t}$ , and step size $\eta_{t} = \frac{1}{\sqrt{T}}$ satisfies + +$$ +\mathbb {E} \| \nabla L _ {S} (\mathbf {w} _ {R}) \| ^ {2} \leq O \left(\frac {1}{\sqrt {T}}\right) + O \left(\frac {\frac {K}{2 T} \sum_ {t = 1} ^ {T} (p \alpha_ {t} ^ {2} + \kappa_ {t} ^ {2})}{\sqrt {T}}\right), +$$ + +where $\mathbf{w}_R$ is uniformly randomly sampled from $\{\mathbf{w}_t\}_{t=1}^T$ . + +The error rate of SGLD depends on the noise level $\alpha_{t}$ and the sub-Gaussian parameter $\kappa_{t}$ . The bound has a $O(1 / \sqrt{T})$ rate as long as the average noise level and sub-Gaussian parameter are bounded by a constant. Similar to differentially private SGD, the convergence rate depends on the dimension of the gradient $p$ due to the isotropic Gaussian noise. Special noise structures such as anisotropic noise that align with the gradient structure can improve the dependence on dimension (Kairouz et al., 2020; Zhang et al., 2021; Asi et al., 2021; Zhou et al., 2020). + +# 4. Experiments + +In this section, we conduct experiments to evaluate our generalization error bounds. For SGLD, we compare our bound in Theorem 2 with existing bounds in Li et al. (2020); Negrea et al. (2019); Rodríguez-Gálvez et al. (2021) for various datasets. Note that the bound presented in Rodríguez-Gálvez et al. (2021) is an extension of that in Haghifam + +et al. (2020) from full-batch setting to mini-batch setting. We also evaluate the optimization performance of proposed Noisy Sign-SGD, comparing it with the original Sign-SGD (Bernstein et al., 2018a) and present the corresponding generalization bound in Theorem 2. + +The details of model architectures, learning rate schedules, hyper-parameter selections, and additional experimental results can be found in Appendix E. Evaluation of the expectation in Theorem 2 is done based on (re)sampling (Appendix E). We emphasize that the goal for the experiments is to do a comparative study relative to existing bounds. We note that the empirical performance of the methods can potentially be improved with better architectures and training strategies, e.g., deeper/wider networks, data augmentation, batch/layer normalization, etc. + +# 4.1. Stochastic Gradient Langevin Dynamics + +Comparison with existing work. We have derived generalization error bounds that depend on the data-dependent gradient discrepancy, i.e., $\| \nabla \ell (\mathbf{w}_t,z_n) - \nabla \ell (\mathbf{w}_t,z'_n)\| _2^2$ . Existing bounds in Li et al. (2020) and Negrea et al. (2019) have also improved the Lipschitz constant in Mou et al. (2018) to a data-dependent quantity. All these generalization error bounds can be added to the empirical training error to get bounds on the empirical test error. As shown in Figure 1 (a)-(d), our bound is able to generate a much tighter upper bound on the test error. The improvements is mainly due to the fact that we replace the squared gradient norm in + +![](images/d8bc7f9a079d8ada0ee5cd02dd4fb40189512acf11c03c619e34e0ff0abe8f89.jpg) +(a) MNIST, $\alpha_{t}^{2}\approx 0.1$ + +![](images/884a3ce9c6f75d2aba4ca9591726b28f73afdf52bb9f53c53a56f4f6759e32d8.jpg) +(b) CIFAR-10, $\alpha_{t}^{2}\approx 0.1$ + +Li et al. (2020), the squared norm of gradient incoherence in Negrea et al. (2019), and that of two-sample incoherence in Rodríguez-Gálvez et al. (2021) with the gradient discrepancy while maintaining a $1/n$ sample dependence. Figure 1 (e)-(h) shows that our bounds are much sharper than those of Li et al. (2020) because our gradient discrepancy norms (Figure 2) are usually 2-4 orders of magnitude smaller than the squared gradient norms in Li et al. (2020). Our bounds are also sharper than those of Negrea et al. (2019) and Rodríguez-Gálvez et al. (2021) due to our $O(1/n)$ sample dependence compared to their $O(1/\sqrt{n})$ dependence. Although the gradient incoherence in Negrea et al. (2019) is can be about 1 to 2 orders of magnitude smaller than the gradient discrepancy for simple problems such as MNIST (Figure 2(a)), the difference between the gradient incoherence and our gradient discrepancy reduces as the problem becomes harder (see results for CIFAR-10 in Figure 2(b)). + +Effect of Random Labels. Motivated by Zhang et al. (2017), we train CNN with SGLD on a smaller subset of MNIST dataset $(n = 10,000)$ with randomly corrupted labels. The corruption fraction varies from $0\%$ (no label corruption) to $60\%$ . As shown in Figure 3 (a), for long enough training time, all experiments with different levels of label randomness can achieve almost zero training error. However, increase in random labels leads to increase in gradient discrepancy (Figure 3(b)) which in turn leads to increase in the generalization bound (Figure 3(c)). As a result, as the empirical error rate increases with increase in label randomness (Figure 3(d) dashed lines), we get the correct increase in the test error bound (solid lines). + +# 4.2. Noisy Sign-SGD + +In this section, we present numerical results for Noisy Sign-SGD proposed in section 3.1. Since none of the existing bounds can give a valid generalization bound for Noisy Sign-SGD, we only present our bound here. + +![](images/8d6b461890c1d33186c9f3887c1c72e966793d46cd81f983855009f0a80942fd.jpg) +(a) Training Error + +![](images/6a7f82e36cf6cb82829a61c22e15cfd980aa47c195e5d4595aad1284e348cc70.jpg) +(b) Gradient Discrepancy + +![](images/c27d3f20c4c700961586c77e77cbafd0e75371bc616e749b196c920ecaa00412.jpg) +Figure 2. Comparison of the squared gradient norm (Li et al., 2020), the gradient incoherence (Negrea et al., 2019), the two-sample incoherence (Rodríguez-Gálvez et al., 2021), and the gradient discrepancy in our bound. Incoherence or discrepancy based quantities are orders of magnitude smaller than the gradient norm. +Figure 3. Results for training CNN using SGLD on a subset of MNIST ( $n = 10000$ ) with different label randomness.(a) Training error: While training takes more epochs with random labels, training error does go to zero. (b) Gradient discrepancy: As the randomness increases, so does the gradient discrepancy, leading to the increase in the generalization bound. (c) Generalization bound: As the randomness increases, so does the generalization bound in Theorem 2. (d) Test error and bound: As the randomness increases, the empirical test error (dashed lines) increases and so does the test error bound (solid lines); overall, the bounds stay valid. + +![](images/6ed9a5e6a86da2cc3303c01358ab7d6e44e650a81a728b98de1fe6a771571707.jpg) +(c) Generalization Bound +(d) Test Error Bound + +**Optimization.** Figure 4 (a)-(b) show the training dynamics of Noisy Sign-SGD under various choices of $\alpha_{t}$ . For small $\alpha_{t}$ , Noisy Sign-SGD matches both the optimization trajectory as well as the test accuracy of the original Sign-SGD (Bernstein et al., 2018a). However, as $\alpha_{t}$ increases, the distribution over $\{-1, +1\}$ is more spread out and the corresponding Noisy Sign-SGD seems to converge but to a sub-optimal value. + +Generalization Bound. Figure 4(c)-(d) show that our bound successfully bounds the empirical test error. Larger $\alpha_{t}$ leads to sharper generalization bounds. However, larger $\alpha_{t}$ adversely affects the optimization, e.g., Figure 4 (a)-(b) blue and orange lines. The results illustrate the trade-off between the empirical optimization and the generalization bound. In practice, one needs to balance the optimization error and generalization by choosing a suitable scaling $\alpha_{t}$ . + +# 5. Conclusions + +Inspired by recent advances in stability based and information theoretic approaches to generalization bounds (Mou et al., 2018; Pensia et al., 2018; Negrea et al., 2019; Li et al., 2020; Haghifam et al., 2020), we have presented a framework for developing such bounds based on expected stability for noisy stochastic iterative algorithms. We have also in + +![](images/1a472d4a4613ac2753efc579410398bdab8764c1ddb9ddafe6032bf9905ba796.jpg) +(a) CNN, MNIST + +![](images/1fe210eaa08c313fe10c94d1fae4f75ad337c594196961577f39daa4dcb49014.jpg) +(b) CNN, Fashion + +![](images/73322b2f670e2b683d906cc9b92a1a6033638eab8474dfee768c18a2584b1dc2.jpg) +(c) CNN, MNIST, $\alpha_{t} = 1$ + +![](images/850105cefde8defa2019d9a808fe90cfef81859ebe331c25e91a1155bd59ad9e.jpg) +(d) CNN, Fashion, $\alpha_{t} = 1$ +Figure 4. (a)-(b) show the training dynamics of CNN on MNIST and Fashion-MNIST using noisy sign-SGD with different scaling $\alpha_{t}$ . Legends indicate the choice of $\alpha_{t}$ and the numbers in brackets are test errors at convergence. As $\alpha_{t} \to 0$ , Nosiy sign-SGD matches both the optimization trajectory as well as the final test accuracy of the original sign-SGD (Bernstein et al., 2018a). (c)-(d) show that empirical test error can be bounded by our bound and the corresponding training error. + +produced Exponential Family Langevin Dynamics (EFLD), a large family of noisy gradient descent algorithms based on exponential family noise, including SGLD and Noisy Sign-SGD as two special cases. We have developed an expected stability based generalization bound applicable to any EFLD algorithm with a $O(1/n)$ sample dependence and a dependence on gradient discrepancy, rather than gradient norms. Further, we have provided optimization guarantees for special cases of EFLD, viz. Noisy Sign-SGD and SGLD. Our experiments on various benchmarks illustrate that our bounds are non-vacuous and quantitatively much sharper than existing bounds (Li et al., 2020; Negrea et al., 2019). + +Acknowledgements. The research was supported by NSF grants IIS 21-31335, OAC 21-30835, DBI 20-21898, and a C3.ai research award. We would like to thank the reviewers for valuable comments and the Minnesota Supercomputing Institute (MSI) for computational resources and support. + +# References + +Alistarh, D., Grubic, D., Li, J., Tomioka, R., and Vojnovic, M. Qsgd: Communication-efficient sgd via gradient quantization and encoding. In Guyon, I., Luxburg, U. V., Bengio, S., Wallach, H., Fergus, R., Vishwanathan, S., and Garnett, R. (eds.), Advances in Neural Information Processing Systems 30, pp. 1709-1720. Curran Associates, + +Inc., 2017. +Asi, H., Duchi, J., Fallah, A., Javidbakht, O., and Talwar, K. Private adaptive gradient methods for convex optimization. In International Conference on Machine Learning, pp. 383-392. PMLR, 2021. +Banerjee, A., Merugu, S., Dhillon, I. S., and Ghosh, J. Clustering with bregman divergences. Journal of machine learning research, 6(10), 2005. +Barndorff-Nielsen, O. Information and exponential families: in statistical theory. John Wiley & Sons, 2014. +Bassily, R., Smith, A., and Thakurta, A. Private empirical risk minimization: Efficient algorithms and tight error bounds. In 2014 IEEE 55th Annual Symposium on Foundations of Computer Science, pp. 464-473. IEEE, 2014. +Bassily, R., Feldman, V., Talwar, K., and Guha Thakurta, A. Private stochastic convex optimization with optimal rates. Advances in neural information processing systems, 2019. +Bassily, R., Feldman, V., Guzmán, C., and Talwar, K. Stability of stochastic gradient descent on nonsmooth convex losses. Advances in Neural Information Processing Systems, 33, 2020. +Bernstein, J., Wang, Y.-X., Azizzadenesheli, K., and Anandkumar, A. signsgd: Compressed optimisation for nonconvex problems. In International Conference on Machine Learning, pp. 560-569. PMLR, 2018a. +Bernstein, J., Zhao, J., Azizzadenesheli, K., and Anandkumar, A. signsgd with majority vote is communication efficient and fault tolerant. In International Conference on Learning Representations, 2018b. +Boucheron, S., Lugosi, G., and Massart, P. Concentration inequalities: A nonasymptotic theory of independence. Oxford university press, 2013. +Bousquet, O. and Elisseeff, A. Stability and generalization. Journal of Machine Learning Research, 2:499-526, 2002. +Bousquet, O., Klochkov, Y., and Zhivotovsky, N. Sharper bounds for uniformly stable algorithms. In Conference on Learning Theory, pp. 610-626. PMLR, 2020. +Brown, L. D. Fundamentals of statistical exponential families: with applications in statistical decision theory. Ims, 1986. +Bu, Y., Zou, S., and Veeravalli, V. V. Tightening mutual information based bounds on generalization error. In 2019 IEEE International Symposium on Information Theory (ISIT), pp. 587-591. IEEE, 2019. + +Bun, M., Dwork, C., Rothblum, G. N., and Steinke, T. Composable and versatile privacy via truncated cdp. In Proceedings of the 50th Annual ACM SIGACT Symposium on Theory of Computing, pp. 74-86, 2018. +Canonne, C. L., Kamath, G., and Steinke, T. The discrete gaussian for differential privacy. In NeurIPS, 2020. +Chen, X., Chen, T., Sun, H., Wu, Z. S., and Hong, M. Distributed training with heterogeneous data: Bridging median-and mean-based algorithms. arXiv preprint arXiv:1906.01736, 2019. +Damian, A., Ma, T., and Lee, J. Label noise sgd provably prefers flat global minimizers. arXiv preprint arXiv:2106.06530, 2021. +Devroye, L. and Wagner, T. Distribution-free inequalities for the deleted and holdout error estimates. IEEE Transactions on Information Theory, 25(2):202-207, 1979. +Elisseeff, A., Evgeniou, T., Pontil, M., and Kaelbing, L. P. Stability of randomized learning algorithms. Journal of Machine Learning Research, 6(1), 2005. +Farghly, T. and Rebeschini, P. Time-independent generalization bounds for SGLD in non-convex settings. In Beygelzimer, A., Dauphin, Y., Liang, P., and Vaughan, J. W. (eds.), Advances in Neural Information Processing Systems, 2021. URL https://openreview.net/forum?id=tNT4APQ0Wgj. +Feldman, V. and Vondrak, J. Generalization bounds for uniformly stable algorithms. In Proceedings of the 32nd International Conference on Neural Information Processing Systems, pp. 9770-9780, 2018. +Feldman, V. and Vondrak, J. High probability generalization bounds for uniformly stable algorithms with nearly optimal rate. In Conference on Learning Theory, pp. 1270-1279. PMLR, 2019. +Grunwald, P., Steinke, T., and Zakynthinou, L. Pac-bayes, mac-bayes and conditional mutual information: Fast rate bounds that handle general vc classes. arXiv preprint arXiv:2106.09683, 2021. +Haghifam, M., Negrea, J., Khisti, A., Roy, D. M., and Dziuugaite, G. K. Sharpened generalization bounds based on conditional mutual information and an application to noisy, iterative algorithms. Advances in Neural Information Processing Systems, 2020. +Hardt, M., Recht, B., and Singer, Y. Train faster, generalize better: Stability of stochastic gradient descent. In International Conference on Machine Learning, pp. 1225-1234, 2016. + +Hellström, F. and Durisi, G. Generalization bounds via information density and conditional information density. IEEE Journal on Selected Areas in Information Theory, 1 (3):824-839, 2020. +Hellström, F. and Durisi, G. Fast-rate loss bounds via conditional information measures with applications to neural networks. In 2021 IEEE International Symposium on Information Theory (ISIT), pp. 952-957. IEEE, 2021. +Jiang, P. and Agrawal, G. A linear speedup analysis of distributed deep learning with sparse and quantized communication. In Bengio, S., Wallach, H., Larochelle, H., Grauman, K., Cesa-Bianchi, N., and Garnett, R. (eds.), Advances in Neural Information Processing Systems 31, pp. 2525-2536. Curran Associates, Inc., 2018. +Jin, C., Ge, R., Netrapalli, P., Kakade, S. M., and Jordan, M. I. How to escape saddle points efficiently. In International Conference on Machine Learning, pp. 1724-1732, 2017. +Jin, C., Netrapalli, P., Ge, R., Kakade, S. M., and Jordan, M. I. On nonconvex optimization for machine learning: Gradients, stochasticity, and saddle points. arXiv preprint arXiv:1902.04811, 2019. +Jin, R., Huang, Y., He, X., Wu, T., and Dai, H. Stochastic-sign sgd for federated learning with theoretical guarantees. arXiv preprint arXiv:2002.10940, 2020. +Kairouz, P., Ribero, M., Rush, K., and Thakurta, A. Dimension independence in unconstrained private erm via adaptive preconditioning. arXiv preprint arXiv:2008.06570, 2020. +Krizhevsky, A. Learning Multiple Layers of Features from Tiny Images. Technical Report Vol. 1. No. 4., University of Toronto, 2009. +LeCun, Y., Bottou, L., Bengio, Y., and Haffner, P. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278-2324, 1998. +Lei, Y. and Ying, Y. Fine-grained analysis of stability and generalization for stochastic gradient descent. In International Conference on Machine Learning, 2020. +Li, B., Chen, C., Liu, H., and Carin, L. On connecting stochastic gradient mcmc and differential privacy. In The 22nd International Conference on Artificial Intelligence and Statistics, pp. 557-566. PMLR, 2019. +Li, J., Luo, X., and Qiao, M. On generalization error bounds of noisy gradient methods for non-convex learning. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id=SkxxxtgHKPS. + +Mou, W., Wang, L., Zhai, X., and Zheng, K. Generalization bounds of sgld for non-convex learning: Two theoretical viewpoints. In Conference on Learning Theory, pp. 605–638. PMLR, 2018. +Negrea, J., Haghifam, M., Dziugaite, G. K., Khisti, A., and Roy, D. M. Information-theoretic generalization bounds for sgld via data-dependent estimates. In Advances in Neural Information Processing Systems, 2019. +Neu, G., Dziugaite, G. K., Haghifam, M., and Roy, D. M. Information-theoretic generalization bounds for stochastic gradient descent. In $COLT$ , 2021. +Pensia, A., Jog, V., and Loh, P.-L. Generalization error bounds for noisy, iterative algorithms. In 2018 IEEE International Symposium on Information Theory (ISIT), pp. 546-550. IEEE, 2018. +Pollard, D. A user's guide to measure theoretic probability. Number 8. Cambridge University Press, 2002. +Raginsky, M., Rakhlin, A., and Telgarsky, M. Non-convex learning via stochastic gradient Langevin dynamics: a nonasymptotic analysis. In Conference on Learning Theory, pp. 1674–1703. PMLR, 2017. +Rodriguez-Galvez, B., Bassi, G., Thobaben, R., and Skoglund, M. On random subset generalization error bounds and the stochastic gradient Langevin dynamics algorithm. In 2020 IEEE Information Theory Workshop (ITW), pp. 1-5. IEEE, 2021. +Rogers, W. H. and Wagner, T. J. A finite sample distribution-free performance bound for local discrimination rules. The Annals of Statistics, pp. 506-514, 1978. +Russo, D. and Zou, J. Controlling bias in adaptive data analysis using information theory. In Artificial Intelligence and Statistics, pp. 1232-1240. PMLR, 2016. +Sason, I. and Verdu, S. $f$ -divergence inequalities. IEEE Transactions on Information Theory, 62, 2016. +Shalev-Shwartz, S., Shamir, O., Srebro, N., and Sridharan, K. Stochastic convex optimization. In $COLT$ , 2009. +Shamir, O. and Zhang, T. Stochastic gradient descent for non-smooth optimization: Convergence results and optimal averaging schemes. In International conference on machine learning, pp. 71-79. PMLR, 2013. +Steinke, T. and Zakynthinou, L. Reasoning about generalization via conditional mutual information. In Conference on Learning Theory, pp. 3437-3452. PMLR, 2020. +Tsybakov, A. B. Introduction to nonparametric estimation. Springer Science & Business Media, 2008. + +Wainwright, M. J. and Jordan, M. I. Graphical models, exponential families, and variational inference. Now Publishers Inc, 2008. +Wang, B., Zhang, H., Zhang, J., Meng, Q., Chen, W., and Liu, T.-Y. Optimizing information-theoretical generalization bound via anisotropic noise of SGLD. In Beygelzimer, A., Dauphin, Y., Liang, P., and Vaughan, J. W. (eds.), Advances in Neural Information Processing Systems, 2021a. URL https://openreview.net/forum?id=1N2Uqm-ScC. +Wang, D. and Xu, J. Differentially private empirical risk minimization with smooth non-convex loss functions: A non-stationary view. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pp. 1182-1189, 2019. +Wang, H., Huang, Y., Gao, R., and Calmon, F. Analyzing the generalization capability of sgld using properties of gaussian channels. Advances in Neural Information Processing Systems, 34, 2021b. +Wang, Y.-X., Fienberg, S., and Smola, A. Privacy for free: Posterior sampling and stochastic gradient monte carlo. In International Conference on Machine Learning, pp. 2493-2502. PMLR, 2015. +Welling, M. and Teh, Y. W. Bayesian learning via stochastic gradient Langevin dynamics. In International Conference on Machine Learning, ICML '11, pp. 681-688, 2011. +Xiao, H., Rasul, K., and Vollgraf, R. Fashion-mnist: a novel image dataset for benchmarking machine learning algorithms, 2017. +Xu, A. and Raginsky, M. Information-theoretic analysis of generalization capability of learning algorithms. Advances in Neural Information Processing Systems, 2017: 2525-2534, 2017. +Yang, G., Zhang, T., Kirichenko, P., Bai, J., Wilson, A. G., and De Sa, C. Swalp: Stochastic weight averaging in low-precision training. 36th International Conference on Machine Learning (ICML), 2019. +Zhang, C., Bengio, S., Hardt, M., Recht, B., and Vinyals, O. Understanding deep learning requires rethinking generalization. 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=Sy8gdB9xx. +Zhang, H., Mironov, I., and Hejazinia, M. Wide network learning with differential privacy. arXiv preprint arXiv:2103.01294, 2021. + +Zhou, R., Tian, C., and Liu, T. Individually conditional individual mutual information bound on generalization error. In 2021 IEEE International Symposium on Information Theory (ISIT), pp. 670-675. IEEE, 2021. +Zhou, Y., Wu, S., and Banerjee, A. Bypassing the ambient dimension: Private sgd with gradient subspace identification. In International Conference on Learning Representations, 2020. + +# A. Related Work + +Uniform stability. Uniform stability is a classical approach for bounding generalization error (Bousquet & Elisseeff, 2002; Hardt et al., 2016; Bousquet et al., 2020; Shalev-Shwartz et al., 2009; Feldman & Vondrak, 2018; 2019), pioneered by Rogers & Wagner (1978); Devroye & Wagner (1979). Recently, uniform stability has been used in analyzing the stability of stochastic gradient descent (SGD) (Hardt et al., 2016). Mou et al. (2018) prove the uniform stability of SGLD (Welling & Teh, 2011; Raginsky et al., 2017) by showing that uniform stability can be bounded by the squared Hellinger distance, and further they establish discretized Fokker-Planck equations for analyzing the squared Hellinger distance. Then they provide uniform stability based generalization bounds for SGLD as $\frac{L}{n}\sqrt{\sum_{t}\eta_{t}^{2}/\sigma_{t}^{2}}$ which depends on $L$ , the global Lipschitz constant for gradients, and the step size $\eta_t \leq \frac{\sigma_t \ln 2}{L}$ (Mou et al., 2018; Li et al., 2020). Recently, Li et al. (2020) followed up on Mou et al. (2018) and derived a data-dependent bound based on Bayes-stability, and got a bound of the form $\frac{c}{n}\sqrt{\sum_{t}\eta_{t}^{2}\mathbf{g}_{e}(t)/\sigma_{t}^{2}}$ , where $\mathbf{g}_e(t)$ is the expected gradient norm square at step $t$ . Their bound improves the Lipschitz constant $L$ to the expected gradient norm square. Recently, Farghly & Rebeschini (2021) provided a time-independent bound for SGLD of the form $O(1/n + \eta^{1/2}d^{1/2})$ which requires the step size scales as $O(1/(n^2d))$ to obtain an $O(1/n)$ bound. Bassily et al. (2019) analyze the uniform stability of differentially private SGD (DP-SGD) for convex optimization by showing the gradient update is a non-expansive operation, which is the key fact in proving the stability of SGD (Hardt et al., 2016). The approach in Hardt et al. (2016) can extend to non-convex setting as well, however it requires fast decaying in step size as $\eta_t = O(1/t)$ . Bassily et al. (2020) provide stability analysis of SGD for convex and non-smooth functions. + +Information-theoretic bounds. Besides the works mentioned above, other theories of deriving generalization bounds for noisy iterative algorithms have been proposed via information-theoretic approaches (Russo & Zou, 2016; Xu & Raginsky, 2017). Such results show that the generalization error of any learning algorithm can be bounded as $O(\sqrt{I(S;W)/n})$ , where $I(S;W)$ is the mutual information between the algorithm input $S$ and the algorithm output $W$ . Recent work following this approach focuses on bounding the mutual information for a broad class of iterative algorithms, including SGLD to obtain a $O(\sqrt{\log T/n})$ generalization bound by choosing $\eta_t = O(1/t)$ , where $T$ is the total number of iterations (Pensa et al., 2018; Bu et al., 2019). Subsequent improvements to this technique were made by Negrea et al. (2019); Haghifam et al. (2020); Rodríguez-Gálvez et al. (2021) to prove data-dependent generalization bounds that do not depend on the Lipschitz constant of the loss function and obtain $\sqrt{\sum_{t} \eta_t / n}$ bounds. Especially, Haghifam et al. (2020); Zhou et al. (2021) introduce generalization bounds based on conditional mutual information inspired by Steinke & Zakynthinou (2020), leading to tighter bounds than those based on mutual information, which was extended by Rodríguez-Gálvez et al. (2021) from full-batch gradient to stochastic setting. Recently, Wang et al. (2021b) provided a bound for SGLD of the from $O\left(\frac{b}{n}\sum_{j=1}^{m}\sqrt{\sum_{t\in\mathcal{T}_j}\eta_t^2Var(\mathbf{g}_j(t))/\sigma_t^2}\right)$ , where $b$ is the mini-batch size, $m$ is the number of mini-batches, $\mathcal{T}_j$ contains the indices of iterations for mini-batch $S_j$ and $Var(\mathbf{g}_j(t))$ is the variance of mini-batch gradient on $S_j$ evaluated on the training set. However, Wang et al. (2021b) requires splitting training samples into disjoint $m$ mini-batches before training and obtained a bound depending on the sum of gradient variance. Their bound also scales inversely to the batch size since the number of mini-batches $m$ and gradient variance increase as the batch size decreases. Neu et al. (2021) extend this information-theoretic approach to derive generalization bound for vanilla SGD. Hellström & Durisi (2021) provide a fast-rate bound for bounded loss functions based via Conditional Information Measures (Grünwald et al., 2021; Hellström & Durisi, 2020), which also provides a unified view of some of the above results. + +Noisy iterative algorithms. Introducing additional noise in the stochastic gradient has been popular in training deep nets. Noisy iterative methods have proven to be useful for machine learning applications, especially for deep neural networks in terms of escaping from saddle points (Jin et al., 2017; 2019), preserving privacy (Bassily et al., 2020; Wang & Xu, 2019), boosting generalization and stability (Mou et al., 2018; Li et al., 2020). SGLD (Welling & Teh, 2011) has been one of the most popular noisy iterative algorithms for non-convex learning problems, where an isotropic Gaussian noise is added to the stochastic gradient. There has been some work (Wang et al., 2015; Li et al., 2019) connecting SGLD with differentially private SGD algorithm (DP-SGD) (Bassily et al., 2020; Wang & Xu, 2019) which usually adds noise with constant variance to the stochastic gradient. Uniform stability has also been popular in the differential privacy literature for analyzing the generalization error bound of DP-SGD algorithms. Recently, noise has been proven to be useful in Sign-SGD (Bernstein et al., 2018a;b; Chen et al., 2019) which has gained popularity as it reduces communication cost in distributed learning. Existing versions of noisy sign-SGD first adds symmetric noise to the stochastic gradient, then take the sign of the noisy stochastic gradient to update the parameters (Chen et al., 2019; Jin et al., 2020). Bernstein et al. (2018b); Chen et al. (2019); Jin et al. (2020) have shown that when noise is unimodal and symmetric, sign-SGD can guarantee convergence to stationary point. Recently, Wang et al. (2021a) study the anisotropic noise for SGLD, where they optimize the information-theoretical generalization bound by manipulating the noise structure in SGLD. They prove that with constraint to guarantee low + +empirical risk, the optimal noise covariance is the square root of the expected gradient covariance. In recent work, Lei & Ying (2020) considered "on average stability" based generalization bounds, which is related to our work. Their bound has a dependence either on $L$ or on some form of convexity. + +# B. Analysis and Proofs for Expected Stability (Section 2) + +Proposition 1. Let $S_{n} \sim D^{n}$ and let $S_{n}^{\prime}$ be a dataset obtained by replacing $z_{n} \in S_{n}$ with $z_{n}^{\prime} \sim D$ . Let $A(S_{n}), A(S_{n}^{\prime})$ respectively denote the distributions over the hypothesis space $\mathcal{W}$ obtained by running randomized algorithm $A$ on $S_{n}, S_{n}^{\prime}$ . Assume that for all $S_{n} \in \mathcal{Z}^{n}, z \in \mathcal{Z}, \mathbb{E}_{W \sim A(S_{n})}[\ell^{2}(W,z)] \leq c_{0}^{2}/4$ for some constant $c_{0} > 0$ . With $H(\cdot, \cdot)$ denoting the Hellinger divergence, we have + +$$ +\begin{array}{l} \left| \mathbb {E} _ {S _ {n} \sim D ^ {n}} \left[ L _ {D} \left(A \left(S _ {n}\right)\right) - L _ {S} \left(A \left(S _ {n}\right)\right) \right] \right| \tag {1} \\ \leq c _ {0} \mathbb {E} _ {S _ {n} \sim D ^ {n}} \mathbb {E} _ {z _ {n} ^ {\prime} \sim D} \sqrt {2 H ^ {2} \left(A (S _ {n}) , A \left(S _ {n} ^ {\prime}\right)\right)}. \\ \end{array} +$$ + +Proof. Let $S_{n} = (z_{1},\ldots ,z_{n})$ and $\tilde{S}_n^{\prime} = (z_1^{\prime},\dots,z_n^{\prime})$ two independent random samples and let $S_{n}^{(i)} = (z_{1},\ldots ,z_{i - 1},z_{i}^{\prime},z_{i + 1},\ldots ,z_{n})$ be the sample that is identical to $S$ except in the $i$ -th example where we replace $z_{i}$ with $z_{i}^{\prime}$ . Note that $S^{(n)} = S_n^\prime$ where $S_{n}^{\prime}$ is the dataset obtained by replacing $z_{n}\in S_{n}$ with $z_{n}^{\prime}$ as in the Proposition statement. Now, by definition we have + +$$ +\begin{array}{l} \left. \left| \mathbb {E} _ {S _ {n} \sim D ^ {n}} \left[ L _ {D} \left(A \left(S _ {n}\right)\right) - L _ {S} \left(A \left(S _ {n}\right)\right) \right] \right| \right. \\ = \left| \mathbb {E} _ {S _ {n} \sim D ^ {n}} \left[ L _ {S} \left(A \left(S _ {n}\right)\right) - L _ {D} \left(A \left(S _ {n}\right)\right) \right] \right| \\ = \left| \mathbb {E} _ {S _ {n}} \mathbb {E} _ {\tilde {S} _ {n} ^ {\prime}} \mathbb {E} _ {A} \left[ \frac {1}{n} \sum_ {i = 1} ^ {n} \left(\ell \left(A \left(S _ {n} ^ {(i)}\right), z _ {i} ^ {\prime}\right) - \ell \left(A \left(S _ {n}\right), z _ {i} ^ {\prime}\right)\right) \right] \right| \\ = \left| \mathbb {E} _ {S _ {n}} \mathbb {E} _ {\tilde {S} _ {n} ^ {\prime}} \frac {1}{n} \sum_ {i = 1} ^ {n} \mathbb {E} _ {A} \left[ \ell \left(A \left(S _ {n} ^ {(i)}\right), z _ {i} ^ {\prime}\right) - \ell \left(A \left(S _ {n}\right), z _ {i} ^ {\prime}\right) \right] \right| \\ \stackrel {(a)} {=} \left| \mathbb {E} _ {S _ {n}} \mathbb {E} _ {\tilde {S} _ {n} ^ {\prime}} \frac {1}{n} \sum_ {i = 1} ^ {n} \left(\int_ {\mathbb {R} ^ {d}} \ell (\mathbf {w}; z _ {i} ^ {\prime}) p ^ {(i)} (\mathbf {w}) d \mathbf {w} - \int_ {\mathbb {R} ^ {d}} \ell (\mathbf {w}; z _ {i} ^ {\prime}) p (\mathbf {w}) d \mathbf {w}\right) \right| \\ = \left| \mathbb {E} _ {S _ {n}} \mathbb {E} _ {\tilde {S} _ {n} ^ {\prime}} \frac {1}{n} \sum_ {i = 1} ^ {n} \int_ {\mathbb {R} ^ {d}} \ell (\mathbf {w}; z _ {i} ^ {\prime}) \left(p ^ {(i)} (\mathbf {w}) - p (\mathbf {w})\right) d \mathbf {w} \right| \\ = \left| \mathbb {E} _ {S _ {n}} \mathbb {E} _ {\tilde {S} _ {n} ^ {\prime}} \frac {1}{n} \sum_ {i = 1} ^ {n} \int_ {\mathbb {R} ^ {d}} \ell (\mathbf {w}; z _ {i} ^ {\prime}) \left(\sqrt {p ^ {(i)} (\mathbf {w})} + \sqrt {p (\mathbf {w})}\right) \left(\sqrt {p ^ {(i)} (\mathbf {w})} - \sqrt {p (\mathbf {w})}\right) d \mathbf {w} \right| \\ \stackrel {(b)} {\leq} \left| \mathbb {E} _ {S _ {n}} \mathbb {E} _ {\tilde {S} _ {n} ^ {\prime}} \frac {1}{n} \sum_ {i = 1} ^ {n} \left\{\left(\int_ {\mathbb {R} ^ {d}} \ell^ {2} (\mathbf {w}; z _ {i} ^ {\prime}) \left(\sqrt {p ^ {(i)} (\mathbf {w})} + \sqrt {p (\mathbf {w})}\right) ^ {2} d \mathbf {w}\right) ^ {\frac {1}{2}} \left(\int_ {\mathbb {R} ^ {d}} \left(\sqrt {p ^ {(i)} (\mathbf {w})} - \sqrt {p (\mathbf {w})}\right) ^ {2} d \mathbf {w}\right) ^ {\frac {1}{2}} \right\} \right| \\ \end{array} +$$ + +where in (a) $p^{(i)}(\mathbf{w}), p(\mathbf{w})$ are respectively the distributions obtained by $A(S_n^{(i)})$ , $A(S_n)$ , and (b) follows by Cauchy-Schwartz inequality. Focusing on the first integral, we have: + +$$ +\begin{array}{l} \left(\int_ {\mathbb {R} ^ {d}} \ell^ {2} (\mathbf {w}; z _ {i} ^ {\prime}) \left(\sqrt {p ^ {(i)} (\mathbf {w})} + \sqrt {p (\mathbf {w})}\right) ^ {2} d \mathbf {w}\right) ^ {1 / 2} \leq \left(2 \int_ {\mathbb {R} ^ {d}} \ell^ {2} (\mathbf {w}; z _ {i} ^ {\prime}) p ^ {(i)} (\mathbf {w}) d \mathbf {w} + 2 \int_ {\mathbb {R} ^ {d}} \ell^ {2} (\mathbf {w}; z _ {i} ^ {\prime}) p (\mathbf {w}) d \mathbf {w}\right) ^ {1 / 2} \\ \leq \left(c _ {0} ^ {2} / 2 + c _ {0} ^ {2} / 2\right) ^ {1 / 2} = c _ {0}. \\ \end{array} +$$ + +Hence, by definition of the Hellinger divergence, we have + +$$ +\begin{array}{l} \mathbb {E} _ {S _ {n} \sim D ^ {n}} [ L _ {D} (A (S _ {n})) - L _ {S} (A (S _ {n})) ] \leq \mathbb {E} _ {S _ {n}} \mathbb {E} _ {\tilde {S} _ {n}} \frac {1}{n} \sum_ {i = 1} ^ {n} c _ {0} \sqrt {2 H ^ {2} \left(A (S _ {n}) , A (S _ {n} ^ {(i)})\right)} \\ \stackrel {(a)} {=} \mathbb {E} _ {S _ {n}} \mathbb {E} _ {\tilde {S} _ {n} ^ {\prime}} \frac {1}{n} \sum_ {i = 1} ^ {n} c _ {0} \sqrt {2 H ^ {2} (A (S _ {n}) , A (S _ {n} ^ {\prime}))} \\ = c _ {0} \mathbb {E} _ {S _ {n} \sim D ^ {n}} \mathbb {E} _ {z _ {n} ^ {\prime} \sim D} \sqrt {2 H ^ {2} \big (A (S _ {n}) , A (S _ {n} ^ {\prime}) \big)} , \\ \end{array} +$$ + +where (a) follows since the samples are drawn i.i.d. and the randomized algorithm $A(\cdot)$ is permutation invariant. That completes the proof. + +Proposition 2. For any distributions $P$ and $P'$ , $2H^2(P, P') \leq \min \{KL(P, P'), \sqrt{\frac{1}{2}KL(P, P')} \}$ . + +Proof. For the first part, note that: + +$$ +\begin{array}{l} K L (P, P ^ {\prime}) = \int \left(\log \frac {p (\mathbf {w})}{p ^ {\prime} (\mathbf {w})}\right) p (\mathbf {w}) d \mathbf {w} \\ = 2 \int \left(- \log \sqrt {\frac {p ^ {\prime} (\mathbf {w})}{p (\mathbf {w})}}\right) p (\mathbf {w}) d \mathbf {w} \\ \stackrel {(a)} {\geq} 2 \int \left(1 - \sqrt {\frac {p ^ {\prime} (\mathbf {w})}{p (\mathbf {w})}}\right) p (\mathbf {w}) d \mathbf {w} \\ = 2 \int \left(p (\mathbf {w}) - \sqrt {p (\mathbf {w}) p ^ {\prime} (\mathbf {w}))}\right) d \mathbf {w} \\ = \int \left(p (\mathbf {w}) + p ^ {\prime} (\mathbf {w}) - 2 \sqrt {p (\mathbf {w}) p ^ {\prime} (\mathbf {w})}\right) d \mathbf {w} \\ = \int \left(\sqrt {p (\mathbf {w})} - \sqrt {p ^ {\prime} (\mathbf {w})}\right) ^ {2} d \mathbf {w} \\ = 2 H ^ {2} (P, P ^ {\prime}), \\ \end{array} +$$ + +where (a) follows since for $z > -1$ , $\log(1 + z) \leq z$ , using $x = 1 + z$ and changing signs gives $-\log x \geq 1 - x$ . + +For the second part, note that: + +$$ +\begin{array}{l} 2 H ^ {2} (P, P ^ {\prime}) = \int_ {\mathbf {w}} (\sqrt {p (\mathbf {w})} - \sqrt {p ^ {\prime} (\mathbf {w})}) ^ {2} d \mathbf {w} \\ = \int_ {\mathbf {w}} | \sqrt {p (\mathbf {w})} - \sqrt {p ^ {\prime} (\mathbf {w})} | \times | \sqrt {p (\mathbf {w})} - \sqrt {p ^ {\prime} (\mathbf {w})} | d \mathbf {w} \\ \leq \int_ {\mathbf {w}} | \sqrt {p (\mathbf {w})} - \sqrt {p ^ {\prime} (\mathbf {w})} | \times | \sqrt {p (\mathbf {w})} + \sqrt {p ^ {\prime} (\mathbf {w})} | d \mathbf {w} \\ = \int_ {\mathbf {w}} | p (\mathbf {w}) - p ^ {\prime} (\mathbf {w}) | d \mathbf {w} \\ = T V (P, P ^ {\prime}), \\ \end{array} +$$ + +where $TV(P, P')$ denotes the total variation distance (Pollard, 2002). Further, from Pinsker's inequality (Tsybakov, 2008), we have + +$$ +T V (P, P ^ {\prime}) \leq \sqrt {\frac {1}{2} K L (P , P ^ {\prime})}. +$$ + +Combining the two results completes the proof. + +![](images/73fe56cf25e7f0ad1a90e5fcbc45c9c54b44ce87230f6ef830c49a8e543e7012.jpg) + +# B.1. Proofs for Section 2.2 + +Our first result establishes a bound on the KL-divergence between two component mixture models in terms of the mixing weight of the unique components. Similar results have appeared in (Li et al., 2020; Bun et al., 2018) in related contexts. Our proof is different, simple, and self-contained. + +Lemma 4. Let $Q, Q', R$ be any three distributions such that $Q, Q'$ are both absolutely continuous w.r.t. $R$ . Then, for any $s \in (0,1)$ + +$$ +K L \left(s Q + (1 - s) R \| s Q ^ {\prime} + (1 - s) R\right) \leq \frac {s ^ {2}}{1 - s} \int_ {\mathbf {w}} \frac {\left(Q (\mathbf {w}) - Q ^ {\prime} (\mathbf {w})\right) ^ {2}}{R (\mathbf {w})} d \mathbf {w}. \tag {10} +$$ + +Proof. Let $U = sQ' + (1 - s)R$ . Then, with $F(x) = Q(x) - Q'(x)$ , we have + +$$ +\begin{array}{l} K L (s Q + (1 - s) R \| s Q ^ {\prime} + (1 - s) R) = K L (U + s (Q - Q ^ {\prime}) \| U) \\ = \int (U (x) + s F (x)) \log \left(\frac {U (x) + s F (x)}{U (x)}\right) d x \\ = \int (U (x) + s F (x)) \log \left(1 + \frac {s F (x)}{U (x)}\right) d x \\ = \int s F (x) + \frac {s ^ {2} F ^ {2} (x)}{2 U (x)} - \frac {s ^ {3} F ^ {3} (x)}{6 U ^ {2} (x)} + \frac {s ^ {4} F ^ {4} (x)}{1 2 U ^ {3} (x)} - \dots d x \\ = s ^ {2} \int {\frac {F ^ {2} (x)}{U (x)}} \left(\frac {1}{2} - \frac {s F (x)}{6 U (x)} + \frac {s ^ {2} F ^ {2} (x)}{1 2 U ^ {2} (x)} - \dots\right) d x, \\ \end{array} +$$ + +where the first term vanishes since $\int F(x)dx = \int (Q(x) - Q'(x))dx = 0$ . This is the reason the dependency is on $s^2$ , not $s$ . With $W(x) = sF(x) / U(x)$ , noting that $W(x) > -1$ , and + +$$ +\left(\frac {1}{2} - \frac {W (x)}{6} + \frac {W ^ {2} (x)}{1 2} - \dots\right) = \frac {(1 + W (x)) \log (1 + W (x)) - W (x)}{W ^ {2} (x)} \leq 1, \tag {11} +$$ + +we have + +$$ +\begin{array}{l} K L (s P + (1 - s) R \| s Q + (1 - s) R) = s ^ {2} \int \frac {F ^ {2} (x)}{U (x)} \left(\frac {(1 + W (x)) \log (1 + W (x)) - W (x)}{W ^ {2} (x)}\right) d x \\ \leq s ^ {2} \int \frac {F ^ {2} (x)}{U (x)} d x \\ \leq \frac {s ^ {2}}{(1 - s)} \int \frac {(Q (x) - Q ^ {\prime} (x)) ^ {2}}{R (x)} d x. \\ \end{array} +$$ + +That completes the proof. + +Proposition 3. Consider the mixture models $Q_{t|} = \frac{1}{|G_1|}\sum_{B_t\in G_1}P_{B_t,\pmb{\xi}_t}, Q_{t|}' = \frac{1}{|G_1|}\sum_{B_t\in G_1}P_{B_t,\pmb{\xi}_t}', R_t = \frac{1}{|G_0|}\sum_{A_t\in G_0}P_{A_t,\pmb{\xi}_t}$ . Then, with $s = \frac{|G_1|}{|G|} = \frac{\binom{n-1}{b-1}}{\binom{n}{b}} = \frac{b}{n}$ , we have + +$$ +P _ {t |} = s Q _ {t |} + (1 - s) R _ {t |}, \qquad a n d \qquad P _ {t |} ^ {\prime} = s Q _ {t |} ^ {\prime} + (1 - s) R _ {t |}. +$$ + +Proof. The proof follows the argument in the proof of Lemma 21 in (Li et al., 2020). + +Lemma 5. Consider a general noisy stochastic iterative algorithm with updates of the form (2) with mini-batch size $B_{t} = b$ . Then, conditioned on any trajectory $\mathbf{w}_{0:t-1}$ , we have + +$$ +K L \left(P _ {t} | | P _ {t}\right) \leq \frac {b ^ {2}}{n ^ {2}} \frac {n}{n - b} \mathbb {E} _ {B _ {t} \in G _ {1}} \mathbb {E} _ {A _ {t} \in G _ {0}} \left[ \int_ {\boldsymbol {\xi} _ {t}} \frac {\left(d P _ {B _ {t} , \boldsymbol {\xi} _ {t}} - d P _ {B _ {t} , \boldsymbol {\xi} _ {t}} ^ {\prime}\right) ^ {2}}{d P _ {A _ {t} , \boldsymbol {\xi} _ {t}}} d \boldsymbol {\xi} _ {t} \right]. \tag {12} +$$ + +Proof. By definition, Proposition 3, and Lemma 4 with $s = b / n$ , we have + +$$ +\begin{array}{l} K L \left(P _ {t |} \| P _ {t |} ^ {\prime}\right) \stackrel {(a)} {\leq} \left(\frac {b}{n}\right) ^ {2} \left(\frac {n}{n - b}\right) \int_ {\mathbf {w}} \frac {(Q - Q ^ {\prime}) ^ {2}}{R} d \mathbf {w} \\ = \frac {b ^ {2}}{n ^ {2}} \left(1 + \frac {b}{n - b}\right) \int_ {\mathbf {w}} \frac {\left(\frac {1}{| G _ {1} |} \left[ \sum_ {B \in G _ {1}} d P _ {B , \boldsymbol {\xi}} (\mathbf {w}) - \sum_ {B \in G _ {1}} P _ {B , \boldsymbol {\xi}} ^ {\prime} (\mathbf {w}) \right]\right) ^ {2}}{\frac {1}{| G _ {0} |} \sum_ {A \in G _ {0}} d P _ {A , \boldsymbol {\xi}} (\mathbf {w})} d \mathbf {w} \\ \stackrel {(b)} {\leq} \frac {b ^ {2}}{n ^ {2}} \left(1 + \frac {b}{n - b}\right) \int_ {\mathbf {w}} \frac {1}{| G _ {1} |} \sum_ {B \in G _ {1}} \frac {\left(d P _ {B , \boldsymbol {\xi}} (\mathbf {w}) - P _ {B , \boldsymbol {\xi}} ^ {\prime} (\mathbf {w})\right) ^ {2}}{\frac {1}{| G _ {0} |} \sum_ {A \in G _ {0}} d P _ {A , \boldsymbol {\xi}} (\mathbf {w})} d \mathbf {w} \\ \stackrel {(c)} {\leq} \frac {b ^ {2}}{n ^ {2}} \left(1 + \frac {b}{n - b}\right) \int_ {\mathbf {w}} \frac {1}{| G _ {1} |} \sum_ {B \in G _ {1}} \left\{\left(d P _ {B, \boldsymbol {\xi}} (\mathbf {w}) - P _ {B, \boldsymbol {\xi}} ^ {\prime} (\mathbf {w})\right) ^ {2} \frac {1}{| G _ {0} |} \sum_ {A \in G _ {0}} \frac {1}{d P _ {A , \boldsymbol {\xi}} (\mathbf {w})} \right\} d \mathbf {w} \\ = \frac {b ^ {2}}{n ^ {2}} \left(1 + \frac {b}{n - b}\right) \frac {1}{| G _ {1} | | G _ {0} |} \sum_ {B \in G _ {1}} \sum_ {A \in G _ {0}} \int_ {\mathbf {w}} \frac {\left(d P _ {B , \boldsymbol {\xi}} (\mathbf {w}) - P _ {B , \boldsymbol {\xi}} ^ {\prime} (\mathbf {w})\right) ^ {2}}{d P _ {A , \boldsymbol {\xi}} (\mathbf {w})} d \mathbf {w}, \\ \end{array} +$$ + +where (a) is from Lemma 4, (b)(c) is from Jensen's inequality since function $f(x) = x^{2}$ is convex and $f(x) = \frac{1}{x}$ is convex on $(0,\infty)$ . That completes the proof. + +Now we have all the pieces to prove the following result: + +Lemma 1. In the setting of Proposition 1 consider a noisy stochastic iterative algorithms of the form (2) with mini-batch size $b \leq n / 2$ . Then, with $c_{1} = \sqrt{2} c_{0}$ (with $c_{0}$ as in Proposition 1) and $\Lambda(B_{t}, A_{t})$ as in (3), we have + +$$ +\begin{array}{l} \left. \left| \mathbb {E} _ {S _ {n}} \left[ L _ {D} \left(A \left(S _ {n}\right)\right) - L _ {S} \left(A \left(S _ {n}\right)\right) \right] \right| \right. \\ \leq c _ {1} \frac {b}{n} \mathbb {E} _ {S _ {n}} \mathbb {E} _ {z _ {n} ^ {\prime}} \sqrt {\sum_ {t = 1} ^ {T} \mathbb {E} _ {W _ {0 : (t - 1)}} \mathbb {E} _ {B _ {t} \in G _ {1}} \mathbb {E} _ {A _ {t} \in G _ {0}} \left[ \Lambda \left(B _ {t} , A _ {t}\right) \right]}. \tag {4} \\ \end{array} +$$ + +Proof. Based on Propositions 1 and 2, we have + +$$ +\mathbb {E} _ {S \sim D ^ {n}} [ L _ {D} (A (S)) - L _ {S} (A (S)) ] \leq \sqrt {K L (P _ {T} \| P _ {T} ^ {\prime})} \leq \sqrt {\sum_ {t = 1} ^ {T} \mathbb {E} _ {P _ {0 : (t - 1)}} \left[ K L (P _ {t |} \| P _ {t |} ^ {\prime}) \right]} +$$ + +Applying Lemma 5 to bound $KL\left(P_{t|}\| P_{t|}^{\prime}\right)$ and noting that $b / (n - b)\leq 1$ for $b\leq n / 2$ completes the proof. + +# B.2. High Probability Generalization Bounds + +Let $S \sim D^n$ with $S = (Z_1, \ldots, Z_n)$ corresponding to the training data. Consider the random variable $Y(S)$ , the Scaled (by $n$ ) Generalization Error (SGE), defined as + +$$ +Y (S) \triangleq \sum_ {i = 1} ^ {n} \mathbb {E} _ {A} \left[ \mathbb {E} _ {Z \sim D} [ \ell (A (S), Z) ] - \ell (A (S), Z _ {i}) \right] = n \left(L _ {D} (A (S)) - L _ {S} (A (S))\right). \tag {13} +$$ + +Theorem 1 establishes a bound on $|\frac{1}{n}\mathbb{E}_S[Y(S)]|$ . We now focus on establishing a high probability bound on $\frac{1}{n} (Y(S) - \mathbb{E}_S[Y(S)])$ . Let $S^{\prime} = (Z_1^{\prime},\dots,Z_n^{\prime})$ be such that $Z_{i}^{\prime}$ is an independent copy of $Z_{i}$ . Further, let $S_i^\prime = (Z_1,\ldots ,Z_{i - 1},Z_i',Z_{i + 1},\ldots ,Z_n)$ . Then, the change in SGE + +$$ +Y (S) - Y \left(S _ {i} ^ {\prime}\right) = n \left[ \left(L _ {D} (A (S)) - L _ {D} \left(A \left(S _ {i} ^ {\prime}\right)\right)\right) - \left(L _ {S} (A (S)) - L _ {S _ {i} ^ {\prime}} \left(A \left(S _ {i} ^ {\prime}\right)\right) \right] \right. \tag {14} +$$ + +is a symmetric random variable, and is identically distributed for $i = 1,\dots ,n$ . Our analysis is based on the following assumption: + +Assumption 3. The random variable $(Y(S) - Y(S_i'))^2$ is sub-Gaussian with $\psi_{2}$ -norm $\kappa_A^2$ , i.e., $\| (Y - Y_i')^2\|_{\psi_2} = \sup_{q\geq 1}(\mathbb{E}_{S.S'}|Y(S) - Y(S_i')|^{2q})^{1 / q} / \sqrt{q} = \kappa_A^2$ . + +Assumption 3 implies that $\| Y - Y_i'\|_{\psi_2} \leq \kappa_A$ . Note that since $Y(S) - Y(S_i')$ is identically distributed for all $i$ , $\kappa_A$ is the same for all $i$ . Further, $\kappa_A$ is a property of the algorithm $A$ , and can be viewed as a measure of stability. If $\kappa_A = O(1)$ , i.e., swapping one point effectively leads to $O\left(\frac{1}{n}\right)$ change in the generalization error, then $A$ can be considered stable; on the other hand, if $\kappa_A = O(\sqrt{n})$ , then $A$ is not stable since the effective change in generalization error $\frac{1}{n}(Y(S) - Y(S_i'))$ is $O(1/\sqrt{n})$ , the same order as typical generalization error $\frac{1}{n}Y(S)$ itself. The sharpness of the high-probability bound we present meaningfully depends on $\kappa_A$ , with smaller values implying sharper bounds. + +Theorem 5. Under Assumption 3, with probability at least $(1 - \delta)$ over the draw $S\sim D^n$ , we have + +$$ +L _ {D} (A (S)) \leq L _ {S} (A (S)) + \mathbb {E} _ {S} \left[ L _ {D} (A (S) - L _ {S} (A (S)) \right] + \max \left(\frac {1}{n}, \frac {c _ {1} \kappa_ {A}}{\sqrt {n}}\right) \log \left(\frac {1 6}{\delta}\right). \tag {15} +$$ + +If $\kappa_{A} = O(1)$ , i.e., swapping one point effectively leads to $O\left(\frac{1}{n}\right)$ change in the generalization error, then $A$ can be considered very stable; if $\kappa_{A} = O\left(\sqrt[4]{n}\right)$ , then $A$ can be considered somewhat stable; and if $\kappa_{A}^{2} = O(\sqrt{n})$ , then $A$ is not stable since the effective change in generalization error $\frac{1}{n}(Y(S) - Y(S_i'))$ is $O(1/\sqrt{n})$ , the same order as the generalization error $\frac{1}{n}Y(S)$ itself. + +Proof. Let $S = (Z_{1},\ldots ,Z_{n})$ and let $S^{\prime} = (Z_1^{\prime},\dots,Z_n^{\prime})$ be such that $Z_{i}^{\prime}$ is an independent copy of $Z_{i}$ . With $(x)_{+} = \max (x,0)$ , let + +$$ +V ^ {+} = V ^ {+} (S) = \sum_ {i = 1} ^ {n} \mathbb {E} _ {S ^ {\prime}} \left[ \left(Y - Y _ {i} ^ {\prime}\right) _ {+} ^ {2} \right], \tag {16} +$$ + +Our proof uses the following exponential version of the Efron-Stein inequality [Theorem 6.16 in (Boucheron et al., 2013)], whose proof is based on a combination of the symmetric modified log-Sobolev inequality [Theorem 6.15 in (Boucheron et al., 2013)] with the change of measure: + +Theorem 6. Let $Y = f(Z_{1},\ldots ,Z_{n})$ , where $Z_{i},i = 1,\dots,n$ are independent. Let $\theta, \lambda >0$ be such that $\theta \lambda < 1$ and $\mathbb{E}[\exp (\lambda V^{+} / \theta)] < \infty$ . Then, + +$$ +\log \mathbb {E} \left[ e ^ {\lambda (Y - \mathbb {E} Y)} \right] \leq \frac {\lambda \theta}{1 - \lambda \theta} \log \mathbb {E} \left[ e ^ {\lambda V ^ {+} / \theta} \right]. \tag {17} +$$ + +For the proof of Theorem 5, note that $V^{+}$ is sub-Gaussian with $\| V^{+}\|_{\psi_{2}}\leq n\kappa_{A}^{2}$ . Let $\mu_{+} = \mathbb{E}[V^{+}]$ and $\kappa_{+} = \| V^{+}\|_{\psi_{2}}$ . Then from Theorem 6, we have + +$$ +\psi (\lambda) \triangleq \log \mathbb {E} \left[ e ^ {\lambda (Y - \mathbb {E} Y)} \right] \leq \frac {\lambda \theta}{1 - \lambda \theta} \left[ \frac {\lambda \mu_ {+}}{\theta} + c \frac {\lambda^ {2} \kappa_ {+} ^ {2}}{\theta^ {2}} \right]. +$$ + +Then, by Markov's inequality we have + +$$ +\begin{array}{l} \log \mathbb {P} (Y - \mathbb {E} Y > t) \leq \psi (\lambda) - \lambda t \\ \leq \frac {1}{1 - \lambda \theta} \left[ \lambda^ {2} \mu_ {+} + c \lambda^ {3} \kappa_ {+} ^ {2} / \theta - (1 - \lambda \theta) \lambda t \right]. \\ \end{array} +$$ + +Choosing $\theta = 1 / (2\lambda)$ , we have + +$$ +\log \mathbb {P} (Y - \mathbb {E} Y > t) \leq 2 \lambda^ {2} \mu_ {+} + 4 c \lambda^ {4} \kappa_ {+} ^ {2} - \lambda t. +$$ + +Consider choosing $\lambda = \min \left\{1, \frac{1}{c_0 \sqrt{2\kappa_+}}\right\}$ , where $c_0 = \max(1, \sqrt[4]{c})$ . Since $\mu_+ \leq \kappa_+$ , we have + +$$ +\begin{array}{l} \log \mathbb {P} (Y - \mathbb {E} Y > t) \leq 2 - \min \left\{1, \frac {1}{c _ {0} \sqrt {2 \kappa_ {+}}} \right\} t \\ \Rightarrow \quad \mathbb {P} (Y - \mathbb {E} Y > t) \leq 8 \exp \left(- \min \left\{1, \frac {1}{c _ {0} \sqrt {2 \kappa_ {+}}} \right\} t\right). \\ \end{array} +$$ + +With $t = n\epsilon$ , and noting that $\kappa_{+} \leq n\kappa_{A}^{2}$ , with $c_{1} = c_{0}\sqrt{2}$ , we have + +$$ +\mathbb {P} \left(Y - \mathbb {E} Y > n \epsilon\right) \leq 8 \exp \left(- \min \left\{n, \frac {\sqrt {n}}{c _ {1} \kappa_ {A}} \right\} \epsilon\right). +$$ + +Now, we choose $\delta$ such that + +$$ +8 \exp \left(- \min \left\{n, \frac {\sqrt {n}}{c _ {1} \kappa_ {A}} \right\} \epsilon\right) \leq 8 \exp (- n \epsilon) + 8 \exp \left(- \frac {\sqrt {n}}{c _ {1} \kappa_ {A}} \epsilon\right) \leq \delta . +$$ + +It suffices to choose $\epsilon$ such that + +$$ +8 \exp (- n \epsilon) \leq \delta / 2 \quad \Rightarrow \quad \epsilon \geq \frac {1}{n} \log \left(\frac {1 6}{\delta}\right) +$$ + +$$ +8 \exp \left(- \frac {\sqrt {n}}{c _ {1} \kappa_ {A}} \epsilon\right) \leq \delta / 2 \quad \Rightarrow \quad \epsilon \geq \frac {c _ {1} \kappa_ {A}}{\sqrt {n}} \log \left(\frac {1 6}{\delta}\right). +$$ + +As a result, + +$$ +\mathbb {P} \left(\frac {1}{n} (Y - \mathbb {E} Y) > \max \left(\frac {1}{n}, \frac {c _ {1} \kappa_ {A}}{\sqrt {n}}\right) \log \left(\frac {1 6}{\delta}\right)\right) \leq \delta . +$$ + +That completes the proof. + +# C. Analysis and Proofs for EFLD (Section 3) + +In this section, we provide the proofs for Section 3. We first review and show details of a few examples of exponential family. + +# C.1. Examples of Exponential Family + +We show that EFLD becomes SGLD when the exponential family is Gaussian, and becomes a noisy version of sign-SGD (Bernstein et al., 2018a;b) when the exponential family is skewed over $\{-1, +1\}$ . + +Example C.1 (Gaussian). SGLD uses scaled Gaussian noise with $\psi(\pmb{\theta}) = \|\pmb{\theta}\|_2^2/2, \alpha_t = \sigma_t/\eta_t$ , $\pi_{0,\alpha_t}(\pmb{\xi}) = \frac{1}{\sqrt{(2\pi)^p\alpha_t^p}} \exp(-\|\pmb{\xi}\|_2^2/2\alpha_t^2)$ so that $p_\psi(\pmb{\xi}; \pmb{\theta}_{B_t,\alpha_t}) = \mathcal{N}(\pmb{\theta}_{B_t}, \alpha_t^2\mathbb{I}_d)$ . Then, the distribution from the natural parameter form is: + +$$ +p _ {\boldsymbol {\theta} / \sigma} (\xi) = \exp \left(\langle \xi , \boldsymbol {\theta} \rangle / \sigma^ {2} - \| \theta \| _ {2} ^ {2} / (2 \sigma^ {2})\right) \times \frac {1}{\sqrt {2 \pi} \sigma} \exp \left(- \| \xi \| _ {2} ^ {2} / 2 \sigma^ {2}\right) = \frac {1}{\sqrt {2 \pi} \sigma} \exp \left(- \| \boldsymbol {\xi} - \boldsymbol {\mu} \| _ {2} ^ {2} / 2 \sigma^ {2}\right). \tag {18} +$$ + +The expectation parameter $\pmb{\mu} = \nabla \psi(\pmb{\theta}) = \pmb{\theta}$ . The scaled expectation parameter $\pmb{\mu}_{\alpha} = \nabla \psi(\pmb{\theta}_{\alpha}) = \pmb{\theta}_{\alpha} = \pmb{\theta} / \sigma = \pmb{\mu} / \sigma$ . Since $\xi = x / \sigma$ and the Bregman divergence $d_{\phi}(\pmb{\xi}, \pmb{\mu}) = \frac{1}{2} \| \pmb{\xi} - \pmb{\mu} \|_2^2$ , the expectation parameter form + +$$ +p _ {\boldsymbol {\mu} _ {\alpha}} (\boldsymbol {\xi}) = \exp (- \| \boldsymbol {\xi} / \sigma - \boldsymbol {\mu} / \sigma \| _ {2} ^ {2} / 2) \frac {1}{\sqrt {2 \pi} \sigma} = \frac {1}{\sqrt {2 \pi} \sigma} \exp (- \| \boldsymbol {\xi} - \boldsymbol {\mu} \| _ {2} ^ {2} / 2 \sigma^ {2}). \tag {19} +$$ + +By taking $\rho_{t} = \eta_{t}$ , the update (6) based on $\rho_{t}\pmb{\xi}_{t}$ is distributed as $\mathcal{N}(\eta_t\pmb{\theta}_{B_t},\eta_t^2\alpha_t^2\mathbb{I}_d) = \mathcal{N}(\eta_t\nabla \ell (\mathbf{w}_{t - 1},S_{B_t}),\sigma_t^2\mathbb{I}_d)$ . Thus the EFLD update reduces to the SGLD update: $\mathbf{w}_t = \mathbf{w}_{t - 1} - \eta_t\nabla \ell (\mathbf{w}_{t - 1},S_{B_t}) + \mathcal{N}\left(0,\sigma_t^2\mathbb{I}_d\right)$ . + +Example C.2 (Skewed Rademacher). For skewed Rademacher over $\{-1,1\}$ , the sufficient statistic $\xi = x \in \{-1,1\}$ , base measure is 1 on $\{-1,1\}$ , and the log-partition function $\psi(\theta) = \log(\exp(-\theta) + \exp(\theta))$ for natural parameter $\theta \in \mathbb{R}$ . The expectation parameter $\mu = \nabla \psi(\theta) = \frac{\exp(\theta) - \exp(-\theta)}{\exp(-\theta) + \exp(\theta)} = \frac{\exp(2\theta) - 1}{\exp(2\theta) + 1}$ , then its inverse function $\theta = \nabla \phi(\mu) = \frac{1}{2} \log\left(\frac{1 + \mu}{1 - \mu}\right)$ , by integration we have $\phi(\mu) = \frac{1 + \mu}{2} \log \frac{1 + \mu}{2} + \frac{1 - \mu}{2} \log \frac{1 - \mu}{2}$ . The expectation parameter $\mu = \nabla \psi(\theta) = \frac{\exp(\theta)}{1 + \exp(\theta)} = \frac{1}{1 + \exp(-\theta)}$ , the sigmoid function of $\theta$ . The Bregman divergence is the Bernoulli KL-divergence given by: $d_{\phi}(\xi, \mu) = \xi \log \frac{\xi}{\mu} + (1 - \xi) \log \frac{1 - \xi}{1 - \mu}$ . For scaled parameters $\theta_{\alpha} = \theta / \alpha$ , the corresponding expectation parameter $\mu_{\alpha} = \frac{1}{1 + \exp(-\theta_{\alpha})}$ . The mean parameter form distribution is given by + +$$ +p _ {\mu_ {\alpha}} (\xi) = \exp (- d _ {\phi} (\xi , \mu_ {\alpha})) = \mu_ {\alpha} ^ {\xi} (1 - \mu_ {\alpha}) ^ {1 - \xi}. \tag {20} +$$ + +Noisy Sign-SGD takes $\rho_{t} = \eta_{t}$ and componentwise $\xi_{j}\in \{-1,1\}$ , $\pi_{0,\alpha_t}(\xi_j) = 1$ , $\psi (\theta) = \log (\exp (-\theta) + \exp (\theta))$ in exponential family update equation (6), the $j$ -th component of exponential family distribution $p_{\psi}(\pmb {\xi};\pmb{\theta}_{B_t,\alpha_t})$ becomes $p_{\psi}(\xi_j;\pmb{\theta}_{B_t,\alpha_t,j}) = \frac{\exp(\xi_j\pmb{\theta}_{B_t,\alpha_t,j})}{\exp(-\theta_{B_t,\alpha_t,j}) + \exp(\theta_{B_t,\alpha_t,j})}$ . Thus, the EFLD update reduces to a noisy version of Sign-SGD: $\mathbf{w}_t = \mathbf{w}_{t - 1} - \eta_t\xi_t,\xi_{t,j}\sim p_{\psi}(\xi_j,\theta_{B_t,\alpha_t,j}),j\in [p]$ , where $\pmb{\theta}_{B_t,\alpha_t} = \nabla \ell (\mathbf{w}_{t - 1},S_{B_t}) / \alpha_t$ is the scaled mini-batch gradient. + +Example C.3 (Bernoulli over $\{0,1\}$ ). For Bernoulli over $\{0,1\}$ , the sufficient statistic $\xi = x \in \{0,1\}$ , base measure is 1 on $\{0,1\}$ , and the log-partition function $\psi(\theta) = \log(1 + \exp(\theta))$ for natural parameter $\theta \in \mathbb{R}$ . The expectation parameter $\mu = \nabla \psi(\theta) = \frac{\exp(\theta)}{1 + \exp(\theta)} = \frac{1}{1 + \exp(-\theta)}$ , the sigmoid function of $\theta$ . The Bregman divergence is the Bernoulli KL-divergence given by: $d_{\phi}(\xi, \mu) = x \log \frac{x}{\mu} + (1 - x) \log \frac{1 - x}{1 - \mu}$ . For scaled parameters $\theta_{\alpha} = \theta / \alpha$ , the corresponding expectation parameter $\mu_{\alpha} = \frac{1}{1 + \exp(-\theta_{\alpha})}$ . The mean parameter form distribution is given by + +$$ +p _ {\mu_ {\alpha}} (\xi) = \exp (- d _ {\phi} (\xi , \mu_ {\alpha})) = \mu_ {\alpha} ^ {\xi} (1 - \mu_ {\alpha}) ^ {1 - \xi}. \tag {21} +$$ + +By taking the $j$ -th component of exponential family distribution $p_{\psi}(\boldsymbol{\xi}; \boldsymbol{\theta}_{B_t, \alpha_t})$ becomes $p_{\psi}(\xi_j; \theta_{B_t, \alpha_t, j}) = \frac{\exp(\xi_j \theta_{B_t, \alpha_t, j})}{1 + \exp(\theta_{B_t, \alpha_t, j})}$ . Thus, the EFLD update reduces to: $\mathbf{w}_t = \mathbf{w}_{t-1} - \eta_t \boldsymbol{\xi}_t, \xi_{t,j} \sim p_{\psi}(\xi_j, \boldsymbol{\theta}_{B_t, \alpha_t, j}), j \in [p]$ , where $\boldsymbol{\theta}_{B_t, \alpha_t} = \nabla \ell(\mathbf{w}_{t-1}, S_{B_t}) / \alpha_t$ is the scaled mini-batch gradient. + +# C.2. Proof of Theorem 1 + +Theorem 1. For a given set $\bar{S}_{n+1} \sim D^{n+1}$ and $\mathbf{w}_{t-1}$ at iteration $(t-1)$ , let $\Delta_{t|\mathbf{w}_{t-1}}(\bar{S}_{n+1}) = \max_{z, z' \in \bar{S}_{n+1}} \|\nabla \ell(\mathbf{w}_{t-1}, z) - \nabla \ell(\mathbf{w}_{t-1}, z')\|_2$ . Further, for a $c_2$ -smooth log-partition function $\psi$ , let the scaling $\alpha_{t|\mathbf{w}_{t-1}}$ be data-dependent such that $\alpha_{t|\mathbf{w}_{t-1}}^2 \geq 8c_2 \Delta_{t|\mathbf{w}_{t-1}}^2(\bar{S}_{n+1})$ . Then, for $\Lambda(A_t, B_t)$ as in (3) we have + +$$ +\begin{array}{l} \Lambda \left(A _ {t}, B _ {t}\right) \leq 5 c _ {2} \left\| \boldsymbol {\theta} _ {B _ {t}, \alpha_ {t}} - \boldsymbol {\theta} _ {B _ {t} ^ {\prime}, \alpha_ {t}} \right\| _ {2} ^ {2} \\ = \frac {5 c _ {2}}{2 \alpha_ {t | \mathbf {w} _ {t - 1}} ^ {2}} \left[ \left\| \nabla \ell \left(\mathbf {w} _ {t - 1}, S _ {B _ {t}}\right) - \nabla \ell \left(\mathbf {w} _ {t - 1}, S _ {B _ {t}} ^ {\prime}\right) \right\| _ {2} ^ {2} \right]. \\ \end{array} +$$ + +To avoid clutter, we drop the subscript $t$ for the analysis and note that the analysis holds for any step $t$ . When the density $dP_{B,\pmb{\xi}} = \mathbf{p}_{\psi}(\pmb{\xi};\pmb{\theta}_{B,\alpha})$ , by mean-value theorem, for each $\pmb{\xi}$ , we have + +$$ +p _ {\psi} (\boldsymbol {\xi}; \boldsymbol {\theta} _ {B, \alpha}) - p _ {\psi} (\boldsymbol {\xi}; \boldsymbol {\theta} _ {B ^ {\prime}, \alpha}) = \left\langle \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {B ^ {\prime}, \alpha}, \nabla_ {\tilde {\boldsymbol {\theta}} _ {B, \alpha}} p _ {\psi} (\boldsymbol {\xi}; \tilde {\boldsymbol {\theta}} _ {B, \alpha}) \right\rangle , \tag {22} +$$ + +for some $\tilde{\pmb{\theta}}_{B,\alpha} = \gamma_{\pmb{\xi}}\pmb{\theta}_{B,\alpha} + (1 - \gamma_{\pmb{\xi}})\pmb{\theta}_{B,\alpha}^{\prime}$ where $\gamma_{\pmb{\xi}} \in [0,1]$ . Then, + +$$ +\begin{array}{l} I _ {A, B} = \int_ {\pmb {\xi}} \frac {\left(p _ {\psi} (\pmb {\xi} ; \pmb {\theta} _ {B , \alpha}) - p _ {\psi} (\pmb {\xi} ; \pmb {\theta} _ {B ^ {\prime} , \alpha})\right) ^ {2}}{p _ {\psi} (\pmb {\xi} ; \pmb {\theta} _ {A , \alpha})} d \pmb {\xi} = \int_ {\pmb {\xi}} \frac {\langle \pmb {\theta} _ {B , \alpha} - \pmb {\theta} _ {B ^ {\prime} , \alpha} , \nabla_ {\tilde {\pmb {\theta}} _ {B , \alpha}} p _ {\psi} (\pmb {\xi} ; \tilde {\pmb {\theta}} _ {B , \alpha}) \rangle^ {2}}{p _ {\psi} (\pmb {\xi} ; \pmb {\theta} _ {A , \alpha})} d \pmb {\xi} \\ = \int_ {\boldsymbol {\xi}} \frac {\left\langle \boldsymbol {\theta} _ {B , \alpha} - \boldsymbol {\theta} _ {B , \alpha} ^ {\prime} , \boldsymbol {\xi} - \nabla_ {\tilde {\boldsymbol {\theta}} _ {B ^ {\prime} , \alpha}} \psi (\boldsymbol {\xi} ; \tilde {\boldsymbol {\theta}} _ {B , \alpha}) \right\rangle^ {2} p _ {\psi} ^ {2} (\boldsymbol {\xi} ; \tilde {\boldsymbol {\theta}} _ {B , \alpha})}{p _ {\psi} (\boldsymbol {\xi} ; \boldsymbol {\theta} _ {A , \alpha})} d \boldsymbol {\xi}, \tag {23} \\ \end{array} +$$ + +since $p_{\psi}(\boldsymbol {\xi};\tilde{\boldsymbol{\theta}}_{B,\alpha}) = \exp (\langle \boldsymbol {\xi},\tilde{\boldsymbol{\theta}}_{B,\alpha}\rangle -\psi (\tilde{\boldsymbol{\theta}}_{B,\alpha}))\pi_0(\boldsymbol {\xi})$ + +# C.2.1. HANDLING DISTRIBUTIONAL DEPENDENCY OF $\tilde{\theta}_B$ + +Note that we cannot proceed with the analysis with the density term depending on $\tilde{\theta}_B$ since $\tilde{\theta}_B$ depends on $\xi$ . In this step we focus on bounding the density term depending on $\tilde{\theta}_B$ in terms of exponential family densities with parameters $\theta_B$ and $\theta_B'$ . + +Lemma 2. With $\tilde{\theta}_{B,\alpha} = \gamma_{\pmb{\xi}}\pmb{\theta}_{B,\alpha} + (1 - \gamma_{\pmb{\xi}})\pmb{\theta}_{B,\alpha}^{\prime}$ for some $\gamma_{\pmb{\xi}}\in [0,1]$ , we have + +$$ +\begin{array}{l} \frac {\exp \left[ \langle \boldsymbol {\xi} , \tilde {\boldsymbol {\theta}} _ {B , \alpha} \rangle - \psi (\tilde {\boldsymbol {\theta}} _ {B , \alpha}) \right]}{\max \left(\exp \left[ \langle \boldsymbol {\xi} , \boldsymbol {\theta} _ {B , \alpha} \rangle - \psi (\boldsymbol {\theta} _ {B , \alpha}) \right] , \exp \left[ \langle \boldsymbol {\xi} , \boldsymbol {\theta} _ {B , \alpha} ^ {\prime} \rangle - \psi (\boldsymbol {\theta} _ {B , \alpha} ^ {\prime}) \right]\right)} \\ \leq \exp \left[ c _ {2} \| \pmb {\theta} _ {B, \alpha} - \pmb {\theta} _ {B, \alpha} ^ {\prime} \| _ {2} ^ {2} \right]. \\ \end{array} +$$ + +Proof. Denoting $\gamma_{\xi}$ as $\gamma$ for convenience (the dependence on $\xi$ does not play a role in the analysis), we have + +$$ +\langle \boldsymbol {\xi}, \tilde {\boldsymbol {\theta}} _ {B, \alpha} \rangle - \psi (\tilde {\boldsymbol {\theta}} _ {B, \alpha}) = \langle \boldsymbol {\xi}, \gamma \boldsymbol {\theta} _ {B, \alpha} + (1 - \gamma) \boldsymbol {\theta} _ {B, \alpha} ^ {\prime} \rangle - \psi (\gamma \boldsymbol {\theta} _ {B, \alpha} + (1 - \gamma) \boldsymbol {\theta} _ {B, \alpha} ^ {\prime}) +$$ + +$$ +\begin{array}{l} = \gamma \left[ \langle \boldsymbol {\xi}, \boldsymbol {\theta} _ {B, \alpha} \rangle - \psi (\boldsymbol {\theta} _ {B, \alpha}) \right] + (1 - \gamma) \left[ \langle \boldsymbol {\xi}, \boldsymbol {\theta} _ {B, \alpha} ^ {\prime} \rangle - \psi (\boldsymbol {\theta} _ {B, \alpha} ^ {\prime}) \right] \\ + \left[ \gamma \psi (\boldsymbol {\theta} _ {B, \alpha}) + (1 - \gamma) \psi (\boldsymbol {\theta} _ {B, \alpha} ^ {\prime}) - \psi (\gamma \boldsymbol {\theta} _ {B, \alpha} + (1 - \gamma) \boldsymbol {\theta} _ {B, \alpha} ^ {\prime}) \right] \\ \end{array} +$$ + +$$ +\begin{array}{l} \stackrel {(a)} {\leq} \max \left(\langle \pmb {\xi}, \pmb {\theta} _ {B, \alpha} \rangle - \psi (\pmb {\theta} _ {B, \alpha}), \langle \pmb {\xi}, \pmb {\theta} _ {B, \alpha} ^ {\prime} \rangle - \psi (\pmb {\theta} _ {B, \alpha} ^ {\prime})\right) \\ + \left[ \gamma d _ {\psi} (\pmb {\theta} _ {B, \alpha}, \tilde {\pmb {\theta}} _ {B, \alpha}) + (1 - \gamma) d _ {\psi} (\pmb {\theta} _ {B, \alpha} ^ {\prime}, \tilde {\pmb {\theta}} _ {B, \alpha}) \right], \\ \end{array} +$$ + +where the second term in (a) follows since difference between two sides of Jensen's inequality is given by the Bregman information, i.e., expected Bregman divergence to the expectation (See section 3.1.1 in (Banerjee et al., 2005)): + +$$ +\gamma \psi (\pmb {\theta} _ {B, \alpha}) + (1 - \gamma) \psi (\pmb {\theta} _ {B, \alpha} ^ {\prime}) - \psi (\gamma \pmb {\theta} _ {B, \alpha} + (1 - \gamma) \pmb {\theta} _ {B, \alpha} ^ {\prime}) = \gamma d _ {\psi} (\pmb {\theta} _ {B, \alpha}, \tilde {\pmb {\theta}} _ {B, \alpha}) + (1 - \gamma) d _ {\psi} (\pmb {\theta} _ {B, \alpha} ^ {\prime}, \tilde {\pmb {\theta}} _ {B, \alpha}). +$$ + +Now, note that + +$$ +\begin{array}{l} \gamma d _ {\psi} \left(\boldsymbol {\theta} _ {B, \alpha}, \tilde {\boldsymbol {\theta}} _ {B, \alpha}\right) + (1 - \gamma) d _ {\psi} \left(\boldsymbol {\theta} _ {B, \alpha} ^ {\prime}, \tilde {\boldsymbol {\theta}} _ {B, \alpha}\right) \leq \gamma d _ {\psi} \left(\boldsymbol {\theta} _ {B, \alpha}, \boldsymbol {\theta} _ {B, \alpha} ^ {\prime}\right) + (1 - \gamma) d _ {\psi} \left(\boldsymbol {\theta} _ {B, \alpha} ^ {\prime}, \boldsymbol {\theta} _ {B, \alpha}\right) \\ \leq \gamma c _ {2} \| \boldsymbol {\theta} _ {B, \alpha} ^ {\prime} - \boldsymbol {\theta} _ {B, \alpha} \| _ {2} ^ {2} + (1 - \gamma) c _ {2} \| \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {B, \alpha} ^ {\prime} \| _ {2} ^ {2} \\ \leq c _ {2} \left\| \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {B ^ {\prime}, \alpha} \right\| _ {2} ^ {2}. \\ \end{array} +$$ + +As a result, + +$$ +\begin{array}{l} \frac {\exp \left[ \langle \boldsymbol {\xi} , \tilde {\boldsymbol {\theta}} _ {B , \alpha} \rangle - \psi (\tilde {\boldsymbol {\theta}} _ {B , \alpha}) \right]}{\max \left(\exp \left[ \langle \boldsymbol {\xi} , \boldsymbol {\theta} _ {B , \alpha} \rangle - \psi (\boldsymbol {\theta} _ {B , \alpha}) \right] , \exp \left[ \langle \boldsymbol {\xi} , \boldsymbol {\theta} _ {B , \alpha} ^ {\prime} \rangle - \psi (\boldsymbol {\theta} _ {B , \alpha} ^ {\prime}) \right]\right)} \\ \leq \exp \left[ c _ {2} \| \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {B ^ {\prime}, \alpha} \| _ {2} ^ {2} \right] \frac {\exp \left[ \max \left(\langle \boldsymbol {\xi} , \boldsymbol {\theta} _ {B , \alpha} \rangle - \psi (\boldsymbol {\theta} _ {B , \alpha}) , \langle \boldsymbol {\xi} , \boldsymbol {\theta} _ {B , \alpha} ^ {\prime} \rangle - \psi (\boldsymbol {\theta} _ {B , \alpha} ^ {\prime})\right) \right]}{\max \left(\exp \left[ \langle \boldsymbol {\xi} , \boldsymbol {\theta} _ {B , \alpha} \rangle - \psi (\boldsymbol {\theta} _ {B , \alpha}) \right] , \exp \left[ \langle \boldsymbol {\xi} , \boldsymbol {\theta} _ {B , \alpha} ^ {\prime} \rangle - \psi (\boldsymbol {\theta} _ {B , \alpha} ^ {\prime}) \right]\right)} \\ = \exp \left[ c _ {2} \| \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {B ^ {\prime}, \alpha} \| _ {2} ^ {2} \right]. \\ \end{array} +$$ + +That completes the proof. + +# C.2.2. BOUNDING THE DENSITY RATIO + +Focusing on density ratio, we have + +Lemma 3. For any $\xi$ , we have + +$$ +\begin{array}{l} \frac {\exp \left[ \langle \boldsymbol {\xi} , 2 \boldsymbol {\theta} _ {B , \alpha} \rangle - 2 \psi (\boldsymbol {\theta} _ {B , \alpha}) \right]}{\exp \left[ \langle \boldsymbol {\xi} , \boldsymbol {\theta} _ {A , \alpha} \rangle - \psi (\boldsymbol {\theta} _ {A , \alpha}) \right]} \leq \exp \left[ 2 c _ {2} \| \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {A, \alpha} \| _ {2} ^ {2} \right] \\ \times \exp \left[ \langle \boldsymbol {\xi}, (2 \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {A, \alpha}) - \psi (2 \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {A, \alpha}) \right]. \\ \end{array} +$$ + +Proof. Note that + +$$ +\begin{array}{l} \frac {\exp \left[ \langle \boldsymbol {\xi} , 2 \boldsymbol {\theta} _ {B , \alpha} \rangle - 2 \psi (\boldsymbol {\theta} _ {B , \alpha}) \right]}{\exp \left[ \langle \boldsymbol {\xi} , \boldsymbol {\theta} _ {A , \alpha} \rangle - \psi (\boldsymbol {\theta} _ {A , \alpha}) \right]} = \exp \left[ \langle \boldsymbol {\xi}, (2 \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {A, \alpha}) \rangle - \left(2 \psi (\boldsymbol {\theta} _ {B, \alpha}) - \psi (\boldsymbol {\theta} _ {A, \alpha})\right) \right] \\ = \beta_ {B, A, \alpha} \exp \left[ \langle \boldsymbol {\xi}, (2 \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {A, \alpha} \rangle - \psi ((2 \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {A, \alpha}) \right], \\ \end{array} +$$ + +where + +$$ +\beta_ {B, A, \alpha} = \exp \left[ \psi \left(\left(2 \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {A, \alpha}\right) - \left(2 \psi \left(\boldsymbol {\theta} _ {B, \alpha}\right) - \psi \left(\boldsymbol {\theta} _ {A, \alpha}\right)\right) \right] \right. +$$ + +Note that + +$$ +\begin{array}{l} \log \beta_ {B, A, \alpha} = \psi \left(\left(2 \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {A, \alpha}\right) - \left(2 \psi \left(\boldsymbol {\theta} _ {B, \alpha}\right) - \psi \left(\boldsymbol {\theta} _ {A, \alpha}\right)\right) \right. \\ = - \left(\psi \left(\boldsymbol {\theta} _ {B, \alpha}\right) - \psi \left(\left(2 \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {A, \alpha}\right)\right) - \left(\psi \left(\boldsymbol {\theta} _ {B, \alpha}\right) - \psi \left(\boldsymbol {\theta} _ {A, \alpha}\right)\right) \right. \\ \stackrel {(a)} {\leq} \left\langle \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {A, \alpha}, \nabla \psi (2 \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {A, \alpha}) \right\rangle + \left\langle \boldsymbol {\theta} _ {A, \alpha} - \boldsymbol {\theta} _ {B, \alpha}, \nabla \psi (\boldsymbol {\theta} _ {A, \alpha} \right\rangle \\ = \left\langle \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {A, \alpha}, \nabla \psi \left(\left(2 \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {A, \alpha}\right) - \nabla \psi \left(\boldsymbol {\theta} _ {A, \alpha}\right) \right. \right\rangle \\ \stackrel {(b)} {\leq} \| \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {A, \alpha} \| _ {2} \| \nabla \psi ((2 \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {A, \alpha}) - \nabla \psi (\boldsymbol {\theta} _ {A, \alpha}) \| _ {2} \\ \stackrel {(c)} {\leq} c _ {2} \left\| \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {A, \alpha} \right\| _ {2} \| \left(2 \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {A, \alpha}\right) - \boldsymbol {\theta} _ {A, \alpha} \| _ {2} \\ = 2 c _ {2} \left\| \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {A, \alpha} \right\| _ {2} ^ {2}, \\ \end{array} +$$ + +where (a) follows from the convexity of $\psi$ , (b) follows from Cauchy-Schwartz, and (c) follows by smoothness of $\psi$ . + +As a result, we have + +$$ +\frac {\exp \left[ \langle \pmb {\xi} , 2 \pmb {\theta} _ {B , \alpha} \rangle - 2 \psi (\pmb {\theta} _ {B , \alpha}) \right]}{\exp \left[ \langle \pmb {\xi} , \pmb {\theta} _ {A , \alpha} \rangle - \psi (\pmb {\theta} _ {A , \alpha}) \right]} \leq \exp \left[ 2 c _ {2} \| \pmb {\theta} _ {B, \alpha} - \pmb {\theta} _ {A, \alpha} \| _ {2} ^ {2} \right] \exp \left[ \langle \pmb {\xi}, (2 \pmb {\theta} _ {B} - \pmb {\theta} _ {A}) / \alpha \rangle - \psi ((2 \pmb {\theta} _ {B} - \pmb {\theta} _ {A}) / \alpha) \right]. +$$ + +That completes the proof. + +The analysis for the term involving $\theta_B^\prime$ is exactly the same. + +Combining Lemma 2 and 3, we have the following result: + +Lemma 6. We have + +$$ +\begin{array}{l} \frac {p _ {\psi} ^ {2} (\pmb {\xi} ; \tilde {\pmb {\theta}} _ {B , \alpha})}{p _ {\psi} (\pmb {\xi} ; \pmb {\theta} _ {A , \alpha})} \leq \exp \left[ 2 c _ {2} \| \pmb {\theta} _ {B, \alpha} - \pmb {\theta} _ {B ^ {\prime}, \alpha} \| _ {2} ^ {2} \right] \\ \times \max \left(\exp \left[ 2 c _ {2} \| \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {A, \alpha} \| _ {2} ^ {2} \right] p _ {\psi} (\boldsymbol {\xi}; 2 \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {A, \alpha})\right), \tag {24} \\ \exp \left[ 2 c _ {2} \| \boldsymbol {\theta} _ {B ^ {\prime}, \alpha} - \boldsymbol {\theta} _ {A, \alpha} \| _ {2} ^ {2} \right] p _ {\psi} (\xi ; 2 \boldsymbol {\theta} _ {B ^ {\prime}, \alpha} - \boldsymbol {\theta} _ {A, \alpha})) . \\ \end{array} +$$ + +Proof. From Lemma 2, we have + +$$ +\begin{array}{l} p _ {\psi} ^ {2} (\boldsymbol {\xi}; \tilde {\boldsymbol {\theta}} _ {B, \alpha}) = \exp \left[ 2 \left\langle \boldsymbol {\xi}, \tilde {\boldsymbol {\theta}} _ {B, \alpha} \right\rangle - 2 \psi \left(\tilde {\boldsymbol {\theta}} _ {B, \alpha}\right) \right] \\ \leq \exp \left[ c _ {2} \left\| \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {B ^ {\prime}, \alpha} \right\| _ {2} ^ {2} \right] \cdot \max \left(\exp \left[ \langle \boldsymbol {\xi}, \boldsymbol {\theta} _ {B, \alpha} \rangle - \psi \left(\boldsymbol {\theta} _ {B, \alpha}\right) \right], \exp \left[ \langle \boldsymbol {\xi}, \boldsymbol {\theta} _ {B ^ {\prime}, \alpha} \rangle - \psi \left(\boldsymbol {\theta} _ {B ^ {\prime}, \alpha}\right) \right]\right) \\ \end{array} +$$ + +Thus, + +$$ +\frac {p _ {\psi} ^ {2} (\boldsymbol {\xi} ; \tilde {\boldsymbol {\theta}} _ {B , \alpha})}{p _ {\psi} (\boldsymbol {\xi} ; \boldsymbol {\theta} _ {A , \alpha})} \leq \exp \left[ 2 c _ {2} \| \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {B ^ {\prime}, \alpha} \| _ {2} ^ {2} \right] \cdot \frac {\max \left(\exp \left[ 2 \langle \boldsymbol {\xi} , \boldsymbol {\theta} _ {B , \alpha} \rangle - 2 \psi (\boldsymbol {\theta} _ {B , \alpha}) \right] , \exp \left[ 2 \langle \boldsymbol {\xi} , \boldsymbol {\theta} _ {B ^ {\prime} , \alpha} \rangle - 2 \psi (\boldsymbol {\theta} _ {B ^ {\prime} , \alpha}) \right]\right)}{\exp \left[ \langle \boldsymbol {\xi} , \boldsymbol {\theta} _ {A , \alpha} \rangle - \psi (\boldsymbol {\theta} _ {A , \alpha}) \right]} +$$ + +Based on Lemma 3, we have + +$$ +\frac {\exp \left[ \langle \pmb {\xi} , 2 \pmb {\theta} _ {B , \alpha} \rangle - 2 \psi (\pmb {\theta} _ {B , \alpha}) \right]}{\exp \left[ \langle \pmb {\xi} , \pmb {\theta} _ {A , \alpha} \rangle - \psi (\pmb {\theta} _ {A , \alpha}) \right]} \leq \exp \left[ 2 c _ {2} \| \pmb {\theta} _ {B, \alpha} - \pmb {\theta} _ {A, \alpha} \| _ {2} ^ {2} \right] \exp \left[ \langle \pmb {\xi}, (2 \pmb {\theta} _ {B} - \pmb {\theta} _ {A}) / \alpha \rangle - \psi ((2 \pmb {\theta} _ {B} - \pmb {\theta} _ {A}) / \alpha) \right] +$$ + +Combining above inequalities we have + +$$ +\begin{array}{l} \frac {p _ {\psi} ^ {2} (\boldsymbol {\xi} ; \tilde {\boldsymbol {\theta}} _ {B , \alpha})}{p _ {\psi} (\boldsymbol {\xi} ; \boldsymbol {\theta} _ {A , \alpha})} \leq \exp \left[ 2 c _ {2} \| \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {B ^ {\prime}, \alpha} \| _ {2} ^ {2} \right] \\ \times \max \left(\exp \left[ 2 c _ {2} \| \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {A, \alpha} \| _ {2} ^ {2} \right] p _ {\psi} (\boldsymbol {\xi}; 2 \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {A, \alpha})\right), \tag {25} \\ \exp \left[ 2 c _ {2} \| \boldsymbol {\theta} _ {B ^ {\prime}, \alpha} - \boldsymbol {\theta} _ {A, \alpha} \| _ {2} ^ {2} \right] p _ {\psi} (\xi ; 2 \boldsymbol {\theta} _ {B ^ {\prime}, \alpha} - \boldsymbol {\theta} _ {A, \alpha})) . \\ \end{array} +$$ + +That completes the proof. + +![](images/4492158fcaee83472011a3090738112798bc8cde1eea9340a1c88c75443d9079.jpg) + +# C.2.3. BOUNDING THE INTEGRAL + +Ignoring multiplicative terms which do not depend on $\xi$ for the moment, the analysis needs to bound an integral term of the form + +$$ +\int_ {\boldsymbol {\xi}} \left\langle \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {B, \alpha} ^ {\prime}, \boldsymbol {\xi} - \nabla \psi (\boldsymbol {\xi}; \tilde {\boldsymbol {\theta}} _ {B, \alpha}) \right\rangle^ {2} p _ {\psi} (\boldsymbol {\xi}; 2 \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {A, \alpha}) d \boldsymbol {\xi}, \tag {26} +$$ + +and a similar term with $p_{\psi}^{2}(\pmb {\xi};2\pmb{\theta}_{B^{\prime},\alpha} - \pmb{\theta}_{A,\alpha})$ . The proof of Theorem 1 can be done by suitably bounding the integral. + +Proof of Theorem 1. From Lemma 6, we have + +$$ +\begin{array}{l} I _ {A, B} \leq \int_ {\boldsymbol {\xi}} \frac {\left\langle \boldsymbol {\theta} _ {B , \alpha} - \boldsymbol {\theta} _ {B , \alpha} ^ {\prime} , \boldsymbol {\xi} - \nabla \psi (\tilde {\boldsymbol {\theta}} _ {B , \alpha}) \right\rangle^ {2} p _ {\psi} ^ {2} (\boldsymbol {\xi} ; \tilde {\boldsymbol {\theta}} _ {B , \alpha})}{p _ {\psi} (\boldsymbol {\xi} ; \boldsymbol {\theta} _ {A , \alpha})} d \boldsymbol {\xi} \\ \leq \exp \left[ 2 c _ {2} \| \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {B ^ {\prime}, \alpha} \| _ {2} ^ {2} \right] \\ \times \max \left( \right.\exp \left[ 2 c _ {2} \| \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {A, \alpha} \| _ {2} ^ {2} \right] \int_ {\boldsymbol {\xi}} \left\langle \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {B, \alpha}, \boldsymbol {\xi} - \nabla \psi (\tilde {\boldsymbol {\theta}} _ {B, \alpha}) \right\rangle^ {2} p _ {\psi} (\boldsymbol {\xi}; 2 \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {A, \alpha}) d \boldsymbol {\xi} , \\ \exp \left[ 2 c _ {2} \| \boldsymbol {\theta} _ {B ^ {\prime}, \alpha} - \boldsymbol {\theta} _ {A, \alpha} \| _ {2} ^ {2} \right] \int_ {\boldsymbol {\xi}} \left\langle \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {B ^ {\prime}, \alpha}, \boldsymbol {\xi} - \nabla \psi (\tilde {\boldsymbol {\theta}} _ {B, \alpha}) \right\rangle^ {2} p _ {\psi} (\boldsymbol {\xi}; 2 \boldsymbol {\theta} _ {B ^ {\prime}, \alpha} - \boldsymbol {\theta} _ {A, \alpha}) d \boldsymbol {\xi} \Bigg) . \\ \end{array} +$$ + +Focusing on the integral in the first term (the analysis for the second term is essentially the same), we have + +$$ +\begin{array}{l} \int_ {\boldsymbol {\xi}} \left\langle \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {B ^ {\prime}, \alpha}, \boldsymbol {\xi} - \nabla \psi (\tilde {\boldsymbol {\theta}} _ {B, \alpha}) \right\rangle^ {2} p _ {\psi} (\boldsymbol {\xi}; 2 \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {A, \alpha}) d \boldsymbol {\xi} \\ = \int_ {\boldsymbol {\xi}} \left\langle \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {B ^ {\prime}, \alpha}, (\boldsymbol {\xi} - \mathbb {E} [ \boldsymbol {\xi} ]) - \left(\nabla \psi (\tilde {\boldsymbol {\theta}} _ {B, \alpha}) - \mathbb {E} [ \boldsymbol {\xi} ]\right) \right\rangle^ {2} p _ {\psi} (\boldsymbol {\xi}; 2 \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {A, \alpha}) d \boldsymbol {\xi} \\ \leq 2 \underbrace {\int_ {\boldsymbol {\xi}} \left\langle \boldsymbol {\theta} _ {B , \alpha} - \boldsymbol {\theta} _ {B ^ {\prime} , \alpha} , \boldsymbol {\xi} - \mathbb {E} [ \boldsymbol {\xi} ] \right\rangle^ {2} p _ {\psi} (\boldsymbol {\xi} ; 2 \boldsymbol {\theta} _ {B , \alpha} - \boldsymbol {\theta} _ {A , \alpha}) d \boldsymbol {\xi}} _ {T _ {1}} \\ + 2 \underbrace {\int_ {\boldsymbol {\xi}} \left\langle \boldsymbol {\theta} _ {B , \alpha} - \boldsymbol {\theta} _ {B , \alpha} , \nabla \psi (\tilde {\boldsymbol {\theta}} _ {B , \alpha}) - \mathbb {E} [ \boldsymbol {\xi} ] \right\rangle^ {2} p _ {\psi} (\boldsymbol {\xi} ; 2 \boldsymbol {\theta} _ {B , \alpha} - \boldsymbol {\theta} _ {A , \alpha}) d \boldsymbol {\xi}} _ {T _ {2}}. \\ \end{array} +$$ + +For $T_{1}$ , note that + +$$ +\begin{array}{l} T _ {1} = \mathbb {E} _ {\boldsymbol {\xi} \sim p _ {\psi} (\boldsymbol {\xi}; 2 \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {A, \alpha})} \left[ \langle \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {B ^ {\prime}, \alpha}, \boldsymbol {\xi} - \mathbb {E} [ \boldsymbol {\xi} ] \rangle^ {2} \right] \\ = \left(\boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {B ^ {\prime}, \alpha}\right) ^ {T} \mathbb {E} _ {\boldsymbol {\xi} \sim p _ {\psi} \left(2 \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {A, \alpha}\right)} \left[ (\boldsymbol {\xi} - \mathbb {E} [ \boldsymbol {\xi} ]) (\boldsymbol {\xi} - \mathbb {E} [ \boldsymbol {\xi} ]) ^ {T} \right] \left(\boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {B ^ {\prime}, \alpha}\right) \\ = \left(\boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {B, \alpha}\right) ^ {T} \nabla^ {2} \psi \left(2 \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {A, \alpha}\right) \left(\boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {B ^ {\prime}, \alpha}\right) \\ \leq c _ {2} \left\| \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {B, \alpha} \right\| _ {2} ^ {2}, \\ \end{array} +$$ + +since, by smoothness, the spectral norm of $\nabla^2\psi$ is bounded by $c_{2}$ + +For $T_{2}$ , first note that + +$$ +\mathbb {E} _ {\pmb {\xi} \sim p _ {\psi} (\pmb {\xi}; 2 \pmb {\theta} _ {B, \alpha} - \pmb {\theta} _ {A, \alpha})} [ \pmb {\xi} ] = \nabla \psi (2 \pmb {\theta} _ {B, \alpha} - \pmb {\theta} _ {A, \alpha})). +$$ + +Hence, with $\tilde{\pmb{\theta}}_{B,\alpha} = \gamma_{\pmb{\xi}}\pmb{\theta}_{B,\alpha} + (1 - \gamma_{\pmb{\xi}})\pmb{\theta}_{B^{\prime},\alpha}$ for some $\gamma_{\pmb{\xi}}\in [0,1]$ , we have + +$$ +\begin{array}{l} T _ {2} = \mathbb {E} _ {\pmb {\xi} \sim p _ {\psi} (\pmb {\xi}; 2 \pmb {\theta} _ {B, \alpha} - \pmb {\theta} _ {A, \alpha})} \left[ \left\langle \pmb {\theta} _ {B, \alpha} - \pmb {\theta} _ {B, \alpha}, \nabla \psi (\tilde {\pmb {\theta}} _ {B, \alpha}) - \mathbb {E} [ \pmb {\xi} ] \right\rangle^ {2} \right] \\ = \mathbb {E} _ {\pmb {\xi} \sim p _ {\psi} (\pmb {\xi}; 2 \pmb {\theta} _ {B, \alpha} - \pmb {\theta} _ {A, \alpha})} \left[ \left\langle \pmb {\theta} _ {B, \alpha} - \pmb {\theta} _ {B ^ {\prime}, \alpha}, \nabla \psi (\tilde {\pmb {\theta}} _ {B, \alpha}) - \nabla \psi (2 \pmb {\theta} _ {B, \alpha} - \pmb {\theta} _ {A, \alpha}) \right\rangle^ {2} \right] \\ \leq \left\| \pmb {\theta} _ {B, \alpha} - \pmb {\theta} _ {B, \alpha} \right\| _ {2} ^ {2} \mathbb {E} _ {\pmb {\xi} \sim p _ {\psi} (\pmb {\xi}; 2 \pmb {\theta} _ {B, \alpha} - \pmb {\theta} _ {A, \alpha})} \left[ \left\| \nabla \psi (\tilde {\pmb {\theta}} _ {B, \alpha}) - \nabla \psi ((2 \pmb {\theta} _ {B, \alpha} - \pmb {\theta} _ {A, \alpha}) \right\| _ {2} ^ {2} \right] \\ = c _ {2} ^ {2} \| \pmb {\theta} _ {B, \alpha} - \pmb {\theta} _ {B ^ {\prime}, \alpha} \| _ {2} ^ {2} \mathbb {E} _ {\pmb {\xi} \sim p _ {\psi} (\pmb {\xi}; 2 \pmb {\theta} _ {B, \alpha} - \pmb {\theta} _ {A, \alpha})} \left[ \left\| \tilde {\pmb {\theta}} _ {B, \alpha} - (2 \pmb {\theta} _ {B, \alpha} - \pmb {\theta} _ {A, \alpha}) \right\| _ {2} ^ {2} \right] \\ = c _ {2} ^ {2} \| \pmb {\theta} _ {B, \alpha} - \pmb {\theta} _ {B ^ {\prime}, \alpha} \| _ {2} ^ {2} \mathbb {E} _ {\pmb {\xi} \sim p _ {\psi} (\pmb {\xi}; 2 \pmb {\theta} _ {B, \alpha} - \pmb {\theta} _ {A, \alpha})} \left[ \left\| \gamma_ {\pmb {\xi}} \pmb {\theta} _ {B, \alpha} + (1 - \gamma_ {\pmb {\xi}}) \pmb {\theta} _ {B ^ {\prime}, \alpha} - \pmb {\theta} _ {B, \alpha} - (\pmb {\theta} _ {B, \alpha} - \pmb {\theta} _ {A, \alpha}) \right\| _ {2} ^ {2} \right] \\ = c _ {2} ^ {2} \| \pmb {\theta} _ {B, \alpha} - \pmb {\theta} _ {B ^ {\prime}, \alpha} \| _ {2} ^ {2} \mathbb {E} _ {\pmb {\xi} \sim p _ {\psi} (\pmb {\xi}; 2 \pmb {\theta} _ {B, \alpha} - \pmb {\theta} _ {A, \alpha})} \left[ \left\| (1 - \gamma_ {\pmb {\xi}}) (\pmb {\theta} _ {B ^ {\prime}, \alpha} - \pmb {\theta} _ {B, \alpha}) - (\pmb {\theta} _ {B, \alpha} - \pmb {\theta} _ {A, \alpha}) \right\| _ {2} ^ {2} \right] \\ \leq 2 c _ {2} ^ {2} \| \pmb {\theta} _ {B, \alpha} - \pmb {\theta} _ {B ^ {\prime}, \alpha} \| _ {2} ^ {2} \left(\mathbb {E} _ {\pmb {\xi} \sim p _ {\psi} (\pmb {\xi}; 2 \pmb {\theta} _ {B, \alpha} - \pmb {\theta} _ {A, \alpha})} \left[ (1 - \gamma_ {\pmb {\xi}}) ^ {2} \| \pmb {\theta} _ {B ^ {\prime}, \alpha} - \pmb {\theta} _ {B, \alpha} \| _ {2} ^ {2} \right] \right. \\ \left. + \mathbb {E} _ {\pmb {\xi} \sim p _ {\psi} (\pmb {\xi}; 2 \pmb {\theta} _ {B, \alpha} - \pmb {\theta} _ {A, \alpha})} \left[ \left\| \pmb {\theta} _ {B, \alpha} - \pmb {\theta} _ {A, \alpha} \right\| _ {2} ^ {2} \right]\right) \\ = 2 c _ {2} ^ {2} \| \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {B ^ {\prime}, \alpha} \| _ {2} ^ {2} \left(\left\| \boldsymbol {\theta} _ {B ^ {\prime}, \alpha} - \boldsymbol {\theta} _ {B, \alpha} \right\| _ {2} ^ {2} \mathbb {E} _ {\boldsymbol {\xi} \sim p _ {\psi} (\boldsymbol {\xi}; 2 \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {A, \alpha})} \left[ (1 - \gamma_ {\boldsymbol {\xi}}) ^ {2} \right] + \left\| \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {A, \alpha} \right\| _ {2} ^ {2}\right) \\ \leq 2 c _ {2} ^ {2} \| \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {B ^ {\prime}, \alpha} \| _ {2} ^ {2} \quad \left(\| \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {B ^ {\prime}, \alpha} \| _ {2} ^ {2} + \| \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {A, \alpha} \| _ {2} ^ {2}\right). \\ \end{array} +$$ + +Putting everything back together + +$$ +\begin{array}{l} \int_ {\boldsymbol {\xi}} \left\langle \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {B ^ {\prime}, \alpha}, \boldsymbol {\xi} - \nabla \psi (\tilde {\boldsymbol {\theta}} _ {B, \alpha}) \right\rangle^ {2} p _ {\psi} (\boldsymbol {\xi}; 2 \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {A, \alpha}) d \boldsymbol {\xi} \\ = c _ {2} \| \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {B ^ {\prime}, \alpha} \| _ {2} ^ {2} \left(1 + 2 c _ {2} \| \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {B ^ {\prime}, \alpha} \| _ {2} ^ {2} + 2 c _ {2} \| \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {A, \alpha} \| _ {2} ^ {2}\right). \\ \end{array} +$$ + +Similarly + +$$ +\begin{array}{l} \int_ {\boldsymbol {\xi}} \left\langle \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {B ^ {\prime}, \alpha}, \boldsymbol {\xi} - \nabla \psi (\tilde {\boldsymbol {\theta}} _ {B, \alpha}) \right\rangle^ {2} p _ {\psi} (\boldsymbol {\xi}; 2 \boldsymbol {\theta} _ {B ^ {\prime}, \alpha} - \boldsymbol {\theta} _ {A, \alpha}) d \boldsymbol {\xi} \\ = c _ {2} \left\| \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {B ^ {\prime}, \alpha} \right\| _ {2} ^ {2} \left(1 + 2 c _ {2} \left\| \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {B ^ {\prime}, \alpha} \right\| _ {2} ^ {2} + 2 c _ {2} \left\| \boldsymbol {\theta} _ {B ^ {\prime}, \alpha} - \boldsymbol {\theta} _ {A, \alpha} \right\| _ {2} ^ {2}\right). \\ \end{array} +$$ + +Then, plugging into bound on $I_{A,B}$ , we have + +$$ +\begin{array}{l} I _ {A, B} \leq c _ {2} \| \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {B ^ {\prime}, \alpha} \| _ {2} ^ {2} \times \exp \left[ 2 c _ {2} \| \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {B ^ {\prime}, \alpha} \| _ {2} ^ {2} \right] \\ \times \max \left(\exp \left[ 2 c _ {2} \| \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {A, \alpha} \| _ {2} ^ {2} \right] \times \left(1 + 2 c _ {2} \| \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {B ^ {\prime}, \alpha} \| _ {2} ^ {2} + 2 c _ {2} \| \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {A, \alpha} \| _ {2} ^ {2}\right) \right., \\ \exp \left[ 2 c _ {2} \| \boldsymbol {\theta} _ {B ^ {\prime}, \alpha} - \boldsymbol {\theta} _ {A, \alpha} \| _ {2} ^ {2} \right] \times \left(1 + 2 c _ {2} \| \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {B ^ {\prime}, \alpha} \| _ {2} ^ {2} + 2 c _ {2} \| \boldsymbol {\theta} _ {B ^ {\prime}, \alpha} - \boldsymbol {\theta} _ {A, \alpha} \| _ {2} ^ {2}\right). \\ \end{array} +$$ + +Since $\alpha^2\geq 8c_2\Delta^2 (S_{n + 1})$ where $\Delta (S_{n + 1}) = \max_{z,z'\in S_{n + 1}}\| \nabla \ell (\mathbf{w},z) - \nabla \ell (\mathbf{w},z')\| _2$ , recalling that $\theta_{B,\alpha} = \nabla \ell (\mathbf{w},B) / \alpha$ we have + +$$ +2 c _ {2} \| \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {B ^ {\prime}, \alpha} \| _ {2} ^ {2} \leq \frac {1}{4}, 2 c _ {2} \| \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {A, \alpha} \| _ {2} ^ {2} \leq \frac {1}{4}, 2 c _ {2} \| \boldsymbol {\theta} _ {B ^ {\prime}, \alpha} - \boldsymbol {\theta} _ {A, \alpha} \| _ {2} ^ {2} \leq \frac {1}{4}. +$$ + +As a result, we have + +$$ +\begin{array}{l} I _ {A, B} \leq c _ {2} \| \boldsymbol {\theta} _ {B, \alpha} - \boldsymbol {\theta} _ {B ^ {\prime}, \alpha} \| _ {2} ^ {2} \times \exp \left(\frac {1}{4}\right) \times \exp \left(\frac {1}{4}\right) \times \left(1 + \frac {1}{4} + \frac {1}{4}\right) \\ \leq \frac {5 c _ {2}}{2 \alpha^ {2}} \| \nabla \ell (\mathbf {w}, S _ {B}) - \nabla \ell (\mathbf {w}, S _ {B} ^ {\prime}) \| _ {2} ^ {2}. \\ \end{array} +$$ + +That completes the proof. + +![](images/70c42c3b0ba68d67c3ca54b1890b626993be33a2df390c553f67f7f198b0b659.jpg) + +# C.3. Expected Stability of EFLD + +Theorem 2. In the setting of Proposition 1 consider an exponential family Langevin dynamics (EFLD) algorithm of the form (6)-(7) with a $c_{2}$ -smooth log-partition function $\psi$ . Then, for mini-batch size $b \leq n/2$ , with $c = c_{0}\sqrt{5c_{2}}$ (with $c_{0}$ as in Proposition 1) and $\alpha_{t}^{2} \geq 8c_{2}\Delta_{t}^{2}(\bar{S}_{n+1})$ (as in Theorem 1, with the conditioning on $\mathbf{w}_{t-1}$ hidden to avoid clutter), we have + +$$ +\begin{array}{l} \left. \right.\left| \mathbb {E} _ {S} \left[ L _ {D} (A (S)) - L _ {S} (A (S)) \right]\right| \leq \\ \frac {c}{n} \underset {\tilde {S} _ {n + 1}} {\mathbb {E}} \sqrt {\sum_ {t = 1} ^ {T} \underset {W _ {0 : (t - 1)}} {\mathbb {E}}} \frac {\left\| \nabla \ell \left(\mathbf {w} _ {t - 1} , z _ {n}\right) - \nabla \ell \left(\mathbf {w} _ {t - 1} , z _ {n} ^ {\prime}\right) \right\| _ {2} ^ {2}}{\alpha_ {t} ^ {2}}. \tag {8} \\ \end{array} +$$ + +Proof. Based on Lemma 1, we have + +$$ +\left| \mathbb {E} _ {S} \left[ L _ {D} (A (S)) - L _ {S} (A (S)) \right] \right| \leq c _ {1} \frac {b}{n} \mathbb {E} _ {S} \mathbb {E} _ {z _ {n} ^ {\prime}} \sqrt {\sum_ {t = 1} ^ {T} \underset {W _ {0 : (t - 1)} B _ {t} \in G _ {1} A _ {t} \in G _ {0}} {\mathbb {E}} \left[ I _ {A _ {t} , B _ {t}} \right]}. \tag {27} +$$ + +with $I_{A_t,B_t} = \int_{\pmb{\xi}_t}\frac{\left(dP_{B_t,\pmb{\xi}_t} - dP_{B_t,\pmb{\xi}_t}'\right)^2}{dP_{A_t,\pmb{\xi}_t}} d\pmb{\xi}_t$ + +From Theorem 1, we have + +$$ +\begin{array}{l} I _ {A _ {t}, B _ {t}} \leq \frac {5 c _ {2}}{2 \alpha_ {t | \mathbf {w} _ {t - 1}} ^ {2}} \left[ \left\| \nabla \ell \left(\mathbf {w} _ {t - 1}, S _ {B _ {t}}\right) - \nabla \ell \left(\mathbf {w} _ {t - 1}, S _ {B _ {t}} ^ {\prime}\right) \right\| _ {2} ^ {2} \right] \\ = \frac {5 c _ {2}}{2 \alpha_ {t | \mathbf {w} _ {t - 1}} ^ {2}} \left[ \left\| \frac {1}{b} \sum_ {z \in S _ {B _ {t}} ^ {\prime}} \nabla \ell (\mathbf {w} _ {t - 1}, z) - \frac {1}{b} \sum_ {z \in S _ {B _ {t}}} \nabla \ell (\mathbf {w} _ {t - 1}, z) \right\| _ {2} ^ {2} \right] \\ = \frac {5 c _ {2}}{2 b \alpha_ {t | \mathbf {w} _ {t - 1}} ^ {2}} \left[ \left\| \nabla \ell (\mathbf {w} _ {t - 1}, z _ {n}) - \nabla \ell (\mathbf {w} _ {t - 1}, z _ {n} ^ {\prime}) \right\| _ {2} ^ {2} \right], \\ \end{array} +$$ + +where the last equation holds because $S_{B_t}$ and $S_{B_t}'$ only differ at $z_n$ and $z_n'$ . + +Combining the above two inequalities, we have + +$$ +| \mathbb {E} _ {S} [ L _ {D} (A (S)) - L _ {S} (A (S)) ] | \leq c _ {1} \frac {b}{n} \mathbb {E} _ {S} \mathbb {E} _ {z _ {n} ^ {\prime}} \sqrt {\sum_ {t = 1} ^ {T} \mathbb {E} _ {W _ {0 : (t - 1)}} \left[ \| \nabla \ell (\mathbf {w} _ {t - 1} , z _ {n}) - \nabla \ell (\mathbf {w} _ {t - 1} , z _ {n} ^ {\prime}) \| _ {2} ^ {2} \right]}. +$$ + +That completes the proof. + +![](images/a49b6c8f925fa3fba7e9c72e332834d153439f735963fa3b3e7cec2e1de01932.jpg) + +# D. Optimization Guarantees for EFLD + +# D.1. Optimization Guarantees for Noisy Sign-SGD + +The "density" for a mini-batch $B$ at scale $\alpha$ is: + +$$ +p _ {\psi} (\boldsymbol {\xi}; \boldsymbol {\theta} _ {B, \alpha}) = \exp \left(\left\langle \boldsymbol {\xi}, \boldsymbol {\theta} _ {B, \alpha} \right\rangle - \psi \left(\boldsymbol {\theta} _ {B, \alpha}\right)\right) \boldsymbol {\pi} _ {0} (\boldsymbol {\xi}), \quad \boldsymbol {\theta} _ {B, \alpha} \triangleq \frac {\boldsymbol {\theta} _ {B}}{\alpha} = \frac {\nabla \ell \left(\mathbf {w} _ {t} , S _ {B}\right)}{\alpha}. \tag {28} +$$ + +Note that the corresponding expectation parameter + +$$ +\boldsymbol {\mu} _ {B, \alpha} = \nabla_ {\boldsymbol {\theta} _ {B, \alpha}} \psi \left(\theta_ {B, \alpha}\right). \tag {29} +$$ + +The full-batch Noisy Sign-SGD update the parameters as + +$$ +\mathbf {w} _ {t + 1} = \mathbf {w} _ {t} - \eta_ {t} \boldsymbol {\xi} _ {t}, \quad \boldsymbol {\xi} _ {t, i} \sim \operatorname {R a d} \left(\frac {1}{1 + \exp \left(- 2 \nabla L _ {S} \left(\mathbf {w} _ {t}\right) / \alpha_ {t}\right)}\right), \forall i \in [ d ], \tag {30} +$$ + +where $\operatorname{Rad}(x)$ is the parametric Rademacher distribution with density $x$ at 1 and density $1 - x$ at $-1$ . For mini-batch $B_{t}$ and scaling $\alpha_{t}$ , mini-batch Noisy Sign-SGD updates the parameters as + +$$ +\mathbf {w} _ {t + 1} = \mathbf {w} _ {t} - \eta_ {t} \boldsymbol {\xi} _ {t}, \quad \boldsymbol {\xi} _ {t, i} \sim \operatorname {R a d} \left(\frac {1}{1 + \exp \left(- 2 \boldsymbol {\theta} _ {B _ {t} , \alpha_ {t}}\right)}\right), \forall i \in [ d ]. \tag {31} +$$ + +We make the following smoothness assumptions of the empirical loss function $L_{S}(\mathbf{w})$ : + +Assumption 1. The loss function $L_{S}(\mathbf{w}) = \frac{1}{n}\sum_{i=1}^{n}\ell(\mathbf{w},z_{i})$ satisfies: $\forall \mathbf{w},\mathbf{w}',$ for some non-negative constants $\vec{K} := [K_1,\ldots,K_p]$ , we have $L_{S}(\mathbf{w}) \leq L_{S}(\mathbf{w}') + \nabla L_{S}(\mathbf{w}')^{T}(\mathbf{w} - \mathbf{w}') + \frac{1}{2}\sum_{i}K_{i}(w_{i} - w_{i}')^{2}$ . + +The assumption on the empirical loss $L_{S}(\mathbf{w})$ is common in optimization analysis, besides that, we also assume some natural statistical properties of the batch gradient of the loss $\nabla \ell (\mathbf{w}_t,S_{B_t})$ , where the randomness comes from batches conditioned on $\mathbf{w}_t$ , satisfies the following assumptions: + +Assumption 2. Given $\mathbf{w}_{t-1}$ , the mini-batch gradient $\nabla \ell(\mathbf{w}_{t-1}, S_{B_t})$ is (a) unbiased, i.e., $\mathbb{E}_{B_t | \mathbf{w}_{t-1}} \nabla \ell(\mathbf{w}_{t-1}, S_{B_t}) = \nabla L_S(\mathbf{w}_{t-1})$ ; (b) symmetric, i.e., the density $p_{B_t | \mathbf{w}_{t-1}}(\boldsymbol{\xi})$ of $\boldsymbol{\xi} \equiv \nabla \ell(\mathbf{w}_{t-1}, S_{B_t})$ is symmetric and (c) sub-Gaussian, i.e., for any $\lambda > 0$ , any $\mathbf{v}$ s.t. $\|\mathbf{v}\|_2 = 1$ , $\mathbb{E}_{B_t | \mathbf{w}_{t-1}}[\exp \lambda \langle \mathbf{v}, \nabla \ell(\mathbf{w}_{t-1}, S_{B_t}) - \nabla L_S(\mathbf{w}_{t-1})\rangle] \leq \exp (\lambda^2 \kappa_t^2 / 2)$ , for some constant $\kappa_t > 0$ . + +With Assumption 1 and Assumption 2, we have the following guarantee for convergence of noisy signSGD under full batch and mini batch settings. The following is a restate theorem from the main paper for the mini-batch Noisy Sign-SGD + +Theorem 7. The following holds for any $S$ , any initialization $\mathbf{w}_0$ , and the expectation is taken over the randomness of algorithm: if the loss satisfies Assumption 1, for full-batch noisy Sign-SGD with step size $\eta_t = 1 / \sqrt{T}$ and $\alpha_{t}$ satisfying $c\geq \alpha_{t}\geq \| \nabla L_{S}(\mathbf{w}_{t})\|_{\infty}$ , we have + +$$ +\mathbb {E} \left[ \frac {1}{T} \sum_ {t = 1} ^ {T} \| \nabla L _ {S} (\mathbf {w} _ {t}) \| _ {2} ^ {2} \right] \leq \frac {5 c}{3 \sqrt {T}} \left(L _ {S} (\mathbf {w} _ {0}) - L _ {S} (\mathbf {w} ^ {*}) + \frac {1}{2} \| \vec {K} \| _ {1}\right). \tag {32} +$$ + +Further, if Assumption 2 holds, for mini-batch noisy Sign-SGD with step size $\eta_t = 1 / \sqrt{T}$ , and $\alpha_{t}$ satisfying $c\geq \alpha_{t}\geq \max [\sqrt{2}\kappa_{t},4\| \nabla L_{S}(\mathbf{w}_{t})\|_{\infty}]$ , we have + +$$ +\mathbb {E} \left[ \frac {1}{T} \sum_ {t = 1} ^ {T} \| \nabla L _ {S} (\mathbf {w} _ {t}) \| _ {2} ^ {2} \right] \leq \frac {4 c}{\sqrt {T}} \left(L _ {S} (\mathbf {w} _ {0}) - L _ {S} (\mathbf {w} ^ {*}) + \frac {1}{2} \| \vec {K} \| _ {1}\right). \tag {33} +$$ + +Proof. First we prove Equation (32) for full-batched settings. Conditioned at $t$ -th iteration, with Assumption 1, we have + +$$ +\begin{array}{l} L _ {S} (\mathbf {w} _ {t + 1}) - L _ {S} (\mathbf {w} _ {t}) \leq \nabla L _ {S} (\mathbf {w} _ {t}) ^ {T} (\mathbf {w} _ {t + 1} - \mathbf {w} _ {t}) + \frac {1}{2} \sum_ {i = 1} ^ {d} K _ {i} (\mathbf {w} _ {t + 1, i} - \mathbf {w} _ {t, i}) ^ {2} \\ = - \eta_ {t} \nabla L _ {S} (\mathbf {w} _ {t}) ^ {T} \pmb {\xi} _ {t} + \eta_ {t} ^ {2} \sum_ {i = 1} ^ {d} \frac {K _ {i}}{2}. \\ \end{array} +$$ + +Then taking conditional expectation on both side for above equation we have + +$$ +\begin{array}{l} \mathbb {E} \left[ L _ {S} \left(\mathbf {w} _ {t + 1}\right) - L _ {S} \left(\mathbf {w} _ {t}\right) \mid \mathbf {w} _ {t} \right] \leq - \eta_ {t} \nabla L _ {S} \left(\mathbf {w} _ {t}\right) ^ {T} \mathbb {E} _ {\boldsymbol {\xi} _ {t} \mid \mathbf {w} _ {t}} \boldsymbol {\xi} _ {t} + \frac {\eta_ {t} ^ {2}}{2} \| \vec {K} \| _ {1} \\ = - \eta_ {t} \sum_ {i} \nabla L _ {S} (\mathbf {w} _ {t}) _ {i} \left(\frac {2}{1 + \exp (- 2 \nabla L _ {S} (\mathbf {w} _ {t}) _ {i} / \alpha_ {t})} - 1\right) + \frac {\eta_ {t} ^ {2}}{2} \| \vec {K} \| _ {1} \\ = - \eta_ {t} \sum_ {i} \nabla L _ {S} (\mathbf {w} _ {t}) _ {i} \left(\frac {\exp \left(2 \nabla L _ {S} (\mathbf {w} _ {t}) _ {i} / \alpha_ {t}\right) - 1}{\exp \left(2 \nabla L _ {S} (\mathbf {w} _ {t}) _ {i} / \alpha_ {t}\right) + 1}\right) + \frac {\eta_ {t} ^ {2}}{2} \| \vec {K} \| _ {1} \\ = - \eta_ {t} \sum_ {i} \nabla L _ {S} (\mathbf {w} _ {t}) _ {i} \tanh (\nabla L _ {S} (\mathbf {w} _ {t}) _ {i} / \alpha_ {t}) + \frac {\eta_ {t} ^ {2}}{2} \| \vec {K} \| _ {1} \\ = - \eta_ {t} \sum_ {i} | \nabla L _ {S} (\mathbf {w} _ {t}) _ {i} | | \operatorname {t a n h} (\nabla L _ {S} (\mathbf {w} _ {t}) _ {i} / \alpha_ {t}) | + \frac {\eta_ {t} ^ {2}}{2} \| \vec {K} \| _ {1}. \\ \end{array} +$$ + +By taking $c\geq \alpha_{t}\geq \| \nabla L_{S}(\mathbf{w}_{t})\|_{\infty}$ , and $\eta_t = 1 / \sqrt{T}$ , we have $\nabla L_S(\mathbf{w}_t)_i / \alpha_t\leq 1$ so we can apply Lemma 7 to have + +$$ +\begin{array}{l} \mathbb {E} \left[ L _ {S} \left(\mathbf {w} _ {t + 1}\right) - L _ {S} \left(\mathbf {w} _ {t}\right) \mid \mathbf {w} _ {t} \right] \leq - \frac {e ^ {2} - 1}{\left(e ^ {2} + 1\right) \alpha_ {t} \sqrt {T}} \| \nabla L _ {S} \left(\mathbf {w} _ {t}\right) \| _ {2} ^ {2} + \frac {1}{2 T} \| \vec {K} \| _ {1} \\ \leq - \frac {3}{5 c \sqrt {T}} \| \nabla L _ {S} (\mathbf {w} _ {t}) \| _ {2} ^ {2} + \frac {1}{2 T} \| \vec {K} \| _ {1}. \\ \end{array} +$$ + +By telescope sum we have + +$$ +\mathbb {E} \left[ \frac {1}{T} \sum_ {t = 1} ^ {T} \| \nabla L _ {S} (\mathbf {w} _ {t}) \| _ {2} ^ {2} \right] \leq \frac {5 c}{3 \sqrt {T}} \left(L _ {S} (\mathbf {w} _ {0}) - L _ {S} (\mathbf {w} ^ {*}) + \frac {1}{2} \| \vec {K} \| _ {1}\right), +$$ + +which completes the proof of full-batch updates. + +Then we turn to prove Equation (33) for mini-batch settings. From smoothness condition Assumption 1, we have + +$$ +\begin{array}{l} \mathbb {E} \left[ L _ {S} (\mathbf {w} _ {t + 1}) - L _ {S} (\mathbf {w} _ {t}) | \mathbf {w} _ {t} \right] \leq \mathbb {E} _ {\mathbf {w} _ {t + 1} | \mathbf {w} _ {t}} \nabla L _ {S} (\mathbf {w} _ {t}) ^ {T} (\mathbf {w} _ {t + 1} - \mathbf {w} _ {t}) + \frac {1}{2} \mathbb {E} _ {\mathbf {w} _ {t + 1} | \mathbf {w} _ {t}} \sum_ {i = 1} ^ {d} L _ {i} (\mathbf {w} _ {t + 1, i} - \mathbf {w} _ {t, i}) ^ {2} \\ = \mathbb {E} _ {\boldsymbol {\xi} _ {t} | \mathbf {w} _ {t}} \nabla L _ {S} (\mathbf {w} _ {t}) ^ {T} (- \eta_ {t} \boldsymbol {\xi} _ {t}) + \frac {1}{2} \mathbb {E} _ {\boldsymbol {\xi} _ {t} | \mathbf {w} _ {t}} \sum_ {i = 1} ^ {d} L _ {i} (- \eta_ {t} \boldsymbol {\xi} _ {t}) ^ {2} \\ = - \eta_ {t} \nabla L _ {S} (\mathbf {w} _ {t}) ^ {T} \mathbb {E} _ {\boldsymbol {\xi} _ {t} | \mathbf {w} _ {t}} \boldsymbol {\xi} _ {t} + \frac {\eta_ {t} ^ {2}}{2} \| \vec {K} \| _ {1} \\ = - \eta_ {t} \sum_ {i} \nabla L _ {S} (\mathbf {w} _ {t}) _ {i} \mathbb {E} _ {B _ {t} | \mathbf {w} _ {t}} \left[ \frac {2}{1 + \exp \left(- 2 \nabla_ {i} \ell \left(\mathbf {w} _ {t} , S _ {B _ {t}} / \alpha_ {t}\right)\right)} - 1 \right] + \frac {\eta_ {t} ^ {2}}{2} \| \vec {K} \| _ {1} \\ = - \eta_ {t} \sum_ {i} \nabla L _ {S} (\mathbf {w} _ {t}) _ {i} \mathbb {E} _ {B _ {t} | \mathbf {w} _ {t}} \left[ \frac {\exp \left(2 \nabla_ {i} \ell \left(\mathbf {w} _ {t} , S _ {B _ {t}}\right) / \alpha_ {t}\right) - 1}{\exp \left(2 \nabla_ {i} \ell \left(\mathbf {w} _ {t} , S _ {B _ {t}}\right) / \alpha_ {t}\right) + 1} \right] + \frac {\eta_ {t} ^ {2}}{2} \| \vec {K} \| _ {1} \\ = - \eta_ {t} \sum_ {i} \mathbb {E} _ {B _ {t} | \mathbf {w} _ {t}} \left[ \theta_ {B _ {t}, i} \right] \mathbb {E} \left[ \frac {\exp \left(2 \theta_ {B _ {t} , i} / \alpha_ {t}\right) - 1}{\exp \left(2 \theta_ {B _ {t} , i} / \alpha_ {t}\right) + 1} \right] + \frac {\eta_ {t} ^ {2}}{2} \| \vec {K} \| _ {1}. \\ \end{array} +$$ + +Focus on each individual term in the sum, we have + +$$ +\begin{array}{l} \mathbb {E} _ {B _ {t} | \mathbf {w} _ {t}} [ \theta_ {B, i} ] \mathbb {E} _ {B _ {t} | \mathbf {w} _ {t}} \left[ \frac {\exp \left(2 \theta_ {B _ {t} , i} / \alpha_ {t}\right) - 1}{\exp \left(2 \theta_ {B _ {t} , i} / \alpha_ {t}\right) + 1} \right] \\ = \mathbb {E} _ {B _ {t} | \mathbf {w} _ {t}} \left[ \theta_ {B _ {t}, i} \right] \mathbb {E} _ {B _ {t} | \mathbf {w} _ {t}} \left[ \frac {\exp \left(2 \theta_ {B _ {t} , i} / \alpha_ {t} - 2 \mathbb {E} _ {B _ {t} | \mathbf {w} _ {t}} \left[ \theta_ {B _ {t} , i} / \alpha_ {t} \right]\right) - \exp - 2 \mathbb {E} _ {B _ {t} | \mathbf {w} _ {t}} \theta_ {B _ {t} , i} / \alpha_ {t}}{\exp \left(2 \theta_ {B _ {t} , i} / \alpha_ {t} - 2 \mathbb {E} _ {B _ {t} | \mathbf {w} _ {t}} \left[ \theta_ {B _ {t} , i} / \alpha_ {t} \right]\right) + \exp - 2 \mathbb {E} _ {B _ {t} | \mathbf {w} _ {t}} \theta_ {B _ {t} , i} / \alpha_ {t}} \right] \\ \end{array} +$$ + +For ease of notation, denote $2\theta_{B,i} / \alpha_t - \mathbb{E}_{B_t|\mathbf{w}_t}[2\theta_{B,i} / \alpha_t] = \theta$ , $\mathbb{E}_{B_t|\mathbf{w}_t}[2\theta_{B,i} / \alpha_t] = \mu$ , and the pdf of $\theta$ is $p_\theta$ for the moment, then from Assumption 2, we have $\theta$ is mean zero, symmetric around zero, and subgaussian with $\psi_2$ norm $2\kappa_t / \alpha_t$ by taking $\lambda = 1$ , $v = \mathbb{1}_i$ in the sub-Gaussian assumption: $\mathbb{E}_{\theta}[\exp \theta] \leq \exp(2\kappa_t^2 / \alpha_t^2)$ . + +Therefore, by changing notation we have + +$$ +\mathbb {E} _ {B _ {t} | \mathbf {w} _ {t}} [ \theta_ {B, i} ] \mathbb {E} _ {B _ {t} | \mathbf {w} _ {t}} \left[ \frac {\exp {(2 \theta_ {B _ {t} , i} / \alpha_ {t})} - 1}{\exp {(2 \theta_ {B _ {t} , i} / \alpha_ {t})} + 1} \right] = \frac {\alpha_ {t} \mu}{2} \mathbb {E} _ {\theta} \left[ \frac {\exp {\theta} - \exp (- \mu)}{\exp {\theta} + \exp (- \mu)} \right]. +$$ + +By symmetry of the distribution of $\theta$ , we have + +$$ +\begin{array}{l} \frac {\alpha_ {t} \mu}{2} \mu \mathbb {E} _ {\theta} \left[ \frac {\exp \theta - \exp (- \mu)}{\exp \theta + \exp (- \mu)} \right] \\ = \frac {\alpha_ {t} \mu}{2} \int_ {- \infty} ^ {\infty} p _ {\theta} (x) \left[ \frac {\exp x - \exp (- \mu)}{\exp x + \exp (- \mu)} \right] d x \\ = \frac {\alpha_ {t} \mu}{2} \int_ {0} ^ {\infty} p _ {\theta} (x) \left[ \frac {\exp x - \exp (- \mu)}{\exp x + \exp (- \mu)} + \frac {\exp (- x) - \exp (- \mu)}{\exp (- x) + \exp (- \mu)} \right] d x \\ = \frac {\alpha_ {t} \mu}{2} \int_ {0} ^ {\infty} p _ {\theta} (x) \frac {(\exp x - \exp (- \mu)) (\exp (- x) + \exp (- \mu)) + (\exp (- x) - \exp (- \mu)) (\exp x + \exp (- \mu))}{(\exp x + \exp (- \mu)) (\exp (- x) + \exp (- \mu))} d x \\ = \alpha_ {t} / 2 \int_ {0} ^ {\infty} p _ {\theta} (x) \frac {2 \mu (1 - \exp (- 2 \mu))}{(\exp x + \exp (- \mu)) (\exp (- x) + \exp (- \mu))} d x \\ \end{array} +$$ + +By symmetry, we have $p_{\theta}(x) = p_{\theta}(-x)$ , and therefore + +$$ +\begin{array}{l} \alpha_ {t} / 2 \int_ {0} ^ {\infty} p _ {\theta} (x) \frac {2 \mu (1 - \exp (- 2 \mu))}{(\exp x + \exp (- \mu)) (\exp (- x) + \exp (- \mu))} d x \\ = \alpha_ {t} / 2 \int_ {- \infty} ^ {\infty} p _ {\theta} (x) \frac {\mu (1 - \exp (- 2 \mu))}{(\exp x + \exp (- \mu)) (\exp (- x) + \exp (- \mu))} d x \\ = \frac {\alpha_ {t}}{2} (\mu (1 - \exp (- 2 \mu))) \mathbb {E} _ {\theta} \frac {1}{(\exp \theta + \exp (- \mu)) (\exp (- \theta) + \exp (- \mu))} \\ \end{array} +$$ + +Since $\frac{\alpha_t}{2} (\mu (1 - \exp (-2\mu)))\geq 0$ , and $\frac{1}{x}$ is convex on $\mathbb{R}_+$ , we have + +$$ +\begin{array}{l} \frac {\alpha_ {t}}{2} (\mu (1 - \exp (- 2 \mu))) \mathbb {E} _ {\theta} \frac {1}{(\exp \theta + \exp (- \mu)) (\exp (- \theta) + \exp (- \mu))} \\ \geq \frac {\alpha_ {t}}{2} (\mu (1 - \exp (- 2 \mu))) \frac {1}{\mathbb {E} _ {\theta} (\exp \theta + \exp (- \mu)) (\exp (- \theta) + \exp (- \mu))}. \\ \end{array} +$$ + +Using the sub-Gaussian property of $\theta$ : $\mathbb{E}_{\theta}[\exp \theta] \leq \exp(2\kappa_{t}^{2}/\alpha_{t}^{2})$ , and symmetry so $\mathbb{E}_{\theta}[\exp(-\theta)] \leq \exp(2\kappa_{t}^{2}/\alpha_{t}^{2})$ , we have + +$$ +\begin{array}{l} \frac {\alpha_ {t}}{2} (\mu (1 - \exp (- 2 \mu))) \frac {1}{\mathbb {E} _ {\theta} (\exp \theta + \exp (- \mu)) (\exp (- \theta) + \exp (- \mu))} \\ = \frac {\alpha_ {t}}{2} (\mu (1 - \exp (- 2 \mu))) \frac {1}{1 + \exp (- 2 \mu) + \exp (- \mu) (\mathbb {E} \exp \theta + \mathbb {E} \exp (- \theta))} \\ \geq \frac {\alpha_ {t}}{2} (\mu (1 - \exp (- 2 \mu))) \frac {1}{1 + \exp (- 2 \mu) + 2 \exp (- \mu) \exp (2 \kappa_ {t} ^ {2} / \alpha_ {t} ^ {2})} \\ \geq \frac {\alpha_ {t}}{2} (\mu (1 - \exp (- 2 \mu))) \frac {1}{2 + 2 \exp (2 \kappa_ {t} ^ {2} / \alpha_ {t} ^ {2})}. \\ \end{array} +$$ + +Switching back to our previous notation: + +$$ +\begin{array}{l} \frac {\alpha_ {t}}{2} (\mu (1 - \exp (- 2 \mu))) \frac {1}{2 + 2 \exp (2 \kappa_ {t} ^ {2} / \alpha_ {t} ^ {2})} = \mathbb {E} _ {B _ {t} | \mathbf {w} _ {t}} \theta_ {B, i} (1 - \exp (- 4 \mathbb {E} _ {B _ {t} | \mathbf {w} _ {t}} \theta_ {B, i} / \alpha_ {t})) \frac {1}{2 + 2 \exp (2 \kappa_ {t} ^ {2} / \alpha_ {t} ^ {2})} \\ = \nabla L _ {S} (\mathbf {w} _ {t}) _ {i} (1 - \exp (- 4 \nabla L _ {S} (\mathbf {w} _ {t}) _ {i} / \alpha_ {t})) \frac {1}{2 + 2 \exp (2 \kappa_ {t} ^ {2} / \alpha_ {t} ^ {2})}, \\ \end{array} +$$ + +which implies we have + +$$ +\mathbb {E} [ L _ {S} (\mathbf {w} _ {t + 1}) - L _ {S} (\mathbf {w} _ {t}) | \mathbf {w} _ {t} ] \leq - \frac {\eta_ {t}}{2 + 2 \exp (2 \kappa_ {t} ^ {2} / \alpha_ {t} ^ {2})} \sum_ {i} \nabla L _ {S} (\mathbf {w} _ {t}) _ {i} (1 - \exp (- 4 \nabla L _ {S} (\mathbf {w} _ {t}) _ {i} / \alpha_ {t})) + \frac {\eta_ {t} ^ {2}}{2} \| \vec {K} \| _ {1}. +$$ + +Using Lemma 8, we have + +$$ +\mathbb {E} \left[ L _ {S} \left(\mathbf {w} _ {t + 1}\right) - L _ {S} \left(\mathbf {w} _ {t}\right) \mid \mathbf {w} _ {t} \right] \leq - \frac {\eta_ {t}}{2 \left(1 + \exp \left(2 \kappa_ {t} ^ {2} / \alpha_ {t} ^ {2}\right)\right)} \sum_ {i} | \nabla L _ {S} (\mathbf {w} _ {t}) _ {i} | \min \left[ \left| 2 \nabla L _ {S} (\mathbf {w} _ {t}) _ {i} / \alpha_ {t} \right|, 0. 5 \right] + \frac {\eta_ {t} ^ {2}}{2} \| \vec {K} \| _ {1}. \tag {34} +$$ + +We choose $\alpha_{t}$ such that $\alpha_{t} \geq 4\|\nabla L_{S}(\mathbf{w}_{t})\|_{\infty}$ , then we have + +$$ +\mathbb {E} \left[ L _ {S} \left(\mathbf {w} _ {t + 1}\right) - L _ {S} \left(\mathbf {w} _ {t}\right) \mid \mathbf {w} _ {t} \right] \leq - \frac {\eta_ {t}}{\alpha_ {t} \left(1 + \exp \left(2 \kappa_ {t} ^ {2} / \alpha_ {t} ^ {2}\right)\right)} \| \nabla L _ {S} \left(\mathbf {w} _ {t}\right) \| _ {2} ^ {2} + \frac {\eta_ {t} ^ {2}}{2} \| \vec {K} \| _ {1}. \tag {35} +$$ + +We choose $\alpha_{t}$ such that $c\geq \alpha_t\geq \max [\sqrt{2}\kappa_t,4\| \nabla L_S(\mathbf{w}_t)\|_\infty ]$ , then we have + +$$ +\mathbb {E} \left[ L _ {S} \left(\mathbf {w} _ {t + 1}\right) - L _ {S} \left(\mathbf {w} _ {t}\right) \mid \mathbf {w} _ {t} \right] \leq - \frac {\eta_ {t}}{c (1 + e)} \| \nabla L _ {S} \left(\mathbf {w} _ {t}\right) \| _ {2} ^ {2} + \frac {\eta_ {t} ^ {2}}{2} \| \vec {K} \| _ {1}. \tag {36} +$$ + +Therefore, if we choose $\eta_t = 1 / \sqrt{T}$ , we have + +$$ +\mathbb {E} \left[ L _ {S} \left(\mathbf {w} _ {t + 1}\right) - L _ {S} \left(\mathbf {w} _ {t}\right) \mid \mathbf {w} _ {t} \right] \leq - \frac {1}{c (1 + e) \sqrt {T}} \| \nabla L _ {S} \left(\mathbf {w} _ {t}\right) \| _ {2} ^ {2} + \frac {1}{2 T} \| \vec {K} \| _ {1}. \tag {37} +$$ + +By telescope sum, we have + +$$ +\mathbb {E} \left[ \frac {1}{T} \sum_ {t = 1} ^ {T} \| \nabla L _ {S} (\mathbf {w} _ {t}) \| _ {2} ^ {2} \right] \leq \frac {(1 + e) c}{\sqrt {T}} \left(L _ {S} (\mathbf {w} _ {0}) - L _ {S} (\mathbf {w} ^ {*}) + \frac {1}{2} \| \vec {K} \| _ {1}\right). \tag {38} +$$ + +With $\mathbf{w}_R$ to be uniformly randomly sampled from $\{\mathbf{w}_1, \dots, \mathbf{w}_T\}$ , we have + +$$ +\mathbb {E} \| \nabla L _ {S} (\mathbf {w} _ {R}) \| _ {2} ^ {2} \leq \frac {(1 + e) c}{\sqrt {T}} \left(L _ {S} (\mathbf {w} _ {0}) - L _ {S} (\mathbf {w} ^ {*}) + \frac {1}{2} \| \vec {K} \| _ {1}\right), \tag {39} +$$ + +and note that $1 + e < 4$ which completes the proof. + +Lemma 7. For any $-1\leq x\leq 1$ , the following holds: + +$$ +| \tanh x | \geq \frac {e ^ {2} - 1}{e ^ {2} + 1} | x | \tag {40} +$$ + +Proof. Without loss of generality, we focus on $0 < x \leq 1$ . We prove $\tanh x / x$ is decreasing function on $\mathbb{R}^+$ , which is equivalent to + +$$ +(\frac {\tanh x}{x}) ^ {\prime} = \frac {x (1 - \tanh ^ {2} x) - \tanh x}{x ^ {2}} \leq 0, +$$ + +and is equivalent to + +$$ +x \leq \frac {\tanh x}{1 - \tanh ^ {2} x}, +$$ + +where the right hand side is $\sinh x$ and use the fact that $x\leq \sinh x$ for $x > 0$ implies $\tanh x / x$ is decreasing function, so + +$$ +\tanh x / x \geq \tanh 1 = \frac {e ^ {2} - 1}{e ^ {2} + 1}, +$$ + +which completes the proof. + +![](images/21276e29369431568e5a57c84aa574eb197f8e1cd92fad1bb4f8b09a54a0051c.jpg) + +Lemma 8. For any $x$ , + +$$ +\left| 1 - \exp (- 2 x)\right) | \geq \min (\left| x \right|, \frac {1}{2}). +$$ + +Proof. Since $\exp(-x) \geq 1 - x$ , so we have for $x < 0$ : + +$$ +1 - \exp (- 2 x) \leq 2 x \leq x. +$$ + +For $x > 0$ , since $\exp x \geq 1 + x$ , we have $\exp - x \leq \frac{1}{1 + x}$ , so + +$$ +1 - \exp (- 2 x) \geq \frac {2 x}{1 + 2 x}. +$$ + +Then when $\frac{1}{2} > x > 0$ , + +$$ +\frac {2 x}{1 + 2 x} > x, +$$ + +and when $x\geq \frac{1}{2}$ + +$$ +\frac {2 x}{1 + 2 x} \geq \frac {1}{2}, +$$ + +which completes the proof. + +Theorem 4. The following holds for any $S$ , any initialization $\mathbf{w}_0$ , and the expectation is taken over the randomness of algorithm: under Assumptions 1 and 2 with $K_{i} = K, \forall i \in [p]$ , SGLD, i.e., EFLD with Gaussian noise, $\rho_{t} = \eta_{t}$ , $\alpha_{t} = \sigma_{t} / \eta_{t}$ and step size $\eta_{t} = \frac{1}{\sqrt{T}}$ satisfies + +$$ +\mathbb {E} \| \nabla L _ {S} (\mathbf {w} _ {R}) \| ^ {2} \leq O \left(\frac {1}{\sqrt {T}}\right) + O \left(\frac {\frac {K}{2 T} \sum_ {t = 1} ^ {T} \left(p \alpha_ {t} ^ {2} + \kappa_ {t} ^ {2}\right)}{\sqrt {T}}\right), +$$ + +where $\mathbf{w}_R$ is uniformly randomly sampled from $\{\mathbf{w}_t\}_{t=1}^T$ . + +Proof. Recall that the update of SGLD is + +$$ +\mathbf {w} _ {t + 1} = \mathbf {w} _ {t} - \eta_ {t} \nabla \ell \left(\mathbf {w} _ {t}, S _ {B _ {t}}\right) + \sigma_ {t} \mathcal {N} (0, \mathbb {I} _ {d}). \tag {41} +$$ + +By smoothness of the loss, taking expectation w.r.t. the randomness of the mini-batch $B_{t}$ and the Gaussian draw $\mathbf{g}_t \sim \mathcal{N}(0,\mathbb{I}_d)$ conditioned on $\mathbf{w}_{1:t}$ , we have + +$$ +\begin{array}{l} \mathbb {E} \left[ L _ {S} \left(\mathbf {w} _ {t + 1}\right) \right] \leq L _ {S} \left(\mathbf {w} _ {t}\right) + \mathbb {E} \left[ \left\langle \nabla L _ {S} \left(\mathbf {w} _ {t}\right), \mathbf {w} _ {t + 1} - \mathbf {w} _ {t} \right\rangle \right] + \frac {K}{2} \mathbb {E} \left[ \left\| \mathbf {w} _ {t + 1} - \mathbf {w} _ {t} \right\| ^ {2} \right] \\ = L _ {S} \left(\mathbf {w} _ {t}\right) + \mathbb {E} \left[ \left\langle \nabla L _ {S} \left(\mathbf {w} _ {t}\right), - \eta_ {t} \nabla \ell \left(\mathbf {w} _ {t}, S _ {B _ {t}}\right) + \sigma_ {t} \mathbf {g} _ {t} \right\rangle \right] + \frac {K}{2} \mathbb {E} \left[ \| - \eta_ {t} \nabla \ell \left(\mathbf {w} _ {t}, S _ {B _ {t}}\right) + \sigma_ {t} \mathbf {g} _ {t} \| ^ {2} \right] \\ \stackrel {(a)} {\leq} L _ {S} (\mathbf {w} _ {t}) - \eta_ {t} \| \nabla L _ {S} (\mathbf {w} _ {t}) \| ^ {2} + \frac {K \eta_ {t} ^ {2}}{2} \left(c _ {3} \kappa_ {t} ^ {2} + p \sigma_ {t} ^ {2} / \eta_ {t} ^ {2}\right), \\ \end{array} +$$ + +where (a) follows since $\mathbb{E}[\nabla \ell (\mathbf{w}_t,S_{B_t})] = 0,\mathbb{E}[\mathbf{g}] = 0,\mathbb{E}[\| \mathbf{g}\| ^2 ] = p$ , and $\mathbb{E}[\| \nabla \ell (\mathbf{w}_t,S_{B_t})\| ^2 ]\leq c_3\kappa_t^2$ for some absolute constant $c_{3}$ since $\nabla \ell (\mathbf{w}_t,S_{B_t})$ is sub-Gaussian with $\psi_{2}$ -norm $\kappa_{t}$ + +Rearranging the above inequality and using $\alpha_{t} = \sigma_{t} / \eta_{t}$ we have + +$$ +\eta_ {t} \| \nabla L _ {S} (\mathbf {w} _ {t}) \| ^ {2} \leq L _ {S} (\mathbf {w} _ {t}) - \mathbb {E} [ L _ {S} (\mathbf {w} _ {t + 1}) ] + \frac {K \eta_ {k} ^ {2}}{2} \left(c _ {3} \kappa_ {t} ^ {2} + p \alpha_ {t} ^ {2}\right). \tag {42} +$$ + +Summing over $t = 1$ to $t = T$ and apply expectation over the trajectory at each step, we have + +$$ +\sum_ {t = 1} ^ {T} \eta_ {t} \mathbb {E} \| \nabla L _ {S} (\mathbf {w} _ {t}) \| ^ {2} \leq L _ {S} (\mathbf {w} _ {1}) - L _ {S} (\mathbf {w} ^ {\star}) + \sum_ {t = 1} ^ {T} \frac {K \eta_ {t} ^ {2}}{2} (p \alpha_ {t} ^ {2} + \kappa_ {t} ^ {2}), +$$ + +where $\mathbf{w}^*$ is a minima of $L_{S}(\mathbf{w})$ . With $\eta_t = \frac{1}{\sqrt{T}}$ for all $t \in [T]$ , we have + +$$ +\frac {1}{T} \sum_ {t = 1} ^ {T} \mathbb {E} \| \nabla L _ {S} (\mathbf {w} _ {t}) \| ^ {2} \leq \frac {L _ {S} (\mathbf {w} _ {1}) - L _ {S} (\mathbf {w} ^ {\star})}{\sqrt {T}} + \frac {\frac {K}{2 T} \sum_ {t = 1} ^ {T} (p \alpha_ {t} ^ {2} + c _ {3} \kappa_ {t} ^ {2})}{\sqrt {T}}. +$$ + +With $\mathbf{w}_R$ to be uniformly randomly sampled from $\{\mathbf{w}_1, \dots, \mathbf{w}_T\}$ , we have + +$$ +\mathbb {E} \| \nabla L _ {S} (\mathbf {w} _ {R}) \| ^ {2} \leq \frac {L _ {S} (\mathbf {w} _ {1}) - L _ {S} (\mathbf {w} ^ {\star})}{\sqrt {T}} + \frac {\frac {K}{2 T} \sum_ {t = 1} ^ {T} (p \alpha_ {t} ^ {2} + c _ {3} \kappa_ {t} ^ {2})}{\sqrt {T}}. +$$ + +That completes the proof. + +# E. Experiment Details + +# E.1. Datasets + +We use MNIST (LeCun et al., 1998), Fashion-MNIST (Xiao et al., 2017), CIFAR-10 (Krizhevsky, 2009) and CIFAR-100 (Krizhevsky, 2009) in our experiments. + +MNIST dataset: 60,000 black and white training images, including handwritten digits 0 to 9. We use a subset of MNIST with $n = 10,000$ data points where 1,000 samples from each class are randomly selected. Each image of size $28 \times 28$ is first re-scaled into [0,1] by dividing each pixel value by 255, then z-scored by subtracting the mean and dividing the standard deviation of the training set. + +Fashion-MNIST dataset: 60,000 gray-scale training images and 10,000 test images, including 10 clothing categories such as shirts, dresses, sandals, etc. Each image of size $28 \times 28$ is first re-scaled into [0,1] by dividing each pixel value by 255, then z-scored by subtracting the mean and dividing the standard deviation of the training set. + +CIFAR-10/-100 dataset: 60,000 color images consisting of 10/100 categories, e.g., airplane, cat, dog etc. The training set includes 50,000 images while the test set contains the rest 10,000 images. Each image of size $32 \times 32$ has 3 color channels. We first re-scale each image into [0, 1] by dividing each pixel value by 255, then each image is normalized by subtracting the mean and dividing the standard deviation of the training set for each color channel. We also use RandomCrop and RandomHorizontalFlip for data augmentation. + +# E.2. Network Architectures + +For experiments on both MNIST and Fashion-MNIST, we use a convolutional neural network with two convolutional layers followed by two fully connected layers with ReLU activations. For experiments use the CIFAR-10 dataset, we consider CNN architecture with two convolutional layers and three fully connected layers. The detail of each CNN architecture can be found in Table 1 and Table 2. + +Table 1. CNN architecture for MNIST and Fashion MNIST. + +
LayerParameters
Convolution32 filters of 5 × 5
Max-Pooling2 × 2
Convolution64 filters of 5 × 5
Max-Pooling2 × 2
Fully connected1024 units
Softmax10 units
+ +# E.3. Experimental Setup + +We are interested in stochastic gradient Langevin dynamics, whose iterative updates are given by $\mathbf{w}_t = \mathbf{w}_{t-1} - \eta_t \nabla \ell(\mathbf{w}_{t-1}, S_{B_t}) + \mathcal{N}(0, \sigma_t^2 \mathbb{I}_d)$ . We also denote $\beta_t = 2\eta_t / \sigma_t^2$ as the inverse temperature at time $t$ . For MNIST and + +Table 2. CNN architecture for CIFAR-10. + +
LayerParameters
Convolution64 filters of 5 × 5
Max-Pooling2 × 2
Convolution192 filters of 5 × 5
Max-Pooling2 × 2
Fully connected384 units
Fully connected192 units
Softmax10 units
+ +Fashion-MNIST, the initial learning rate is $\eta_0 = 0.004$ and it decays by 0.96 after every 5 epochs. For CIFAR-10, the initial learning rate is $\eta_0 = 0.005$ and it decays by 0.995 after every 5 epochs. We use batch size $|B_t| = 100$ for MNIST and Fashion-MNIST, and $|B_t| = 200$ for CIFAR-10. + +Motivated by (Zhang et al., 2017), we train CNN with SGLD on a smaller subset of MNIST dataset ( $n = 10000$ ) with randomly corrupted labels. The corruption fraction varies from $0\%$ (without label corruption) to $60\%$ . For different level of randomness, we use the same training setting with batch size $|B_t| = 100$ , initial step size $\eta_0 = 0.005$ , noise variance $\sigma_t = 0.2 \cdot \eta_t$ , and we decay $\eta_t$ by 0.995 for every 30 epochs. + +We are also interested in Noisy Sign-SGD whose iterative updates are given by $\mathbf{w}_{t + 1} = \mathbf{w}_t - \eta_t\pmb {\xi}_t$ , where $\pmb{\xi}_{t,j}\sim p_{\pmb{\theta}_{B_t,\alpha_t,j}}(\xi_j) = \frac{\exp(\xi_j\pmb{\theta}_{B_t,\alpha_t})}{\exp(-\pmb{\theta}_{B_t,\alpha_t}) + \exp(\pmb{\theta}_{B_t,\alpha_t})}$ . The initial learning rate is $\eta_0 = 10^{-4}$ and it decays by 0.1 after every 30 epochs. We use batch size $|B_{t}| = 100$ for all benchmarks. + +All experiments minimize cross-entropy loss for a fixed number of epochs and have been run on NVIDIA Tesla K40m GPUs. For CNN, we repeat each experiment 30 times, and for ResNet-18, we repeat 5 times. + +# E.4. Evaluation of the bound in Theorem 2 + +Estimation of $c_{0}$ in Proposition 1. Something similar to $c_{0}$ exists in all prior bounds, e.g., see Lemma 1 of Xu & Raginsky (2017), Theorem 9 in Li et al. (2020), etc. If the loss is bounded, then one can get $c_{0}$ , but in general, it is difficult. Empirically, we chose $c_{0}$ based on maximum observed training loss for our bound as well as baseline approaches. + +Computation of $\Delta_t^2 (\bar{S}_{n + 1})$ and the expectation over $S_{n + 1}$ in Theorem 2. We start with the uniform analysis. Let $L$ be the Lipschitz constant so $\| \nabla \ell (w,z)\| _2\leq L$ . Then $\Delta_{t|}(\bar{S}_{n + 1})\leq 2L$ . So, suffices to have $\alpha_{t} = 4\sqrt{2} c_{2}L$ . This will always work if $L$ is known or ensured using gradient clipping. + +More generally, for any given $\bar{S}_{n+1}$ , $\Delta_{t|}(\bar{S}_{n+1})$ can be computed by definition from Theorem 1 by taking the maximum discrepancy over all $\binom{n+1}{2}$ pairs of points in $\bar{S}_{n+1}$ . The argmax for the discrepancy will arguably have $z \in S_n$ and $z' = z_{n+1}$ , which simplifies the argmax to just consider $n$ pairs rather than $\binom{n+1}{2}$ . We verified and used this simpler calculation for the experiments. + +The expectation over $\bar{S}_{n+1}$ is hard to compute but (re)sampling based estimates can be used. The term entails sampling $\bar{S}_{n+1}$ , running the training with $n$ samples $S_{n}$ , using $z_{n+1}$ to compute the discrepancy. To get Monte Carlo estimates, the analysis has to be repeated for different $z_{n+1}$ (done in the main paper) or by resampling $(S_{n}, z_{n+1})$ , and computing the average which we show in Figure 5 (a). The estimates are shown to have rather low variance. + +Dependence of the bound on batchsize $b$ . Our bound in Theorem 2 does not have a dependence on $b$ , because of what Remark 3.2 shows, i.e., the $1 / b$ scale factor neutralizes the leading b term in Lemma 1. The gradient discrepancy term itself may have a mild dependence on $b$ , with smaller batch sizes having mildly smaller empirical gradient discrepancy as shown in Figure 5 (b). + +![](images/5f8c9110447e808e066438347ba6f41600b9585067a8004dea885abe970f8d15.jpg) +(a) Estimates of $\Delta_t^2 (\bar{S}_{n + 1})$ + +![](images/cf632829f5de5af316730942658f44553b32af93ff7fe34ee362dba7e5229c92.jpg) +(b) Effect of batch size +Figure 5. Results for training CNN using SGLD on MNIST. (a) Estimation of $\Delta_t^2 (\bar{S}_{n + 1})$ using re-sampled $(S_{n},z_{n + 1})$ . The variance of such estimation is small. (b) The gradient discrepancy for different batch sizes. Overall, the differences are not significant. + +Table 3. Details of Experiments reported in Figure 1 and 6 for MNIST and Fashion-MNIST with CNN + +
ParameterValues
DatasetMNIST/ Fashion-MNIST
ArchitectureCNN with 2 conv. layers and 2 linear layers
Batch Size100
Learning Rateη0=4×10-3, decay epochs=5, decay rate=0.96
Inverse Temperatureβ∈[5000, 55000]
Number of Epochs50
No. of training examples55000
Number of Repeated Runs30
+ +Table 4. Details of Experiments reported in Figure 1 and 7 for CIFAR-10 with CNN + +
ParameterValues
DatasetCIFAR-10
ArchitectureCNN with 2 conv. layers and 3 linear layers
Batch Size200
Learning Rateη0=5×10-3, decay epochs=5, decay rate=0.995
Inverse Temperatureβ∈[5000, 55000]
Number of Epochs1000
No. of training examples55000
Number of Repeated Runs20
+ +Table 5. Details of Experiments reported in Figure 3 for MNIST with CNN $\left( {{\sigma }_{t} = {0.2} \cdot {\eta }_{t}}\right)$ + +
ParameterValues
DatasetMNIST
ArchitectureCNN with 2 conv. layers and 2 linear layers
Batch Size100
Learning Rateη0=5×10-3, decay epochs=30, decay rate=0.995
Number of Epochs1000
No. of training examples10000
Number of Repeated Runs30
+ +![](images/027abd7d0eeac1452b92a3ca46e86fa9aac64e367f79405819d8f8cb6f79f0b2.jpg) +(a) MNIST, $\alpha_{t}^{2}\approx 0.1$ $\beta_{t} = 55000$ + +![](images/648636a3398d0af663284a40cc58d379478009f0d6a4948c2cd06541bec53bf1.jpg) +(b) MNIST, $\alpha_{t}^{2}\approx 0.1,\beta_{t} = 5000$ + +![](images/ef24f05e64f697cf2581be5b8a472a6e36fae6e6e677178d989cab75f0f8c83d.jpg) +(c) MNIST, $\alpha_{t}^{2}\approx 0.1$ $\beta_{t} = 55000$ + +![](images/4217700013307e834e3bdc24b2421160241666adb38e276d7c0fa538da96bead.jpg) +(d) MNIST, $\alpha_{t}^{2}\approx 0.1,\beta_{t} = 5000$ + +![](images/8471d5d522f85683d917f9656eab3919ce907a0f204785c2dd6c824dde97bc17.jpg) +(e) MNIST, $\alpha_{t}^{2}\approx 0.1$ $\beta_{t} = 55000$ + +![](images/4ef5c9c418adace6144e7aa2ef762d4ab3065cf9883dde3ee608b7b2d4431274.jpg) +(f) MNIST, $\alpha_t^2\approx 0.1$ $\beta_{t} = 5000$ +Figure 6. Numerical results for CNN trained on MNIST using SGLD with a small noise variance $\sigma_t \approx 10^{-4}$ . + +![](images/9b119a2dfdcb43829fb23d841925943c1ccb8ad6c204d39433ddbc1b126232ec.jpg) +(a) CIFAR-10, $\alpha_{t}^{2}\approx 0.01$ $\beta_{t} = 55000$ + +![](images/0bd5ea5b8751838163892b29eb9e1cfd73458fe9971b4efb909301bbf640f33b.jpg) +(b) CIFAR-10, $\alpha_{t}^{2}\approx 0.1$ $\beta_{t} = 5000$ + +![](images/45f6c0d8bc55677aaa342129e1590bb91adcf88e89101bc66f99c0bfa4f5e065.jpg) +(c) CIFAR-10, $\alpha_{t}^{2}\approx 0.01$ $\beta_{t} = 55000$ + +![](images/3ec368c43956818698365ac5935d1b70f2112c91490e05aa24e42d09016c605b.jpg) +(d) CIFAR-10, $\alpha_t^2\approx 0.1$ $\beta_{t} = 5000$ + +![](images/405ef603de450ff139db871f9a2da247fb18d09be9fd42e042ea863bde5d5868.jpg) +(e) CIFAR-10, $\alpha_{t}^{2}\approx 0.01$ $\beta_{t} = 55000$ +Figure 7. Numerical results for training CNN using SGLD on CIFAR-10. + +![](images/8397c0bce7d7ef3358245272f58e2547cc133773174a9a7203f814d3461d5709.jpg) +(f) CIFAR-10, $\alpha_{t}^{2}\approx 0.1$ $\beta_{t} = 5000$ + +![](images/2564be8586109cbb884df8c4719187d4dcc403eb548a5c08730b835c61a1bbd4.jpg) +(a) CNN, MNIST, Noisy-SGD, $\alpha_{t} = 0.2$ , $\sigma_{t}\approx 10^{-4}$ + +![](images/05d6988b5d913dad0d274c9ac8785c238e1d8486d9d4223d9b6def940ac21b5c.jpg) + +![](images/9d3184742aaa172ac9d84251afbcf1b69464afc280336941738afd0f35ed0578.jpg) + +![](images/3595e19168cccf3c4f997cc35273a1790cf859c9fbbf6615da74f7858d3c1440.jpg) +(b) CNN, MNIST, Noisy-SGD, $\alpha_{t} = 0.002$ , $\sigma_{t}\approx 10^{-6}$ + +![](images/ab3748ea9d618c7090859557156d685463fbcac641c8312a91577598a174b3de.jpg) +Figure 8. Numerical results for CNN trained on MNIST using Noisy SGD. We follow the setting described in (Li et al., 2020). The initial $\eta_t$ is $4 \times 10^{-3}$ , and decays by $0.95(\alpha_t = 0.2)$ or $0.995(\alpha_t = 0.002)$ for every 5 epochs. + +![](images/c0509ea90fd2ebe29a532b966cb43a8a626e752b34cb308576210ff73aa64242.jpg) + +![](images/dac6c2aa72f5c466d6db92e08dca9b6731b7dab463de9f149e2b9d72b8f10dba.jpg) +(a) CNN, MNIST + +![](images/e0646483232e5d75fb15cfc9de8181cc053e866d8a1a58dbd2e1731ea7e39b47.jpg) +(b) CNN, Fashion + +![](images/c3c4da6c412377c10ab516b70489376cf547af91eeac799251ccfb0547731bec.jpg) +(c) ResNet-18, CIFAR10 + +![](images/440180cee9684bbad72675e7412352e11a60253d7efb095c302ad6da7df1a187.jpg) +(d) ResNet-18, CIFAR100 +Figure 9. Training dynamics of CNN on MNIST and Fashion-MNIST, and ResNet-18 on CIFAR-10 and CIFAR-100 using noisy sign-SGD with different scaling $\alpha_{t}$ . Legends indicate the choice of $\alpha_{t}$ and the numbers in brackets are test errors at convergence. As $\alpha_{t} \to 0$ , Nosiy sign-SGD matches both the optimization trajectory as well as the final test accuracy of the original sign-SGD (Bernstein et al., 2018a). + +![](images/c4e62a2ee26eb24ad6e6e2488a81920a1d409cfa75feea385b985b677703c80a.jpg) +(a) MNIST, $\alpha_{t} = 1.0$ + +![](images/c85279e0032dc09b07f06cf13bd5418e1a1244f371e8990fbb8a547c4c7f87b5.jpg) +(b) MNIST, $\alpha_{t} = 0.1$ + +![](images/ee95cbad65193b0e9b2c7d27fe3269f0cbc14a143baaa7b61382ae83953c3d79.jpg) +(c) MNIST, $\alpha_{t} = 0.01$ + +![](images/1b85985e9126778a81e799eb0f35e0c3c17493f052d72b2e028a5c521e671410.jpg) +(d) MNIST, Our Bound + +![](images/19811a64271c6fc8215ef74de2b20b7aca4e81a621ec4a06e9f398e81696587a.jpg) +(e) MNIST, Gradient Discrepancy + +![](images/93ab2041f12edb2a5e7eb7f93f03eedf0e5616a5c04aee3eb505a4c260850e3b.jpg) +(f) Fashion, $\alpha_{t} = 1.0$ + +![](images/0327ac9450c41288f015fd835301b4bb71c53e76e2536888c05df6a140e42bf9.jpg) +(g) Fashion, $\alpha_{t} = 0.1$ + +![](images/af6fb17f0540d714fcac7a62d0b2437a754461caedcbf27f4aaa61e299f48baa.jpg) +(h) Fashion, $\alpha_{t} = 0.01$ + +![](images/6ab27ec4cb2f19356f30876a39fd21b18524718a87c43b215b71db0797d839b5.jpg) +(i) Fashion, Our Bound +Figure 10. Numerical results for training CNN on MNIST and Fashion-MNIST using Noisy Sign-SGD. Increasing $\alpha_{t}$ leads to a tighter generalization bound even though it leads to a slightly larger gradient discrepancy. + +![](images/0e2f454dd5256b1e24ea1ad59cacb2f9a24f9a250f5d5ca687cf6948f8aba2a9.jpg) +(j) Fashion, Gradient Discrepancy \ No newline at end of file diff --git a/stabilitybasedgeneralizationboundsforexponentialfamilylangevindynamics/images.zip b/stabilitybasedgeneralizationboundsforexponentialfamilylangevindynamics/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..a15713a1bfa0ebce2c9dd6efa6f3de7108af352b --- /dev/null +++ b/stabilitybasedgeneralizationboundsforexponentialfamilylangevindynamics/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7d7418a429864abec83f984332a6e9248fbdb828ea9ff3197e9df7a3d46a69c6 +size 2971122 diff --git a/stabilitybasedgeneralizationboundsforexponentialfamilylangevindynamics/layout.json b/stabilitybasedgeneralizationboundsforexponentialfamilylangevindynamics/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..951481064f973f74ab334ccf3bc0dab07a0fedbd --- /dev/null +++ b/stabilitybasedgeneralizationboundsforexponentialfamilylangevindynamics/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5cf57068d607a03ad908dedfc8db0b4b5992f10315ab9d060bb247a09f6372d0 +size 1719985 diff --git a/stabilizingoffpolicydeepreinforcementlearningfrompixels/32a96ffc-9b5f-4ca2-9ae4-f5b672e5436f_content_list.json b/stabilizingoffpolicydeepreinforcementlearningfrompixels/32a96ffc-9b5f-4ca2-9ae4-f5b672e5436f_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..af7c51d9ce3d3c9641ca02003d90475de5ce43d9 --- /dev/null +++ b/stabilizingoffpolicydeepreinforcementlearningfrompixels/32a96ffc-9b5f-4ca2-9ae4-f5b672e5436f_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aa18f6fa818c0daeaa80087b79af77401160b591e47a2134e4db978a4a5380c8 +size 174703 diff --git a/stabilizingoffpolicydeepreinforcementlearningfrompixels/32a96ffc-9b5f-4ca2-9ae4-f5b672e5436f_model.json b/stabilizingoffpolicydeepreinforcementlearningfrompixels/32a96ffc-9b5f-4ca2-9ae4-f5b672e5436f_model.json new file mode 100644 index 0000000000000000000000000000000000000000..b205613d952a001ff9a4f4e5107854cb9ac73352 --- /dev/null +++ b/stabilizingoffpolicydeepreinforcementlearningfrompixels/32a96ffc-9b5f-4ca2-9ae4-f5b672e5436f_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d61084468549ab1827f7ee17196377cd2ae84c4121d0d435167492ecc052fa09 +size 210867 diff --git a/stabilizingoffpolicydeepreinforcementlearningfrompixels/32a96ffc-9b5f-4ca2-9ae4-f5b672e5436f_origin.pdf b/stabilizingoffpolicydeepreinforcementlearningfrompixels/32a96ffc-9b5f-4ca2-9ae4-f5b672e5436f_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..0ab11f64bb1b22605cb45eedd5a7c54f3a8ee165 --- /dev/null +++ b/stabilizingoffpolicydeepreinforcementlearningfrompixels/32a96ffc-9b5f-4ca2-9ae4-f5b672e5436f_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e7128201d9d324bd5bf1b72bcaa1d995132ceb2cc82636d138f3ba4331268d6c +size 9861934 diff --git a/stabilizingoffpolicydeepreinforcementlearningfrompixels/full.md b/stabilizingoffpolicydeepreinforcementlearningfrompixels/full.md new file mode 100644 index 0000000000000000000000000000000000000000..976c077db111df530a069f494828f7f18dd34e7f --- /dev/null +++ b/stabilizingoffpolicydeepreinforcementlearningfrompixels/full.md @@ -0,0 +1,690 @@ +# Stabilizing Off-Policy Deep Reinforcement Learning from Pixels + +Edoardo Cetin $^{*1}$ Philip J. Ball $^{*2}$ Steve Roberts $^{2}$ Oya Celiktutan $^{1}$ + +# Abstract + +Off-policy reinforcement learning (RL) from pixel observations is notoriously unstable. As a result, many successful algorithms must combine different domain-specific practices and auxiliary losses to learn meaningful behaviors in complex environments. In this work, we provide novel analysis demonstrating that these instabilities arise from performing temporal-difference learning with a convolutional encoder and low-magnitude rewards. We show that this new visual deadly triad causes unstable training and premature convergence to degenerate solutions, a phenomenon we name catastrophic self-overfitting. Based on our analysis, we propose A-LIX, a method providing adaptive regularization to the encoder's gradients that explicitly prevents the occurrence of catastrophic self-overfitting using a dual objective. By applying A-LIX, we significantly outperform the prior state-of-the-art on the DeepMind Control and Atari 100k benchmarks without any data augmentation or auxiliary losses. + +# 1. Introduction + +One of the core challenges in real world Reinforcement Learning (RL) is achieving stable training with sample-efficient algorithms (Dulac-Arnold et al., 2019). Combining these properties with the ability to reason from visual observations has great implications for the application of RL to the real world (Kalashnikov et al., 2018; Zhu et al., 2020). Recent works utilizing temporal-difference (TD-) learning have made great progress advancing sample-efficiency (Lillicrap et al., 2015; Fujimoto et al., 2018; Haarnoja et al., 2018a; Cetin & Celiktutan, 2021). However, stability has remained a key issue for these off-policy algorithms (Sutton, + +*Equal contribution ¹Centre for Robotics Research, Department of Engineering, King's College London ²Department of Engineering Science, University of Oxford. Correspondence to: Edoardo Cetin , Philip J. Ball . + +Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s). + +![](images/c2621dc4e68d789a008a0c3d0b63171959cb752f20dce4c3a42d5d357f442b47.jpg) +Figure 1. Performance of agents in DMC (left) and Atari 100k (right) benchmarks from 10 seeds. A-LIX outperforms previous methods without using image augmentations or auxiliary losses. + +![](images/4e1ba0e53a911a2f1ad11197cb406b4e66e25e0b4a4214cbeea82b87bae3fcfb.jpg) + +1988; Duan et al., 2016; Van Hasselt et al., 2018; Buşoniu et al., 2018), making their general applicability limited as compared to their on-policy counterparts (Schulman et al., 2017; Cobbe et al., 2021). At the same time, using pixel observations has been another orthogonal source of instabilities, with several successful approaches relying on pretraining instead of end-to-end learning (Finn et al., 2015; Dwibedi et al., 2018). In fact, alternative optimization objectives, large amounts of simulation data, and symbolic observations have been common factors in most contemporary large-scale RL milestones (Silver et al., 2017; Vinyals et al., 2019; Berner et al., 2019). + +In this work, we provide novel insights behind why applying successful off-policy RL algorithms designed for proprioceptive tasks to pixel-based environments is generally underwhelming (Lee et al., 2019; Yarats et al., 2021). In particular, we provide evidence that three key elements strongly correlate with the occurrence of detrimental instabilities: i) Exclusive reliance on the TD-loss. ii) Unregularized end-to-end learning with a convolutional encoder. iii) Low-magnitude sparse rewards. Using this framework, we are able to motivate the effectiveness of auxiliary losses (Laskin et al., 2020b; Schwarzer et al., 2020; Yarats et al., 2021) and many domain-specific practices (Hessel et al., 2018b; Laskin et al., 2020a) by explaining how they address elements of this new visual deadly triad. + +We focus our analysis on the popular DeepMind Control suite (DMC) (Tassa et al., 2018), where the introduction of random shift augmentations has played a key role in recent advances (Laskin et al., 2020a; Kostrikov et al., 2021; + +Table 1. Practices from recent pixel-based TD-learning methods to mitigate elements of the visual deadly triad. ${}^{ \dagger }$ DrQ uses 10-step returns on Atari. *CURL uses 20-step returns on Atari. + +
AlgorithmVisual Deadly Triad Mitigation
TD-LossCNN OverfitLow-Density Reward
DrQ/RAD-Shift/Jitter Augmentations10-step returns†
DrQ-v2-Shift Augmentations3-step returns
SAC-AEVAE Loss--
SPRModel-Based LossShift/Jitter Augmentations10-step returns
DER-Non-Overlapping Strides20-step returns
CURLContrastive LossShift Augmentations20-step returns*
+ +Yarats et al., 2022). In this domain, we observe that the presence of the visual deadly triad results in the TD-loss gradients through the convolutional encoder's feature maps having high spatial frequencies. We find these gradients are spatially inconsistent and result in degenerate optimization landscapes when backpropagated to the encoder's parameters. Furthermore, repeatedly updating the convolutional encoder with these gradients consistently leads to early convergence to degenerate feature representations causing the critic to fit high-variance erroneous targets, a phenomenon we name catastrophic self-overfitting. As a way of identifying the direct implications of the visual deadly triad in the gradient signal, we propose a new measure called the Normalized Discontinuity (ND) score and show how its value precisely correlates with agent performance. Thus, we explain the effectiveness of shift augmentations by recognizing that they regularize the gradient signal by providing an implicit spatial smoothing effect. + +Based on our analysis, we propose Adaptive Local Signal MyXing (A-LIX) a novel method to prevent catastrophic self-overfitting with two key components: $i$ ) A new parameterized layer (LIX) that explicitly enforces smooth feature map gradients. $ii$ ) A dual objective that ensures learning stability by adapting the LIX parameters based on the estimated $ND$ scores. We show that integrating A-LIX with existing off-policy algorithms achieves state-of-the-art performance in both DeepMind Control and Atari 100k benchmarks without requiring image augmentations or auxiliary losses and significantly fewer heuristics. We open-source our code to facilitate reproducibility and future extensions1. + +Our main contribution can be summarized as follows: + +- We conjecture the existence of a visual deadly triad as a principal source of instability in reinforcement learning from pixel observations and provide clear empirical evidence validating our hypothesis. +- We show these instabilities affect the gradient signal causing catastrophic self-overfitting, a phenomenon that can severely harm TD-learning. As a result, we design the normalized discontinuity score to explicitly + +![](images/708e4944585f6af81af653581b84af577d14ac01e37ec64a0e568c5d8d126a91.jpg) +Figure 2. Returns of agents over 5 seeds. Solid lines represent median performance, faded lines represent individual runs. The vertical dashed line shows when augmentations are turned off. + +anticipate its occurrence. + +- We propose A-LIX, a new method that adaptively regularizes convolutional features to prevent catastrophic self-overfitting, achieving state-of-the-art results on two popular pixel-based RL benchmarks. + +# 2. Background + +We consider problem settings described by Markov Decision Processes (MDPs) (Bellman, 1957), defined as the tuple $(S,A,P,p_0,r,\gamma)$ . This comprises a state space $S$ , an action space $A$ , transitions dynamics given by $P$ and $p_0$ , and a reward function $r$ . The RL objective is then for an agent to recover an optimal policy $\pi^*$ , yielding a distribution of trajectories $p_{\pi}(\tau)$ that maximizes its expected sum of discounted future rewards, $\pi^* = \arg \max_{\pi}\mathbb{E}_{p_{\pi}(\tau)}[\sum_{t=0}^{\infty}\gamma^t r(s_t,a_t)]$ . In off-policy RL, this objective is usually approached by learning a critic function to evaluate the effectiveness of the agent's behavior. A common choice for the critic is to parameterize the policy's Q-function $Q^{\pi}:S\times A\to \mathbb{R}$ , that quantifies the agent's performance after performing a particular action: $Q^{\pi}(s,a) = \mathbb{E}_{p_{\pi}(\tau|s_0=s,a_0=a)}[\sum_{t=0}^{\infty}\gamma^t r(s_t,a_t)]$ . Most off-policy algorithms entail storing trajectories in a buffer $D$ , and learning parameterized Q-functions by iteratively minimizing a squared temporal difference (TD-) loss: + +$$ +\begin{array}{l} J _ {Q} (\phi) = \mathbb {E} _ {(s, a, s ^ {\prime}, r) \sim D} \left[ (Q _ {\phi} ^ {\pi} (s, a) - y) ^ {2} \right], \\ y = r + \gamma \mathbb {E} _ {a \sim \pi (s ^ {\prime})} \left[ \hat {Q} _ {\phi^ {\prime}} ^ {\pi} \left(s ^ {\prime}, a\right) \right]. \tag {1} \\ \end{array} +$$ + +Here, the TD-targets $y$ are computed from a 1-step bootstrap operation with a slowly-changing target $Q$ -function $\hat{Q}_{\phi'}^{\pi}$ . In continuous action spaces, we also learn a separate parameterized policy to exploit the information in the critic. This practically results in alternating TD-learning with maximizing the Q-function's expected return predictions, following the policy gradient theorem (Sutton et al., 2000). + +# 3. Instabilities in TD-Learning from Pixels + +Unlike proprioceptive observations, off-policy RL from pixel observations commonly requires additional domain + +![](images/4e4f586a56330a0494eb5a90f2e3cb3573ff9d8c8d548f907b189ecd3c254688.jpg) +Figure 3. Evidence of overfitting when augmentations are not used. On the left, shaded lines are individual estimates, the solid line represents the median Q-value. On the right, the Q-values Pearson correlation with target values and Monte-Carlo returns $(R_{MC})$ . + +![](images/ea573fc1f9716b5e2976f190c019871c4a9ee47fdc7fcaba8a26c0f7176e4e35.jpg) +Figure 4. TD-loss of offline fixed transitions during training, separated based on having non-zero reward. + +specific practices to ensure stability. In this section, we provide a novel analysis of this phenomenon by focusing on the DeepMind Control Suite (Tassa et al., 2018). In this benchmark, the introduction of random shift data augmentations has been a core component of recent advances in pixel-based off-policy RL (Laskin et al., 2020a; Yarats et al., 2022), allowing us to isolate and reproduce stable and unstable training regimes. Our analysis suggests the existence of specific elements that cause instabilities and strives to explain their implications on learning dynamics. We validate our findings via thorough empirical experimentation showing numerous results corroborating our hypotheses. Based on our discoveries, in Section 4 we provide a new interpretation of random shifts and propose a new improved method to isolate and counteract instabilities. + +# 3.1. Why Do Augmentations Help? + +The underlying mechanism behind the effectiveness of random shifts is not immediately clear. While this augmentation may appear to assist generalization by encoding an invariance (Shorten & Khoshgoftaar, 2019), we note that all the environments from DMC employ a camera that is fixed relative to the agent's position. Hence, robustness to shifts does not appear to introduce any useful inductive bias about the underlying tasks. Moreover, prior work successfully learned effective controllers without augmentations (Hafner et al., 2020; Yarats et al., 2021), suggesting that shift generalization might not be the primary benefit of this method. We analyze the effect of random shifts by training a DrQ-v2 agent (Yarats et al., 2022) on Cheetah Run but turning off augmentations after an initial 500,000 time-steps learning phase. As shown in Fig. 2, while training without any shift augmentation fails to make consistent progress, turning off augmentations after the initial learning phase actually appears to slightly improve the performance of DrQ-v2. This result is a clear indication that augmentations are not needed for asymptotic performance, and are most helpful to counteract instabilities present in the earlier stages of learning, which we now focus on analyzing (see App. F.1-F.2 for + +![](images/1a047fba10a0008cbd645cfa76d01a5180e089b5698d5fb480fea839784309e1.jpg) + +complementary experiments validating these claims). + +# 3.2. Identifying a New Deadly Triad + +To reduce confounding factors and to disentangle the origin of these instabilities, we design an offline RL experiment (Levine et al., 2020). This experiment isolates three distinct elements affecting off-policy RL: exploration, policy evaluation, and policy improvement. First, we gather a set of 15,000 transitions with pixel observations using a random policy in Cheetah Run. This allows us to ground exploration and analyze learning from fixed data resembling the early stages of online training (when augmentations appear most helpful). We then isolate policy evaluation by training both critic and encoder using SARSA (Rummery & Niranjan, 1994) until convergence on this fixed data. Finally, we run policy improvement, training an actor to maximize the expected discounted return as predicted by the converged critic (see App. B.1 for details). Interestingly, we find that turning on augmentations exclusively during exploration or policy improvement has no apparent effect on stability and final performance. Hence, we focus on the effects that augmentations have on TD-learning and analyze applying augmentations only during policy evaluation. + +Table 2. Performance and training statistics of different agent types in the offline experiments from 15,000 random transitions. + +
AgentFinal TD-LossFinal Policy LossReturn
Augmented0.021-0.9986.5 ± 11.3
Non-Augmented0.002-1.059.2 ± 12.1
Proprioceptive0.012-1.1479.1 ± 7.7
Frozen CNN (random)0.023-0.9543.6 ± 20.2
Frozen CNN (pre-trained)0.012-0.9977.6 ± 18.5
Non-Augmented (norm r)18.6163.8638.6 ± 16.5
Non-Augmented (10-step returns)0.003-1.2436.5 ± 20.3
+ +As shown in Table 2, applying augmentations during policy evaluation enables us to learn policies that achieve a return of 86.5, despite the best trajectory in the offline data achieving only 10.8. In contrast, without augmentations we consistently recover near 0 returns, resembling the failures observed in the online experiments. On the left of Fig. 3 we show the evolution of the predicted Q-values for both + +agents on a fixed batch of offline data. In particular, when performing policy evaluation without augmentations, these predictions display extremely high variance across different state-action pairs. In Table 2 we further show that the non-augmented agent displays significantly lower loss, despite having higher average Q-values than the augmented agent (Schaul et al., 2021). We argue this is a clear indication of the occurrence of overfitting. We corroborate our claim by analyzing the evolution of the Pearson bi-variate correlation between the estimated Q-values and target Q-values on the right of Fig. 3. These results show that the non-augmented agent displays near-perfect correlation with its own target Q-values throughout training, indicating that it immediately learns to fit its own noisy, randomly-initialized predictions. We also record the correlation with the actual discounted Monte-Carlo returns, which represent the true targets the Q-values should ideally approximate during policy evaluation. For these results, we observe that the relationship between applying augmentations and the recorded correlation is reversed, with the non-augmented agent displaying significantly lower correlation. This dichotomy appears to indicate that fitting the noisy targets severely affects learning the useful training signal from the collected transitions regarding the experienced rewards. We confirm this phenomenon by splitting the data into non-zero and zero reward transitions, where the only learning signal propagated in the TD-loss is from the initially random target values. In Fig. 4 we illustrate that the non-augmented agents initially experience much higher TD-errors on zero reward transitions, confirming that they focus on fitting uninformative components of the TD-objective. + +In Table 2 we provide the results of additional experiments that indicate that TD-learning is not the only cause for the observed instabilities. First, we confirm that the observed overfitting appears to be exclusive to performing end-to-end TD-learning with convolutional neural network (CNN) encoders. Concretely, we run the same offline experiment without training an encoder in three different settings. First, we consider performing policy evaluation directly from non-augmented proprioceptive observations with a fully-connected critic network. Moreover, we also consider freezing the encoder weights either to their initial random values or to pre-trained values from the augmented agent experiments. In all three cases, we attain largely superior performance, almost matching the augmented agent's performance for both the proprioceptive and pre-trained experiments. In addition, we also find that the observed overfitting phenomenon is diminished when simply increasing the magnitude of the reward signal in the TD-loss. We test this through two additional experiments which consider normalizing the collected rewards before policy evaluation and incorporating large $n$ -step returns (Sutton, 1988). As reported, both modifications considerably improve the non- + +![](images/40331734af81e27ef2927b192ab9275b31ee2ad123bae1f2a0fa0a38fe86979c.jpg) +Non-augmented Final Feature Map + +![](images/c3744acc1663b1a5f8ac7e5c8b9a1cee3b817a696718353476eba4646adf2006.jpg) +Augmented Final Feature Map + +![](images/d739e64a126b1d6a202029395b6469c153a5a17bb9646897f5f6171a495048dc.jpg) + +![](images/b047f36372354bf972c87f8a380c0836f019b2293bf801f8cd140af48c447591.jpg) + +![](images/5f9575d4bccdde1857ffb13194b60979af88c52808c0a8e4259293c0422542c1.jpg) +Figure 5. Feature maps in the final layer of both augmented (top) and non-augmented (bottom) agent encoders. Non-augmented agents manifest inconsistent, high-frequency feature maps. + +![](images/e1bb20f802a633f0b09ee1cc029ced152735299805ecc9c74889dc0760bae861.jpg) + +![](images/f786fb8c13ab5747765772bc495892a499992bb29a610ae77b413d388d5d8d30.jpg) + +![](images/52004ccc4f7a5ff4bd74dd5bb9a1b90b997cff12cf683367846f4fa7832e2545.jpg) + +augmented agent's performance. However, we note that both practices introduce further unwanted variance in the optimization, failing to yield the same improvements as augmentations (see App. C.2). + +Taken together, our results appear to strongly indicate that instabilities in off-policy RL from pixel observation come from three key conditions, which we refer to as the visual deadly triad: i) Exclusive reliance on the TD-loss; ii) Unregularized learning with an expressive convolutional encoder; iii) Initial low-magnitude sparse rewards. Further evidence arises when considering the ubiquity of particular practices employed in pixel-based off-policy RL. In particular, as summarized in Table 1, most popular prior algorithms feature design choices that appear to counteract at least two elements of this triad, either directly or implicitly. Furthermore, we show these instabilities result in the non-augmented critics focusing on learning their own noisy predictions, rather than the actual experienced returns. We observe this ultimately leads to convergence to erroneous and high-variance Q-value predictions, a phenomenon we name catastrophic self-overfitting. + +# 3.3. Anticipating Catastrophic Self-Overfitting + +We now attempt to unravel the links that connect the visual deadly triad with catastrophic self-overfitting. We start by observing that catastrophic self-overfitting comes with a significant reduction of the critic's sensitivity to changes in action inputs, implying that the erroneous high-variance Q-value predictions arise primarily due to changes in the observations (see App. F.3 for action-value surface plots). Hence, we focus on analyzing the feature representations of the pixel observations, computed by the convolutional encoder, $z \in \mathbb{R}^{C \times H \times W}$ . In particular, we wish to quantify the sensitivity of feature representations to small perturbations in the input observations. To measure this, we evaluate the Jacobians of the encoder across a fixed batch of offline data for the augmented and non-augmented agents. We then calculate the Frobenius norm of each agent's Jacobians, giving us a measure of how quickly the encoder feature represen + +![](images/8d3c449194204934367563379d3569431edaac40efedc281daead974a4ceafb2.jpg) +Figure 6. Critic loss surface plots of augmented (left) and non-augmented (right) agents after 5,000 steps of offline training. + +tations are changing locally around an input (see App. B.2 for details). Our results show a stark difference, with the feature representations of the non-augmented agents being on average 2.85 times more sensitive. This suggests that overfitting is driven by the CNN encoder's representations learning high-frequency information about the input observations and, thus, breaking useful inductive biases about this class of models (Rahaman et al., 2019). + +In App. E.1 we demonstrate that lower sensitivity to random noise, while desirable for optimization (Rosca et al., 2020), is actually a byproduct of a stable feature representations, and not its defining factor. Furthermore, observing the actual feature maps of different observations in Fig. 5, we see that augmentations make the encoder produce features that are spatially consistent, aligned with common understandings of how natural representations should appear (Alsallakh et al., 2021; Allen-Zhu & Li, 2021). In contrast, the non-augmented agents display high-frequency and discontinuous feature maps that do not reflect the spatial properties of their inputs. Hence, our evidence suggests that catastrophic self-overfitting specifically follows from the same learning process that produces highly-sensitive and discontinuous encoder feature maps. Therefore, we turn our focus to analyzing the gradients backpropagated to the encoder's features maps and observe one key property: the gradients of the output feature maps consistently reflect the same spatial properties of their resulting features. In particular, the gradients of the feature maps appear spatially consistent for the augmented agent, and discontinuous for the non-augmented agent. This optimization property reflects intuitive understandings of backpropagation since discontinuous gradients should push the encoder's weights to encode discontinuous representations. To provide further complementary evidence that discontinuous gradients are the direct cause of catastrophic self-overfitting, we analyze the normalized loss surfaces when backpropagating these discontinuous gradients to the encoder's parameters (following Li et al. (2018)). In Fig. 6, we see that gradient discontinuities in the non-augmented agent yield extreme peaks in its encoder's loss surface, clearly suggestive of + +overfitting (Keskar et al., 2017) $^2$ + +To quantify the level of discontinuity in the features and their gradients, we propose a new metric that encodes the aggregated immediate spatial 'unevenness' of each feature location within its relative feature map. In particular, we define $D(z) \in \mathbb{R}^{C \times H \times W}$ as the expected squared local discontinuity of $z$ in any spatial direction, i.e.: + +$$ +D (z) _ {i j c} \approx \mathbb {E} _ {v \sim S ^ {1}} \left[ \left(\frac {\partial z _ {i j c}}{\partial v}\right) ^ {2} \right], \tag {2} +$$ + +practically estimated via sampling. We then normalize each value in $D(z)$ by its squared input and average over all the feature positions. We name this metric the normalized discontinuity (ND) score: + +$$ +N D (z) = \frac {1}{C \times H \times W} \sum_ {c = 1} ^ {C} \sum_ {j = 1} ^ {H} \sum_ {i = 1} ^ {W} \frac {D (z) _ {i j c}}{z _ {i j c} ^ {2}}. \tag {3} +$$ + +Intuitively, this score reflects how locally discontinuous $z$ is expected to be at any spatial location. In Fig. 7, we show how the $ND$ score of $\nabla z$ evolves during training in the offline and an online setting for both augmented and non-augmented agents. We see that augmented agents experience considerably less discontinuous gradients through their features, and that recordings of lower $ND$ scores also appear to be highly correlated with performance improvements. We additionally show an accumulated $ND$ score, using an exponential moving average of $\nabla z$ in each spatial position to calculate this metric. Interestingly, we observe that the $ND$ score over accumulated gradients is almost identical to the instantaneous $ND$ score, showing that similar gradient discontinuities are propagated persistently through training in each position of the feature map. This property confirms that the discontinuities are not smoothed by the stochastic sampling of different consecutive training batches, in which case we would expect to observe lower accumulated $ND$ scores. Thus, it suggests that self-overfitting emerges in the non-augmented agents due to repeated gradient steps towards persistent feature map discontinuities. + +# 4. Counteracting Gradient Discontinuities + +# 4.1. Gradient Smoothing and Random Shifts + +As analyzed in Section 3, catastrophic self-overfitting occurs when the gradients in the convolution layers are locally discontinuous. As a result, we argue that the efficacy of random shifts arises from their downstream effect on feature gradient computation, which counteracts these discontinuities during backpropagation. In particular, while random shifts do not act directly on the latent representation or their + +![](images/b710e5ee989285e1687c5d0db07e7dff726c11f98771ca8e3c4a602c11dbd0a2.jpg) +Figure 7. Instantaneous (red and blue) and accumulated (orange and purple) $ND$ scores for the features gradients from offline (left) and online (right) training in Cheetah Run. + +respective gradients, they do affect how the latent representations are computed. This has an impact on how persistent discontinuous components of the gradient are backpropagated to the encoder's parameters during learning. From the approximate shift invariance of convolutional layers, we can view a convolutional encoder as computing each of the feature vectors $[z_{1ij},\dots,z_{Cij}]^T$ with the same parameterized function, $V_{\phi}$ , that takes as input a subset of each observation $O\in \mathbb{R}^{C'\times H'\times W'}$ . This subset corresponds to a local neighborhood around some reference input coordinates $i',j'$ . Thus, the only factor differentiating features in the same feature map (e.g., $z_{cij}$ and $z_{ckl}$ ) is some implicit function $f(i,j) = i'$ , $j'$ translating each of the output features coordinate into the relative reference input coordinate, i.e. $z_{cij} = V_{\phi}(O,i',j')_c$ (determined by kernel sizes, strides...). Therefore, random shifts are approximately equivalent to further translating each reference coordinate by adding some uniform random variables $\delta_x',\delta_y'$ : + +$$ +z _ {c i j} \approx V _ {\phi} (O, i ^ {\prime} + \delta_ {x} ^ {\prime}, j ^ {\prime} + \delta_ {y} ^ {\prime}) _ {c}, +$$ + +where $\delta_x', \delta_y' \sim U[-s', s']$ , $f(i, j) = i', j'$ . + +Due to the employed strides from the convolutional architectures used in DrQ-v2 (Yarats et al., 2022), the difference in reference coordinates of adjacent features in a feature map is less than the maximum allowable shift employed in the augmentations, i.e., $(i + 1)' - i', (j + 1)' - j' < s'$ (where $s'$ is the maximum allowable shift). Consequently, shift augmentations effectively turn the deterministic computation graph of each feature $z_{cij}$ into a random variable, whose sample space comprises the computation graphs of all nearby features within its feature map. Hence, applying different random shifts to samples in a minibatch makes the gradient of each feature $\nabla z_{cij}$ backpropagate to a random computation graph, sampled from a set that extends the set of non-augmented computation graphs for all features in a local neighborhood of coordinates $i, j$ . Therefore, aggregating the parameter gradients produced with different $\delta_x', \delta_y'$ , provides a smoothing effect on how each discontinuous component of $\nabla z$ affects learning, and prevents + +persistent discontinuities from accumulating. Hence, random shifts break the second condition of the visual deadly triad, by providing effective implicit regularization of the convolutional encoder's learning process. At the same time, this minimally disrupts the information content of the resultant features, since discarded observation borders almost exclusively comprise background textures that are irrelevant for performing the task. This interpretation of random shifts aligns with the analysis in Section 3, showing that implicitly smoothing over the backpropagated gradient maps consistently prevents catastrophic self-overfitting. + +# 4.2. Local Signal Mixing + +We extrapolate our hypotheses about catastrophic self-overfitting and random shifts by proposing a technique that aims to enforce gradient smoothing regularization explicitly. We propose Local SIgnal MiXing, or LIX, a new layer specifically designed to prevent catastrophic self-overfitting in convolutional reinforcement learning architectures. LIX acts on the features produced by the convolutional encoder, $z \in \mathbb{R}^{C \times H \times W}$ , by randomly mixing each component $z_{cij}$ with its neighbors belonging to the same feature map. Hence, LIX outputs a new latent representation with the same dimensionality $\hat{z} \in \mathbb{R}^{C \times H \times W}$ , whose computation graph minimally disrupts the information content of each feature $z_{cij}$ while smoothing discontinuous components of the gradient signal during backpropagation. + +LIX is a regularization layer that acts as a simple random smoothing operation, reducing the expected magnitude of gradient discontinuities by preventing higher frequency signals to persist. In the forward pass, LIX produces a new latent representation where for each of the $C$ feature maps, $\hat{z}_{cij}$ is computed as a randomly weighted average of its spatial neighbors around coordinates $i,j$ . We further parameterize this stochastic operation using some maximum range radius $S$ , and consequently sample two uniform continuous random variables $\delta_x,\delta_y\sim U[-S,S]$ , representing shifts in the $x$ and $y$ coordinates respectively. Correspondingly, we define $\tilde{i} = i + \delta_{x}$ and $\tilde{j} = j + \delta_{y}$ and perform the weighted averaging as a bilinear interpolation with weights determined by the random shifts: + +$$ +\begin{array}{l} \hat {z} _ {c i j} = z _ {c \lfloor \tilde {i} \rfloor \lfloor \tilde {j} \rfloor} (\lceil \tilde {i} \rceil - \tilde {i}) (\lceil \tilde {j} \rceil - \tilde {j}) + z _ {c \lfloor \tilde {i} \rfloor \lceil \tilde {j} \rceil} (\lceil \tilde {i} \rceil - \tilde {i}) (\tilde {j} - \lfloor \tilde {j} \rfloor) \\ + z _ {c [ \tilde {i} ] \lfloor \tilde {j} ]} (\tilde {i} - \lfloor \tilde {i} \rfloor) (\lceil \tilde {j} \rceil - \tilde {j}) + z _ {c [ \tilde {i} ] \lceil \tilde {j} \rceil} (\tilde {i} - \lfloor \tilde {i} \rfloor) (\tilde {j} - \lfloor \tilde {j} \rfloor). \\ \end{array} +$$ + +Since nearby features in a convolutional feature map are computed with very similar receptive fields, the mixing effect of LIX should have a trivial effect on the information the encoder can convey in its latent representations. In addition, LIX should have a direct regularization effect on the gradients by acting on the feature maps themselves. In particular, since LIX computes each output feature from a weighted average of its neighbors, back + +propagation will split each gradient $\nabla \hat{z}_{cij}$ , to a random local combination of features within the same feature map, $\{\nabla z_{c[\tilde{i}]\lfloor \tilde{j}\rfloor},\nabla z_{c[\tilde{i}]\lfloor \tilde{j}\rfloor},\nabla z_{c[i]\lfloor \tilde{j}\rfloor},\nabla z_{c[i]\lfloor \tilde{j}\rfloor}\}$ . Thus, LIX should mostly preserve the consistent component of $\nabla z$ while randomly smoothing its discontinuous component. + +There are multiple key differences between the regularization from LIX and random shifts. LIX provides a local smoothing effect over the gradients explicitly and exactly, without having to deal with the implications of padding and strided convolutions breaking shift-invariance assumptions. Moreover, LIX smooths the gradient signal not only across different inputs but also within each feature map. In addition, by applying its operation solely at the feature level, the encoder can still learn to entirely circumvent LIX's smoothing effect on the information encoded in the latent representations, given enough capacity. This means that LIX does not forcibly preclude any input information from affecting the computation. Consequently, LIX also does not have to enforce learning invariances which might not necessarily reflect useful inductive biases about the distribution of observations. In contrast, random shifts need to exploit the particular uninformativeness of the observations borders to avoid disrupting the features' information content. + +# 4.3.A-LIX + +LIX introduces a single key parameter: the range radius $S$ used for sampling $\delta_x$ and $\delta_y$ . Intuitively, this value should reflect how much we expect gradients to be locally consistent for a given architecture and task. Therefore, we argue that the value of $S$ should ideally decrease throughout training as the useful learning signal from the TD-loss becomes stronger. This is consistent with the results illustrated in Figure 2, showing that turning off random shift augmentations after the TD-targets become informative can improve learning. Hence, we propose an adaptive strategy to learn $S$ throughout training. Utilizing the normalized discontinuity (ND) score in Section 3.3, we set up a dual optimization objective to ensure a minimum value of local smoothness in the representation gradients, $\overline{ND}$ . However, computing the ND score of the gradient signal involves a ratio between potentially very small values. As a result, estimation of these values from a batch of gradient samples can lead to outliers having an extreme impact on this average measure, translating into large erroneous updates of $S$ . To overcome this, we propose using a slightly modified version of the ND score with increased robustness to outliers (see App. C.1 for further details): + +$$ +\widetilde {N D} (\nabla \hat {z}) = \sum_ {c = 1} ^ {C} \sum_ {j = 1} ^ {H} \sum_ {i = 1} ^ {W} \log \left(1 + \frac {D (\nabla \hat {z}) _ {c i j}}{\nabla \hat {z} _ {i j c} ^ {2}}\right). \tag {4} +$$ + +In practice, we set up a dual optimization objective similar to the automatic temperature adjustment from Haarnoja et al. + +![](images/28e36a230da291e319f9713758555ebc0ae16d8e58b5d6388eed04e9802e4120.jpg) +Figure 8. A-LIX's $S$ parameter evolution during training in Cheetah Run (left) and Quadruped Run (right). As the critic targets become more informative, $S$ falls, improving data efficiency and asymptotic performance. + +![](images/2a6298f7051cd340b7a9cf0479c482318fe6f5587819fb4ec06cb294aa0661c7.jpg) + +(2018b). This entails alternating the optimization of the TD-learning objectives described in Section 2 with minimizing a dual objective loss: + +$$ +\underset {S} {\arg \min } - S \times \mathbb {E} _ {\hat {z}} \left[ \widetilde {N D} (\nabla \hat {z}) - \overline {{N D}} \right], \tag {5} +$$ + +approximating dual gradient descent (Boyd et al., 2004). Hence, we call this new layer Adaptive LIX (A-LIX). In Fig. 8 we show that A-LIX effectively anneals $S$ as the agent escapes its unstable regimes, in line with our intuition. + +# 5. Performance Evaluation + +We evaluate the effectiveness of A-LIX in pixel-based reinforcement learning tasks in two popular and distinct domains featuring a diverse set of continuous and discrete control problems. We integrate A-LIX with existing popular algorithms and compare against current state-of-the-art model-free baselines. We provide further details of our integration and full hyperparameters in App. D. We also extend this section by providing more granular evaluation metrics in App. A. Furthermore, we provide ablation studies analyzing different components of A-LIX in App. E. + +# 5.1. DeepMind Control Evaluation + +We first evaluate the effectiveness of A-LIX for pixel-based RL on continuous control tasks from the DeepMind Control Suite (DMC) (Tassa et al., 2018). Concretely, we integrate A-LIX with the training procedure and network architecture from DrQ-v2 (Yarats et al., 2022), but without using image augmentations. To show the generality of our method we do not modify any of the environment-specific hyperparameters from DrQ-v2 and simply add our A-LIX layer after each encoder nonlinearity. For simplicity, we optimize a shared $S$ for all the A-LIX layers with the dual objective in Eq. 5. Hence, this introduces a single additional parameter and negligible computational overhead. We compare A-LIX to DrQ-v2, which represents the current state-of-the-art on this benchmark. We also compare against three further baselines: the original DrQ (Kostrikov et al., 2021), which foregoes n-step returns and includes an entropy bonus; CURL (Laskin et al., 2020b), which includes an auxiliary contrastive ob + +![](images/5ae85836bd4ea603914e73302b560fd9848ad28876a694c6be6117cc9beed5fe.jpg) +Figure 9. Average performance in 10 seeds for DMC Medium (left) and Hard tasks (right). Shaded regions represent $\pm 1$ SE. + +jective; an extension of SAC (Haarnoja et al., 2018b) with the encoder from Yarats et al. (2021). These last three baselines have been performant on a prior DMC benchmark that considers fewer tasks with high action repeats, as described by Hafner et al. (2019). Instead, we evaluate on the more challenging 'Medium' and 'Hard' benchmarks from Yarats et al. (2022), comprising 15 tasks with low action repeats. + +Results. We summarize the results in Figure 9, showing the mean performance curves for both medium and hard benchmark tasks. We provide further details and the full list of results across all 15 environments in App. A.1. Overall, A-LIX surpasses all prior methods with clear margins, both in terms of efficiency and final performance. This is particularly notable in the more complex 'Hard' tasks. As highlighted in prior work (Cetin & Celiktutan, 2021), DrQ-v2 appears to yield inconsistent results on some of the harder exploration tasks with sparse rewards. This likely indicates that the gradient regularization induced by random shifts (described in Section 4.1) is unable to consistently prevent catastrophic self-overfitting in scenarios where the initial learning signal from TD-learning is particularly low. Finally, DrQ, CURL, and SAC fail to make consistent meaningful progress on this harder benchmark. This performance gap corroborates the third component of the visual deadly triad, showing how lower magnitude rewards due to harder exploration and lower action-repeats further destabilize TD-learning based algorithms, and explains the gains seen in DrQ-v2 when incorporating n-step returns. We believe these results emphasize the challenge of overcoming the visual deadly triad in continuous control problems and the particular effectiveness of A-LIX to counteract its direct implications. + +# 5.2. Atari 100k Evaluation + +We perform a second set of experiments in an entirely different setting, discrete control. We make use of the popular Atari Learning Environment (ALE) (Bellemare et al., 2013) and consider the 100k evaluation benchmark from Kaiser et al. (2020). In particular, this benchmark comprises evaluating performance for 26 tasks after only two hours of play-time (100k interaction steps), following the evaluation + +Table 3. Results summary for the Atari 100k benchmark. The reported performance of A-LIX is from 10 seeds. + +
MetricsSimPLeDEROTRainbowCURLDrQSPRA-LIX
Norm. Mean0.4430.2850.2640.3810.3570.7040.753
Norm. Median0.1440.1610.2040.1750.2680.4150.411
#SOTA71111411
#Super2212277
Average Rank3.925.005.213.924.852.882.21
+ +protocol in Machado et al. (2018). We integrate A-LIX with Data-Efficient Rainbow (DER) (van Hasselt et al., 2019), a simple extension to Rainbow (Hessel et al., 2018a) with improved data-efficiency. We would like to note that our integration has key differences to DER, designed to highlight the generality of our method in tackling the visual deadly triad. In particular, we reduce the n-step returns to 3 (from 20), and we maintain the same encoder architecture as in DrQ-v2. To speak to the latter point, this means we do not require the highly regularized encoders with large convolutional filters and strides, used ubiquitously in off-policy learning for Atari environments. Instead, to stabilize learning we simply apply our A-LIX layer after the final encoder nonlinearity. We compare against three algorithms that, like A-LIX, do not employ data-augmentation: Data-Efficient Rainbow (DER); Overtrained Rainbow (OTRainbow) (Kielak, 2019); and Simulated Policy Learning (Simple) (Kaiser et al., 2020) (model-based). Moreover, we also compare with additional state-of-the-art off-policy baselines that make use of data augmentations: the aforementioned CURL and DrQ; and Self-Predictive Representations (SPR) (Schwarzer et al., 2020), the current state-of-the-art TD-learning based algorithm on this benchmark. SPR combines data augmentation with numerous additional algorithmic design choices, such as an auxiliary self-supervised loss for learning a latent dynamics model. + +Results. We summarize the results in Table 3, showing the mean and median human-normalized scores together with the number of environments where each algorithm either achieves state-of-the-art or super-human performance. We include the full per-environment results in App. A.2. Remarkably, A-LIX obtains a substantially higher human-normalized mean performance than all other considered algorithms. While the recorded normalized median performance is slightly inferior to SPR, we argue that such difference is not particularly significant since this metric depends on the performance obtained in just two environments. Moreover, A-LIX achieves super-human performance in 7 games (the same as SPR), and state-of-the-art performance in 11 games, considerably more than all other algorithms. These results corroborate how tuned architectures, data augmentation, and auxiliary losses used on ALE mostly serve the purpose of counteracting the direct implications of the visual deadly triad and show that A-LIX enables us to learn + +![](images/3c82f08052f44ec8c37602d5d5d6c84c075c525c54b833d3cf64d386bc60d5ce.jpg) +(a) DeepMind Control: Medium and Hard Tasks + +![](images/7d7994ab75aa57acbadd2a6f9baeaf72955140e603a84400b8d8097f719bd9d4.jpg) +(b) Atari 100k +Figure 10. Probability of improvement and performance profiles obtained from the recorded results in DMC (left) and Atari 100k (right). A-LIX displays statistically significantly improvements and stochastically dominates most prior algorithms. + +powerful models without relying on these design choices. + +# 5.3. Statistical Significance + +To validate the significance of our improvements, we statistically analyze our results using the Riable tools and practices from Agarwal et al. (2021). We summarize some of our key findings in Fig. 10, showing the probability of improvements of A-LIX over prior methods (computed with the Mann-Whitney U statistic (Mann & Whitney, 1947)) and the relative normalized performance profiles (Dolan & Moré, 2002). The ranges correspond to $95\%$ stratified bootstrap confidence intervals (Efron, 1992). In both DMC and Atari benchmarks, we find that our improvements are statistically significant (lower confidence intervals $>0.5$ ) and observe 'stochastic dominance' of our algorithm against almost all considered baselines (Dror et al., 2019). We provide further results and details of the employed statistical analysis in App. A.1 and App. A.3 respectively. + +# 6. Related Work + +Previous works have characterized several optimization issues related to performing RL via TD-learning (Baird & Moore, 1998; Baird, 1999). In this work, we instead focus on the empirical analysis of modern TD-learning algorithms, specific to the pixel-based RL setting. We also observe links with recent work studying observational overfitting (Song et al., 2020). Our work differs by focusing on memorization effects particular to the combination of CNNs and TD-learning. There are also connections with existing feature-level augmentation work, such as Dropout (Srivastava et al., 2014) and DropBlock (Ghiasi et al., 2018). In particular, the latter also applies structured transformations directly to the feature maps and introduces a heuristic to adjust this transformation over training, validating our findings on the utility of adaptivity. Outside RL, there is a rich body of work on implicit regularization and memorization in CNNs (Keskar et al., 2017; Neyshabur et al., 2017; Arpit et al., 2017; Liu et al., 2020; Maennel et al., 2020). Rahaman et al. (2019) show that higher frequency data manifolds cause CNNs to learn higher spectral frequency terms, aligning with our analysis of higher frequency representations. + +tions. Chatterjee (2020) show generalization arises when similar examples induce similar gradients during learning (i.e., coherence). Their work supports our findings since inconsistent feature gradients are a manifestation of noncoherence, explaining their poor generalization. Finally, our dual objective falls under automatic tuning methods in RL (AutoRL) (Parker-Holder et al., 2022). These approaches have been applied very successfully to manage non-stationary trade-offs, such as exploration and exploitation (Ball et al., 2020) and optimism (Moskovitz et al., 2021; Cetin & Celiktutan, 2021). Finally, we note links with recent work concerning implicit regularization in TD-learning (Kumar et al., 2021). However, while Kumar et al. (2021) observe an implicit 'underfitting' phenomenon in later training stages, we analyze an opposed 'overfitting' phenomenon occurring during the first training steps, which we find to be specific to learning from visual inputs. + +# 7. Conclusion + +In this work, we provide a novel analysis demonstrating that instabilities in pixel-based off-policy RL come specifically from performing TD-learning with a convolutional encoder in the presence of a sparse reward signal. We show this visual deadly triad affects the encoder's gradients, causing the critic to catastrophically self-overfit to its own noisy predictions. Therefore, we propose Adaptive Local SSignal MiXing (A-LIX), a powerful regularization layer to explicitly counteract this phenomenon. Applying A-LIX enables us to outperform prior state-of-the-art algorithms on popular benchmarks without relying on image augmentations, auxiliary losses, or other notable design choices. + +# Acknowledgments + +Edoardo Cetin and Oya Celiktutan would like to acknowledge the support from the Engineering and Physical Sciences Research Council [EP/R513064/1] and LISI Project [EP/V010875/1]. Philip J. Ball would like to thank the Willowgrove Foundation for support and funding. Furthermore, support from Toyota Motor Corporation contributed towards funding the utilized computational resources. + +# References + +Agarwal, R., Schwarzer, M., Castro, P. S., Courville, A., and Bellemare, M. G. Deep reinforcement learning at the edge of the statistical precipice, 2021. +Allen-Zhu, Z. and Li, Y. Feature purification: How adversarial training performs robust deep learning, 2021. +Alsallakh, B., Kokhlikyan, N., Miglani, V., Yuan, J., and Reblitz-Richardson, O. Mind the pad - {cnn}s can develop blind spots. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id=m1CD7tPubNy. +Arpit, D., Jastrzebski, S., Ballas, N., Krueger, D., Bengio, E., Kanwal, M. S., Maharaj, T., Fischer, A., Courville, A., Bengio, Y., and Lacoste-Julien, S. A closer look at memorization in deep networks. In Precup, D. and Teh, Y. W. (eds.), Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pp. 233-242. PMLR, 06-11 Aug 2017. URL https://proceedings.mlr.org/press/v70/arpit17a.html. +Baird, L. Reinforcement learning through gradient descent. Technical report, Carnegie-Mellon University, Department of Computer Science, 1999. +Baird, L. and Moore, A. Gradient descent for general reinforcement learning. Advances in neural information processing systems, 11, 1998. +Ball, P., Parker-Holder, J., Pacchiano, A., Choromanski, K., and Roberts, S. Ready policy one: World building through active learning. In Proceedings of the 37th International Conference on Machine Learning, ICML. 2020. +Bellemare, M. G., Naddaf, Y., Veness, J., and Bowling, M. The arcade learning environment: An evaluation platform for general agents. Journal of Artificial Intelligence Research, 47:253-279, 2013. +Bellman, R. A markovian decision process. Indiana Univ. Math. J., 6:679-684, 1957. ISSN 0022-2518. +Berner, C., Brockman, G., Chan, B., Cheung, V., Debiak, P., Dennison, C., Farhi, D., Fischer, Q., Hashme, S., Hesse, C., et al. Dota 2 with large scale deep reinforcement learning. arXiv preprint arXiv:1912.06680, 2019. +Boyd, S., Boyd, S. P., and Vandenberghe, L. Convex optimization. Cambridge university press, 2004. +Brandfonbrener, D., Whitney, W. F., Ranganath, R., and Bruna, J. Offline RL without off-policy evaluation. In Beygelzimer, A., Dauphin, Y., Liang, P., and Vaughan, J. W. (eds.), Advances in Neural Information Processing Systems, 2021. URL https://openreview.net/forum?id=LU687itn08w. + +Buşoniu, L., de Bruin, T., Tolic, D., Kober, J., and Palunko, I. Reinforcement learning for control: Performance, stability, and deep approximators. Annual Reviews in Control, 46:8-28, 2018. +Cetin, E. and Celiktutan, O. Learning pessimism for robust and efficient off-policy reinforcement learning. arXiv preprint arXiv:2110.03375, 2021. +Chatterjee, S. Coherent gradients: An approach to understanding generalization in gradient descent-based optimization. arXiv preprint arXiv:2002.10657, 2020. +Cobbe, K. W., Hilton, J., Klimov, O., and Schulman, J. Phasic policy gradient. In International Conference on Machine Learning, pp. 2020-2027. PMLR, 2021. +Dolan, E. D. and Moré, J. J. Benchmarking optimization software with performance profiles. Mathematical programming, 91(2):201-213, 2002. +Dror, R., Shlomov, S., and Reichart, R. Deep dominance-how to properly compare deep neural models. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pp. 2773-2785, 2019. +Duan, Y., Chen, X., Houthooft, R., Schulman, J., and Abbeel, P. Benchmarking deep reinforcement learning for continuous control. In International conference on machine learning, pp. 1329-1338. PMLR, 2016. +Dulac-Arnold, G., Mankowitz, D., and Hester, T. Challenges of real-world reinforcement learning. arXiv preprint arXiv:1904.12901, 2019. +Dwibedi, D., Tompson, J., Lynch, C., and Sermanet, P. Learning actionable representations from visual observations. In 2018 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), pp. 1577-1584. IEEE, 2018. +Efron, B. Bootstrap methods: another look at the jackknife. In Breakthroughs in statistics, pp. 569-593. Springer, 1992. +Finn, C., Tan, X. Y., Duan, Y., Darrell, T., Levine, S., and Abbeel, P. Learning visual feature spaces for robotic manipulation with deep spatial autoencoders. arXiv preprint arXiv:1509.06113, 25, 2015. +Fu, J., Kumar, A., Nachum, O., Tucker, G., and Levine, S. D4{rl}: Datasets for deep data-driven reinforcement learning, 2021. +Fujimoto, S., van Hoof, H., and Meger, D. Addressing function approximation error in actor-critic methods. In ICML, pp. 1582-1591, 2018. URL http://proceedings.mlr.press/v80/fujimoto18a.html. + +Ghiasi, G., Lin, T.-Y., and Le, Q. V. Dropblock: A regularization method for convolutional networks. In Bengio, S., Wallach, H., Larochelle, H., Grauman, K., Cesa-Bianchi, N., and Garnett, R. (eds.), Advances in Neural Information Processing Systems, volume 31. Curran Associates, Inc., 2018. URL https://proceedings.neurips.cc/paper/2018/file/7edcfb2d8f6a659ef4cd1e6c9b6d7079-Paper.pdf. +Gogianu, F., Berariu, T., Rosca, M. C., Clopath, C., Busoniu, L., and Pascanu, R. Spectral normalisation for deep reinforcement learning: An optimisation perspective. In Meila, M. and Zhang, T. (eds.), Proceedings of the 38th International Conference on Machine Learning, volume 139 of Proceedings of Machine Learning Research, pp. 3734-3744. PMLR, 18-24 Jul 2021. URL https://proceedings.mlr.press/v139/gogianu21a.html. +Haarnoja, T., Zhou, A., Abbeel, P., and Levine, S. Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor. In Dy, J. and Krause, A. (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 2018a. URL https://proceedings.mlr.press/v80/haarnoja18b.html. +Haarnoja, T., Zhou, A., Hartikainen, K., Tucker, G., Ha, S., Tan, J., Kumar, V., Zhu, H., Gupta, A., Abbeel, P., et al. Soft actor-critic algorithms and applications. arXiv preprint arXiv:1812.05905, 2018b. +Hafner, D., Lillicrap, T., Fischer, I., Villegas, R., Ha, D., Lee, H., and Davidson, J. Learning latent dynamics for planning from pixels. In International Conference on Machine Learning, pp. 2555-2565. PMLR, 2019. +Hafner, D., Lillicrap, T., Ba, J., and Norouzi, M. Dream to control: Learning behaviors by latent imagination. In International Conference on Learning Representations, 2020. +Hernandez-Garcia, J. F. and Sutton, R. S. Understanding multi-step deep reinforcement learning: A systematic study of the dqn target, 2019. +Hessel, M., Modayil, J., Van Hasselt, H., Schaul, T., Ostrovski, G., Dabney, W., Horgan, D., Piot, B., Azar, M., and Silver, D. Rainbow: Combining improvements in deep reinforcement learning. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 32, 2018a. +Hessel, M., Modayil, J., Van Hasselt, H., Schaul, T., Ostrovski, G., Dabney, W., Horgan, D., Piot, B., Azar, M., and + +Silver, D. Rainbow: Combining improvements in deep reinforcement learning. In Thirty-second AAAI conference on artificial intelligence, 2018b. +Kaiser, L., Babaeizadeh, M., Milos, P., Osiński, B., Campbell, R. H., Czechowski, K., Erhan, D., Finn, C., Kozakowski, P., Levine, S., Mohiuddin, A., Sepassi, R., Tucker, G., and Michalewski, H. Model based reinforcement learning for Atari. In International Conference on Learning Representations, 2020. +Kalashnikov, D., Irpan, A., Pastor, P., Ibarz, J., Herzog, A., Jang, E., Quillen, D., Holly, E., Kalakrishnan, M., Vanhoucke, V., et al. Qt-opt: Scalable deep reinforcement learning for vision-based robotic manipulation. arXiv preprint arXiv:1806.10293, 2018. +Kearns, M. J. and Singh, S. P. Bias-variance error bounds for temporal difference updates. In Proceedings of the Thirteenth Annual Conference on Computational Learning Theory, COLT '00, pp. 142-147, San Francisco, CA, USA, 2000. Morgan Kaufmann Publishers Inc. ISBN 155860703X. +Keskar, N. S., Mudigere, D., Nocedal, J., Smelyanskiy, M., and Tang, P. T. P. On large-batch training for deep learning: Generalization gap and sharp minima. 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=H1oyRlYgg. +Kielak, K. P. Do recent advancements in model-based deep reinforcement learning really improve data efficiency? 2019. +Kingma, D. P. and Ba, J. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. +Kostrikov, I., Yarats, D., and Fergus, R. Image augmentation is all you need: Regularizing deep reinforcement learning from pixels. In International Conference on Learning Representations. 2021. +Kumar, A., Agarwal, R., Ghosh, D., and Levine, S. Implicit under-parameterization inhibits data-efficient deep reinforcement learning. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id=09bnihsFfXU. +Laskin, M., Lee, K., Stooke, A., Pinto, L., Abbeel, P., and Srinivas, A. Reinforcement learning with augmented data. In Advances in Neural Information Processing Systems 33. 2020a. +Laskin, M., Srinivas, A., and Abbeel, P. CURL: Contrastive unsupervised representations for reinforcement learning. In Proceedings of the 37th International Conference on Machine Learning, 2020b. + +Lee, A. X., Nagabandi, A., Abbeel, P., and Levine, S. Stochastic latent actor-critic: Deep reinforcement learning with a latent variable model. arXiv preprint arXiv:1907.00953, 2019. +Levine, S., Kumar, A., Tucker, G., and Fu, J. Offline reinforcement learning: Tutorial, review, and perspectives on open problems, 2020. +Li, H., Xu, Z., Taylor, G., Studer, C., and Goldstein, T. Visualizing the loss landscape of neural nets. In Neural Information Processing Systems, 2018. +Lillicrap, T. P., Hunt, J. J., Pritzel, A., Heess, N., Erez, T., Tassa, Y., Silver, D., and Wierstra, D. Continuous control with deep reinforcement learning. arXiv preprint arXiv:1509.02971, 2015. +Liu, S., Papailiopoulos, D., and Achlioptas, D. Bad global minima exist and sgd can reach them. Advances in Neural Information Processing Systems, 33, 2020. +Machado, M. C., Bellemare, M. G., Talvitie, E., Veness, J., Hausknecht, M., and Bowling, M. Revisiting the arcade learning environment: Evaluation protocols and open problems for general agents. Journal of Artificial Intelligence Research, 61:523-562, 2018. +Maennel, H., Alabdulmohsin, I. M., Tolstikhin, I. O., Baldock, R., Bousquet, O., Gelly, S., and Keysers, D. What do neural networks learn when trained with random labels? In Larochelle, H., Ranzato, M., Hadsell, R., Balcan, M. F., and Lin, H. (eds.), Advances in Neural Information Processing Systems, volume 33, pp. 19693-19704. Curran Associates, Inc., 2020. URL https://proceedings.neurips.cc/paper/2020/file/e4191d610537305de1d294adb121b513-Paper.pdf. +Mann, H. B. and Whitney, D. R. On a Test of Whether one of Two Random Variables is Stochastically Larger than the Other. The Annals of Mathematical Statistics, 18(1):50-60, 1947. doi: 10.1214/aoms/1177730491. URL https://doi.org/10.1214/aoms/1177730491. +Miyato, T., Kataoka, T., Koyama, M., and Yoshida, Y. Spectral normalization for generative adversarial networks. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id=B1QRgziT-. +Mnih, V., Kavukcuoglu, K., Silver, D., Graves, A., Antonoglou, I., Wierstra, D., and Riedmiller, M. Playing atari with deep reinforcement learning. arXiv preprint arXiv:1312.5602, 2013. + +Moskovitz, T., Parker-Holder, J., Pacchiano, A., Arbel, M., and Jordan, M. Tactical optimism and pessimism for deep reinforcement learning. In Beygelzimer, A., Dauphin, Y., Liang, P., and Vaughan, J. W. (eds.), Advances in Neural Information Processing Systems, 2021. URL https://openreview.net/forum?id=a4WgjcLeZIn. +Neyshabur, B., Bhojanapalli, S., McAllester, D., and Srebro, N. Exploring generalization in deep learning. In Proceedings of the 31st International Conference on Neural Information Processing Systems, NIPS'17, pp. 5949-5958, Red Hook, NY, USA, 2017. Curran Associates Inc. ISBN 9781510860964. +Parker-Holder, J., Rajan, R., Song, X., Biedenkapp, A., Miao, Y., Eimer, T., Zhang, B., Nguyen, V., Calandra, R., Faust, A., Hutter, F., and Lindauer, M. Automated reinforcement learning (autorl): A survey and open problems, 2022. +Rahaman, N., Baratin, A., Arpit, D., Draxler, F., Lin, M., Hamprecht, F., Bengio, Y., and Courville, A. On the spectral bias of neural networks. In International Conference on Machine Learning, pp. 5301-5310. PMLR, 2019. +Rosca, M., Weber, T., Gretton, A., and Mohamed, S. A case for new neural networks smoothness constraints. In "I Can't Believe It's Not Better!" NeurIPS 2020 workshop, 2020. URL https://openreview.net/forum?id=_b-uT9wCI-7. +Rummery, G. A. and Niranjan, M. On-line Q-learning using connectionist systems. Technical Report TR 166, Cambridge University Engineering Department, Cambridge, England, 1994. +Schaul, T., Ostrovski, G., Kemaev, I., and Borsa, D. Return-based scaling: Yet another normalisation trick for deep rl, 2021. +Schulman, J., Wolski, F., Dhariwal, P., Radford, A., and Klimov, O. Proximal policy optimization algorithms. CoRR, abs/1707.06347, 2017. URL http://arxiv.org/abs/1707.06347. +Schwarzer, M., Anand, A., Goel, R., Hjelm, R. D., Courville, A., and Bachman, P. Data-efficient reinforcement learning with self-predictive representations. arXiv preprint arXiv:2007.05929, 2020. +Shorten, C. and Khoshgoftaar, T. M. A survey on image data augmentation for deep learning. Journal of Big Data, 6(1):1-48, 2019. +Silver, D., Lever, G., Heess, N., Degris, T., Wierstra, D., and Riedmiller, M. Deterministic policy gradient algorithms. 2014. + +Silver, D., Hubert, T., Schrittwieser, J., Antonoglou, I., Lai, M., Guez, A., Lanctot, M., Sifre, L., Kumaran, D., Graepel, T., et al. Mastering chess and shogi by self-play with a general reinforcement learning algorithm. arXiv preprint arXiv:1712.01815, 2017. +Song, X., Jiang, Y., Tu, S., Du, Y., and Neyshabur, B. Observational overfitting in reinforcement learning. In International Conference on Learning Representations, 2020. +Srivastava, N., Hinton, G., Krizhevsky, A., Sutskever, I., and Salakhutdinov, R. Dropout: A simple way to prevent neural networks from overfitting. Journal of Machine Learning Research, 15(56):1929-1958, 2014. URL http://jmlr.org/papers/v15/srivastava14a.html. +Student. The probable error of a mean. Biometrika, 6 (1):1-25, 1908. ISSN 00063444. URL http://www.jstor.org/stable/2331554. +Sutton, R. Learning to predict by the method of temporal differences. Machine Learning, 3:9-44, 08 1988. doi: 10.1007/BF00115009. +Sutton, R. S., McAllester, D. A., Singh, S. P., and Mansour, Y. Policy gradient methods for reinforcement learning with function approximation. In Advances in neural information processing systems, pp. 1057-1063, 2000. +Tassa, Y., Doron, Y., Muldal, A., Erez, T., Li, Y., Casas, D. d. L., Budden, D., Abdolmaleki, A., Merel, J., Lefrancq, A., et al. Deepmind control suite. arXiv preprint arXiv:1801.00690, 2018. +Van Hasselt, H., Doron, Y., Strub, F., Hessel, M., Sonnerat, N., and Modayil, J. Deep reinforcement learning and the deadly triad. arXiv preprint arXiv:1812.02648, 2018. +van Hasselt, H. P., Hessel, M., and Aslanides, J. When to use parametric models in reinforcement learning? Advances in Neural Information Processing Systems, 32:14322-14333, 2019. +Vinyals, O., Babuschkin, I., Czarnecki, W. M., Mathieu, M., Dudzik, A., Chung, J., Choi, D. H., Powell, R., Ewalds, T., Georgiev, P., et al. Grandmaster level in starcraft ii using multi-agent reinforcement learning. Nature, 575 (7782):350-354, 2019. +Wilcoxon, F. Individual comparisons by ranking methods. Biometrics Bulletin, 1(6):80-83, 1945. ISSN 00994987. URL http://www.jstor.org/stable/3001968. +Yarats, D., Zhang, A., Kostrikov, I., Amos, B., Pineau, J., and Fergus, R. Improving sample efficiency in model-free reinforcement learning from images. Proceedings + +of the AAAI Conference on Artificial Intelligence, 35(12): 10674-10681, May 2021. URL https://ojs.aaai.org/index.php/AAAI/article/view/17276. +Yarats, D., Fergus, R., Lazaric, A., and Pinto, L. Mastering visual continuous control: Improved data-augmented reinforcement learning. In International Conference on Learning Representations, 2022. URL https://openreview.net/forum?id=__SJ-_yyes8. +Zhu, H., Yu, J., Gupta, A., Shah, D., Hartikainen, K., Singh, A., Kumar, V., and Levine, S. The ingredients of real-world robotic reinforcement learning. arXiv preprint arXiv:2004.12570, 2020. + +# A. Detailed Results + +# A.1. DMC Medium and Hard Tasks + +In Table 4, we show the performance in each of the evaluated 15 DMC environments by reporting the mean and standard deviations over the cumulative returns obtained midway and at the end of training for the medium and hard benchmark tasks, respectively. A-LIX attains state-of-the-art performance in the majority of the tasks at both reported checkpoints, while still closely matching DrQ-v2's performance on the remaining tasks. On the other hand, DrQ-v2 struggles to consistently solve some of the harder exploration tasks such as Cartpole Swingup Sparse and Humanoid Run, as shown by the high standard deviations. Interestingly, unlike in the simpler DMC benchmark from Hafner et al. (2019) with higher action repeat, CURL appears have a slight edge over DrQ. In particular, the self-supervised signal from CURL appears to aid precisely in the sparse reward environments where DrQ-v2 struggles. Hence, this appears to suggest that including an additional self-supervised signal to the TD-loss, lessens the hindering effects of a lower-magnitude reward signal. We interpret this result as additional evidence showing how addressing any individual component of the deadly triad helps counteracting the catastrophic self-overfitting phenomenon. + +We also test the significance of our results by performing a Wilcoxon signed-rank test (Wilcoxon, 1945) between A-LIX and DrQ-v2. We perform a paired rank test across both seeds and tasks, allowing us to obtain an $p$ -value that takes into account both population size and relative performance gains across all tasks. The choice of Wilcoxon signed-rank test also does not presume normality in the distributions of performance which we believe is a more appropriate assumption than for instance a paired $t$ -test (Student, 1908), despite a potential loss of statistical power. To ensure correct population pairing, A-LIX and DrQ-v2 seeds were identical, resulting in the same initially collected data and network initialization. Performing this test over all 15 tasks and 5 seeds, we achieve a $p$ -value of 0.0057 at $50\%$ total frames (1.5M and 15M for Medium and Hard respectively) and 0.0053 at $100\%$ total frames (3.0M and 30M for Medium and Hard Respectively), much lower than the typical rejection criteria of $p > 0.05$ . We therefore believe this shows clear evidence that our results in DMC are strongly statistically significant. + +Table 4. Full results for the DeepMind Control Suite benchmark. Each displayed return is averaged over 10 random seeds and from 10 evaluation runs collected at each experience checkpoint. + +
Medium tasks1.5M frames3.0M frames
SACCURLDrQDrQv2A-LIX (Ours)SACCURLDrQDrQv2A-LIX (Ours)
Acrobot Swingup8±96±524±27256±47270±9912±116±528±25442±64402±100
Cartpole Swingup Sparse118±233479±329318±389485±396718±250185±295499±349316±389505±412742±250
Cheetah Run9±8507±114788±59792±29806±787±8590±95835±45873±60864±78
Finger Turn Easy190±137297±150199±132854±73546±101200±155309±176216±158934±54901±109
Finger Turn Hard79±73174±106100±63491±182587±109100±78146±9586±70902±77906±101
Hopper Hop0±0184±127268±91198±102287±480±0224±135285±96240±123372±48
Quadruped Run68±72164±91129±97419±204528±10763±45175±104130±59523±271759±107
Quadruped Walk75±65134±53144±149591±256776±3748±32168±49142±67920±36900±37
Reach Duplo1±18±108±12220±7212±32±37±109±9228±2221±3
Reacher Easy52±64707±142600±201971±4887±19115±98667±182612±181940±50966±19
Reacher Hard3±2463±196320±233727±172720±8310±23678±350397±273935±49855±83
Walker Run26±4379±234474±148571±276691±1025±3447±224547±143616±297756±10
Average score52.28291.73281.03547.96585.6763.80326.45300.27671.40720.30
15.0M frames30.0M frames
Hard tasksSACCURLDrQDrQv2A-LIX (Ours)SACCURLDrQDrQv2A-LIX (Ours)
Humanoid Walk7±35±33±2243±162476±794±34±35±3675±86754±79
Humanoid Stand5±36±34±3167±159519±946±36±26±2588±63781±94
Humanoid Run5±36±25±322±30122±593±34±34±2170±122242±59
Average score5.645.744.02144.16372.784.304.894.90477.74592.48
+ +We now compare our results using the Riable framework introduced in Agarwal et al. (2021) (see App. A.3 for a detailed explanation about the metrics introduced). + +Figure 11. Performance profiles at $50\%$ (left) and $100\%$ (right) of the total steps in Medium and Hard DMC Tasks. +![](images/621c8d27d97c759abdcbd11b051cc48e5687139c126f76822a19da5e90758ac0.jpg) +A-LIX DrQv2 DrQ CURL SAC + +![](images/fdd16691ebe3e04c854485f878c0ab24afc633f51e379c5023924b471e432bf3.jpg) + +We plot performance profiles in Fig. 11 at both $50\%$ and $100\%$ the total training steps in DMC, which aim to represent sample efficiency and asymptotic performance respectively. We see that in almost all cases, A-LIX improves upon DrQ-v2. + +![](images/63dd58fa1c090b74ee19c0957a4c4018cd8f62fddda974d4e0efdb9d506d038a.jpg) +(a) Overall ranking statistics at $50\%$ (top) and $100\%$ (bottom) of the total steps in Medium and Hard DMC Tasks. + +![](images/8317bfc248b3093c2d14102ca53bc30cc488e1728ce933a85bfbce0ec89e320d.jpg) +(b) Aggregate IQM (left) and Optimality Gap (right) metrics at $50\%$ of the total steps in Medium and Hard DMC Tasks. + +We plot ranking statistics in Fig. 11 at both $50\%$ and $100\%$ the total training steps in DMC. We see that A-LIX clearly appears most in the 1st ranked column, and rarely appears in lower ranked (i.e., $>3$ ), suggesting strong performance across all environments in DMC Medium and Hard. We also provide a further aggregated statistics plot in Fig. 12b (this time at $50\%$ the total steps), which shows A-LIX is particularly sample-efficient and consistent (i.e., low error bars) across all environments. + +![](images/26ac519696f0ed9ca88f00fd879a6fdc7ec1c75291425e3ee2f47618d0e0b32a.jpg) +(a) $50\%$ total steps. + +![](images/c62bb506e6a117ab7241dc3941952ae53729c6506a86b2246cb88d8f7ba24fb1.jpg) +(b) $100\%$ total steps. +Figure 13. Probability of Improvement statistics at both $50\%$ (left) and $100\%$ (right) of the total timesteps in Medium and Hard DMC Tasks. + +In Fig. 13 we observe that A-LIX likely improves over prior work, and note that whilst the improvement probability over DrQ-v2 may seem slightly low at $\sim 60\%$ , we note that this value is in line with statistics in prior works that achieve significant gains (as seen in Agarwal et al. (2021)), and furthermore it does not take into account absolute performance values, and instead only compares relative values, which explains why the gains of A-LIX appear larger when evaluated under IQM and OG. Furthermore, the lower CI for $50\%$ total steps does not fall below 0.5, which means improvements are indeed statistically significant. + +# A.2. Atari 100k + +In Table 5, we show the final average performance for all the evaluated algorithms in each of the twenty-six tasks in the Atari 100k benchmark. A-LIX outperforms SPR, the previous state-of-the-art off-policy algorithm on this benchmark, on 16 out of 26 tasks. Moreover, it attains comparatively similar performance on most of the remaining tasks despite using no augmentation, auxiliary losses, or model-based elements. + +Table 5. Full results for the Atari 100k benchmark, following the evaluation protocol from Machado et al. (2018). We report the results collected from 10 random seeds. + +
TasksRandomHumanSimPLeDEROTRainbowCURLDrQSPRA-LIX (Ours)
Alien227.807127.70616.9739.9824.7558.2771.2801.5902
Amidar5.801719.5088188.682.8142.1102.8176.3174.27
Assault222.40742.00527.2431.2351.9600.6452.4571660.53
Asterix210.008503.301128.3470.8628.5734.5603.5977.8809.5
Bank Heist14.20753.1034.251182.1131.6168.9380.9639.4
Battle Zone2360.0037187.505184.410124.64060.614870129541665114470
Boxing0.1012.109.10.22.51.2635.821.5
Breakout1.7030.5016.41.99.84.916.117.123.52
Chopper Command811.007387.801246.9861.81033.31058.5780.3974.8747
Crazy Climber10780.5035829.4062583.616185.321327.812146.520516.542923.653166
Demon Attack152.101971.00208.1508711.8817.61113.4545.2888.15
Freeway0.0029.6020.327.92526.79.824.431.04
Frostbite65.204334.70254.7866.8231.61181.3331.11821.51845.7
Gopher257.602412.50771349.5778669.3636.3715.2500.6
Hero1027.0030826.402656.668576458.86279.33736.37019.27185.85
Jamesbond29.00302.80125.3301.6112.3471236365.4341.5
Kangaroo52.003035.00323.1779.3605.4872.5940.63276.46507
Krull1598.002665.504539.92851.53277.94229.64018.13688.94884.04
Kung Fu Master258.5022736.3017257.214346.15722.214307.8911113192.716316
Ms Pacman307.306951.6014801204.1941.91465.5960.51313.21258.4
Pong-20.7014.6012.8-19.31.3-16.5-8.5-5.96.03
Private Eye24.9069571.3058.397.8100218.4-13.6124100
Qbert163.9013455.001288.81152.9509.31042.4854.4669.12974
Road Runner11.507845.005640.696002696.756618895.114220.517471
Seaquest68.4042054.70683.3354.1286.9384.5301.2583.1654.6
Up N Down533.4011693.203350.32877.42847.62955.23180.828138.55011.7
Human Norm. Mean0.0001.0000.4430.2850.2640.3810.3570.7040.753
Human Norm. Median0.0001.0000.1440.1610.2040.1750.2680.4150.411
# SOTAN/AN/A71111411
# SuperN/AN/A2212277
Average RankN/AN/A3.925.005.213.924.852.882.21
+ +We now present additional evaluations under the Riable framework, continuing on from the analysis in Fig. 10b. + +![](images/bb5dbd181123dfea044f7addfd5e3b8725dafaf098866076630d0886ec86a7ca.jpg) + +![](images/0c4d22a7a2c7729e8c22b9780347dffe2f3f150b0b581a156911e2ab1e3c04d5.jpg) +Figure 14. Performance profiles with linear (left) and logarithmic (right) scaling in Atari $100\mathrm{k}$ . + +![](images/095a8ef7110807c569c86b9e82182e0f3707e00c88b8ebfd3afc980ddc11a5bb.jpg) + +![](images/6e780c9af0a5878e7414b4da80fbdb21034001a74e7db593e7d3eeb170ecf973.jpg) + +![](images/7fbb9334b1a10054f11fdcbbe4057876156b4380091b7a51c711c6d316679ae2.jpg) + +![](images/7511013f09784ddb97574419ac93c6f85e6f8378c5518e722c6150f4f958aa85.jpg) + +![](images/b04e93924cac78ba970f355277df42e7faac2c312404965e2cddbc79fdf441d3.jpg) + +![](images/43138680d2ff958f21020e1b91eca6f758b88d004a6c0c657e92054a76d226e2.jpg) + +![](images/2306c6d88a75d4b3e3927cddff17b5f746cefa6697cc731edab661a1ca7d0550.jpg) + +![](images/3b78bac0d8a725470ea8af7f425028aad2ce28d84b0d8ba3043b7b0aff3029e6.jpg) + +![](images/bf9037786314aabc488730766e82a7d777349fae91ebafb9e4610b8832b865cf.jpg) + +![](images/6b9d3fbc53c54220aea86ad8c49c67103adb9d459c75f939a648d1da8bbade8b.jpg) + +![](images/3c6b2022c2d05387b9aba6bd8e86baca07d9e380b84880c37da7e5386ed3e235.jpg) + +![](images/fe36b1d1a1f5bc36ed4c042bb7b7b2eca5882845b4f3dd724cb00ce83c588fa0.jpg) + +![](images/0907b6fea58d0f6917e28a9170b1f2367f72fe7e0fbe717bee59b2e6685f51b2.jpg) + +In Fig. 14 A-LIX performs noticeably better than previous work, and performs at least as well as SPR over all settings of + +normalized scores. + +![](images/b2610d9c59f73dc3a5f118951935adb69325e18be58204c05ed248889ba9abb5.jpg) +(a) Ranking statistics. + +![](images/8133c63f4382e794653fd9d9db6a1d76e44c6f8d2d9c9b4694527c5d17746949.jpg) +(b) Probability of improvement statistics. +Figure 15. Bootstrapped ranking statistics (left) and probability of improvement plots (right) on Atari $100\mathrm{k}$ . + +In Fig. 15a A-LIX constitutes the majority of the algorithms ranked in 1st, and shows far fewer instances of being ranked in lower positions (i.e., $>4$ ). In Fig. 15b we observe A-LIX likely improves upon prior work. Similar to Fig. 13, while the $\sim 60\%$ improvement value over SPR may seem low, this is justified due to shortcomings in this metric, such as not taking into account actual performance values, and instead relative improvements. Furthermore, the lower CI does not fall below 0.5, which means improvements due to A-LIX are statistically significant. + +# A.3. Riable: A Primer + +In addition to providing traditional methods of evaluation (e.g., performance tables, significance testing), we use robust metrics and evaluation strategies introduced in Riable (Agarwal et al., 2021). Riable advocates for computing aggregate performance statistics not just across many seeds, but also across the many tasks within a benchmark suite. + +We give details on how these metrics achieve reliable performance evaluation in RL, denoting number of seeds as $N$ and number of tasks as $M$ . We follow Agarwal et al. (2021) as closely as possible; please refer to their paper for further details. + +# A.3.1. SEED AND TASK AGGREGATION + +In order to aggregate performances across different tasks in the same benchmark suite, we must first normalize each benchmark to the same range. In Atari, this is usually done by normalizing scores with respect to those achieved by humans, and in DMC this is done with respect to the maximum achievable score (i.e., 1,000). We refer to this normalized score as $\tau$ . + +# A.3.2.IQM AND OG + +Interquartile Mean (IQM) takes the middle $50\%$ of the runs across seeds and benchmarks (i.e., $[NM/2]$ ) and then calculates its mean score, improving outlier robustness whilst maintaining statistical efficiency. Optimality Gap (OG) calculates the proportion of performances $(NM)$ that fail to meet a minimum threshold $\gamma$ , with the assumption that improvements beyond $\gamma$ are not important. In both cases, stratified bootstrap sampling is used to calculate confidence intervals (CIs). + +# A.3.3. PERFORMANCE PROFILES + +Performance profiles are a form of empirical CDF, but with stratified bootstrap sampling to produce confidence bands that account for the underlying variability of the score. We can also establish 'stochastic dominance' by observing whether one method's performance profile is consistently above another's for all normalized performance values $\tau$ . + +# A.3.4. RANKING + +Ranking shows the proportion of times a given algorithm ranks in a given position across all tasks, with distributions produced using stratified bootstrap sampling having 200,000 repetitions. + +# A.3.5. PROBABILITY OF IMPROVEMENT + +Probability of improvement is calculated by calculating the Mann-Whitney U-statistic (Mann & Whitney, 1947) across all $M$ tasks. The distribution is then plotted as a boxplot, and if the lower CI $> 0.5$ , the improvement is statistically significant. + +# B. Experiments Description + +# B.1. Offline Experiments + +We follow the original training hyperparameters of DrQ-v2, and run policy evaluation and policy improvement until we saw convergence in the TD-loss, which would occur at similar points in all agents (i.e., between 10-20k and 5-10k steps of SGD in policy evaluation and policy iteration respectively). For the proprioceptive experiments, we keep everything consistent, except the input to the critic and actor MLP layers are now the proprioceptive states from the DMC simulator, not the latent representation $z$ from the encoder. That is to say we do not modify the MLP architectures nor their learning rates in the interests of a fair comparison. Furthermore, for any given seed of the offline experiment, we also instantiate all networks in the agents identically and train on the same random offline data, with minibatches presented in the same order. + +We also note that a similar algorithm is described in Brandfonbrener et al. (2021), but in the context of minimizing extrapolation errors. + +Now we present some additional analysis to provide further context to our offline experiments. First, we see that the proprioceptive statistics mirror those of the augmented agent, further illustrating the crucial role of CNN regularization for successful TD-learning from pixels: + +![](images/f1ddc03825a2ec99549b55f5dea9dc1f8ba66763fc0cd08a0b3a70d42ad7d501.jpg) +Figure 16. Q values and Pearson Correlation of the offline Proprioceptive agent on an offline fixed batch. + +![](images/a87431efa5662bf5f9d662297af2e07e5b6135bad49e2ac70efeea9e8624262c.jpg) + +Secondly, we observe that the exact same self-overfit also manifests in the online setting by plotting the Pearson correlation values over the initial stages of training in 5 seeds, confirming that phenomena of our offline analysis applies to the online RL problem: + +![](images/88cc0d253f3088b3aadc6a0147633d86c60977e9bd94d9d67de777b4c61dfe4f.jpg) +Figure 17. Pearson Correlation of augmented and non-augmented online agents in Cheetah Run and Quadruped Walk across 5 seeds. Shaded lines represent individual runs, and solid lines represent the median. We see that augmented agents do not immediately overfit to their target networks, and become correlated only after useful signal is learned. + +# B.2. Jacobian Analysis + +In order to measure local sensitivity, we linearize the encoder around its input using a Taylor series expansion. Consider an $N$ -dimensional input $\mathbf{x} \in \mathbb{R}^N$ and perturbation $\epsilon \in \mathbb{R}^N$ , an $M$ -dimensional output $\mathbf{y} \in \mathbb{R}^M$ , and a function $\mathbf{F}: \mathbb{R}^N \to \mathbb{R}^M$ . Now, performing a Taylor series expansion around $\tilde{\mathbf{x}}$ : + +$$ +\begin{array}{l} \mathbf {F} (\tilde {\mathbf {x}} + \epsilon) = \mathbf {F} (\tilde {\mathbf {x}}) + \epsilon \mathbf {F} (\mathbf {x}) \nabla^ {T} | _ {\mathbf {x} = \tilde {\mathbf {x}}} + \frac {\epsilon^ {2}}{2} \nabla \mathbf {F} (\mathbf {x}) \nabla^ {T} | _ {\mathbf {x} = \tilde {\mathbf {x}}} + \dots (6) \\ \approx \mathbf {F} (\tilde {\mathbf {x}}) + \mathbf {J} (\tilde {\mathbf {x}}) \epsilon (7) \\ = \tilde {\mathbf {y}} (8) \\ \end{array} +$$ + +where we make the approximation in the second line by dropping the second order/Hessian and higher terms under the assumption the perturbation vector $\epsilon$ is small. This allows us to write $\mathbf{F}$ in the form of a local linear system: $\mathbf{y} = \mathbf{F}(\mathbf{x}) + \mathbf{J}(\mathbf{x})\epsilon$ . It is straightforward to see that if the entries of the Jacobian matrix $\mathbf{J}$ are larger, then small perturbations $\epsilon$ will cause larger changes in the output $\mathbf{y}$ . To measure the magnitude of the Jacobian entries, we take the Frobenius norm: + +$$ +\left| \left| \mathbf {J} (\mathbf {x}) \right| \right| _ {F} = \sum_ {n} \sum_ {m} \left(\frac {\partial \mathbf {F} _ {m} (\mathbf {x})}{\partial \mathbf {x} _ {n}}\right) ^ {2} \tag {9} +$$ + +where $\mathbf{x}_n$ is the $n$ 'th entry of $\mathbf{x}$ and $\mathbf{F}_m$ is the $m$ 'th entry of the codomain of $\mathbf{F}$ . The calculation of the Jacobian is trivial through the use of an automatic differentiation framework. + +In our analysis we calculate the Jacobians of both agents on of a fixed batch of 128 frame stacked images taken from the offline training dataset, and compare the corresponding ratios of their Frobenius norms, and take this average ratio over the batch across 4 seeds. + +# C. Additional Analysis + +# C.1. Adaptive ND Dual Objective Optimization + +The alternative $ND$ score with increased outlier robustness, $\widetilde{ND}$ , proposed in Section 4.3 is inspired by recordings of signal-to-noise ratio measurements. In particular, by passing the individual normalized $D(z)$ terms through a $\log(1 + x)$ smoothing function we downweight the effect that large individual outliers might have on this aggregated metric. We would like to remark that since we set up the optimization of $S$ with a dual objective, changes in the actual target value relating to some appropriate smoothness constraint are mostly irrelevant when considering the optimization's dynamics. Therefore, we argue that tuning $S$ with the actual $ND$ should not considerably diverge from tuning $S$ based on a re-scaled appropriate target for $\widetilde{ND}$ . + +We provide further plots comparing agent performance and respective adaptive parameter $S$ during training: + +![](images/949e773f131733d55f34a65a72db3a0da1f20060cdfb0d0bf89fa955ebd1754e.jpg) +Figure 18. Performance of agents across 4 different seeds of the Cheetah Run environment and their adaptive scalar parameter $S$ . We observe that initially, $S$ is high until agents learn useful behaviors, whereupon it drops to maintain ND due to presence of useful signal in the feature gradients. + +![](images/293a55c75a1651d0649a72b6f415e86c3b16b9ad0ce5c687b80a1ee1454f2b0a.jpg) +Figure 19. Performance of agents across 4 different seeds of the Quadruped Run environment and their adaptive scalar parameter $S$ . We observe that as meaningful behaviors are learned in agents towards the end of training, $S$ falls accordingly, whereupon it drops to maintain ND due to presence of useful signal in the feature gradients. + +We see the same effect in these two contrasting environments; in Cheetah Run, where learning is more stable due to more predictable initializations and fewer degrees of freedom, we see the A-LIX parameter $S$ drop almost immediately as the TD-targets quickly become more accurate. In the less stable Quadruped Run, we also notice this annealing effect, however this occurs later on in training, when the agent can consistently recover from poor initializations. + +# C.2. N-Step Returns + +Large n-step rewards have become an important part of many algorithms that use TD-learning from visual observations. As motivated in Section 3, large n-step rewards can help towards mitigating self-overfitting by densifying the reward and downweighting the contribution of the inaccurate target critic, especially early in training; indeed as shown in (Yarats et al., 2022), using 1-step learning has a significant negative impact on performance. However, it is known that there is a bias-variance trade-off with multi-step approaches (Kearns & Singh, 2000), and furthermore, almost all approaches using this method do not apply off-policy bias correction when sampling from a replay buffer. While we motivate the use of n-step returns as a way to mitigate self-overfitting through incurring fewer 0 reward tuples (especially common in sparse reward environments early in training), we believe there is evidence to show that this introduces bias when n is sufficiently large, despite prior work suggesting this is not the case (Hernandez-Garcia & Sutton, 2019). + +![](images/0cb65ba74c4bf9bd3352da1178748c2b018c745cbfa5791823a6b626ff7b1537.jpg) +Figure 20. Returns of agents over 5 seeds. Solid lines represent median performance, faded lines represent individual runs. + +We show in Fig. 20 that 10-step (as is commonly done in algorithms used to solve Atari) returns can mitigate failure seeds as predicted under the visual deadly triad framework (indeed in Cheetah Run there are no seeds that completely flat-line when 10-step returns are used). However, we also see evidence that applying 10-step returns can have negative impacts on convergence and asymptotic performance in Cheetah Run when the deadly triad is sufficiently managed, such as using augmentations; in Quadruped Run we see moderate benefit initially, but note that asymptotically the 10-step and 3-step agents converge to the same performance. We also provide further evidence in App. E.3, where applying 10-step returns to an A-LIX agent generally has a largely negative impact on performance. Finally, we note that trying 20-step returns, as is done in some algorithms that solve Atari (Laskin et al., 2020b), caused significant performance reductions in DMC. In conclusion, this provides evidence that we should consider using lower values of 'n' in multi-step returns, and achieve this through addressing other elements of the deadly triad. + +# D. Implementation Details + +In Tables 6 and 7 we provide the full list of hyperparameters used in our implementations for DMC and Atari $100\mathrm{k}$ , respectively. We show significant differences from standard practices in **bold**. In particular, A-LIX uses the same encoder architecture and $n$ -step returns for both benchmarks, highlighting its lower reliance to environment-specific heuristics. Moreover, unlike prior state-of-the-art algorithms it does not employ any data augmentation or auxiliary loss function. These factors show the effectiveness of our adaptive method in counteracting instabilities from the visual deadly triad without any additional help, highlighting its applicability. + +Table 6. Full hyperparameters list used for the DeepMind Control A-LIX experiments. Bolded values represent significant differences from canonical implementations. + +
DDPG-integration hyperparameters (following (Yarats et al., 2022))
Replay data buffer size1000000 (100000 for Quadruped Run)
Batch size256 (512 for Walker Run)
Minimum data before training4000
Random exploration steps2000
OptimizerAdam (Kingma & Ba, 2014)
Policy/critic learning ratemedium: 0.0001
hard: 0.00008
Policy/critic β10.9
Critic UTD ratio0.5
Policy UTD ratio0.5
Discount γ0.99
Polyak coefficient ρ0.99
N-step returns3 (1 for Walker Run)
Hidden dimensionality1024
Feature dimensionalitymedium: 50
hard: 100
NonlinearityReLU
Exploration stddev. clip0.3
Exploration stddev. schedulemedium: linear: 1 → 0.1 in 500000 steps
hard: linear: 1 → 0.1 in 2000000 steps
AugmentationsOFF
A-LIX-specific hyperparameters
Initial maximum sampling shift S1.0
Normalized discontinuity targets ND0.635
Maximum sampling shift learning rate0.003
Maximum sampling shift β10.5
+ +Table 7. Full hyperparameters list used for the Atari 100k A-LIX experiments. Bolded values represent significant differences from canonical implementations. + +
DER-integration hyperparameters
Gray-scalingTrue
Down-sampling84 × 84
Frames stacked4
Action repetitions4
Reward clipping[-1,1]
Max episode frames108000
Replay data buffer size100000
Replay period every1
Batch size32
Minimum data before training1600
Random exploration steps1600
OptimizerAdam (Kingma & Ba, 2014)
Critic learning rate0.0001
Critic β10.9
Critic ε0.000015
Max gradient norm10
Critic UTD ratio2
Discount γ0.99
Target update period1
N-step returns3
Feature maps32,32,32
Filter sizes3 × 3, 3 × 3, 3 × 3
Strides2,1,1
Hidden dimensionality256
Feature dimensionality50
NonlinearityReLU
Exploration noisy nets parameter0.1
AugmentationsOFF
+ +A-LIX-specific hyperparameters + +
Initial maximum sampling shift S1.0
Normalized discontinuity targets ND0.75
Maximum sampling shift learning rate0.0001
Maximum sampling shift β10.5
+ +# E. Additional Ablations + +# E.1. Smoothness Regularization through Spectral Normalization + +To distinguish between general smoothness constraints in convolutional features, and the smoothness that arises as a result spatial consistency, we apply spectral normalization (Miyato et al., 2018) to the final convolutional layer in the encoder to represent the former class of constraints. Spectral normalization operates on the parameters of a network and constrains its outputs to be 1-Lipschitz and has shown benefits in prior work (Gogianu et al., 2021), but does not explicitly enforce a spatial regularization in the features. We train agents without augmentations using spectral normalization. + +Figure 21. Returns of agents over 5 seeds. Solid lines represent median performance, faded lines represent individual runs. +![](images/e1aaefabcffdd86af2a4036b95ea94c76804dcefa2f9dc3eefe3ec179421b68a.jpg) +Augs Spectral Normalization + +![](images/c1a36ea3c3f2efb9a98bfa5a469df32a3df9ff1b7cd5b59797352f1625dee5e6.jpg) + +We see that whilst there is clear improvement above the original non-augmented agents in some cases, the performance is still lower than agents that use spatial consistency regularization, such as random shift augmentations. + +# E.2. Is Gradient Smoothing All We Need? + +Following the argument in Section 4.1, we can view augmentations as a gradient smoothing regularizer. This naturally leads us to ask the following: can we replace the stochastic shifting mechanism with a fixed smoothing mechanism? To test this, we instead apply a Gaussian smoothing kernel to the feature gradients in the CNN, and utilize our $ND$ score to vary the width of the kernel adaptively through training; we call this method A-Gauss (Adaptive Gaussian Feature Gradient Kernel). + +Figure 22. Returns of agents over 5 seeds. Solid lines represent median performance, faded lines represent individual runs. +![](images/cf90a2485913715d916e1b8d49ef796e371c2da3e14a9dd45d34e06fc2d7ce7b.jpg) +Augs A-Gauss + +![](images/2cdaceb0f02b2f6aceeddf87985a4e8188b4bcfa8cb98b07276657fe21d7ca48.jpg) + +We see that while there is improvement over non-augmented agents, overall performance is still lower than even simple non-adaptive augmentation. We believe this is due to the Gaussian kernel having too significant an effect on the information contained in the feature gradients during backpropagation, causing information to be lost. We believe this explains the effectiveness of shift-augmentations in reinforcement learning, which is that they effectively balance the information contained in the gradients, as well as ensuring their smoothness to reduce overfitting. + +# E.3. Ablations to A-LIX + +We now provide a set of ablations on both DMC and Atari, assessing the impact of individual components in A-LIX. + +![](images/7ecfbb5e621422694c20946effc2782749a56b851049e9e110f6d75dfde85c23.jpg) +(a) DMC Control ablations in Cheetah Run (left) and Quadruped Run (right) evaluated over 4 seeds. + +![](images/5c3bec34d9f31526d8767fc40a4ff9545979d15800c76e0a6012823706c8b0be.jpg) +(b) Atari 100k ablations evaluated over 4 seeds in 4 different Atari 100k tasks. +Figure 23. An ablation study of A-LIX, showing the contribution of its individual components to ultimate performance in DMC and Atari 100k. + +In Fig. 23a we choose the following ablations for DMC: + +A-LIX +- Adaptive Random Shifts (where the magnitude of the random shift image augmentation is adjusted using the dual ND objective) +LIX +- Random Shifts (i.e., DrQ-v2) + +While we see a slight asymptotic performance improvement in Cheetah Run by using LIX layers instead of random shifts, we notice significant differences in the less stable Quadruped Run environment. Concretely, we see much greater stability in both LIX approaches compared with image augmentation approaches, with the former having no failure seeds. Furthermore, we observe stronger asymptotic performance with the inclusion of the adaptive dual objective for both approaches. As motivated in Fig. 19, this is likely a result of reducing the shift parameter as the signal in the target values increases. + +In Fig. 23b, we choose the following ablations for Atari $100\mathrm{k}$ on a subset of environments that represent a diverse set of tasks and performances with baseline algorithms: + +A-LIX +- Adaptive Random Shifts (as before) +LIX +- A-LIX with 10-step returns +- Random Shifts + +We see that A-LIX performs consistently strongly across the environments tested, always placing in the top 2 with regards to Human Normalized Score. We also notice that generally, LIX layer methods outperform random shift methods apart from in Crazy Climber, where the opposite is true. We believe this may be due to random shift augmentations actually reflecting the inductive biases concerning generalization in this environment, and believe this merits further investigation. Finally, we observe that using 10-step returns instead of 3 generally harms performance with A-LIX, with justification given in App. C.2. + +# F. Additional Offline Experiment Analysis + +# F.1. Behavior Cloning without Augmentations + +![](images/52fb32904dbf3e8cc502e8083a2c4f3db39794c7a4bbd342e3fbf8c17c14a8c1.jpg) +Figure 24. Returns of agents over 5 seeds. Solid lines represent median performance, faded lines represent individual runs. The grey dotted horizontal line represents mean expert performance. + +To illustrate that test time shift invariance is not required, we show that it is possible to learn a policy through supervised learning. To do this, we generate a pixel-based dataset of 500,000 timesteps under an expert policy in Cheetah Run, and jointly train a CNN encoder and policy using behavior cloning/supervised learning by minimizing the loss $\mathcal{L} = (a - \pi(o))^2$ until convergence, where $o$ follows the stacked frame image inputs of (Mnih et al., 2013). We see that the pixel-based policy performs as well as the behavior agent, despite using both higher dimensional data and fewer than half the samples compared to existing expert offline RL benchmarks from proprioceptive states (Fu et al., 2021). + +This provides clear evidence that shift invariance is not required at test time, and motivates us to find an alternative explanation for why random shift augmentations help the learning process in TD-learning. An alternative perspective is that when the learning signal is strong, as is the case for supervised learning (and later stages during online learning when target values are more accurate), the natural bias of CNNs to learn lower order representations acts as an implicit regularizer (Rahaman et al., 2019) that results in test-time generalization. + +# F.2. Turning Off Augmentations + +We present more evidence showing that augmentations benefit learning the most at the beginning of training. In Fig. 25 we show the effect of turning off augmentations at 200,000 steps in Cheetah Run, and at 500,000 in Quadruped Walk. In both instances, we see large improvements over not augmenting at all, and both nearly converge to the same value as DrQ-v2, showing further evidence that stability initially in learning is vital. We posit that turning off augmentations here did not yield similar benefits to Fig. 2 due to the fact that there is still high-frequency information in the targets (consider that the augmentations in Cheetah Run are switched off significantly earlier) that cause a marginal amount of self-overfitting, reducing the rate of learning due to feature space degeneration. + +![](images/b7d35aeecc66a405e70897fcfedf52d4f97380a7113bcbff3f5f345d2645bfcb.jpg) +Figure 25. Returns of agents over 5 seeds. Solid lines represent median performance, faded lines represent individual runs. The grey dashed line shows when augmentations are turned off. + +![](images/43034fa92e8db8ef80008e2aac37b16038af122413de9d331b6e516e80e4fb22.jpg) + +# F.3. Action-Value Surfaces + +Here we show the action-value surfaces of the offline agents' critics at various tuples sampled from the data. This provides us with an intuition over the loss landscape that the policies will be optimizing during the policy improvement, as accordingly the policy under the deterministic policy gradient (Silver et al., 2014) updates its own weights towards maximizing the action-values defined by the critic through the chain rule: + +$$ +\nabla_ {\phi} J _ {\pi} \approx \mathbb {E} _ {s \sim E} \left[ \nabla_ {a} Q _ {\theta} (s, a) | _ {a = f _ {\phi} (s)} \nabla_ {\phi} f _ {\phi} (s) \right] \tag {10} +$$ + +where $\phi$ and $\theta$ are policy and critic weights respectively. We hypothesize that self-overfitting reduces the sensitivity of the critic to actions, discarding important information regarding the causal link between actions and expected returns. To evaluate this, we sample state-action pairs from our replay buffer, and then visualize the action-value surface by sampling two random orthogonal direction vectors from the action space $A$ . We then normalize the direction vectors to have a 2-norm of 1, and then multiply each direction vector by scalars $\alpha, \beta \in [-2,2]$ respectively. We then plot the action-value surface as a result of adding the random vectors multiplied by their respective scalars onto the action sampled from offline dataset, giving us a 3-D surface. We clip actions to $a \in [-1,1]^{[A]}$ as actions are squashed to this range in the policy through a truncated normal distribution. + +![](images/1733e92263284ada77542bde73c4968b029778c5ddfb0e4600c80d45353ce5a7.jpg) +(a) Random Sampled State-Action Pair 1 + +![](images/be126d2ab5915787d3ce9aef60301e9f910c177ca2a9eee72d539e56585ef42b.jpg) +(c) Random Sampled State-Action Pair 4 + +![](images/525584e5323a2c4d4ada5c16ffd858041f750b2572ad8996c33f9caae944dc8a.jpg) +(b) Random Sampled State-Action Pair 2 + +![](images/0668544b3c2e7a52256d728ae402b064d31668c4b80a620df5325511f1aabd45.jpg) +(d) Random Sampled State-Action Pair 4 +Figure 26. Action-Value loss surface plotted with respect to two orthogonal random directions sampled from the action space (i.e., $d_r \in A$ and $d_1 \perp d_2$ ). + +We see that the critics learned by the augmented agents are more sensitive to changes in action. We believe this is due to the non-augmented agents overfitting to the observations, thus ignoring the lower-dimensional action inputs. To validate this, we sampled 128 random state-action tuples from the offline buffer, and calculated the average variance across the loss surfaces. We see a significant difference, with the augmented agent having an average loss surface variance of 0.0129, whereas the non-augmented agent has an average loss surface variance of 0.0044, suggestive of lower sensitivity. + +# F.4. Evidence of Critic MLP Overfitting from High-Frequency Features + +We provide further evidence that measuring high-frequency features through the ND score is vital to understanding overfit by showing how overfitting is able to occur in the fully-connected critic layers, which are usually stable under proprioceptive observations (see Table 2). To do this, we construct a pattern containing high frequency checkerboard noise $c \in \mathbb{R}^{H \times W}$ and produce as many patterns as there are channels $C$ in the final layer. To ensure consistency across each individual feature map, we normalize each checkerboard pattern by the maximum value in its respective feature map, and then divide by the width of the checkerboard. We then add this pattern multiplied by a scalar $\alpha$ onto each feature map. + +![](images/10c4eaffcc46055bd7ada096451197309f12c13ac8e4b95e4ad20acce19f7fe2.jpg) +Augmented Agent + +![](images/cc506b3ba3d3613f8afa8766ee49988c5c11894023f6027d8a9ed56b54554415.jpg) +Non-Augmented Agent +(a) Example checkerboard artefacts. + +![](images/c773f223560e66122c9a432339b15106a840b0e38ff6ab124085abf3b868dd1d.jpg) +$\alpha$ (Checkerboard Weight) +(b) Sensitivity of agents to checkerboard artifact weight +Figure 27. Effect of checkerboard artifacts on feature maps and resultant loss sensitivity. We see the non-augmented agent is significantly more sensitive to this high-frequency noise. + +As we see, the loss is significantly more sensitive to high-frequency perturbations in the non-augmented agent, justifying its reliance on high-frequency patterns in the feature maps to enable self-overfitting. + +# F.5. Additional Loss Surfaces + +Here we show the loss surfaces of the offline agents under policy evaluation with at 1,000, 5,000, and 10,000 training steps. We also show the surfaces respect to only the MLP layers, again following the normalization approach of Li et al. (2018). + +![](images/5675afb5dd151a216c6244b4072df68d32666fdfc2a4bfd3a23e00fb06094a28.jpg) +(a) 1,000 SGD Steps + +![](images/562ed7aba12ed8331d2b230ec4a0e8c54c356c8f3fda82e20890fe76500a479c.jpg) +(b) 5,000 SGD Steps + +![](images/5302917c434f539e3a8f3ea4c9faacf99ae561e086817331b5acba955529ecb1.jpg) +(c) 10,000 SGD Steps + +![](images/208bfd672f5efef7ee383ea6bc6365961ffe75b753a0bb61aa40c463e2234105.jpg) +Figure 28. Loss surface plotted with respect to Encoder parameters at various stages of training. +(a) 1,000 SGD Steps + +![](images/f478ad6c041c71414a8a1b7028523ebf90247d39481ec291fff9d0f00c202589.jpg) + +![](images/fde613cbaba7d04e2a6c4aa222d431b225efcc5cb495d08c5d6cdb9088b1284c.jpg) +(b) 5,000 SGD Steps +Figure 29. Loss surface plotted with respect to Critic MLP parameters at various stages of training. + +![](images/c8936e04c096748e22999c09d3abdb9346090ad28e38046f5b4f1582a67fd59a.jpg) +(c) 10,000 SGD Steps + +As we see, the loss surface with respect to the MLP parameters is significantly less sharp, lending further evidence that self-overfitting is predominately a result of the flexibility of the CNN layers to learn high-frequency features. \ No newline at end of file diff --git a/stabilizingoffpolicydeepreinforcementlearningfrompixels/images.zip b/stabilizingoffpolicydeepreinforcementlearningfrompixels/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..9c541e76556572fadb33554be13b7274804523a5 --- /dev/null +++ b/stabilizingoffpolicydeepreinforcementlearningfrompixels/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bfa7e63a68d3a633e3acaa16a842bd46a0c008834f1269e10dff7706b9f7a4a2 +size 1813301 diff --git a/stabilizingoffpolicydeepreinforcementlearningfrompixels/layout.json b/stabilizingoffpolicydeepreinforcementlearningfrompixels/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..96300d95c03c6badaaf17610c6e437c3a0e3a68f --- /dev/null +++ b/stabilizingoffpolicydeepreinforcementlearningfrompixels/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8da4d4fd759185b0b4cebe2e735d77a447cc61e5e1681f5d043d5e56d1eb2eb9 +size 865457 diff --git a/stabilizingqlearningwithlineararchitecturesforprovableefficientlearning/cd4a56c6-683a-4103-a9f2-d41ae8de6216_content_list.json b/stabilizingqlearningwithlineararchitecturesforprovableefficientlearning/cd4a56c6-683a-4103-a9f2-d41ae8de6216_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..509fbc525d759d2a7f97799328501f55a059ee5a --- /dev/null +++ b/stabilizingqlearningwithlineararchitecturesforprovableefficientlearning/cd4a56c6-683a-4103-a9f2-d41ae8de6216_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:638cea46d4b64ab94b535f3d30d336f83491b58794bdb965221b3f3f4f059074 +size 271519 diff --git a/stabilizingqlearningwithlineararchitecturesforprovableefficientlearning/cd4a56c6-683a-4103-a9f2-d41ae8de6216_model.json b/stabilizingqlearningwithlineararchitecturesforprovableefficientlearning/cd4a56c6-683a-4103-a9f2-d41ae8de6216_model.json new file mode 100644 index 0000000000000000000000000000000000000000..986e3ea1f1a966b27c3280f3d075f99bdfb83f29 --- /dev/null +++ b/stabilizingqlearningwithlineararchitecturesforprovableefficientlearning/cd4a56c6-683a-4103-a9f2-d41ae8de6216_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:22be66c39b40630f3ca63ba4f6bcc8c204e09035a786a67eeb508d02059aa431 +size 317113 diff --git a/stabilizingqlearningwithlineararchitecturesforprovableefficientlearning/cd4a56c6-683a-4103-a9f2-d41ae8de6216_origin.pdf b/stabilizingqlearningwithlineararchitecturesforprovableefficientlearning/cd4a56c6-683a-4103-a9f2-d41ae8de6216_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..02a0ec5fa8c2e0eb57d40e2e5e142bbebd937057 --- /dev/null +++ b/stabilizingqlearningwithlineararchitecturesforprovableefficientlearning/cd4a56c6-683a-4103-a9f2-d41ae8de6216_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1acd7193141963b343955539585014e931303aaa63a030803c31f7ac12c3eade +size 566347 diff --git a/stabilizingqlearningwithlineararchitecturesforprovableefficientlearning/full.md b/stabilizingqlearningwithlineararchitecturesforprovableefficientlearning/full.md new file mode 100644 index 0000000000000000000000000000000000000000..3d430188aefc88fcfa4f5e404cdc1b18dd3b914b --- /dev/null +++ b/stabilizingqlearningwithlineararchitecturesforprovableefficientlearning/full.md @@ -0,0 +1,1519 @@ +# Stabilizing $Q$ -learning with Linear Architectures for Provably Efficient Learning + +Andrea Zanette1 Martin J. Wainwright2 + +# Abstract + +The $Q$ -learning algorithm is a simple and widely-used stochastic approximation scheme for reinforcement learning, but the basic protocol can exhibit instability in conjunction with function approximation. Such instability can be observed even with linear function approximation. In practice, tools such as target networks and experience replay appear to be essential, but the individual contribution of each of these mechanisms is not well understood theoretically. This work proposes an exploration variant of the basic $Q$ -learning protocol with linear function approximation. Our modular analysis illustrates the role played by each algorithmic tool that we adopt: a second order update rule, a set of target networks, and a mechanism akin to experience replay. Together, they enable state of the art regret bounds on linear MDPs while preserving the most prominent feature of the algorithm, namely a space complexity independent of the number of step elapsed. We show that the performance of the algorithm degrades very gracefully under a novel and more permissive notion of approximation error. The algorithm also exhibits a form of instance-dependence, in that its performance depends on the "effective" feature dimension. + +# 1. Introduction + +The $Q$ -learning algorithm (Watkins, 1989) is a classical and widely-used method for estimating optimal $Q$ -value functions. As a stochastic approximation procedure for solving the Bellman fixed point equation, it comes with strong + +$^{1}$ Department of Electrical Engineering and Computer Sciences, University of California, Berkeley, USA $^{2}$ Department of Electrical Engineering and Computer Sciences and Department of Statistics, University of California, Berkeley, USA. Correspondence to: Andrea Zanette , Martin J. Wainwright . + +Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s). + +convergence guarantees when applied to tabular Markov decision processes (e.g., (Tsitsiklis, 1994; Kearns & Singh, 1999; Even-Dar et al., 2003; Wainwright, 2019a; Li et al., 2021)). When combined with function approximation, however, the basic $Q$ -learning algorithm need not converge, and can exhibit instability. This challenge has motivated various proposals for stabilizing the updates. Among other modifications, experience replay is one ingredient that seems essential to state-of-the-art performance. From a theoretical point of view, however, these mechanisms are not well understood. This state of affairs leaves us with the following open question: is it possible to derive a stable $Q$ -learning procedure with rigorous guarantees for a broad class of problem instances? + +On one hand, recent work has unveiled information-theoretic barriers applicable to any algorithm (Weisz et al., 2020; Zanette, 2020; Wang et al., 2020a; 2021; Weisz et al., 2021; Foster et al., 2021). On the other hand, there exist several MDP models for which sample-efficient RL is possible. In particular, a recent line of papers (Krishnamurthy et al., 2016; Jiang et al., 2017; Sun et al., 2018; Zanette et al., 2020b; Jin et al., 2021; Du et al., 2021) provide analyses of RL procedures for certain MDP classes, and provide procedures that have polynomial sample complexity, albeit with non-polynomial computational complexity. + +The starting point of this paper is to study $Q$ -learning in some settings in which model-free algorithms1 admit polynomial-time implementation. Examples include the class of low-rank MDPs (Jin et al., 2020; Zanette et al., 2020a; Agarwal et al., 2020b;a; Zanette et al., 2021a), and various generalizations thereof (Wang et al., 2019; 2020b). Although the underlying algorithms are polynomial-time, they can still require prohibitive amounts of computation and storage in practical settings. For instance, the memory requirement scales linearly with the amount of experience collected, which limits its practical applicability. + +The $Q$ -learning algorithm is popular in applications precisely because of its low computational complexity, as well + +as memory requirements that do not scale with the iteration count. Thus, we are led to ask whether it is possible to devise a version of $Q$ -learning that is provably efficient when applied to low-rank MDPs. We address this question in the general exploration setting, so that a number of challenges come into play, including credit assignment, moving targets, and distribution shift. + +# 1.1. Our contributions + +The main contribution of this paper is to design and analyze a variant of the $Q$ -learning algorithm that is guaranteed to minimize regret over the class of low-rank MDPs. Three main ingredients are key in our analysis: (1) a second-order update rule for improved statistical efficiency; a set of target networks (Mnih et al., 2015) to stabilize the updates, and most importantly, a replay mechanism called policy replay. This mechanism is similar to experience replay used in the deep RL literature (e.g., (Mnih et al., 2013)). While the second-order scheme and the target networks have been used in the optimization and the RL literature before, the policy replay mechanism is one key reinforcement learning contribution made in this paper. It stabilizes the learning process by eliminating the distribution shift problem that naturally arises when converging to an optimal controller. + +Taken together, these algorithmic tools yield state-of-the-art regret bounds on $H$ -horizon low-rank MDPs with $d$ -dimensional feature representations. At the same time, they preserve one of the most important features of $Q$ -learning, namely a memory requirement that—thanks to the policy replay mechanism—grows only logarithmically with sample size. + +We now provide an informal preview of our main result. We consider an MDP with a finite action space of cardinality $|\mathcal{A}|$ , and take (rescaling as needed) the optimal value function to be bounded in $[0,1]$ . Letting $K$ the number of episodes elapsed, we have the following: + +Theorem 1 (Informal statement). There is a $Q$ -learning algorithm that achieves the regret upper bound $\tilde{\mathcal{O}}(H^2 d^{3/2} \sqrt{K})$ while using $\tilde{\mathcal{O}}(d^3 H^2)$ storage and per-step computational complexity $\mathcal{O}(d^2 |\mathcal{A}|)$ . + +To our knowledge, this is the first regret bound for $Q$ -learning with any function approximator, which makes it the first algorithm with bounded memory complexity for the considered setting. The regret bound is competitive with the state-of-the-art results (Jin et al., 2020), in particular sub-optimal by a factor of $H$ in the regret bound. + +In this work, we also introduce a new notion of model misspecification, one especially well-suited to the analysis of temporal difference RL algorithms. It is a much weaker requirement than the $\ell_{\infty}$ -norm bounds on mis-specification adopted in prior analyses; instead, it involves the expected + +off-policy prediction error. To the best of our knowledge, this leads to the mildest form of approximation error control for regret-minimizing algorithms using temporal differences and function approximation. + +Our results are also partially instance-dependent, in the sense that we obtain faster rates for "easier problems". In particular, we show that the dimension $d$ in Theorem 1 can (mostly) replaced by the effective dimension, a quantity that can be much smaller. We are not aware of instance-dependent results of this type when the algorithm is not provided with side knowledge of the problem structure. + +Due to space limitation, the relation with past work is discussed in Appendix A.1. + +# 2. Background and problem formulation + +# 2.1. Finite-horizon Markov decision processes + +In this paper, we focus on finite-horizon Markov decision processes; see the standard references (Puterman, 1994; Bertsekas & Tsitsiklis, 1996) for more background and detail. A finite-horizon MDP is specified by a positive integer $H$ , and events take place over a sequence of stages indexed by the time step $h \in [H] \stackrel{\text{def}}{=} \{1, \ldots, H\}$ . The underlying dynamics involve a state space $S$ , and are controlled by actions that take values in some action set $\mathcal{A}$ . In the analysis of this paper, the state space is allowed to be arbitrary (discrete or continuous), but we restrict to a finite action space. + +For each time step $h\in [H]$ , there is a reward function $r_h$ .. $\mathcal{S}\times \mathcal{A}\to \mathbb{R},$ and for every time step $h$ and state-action pair $(s,a)$ , there is a probability transition function $\mathbb{P}_h(\cdot \mid s,a)$ When at horizon $h$ , if the agent takes action $a$ in state $s$ , it receives a random reward drawn from a distribution $R_{h}(s,a)$ with mean $r_h(s,a)$ , and it then transitions randomly to a next state $s^{\prime}$ drawn from the transition function $\mathbb{P}_h(\cdot \mid s,a)$ + +A policy $\pi_h$ at stage $h$ is a mapping from the state space $\mathcal{S}$ to the action space $\mathcal{A}$ . Given a full policy $\pi = (\pi_1, \dots, \pi_H)$ , the state-action value function at time step $h$ is given by + +$$ +Q _ {h} ^ {\pi} (s, a) = r _ {h} (s, a) + \mathbb {E} _ {S _ {\ell} \sim \pi | (s, a)} \sum_ {\ell = h + 1} ^ {H} r _ {\ell} \left(S _ {\ell}, \pi_ {\ell} \left(S _ {\ell}\right)\right), +$$ + +where the expectation is over the trajectories induced by $\pi$ upon starting from the pair $(s,a)$ . When we omit the starting state-action pair $(s,a)$ , the expectation is intended to start from a fixed state denoted by $s_1$ . Any policy is associated with a value function $V_h^\pi (s) = Q_h^\pi (s,\pi_h(s))$ , along with a Bellman evaluation operator + +$$ +\begin{array}{l} \mathcal {T} _ {h} ^ {\pi} \left(Q _ {h + 1}\right) (s, a) = r _ {h} (s, a) \\ + \mathbb {E} _ {S ^ {\prime} \sim \mathbb {P} _ {h} (s, a)} \mathbb {E} _ {A ^ {\prime} \sim \pi} Q _ {h + 1} \left(S ^ {\prime}, A ^ {\prime}\right). \\ \end{array} +$$ + +Under some regularity conditions (Puterman, 1994; Shreve + +& Bertsekas, 1978), there always exists an optimal policy $\pi^{\star}$ whose value and action-value functions achieve the suprema + +$$ +V _ {h} ^ {\star} (s) = V _ {h} ^ {\pi^ {\star}} (s) = \sup _ {\pi} V _ {h} ^ {\pi} (s), \quad \text {a n d} +$$ + +$$ +Q _ {h} ^ {\star} (s, a) = Q _ {h} ^ {\pi^ {*}} (s, a) = \sup _ {\pi} Q _ {h} ^ {\pi} (s, a). +$$ + +uniformly over all states and actions. We use $\mathbb{E}_{\pi}[\phi_h] \stackrel{\text{def}}{=} \mathbb{E}_{(S_h, A_h) \sim \pi}[\phi_h(S_h, A_h)]$ to denote the expected feature vector at timestep $h$ . + +We analyze algorithms that produce sequences of policies $\{\pi^1,\dots ,\pi^K\}$ , and for any such sequence, we define the regret + +$$ +\operatorname {R E G R E T} (K) \stackrel {\text {d e f}} {=} \sum_ {k = 1} ^ {K} \mathbb {E} _ {s _ {1} \sim \rho} \left(V _ {1} ^ {\star} - V _ {1} ^ {\pi^ {k}}\right) (s _ {1}). \tag {1} +$$ + +Whenever we have a sequence $n^1, \ldots, n^k$ of values we denote with $n^{1:k} = \sum_{i=1}^{k} n^i$ their sum. + +# 2.2. Structural conditions + +Let now us lay out some assumptions on the MDPs and function approximation schemes. + +# 2.2.1. LINEAR FUNCTION APPROXIMATIONS + +For each $h \in [H]$ , let $\phi_h: \mathcal{S} \times \mathcal{A} \mapsto \mathbb{R}^d$ be a given feature map. Throughout this paper, we assume the uniform boundedness condition + +$$ +\sup _ {s, a} \| \phi_ {h} (s, a) \| _ {2} \leq 1 \quad \text {f o r a l l} h \in [ H ]. \tag {2} +$$ + +For a given parameter vector $\theta_h \in \mathbb{R}^d$ , define the function $f_{h,\theta}(s,a) \stackrel{\text{def}}{=} \langle \phi_h(s,a), \theta_h \rangle$ . With a slight abuse of notation, given a partitioned vector $\theta = (\theta_1, \ldots, \theta_H) \in (\mathbb{R}^d)^H$ , we use the shorthand $f_\theta = (f_{1,\theta_1}, \ldots, f_{H,\theta_H})$ for the associated collection of functions. + +In this paper, we study algorithms that produce linear functions in the class + +$$ +\mathcal {Q} ^ {(\mathrm {l i n})} \stackrel {\text {d e f}} {=} \left\{f _ {\theta} \mid \| \theta_ {h} \| _ {2} \leq 1 \quad \text {f o r a l l} h \in [ H ] \right\}. \tag {3a} +$$ + +Note that the bounded feature map condition (2), in conjunction with the Cauchy-Schwarz inequality, implies that + +$$ +\left\| f _ {h, \theta_ {h}} \right\| _ {\infty} = \sup _ {s, a} | f _ {h, \theta_ {h}} (s, a) | \leq 1 \quad \text {f o r a n y} f _ {\theta} \in \mathcal {Q} ^ {(\mathrm {l i n})}. +$$ + +Consequently, the function class is contained with the larger class of action-value functions $(s,a)\mapsto Q_h(s,a)$ that are uniformly bounded in sup-norm--more precisely, the class + +$$ +\mathcal {Q} ^ {(\text {a l l})} \stackrel {\text {d e f}} {=} \left\{\left(Q _ {1}, \dots Q _ {H}\right) \mid \| Q _ {h} \| _ {\infty} \leq 1 \quad \text {f o r a l l} h \in [ H ] \right\}. \tag {3b} +$$ + +The definitions above can be specialized for a specific timestep $h$ in a natural way, in which case we denote the corresponding function spaces by $\mathcal{Q}_h^{(\mathrm{lin})}$ and $\mathcal{Q}_h^{(\mathrm{all})}$ . + +# 2.2.2.BELLMAN CONDITIONS + +Our work covers both the settings with low inherent Bellman error (e.g., (Munos & Szepesvári, 2008; Zanette et al., 2020b)) as well as low-rank MDPs (e.g., (Yang & Wang, 2020; Jin et al., 2020)), which we introduce next. In both cases we assume that $\mathcal{Q}_{H + 1}^{\mathrm{(lin)}} = \mathcal{Q}_{H + 1}^{\mathrm{(all)}} = \{0\}$ . + +Assumption 1 (Bellman closure). We say that an MDP and a feature representation $\phi$ have zero inherent Bellman error if for each $h\in [H]$ and any $Q_{h + 1}\in \mathcal{Q}_{h + 1}^{(lin)}$ , there exists $Q_{h}\in \mathcal{Q}_{h}^{(lin)}$ such that $Q_{h} = T_{h}Q_{h + 1}$ . + +Assumption 2 (Low-Rank). An MDP is low rank with respect to the feature representation $\phi$ if for each $h\in [H]$ , the following holds: + +$$ +\forall Q _ {h + 1} \in \mathcal {Q} _ {h + 1} ^ {(a l l)}, t h e r e e x i s t s Q _ {h} \in \mathcal {Q} _ {h} ^ {(l i n)} s. t. Q _ {h} = \mathcal {T} _ {h} Q _ {h + 1}. +$$ + +It can be shown that the class of low-rank MDP models is strictly contained within the class of MDPs with zero inherent Bellman error; see the paper (Zanette et al., 2020b) for further details. + +Model misspecification: When the representation conditions do not exactly hold, we need to measure model misspecification. With this aim, we introduce two definitions of model misspecification that are appropriate for RL with temporal difference methods. The first one measures the violation of Assumption 1 with respect to a stationary external controller, while the second one measures the violation with respect to Assumption 2 when a single stationary controller is not available. + +Before stating the definitions, let us introduce some more notation and terminology along with their motivation. Let $\pi$ be a policy that generates a dataset used to fit a predictor. Using the data generated by $\pi$ , we will make predictions about a target policy $\overline{\pi}$ which could be arbitrary. The predictor that we seek should fit $\mathcal{T}Q'$ where $Q' \in \mathcal{Q}^{(\mathrm{lin})}$ or $Q' \in \mathcal{Q}^{(\mathrm{all})}$ depending on whether we seek to quantify the violation of Assumption 1 or Assumption 2, respectively. Accordingly, define the population minimizer $\theta^{\pi, Q', h}$ along $\pi$ with $Q'$ as next state value function as + +$$ +\begin{array}{l} \theta^{\pi ,Q^{\prime},h}\stackrel {def}{=}\underset {\theta \in \mathcal{B}}{\arg \min}\mathbb{E}_{(S_{h},A_{h})\sim \pi} \\ \left\{\langle \phi_ {h} (S _ {h}, A _ {h}), \theta \rangle - (\mathcal {T} _ {h} Q ^ {\prime}) (S _ {h}, A _ {h})) \right\} ^ {2}. (4) \\ \end{array} +$$ + +Let us now state a definition of model misspecification that measures the violation with respect to Assumption 1 (Bellman closure) whenever there exists an external stationary + +controller $\pi$ . This definition involves a non-negative error term $\nu \geq 0$ referred to as transfer error. + +Definition 1 (Model Misspecification w.r.t. Bellman Closure). An MDP and a feature map $\phi$ are $\nu$ -misspecified with respect to the Bellman closure condition and the stationary policy $\pi$ if for any policy $\overline{\pi}$ and action-value function $Q' \in \mathcal{Q}^{(lin)}$ the best on policy fit $Q_h : (s, a) \mapsto \langle \phi_h(s, a), \theta^{\pi, Q', h} \rangle$ along $\pi$ satisfies the bound + +$$ +\left| \sum_ {h = 1} ^ {H} \mathbb {E} _ {\left(S _ {h}, A _ {h}\right) \sim \bar {\pi}} \left[ Q _ {h} \left(S _ {h}, A _ {h}\right) - \left(\mathcal {T} _ {h} Q _ {h + 1} ^ {\prime}\right) \left(S _ {h}, A _ {h}\right) \right] \right| \leq \nu . \tag {5} +$$ + +In summary, Definition 1 measures the average Bellman error that arises when evaluating the predictor fit on the controller's distribution along other distributions. This is a significantly more generous requirement than $\ell_{\infty}$ model misspecification, and is algorithm-independent. Notice that the expectation is inside the absolute value. We conclude by presenting an extension of Definition 1, one that applies to the exploration setting where there is no single stationary controller that generates the dataset. + +Definition 2 (Model Misspecification w.r.t. Low Rank). An MDP and a feature map $\phi$ are $\nu$ -misspecified with respect to the low rank condition if for any two policies $\pi, \overline{\pi}$ and action value function $Q' \in \mathcal{Q}^{(all)}$ , the best on policy fit $Q_h : (s, a) \mapsto \langle \phi_h(s, a), \theta^{\pi, Q', h} \rangle$ satisfies the bound (5). + +The primary distinction between Definition 1 and Definition 2 is that the latter needs to hold when $Q' \in \mathcal{Q}^{(\mathrm{all})}$ instead of just $Q' \in \mathcal{Q}^{(\mathrm{lin})}$ . + +# 3. Algorithms + +This section is devoted to a description of the $Q$ -learning procedures analyzed in this paper. We begin by providing some intuition for our algorithms in Section 3.1. Section 3.2 is devoted to the description of Stabilized, Second-Order, Streaming $Q$ -learning algorithm, or $\mathbf{S}^3\mathbf{Q}$ -LEARNING for short. It corresponds to a stabilized and streaming form of $Q$ -learning that estimates the optimal policy based on data drawn from some fixed (stationary) controller policy. We use this algorithm as a building block for the more sophisticated algorithm described in Section 3.3, which allows for the data-generating policy to also change, essential to obtaining an overall scheme with low regret. We refer to this procedure as Sequentially Stabilized Second-order Streaming $Q$ -learning, or $\mathbf{S}^4\mathbf{Q}$ -LEARNING for short. + +# 3.1. Some intuition + +Let us begin by providing some intuition for the algorithms that are proposed and analyzed in this paper. When the + +basic form of $Q$ -learning is implemented with linear function approximation, the updates are performed directly on the parameter $\theta$ associated with the linear representation. Upon observing the tuple $(s_h, a_h, r_h, s_h')$ , representing the experienced state, action, reward and successor state at level $h$ , the update rule for a user defined learning rate $\alpha \in \mathbb{R}$ takes the familiar form + +$$ +\theta_ {h} \leftarrow \theta_ {h} - \alpha \Delta \phi_ {h} \left(s _ {h}, a _ {h}\right) \quad \text {w h e r e} \tag {6} +$$ + +$$ +\Delta = \left\langle \phi_ {h} \left(s _ {h}, a _ {h}\right), \theta_ {h} \right\rangle - r _ {h} - \max _ {a ^ {\prime}} \left\langle \phi_ {h + 1} \left(s _ {h} ^ {\prime}, a ^ {\prime}\right), \theta_ {h + 1} \right\rangle . +$$ + +Although $Q$ -learning is a form of stochastic approximation, as are stochastic gradient methods, the above update is not equivalent to stochastic gradient. However, for the purposes of analysis, it is useful to consider some restrictions under which it can be related to a stochastic gradient method. + +For a moment, let us additionally assume that (a) the next timestep parameter $\theta_{h + 1}$ is never updated, and (b) the tuple $(s_h,a_h,r_h,s_h^{\prime})$ is drawn from a stationary distribution. When these conditions are met, the update (6) corresponds to a stochastic gradient update as applied to the squared loss + +$$ +\begin{array}{l} \theta_ {h} \mapsto \mathbb {E} _ {\left(S _ {h}, A _ {h}, R _ {h}, S _ {h} ^ {\prime}\right)} \bigg [ \underbrace {\left\langle \phi_ {h} \left(S _ {h} , A _ {h}\right) , \theta_ {h} \right\rangle} _ {\text {p r e d i c t o r}} \\ \left. - \underbrace {\left(R _ {h} + \max _ {a ^ {\prime}} \left\langle \phi_ {h + 1} \left(S _ {h} ^ {\prime} , a ^ {\prime}\right) , \theta_ {h + 1} \right\rangle\right)} _ {\text {f i x e d t a r g e t f u n c t i o n}} \right] ^ {2}, \tag {7} \\ \end{array} +$$ + +where the expectation is over the stationary distribution that generates the data. This is an algorithm that we know how to analyze. + +With this perspective in place, our high-level idea is to enforce these two conditions—namely, a fixed target and a stationary distribution for drawing samples. However, so as to be able to estimate an optimal policy while incurring low regret, the next state-value function and the sampling distribution cannot be “locked in” forever, but instead need to evolve with time. The core algorithmic contribution of this paper is the design of a device to periodically update the next-state value function and the sampling distribution so as to allow convergence to an optimal controller in a stable way. In addition, we use a second-order update in place of the first-order scheme (6) so as to achieve improved statistical efficiency. + +We first describe an algorithm for the controlled setting, in which stream of states, actions, rewards and transitions are generated by a stationary controller. In this case, only the next-state action value function needs to be updated periodically, because the distribution that generates the experience is fixed. Next, we design a meta-algorithm that performs exploration while additionally ensuring that the $Q$ -learning update rule is fed with data from a stationary controller. + +# 3.2. $\mathbf{S}^3\mathbf{Q}$ -LEARNING + +In this section, we introduce the Stabilized, Second-Order, Streaming $Q$ -learning algorithm, or $\mathbf{S}^3\mathbf{Q}$ -LEARNING for short. The algorithm takes as input a stationary controller policy $\pi$ that generates a stream of states, actions, rewards and transitions. Target networks are used to stabilize the value function updates, which are performed via a second-order update rule for improved statistical efficiency. This is a streaming algorithm, meaning that each sample is immediately processed and then discarded. + +Learning mechanics: The $S^3$ Q-LEARNING algorithm is detailed in Algorithm 1. The algorithm proceeds over a sequence of epochs, denoted by $e$ in the algorithm. Each epoch is handled by the outermost "while" loop. Within each epoch, the algorithm sequentially updates the target networks $\hat{Q}_h^{tar}$ at each level $\ell$ proceeding backward from $\ell = H$ to $\ell = 1$ . This order of updates ensures that the next-timestep $(\ell + 1)$ target network is always up to date to compute the bootstrapped $Q$ values needed at level $\ell$ to compute the temporal difference (TD) error (see Line 12 and Eq. (8)). When the update has completed in every level $\ell \in [H]$ , the target networks are stored in the predictor $\widehat{Q}^\star$ , which is the one that the algorithm considers to be the "best" estimate of $Q^\star$ . At this point, a new epoch begins. + +Let us now describe the update rule in Lines 12 and 13. At each timestep $h$ the algorithm observes a tuple of state, action, reward and transition $(s_h, a_h, r_h, s_{h+1})$ and uses them to update $\widehat{\theta}_h$ . To be clear, $\widehat{\theta}_h$ is associated to a network different from the target network $\widehat{Q}_h^{tar}$ for that timestep. To perform the update, the algorithm first computes the temporal difference error + +$$ +\mathrm {T D} _ {h} \stackrel {\text {d e f}} {=} r _ {h} + \max _ {a ^ {\prime}} \widehat {Q} _ {h + 1} ^ {\operatorname {t a r}} \left(s _ {h + 1}, a ^ {\prime}\right) - \left\langle \phi_ {h} \left(s _ {h}, a _ {h}\right)\right), \widehat {\theta} _ {h} \rangle \tag {8} +$$ + +in Line 12 and then updates the network parameter $\widehat{\theta}_h$ using a second order update rule (in place of Eq. (6)) together with the empirical covariance $\Sigma_h^{-1}$ , see Line 13. Such update rule effectively minimizes the least-squares criterion (7), as it coincides with the Sherman-Morrison rank one update. + +The stopping condition in line 8 can be any arbitrary stopping time; without it, the algorithm will simply keep running indefinitely. + +# 3.3. $\mathbf{S}^4\mathbf{Q}$ -LEARNING + +When the stream of data is generated by a controller that is converging to an optimal one—a necessary condition to + +obtain low regret—the experience it generates is no longer stationary. We will now introduce a simple device, the policy replay mechanism, that allows the controller to evolve with time while ensuring that there is no distribution shift during the $Q$ -learning updates. It leads to an algorithm that converges to an optimal controller under some assumptions. This is achieved by sequentially invoking $\mathrm{S}^3\mathrm{Q}$ -LEARNING using stationary controllers that are increasingly more optimal; the resulting algorithm is called Sequentially Stabilized Second-order Streaming $Q$ -learning, or $\mathrm{S}^4\mathrm{Q}$ -LEARNING for short, and is detailed in Algorithm 2. + +Policy replay for experience replay: The policy replay mechanism generates new experience using past policies. The past policies are stored in the policy replay memory $\Pi \stackrel{\text{def}}{=} \{(\pi_i, n_i)\}_{i=1}^p$ , which contains a set of policies $\pi_i$ associated to a number of samples $n_i$ . The policy replay mechanism extracts a stationary mixture policy from $\Pi$ , defined as the controller that plays each policy $\pi_i$ with probability proportional to $n_i$ for the full episode. Such mixture policy is taken as stationary controller to invoke S $^3$ Q-LEARNING, along with a suitable exploration bonus to produce optimistic $Q$ -values that guide the exploration. The stopping condition to be used in Line 8 in Algorithm 1 is the number of trajectories $cHm_{\mathrm{tot}}$ for an appropriate constant $c$ , see line Line 6 in Algorithm 2. + +The policy replay mechanism is similar in purpose to experience replay where the experience $\{(s_i, a_i, r_i, s_i')\}$ generated so far is stored and used to retrain the network. However, unlike experience replay, the policy replay memory does not store the full dataset and instead just contains a 'recipe' for generating a statistically similar dataset by re-playing past policies. In this way, the memory complexity does not grow with the number of iterations beyond a mild logarithmic term, making our algorithm truly streaming. And while the policy replay mechanism requires additional samples, the regret remains well controlled because the policies in II are progressively more and more near-optimal: in the limit, the policies in the policy replay memory generate samples with vanishing regret. + +Having described the policy replay mechanism, we can now illustrate how $\mathrm{S}^4\mathrm{Q}$ -LEARNING conducts exploration using such device. + +Learning mechanics: The $\mathrm{S}^4\mathrm{Q}$ -LEARNING algorithm proceeds in phases which are indexed by $p$ inside the algorithm. At the beginning of each phase, the algorithm invokes the $\mathrm{S}^3\mathrm{Q}$ -LEARNING subroutine with a controller $\pi_{\mathrm{Control}}$ that is a mixture policy among those in the current policy replay memory $\Pi$ , as described in the prior paragraph. The $\mathrm{S}^3\mathrm{Q}$ -LEARNING procedure then returns an optimistic action-value function estimate $Q$ from which the greedy (optimistic) policy $\pi$ is extracted in Line 7 of Algorithm 2. + +Algorithm 1 S3Q-LEARNING +1: Input: Controller $\pi$ ,(optional) stopping condition,(optional) bonus function $b$ +2: $\widehat{Q}_{\ell}^{tar}(\cdot ,\cdot) = 0,\forall \ell \in [H + 1];e = 0$ ▷ Initialize target network and epoch counter +3: while True do +4: $e = e + 1$ ▷ New epoch begins +5: for level $\ell = H,H - 1,\dots ,2,1$ do +6: $\widehat{\theta}_{\ell} = 0;\Sigma_{\ell} = \lambda_{\mathrm{Reg}}I;$ ▷ Initialize network and covariance +7: for $n^\ell = 1,\ldots ,2^e$ do +8: if STOPPING CONDITION then return $\widehat{Q}^{\star}$ +9: $s_1\sim \rho$ ▷ Get start state +10: for timestep $h = 1,2,\dots ,H$ do +11: Play $a_{h} = \pi_{h}(s_{h})$ and get $(r_h,s_{h + 1};\phi_h\stackrel {def}{=}\phi_h(s_h,a_h)$ ▷ Play and advance +12: $\mathrm{TD}_h = r_h + \max_{a'}\widehat{Q}_{h + 1}^{tar}(s_{h + 1},a') - \langle \phi_h,\widehat{\theta}_h\rangle ,$ ▷ Compute TD error +13: $\widehat{\theta}_h\gets \widehat{\theta}_h + \frac{\Sigma_h^{-1}\phi_h\mathrm{TD}_h}{1 + \| \phi_h\|_{\Sigma_h^{-1}}^2};\quad \Sigma_h^{-1}\gets \Sigma_h^{-1} - \frac{\Sigma_h^{-1}\phi_h\phi_h^\top\Sigma_h^{-1}}{1 + \| \phi_h\|_{\Sigma_h^{-1}}^2}$ ▷ Update network and covariance +14: end for +15: end for +16: $\widehat{\theta}_{\ell}^{tar} = \min_{\theta \in \mathcal{B}}\| \theta -\widehat{\theta}_{\ell}\|_{\Sigma_{\ell}}^2$ ▷ Project parameter +17: $\widehat{Q}_{\ell}^{tar}(\cdot ,\cdot)\gets \langle \phi_{\ell}(\cdot ,\cdot),\widehat{\theta}_{\ell}^{tar}\rangle$ or $\widehat{Q}_{\ell}^{tar}(\cdot ,\cdot)\gets \min \{1,\langle \phi_{\ell}(\cdot ,\cdot),\widehat{\theta}_{\ell}^{tar}\rangle +b_{\ell}(\cdot ,\cdot)\}$ ▷ Update target network +18: end for +19: $\widehat{Q}^{\star}\gets \widehat{Q}^{tar}$ ▷ Save best approximator +20: end while + +The $S^4$ Q-LEARNING algorithm then proceeds to collect trajectories from the greedy policy $\pi$ until "sufficient progress" is made. In order to measure the progress, the agent maintains the accumulator $T$ and updates it in Line 13. Once $T$ is larger than a certain value (see Line 16), the procedure has made sufficient progress on the current data, so that $Q$ network should be updated with fresh data. The triggering condition in Line 16 is essentially equivalent to checking that the determinant of the cumulative covariance has doubled with respect to that of the prior epoch (cf. a similar condition for linear bandits (Abbasi-Yadkori et al., 2011)). When the determinant doubles, the agent has acquired sufficient information and a new policy may be computed. An important difference here is that the determinant should refer to the expected cumulative covariance, which is unknown, and such determinant ratio must thus be estimated from data; our accumulator $T$ performs such task. + +In order to update the $Q$ network, $\mathbf{S}^4\mathbf{Q}$ -LEARNING constructs a new bonus function and adds the current greedy policy $\pi$ to the policy replay memory (together with the number of trajectories that should be generated from such policy). A new phase can now begin with a call to $\mathbf{S}^3\mathbf{Q}$ -LEARNING using a newly constructed, more optimal controller and smaller bonus function. + +# 4. Main results + +We now turn to the statement of our main results, along with discussion of some of their consequences. We begin + +in Section 4.1 by describing the form of the bonus function used in our algorithms, along with the effective dimension that appears in our bounds. Section 4.2 is devoted to our main result—namely, a performance guarantee for the $S^4$ Q-LEARNING algorithm. In Section 4.3, we elaborate upon the guarantees for the $S^3$ Q-LEARNING algorithm that underlie our main result. + +# 4.1. Bonus function and effective dimension + +Bonus function: The bonus function used in phase $p$ is + +$$ +b _ {h} (\cdot , \cdot) \stackrel {\text {d e f}} {=} \alpha_ {h} \| \phi_ {h} (\cdot , \cdot) \| _ {\Sigma_ {h} ^ {- 1}}, \quad \text {w h e r e} +$$ + +$$ +\alpha_ {h} \stackrel {\text {d e f}} {=} c \left\{\sqrt {d \log \left(\frac {d p n ^ {(1 : p)}}{\delta}\right)} + \sqrt {\lambda_ {\mathrm {R e g}}} \right\}. \tag {9} +$$ + +Here $c > 0$ is a universal constant; we use $n^{(1:p)} = \sum_{i=1}^{p} n^{(i)}$ to denote the samples used in phases 1 through $p$ ; and $\Sigma_h$ is a cumulative covariance matrix. The empirically estimated cumulative covariance $\Sigma$ is constructed as follows. Let $\pi_{\text{Control}}$ denote the controller used to call $S^3 Q$ -LEARNING in phase $p-1$ , and let $\pi$ denote the greedy policy used by $S^4 Q$ -LEARNING in the same phase. The cumulative covariance takes the form + +$$ +\Sigma_ {h} = \underbrace {\sum_ {i = 1} ^ {m _ {\mathrm {t o t}}} \phi_ {i h} \phi_ {i h} ^ {\top} + \lambda_ {\mathrm {R e g}} I} _ {\substack {\mathrm {S} ^ {3} \mathrm {Q - L E A R N I N G} \\ \text {covariance} \\ \text {returned in phase } p - 1}} + \underbrace {\sum_ {j = 1} ^ {m _ {p}} \phi_ {j h} \phi_ {j h} ^ {\top}} _ {\substack {\mathrm {S} ^ {4} \mathrm {Q - L E A R N I N G} \\ \text {covariance} \\ \text {added in phase } p - 1}}, \tag{10} +$$ + +Algorithm 2 $\mathbf{S}^4\mathbf{Q}$ LEARNING +1: Input: Bonus function $b$ , update trigger $T_{\mathrm{Trig}} = \Theta (\log \frac{pK}{\delta})$ +2: $\Pi_h = \emptyset ;\forall h\in [H]$ ▷ Initialize policy replay memory +3: for phase $p = 1,2,\ldots$ do +4: $m_{\mathrm{tot}} = \sum_{j = 1}^{p - 1}m_j$ for $(\pi_j,m_j)\in \Pi$ ▷ Get total # trajectories to simulate +5: $\pi_{\mathrm{Control}}\stackrel {\textit{def}}{=}$ at the start of the episode play $\pi_{j}$ with probability $m_j / m_{\mathrm{tot}},\forall j\in [p - 1]$ ▷ Define controller +6: $(Q,\Sigma^{ref})\leftarrow \mathrm{S}^3\mathrm{Q}$ LEARNING( $\pi_{\mathrm{Control}},cHm_{\mathrm{tot}},b),c\in \mathbb{R}$ ▷ Get optimistic $Q$ values +7: $\pi_h(\cdot) = \arg \max_a Q_h(\cdot ,a),\forall h\in [H]$ ▷ Extract greedy policy +8: $\Sigma = \Sigma^{ref}$ $m = 0$ $T_{h} = 0$ $\forall h\in [H]$ ▷ Initialize # trajectories and trigger value +9: repeat +10: $s_1\sim \rho$ ▷ Get start state +11: for $h = 1,2,\dots ,H$ do +12: Play $a = \pi_h(s)$ . $m = m + 1$ ▷ Play and increment counter +13: $T_{h}\gets T_{h} + \| \phi_{h}(s,a)\|_{(\Sigma_{h}^{ref})^{-1}}^{2};\Sigma_{h}\gets \Sigma_{h} + \phi_{h}(s,a)\phi_{h}(s,a)^{\top}$ ▷ Increment accumulator and covariance +14: Get next state $s^+;s\gets s^+$ ▷ Advance +15: end for +16: until $\exists h\in [H]$ such that $T_{h}\geq T_{\mathrm{Trig}}$ +17: $\Pi \gets \Pi \cup \{(\pi ,m)\} ;b_h(\cdot ,\cdot) = \alpha_h\| \phi (\cdot ,\cdot)\|_{\Sigma_h^{-1}}$ ▷ Update policy replay memory and bonus +18: end for + +where $\phi_{ih} \sim \pi_{\mathrm{Control}}$ , $\phi_{jh} \sim \pi$ . Note that $\Sigma_h$ is formed by the sum of the cumulative covariance matrix returned by $\mathbf{S}^3\mathbf{Q}$ -LEARNING along with additional terms computed by $\mathbf{S}^4\mathbf{Q}$ -LEARNING between Line 9 to Line 16 in phase $p - 1$ . + +Notice that the empirical covariance $\Sigma_h$ is estimated de novo within each phase $p$ , and due to statistical fluctuations, it does not grow monotonically across phases. Nonetheless, the covariance and the bonus are two devices to measure the progress of the algorithm. + +Information gain and effective dimension: We now define the effective dimension $\widetilde{d_h}$ at time step $h$ . It is a scalar quantity that governs the complexity of the exploration problem, defined as + +$$ +\widetilde {d _ {h}} = \max _ {\pi} \log \left(\det \left(I + \frac {n}{\lambda_ {\mathrm {R e g}}} \mathbb {E} _ {\phi_ {h} \sim \pi} [ \phi_ {h} \phi_ {h} ^ {\top} ]\right)\right). \tag {11} +$$ + +We note that this notion has been exploited in past work (Srinivas et al., 2009; Yang & Wang, 2020; Agarwal et al., 2020a; Du et al., 2021). The information gain can be much smaller than the dimensionality $d$ of the feature vectors $\phi$ —that is, we can have $\widetilde{d}_h \ll d_h$ . This scaling holds, for instance, when the feature moment matrix $\mathbb{E}_{\phi_h \sim \pi}[\phi_h \phi_h^\top]$ is mostly concentrated along few directions; see Lemma 11 in Appendix D.2 for details. + +# 4.2. Guarantees for $\mathbf{S}^4\mathbf{Q}$ -LEARNING + +We are now ready to present our main result, namely a bound on the regret incurred by all the policies that generate rollouts, including those played by the $S^3$ Q-LEARNING subroutine when it is called by $S^4$ Q-LEARNING. We assume + +that the bonus function is defined according to Eq. (9) with an appropriately chosen universal constant. + +Theorem 1 (Performance Bound of $S^4$ Q-LEARNING). Consider an MDP that is $\nu$ -misspecified w.r.t. Bellman closure (cf. Definition 2). Then for any number of episodes, there exists an event $\mathcal{E}_K$ that holds with probability at least $1 - \delta$ , and under this event, we have the following guarantees: + +(a) The average regret of $\mathbf{S}^4\mathbf{Q}$ -LEARNING is upper bounded as $\mathrm{AveReg}(K)\leq$ + +$$ +c L \left\{\frac {H}{\sqrt {K}} \left[ \left(\sum_ {h = 1} ^ {H} \widetilde {d} _ {h}\right) \times \left(\sum_ {h = 1} ^ {H} \left(d _ {h} + 1\right) \widetilde {d} _ {h}\right) \right] ^ {1 / 2} + \nu \right\} \tag {12} +$$ + +where $L \stackrel{\text{def}}{=} \log\left(\frac{dp_{tot}K}{\delta}\right)$ . + +(b) The memory complexity is bounded as $\mathcal{O}(Ld^2 H\sum_h\widetilde{d_h}) = \mathcal{O}(Ld^3 H^2)$ while the per-step computational complexity is $\mathcal{O}(|\mathcal{A}|d^2)$ . + +See Appendix C for the proof of this claim. + +In absence of model misspecification $(\nu = 0)$ and the special case $d_h = \widetilde{d}_h$ for all $h$ , the worst-case regret bound becomes $\widetilde{\mathcal{O}}\big(H^2\sqrt{d^3K}\big)$ . Here $\widetilde{\mathcal{O}}$ includes constant and logarithmic factors. + +Some comments: When the value function is rescaled to be in $[0, H]$ instead of the unit interval $[0, 1]$ , the regret bound of $S^4$ Q-LEARNING becomes $\widetilde{\mathcal{O}}(H^3 \sqrt{d^3 K})$ , which + +is larger by only a factor of $H$ relative to the state-of-the-art $\widetilde{\mathcal{O}}(H^2\sqrt{d^3K})$ bound available for computationally tractable algorithms (Jin et al., 2020). + +This slightly sub-optimal sample complexity is counterbalanced by a number of advantages of $\mathrm{S^4Q}$ -LEARNING. One major benefit is the low memory footprint, which depends only on $K$ via a logarithmic factor. To the best of our knowledge, all previous methods that apply in this setting need to store the full experience, leading to a memory requirement scaling at least linearly in the number of episodes $K$ . For problems with a large number of interactions, this linear scaling can be prohibitive. + +Additionally if the horizon is not very large, the $S^4$ Q-LEARNING bound might be substantially tighter than the guarantees in Jin et al. (Jin et al., 2020), since it primarily scales with the effective dimension $\widetilde{d}$ . To the best of our knowledge, our result gives the first adaptive and tractable algorithm for this setting with regret bounds depending on the effective dimension $\widetilde{d}$ . In contrast, existing algorithms with regret bounds in terms of the effective dimension need to know its value to inherit an improved regret bound (Agarwal et al., 2020a; Yang & Wang, 2020); in this sense, they are non-adaptive guarantees. + +Finally, our approximation error guarantees are new for value-based exploration algorithms and close some of the gaps with respect to policy gradient methods. The approximation error of $\mathrm{S}^4\mathrm{Q}$ -LEARNING scales with the worst-case off-policy expected prediction error. To the best of our knowledge, temporal difference methods that perform exploration have only been analyzed with $\ell_{\infty}$ -approximation guarantees. Instead, in policy gradient algorithms (Agarwal et al., 2020a; Zanette et al., 2021a), the approximation error is measured in expectation with respect to an arbitrary comparator. Our approximation error depends on the worst-case (with respect to the policies) approximation error, but the error is still measured in expectation, and furthermore, the expectation is inside the absolute value. + +# 4.3. Guarantees for $\mathbf{S}^3\mathbf{Q}$ -LEARNING + +When a stationary controller is available, the $S^3 Q$ -LEARNING algorithm can be used to maintain a running estimate of the optimal action value function $Q^{\star}$ with a low memory footprint. This guarantee is of independent interest: the basic protocol illustrated in Algorithm 1 serves as a building block for sophisticated algorithms, with the $S^4 Q$ -LEARNING procedure analyzed in this paper being one example. Of course, in the controlled setting the quality of the value function estimate will also depend on how exploratory the controller policy is; some notation will be introduced shortly to quantify this. + +Let us define the expected cumulative covariance matrix + +after $n$ samples from the (controller) policy $\pi$ as + +$$ +\bar {\Sigma} _ {h} (n) = n \left\{\mathbb {E} _ {\phi_ {h} \sim \pi} \left[ \phi_ {h} \phi_ {h} ^ {\top} \right] + \lambda_ {\operatorname {R e g}} I \right\}, \tag {13} +$$ + +where $\lambda_{\mathrm{Reg}} > 0$ is a fixed positive regularization parameter. Given a stationary controller $\pi$ and a bonus function $b$ , the $\mathrm{S}^3\mathrm{Q}$ -LEARNING algorithm returns a sequence of estimated $Q$ -functions $\widehat{Q}^{\star} = (\widehat{Q}_1^{\star},\dots,\widehat{Q}_H^{\star})\in \mathcal{Q}^{(\mathrm{lin})}$ . In this section, we state some bounds on the value function error $\widehat{Q}^{\star} - Q^{\star}$ when the bonus function $b = 0$ and the violation of Assumption 1 (Bellman closure) is measured according to Definition 1. (We consider the extension to the setting $b\geq 0$ in Appendix D). + +Our analysis involves the Bellman error associated with $\widehat{Q}^{\star}$ , defined for each $h\in [H]$ and $(s,a)$ as the discrepancy of $\widehat{Q}^{\star}$ in satisfying the Bellman equations with $\widehat{Q}_{h + 1}^{\star}$ as the next state value function: + +$$ +\mathcal {E} _ {h} (s, a) \stackrel {\text {d e f}} {=} \widehat {Q} _ {h} ^ {\star} (s, a) - \left(\mathcal {T} _ {h} \widehat {Q} _ {h + 1} ^ {\star}\right) (s, a). \tag {14} +$$ + +Our analysis shows how this Bellman error can be bounded in terms of an uncertainty function and an approximation error. For a given integer sample size $n > 1$ and user-defined error probability $\delta \in (0,1)$ , define the scalar quantity + +$$ +\bar {\alpha} _ {h} (n, \delta) = c \left\{\sqrt {d \log \left(\frac {d n e H}{\delta}\right)} + \sqrt {\lambda_ {\mathrm {R e g}}} \right\}, \tag {15} +$$ + +where $c > 0$ is a universal constant, whose specific value can be determined via the proof. + +Suppose that the algorithm terminates after $e_{tot}$ epochs, and let $K$ be the total number of trajectories. For a given tolerance probability $\delta_{\mathrm{master}} \in (0,1)$ , we define the uncertainty function + +$$ +\mathcal {U} _ {h} (s, a) \stackrel {\text {d e f}} {=} \overline {{\alpha}} _ {h} \left(n ^ {*}, \delta^ {*}\right) \| \phi_ {h} (s, a) \| _ {\left(\overline {{\Sigma}} _ {h} \left(n ^ {*}\right)\right) ^ {- 1}} \tag {16a} +$$ + +$$ +\text {w h e r e} n ^ {*} \stackrel {\text {d e f}} {=} \frac {K}{4 H}, \text {a n d} \delta^ {*} \stackrel {\text {d e f}} {=} \frac {\delta_ {\text {m a s t e r}}}{2 H e _ {t o t} ^ {2}} d. \tag {16b} +$$ + +We define the comparator error + +$$ +\Delta_ {h} ^ {\pi} (s, a) \stackrel {{d e f}} {{=}} \left(\mathcal {T} _ {h} \widehat {Q} _ {h + 1} ^ {t a r}\right) (s, a) - \left\langle \phi_ {h} (s, a), \theta^ {\pi , \widehat {Q} _ {h + 1} ^ {t a r}, h} \right\rangle . \tag {16c} +$$ + +In order to state the theorem, let $\mathbb{E}_{\pi}$ denote the expectation over the trajectories $(S_{1},A_{1},\ldots ,S_{H},A_{H})$ induced by following $\pi$ after sampling from the starting distribution $\rho$ . + +Theorem 2 (Performance bound for $\mathbf{S}^3\mathbf{Q}$ -LEARNING). Consider an MDP that is $\nu$ -misspecified w.r.t. Bellman closure (cf. Definition 1). If the $\mathbf{S}^3\mathbf{Q}$ -LEARNING algorithm is run with the uncertainty function (16a), then for any episode $K$ , with probability at least $1 - \delta_{master}$ , it returns a solution $\widehat{Q}^\star$ such that: + +(a) Its Bellman error function $\mathcal{E}_h\stackrel {def}{=}\widehat{Q}_h^\star -\left(\mathcal{T}_h\widehat{Q}_{h + 1}^\star\right)$ satisfies the pointwise bound for each $(s,a)$ + +$$ +\left| \mathcal {E} _ {h} (s, a) + \Delta_ {h} ^ {\pi} (s, a) \right| \leq \mathcal {U} _ {h} (s, a). \tag {17a} +$$ + +(b) For each $h \in [H]$ , the greedy policy $\overline{\pi}_h(s) \stackrel{def}{=} \arg \max_a \widehat{Q}_h^\star(s, a)$ satisfies the bounds + +$$ +\begin{array}{l} - \mathbb {E} _ {\pi^ {\star}} \sum_ {h = 1} ^ {H} \mathcal {U} _ {h} \left(S _ {\tau}, A _ {h}\right) - \nu \leq \mathbb {E} _ {S \sim \rho} \left(\widehat {V} _ {1} ^ {\star} - V _ {1} ^ {\star}\right) (S) \tag {17b} \\ \leq \mathbb {E} _ {\bar {\pi}} \sum_ {h = 1} ^ {H} \mathcal {U} _ {h} (S _ {\tau}, A _ {\tau}) + \nu . \\ \end{array} +$$ + +Furthermore, the memory complexity of the algorithm is bounded as $\mathcal{O}(d^2 H)$ and the per-step computational complexity is bounded as $\mathcal{O}(d^2 + |\mathcal{A}|d)$ . + +See Appendix B for the proof of this claim. + +# 5. Discussion + +In this paper, we have introduced several modifications to the basic $Q$ -learning protocol so as to derive an exploratory procedure that operates with linear function approximation, and is equipped with performance guarantees while remaining computation and memory-efficient. It is natural to ask to what extent these modifications—the second-order update rule, the use of target networks and policy replay—are needed in order to obtain such guarantees. + +On the second-order rule: Of the three ingredients, the second-order update rule only serves to improve the statistical efficiency. When the target network and sampling distribution are fixed, using first-order update rule in Eq. (6) would be essentially equivalent to a stochastic gradient update; such updates would minimize the loss function (7) with a rate $1 / \sqrt{n}$ instead of the $1 / n$ enabled by our second-order updates. It should be observed that the higher cost and memory of the second-order rule are not a problem when conducting exploration, as the main computational bottleneck is the calculation of the bonus function, while the main memory requirement is due to the policy replay. + +Nonetheless, if one is interested purely in the optimization setting, where neither the replay memory nor the exploration bonuses are needed, some techniques from variance reduction can be used in conjunction with a first-order update rule (Frostig et al., 2015; Li et al., 2020; Wainwright, 2019b; Mou et al., 2022) to lower the computational and space complexity while retaining high sample efficiency. We leave this as an interesting direction for future work. + +On the use of target networks: The target networks considerably simplify the analysis of the algorithm by establishing a connection with linear regression with a fixed target. There is no real downside with adopting target networks, and whether they could be removed is left as future work. + +On the policy replay mechanism: A truly critical ingredient in this work is the policy replay mechanism, which ensures that the $Q$ -learning updates are performed on data generated by a stationary controller and with the most recent bonus and value function estimate. Without the replay mechanism, the network weights would be updated with a changing target—recall that the target networks need to be updated periodically—and under a non-stationary distribution. The main issue is that the target networks contain both statistical errors and bias due to the exploration bonus which decay with time. In this case, the high errors present in the target networks in early phases would hurt the algorithm in later phases. Discounting early updates by an appropriate learning rate to favor later updates may seem like a solution, but this can lead to "catastrophic forgetting" of past experience because the learning distribution is non-stationary. When using linear function approximation, a concrete consequence is that the algorithm can forget what it has learned along the directions it played in the early phases. + +Exploration algorithms inspired by Least Square Value Iteration (LSVI) avoid these issues, because they update the weights of the network by computing the full least-squares solution using the most recent, and thus most accurate, target function. In this way, the next state value function is as accurate as possible over the full domain, and is perturbed everywhere by the most recent (and smallest) exploration bonus, one that truly reflects the current model uncertainty. + +Likewise, experience replay would alleviate these issues by re-training the network using the most recent target network. Unfortunately, doing so seems to require a replay buffer of size proportional to all the experience collected so far, making $Q$ -learning no longer a truly streaming algorithm. The policy replay memory is a simple solution to such issues, one that preserves the streaming nature of $Q$ -learning. + +Due to space constraints, future directions are discussed in Appendix A.2 + +# Acknowledgment + +This work was partially supported by National Science Foundation FODSI grant 2023505, DOD ONR Office of Naval Research N00014-21-1-2842, National Science Foundation DMS grant 2015454, and National Science Foundation CCF grant 1955450. Part of this work was completed while Andrea Zanette was visiting Learning and Games at the Simons Institute for the Theory of Computing. The authors are very grateful to the reviewers, as well as to the meta-reviewer, for identifying clarity issues present in an earlier draft. + +# References + +Abbasi-Yadkori, Y., Pal, D., and Szepesvari, C. Improved algorithms for linear stochastic bandits. In Advances in Neural Information Processing Systems (NIPS), 2011. +Agarwal, A., Henaff, M., Kakade, S., and Sun, W. Pc-pg: Policy cover directed exploration for provable policy gradient learning. arXiv preprint arXiv:2007.08459, 2020a. +Agarwal, A., Kakade, S., Krishnamurthy, A., and Sun, W. Flambe: Structural complexity and representation learning of low rank mdps. arXiv preprint arXiv:2006.10814, 2020b. +Agarwal, N., Chaudhuri, S., Jain, P., Nagaraj, D., and Netrapalli, P. Online target q-learning with reverse experience replay: Efficiently finding the optimal policy for linear mdps. arXiv preprint arXiv:2110.08440, 2021. +Al Marjani, A. and Proutiere, A. Adaptive sampling for best policy identification in markov decision processes. In International Conference on Machine Learning, pp. 7459-7468. PMLR, 2021. +Ayoub, A., Jia, Z., Szepesvari, C., Wang, M., and Yang, L. F. Model-based reinforcement learning with value-targeted regression. arXiv preprint arXiv:2006.01107, 2020. +Baird, L. Residual algorithms: Reinforcement learning with function approximation. In International Conference on Machine Learning (ICML). 1995. +Bertsekas, D. P. and Tsitsiklis, J. N. Neuro-dynamic programming. Athena Scientific, 1996. +Beygelzimer, A., Langford, J., Li, L., Reyzin, L., and Schapire, R. Contextual bandit algorithms with supervised learning guarantees. In Proceedings of the Fourteenth International Conference on Artificial Intelligence and Statistics, pp. 19-26. JMLR Workshop and Conference Proceedings, 2011. +Bhandari, J., Russo, D., and Singal, R. A finite time analysis of temporal difference learning with linear function approximation. In Conference on learning theory, pp. 1691-1692. PMLR, 2018. +Cai, Q., Yang, Z., Lee, J., and Wang, Z. Neural temporal-difference learning converges to global optima. 2019. +Carvalho, D., Melo, F. S., and Santos, P. A new convergent variant of q-learning with linear function approximation. Advances in Neural Information Processing Systems, 33: 19412-19421, 2020. +Du, S. S., Kakade, S. M., Lee, J. D., Lovett, S., Mahajan, G., Sun, W., and Wang, R. Bilinear classes: A structural framework for provable generalization in rl. arXiv preprint arXiv:2103.10897, 2021. + +Duan, Y., Wainwright, M. J., and Wang, M. Optimal value estimation using kernel-based temporal difference methods. Technical report, Princeton University, September 2021. +Even-Dar, E., Mansour, Y., and Bartlett, P. Learning rates for q-learning. Journal of machine learning Research, 5 (1), 2003. +Fan, J., Wang, Z., Xie, Y., and Yang, Z. A theoretical analysis of deep q-learning. In Learning for Dynamics and Control, pp. 486-489. PMLR, 2020. +Foster, D. J., Krishnamurthy, A., Simchi-Levi, D., and Xu, Y. Offline reinforcement learning: Fundamental barriers for value function approximation, 2021. +Frostig, R., Ge, R., Kakade, S. M., and Sidford, A. Competing with the empirical risk minimizer in a single pass. In Conference on learning theory, pp. 728-763. PMLR, 2015. +Golub, G. H. and Van Loan, C. F. Matrix Computations. JHU Press, 2012. +Gordon, G. J. Stable function approximation in dynamic programming. In International Conference on Machine Learning (ICML), pp. 261-268. 1995. +He, J., Zhou, D., and Gu, Q. Logarithmic regret for reinforcement learning with linear function approximation. In International Conference on Machine Learning, pp. 4171-4180. PMLR, 2021. +Jaakkola, T., Jordan, M. I., and Singh, S. P. On the convergence of stochastic iterative dynamic programming algorithms. Neural computation, 6(6):1185-1201, 1994. +Jiang, N., Krishnamurthy, A., Agarwal, A., Langford, J., and Schapire, R. E. Contextual decision processes with low Bellman rank are PAC-learnable. In Precup, D. and Teh, Y. W. (eds.), International Conference on Machine Learning (ICML), volume 70 of Proceedings of Machine Learning Research, pp. 1704–1713, International Convention Centre, Sydney, Australia, 06–11 Aug 2017. PMLR. URL http://proceedings.mlrpress/v70/jiang17c.html. +Jin, C., Allen-Zhu, Z., Bubeck, S., and Jordan, M. I. Is q-learning provably efficient? In Advances in Neural Information Processing Systems, pp. 4863-4873, 2018. +Jin, C., Yang, Z., Wang, Z., and Jordan, M. I. Provably efficient reinforcement learning with linear function approximation. In Conference on Learning Theory, 2020. +Jin, C., Liu, Q., and Miryoosefi, S. Bellman eluder dimension: New rich classes of rl problems, and sample-efficient algorithms. arXiv preprint arXiv:2102.00815, 2021. + +Kearns, M. and Singh, S. Finite-sample convergence rates for q-learning and indirect algorithms. Advances in neural information processing systems, pp. 996-1002, 1999. +Khamaru, K., Xia, E., Wainwright, M. J., and Jordan, M. I. Instance-optimality in optimal value estimation: Adaptivity via variance-reduced Q-learning. Technical report, UC Berkeley, June 2021. Arxiv technical report 2106.14352. +Kong, D., Salakhutdinov, R., Wang, R., and Yang, L. F. Online sub-sampling for reinforcement learning with general function approximation, 2021. +Krishnamurthy, A., Agarwal, A., and Langford, J. Pac reinforcement learning with rich observations. In Advances in Neural Information Processing Systems (NIPS), pp. 1840-1848, 2016. +Lakshminarayanan, C. and Szepesvari, C. Linear stochastic approximation: How far does constant step-size and iterate averaging go? In International Conference on Artificial Intelligence and Statistics, pp. 1347-1355. PMLR, 2018. +Li, C. J., Mou, W., Wainwright, M. J., and Jordan, M. I. Root-sgd: Sharp nonasymptotics and asymptotic efficiency in a single algorithm. arXiv preprint arXiv:2008.12690, 2020. +Li, G., Cai, C., Chen, Y., Gu, Y., Wei, Y., and Chi, Y. Is q-learning minimax optimal? a tight sample complexity analysis. arXiv preprint arXiv:2102.06548, 2021. +Li, Z., Xu, T., and Yu, Y. A note on target q-learning for solving finite mdps with a generative oracle. arXiv preprint arXiv:2203.11489, 2022. +Lin, L.-J. Self-improving reactive agents based on reinforcement learning, planning and teaching. Machine learning, 8(3-4):293-321, 1992. +Liu, B., Liu, J., Ghavamzadeh, M., Mahadevan, S., and Petrik, M. Finite-sample analysis of proximal gradient td algorithms. arXiv preprint arXiv:2006.14364, 2020. +Liu, S. and Su, H. Provably efficient kernelized q-learning. arXiv preprint arXiv:2204.10349, 2022. +Maurer, A. and Pontil, M. Empirical bernstein bounds and sample variance penalization. In Conference on Learning Theory (COLT), 2009. +Mehta, N. Fast rates with high probability in exp-concave statistical learning. In Artificial Intelligence and Statistics, pp. 1085-1093. PMLR, 2017. +Mehta, P. and Meyn, S. Q-learning and pontryagin's minimum principle. In Proceedings of the 48h IEEE Conference on Decision and Control (CDC) held jointly with + +2009 28th Chinese Control Conference, pp. 3598-3605. IEEE, 2009. +Melo, F. S., Meyn, S. P., and Ribeiro, M. I. An analysis of reinforcement learning with function approximation. In International Conference on Machine Learning (ICML), 2008. +Mnih, V., Kavukcuoglu, K., Silver, D., Graves, A., Antonoglou, I., Wierstra, D., and Riedmiller, M. Playing atari with deep reinforcement learning. arXiv preprint arXiv:1312.5602, 2013. +Mnih, V., Kavukcuoglu, K., Silver, D., Rusu, A. A., Veness, J., Bellemare, M. G., Graves, A., Riedmiller, M., Fidjeland, A. K., Ostrovski, G., et al. Human-level control through deep reinforcement learning. nature, 518(7540): 529-533, 2015. +Modi, A., Jiang, N., Tewari, A., and Singh, S. Sample complexity of reinforcement learning using linearly combined model ensembles. In International Conference on Artificial Intelligence and Statistics, pp. 2010-2020. PMLR, 2020. +Modi, A., Chen, J., Krishnamurthy, A., Jiang, N., and Agarwal, A. Model-free representation learning and exploration in low-rank mdps. arXiv preprint arXiv:2102.07035, 2021. +Mou, W., Khamaru, K., Wainwright, M. J., Bartlett, P. L., and Jordan, M. I. Optimal variance-reduced stochastic approximation in Banach spaces. Technical report, UC Berkeley, January 2022. +Munos, R. and Szepesvári, C. Finite-time bounds for fitted value iteration. Journal of Machine Learning Research, 9 (May):815-857, 2008. +Perkins, T. J. and Pendrith, M. D. On the existence of fixed points for q-learning and sarsa in partially observable domains. In ICML, pp. 490-497, 2002. +Puterman, M. L. Markov Decision Processes: Discrete Stochastic Dynamic Programming. John Wiley & Sons, Inc., New York, NY, USA, 1994. ISBN 0471619779. +Riedmiller, M. Neural fitted q iteration-first experiences with a data efficient neural reinforcement learning method. In European conference on machine learning, pp. 317-328. Springer, 2005. +Santos, P. P., Melo, F. S., Sardinha, A., and Carvalho, D. S. Understanding the impact of data distribution on q-learning with function approximation. arXiv preprint arXiv:2111.11758, 2021. + +Shi, L., Li, G., Wei, Y., Chen, Y., and Chi, Y. Pessimistic q-learning for offline reinforcement learning: Towards optimal sample complexity. arXiv preprint arXiv:2202.13890, 2022. +Shreve, S. E. and Bertsekas, D. P. Alternative theoretical frameworks for finite horizon discrete-time stochastic optimal control. SIAM Journal on control and optimization, 16(6):953-978, 1978. +Simchowitz, M. and Jamieson, K. Non-asymptotic gap-dependent regret bounds for tabular mdps. arXiv preprint arXiv:1905.03814, 2019. +Srinivas, N., Krause, A., Kakade, S. M., and Seeger, M. Gaussian process optimization in the bandit setting: No regret and experimental design. arXiv preprint arXiv:0912.3995, 2009. +Sun, W., Jiang, N., Krishnamurthy, A., Agarwal, A., and Langford, J. Model-based reinforcement learning in contextual decision processes. arXiv preprint arXiv:1811.08540, 2018. +Szeptesvári, C. et al. The asymptotic convergence-rate of q-learning. Advances in neural information processing systems, pp. 1064-1070, 1998. +Tirinzoni, A., Pirotta, M., and Lazaric, A. A fully problem-dependent regret lower bound for finite-horizon mdps. arXiv preprint arXiv:2106.13013, 2021. +Tropp, J. A. An introduction to matrix concentration inequalities. Foundations and Trends® in Machine Learning, 8(1-2):1-230, 2015. ISSN 1935-8237. doi: 10.1561/2200000048. URL http://dx.doi.org/10.1561/2200000048. +Tsitsiklis, J. N. Asynchronous stochastic approximation and q-learning. Machine learning, 16(3):185-202, 1994. +Tsitsiklis, J. N. and Van Roy, B. Analysis of temporal-difference learning with function approximation. In Advances in Neural Information Processing Systems (NIPS), 1997. +Wagenmaker, A., Chen, Y., Simchowitz, M., Du, S. S., and Jamieson, K. First-order regret in reinforcement learning with linear function approximation: A robust estimation approach, 2021a. +Wagenmaker, A., Simchowitz, M., and Jamieson, K. Beyond no regret: Instance-dependent pac reinforcement learning. arXiv preprint arXiv:2108.02717, 2021b. +Wainwright, M. J. Stochastic approximation with conecontractive operators: Sharp $\ell_{\infty}$ -bounds for $q$ -learning. arXiv preprint arXiv:1905.06265, 2019a. + +Wainwright, M. J. Variance-reduced q-learning is minimax optimal. arXiv preprint arXiv:1906.04697, 2019b. +Wang, R., Foster, D. P., and Kakade, S. M. What are the statistical limits of offline rl with linear function approximation? arXiv preprint arXiv:2010.11895, 2020a. +Wang, R., Salakhutdinov, R., and Yang, L. F. Provably efficient reinforcement learning with general value function approximation, 2020b. +Wang, Y., Wang, R., Du, S. S., and Krishnamurthy, A. Optimism in reinforcement learning with generalized linear function approximation. arXiv preprint arXiv:1912.04136, 2019. +Wang, Y., Wang, R., and Kakade, S. M. An exponential lower bound for linearly-realizable mdps with constant suboptimality gap. arXiv preprint arXiv:2103.12690, 2021. +Watkins, C. J. Learning from delayed rewards. 1989. +Watkins, C. J. and Dayan, P. Q-learning. Machine learning, 8(3-4):279-292, 1992. +Weisz, G., Amortila, P., and Szepesvári, C. Exponential lower bounds for planning in mdps with linearly-realizable optimal action-value functions. arXiv preprint arXiv:2010.01374, 2020. +Weisz, G., Szepesvári, C., and György, A. Tensorplan and the few actions lower bound for planning in mdps under linear realizability of optimal value functions. arXiv preprint arXiv:2110.02195, 2021. +Xia, E., Khamaru, K., Wainwright, M. J., and Jordan, M. I. Instance-dependent confidence and early stopping in reinforcement learning. Technical report, UC Berkeley, January 2022. +Xie, T., Cheng, C.-A., Jiang, N., Mineiro, P., and Agarwal, A. Bellman-consistent pessimism for offline reinforcement learning. arXiv preprint arXiv:2106.06926, 2021. +Xu, H., Ma, T., and Du, S. S. Fine-grained gap-dependent bounds for tabular mdps via adaptive multi-step bootstrap. arXiv preprint arXiv:2102.04692, 2021a. +Xu, H., Zhan, X., and Zhu, X. Constraints penalized q-learning for safe offline reinforcement learning. arXiv preprint arXiv:2107.09003, 2021b. +Yan, Y., Li, G., Chen, Y., and Fan, J. The efficacy of pessimism in asynchronous q-learning. arXiv preprint arXiv:2203.07368, 2022. +Yang, K., Yang, L., and Du, S. Q-learning with logarithmic regret. In International Conference on Artificial Intelligence and Statistics, pp. 1576-1584. PMLR, 2021. + +Yang, L. F. and Wang, M. Reinforcement leaning in feature space: Matrix bandit, kernels, and regret bound. In International Conference on Machine Learning (ICML), 2020. +Yin, M. and Wang, Y.-X. Towards instance-optimal offline reinforcement learning with pessimism. arXiv preprint arXiv:2110.08695, 2021. +Zanette, A. Exponential lower bounds for batch reinforcement learning: Batch rl can be exponentially harder than online rl. arXiv preprint arXiv:2012.08005, 2020. +Zanette, A. and Brunskill, E. Tighter problem-dependent regret bounds in reinforcement learning without domain knowledge using value function bounds. In International Conference on Machine Learning (ICML), 2019. URL http://proceedings.mlr.press/v97/zanette19a.html. +Zanette, A., Brunskill, E., and J. Kochenderfer, M. Almost horizon-free structure-aware best policy identification with a generative model. In Advances in Neural Information Processing Systems, 2019. +Zanette, A., Brandfonbrener, D., Pirotta, M., and Lazaric, A. Frequentist regret bounds for randomized least-squares value iteration. In AISTATS, 2020a. +Zanette, A., Lazaric, A., Kochenderfer, M., and Brunskill, E. Learning near optimal policies with low inherent bellman error. In International Conference on Machine Learning (ICML), 2020b. +Zanette, A., Cheng, C.-A., and Agarwal, A. Cautiously optimistic policy optimization and exploration with linear function approximation. arXiv preprint arXiv:2103.12923, 2021a. +Zanette, A., Wainwright, M. J., and Brunskill, E. Provable benefits of actor-critic methods for offline reinforcement learning. arXiv preprint arXiv:2108.08812, 2021b. +Zhang, Z., Zhou, Y., and Ji, X. Almost optimal model-free reinforcement learning via reference-advantage decomposition. Advances in Neural Information Processing Systems, 33, 2020. + +# A. Additional Material + +# A.1. Relation to past work + +There is a long line of past work on $Q$ -learning for tabular problems, with results in both the asymptotic settings (e.g., (Watkins & Dayan, 1992; Tsitsiklis, 1994; Jaakkola et al., 1994; Szepesvári et al., 1998)), as well as the non-asymptotic setting (e.g., (Kearns & Singh, 1999; Even-Dar et al., 2003; Wainwright, 2019a; Li et al., 2021)). Other work on $Q$ -learning in tabular problems has derived regret bounds that are also near-optimal (Jin et al., 2018; Zhang et al., 2020). + +It is well known that once function approximation is introduced, then the $Q$ -learning algorithm may diverge (Baird, 1995). Such divergence does not occur in certain special cases, including when the dynamics are restricted to induce similar directions in feature space (Melo et al., 2008), or the function approximators are $\ell_{\infty}$ -contractive in an appropriate sense (e.g. (Gordon, 1995)). Related results are presented in the papers (Tsitsiklis & Van Roy, 1997; Perkins & Pendraith, 2002; Mehta & Meyn, 2009; Liu et al., 2020; Bhandari et al., 2018; Lakshminarayanan & Szepesvari, 2018). In contrast, our analysis does not impose such conditions. We also note that there is some recent analysis of $Q$ -learning with deep neural networks (Fan et al., 2020) that leverages connectionms to neural fitted $Q$ -iteration (Riedmiller, 2005; Munos & Szepesvari, 2008); see also the papers (Cai et al., 2019; Carvalho et al., 2020). + +Some of the algorithmic techniques used in this work—specifically, the use of target networks and experience replay—are believed to be essential to recent empirical successes in reinforcement learning. Experience replay was introduced by Lin (Lin, 1992), and popularized more widely by the influential paper (Mnih et al., 2013). To be clear, our replay mechanism differs in that it does not store past rewards and transitions; this fact is essential to maintaining low memory complexity. Our replay mechanism is related to the policy cover mechanism (Agarwal et al., 2020a; Zanette et al., 2021a), but differs in that it needs to store high performance policies, and it is not used as starting distribution for policies roll-outs. As for target networks, they have also been a core component of past empirical successes (Mnih et al., 2015). + +We note that recent work by Agarwal et al. (Agarwal et al., 2021) also shows the importance of forms of experience replay, in establishing a result related to our Theorem 2. Our work shows that experience replay is not needed when the controller is stationary. Indeed, our primary contribution is in the exploration setting (cf. Theorem 1), whose literature we discuss next. A related and concurrent work in the exploration setting is (Liu & Su, 2022). + +To the best of our knowledge, this paper constitutes the first analysis of an exploratory form of $Q$ -learning combined with function approximation. It can be compared with the work of Jin et al. (Jin et al., 2020), who proved guarantees for exploration based on a form of least-squares value iteration (LSVI) with optimism for the class of low-rank MDPs. However, their algorithm has a space complexity that grows linearly with time, and the approximation error requirements are expressed via sup-norm $(\ell_{\infty})$ bounds. Better approximation error requirements with respect to a fixed comparator are given by policy gradient methods (Agarwal et al., 2020a; Zanette et al., 2021a), whose memory complexity still grows with the required accuracy3. Our work shows that attractive approximation error guarantees are not unique to policy gradient algorithms: temporal difference methods also inherit favorable—albeit different—guarantees. While this has recently been noted in the offline setting, such guarantees were enabled by a dataset generated from a stationary distribution (Xie et al., 2021), as opposed to a reactive controller (Zanette et al., 2021b), which is the standard case in the exploration setting. + +Finally, to our knowledge none of algorithms discussed so far inherit instance-dependent regret bounds while being agnostic to the setting. The bulk of past instance-dependent results correspond to tabular problems (e.g., (Zanette & Brunskill, 2019; Zanette et al., 2019; Simchowitz & Jamieson, 2019; Yin & Wang, 2021; Tirinzoni et al., 2021; Al Marjani & Proutiere, 2021; Xu et al., 2021a; Wagenmaker et al., 2021b; Yang et al., 2021; Khamaru et al., 2021; Xia et al., 2022); a few exceptions include the logarithmic regret bounds given in the paper (He et al., 2021) and the recent paper (Wagenmaker et al., 2021a), as well as some partially instance-dependent results on kernel LSTD (Duan et al., 2021). Other studies related to $Q$ -learning include the papers (Li et al., 2022; Yan et al., 2022; Shi et al., 2022; Santos et al., 2021; Xu et al., 2021b). + +# A.2. Future directions + +Our work focused exclusively on linear approximations of $Q$ -functions, but some of the underlying ideas are more generally applicable. One interesting direction is to extend our analysis to models with low Eluder dimension (Wang et al., 2020b; + +Kong et al., 2021), and to see whether the regret bound can be improved. Second, our definition of approximation error is very permissive, in that it only measures the expected prediction error. It would be interesting to understand whether or not there exist exploration algorithms based on least-square value iteration (without "policy replay") that inherit similar guarantees. Finally, this work establishes a partial form of instance-dependence, in that the results depend on the effective dimension. In the simpler tabular setting, the instance dependence of $Q$ -learning has been studied through the lens of local minimax theory (Khamaru et al., 2021; Xia et al., 2022) to obtain completely sharp instance-dependent guarantees. It would be interesting to develop similarly sharp analyses in this more general setting with function approximation. + +# B. Proofs for the $\mathbf{S}^3\mathbf{Q}$ -LEARNING algorithm + +This section is devoted to proving the bounds on $S^3$ Q-LEARNING stated in Theorem 2. At the same time, we also establish a related result, to be stated momentarily as Theorem 3. The proofs of both results share a very similar structure, following the same argument except for the way in which the violation of Assumption 1 or Assumption 2 is measured. More precisely, Theorem 2 measures misspecification according to $\nu$ , which is zero when Assumption 1 holds and the bonus is zero. On the other hand, Theorem 3 measures misspecification using $\nu$ defined according to Definition 2. This quantity is zero under the low-rank assumption (Assumption 2). Thus, both theorems can be proved within a common framework, with the only difference being the way in which $\nu$ is defined. + +Let us now state the second result to be proved in this section. + +Theorem 3. Consider an MDP that is $\nu$ -misspecified w.r.t. the low rank assumption according to Definition 2; assume $b \geq 0$ pointwise. With the uncertainty function (16a), for any episode $K$ , the $\mathsf{S}^3\mathsf{Q}$ -LEARNING algorithm returns a solution $\widehat{Q}^\star$ with Bellman error $\mathcal{E}$ such that with probability at least $1 - \delta_{\text{master}}$ : + +(a) The Bellman error function satisfies the pointwise bound + +$$ +\min \{0, - \mathcal {U} _ {h} + b _ {h} \} (s, a) \leq \left(\mathcal {E} _ {h} + \Delta_ {h} ^ {\pi}\right) (s, a) \leq \left(\mathcal {U} _ {h} + b _ {h}\right) (s, a). \tag {18} +$$ + +(b) For each $h \in [H]$ , the greedy policy $\overline{\pi}_h(s) \stackrel{\text{def}}{=} \arg \max_a \widehat{Q}_h^\star(s, a)$ satisfies the bound + +$$ +\mathbb {E} _ {S \sim \rho} \left(\widehat {V} _ {1} ^ {\star} - V _ {1} ^ {\star}\right) (S) \leq \mathbb {E} _ {S \sim \rho} \left(\widehat {V} _ {1} ^ {\star} - V _ {1} ^ {\overline {{\pi}}}\right) (S) \leq \mathbb {E} _ {\overline {{\pi}}} \sum_ {h = 1} ^ {H} \left(\mathcal {U} _ {h} + b _ {h}\right) \left(S _ {\tau}, A _ {\tau}\right) + \nu . \tag {19} +$$ + +Proof: For each epoch, the argument can be broken into four steps. + +- First, we show that for any level $\ell \in [H]$ , the second-order update rule (13) produces the same iterates as least-squares regression would. +- Second, we show for any level $\ell \in [H]$ , learned predictor $\widehat{Q}^{\star}$ uses at least $\sim \frac{1}{H}$ of the total data. +- Third, we bound the least-square prediction error under either Assumption 1 or Assumption 2. This analysis controls the error made by the algorithm at each level $\ell \in [H]$ during the epoch under consideration. +- The final step is to compute how the least-square errors propagate and accumulate through timesteps, thereby leading to the final performance bound in terms of the learned action value function $\hat{Q}^{\star}$ . + +Notation: Let us summarize here some notation for convenient reference. We say that the algorithm has completed learning at level $\ell$ in epoch $e$ if $n^{\ell} = 2^{e}$ , i.e., when the loop over $n^{\ell}$ has terminated. We indicate with $n_e = 2^e$ the number of samples allocated in the epoch $e$ . + +Let $\{(s_i, a_i, r_i, s_i')\}_{i=1}^{n_e}$ be the samples acquired at level $\ell$ in epoch $e$ . For a parameter vector $\theta$ and a next-state action-value function $Q'$ , define the $(\ell, e)$ -empirical loss as + +$$ +\widehat {\mathcal {L}} _ {\ell e} \left(\theta \mid \mid Q ^ {\prime}\right) \stackrel {\text {d e f}} {=} \sum_ {i = 1} ^ {n _ {e}} \left[ \left\langle \phi_ {\ell} \left(s _ {i}, a _ {i}\right), \theta \right\rangle - r _ {i} - \max _ {a ^ {\prime}} Q ^ {\prime} \left(s _ {i} ^ {\prime}, a ^ {\prime}\right) \right] ^ {2} + \lambda_ {\mathrm {R e g}} \| \theta \| _ {2} ^ {2}, \tag {20} +$$ + +where $\lambda_{\mathrm{Reg}} > 0$ is a given regularization parameter. With a minor overload of notation, Recalling the class of linear functions $\mathcal{Q}^{(\mathrm{lin})}$ from equation (3a), we define + +$$ +Q _ {\min } = \underset {Q \in \mathcal {Q} ^ {(\text {i n})}} {\arg \min } \widehat {\mathcal {L}} _ {\ell e} (Q | | Q ^ {\prime}) \tag {21} +$$ + +if $Q_{\mathrm{min}}$ can be written as $Q_{\mathrm{min}}:(s,a)\mapsto \bigl \langle \phi (s,a),\theta_{\mathrm{min}}\bigr \rangle$ , where $\theta_{\mathrm{min}} = \arg \min_{\| \theta \| _2\leq 1}\widehat{\mathcal{L}}_{\ell e}(\theta ||Q')$ + +# B.1. Main argument + +We now proceed to the core of the argument. When the algorithm terminates at the evaluation episode $K$ , it returns the predictor $\widehat{Q}^{\star}$ . For the rest of the proof, we let $e_{tot}$ be the epoch in which $\widehat{Q}^{\star}$ was last updated upon termination of the algorithm. Moreover, our proof makes use of three auxiliary lemmas, which we begin by stating. + +Lemma 1 (Equivalence with Least-Squares). Upon completion of level $\ell$ within epoch $e$ , the $\mathbf{S}^3\mathbf{Q}$ -LEARNING algorithm returns a parameter vector $\widehat{\theta}_{\ell e}^{tar}$ such that + +$$ +\widehat {\theta} _ {\ell e} ^ {t a r} = \arg \min _ {\| \theta \| _ {2} \leq 1} \left\{\widehat {\mathcal {L}} _ {\ell e} (\theta | | \widehat {Q} _ {\ell + 1, e} ^ {t a r}) \right\}. \tag {22} +$$ + +See Appendix B.2 for the proof of this claim. + +We emphasize that the target network $\widehat{Q}_{\ell +1,e}^{tar}$ remains fixed throughout a given epoch. The lemma establishes that the second-order update rule produces the same solution as a batch least-square regression would. + +Our next step is to lower bound the number of samples used to solve the regression problem: + +Lemma 2 (Number of Samples). Upon termination in episode $K$ , the algorithm returns a parameter sequence $\widehat{\theta}^{\star} = \{\widehat{\theta}_{\ell}^{\star}\}_{\ell=1}^{H}$ such that + +$$ +\widehat {\theta} _ {\ell} ^ {\star} = \underset {\| \theta \| _ {2} \leq 1} {\arg \min } \widehat {\mathcal {L}} _ {\ell , e _ {t o t}} (\theta | | \widehat {Q} _ {\ell + 1} ^ {\star}) \quad f o r e a c h \ell \in [ H ] \tag {23} +$$ + +and moreover, the level $\ell$ regression problem uses at least $n^{\ell} \geq \frac{K}{4H}$ of the form $\{(s_i, a_i, r_i, s_i')\}_{i=1}^{n^{\ell}}$ . + +The above lemma states that nearly all the data collected are used. The proof can be found in Appendix B.3. + +Given this equivalence to least-squares regression and the lower bound on the sample size, we can now leverage standard analysis of linear regression so as to bound the prediction error. Recall our definition of the error function + +$$ +\mathcal {E} _ {\ell e} (s, a) \stackrel {\text {d e f}} {=} \widehat {Q} _ {\ell e} ^ {\operatorname {t a r}} (s, a) - \left(\mathcal {T} _ {\ell} \widehat {Q} _ {\ell + 1, e} ^ {\operatorname {t a r}}\right) (s, a). \tag {24} +$$ + +Lemma 3 (Least Square Error Bounds). The $\mathrm{S}^3\mathrm{Q}$ -LEARNING procedure returns a predictor $\widehat{Q}_{\ell}^{\star}$ whose error $\mathcal{E}_{\ell}$ is sandwiched as + +$$ +\left. \min \left\{0, \left(- \mathcal {U} _ {\ell} (s, a) + b _ {\ell} (s, a)\right) \right\} - \Delta_ {\ell} ^ {\pi} (s, a) \leq \mathcal {E} _ {\ell} (s, a) \leq \mathcal {(b)} \mathcal {U} _ {\ell} (s, a) + b _ {\ell} (s, a) - \Delta_ {\ell} ^ {\pi} (s, a) \right. \tag {25} +$$ + +with probability at least $1 - \delta$ . + +See Appendix B.4 for the proof of this claim. + +Lemma 3 allows us to quantify the empirical Bellman backup error and uses Assumption 1 (Bellman closure) or Assumption 2 (Low-Rank) depending on the setting (i.e., optimization vs exploration). In the zero-bonus setting $(b = 0)$ , the error term can be bounded symmetrically by the uncertainty function (see Eq. (25)), which is always positive. The min function on the left hand side arises due to "clipping" the $\widehat{Q}_{\ell}^{tar}$ values, so that adding a bigger bonus $b_{\ell}$ does not necessarily make $\widehat{Q}_{\ell}^{tar}$ (and its error function) more positive. + +Our next step to establishing the bounds (17b) is to analyze how errors propagate. We begin with the rightmost inequality in equation (17b). Since $Q^{\star}$ is the optimal $Q$ -function, we have the pointwise inequality + +$$ +(\widehat {Q} ^ {\star} - Q ^ {\star}) (s, a) \leq (\widehat {Q} ^ {\star} - Q ^ {\overline {{\pi}}}) (s, a) \quad \text {f o r a l l} (s, a) \text {p a i r s}, +$$ + +valid for any policy $\overline{\pi}$ ; in particular, this bound holds for the greedy policy $\overline{\pi}$ with respect to $\widehat{Q}^{\star}$ . Moreover, for this greedy policy, we have + +$$ +\widehat {Q} _ {h} ^ {\star} = \mathcal {E} _ {h} + \left(\mathcal {T} _ {h} \widehat {Q} _ {h + 1} ^ {\star}\right) = \mathcal {E} _ {h} + \left(\mathcal {T} _ {h} ^ {\overline {{\pi}}} \widehat {Q} _ {h + 1} ^ {\star}\right), \qquad \text {f o r a l l} h \in [ H ]. +$$ + +Since $Q^{\overline{\pi}}$ satisfies the Bellman evaluation equations $Q_{h}^{\overline{\pi}} = \left( T_{h}^{\overline{\pi}} Q_{h+1}^{\overline{\pi}} \right)$ for each $h \in [H]$ , the claim now follows, as $\widehat{Q}_{h}^{\star}$ can be thought of as the action value function of $\overline{\pi}$ on an MDP with dynamics specified by $T^{\overline{\pi}}$ , and reward function consisting of a portion from $T^{\overline{\pi}}$ , along with an additional reward equal to $\mathcal{E}$ . + +The proof of the left inequality in equation (17b) is similar. In particular, we observe that + +$$ +\widehat {Q} _ {h} ^ {\star} = \mathcal {E} _ {h} + \left(\mathcal {T} _ {h} \widehat {Q} _ {h + 1} ^ {\star}\right) \geq \mathcal {E} _ {h} + \left(\mathcal {T} _ {h} ^ {\pi^ {\star}} \widehat {Q} _ {h + 1} ^ {\star}\right), \quad \text {f o r a l l} h \in [ H ]. +$$ + +Expanding the definition of error function along the trajectories identified by $\pi^{\star}$ concludes the proof of the claim. + +# B.2. Proof of Lemma 1 (Equivalence with Least-Squares) + +Fix an epoch $e$ and let the current level be $\ell$ . By construction, the target network for the next state value function $\widehat{Q}_{\ell+1,e}^{tar}$ has already been updated in that epoch. We observe that $\mathrm{S}^3\mathrm{Q}$ -LEARNING is updating $\widehat{\theta}_h$ in a way equivalent to Algorithm 3 with $a_k = \phi_h$ and $b_k = r_h + \max_{a'} \widehat{Q}_{h+1}^{tar}(s_{h+1}, a')$ and $\mathcal{B} = \{x \mid \|x\|_2 \leq 1\}$ . + +Algorithm 3 STREAMING LEAST SQUARES +1: $\overline{\overline{\Sigma}}_1 = \lambda_{\mathrm{Reg}}I_{d\times d}$ +2: $x_0^{\prime \prime} = 0$ +3: for $k = 1,2,\ldots$ do +4: Receive $(a_{k},b_{k})$ +5: $x_{k}^{\prime \prime} = x_{k - 1}^{\prime \prime} + \frac{\Sigma_{k}^{-1}a_{k}(b_{k} - a_{k}^{\top}x_{k - 1}^{\prime \prime})}{1 + a_{k}^{\top}\Sigma_{k}^{-1}a_{k}}$ +6: $\overline{\overline{\Sigma}}_{k + 1}^{-1} = \overline{\overline{\Sigma}}_k^{-1} - \frac{\overline{\overline{\Sigma}}_k^{-1}a_ka_k^\top\overline{\overline{\Sigma}}_k^{-1}}{1 + a_k^\top\overline{\overline{\Sigma}}_k^{-1}a_k}$ +7: end for +8: return arg min $\| x\| _2\leq 1\| x - x_K^{\prime \prime}\|_{\overline{\Sigma}_{K + 1}}^2$ + +Thus, in order to prove Lemma 1, it suffices to show that Algorithm 3 finds the empirical risk minimizer. In particular, we claim that given any sequence of tuples $(a_{1},b_{1}),\ldots ,(a_{k},b_{k})$ , then upon termination, Algorithm 3 returns the constrained minimizer + +$$ +\arg \min _ {\| x \| _ {2} \leq 1} \left\{\sum_ {k = 1} ^ {K} \left(x ^ {\top} a _ {k} - b _ {k}\right) ^ {2} + \lambda_ {\text {R e g}} \| x \| _ {2} ^ {2} \right\}. \tag {26} +$$ + +In order to prove this claim, we introduce some helpful notation. With the initialization $A_0 \stackrel{\text{def}}{=} \sqrt{\lambda_{\mathrm{Reg}}} I_{d \times d}$ and $B_0 \stackrel{\text{def}}{=} 0$ , define the recursions + +$$ +A _ {k} \stackrel {\text {d e f}} {=} \left[ \begin{array}{l} A _ {k - 1} \\ a _ {k} ^ {\top} \end{array} \right], \quad B _ {k} \stackrel {\text {d e f}} {=} \left[ \begin{array}{l} B _ {k - 1} \\ b _ {k} \end{array} \right] \tag {27} +$$ + +The associated solution to the normal equations is given by $x_{k}^{\prime} \stackrel{def}{=} (A_{k}^{\top} A_{k})^{-1} A_{k}^{\top} B_{k}$ . With these definitions, we then have the equivalences + +$$ +x _ {k} ^ {\prime} \stackrel {\text {(i)}} {=} \underset {x} {\arg \min } \| A _ {k} x - B _ {k} \| _ {2} ^ {2} \stackrel {\text {(i i)}} {=} \sum_ {i = 1} ^ {k} \left(x ^ {\top} a _ {i} - b _ {i}\right) ^ {2} + \lambda_ {\operatorname {R e g}} \| x \| _ {2} ^ {2}, \tag {28} +$$ + +where step (i) follows by definition; and step (ii) follows from how the dataset $(A_0, b_0)$ was constructed, in particular including the pair $\{(\sqrt{\lambda_{\mathrm{Reg}}} e_1, 0), \ldots, (\sqrt{\lambda_{\mathrm{Reg}}} e_d, 0)\}$ prior to the $k$ samples $\{(a_i, b_i)\}_{i=1}^k$ . + +Now we proceed by induction on the index $k$ . For the base case $k = 0$ , observe that $x_0' = x_0''$ and $A_0^\top A_0 = \lambda_{\mathrm{Reg}} I$ by the given initialization. Turning to the induction step, let us suppose that the equalities + +$$ +x _ {k - 1} ^ {\prime} = x _ {k - 1} ^ {\prime \prime}, \quad \text {a n d} \quad A _ {k - 1} ^ {\top} A _ {k - 1} = \overline {{\overline {{\Sigma}}}} _ {k} \tag {29} +$$ + +hold for a certain $k \geq 1$ . We can write the next iterate $x_{k}^{\prime}$ as + +$$ +\begin{array}{l} x _ {k} ^ {\prime} = \left(A _ {k} ^ {\top} A _ {k}\right) ^ {- 1} A _ {k} ^ {\top} B _ {k} = \left(A _ {k - 1} ^ {\top} A _ {k - 1} + a _ {k} a _ {k} ^ {\top}\right) ^ {- 1} \left[ \begin{array}{c c} A _ {k - 1} ^ {\top} & a _ {k} \end{array} \right] \left[ \begin{array}{c} B _ {k - 1} \\ b _ {k} \end{array} \right] \\ \stackrel {\mathrm {(i i i)}} {=} \left[ \left(A _ {k - 1} ^ {\top} A _ {k - 1}\right) ^ {- 1} - \frac {\left(A _ {k - 1} ^ {\top} A _ {k - 1}\right) ^ {- 1} a _ {k} a _ {k} ^ {\top} \left(A _ {k - 1} ^ {\top} A _ {k - 1}\right) ^ {- 1}}{1 + a _ {k} ^ {\top} \left(A _ {k - 1} ^ {\top} A _ {k - 1}\right) ^ {- 1} a _ {k}} \right] \left(A _ {k - 1} ^ {\top} B _ {k - 1} + a _ {k} b _ {k}\right), \\ \end{array} +$$ + +where step (iii) follows from the Sherman Morrison rank-one matrix inversion formula (e.g., (Golub & Van Loan, 2012)). Recalling that + +$$ +x _ {k - 1} ^ {\prime} = \left(A _ {k - 1} ^ {\top} A _ {k - 1}\right) ^ {- 1} A _ {k - 1} ^ {\top} B _ {k - 1}, +$$ + +we find that + +$$ +\begin{array}{l} x _ {k} ^ {\prime} = x _ {k - 1} ^ {\prime} + \left(A _ {k - 1} ^ {\top} A _ {k - 1}\right) ^ {- 1} a _ {k} b _ {k} - \frac {\left(A _ {k - 1} ^ {\top} A _ {k - 1}\right) ^ {- 1} a _ {k} a _ {k} ^ {\top} \left(A _ {k - 1} ^ {\top} A _ {k - 1}\right) ^ {- 1}}{1 + a _ {k} ^ {\top} \left(A _ {k - 1} ^ {\top} A _ {k - 1}\right) ^ {- 1} a _ {k}} \left(A _ {k - 1} ^ {\top} B _ {k - 1} + a _ {k} b _ {k}\right) \\ = x _ {k - 1} ^ {\prime} + \frac {\left(A _ {k - 1} ^ {\top} A _ {k - 1}\right) ^ {- 1} a _ {k} b _ {k} - \left(A _ {k - 1} ^ {\top} A _ {k - 1}\right) ^ {- 1} a _ {k} a _ {k} ^ {\top} \overbrace {\left(A _ {k - 1} ^ {\top} A _ {k - 1}\right) ^ {- 1} A _ {k - 1} ^ {\top} B _ {k - 1}} ^ {x _ {k - 1} ^ {\prime}}}{1 + a _ {k} ^ {\top} \left(A _ {k - 1} ^ {\top} A _ {k - 1}\right) ^ {- 1} a _ {k}} \\ = x _ {k - 1} ^ {\prime} + \frac {\left(A _ {k - 1} ^ {\top} A _ {k - 1}\right) ^ {- 1} a _ {k} \left(b _ {k} - a _ {k} ^ {\top} x _ {k - 1} ^ {\prime}\right)}{1 + a _ {k} ^ {\top} \left(A _ {k - 1} ^ {\top} A _ {k - 1}\right) ^ {- 1} a _ {k}}. \\ \end{array} +$$ + +Since $x_{k - 1}^{\prime} = x_{k - 1}^{\prime \prime}$ by the induction hypothesis, it follows that $x_{k}^{\prime} = x_{k}^{\prime \prime}$ as the above display matches Line 5 of Algorithm 3. Applying the Sherman-Morrison rank one update, we find that + +$$ +\left(\overline {{\overline {{\Sigma}}}} _ {k + 1}\right) ^ {- 1} = \left(A _ {k} ^ {\top} A _ {k}\right) ^ {- 1}. \tag {30} +$$ + +Thus, we have established that the equalities (29) hold for every $k$ . The proof is concluded upon noticing that $x_{k}^{\prime \prime}$ is the unconstrained solution to the loss in (26), and the projection step in the final line of the algorithm is thus equivalent to solving (26) with the constraint $x \in \mathcal{B}$ . + +# B.3. Proof of Lemma 2 (Number of Samples) + +In every epoch the algorithm updates the target networks in the order $\widehat{Q}_{H,e}^{tar},\ldots ,\widehat{Q}_{1,e}^{tar}$ . Since the algorithm returns $\widehat{Q}_{\ell}^{\star} = \widehat{Q}_{\ell ,e_{tot}}^{tar}$ for each $\ell \in [H]$ , the statement (23) follows by construction of the algorithm and Lemma 1. + +It remains to lower bound the number of samples involved in the computation of $\widehat{Q}_{\ell}^{\star}$ . By construction, every epoch $e$ uses exactly $2^{e}H$ trajectories. Let $m$ denote the number of trajectories in the current (unfinished) epoch $e_{tot} + 1$ when we evaluate the algorithm (at the stopping time in the episode $K$ ). We must have + +$$ +K = H \left(2 ^ {1} + 2 ^ {2} + \dots + 2 ^ {e _ {t o t}} + m\right) \leq H \left(2 ^ {e _ {t o t} + 1} + 2 ^ {e _ {t o t} + 1}\right) = 4 H 2 ^ {e _ {t o t}}. \tag {31} +$$ + +Since the algorithm in epoch $e_{tot}$ has sampled $H2^{e_{tot}}$ trajectories, using the above relation we deduce that it must have used $H2^{e_{tot}} \geq \frac{K}{4}$ total episodes, meaning at least $n^{\ell} \geq \frac{K}{4H}$ in every level to solve the regression problem (23), as stated. + +# B.4. Proof of Lemma 3 (Least Square Error Bounds) + +Let $\{(s_i, a_i, r_i, s_i')\}_{i=1}^{n_e}$ be the sequence of $n_e$ states, actions, rewards, successor states acquired while learning level $\ell$ in epoch $e$ . We drop the epoch index $e = e_{tot}$ as this is fixed through the proof. + +Within an epoch, $\mathbf{S}^3\mathbf{Q}$ -LEARNING updates the target networks in the order $\widehat{Q}_H^{tar}, \widehat{Q}_{H-1}^{tar}, \ldots, \widehat{Q}_2^{tar}, \widehat{Q}_1^{tar}$ . Thus, when the algorithm updates $\widehat{Q}_{\ell}^{tar}$ , it must use $\widehat{Q}_{\ell+1}^{tar}$ , which has already been updated in that epoch, to compute the backup in Line 12. Notice that the next-timestep target $\widehat{Q}_{\ell+1}^{tar}$ stays fixed while learning at level $\ell$ . Observe that regardless of the choice of bonus (so in either the optimization or exploration setting), we have $\| \widehat{Q}_{\ell+1}^{tar} \|_{\infty} \leq 1$ by construction. + +We introduce the shorthand $\Delta_i^\pi \stackrel{def}{=} \left( \mathcal{T}_\ell \widehat{Q}_{\ell+1}^{tar} \right) (s_i, a_i) - \langle \phi_\ell(s_i, a_i), \theta^{\pi, \widehat{Q}_{\ell+1}^{tar}, \ell} \rangle$ for the comparator error evaluated at $(s_i, a_i)$ . With this shorthand, we can write + +$$ +r _ {i} + \max _ {a ^ {\prime}} \widehat {Q} _ {\ell + 1} ^ {t a r} \left(s _ {i} ^ {\prime}, a ^ {\prime}\right) = \left(\mathcal {T} _ {\ell} \widehat {Q} _ {\ell + 1} ^ {t a r}\right) \left(s _ {i}, a _ {i}\right) + \eta_ {i} = \left\langle \phi_ {\ell} \left(s _ {i}, a _ {i}\right), \theta^ {\pi , \widehat {Q} _ {\ell + 1} ^ {t a r}, \ell} \right\rangle + \Delta_ {i} ^ {\pi} + \eta_ {i}, \tag {32} +$$ + +where $\eta_i \stackrel{\text{def}}{=} r_i + \max_{a'} \widehat{Q}_{\ell+1}^{tar}(s_i', a') - \left( \mathcal{T}_\ell \widehat{Q}_{\ell+1}^{tar} \right)(s_i, a_i)$ is the Bellman noise. Note that conditioned on $(s_i, a_i)$ , the random variable on the left hand side is bounded in $[-1, +1]$ . + +Now, to conclude we use the following high-probability error bound on a perturbed least-squares estimator. Given a joint distribution $\mu$ over pairs $(X,Y)$ , define the constrained least-squares estimate + +$$ +\theta^ {\star} \stackrel {d e f} {=} \min _ {\| \theta \| _ {2} \leq 1} \mathbb {E} _ {(X, Y)} \left(\langle X, \theta \rangle - Y\right) ^ {2}. \tag {33a} +$$ + +Given $n$ i.i.d. samples $(x_{i},y_{i})\sim \mu$ , we define the empirical version of this estimator + +$$ +\widehat {\theta} \stackrel {d e f} {=} \min _ {\| \theta \| _ {2} \leq 1} \frac {1}{n} \sum_ {i = 1} ^ {n} \left(\left\langle x _ {i}, \theta \right\rangle - y _ {i}\right) ^ {2}. \tag {33b} +$$ + +The following result bounds the difference between the empirical and population estimates: + +Lemma 4 (Convergence to Population Minimizer). The empirical estimate (33b) satisfies the bound + +$$ +\left\| \widehat {\theta} - \theta^ {\star} \right\| _ {\left(n \mathbb {E} _ {\mu} x x ^ {\top} + \lambda I\right)} \leq c \left\{\sqrt {d \log \frac {d n}{\delta}} + \sqrt {\lambda} \right\} \tag {34} +$$ + +with probability at least $1 - \delta$ . + +See Appendix B.5 for the proof of this claim. + +After redefining $\delta$ and collecting probabilities, Cauchy-Schwartz now ensures with probability $1 - \delta$ that + +$$ +\left| \left\langle \phi_ {\ell} (s, a), \widehat {\theta} _ {\ell} ^ {t a r} - \theta^ {\pi , \widehat {\theta} _ {\ell + 1} ^ {t a r}, \ell} \right\rangle \right| \leq \| \phi_ {\ell} (s, a) \| _ {\left(\overline {{\Sigma}} _ {\ell} \left(n ^ {\star}\right)\right) ^ {- 1}} \| \widehat {\theta} _ {\ell} ^ {t a r} - \theta^ {\pi , \widehat {\theta} _ {\ell + 1} ^ {t a r}, \ell} \| _ {\overline {{\Sigma}} _ {\ell} \left(n ^ {\star}\right)} \leq \underbrace {\alpha \left(n ^ {\star} , \delta^ {\star}\right) \| \phi_ {\ell} (s , a) \| _ {\left(\overline {{\Sigma}} _ {\ell} \left(n ^ {\star}\right)\right) ^ {- 1}}} _ {\equiv \mathcal {U} _ {\ell} (s, a)}, \tag {35} +$$ + +where we have used the definition (16a) for the uncertainty parameter with the number of samples given by Lemma 2 (Number of Samples) together with a union bound over the horizon and the random epoch at evaluation time. + +We now use the bound (35) to prove the two inequalities in equation (25). + +Proof of inequality (25)(b): We begin with the upper bound. Due to the clipping step, we are guaranteed to have the upper bound $\widehat{Q}_{\ell}^{tar}(s,a) \leq \left\langle \phi_{\ell}(s,a), \widehat{\theta}_{\ell}^{tar} \right\rangle + b_{\ell}(s,a)$ , and hence + +$$ +\widehat {Q} _ {\ell} ^ {t a r} (s, a) - \left\langle \phi_ {\ell} (s, a), \theta^ {\pi , \widehat {\theta} _ {\ell + 1} ^ {t a r}, \ell} \right\rangle = \left\langle \phi_ {\ell} (s, a), \widehat {\theta} _ {\ell} ^ {t a r} - \theta^ {\pi , \widehat {\theta} _ {\ell + 1} ^ {t a r}, \ell} \right\rangle + b _ {\ell} (s, a) \stackrel {(i)} {\leq} \mathcal {U} _ {\ell} (s, a) + b _ {\ell} (s, a), +$$ + +where step (i) follows from our earlier inequality (35). Thus, we have established the bound (25)(b) once we recall the definition of transfer error $\Delta_{\ell}^{\pi}$ . + +Proof of the lower bound (25)(a): We now turn to the lower bound. By construction, we have $\| \widehat{Q}_{\ell}^{tar} \|_{\infty} \leq 1$ , so that we can write + +$$ +\widehat {Q} _ {\ell} ^ {t a r} (s, a) = \min \left\{1, \left\langle \phi_ {\ell} (s, a), \widehat {\theta} _ {\ell} ^ {t a r} \right\rangle + b _ {\ell} (s, a) \right\}. +$$ + +Consequently, by adding and subtracting the term $\left\langle \phi_{\ell}(s,a),\theta^{\pi ,\widehat{\theta}_{\ell +1}^{tar},\ell}\right\rangle$ , we have + +$$ +\begin{array}{l} \widehat {Q} _ {\ell} ^ {t a r} (s, a) = \min \left\{1, \left\langle \phi_ {\ell} (s, a), \widehat {\theta} _ {\ell} ^ {t a r} - \theta^ {\pi , \widehat {\theta} _ {\ell + 1} ^ {t a r}, \ell} \right\rangle + b _ {\ell} (s, a) + \left\langle \phi_ {\ell} (s, a), \theta^ {\pi , \widehat {\theta} _ {\ell + 1} ^ {t a r}, \ell} \right\rangle \right\} \\ \stackrel {(i)} {\geq} \min \left\{1, - \mathcal {U} _ {\ell} (s, a) + b _ {\ell} (s, a) + \left\langle \phi_ {\ell} (s, a), \theta^ {\pi , \widehat {\theta} _ {\ell + 1} ^ {t a r}}, \ell \right\rangle \right\} \\ \stackrel {(i i)} {\geq} \min \left\{0, - \mathcal {U} _ {\ell} (s, a) + b _ {\ell} (s, a) \right\} + \left\langle \phi_ {\ell} (s, a), \theta^ {\pi , \widehat {\theta} _ {\ell + 1} ^ {t a r}, \ell} \right\rangle . \\ \end{array} +$$ + +where step (i) uses our earlier bound (35), and step (ii) follows since $\langle \phi_{\ell}(s,a),\theta^{\pi ,\theta_{\ell +1}^{tar},\ell}\rangle \leq 1$ . In this way, we have shown that + +$$ +\widehat {Q} _ {\ell} ^ {t a r} (s, a) - (\mathcal {T} _ {\ell} \widehat {Q} _ {\ell + 1} ^ {t a r}) (s, a) \geq \min \left\{0, - \mathcal {U} _ {\ell} (s, a) + b _ {\ell} (s, a) \right\} - \Delta_ {\ell} ^ {\pi} (s, a), +$$ + +as claimed in equation (25)(a). + +# B.5. Proof of Lemma 4 + +Our proof makes use of known bounds on the excess risk in a linear regression problem. In particular, consider a regression problem based on covariate vectors $\phi \in \mathbb{R}^d$ and responses $y\in \mathbb{R}$ that satisfy the bounds $\| \phi \| _2\leq 1$ and $|y|\leq y_{max}$ . + +With the shorthand $z = (\phi, y)$ , define the least-squares loss $\mathcal{L}_w(z) = \frac{1}{2} (y - \langle \phi, w \rangle)^2$ . For some distribution $\mathbb{P}$ over $\mathbb{R}^d \times \mathbb{R}$ , define the constrained population and empirical minimizers + +$$ +w ^ {\star} \stackrel {d e f} {=} \arg \min _ {\| w \| _ {2} \leq B} \mathbb {E} _ {Z \sim \mathbb {P}} \mathcal {L} _ {w} (Z), \quad \text {a n d} \quad \widehat {w} \stackrel {d e f} {=} \arg \min _ {\| w \| _ {2} \leq B} \frac {1}{n} \sum_ {i = 1} ^ {n} \mathcal {L} _ {w} (Z _ {i}) +$$ + +where $\{Z_i\}_{i=1}^n$ are drawn i.i.d. according to $\mathbb{P}$ . + +We claim that the excess risk associated with the constrained least-squares estimate $\widehat{w}$ can be bounded as + +$$ +\mathbb {E} _ {Z \sim \mathbb {P}} \left[ \mathcal {L} _ {\hat {w}} (Z) - \mathcal {L} _ {w ^ {\star}} (Z) \right] \leq \frac {1}{n} \left\{3 2 \left(B + y _ {\max }\right) ^ {2} \times \left[ d \log \left(3 2 B n \left(B + y _ {\max }\right)\right) + \log \left(\frac {1}{\delta^ {\prime}}\right) \right] + 1 \right\}, \tag {36} +$$ + +with probability at least $1 - \delta'$ . This bound follows as a consequence of a result due to Mehta (Mehta, 2017). In particular, the maximum value the loss can take is $L_{max}^2 = (B + y_{max})^2$ . Applying Theorem 1 in the paper (Mehta, 2017) to the least-squares objective, which is $1 / (4L_{max}^2)$ -exp-concave, yields the claim. + +To conclude, the proof of Lemma 4 follows by combining the bound with Lemma 16 (Excess Risk with Regularization). + +# C. Proof of Theorem 1 + +This section is devoted to the proof of the performance bound on $\mathbf{S}^4\mathbf{Q}$ -LEARNING stated in Theorem 1. At a high level, the proof consists of three steps. First, we decompose the regret into a sum of partial regrets incurred in each phase. Second, we show that the exploration bonus correctly quantifies the uncertainty; this allows the algorithm to ensure optimism. Finally, we use an elliptic potential argument and a bound on the number of phases to conclude the proof. + +Notation: Letting $p$ be the current phase, we use $Q^{(p)}$ and $V^{(p)}$ (respectively) to denote the $Q$ -action-value and value functions returned by $S^3$ Q-LEARNING, (cf. Line 6) and $\theta^{(p)}$ to denote the associated parameter of its linear representation. We let $\pi^{(p)}$ be the policy extracted in Line 7 of $S^4$ Q-LEARNING after termination of $S^3$ Q-LEARNING. Let $n^{(p)}$ be the (random) number of times that the policy is executed in phase $p$ between Line 9 and Line 16 of $S^4$ Q-LEARNING (Algorithm 2). Denote with $p_{tot}$ the total number of phases, including the one that is still in progress at the evaluation episode $K$ . We let $b^{(p)}$ denote the bonus (17) created at the end of phase $p - 1$ in Line 17 of Algorithm 2; the bonus will be actively used in phase $p$ . We use the shorthand $\Delta_h^{(p)}$ with the same meaning as Eq. (16c) where the policy $\pi$ is the one used in phase $p$ within $S^3$ Q-LEARNING. + +# C.1. Main argument + +We begin by decomposing the regret of $\mathbf{S}^4\mathbf{Q}$ -LEARNING into the sums of partial regrets generated in each phase $p = 1, \ldots, p_{tot}$ . The partial regret $\mathrm{REGRET}^{(p)}$ in phase $p$ corresponds to the regret incurred by playing all policies in that phase. Policy rollouts that generate regret are performed in one of two places: (i) in the call to $\mathbf{S}^3\mathbf{Q}$ -LEARNING (see Line 6 of $\mathbf{S}^4\mathbf{Q}$ -LEARNING), or; (ii) by $\mathbf{S}^4\mathbf{Q}$ -LEARNING between Line 9 and Line 16. We can write + +$$ +\operatorname {R E G R E T} ^ {(p)} \stackrel {\text {d e f}} {=} \sum_ {\substack {\pi \text {played in} \\ \text {the call to} \\ \mathrm {S} ^ {3} \mathrm {Q - L E A R N I N G} \\ \text {in phase} p}} \mathbb {E} _ {S _ {1} \sim \rho} \left(V _ {1} ^ {\star} - V _ {1} ^ {\pi}\right) (S _ {1}) + \sum_ {\substack {\pi \text {played in} \\ \text {the main loop of} \\ \mathrm {S} ^ {4} \mathrm {Q - L E A R N I N G} \\ \text {in phase} p}} \mathbb {E} _ {S _ {1} \sim \rho} \left(V _ {1} ^ {\star} - V _ {1} ^ {\pi}\right) (S _ {1}). \tag{37} +$$ + +The following lemma leverages the mechanics of the algorithm to upper bounds the total regret up to episode $K$ by expressing it as a sum of the regrets generated only by the main loop of $S^4 Q$ -LEARNING (so excluding the call to $S^3 Q$ -LEARNING). What makes this possible is that $S^3 Q$ -LEARNING only plays the policies from the policy replay memory $\Pi^{(p)}$ , which have already been played by the controller ( $S^4 Q$ -LEARNING). Summing over the phases and accounting for possible statistical deviations (due to sampling from the policy mixture) yields the following claim: + +Lemma 5 (Phased Regret). With probability at least $1 - \delta$ , uniformly over all $K$ , we have the upper bound $\mathrm{REGRET}(K) \stackrel{\text{def}}{=} \sum_{p=1}^{p_{tot}} \mathrm{REGRET}^{(p)} \leq T_1 + T_2$ , where + +$$ +T _ {1} \stackrel {\text {d e f}} {=} H \left\{\sum_ {p = 1} ^ {p _ {\text {t o t}}} \sum_ {j = 1} ^ {p - 1} n ^ {(j)} \times \mathbb {E} _ {S \sim \rho} \left[ V _ {1} ^ {\star} (S) - V _ {1} ^ {\pi^ {(j)}} (S) \right] \right\} + H \log \left(\frac {p _ {\text {t o t}}}{\delta}\right) \quad a n d \tag {38a} +$$ + +$$ +T _ {2} \stackrel {\text {d e f}} {=} \sum_ {p = 1} ^ {p _ {\text {t o t}}} n ^ {(p)} \times \mathbb {E} _ {S \sim \rho} \left[ V _ {1} ^ {\star} (S) - V _ {1} ^ {\pi^ {(p)}} (S) \right]. \tag {38b} +$$ + +See Appendix C.2 for the proof of this claim. + +Note that $T_{1}$ corresponds to the regret associated with $S^3 Q$ -LEARNING, whereas $T_{2}$ is associated with $S^4 Q$ -LEARNING. To be clear, the regret to $S^4 Q$ -LEARNING excludes the regret of the policies that are rolled out within the $S^3 Q$ -LEARNING subroutine. Now notice that for some constant $c \in \mathbb{R}$ we can write the total number of episodes as + +$$ +K = \underbrace{cH\sum_{p = 1}^{p_{tot}}\sum_{j = 1}^{p - 1}n^{(j)}}_{\substack{\text{Total trajectories by}\\ \mathrm{S}^{3}\mathrm{Q - LEARNING}}} + \underbrace{\sum_{p = 1}^{p_{tot}}n^{(p)}}_{\substack{\text{Total trajectories by}\\ \mathrm{S}^{4}\mathrm{Q - LEARNING}}}. +$$ + +Applying the Cauchy-Schwarz inequality yields the bound $\mathrm{REGRET}(K) \leq T_3 \times \sqrt{T_4}$ , where + +$$ +T _ {3} \stackrel {{d e f}} {{=}} \sqrt {c H \sum_ {p = 1} ^ {p _ {t o t}} \sum_ {j = 1} ^ {p - 1} n ^ {(j)} , \sum_ {p = 1} ^ {p _ {t o t}} n ^ {(p)}}, \quad \text {a n d} +$$ + +$$ +T _ {4} \stackrel {d e f} {=} c H \sum_ {p = 1} ^ {p _ {t o t}} \sum_ {j = 1} ^ {p - 1} n ^ {(j)} \left[ \mathbb {E} _ {S \sim \rho} \left(V _ {1} ^ {\star} - V _ {1} ^ {\pi^ {(j)}}\right) (S) \right] ^ {2} + \sum_ {p = 1} ^ {p _ {t o t}} n ^ {(p)} \left[ \mathbb {E} _ {S \sim \rho} \left(V _ {1} ^ {\star} - V _ {1} ^ {\pi^ {(p)}}\right) (S) \right] ^ {2}. +$$ + +Thus, a standard $\sqrt{K}$ regret bound can be obtained as soon as the term $T_{4}$ is bounded. The next step is then to transform $T_{4}$ into an estimation problem through optimism. + +Recall from equation (9). that we introduce optimism via an exploration bonus of the form + +$$ +b _ {h} ^ {(p)} (s, a) \stackrel {\text {d e f}} {=} \alpha_ {h} ^ {(p)} \| \phi_ {h} (s, a) \| _ {(\Sigma_ {h} ^ {(p)}) ^ {- 1}} \tag {39} +$$ + +for all state-action pairs. This bonus is created in Line 17, and passed to $\mathrm{S}^3\mathrm{Q}$ -LEARNING. The uncertainty parameter $\alpha^{(p)}$ to be used in phase $p$ is defined in Eq. (9). To be clear, the covariance matrix used to construct the bonus is the one in the + +current phase $\Sigma^{(p)}$ . In order to proceed, we must relate the bonus to the uncertainty function. Let us define the reference covariance + +$$ +\overline {{\Sigma}} _ {h} ^ {(p)} \stackrel {d e f} {=} \sum_ {j = 1} ^ {p - 1} n ^ {(j)} \mathbb {E} _ {\phi_ {h} \sim \pi^ {(j)}} [ \phi_ {h} \phi_ {h} ^ {\top} ] + \lambda_ {\mathrm {R e g}} I. +$$ + +We also recall our earlier definition (15) of the uncertainty parameter + +$$ +\alpha_ {h} ^ {(p)} = c \left\{\sqrt {d \log \left(\frac {d p n ^ {(1 : p)}}{\delta}\right)} + \sqrt {\lambda_ {\mathrm {R e g}}} \right\}. \tag {40} +$$ + +On our way to prove optimism, the next proposition highlights the relation between the bonus and the uncertainty function. + +Lemma 6 (Bonus Bound). Set $\lambda_{Reg} = \Theta (\log \frac{dpn^{(1:p)}}{\delta})$ . There exists a large enough $c\in \mathbb{R}$ in Eq. (40) such that with probability at least $1 - \delta$ jointly for all episodes $K$ we have the pointwise bound + +$$ +\mathcal {U} _ {h} ^ {(p)} \leq b _ {h} ^ {(p)} \leq c _ {o} \mathcal {U} _ {h} ^ {(p)} \tag {41} +$$ + +for some constant $c_{o}\in \mathbb{R}$ + +The lemma is proved in Appendix C.3, and it allows us to claim that the algorithm is optimistic (using the left inequality above) but without using a bonus that is too large (right inequality above) which would create too much regret. We verify such optimistic claim in Appendix C.4. Recall the definition of transfer error in Eq. (5) and the comparator error in Eq. (16c) where $\widehat{Q}_{h+1}^{tar} = Q_{h+1}^{(p)}$ is the network returned by S $^3$ Q-LEARNING. + +Lemma 7 (Near-Optimism). Suppose that the event in Lemma 6 holds jointly for all episodes $K$ . Then optimism holds in the following sense: + +$$ +Q _ {h} ^ {(p)} (s, a) \geq Q _ {h} ^ {\star} (s, a) - \sum_ {\tau = h} ^ {H} \mathbb {E} _ {\left(S _ {\tau} ^ {\prime}, A _ {\tau} ^ {\prime}\right) \sim \pi^ {\star} | (s, a)} \Delta_ {\tau} ^ {(p)} \left(S _ {\tau} ^ {\prime}, A _ {\tau} ^ {\prime}\right), \quad \forall (s, a) \tag {42a} +$$ + +As a consequence, under the same event, we have + +$$ +\mathbb {E} _ {S \sim \rho} V _ {1} ^ {(p)} (S) \geq \mathbb {E} _ {S \sim \rho} V ^ {\star} (S) - \nu . \tag {42b} +$$ + +From the optimism in the procedure, at any phase $j$ , we have the bound + +$$ +0 \leq \mathbb {E} _ {S \sim \rho} \left(V _ {1} ^ {\star} - V _ {1} ^ {\pi^ {(j)}}\right) (S) \leq \mathbb {E} _ {S \sim \rho} \left(V _ {1} ^ {(j)} - V _ {1} ^ {\pi^ {(j)}}\right) (S) + \nu , +$$ + +and hence + +$$ +T _ {4} \lesssim T _ {4 a} + T _ {4 b} + \underbrace {\left(c H \sum_ {p = 1} ^ {p _ {t o t}} \sum_ {j = 1} ^ {p - 1} n ^ {(j)} + \sum_ {p = 1} ^ {p _ {t o t}} n ^ {(p)}\right)} _ {= K} \nu^ {2} +$$ + +where + +$$ +T _ {4 a} \stackrel {d e f} {=} c H \sum_ {p = 1} ^ {p _ {t o t}} \sum_ {j = 1} ^ {p - 1} n ^ {(j)} \Big [ \mathbb {E} _ {S \sim \rho} \big (V _ {1} ^ {(j)} - V _ {1} ^ {\pi^ {(j)}} \big) (S) \Big ] ^ {2} m \quad \mathrm {a n d} \quad T _ {4 b} \stackrel {d e f} {=} \sum_ {p = 1} ^ {p _ {t o t}} n ^ {(p)} \Big [ \mathbb {E} _ {S \sim \rho} \big (V _ {1} ^ {(p)} - V _ {1} ^ {\pi^ {(p)}} \big) (S) \Big ] ^ {2}. +$$ + +In turn bounding $T_{4a}$ and $T_{4b}$ , we find that + +$$ +T _ {4} \lesssim H p _ {t o t} \sum_ {j = 1} ^ {p} n ^ {(j)} \left[ \mathbb {E} _ {S \sim \rho} \left(V _ {1} ^ {(j)} - V _ {1} ^ {\pi^ {(j)}}\right) (s) \right] ^ {2} + K \nu^ {2}. +$$ + +The remainder of the proof is devoted to deriving a high probability bound on the first term of the above display. Using the error bounds on $\mathbf{S}^3\mathbf{Q}$ -LEARNING from Theorem 3, we can write + +$$ +\begin{array}{l} T _ {4} \lesssim H p _ {t o t} \sum_ {j = 1} ^ {p} n ^ {(j)} \Big [ \sum_ {h = 1} ^ {H} \mathbb {E} _ {(S _ {h}, A _ {h}) \sim \pi^ {(j)}} (\mathcal {U} _ {h} ^ {(j)} + b _ {h} ^ {(j)} - \Delta_ {h} ^ {(j)}) (s _ {h}, a _ {h}) \Big ] ^ {2} + K \nu^ {2} \\ \lesssim H p _ {t o t} \sum_ {j = 1} ^ {p} n ^ {(j)} \Big [ \sum_ {h = 1} ^ {H} \mathbb {E} _ {(S _ {h}, A _ {h}) \sim \pi^ {(j)}} (\mathcal {U} _ {h} ^ {(j)}) (s _ {h}, a _ {h}) \Big ] ^ {2} + K \nu^ {2}. \\ \end{array} +$$ + +The second step follows by bringing $\nu$ outside the square and by bounding the bonus by using Lemma 6 (Bonus Bound). + +Putting together the pieces, we have + +$$ +\begin{array}{l} T _ {4} \stackrel {(i)} {\lesssim} H ^ {2} p _ {t o t} \sum_ {j = 1} ^ {p} n ^ {(j)} \sum_ {h = 1} ^ {H} \left[ \mathbb {E} _ {(S _ {h}, A _ {h}) \sim \pi^ {(j)}} \mathcal {U} _ {h} ^ {(j)} (s _ {h}, a _ {h}) \right] ^ {2} + K \nu^ {2} \\ \stackrel {(i i)} {\leq} H ^ {2} p _ {t o t} \sum_ {h = 1} ^ {H} \sum_ {j = 1} ^ {p} n ^ {(j)} \mathbb {E} _ {\left(S _ {h}, A _ {h}\right) \sim \pi^ {(j)}} \left[ \mathcal {U} _ {h} ^ {(j)} \left(s _ {h}, a _ {h}\right) \right] ^ {2} + K \nu^ {2} \\ = H ^ {2} p _ {t o t} \sum_ {h = 1} ^ {H} \sum_ {j = 1} ^ {p} n ^ {(j)} \mathbb {E} _ {(S _ {h}, A _ {h}) \sim \pi^ {(j)}} \Big [ \alpha_ {h} ^ {(j)} \| \phi_ {h} (s _ {h}, a _ {h}) \| _ {(\overline {{\Sigma}} _ {h} ^ {(j)}) ^ {- 1}} \Big ] ^ {2} + K \nu^ {2}, \\ \end{array} +$$ + +where step (i) follows from the Cauchy-Schwarz inequality, and step (ii) follows from Jensen's inequality. Notice that that we have the ordering $\alpha_h^{(1)}\leq \dots \leq \alpha_h^{(p)}\leq \dots \leq \alpha_h^{(p_{tot})}$ , i.e., the sequence of reference parameter uncertainty must be non-decreasing. Consequently, we find that + +$$ +T _ {4} \lesssim H ^ {2} p _ {t o t} \sum_ {h = 1} ^ {H} \left(\alpha_ {h} ^ {\left(p _ {t o t}\right)}\right) ^ {2} \sum_ {j = 1} ^ {p} n ^ {(j)} \mathbb {E} _ {\left(S _ {h}, A _ {h}\right) \sim \pi^ {(j)}} \| \phi_ {h} \left(s _ {h}, a _ {h}\right) \| _ {\left(\overline {{\Sigma}} _ {h} ^ {(j)}\right) - 1} ^ {2} + K \nu^ {2}. \tag {43} +$$ + +We now proceed to bound the sum of the quadratic terms, a quantity that arises in linear bandit analysis. In order to do so, we need to define the triggering value used in Line 16 of Algorithm 2. + +$$ +L _ {\text {t r i g}} = \Theta \left(\log \frac {n p}{\delta}\right) \tag {44} +$$ + +where $n \leq K$ is the number of times the condition has been checked in phase $p$ . We obtain the following lemma which is proved in Appendix C.5. + +Lemma 8 (Elliptic Potential). Assume $\lambda_{Reg} = \Theta (\log \frac{dpn^{(1:p)}}{\delta})\geq 1$ . There exists a setting $L_{trig}$ as defined in Eq. (44) such that with probability at least $1 - \delta$ we have + +$$ +\sum_ {j = 1} ^ {p} n ^ {(j)} \mathbb {E} _ {\left(S _ {h}, A _ {h}\right) \sim \pi^ {(j)}} \| \phi_ {h} \left(s _ {h}, a _ {h}\right) \| _ {\left(\overline {{\Sigma}} _ {h} ^ {(j)}\right) - 1} ^ {2} \leq 8 \left(L _ {\text {t r i g}} + 1\right) \widetilde {d _ {h}}. \tag {45} +$$ + +Continuing the bound (43), recalling the definition (40) and applying Cauchy-Schwartz gives us + +$$ +\begin{array}{l} T _ {4} \lesssim H ^ {2} p _ {t o t} \left(\sum_ {h = 1} ^ {H} \left(\alpha_ {h} ^ {(p _ {t o t})}\right) ^ {2} \widetilde {d} _ {h}\right) \times 8 (L _ {\mathrm {t r i g}} + 1) + K \nu^ {2} \\ \lesssim H ^ {2} p _ {t o t} \sum_ {h = 1} ^ {H} \left(d _ {h} + \log \frac {d p _ {t o t} K}{\delta}\right) \widetilde {d} _ {h} \times 8 (L _ {\mathrm {t r i g}} + 1) + K \nu^ {2}. \\ \end{array} +$$ + +To conclude, it remains to bound the total number $p_{tot}$ of phases; we state the bound here and prove it in Appendix C.6. + +Lemma 9 (Number of Phases). Under the conditions of Lemma 8, the total number of phases up to episode $K$ is upper bounded as + +$$ +p _ {t o t} \leq \sum_ {h = 1} ^ {H} \frac {\widetilde {d} _ {h}}{\log \left(1 + \frac {1}{8} L _ {t r i g}\right)} \tag {46} +$$ + +with probability at least $1 - \delta$ . + +# C.2. Proof of Lemma 5 + +The total regret up to episode $K$ can be expressed as a sum of regret incurred in different phases + +$$ +\operatorname {R E G R E T} (K) = \sum_ {p = 1} ^ {p _ {\text {t o t}}} \operatorname {R E G R E T} ^ {(p)}. \tag {47} +$$ + +Notice that in every phase $p$ , the $S^3 Q$ -LEARNING procedure is invoked with the policy replay memory $\Pi^{(p)}$ which consists of the mixture policy $\sum_{j=1}^{p-1} n^{(j)} \pi^{(j)}$ and in addition $S^4 Q$ -LEARNING plays the policy $\pi^{(p)}$ between Line 9 and Line 16 (in Algorithm 2) for exactly $n^{(p)}$ trajectories. Notice that in this proof the sequence $\{n^{(j)}\}_1^p$ is assumed to be fixed, i.e., non-random. + +Outside of the call to $\mathbf{S}^3\mathbf{Q}$ -LEARNING, $\mathbf{S}^4\mathbf{Q}$ -LEARNING induces a regret exactly equal to + +$$ +\mathrm {S} ^ {4} \mathrm {Q} - \text {L E A R N I N G ' s} \operatorname {R E G R E T} ^ {(p)} = n ^ {(p)} \times \mathbb {E} _ {S \sim \rho} \left(V _ {1} ^ {\star} - V _ {1} ^ {\pi^ {(p)}}\right) (s). \tag {48} +$$ + +In the same phase $p$ , the regret due to the call to $\mathbf{S}^3\mathbf{Q}$ -LEARNING in Line 6 of $\mathbf{S}^4\mathbf{Q}$ -LEARNING is + +$$ +\mathrm {S} ^ {3} \text {Q - L E A R N I N G ' s R E G R E T} ^ {(p)} \propto H \sum_ {j} ^ {p - 1} N _ {Q} ^ {(j)} \times \mathbb {E} _ {S \sim \rho} \left(V _ {1} ^ {\star} - V _ {1} ^ {\pi^ {(j)}}\right) (s) \tag {49} +$$ + +where $N_{Q}^{(j)}$ is the random number of times that policy $\pi^{(j)}$ is actually played within $\mathbf{S}^3\mathbf{Q}$ -LEARNING in phase $p$ . Intuitively, $N_{Q}^{(j)} \approx n^{(p)}$ since $\mathbb{E}N_{Q}^{(j)} = n^{(p)}$ . We make this precise by applying a Bernstein inequality for martingales (cf. Thm. 1 from the paper (Beygelzimer et al., 2011)). + +Let $0 \leq X_{j} \stackrel{def}{=} \mathbb{E}_{S' \sim \rho}(V_{1}^{\star} - V_{1}^{\pi^{(j)}})(s') \leq 1$ be the random regret in step $j$ of $\mathrm{S}^3\mathrm{Q}$ -LEARNING; here the randomness comes from the random index $j$ of the policy mixture. Let $n_{\mathrm{tot}} = \sum_{j=1}^{p-1} n^{(j)}$ ; we can write + +$$ +\sum_ {t = 1} ^ {n _ {\mathrm {t o t}}} X _ {t} = \sum_ {j = 1} ^ {p - 1} N _ {Q} ^ {(j)} \times \mathbb {E} _ {S ^ {\prime} \sim \rho} \left(V _ {1} ^ {\star} - V _ {1} ^ {\pi^ {(j)}}\right) (s ^ {\prime}). +$$ + +By construction, the $X_{t}$ 's are i.i.d., and $\mathbb{E}\sum_{t = 1}^{n_{\mathrm{tot}}}X_{t} = \sum_{j = 1}^{p - 1}n^{(j)}\mathbb{E}_{S^{\prime}\sim \rho}(V_{1}^{\star} - V_{1}^{\pi^{(j)}})(S^{\prime})$ . Therefore, upon invoking Theorem 1 from the paper (Beygelzimer et al., 2011) and recalling that $X_{t}^{2}\leq X_{t}$ , we find that + +$$ +\sum_ {t = 1} ^ {n _ {\mathrm {t o t}}} X _ {t} \leq \sum_ {t = 1} ^ {n _ {\mathrm {t o t}}} \mathbb {E} X _ {t} + 2 \sqrt {\left(\sum_ {t = 1} ^ {n _ {\mathrm {t o t}}} \mathbb {E} _ {t} X _ {t}\right) \log \left(\frac {1}{\delta}\right)} + 2 \log \left(\frac {1}{\delta}\right) +$$ + +with probability at least $1 - \delta$ . Completing the square on the right hand side and applying Cauchy-Schwarz inequality yields the upper bound $2\sum_{t=1}^{n_{\mathrm{tot}}} \mathbb{E}X_t + 3\log\left(\frac{1}{\delta}\right)$ . + +Thus, the regret contributed by $\mathbf{S}^3\mathbf{Q}$ -LEARNING in phase $p$ can be upper bounded by the cumulative regret by $\mathbf{S}^4\mathbf{Q}$ -LEARNING (excluding its call to $\mathbf{S}^3\mathbf{Q}$ -LEARNING)—viz. + +$$ +\mathrm {S} ^ {3} \mathrm {Q - L E A R N I N G} ^ {\prime} \mathrm {s} \mathrm {R E G R E T} ^ {(p)} \lesssim H \sum_ {j} ^ {p - 1} n ^ {(j)} \times \mathbb {E} _ {S \sim \rho} \left(V _ {1} ^ {\star} - V _ {1} ^ {\pi^ {(j)}}\right) (s) + 3 H \log \frac {1}{\delta}. +$$ + +Summing together these contributions over all phases, and applying the union bound over all possible phases yields the claim. + +# C.3. Proof of Lemma 6 (Bonus Bound) + +The main part of the proof is to show that the empirical covariance matrices are accurate enough. $\mathbf{S}^4\mathbf{Q}$ -LEARNING constructs the cumulative covariance used to construct the bonus to be used in phase $p$ as the sum of two terms: 1) the covariance estimate returned by $\mathbf{S}^3\mathbf{Q}$ -LEARNING in Line 6 of Algorithm 2 and 2) the increment obtained by $\mathbf{S}^4\mathbf{Q}$ -LEARNING between Line 9 and Line 16 of Algorithm 2. We can write: + +$$ +\Sigma_ {h} ^ {(p)} = \underbrace {\lambda_ {\text {R e g}} I + \sum_ {i = 1} ^ {n ^ {(1 : p - 1)}} \phi_ {i h} \phi_ {i h} ^ {\top}} _ {\mathrm {S} ^ {3} \mathrm {Q} - \text {L E A R N I N G} ^ {\prime} \text {s C o v a r i a n c e E s t i m a t e}} + \underbrace {\sum_ {j = 1} ^ {n ^ {(p)}} \phi_ {j h} \phi_ {j h} ^ {\top}} _ {\mathrm {S} ^ {4} \mathrm {Q} - \text {L E A R N I N G} ^ {\prime} \text {s i n c r e m e n t}}. \tag {50} +$$ + +For simplicity we have denoted with $n^{(1:p-1)} = \sum_{i=1}^{p-1} n^{(i)}$ ; the first summation is over the feature vectors $\{\phi_i\}$ sampled by $S^3 Q$ -LEARNING and the second is over the feature vectors $\{\phi_j\}$ examined by $S^4 Q$ -LEARNING. Notice that there exists a setting $\lambda_{\mathrm{Reg}} = \Theta(\log \frac{d}{\delta})$ that allows us to use Proposition 1 (Concentration of Regularized Covariance) twice and claim with probability at least $1 - \delta / 2$ + +$$ +\begin{array}{l} \Sigma_ {h} ^ {(p)} = \frac {\lambda_ {\mathrm {R e g}}}{2} I + \sum_ {i = 1} ^ {n ^ {(1: p - 1)}} \phi_ {i h} \phi_ {i h} ^ {\top} + \frac {\lambda_ {\mathrm {R e g}}}{2} I + \sum_ {j = 1} ^ {n ^ {(p)}} \phi_ {j h} \phi_ {j h} ^ {\top} \\ \preceq 2 \lambda_ {\mathrm {R e g}} I + 2 n ^ {(1: p - 1)} \mathbb {E} _ {\phi \sim \Pi^ {(p - 1)}} \phi_ {h} \phi_ {h} ^ {\top} + 2 n ^ {(p)} \mathbb {E} _ {\phi \sim \pi^ {(p)}} \phi_ {h} \phi_ {h} ^ {\top} \\ = 2 \lambda_ {\mathrm {R e g}} I + 2 n ^ {(1: p)} \mathbb {E} _ {\phi \sim \Pi^ {(p)}} \phi_ {h} \phi_ {h} ^ {\top} \\ = 2 \overline {{\Sigma}} _ {h} ^ {(p)}. \\ \end{array} +$$ + +(We have indicated with $\phi \sim \pi^{(p)}$ the random feature sampled according to the policy mixture using the policy replay memory). We conclude that under such event we must have + +$$ +b _ {h} ^ {(p)} (s, a) = \alpha_ {h} ^ {(p)} \| \phi_ {h} (s, a) \| _ {(\Sigma_ {h} ^ {(p)}) ^ {- 1}} \geq \alpha_ {h} ^ {(p)} \| \phi_ {h} (s, a) \| _ {(\overline {{\Sigma}} _ {h} ^ {(p)}) ^ {- 1}} = \mathcal {U} _ {h} ^ {(p)} (s, a). +$$ + +and under the same event + +$$ +b _ {h} ^ {(p)} (\cdot , \cdot) = \alpha_ {h} ^ {(p)} \| \phi_ {h} (\cdot , \cdot) \| _ {\left(\Sigma_ {h} ^ {(p)}\right) ^ {- 1}} \leq 2 \alpha_ {h} ^ {(p)} \| \phi_ {h} (\cdot , \cdot) \| _ {\left(\overline {{\Sigma}} _ {h} ^ {(p)}\right) ^ {- 1}} = c _ {o} \mathcal {U} _ {h} ^ {(p)} (\cdot , \cdot). \tag {51} +$$ + +A union bound over all possible phases and rescaling $\delta$ concludes. + +# C.4. Proof of Lemma 7 + +When $S^3 Q$ -LEARNING terminates, Theorem 3 ensures it returns a state-action value function $\widehat{Q}^\star$ such that + +$$ +\widehat {Q} _ {h} ^ {\star} (s, a) = \left(\mathcal {T} _ {\ell} \widehat {Q} _ {h + 1} ^ {\star}\right) (s, a) + \mathcal {E} _ {h} (s, a), \quad \text {a n d} +$$ + +$$ +\min \{0, \left(- \mathcal {U} _ {h} ^ {(p)} + b _ {h} ^ {(p)}\right) (s, a) \} - \Delta_ {h} ^ {(p)} (s, a) \leq \mathcal {E} _ {h} (s, a), +$$ + +where both relations hold uniformly over all state-action pairs $(s, a)$ . Conditioned on the event from Lemma 6, we have + +$$ +- \Delta_ {h} ^ {(p)} (s, a) = \min \{0, - \mathcal {U} _ {h} ^ {(p)} (s, a) + b _ {h} ^ {(p)} (s, a) \} - \Delta_ {h} ^ {(p)} (s, a) \leq \mathcal {E} _ {h} (s, a). +$$ + +which implies that $\mathcal{E}_h(s,a)\geq -\Delta_h^{(p)}(s,a)$ for all state-action pairs and time steps $h$ + +Using this bound, we now perform backwards induction over the timestep $h$ in order to prove that + +$$ +\widehat {Q} _ {h + 1} ^ {\star} \left(s _ {h + 1}, a _ {h + 1}\right) \geq Q _ {h + 1} ^ {\star} \left(s _ {h + 1}, a _ {h + 1}\right) - \sum_ {\tau = h + 1} ^ {H} \mathbb {E} _ {\left(s _ {\tau} ^ {\prime}, a _ {\tau} ^ {\prime}\right) \sim \pi^ {\star} \mid \left(s _ {h + 1}, a _ {h + 1}\right)} \Delta_ {h} ^ {(p)} \left(s _ {\tau} ^ {\prime}, a _ {\tau} ^ {\prime}\right), \quad \forall \left(s _ {h + 1}, a _ {h + 1}\right) \tag {52} +$$ + +For the base case $h = H$ , all action-value functions are zero, so that the bound (52) certainly holds. + +Now assume that the bound (52) holds at timestep $h + 1$ , for some $h \in \{1, \dots, H - 1\}$ ; we need to show that it also holds at timestep $h$ . Fix an arbitrary state-action pair $(s, a)$ . From our earlier lower bound, we have + +$$ +\begin{array}{l} \widehat {Q} _ {h} ^ {\star} (s, a) = \left(\mathcal {T} _ {h} \widehat {Q} _ {h + 1} ^ {\star}\right) (s, a) + \mathcal {E} _ {h} (s, a) \\ \geq \left(\mathcal {T} _ {h} ^ {\pi^ {\star}} \widehat {Q} _ {h + 1} ^ {\star}\right) (s, a) + \mathcal {E} _ {h} (s, a) \\ \stackrel {\mathrm {(i)}} {\geq} \left(\mathcal {T} _ {h} ^ {\pi^ {\star}} Q _ {h + 1} ^ {\star}\right) (s, a) + \mathcal {E} _ {h} (s, a) - \sum_ {\tau = h + 1} ^ {H} \mathbb {E} _ {(s _ {\tau} ^ {\prime}, a _ {\tau} ^ {\prime}) \sim \pi^ {\star} | (s, a)} \Delta_ {h} ^ {(p)} (s _ {\tau} ^ {\prime}, a _ {\tau} ^ {\prime}) \\ \geq \left(\mathcal {T} _ {h} Q _ {h + 1} ^ {\star}\right) (s, a) - \sum_ {\tau = h} ^ {H} \mathbb {E} _ {(s _ {\tau} ^ {\prime}, a _ {\tau} ^ {\prime}) \sim \pi^ {\star} | (s, a)} \Delta_ {h} ^ {(p)} (s _ {\tau} ^ {\prime}, a _ {\tau} ^ {\prime}). \\ \end{array} +$$ + +Here step (i) follows from the induction hypothesis. Thus, we have shown that the bound (52) holds at timestep $h$ , which completes our proof via induction. + +# C.5. Proof of Lemma 8 + +We now prove the elliptic potential bound stated in Lemma 8. Let $\phi_{ih}^{(j)}$ be the $i$ experienced feature vector at level $h$ that $\mathrm{S}^4\mathrm{Q}$ -LEARNING uses to check the triggering condition in Line 16 during phase $j$ . Since $\lambda_{\mathrm{Reg}} \geq 1$ we have $\| \phi \|_{(\Sigma_h^{(j)})^{-1}} \leq 1$ , $\forall \| \phi \|_2 \leq 1$ . Thus, when the triggering condition holds, the condition itself is not violated by much: + +$$ +L _ {\text {t r i g}} \leq \sum_ {i = 1} ^ {n ^ {(j)}} \| \phi_ {i h} ^ {(j)} \| _ {(\Sigma_ {h} ^ {(j)}) ^ {- 1}} ^ {2} \leq \underbrace {\sum_ {i = 1} ^ {n ^ {(j)} - 1} \| \phi_ {i h} ^ {(j)} \| _ {(\Sigma_ {h} ^ {(j)}) ^ {- 1}} ^ {2}} _ {\leq L _ {\text {t r i g}}} + \underbrace {\| \phi_ {n ^ {(j)} h} ^ {(j)} \| _ {(\Sigma_ {h} ^ {(j)}) ^ {- 1}} ^ {2}} _ {\leq 1} \leq L _ {\text {t r i g}} + 1. \tag {53} +$$ + +Using Lemma 12 (Proportional Estimates) and Proposition 1 (Concentration of Regularized Covariance), we find that with probability at least $1 - \delta$ + +$$ +\begin{array}{l} n ^ {(j)} \mathbb {E} _ {\left(S _ {h}, A _ {h}\right) \sim \pi^ {(j)}} \| \phi_ {h} \left(s _ {h}, a _ {h}\right) \| _ {\left(\overline {{\Sigma}} _ {h} ^ {(j)}\right) ^ {- 1}} ^ {2} \leq 4 n ^ {(j)} \mathbb {E} _ {\left(S _ {h}, A _ {h}\right) \sim \pi^ {(j)}} \| \phi_ {h} \left(s _ {h}, a _ {h}\right) \| _ {\left(\Sigma_ {h} ^ {(j)}\right) ^ {- 1}} ^ {2} \\ \leq 8 \sum_ {i = 1} ^ {n ^ {(j)}} \| \phi_ {i h} ^ {(j)} \| _ {(\Sigma_ {h} ^ {(j)}) ^ {- 1}} ^ {2} \leq 8 (L _ {\mathrm {t r i g}} + 1). \\ \end{array} +$$ + +Now recall that + +$$ +\overline {{\Sigma}} _ {h} ^ {(j + 1)} = \overline {{\Sigma}} _ {h} ^ {(j)} + n ^ {(j)} \mathbb {E} _ {(S _ {h}, A _ {h}) \sim \pi^ {(j)}} \phi_ {h} (s _ {h}, a _ {h}) \phi_ {h} (s _ {h}, a _ {h}) ^ {\top}. +$$ + +Since $(L_{\mathrm{trig}} + 1) \geq e - 1$ , we can invoke Lemma 11 (Information gain bounds) so as to ensure that + +$$ +n ^ {(j)} \mathbb {E} _ {\left(S _ {h}, A _ {h}\right) \sim \pi^ {(p)}} \| \phi_ {h} \left(s _ {h}, a _ {h}\right) \| _ {\left(\overline {{\Sigma}} ^ {(j)}\right) ^ {- 1}} ^ {2} \leq 8 \left(L _ {\text {t r i g}} + 1\right) \log \frac {\det \left(\overline {{\Sigma}} _ {h} ^ {(j + 1)}\right)}{\det \left(\overline {{\Sigma}} _ {h} ^ {(j)}\right)}. +$$ + +Summing over the phases and cancelling terms in the telescopic sum yields + +$$ +\begin{array}{l} \sum_ {j = 1} ^ {p} n ^ {(j)} \mathbb {E} _ {\left(S _ {h}, A _ {h}\right) \sim \pi^ {(j)}} \left\| \phi_ {h} \left(s _ {h}, a _ {h}\right) \right\| _ {\left(\overline {{\Sigma}} _ {h} ^ {(j)}\right) ^ {- 1}} ^ {2} \leq 8 \left(L _ {\operatorname {t r i g}} + 1\right) \log \frac {\det \left(\overline {{\Sigma}} _ {h} ^ {(p + 1)}\right)}{\det \left(\overline {{\Sigma}} _ {h} ^ {(1)}\right)} \\ \leq 8 \left(L _ {\text {t r i g}} + 1\right) \widetilde {d} _ {h}. \\ \end{array} +$$ + +A union bound over all possible phases concludes. + +# C.6. Proof of Lemma 9 (Number of Phases) + +For invertible matrices $A$ and $B$ , note that $A \preceq B$ implies that $A^{-1} \succeq B^{-1}$ , and moreover, we have the equivalence $A \preceq B \Longleftrightarrow x^{\top}Ax \leq x^{\top}Bx$ for all $x \in \mathbb{R}^d$ . We now combine Lemma 12 with Proposition 1 so as to argue that Algorithm 2 makes sufficient progress. In particular, consider each time that Line 16 of Algorithm 2 triggers a new phase at level $h$ . Then with probability at least $1 - \delta$ , we must have + +$$ +\begin{array}{l} n ^ {(p)} \mathbb {E} _ {\left(S _ {h}, A _ {h}\right) \sim \pi^ {(p)}} \left\| \phi_ {h} \left(s _ {h}, a _ {h}\right) \right\| _ {\left(\overline {{\Sigma}} _ {h} ^ {(p)}\right) ^ {- 1}} ^ {2} \geq \frac {1}{4} n ^ {(p)} \mathbb {E} _ {\left(S _ {h}, A _ {h}\right) \sim \pi^ {(p)}} \left\| \phi_ {h} \left(s _ {h}, a _ {h}\right) \right\| _ {\left(\Sigma_ {h} ^ {(p)}\right) ^ {- 1}} ^ {2} \\ \geq \frac {1}{8} \sum_ {i = 1} ^ {n ^ {(p)}} \| \phi_ {i h} ^ {(p)} \| _ {\left(\Sigma_ {h} ^ {(p)}\right) ^ {- 1}} ^ {2} \\ \geq \frac {1}{8} L _ {\text {t r i g}}. \\ \end{array} +$$ + +When this bound holds and the triggering condition is satisfied at level $h$ in phase $p$ , then the information ratio must increase by a constant fraction: more precisely, Lemma 11 guarantees that + +$$ +\begin{array}{l} \frac {\det \left(\overline {{\Sigma}} _ {h} ^ {(p + 1)}\right)}{\det \overline {{\Sigma}} _ {h} ^ {(p)}} = \frac {\det \left(\overline {{\Sigma}} _ {h} ^ {(p)} + n ^ {(p)} \mathbb {E} _ {\left(S _ {h} , A _ {h}\right) \sim \pi^ {(p)}} \phi_ {h} \left(s _ {h} , a _ {h}\right) \phi_ {h} \left(s _ {h} , a _ {h}\right) ^ {\top}\right)}{\det \overline {{\Sigma}} _ {h} ^ {(p)}} \\ \geq 1 + n ^ {(p)} \mathbb {E} _ {\left(S _ {h}, A _ {h}\right) \sim \pi^ {(p)}} \| \phi_ {h} \left(s _ {h}, a _ {h}\right) \| _ {\left(\overline {{\Sigma}} _ {h} ^ {(p)}\right) ^ {- 1}} ^ {2} \\ \geq 1 + \frac {1}{8} L _ {\text {T r i g g e r}} (\delta_ {\text {p h a s e}}). \\ \end{array} +$$ + +By induction, in phase $p$ we must have (notice that we are ignoring the additional contribution that arises when level $h$ is not the one that triggers a new phase) + +$$ +\frac {\det \bar {\Sigma} _ {h} ^ {(p + 1)}}{\det \bar {\Sigma} _ {h} ^ {(1)}} \geq \left(1 + \frac {1}{8} L _ {\mathrm {t r i g}}\right) ^ {s _ {h} ^ {(p)}} \tag {54} +$$ + +where $s_h^{(p)}$ is the number of switches up to phase $p$ that were triggered at level $h$ . Taking log gives + +$$ +s _ {h} ^ {(p)} \leq \frac {\log \frac {\operatorname* {d e t} \overline {{\Sigma}} _ {h} ^ {(p + 1)}}{\operatorname* {d e t} \overline {{\Sigma}} _ {h} ^ {(1)}}}{\log \left(1 + \frac {1}{3} L _ {\mathrm {t r i g}}\right)}. \tag {55} +$$ + +Recalling the total number of switches across levels equals the total number of phases, i.e., $\sum_{h=1}^{H} s_h^{(p)} = p_{tot}$ , together with the relevant union bound over phases concludes. + +# D. Auxiliary results + +In this appendix, we collect together various auxiliary results that we use in our main argument, along with their proofs. + +# D.1. Information Gain + +Lemma 10 (Upper Bound on Information Gain). + +$$ +\log \left(\frac {\det \bar {\Sigma} _ {h} ^ {(p t o t + 1)}}{\det \bar {\Sigma} _ {h} ^ {(1)}}\right) \leq \widetilde {d} _ {h} \leq d \log \frac {K}{d \lambda_ {R e g}}. \tag {56} +$$ + +We must now bound the determinant of $\overline{\Sigma}_h^{(p_{tot})}$ to compute the maximum number of phases; we proceed in a way similar to Lemma 10 of (Abbasi-Yadkori et al., 2011), the only difference being that the increments are not rank one. Let $\alpha_1, \ldots, \alpha_d$ + +be the eigenvalues of $\overline{\Sigma}_h^{(p_{tot})}$ . We must have + +$$ +\det \left(\bar {\Sigma} _ {h} ^ {(p _ {t o t})}\right) = \prod_ {i} \alpha_ {i} \leq \left(\frac {\sum_ {i} \alpha_ {i}}{d}\right) ^ {d} = \left(\frac {\operatorname {T r} \bar {\Sigma} _ {h} ^ {(p _ {t o t})}}{d}\right) ^ {d}. \tag {57} +$$ + +We can upper bound the trace as follows: + +$$ +\begin{array}{l} \operatorname {T r} \left(\overline {{\Sigma}} _ {h} ^ {(p _ {t o t})}\right) = \sum_ {p = 1} ^ {p _ {t o t}} \operatorname {T r} \left(n ^ {(p)} \overline {{M}} _ {h} ^ {(p)}\right) = \sum_ {p = 1} ^ {p _ {t o t}} n ^ {(p)} \operatorname {T r} \left(\mathbb {E} _ {(S _ {h}, A _ {h}) \sim \pi^ {(p)}} \phi_ {h} (s _ {h}, a _ {h}) \phi_ {h} (s _ {h}, a _ {h}) ^ {\top}\right) \\ = \sum_ {p = 1} ^ {p _ {t o t}} n ^ {(p)} \mathbb {E} _ {\left(S _ {h}, A _ {h}\right) \sim \pi^ {(p)}} \operatorname {T r} \left(\phi_ {h} \left(s _ {h}, a _ {h}\right) \phi_ {h} \left(s _ {h}, a _ {h}\right) ^ {\top}\right) \\ \leq \sum_ {p = 1} ^ {p _ {t o t}} n ^ {(p)} \\ \leq K. \\ \end{array} +$$ + +Combining with the prior displays and recalling that $\overline{\Sigma}_h^{(0)} = \lambda_{\mathrm{Reg}}I$ yields the claim. + +# D.2. Bounds on the information gain + +Lemma 11 (Information gain bounds). For any random vector $\phi \in \mathbb{R}^d$ , scalar $\alpha > 0$ and positive definite matrix $\Sigma$ , we have the upper bound + +$$ +\log \frac {\operatorname* {d e t} \left(\Sigma + \alpha \mathbb {E} \left[ \phi \phi^ {\top} \right]\right)}{\operatorname* {d e t} \Sigma} \leq \alpha \mathbb {E} \| \phi \| _ {\Sigma - 1} ^ {2}. \tag {58a} +$$ + +Moreover, we have the lower bounds + +$$ +\log \frac {\operatorname* {d e t} \left(\Sigma + \alpha \mathbb {E} \left[ \phi \phi^ {\top} \right]\right)}{\operatorname* {d e t} (\Sigma)} \geq \log \left(1 + \alpha \mathbb {E} \| \phi \| _ {\Sigma - 1} ^ {2}\right) \geq \frac {(i)}{L} \mathbb {E} \| \phi \| _ {\Sigma - 1} ^ {2}, \tag {58b} +$$ + +where (i) holds whenever $\alpha \mathbb{E}\| \phi \|_{\Sigma^{-1}}^2\leq L$ for some $L\geq e - 1$ + +Proof. We first begin with equivalent expression for the determinant ratio. Letting $\lambda_j(M)$ denote the $j^{th}$ -ordered eigenvalue of a matrix $M$ , we have + +$$ +\begin{array}{l} \frac {\det \left(\Sigma + \alpha \mathbb {E} \phi \phi^ {\top}\right)}{\det \Sigma} = \det (I + \alpha \Sigma^ {- \frac {1}{2}} \mathbb {E} [ \phi \phi^ {\top} ] \Sigma^ {- \frac {1}{2}}) = \prod_ {j = 1} ^ {d} \lambda_ {j} \left(I + \alpha \Sigma^ {- \frac {1}{2}} \mathbb {E} \phi \phi^ {\top} \Sigma^ {- \frac {1}{2}}\right) \\ = \prod_ {j = 1} ^ {d} \left(1 + \alpha \lambda_ {j} \left(\Sigma^ {- \frac {1}{2}} \mathbb {E} \phi \phi^ {\top} \Sigma^ {- \frac {1}{2}}\right)\right). \tag {59} \\ \end{array} +$$ + +Proof of the upper bound (58a): Taking logarithms in equation (59) and using the elementary bound $\log(1 + t) \leq t$ , valid for $t \geq 0$ , we have + +$$ +\begin{array}{l} \log \left(\frac {\det (\Sigma + \alpha \mathbb {E} \phi \phi^ {\top})}{\det \Sigma}\right) = \sum_ {j = 1} ^ {d} \log \left(1 + \alpha \lambda_ {j} \left(\Sigma^ {- \frac {1}{2}} \mathbb {E} \phi \phi^ {\top} \Sigma^ {- \frac {1}{2}}\right)\right) \leq \sum_ {j = 1} ^ {d} \left\{\alpha \lambda_ {j} \left(\Sigma^ {- \frac {1}{2}} \mathbb {E} \phi \phi^ {\top} \Sigma^ {- \frac {1}{2}}\right) \right\} \\ \stackrel {(i)} {=} \alpha \operatorname {T r} \left(\Sigma^ {- \frac {1}{2}} \mathbb {E} \phi \phi^ {\top} \Sigma^ {- \frac {1}{2}}\right) \\ \stackrel {(i i)} {=} \alpha \mathbb {E} \| \phi \| _ {\Sigma^ {- 1}} ^ {2}, \\ \end{array} +$$ + +where step (i) follows since the trace is equal to the sum of the eigenvalues, and step (ii) follows from cyclic properties of the trace operator, and some algebra. + +Proof of the lower bound (58b): In order to prove the lower bound, we again begin with equation (59). Notice that the eigenvalues are all non-negative since the matrix $\Sigma^{-\frac{1}{2}}\mathbb{E}[\phi \phi^{\top}]\Sigma^{-\frac{1}{2}}$ is positive semidefinite. Thus, we can ignore the higher-order terms in the product so as to obtain the lower bound + +$$ +\frac {\operatorname* {d e t} \left(\Sigma + \alpha \mathbb {E} \phi \phi^ {\top}\right)}{\operatorname* {d e t} \Sigma} \geq 1 + \alpha \sum_ {j = 1} ^ {d} \lambda_ {j} \left(\Sigma^ {- \frac {1}{2}} \mathbb {E} \phi \phi^ {\top} \Sigma^ {- \frac {1}{2}}\right) = 1 + \alpha \mathbb {E} \| \phi \| _ {\Sigma^ {- 1}} ^ {2}, \tag {60a} +$$ + +where the final equality follows by the same sequence of calculations as in step (ii) above. + +In order to complete the proof, observe that $f(x) = \log (1 + x)$ is a concave function. Thus, for any $a \geq e - 1$ and $x \in [0, a]$ , we can set $\lambda = \frac{x}{a} \in [0, 1]$ , and write + +$$ +\log (1 + x) = f (x) = f (\lambda a + (1 - \lambda) 0) \stackrel {(i i i)} {\geq} \lambda f (a) + (1 - \lambda) f (0) = \lambda f (a) \stackrel {(i v)} {\geq} \lambda = \frac {x}{a}, \tag {60b} +$$ + +where step (iii) follows from Jensen's inequality; and step (iv) is valid for any $a \geq e - 1$ . + +Finally, taking logarithms in inequality (60a) and applying the lower bound (60b) yields + +$$ +\log \frac {\operatorname* {d e t} (\Sigma + \alpha \mathbb {E} \phi \phi^ {\top})}{\operatorname* {d e t} \Sigma} \geq \log \left(1 + \alpha \mathbb {E} \| \phi \| _ {\Sigma - 1} ^ {2}\right) \geq \frac {\alpha}{L} \mathbb {E} \| \phi \| _ {\Sigma - 1} ^ {2}, +$$ + +as claimed. + +![](images/8029b6e808ad7ca1fff834f5b8f5af86e2ae214a732709d41f1e548979d3af15.jpg) + +# D.3. Proportional estimates under the triggering condition + +Suppose that the triggering condition holds, so that we have the lower bound + +$$ +\sum_ {i = 1} ^ {n} Z _ {i} \geq 3 2 \varphi_ {\sqrt {n}} \left(\frac {\delta}{2 n ^ {2}}\right) + 8 \varphi_ {n} \left(\frac {\delta}{2 n ^ {2}}\right) \stackrel {\text {d e f}} {=} L _ {\text {T r i g g e r}} (\delta). \tag {61} +$$ + +The following lemma shows that under this condition, the sample average $\widehat{S}_n \stackrel{\text{def}}{=} \frac{1}{n} \sum_{i=1}^{n} Z_i$ is close to the expectation $\mathbb{E}[Z]$ . + +Lemma 12 (Proportional Estimates). Under the triggering condition (61), for any $\delta \in (0,1)$ , we have the sandwich result + +$$ +\frac {1}{2} \widehat {S} _ {n} \leq \mathbb {E} [ Z ] \leq \frac {3}{2} \widehat {S} _ {n} \quad \text {w i t h p r o b . a t l e a s t} 1 - \delta . \tag {62} +$$ + +In order to prove this claim, we first show that for any fixed $n$ at which the triggering conditioning holds, the sandwich bound (62) holds with probability at least $1 - \delta'$ , where $\delta' = \frac{\delta}{2n^2}$ . We can then take a union bound over all $n = 1, 2, \ldots$ to conclude that for any $n$ , sandwich bound (62) holds with probability at least $1 - \sum_{n=1}^{\infty} \frac{\delta}{2n^2} \geq 1 - \delta$ , as required. + +Thus, for the remainder of the proof, we study the problem for a fixed sample size $n$ . Our proof is based two auxiliary results. First, for i.i.d. random variables $\{Z_i\}_{i=1}^n$ taking values in $[0,1]$ , the sample average $\widehat{S}_n$ satisfies the following empirical Bernstein bound: for any $\delta \in (0,1)$ , + +$$ +\mathbb {P} \left[ \left| \widehat {S} _ {n} - \mathbb {E} [ Z ] \right| \leq \sqrt {\frac {\varphi_ {\sqrt {n}} (\delta) \widehat {\operatorname {V a r} Z}}{n}} + \frac {\varphi_ {n} (\delta)}{n - 1} \right] \geq 1 - \delta \tag {63} +$$ + +where $\varphi_{\sqrt{n}}(\delta) = 2\log (\frac{4}{\delta})$ $\varphi_{n}(\delta) = \frac{7}{3}\log (\frac{4}{\delta})$ , and + +$$ +\widehat {\mathrm {V a r}} Z = \frac {1}{n (n - 1)} \sum_ {1 \leq i < j \leq n} (Z _ {i} - Z _ {j}) ^ {2} +$$ + +is the empirical variance. This claim is a consequence of two applications of the empirical Bernstein bound from the paper (Maurer & Pontil, 2009), as applied to the random variables $Z$ and then $1 - Z$ , followed by a union bound to obtain the two-sided claim give here. + +Next, we observe that the sample variance can be upper bounded as + +$$ +\widehat {\operatorname {V a r}} Z \stackrel {\text {d e f}} {=} \frac {1}{n - 1} \left(\sum_ {i = 1} ^ {n} Z _ {i} ^ {2} - \sum_ {i = 1} ^ {n} Z _ {i}\right) \leq \frac {1}{n - 1} \sum_ {i = 1} ^ {n} Z _ {i} ^ {2} \leq \frac {1}{n - 1} \sum_ {i = 1} ^ {n} Z _ {i} \leq \frac {n}{n - 1} \leq 2, \tag {64} +$$ + +using the fact that each $Z_{i}\in [0,1]$ + +Now combining the empirical Bernstein bound (63) with the variance bound (64), we find that + +$$ +\left| \widehat {S} _ {n} - \mathbb {E} [ Z ] \right| \leq \frac {1}{n} \left\{\sqrt {2 \widehat {S} _ {n} \varphi_ {\sqrt {n}} (\delta^ {\prime})} + 2 \varphi_ {n} (\delta^ {\prime}) \right\} \quad \text {w i t h p r o b . a t l e a s t} 1 - \delta^ {\prime}. \tag {65} +$$ + +The triggering condition (61) ensures that $n\widehat{S}_n \geq 32\varphi_{\sqrt{n}}(\delta') + 8\varphi_n(\delta')$ , whence $\frac{1}{n}\varphi_{\sqrt{n}}(\delta) \leq \frac{\widehat{S}_n}{32}$ and $\frac{1}{n}\varphi_n(\delta) \leq \frac{\widehat{S}_n}{8}$ . Putting together the pieces, we find that + +$$ +| \widehat {S} _ {n} - \mathbb {E} [ Z ] | \leq \frac {1}{n} \bigl \{\sqrt {2 \widehat {S} _ {n} \varphi_ {\sqrt {n}} (\delta)} + 2 \varphi_ {n} (\delta) \bigr \} \leq \sqrt {\frac {(\widehat {S} _ {n}) ^ {2}}{1 6}} + \frac {\widehat {S} _ {n}}{4} = \frac {\widehat {S} _ {n}}{2} +$$ + +with probability at least $1 - \delta'$ . Re-arranging shows that we have the sandwich relation $\frac{1}{2}\widehat{S}_n \leq \mathbb{E}[Z] \leq \frac{3}{2}\widehat{S}_n$ with probability $1 - \delta'$ , as claimed. + +# D.4. Non-Isotropic Proportional Estimates of the Empirical Covariance + +An important step in the analysis is ensuring that the empirical covariance matrices computed by the algorithm are sufficiently close to their (conditional) expectations. In this section, we discuss how to use matrix Chernoff techniques to establish the requisite bounds. + +Let $\{Z_k\}_{k=1}^n$ be a sequence of independent, symmetric and positive definite random matrices of dimension $d$ . Suppose that + +$$ +0 \leq \lambda_ {\min } \left(Z _ {k}\right), \quad \lambda_ {\max } \left(Z _ {k}\right) \leq L _ {Z}, \quad \text {f o r a l l} k = 1, \dots , K. \tag {66} +$$ + +The following result provides bounds on the sum $W = \sum_{k=1}^{K} Z_k$ . + +Proposition 1 (Concentration of Regularized Covariance). Under the above conditions, for any $\delta \in (0,1)$ and $\lambda \geq 2L_Z\frac{\log\frac{2d}{\delta}}{\log\frac{36}{35}}$ , we have + +$$ +\frac {1}{2} (W + \lambda I) \preceq \mathbb {E} W + \lambda I \preceq \frac {3}{2} (W + \lambda I). \tag {67} +$$ + +with probability at least $1 - \delta$ . + +Proof. In fact, we establish a somewhat more general claim: namely, for any $\epsilon > 0$ and $\lambda > 0$ , we have + +$$ +\mathbb {P} \left(\frac {1}{1 + \epsilon} (W + \lambda I) \preceq \mathbb {E} W + \lambda I \preceq \frac {1}{1 - \epsilon} (W + \lambda I)\right) \geq 1 - 2 d \left(1 - \frac {\epsilon^ {2}}{4}\right) ^ {\frac {\lambda}{L _ {Z} + \frac {\lambda}{R}}}. \tag {68} +$$ + +In order to recover the stated claim (67) we fix $\epsilon = \frac{1}{3}$ . On one hand, if $L_Z \leq \frac{1}{2} \frac{\lambda}{K}$ , then we have the (deterministic) sandwich relations + +$$ +0 \preceq W \preceq \frac {1}{2} \lambda I, \quad \text {a n d} \quad 0 \preceq \mathbb {E} W \preceq \frac {1}{2} \lambda I +$$ + +so that the bound (67) holds deterministically. On the other hand, if $L_Z \geq \frac{1}{2} \frac{\lambda}{K}$ , then the claim follows by choosing $\lambda \geq 2L_Z \frac{\log(\frac{2d}{\delta})}{\log(\frac{36}{35})}$ . + +In order to prove the bound (68), we make use of the following matrix Chernoff inequality: + +Lemma 13 (Matrix Chernoff). Consider the sum $Y = \sum_{k=1}^{K} X_k$ of a sequence $\{X_k\}_{k \geq 1}$ of independent, symmetric PSD matrices whose eigenvalues all lie in the interval $[0, L]$ , and suppose that $\mathbb{E}[Y] = I$ . Then we have + +$$ +(1 - \epsilon) I \preceq Y \preceq (1 + \epsilon) I \tag {69} +$$ + +with probability at least $1 - 2d\left(1 - \frac{\epsilon^2}{4}\right)^{\frac{1}{L}}$ for all $\epsilon \in (0,1)$ . + +This claim follows by applying Theorem 5.1.1 from Tropp (Tropp, 2015) twice, for the upper and lower tail respectively, combined with the inequalities + +$$ +\frac {e ^ {- \epsilon}}{(1 - \epsilon) ^ {1 - \epsilon}} \leq 1 - \frac {\epsilon^ {2}}{4}, \quad \text {a n d} \quad \frac {e ^ {\epsilon}}{(1 + \epsilon) ^ {1 + \epsilon}} \leq 1 - \frac {\epsilon^ {2}}{4}, \quad \text {v a l i d f o r a n y} \epsilon \in [ 0, 1), +$$ + +along with the fact that $a \leq b$ implies that $a^x \leq b^x$ for all strictly positive scalars $a, b, x$ . + +Using Lemma 13, we can now prove the bound (68). We define "regularized" versions of $Z_{k}$ and $W$ via $X_{k}^{\prime}\stackrel {def}{=}Z_{k} + \frac{\lambda}{K} I$ and $Y^{\prime}\stackrel {def}{=}\sum_{k = 1}^{K}X_{k}^{\prime}$ . By definition, we have + +$$ +Y ^ {\prime} = \sum_ {k = 1} ^ {K} \left(Z _ {k} + \frac {\lambda}{K} I\right) = W + \lambda I \quad \text {a n d} \quad \mathbb {E} Y ^ {\prime} = \mathbb {E} W + \lambda I. \tag {70} +$$ + +Thus, in order to prove the claim, it suffices to establish a high probability bound on the event + +$$ +\mathcal {E} \stackrel {\text {d e f}} {=} \left\{(1 - \epsilon) Y ^ {\prime} \preceq \mathbb {E} Y ^ {\prime} \preceq (1 + \epsilon) Y ^ {\prime} \right\}. \tag {71} +$$ + +Since $\lambda_{\min}(\mathbb{E}Y') \geq \lambda$ , the matrix $\mathbb{E}Y'$ is strictly positive definite, and the matrix $(\mathbb{E}Y')^{-\frac{1}{2}}$ exists. We use it to define the new matrices + +$$ +X _ {k} \stackrel {\text {d e f}} {=} \left(\mathbb {E} Y ^ {\prime}\right) ^ {- \frac {1}{2}} X _ {k} ^ {\prime} \left(\mathbb {E} Y ^ {\prime}\right) ^ {- \frac {1}{2}}, \quad \text {a n d} \tag {72} +$$ + +$$ +Y \stackrel {d e f} {=} \sum_ {k = 1} ^ {K} X _ {k} = (\mathbb {E} Y ^ {\prime}) ^ {- \frac {1}{2}} \left(\sum_ {k = 1} ^ {K} X _ {k} ^ {\prime}\right) (\mathbb {E} Y ^ {\prime}) ^ {- \frac {1}{2}} = (\mathbb {E} Y ^ {\prime}) ^ {- \frac {1}{2}} (Y ^ {\prime}) (\mathbb {E} Y ^ {\prime}) ^ {- \frac {1}{2}}. +$$ + +Note that we have $\mathbb{E}[Y] = I$ by construction, so that the matrix Chernoff bound (69) can be applied. We observe that + +$$ +\lambda_ {\max} (X _ {k}) = \| X _ {k} \| _ {2} \leq \| (\mathbb {E} Y ^ {\prime}) ^ {- \frac {1}{2}} X _ {k} ^ {\prime} (\mathbb {E} Y ^ {\prime}) ^ {- \frac {1}{2}} \| _ {2} \leq \| (\mathbb {E} Y ^ {\prime}) ^ {- \frac {1}{2}} \| _ {2} \| X _ {k} ^ {\prime} \| _ {2} \| (\mathbb {E} Y ^ {\prime}) ^ {- \frac {1}{2}} \| _ {2} \leq \frac {1}{\lambda} \left(L _ {Z} + \frac {\lambda}{K}\right) \overset {d e f} {=} L. +$$ + +Applying the bound (69) yields + +$$ +(1 - \epsilon) I \preceq Y \preceq (1 + \epsilon) I. +$$ + +with the stated probability. Finally, we can pre- and post-multiply by $(\mathbb{E}Y^{\prime})^{\frac{1}{2}}$ and then use Eq. (72) so as to obtain + +$$ +(1 - \epsilon) \mathbb {E} Y ^ {\prime} \preceq (\mathbb {E} Y ^ {\prime}) ^ {\frac {1}{2}} Y (\mathbb {E} Y ^ {\prime}) ^ {\frac {1}{2}} = Y ^ {\prime} \preceq (1 + \epsilon) \mathbb {E} Y ^ {\prime}. +$$ + +Recalling the definition (70) of $Y'$ , we see that this sandwich is equivalent to the stated claim (67). + +# D.5. Concentration of Log Determinants + +In this section, we prove the following claim: + +Lemma 14 (Concentration of Log Determinants). Let $\{x_i\}$ be i.i.d. vector random variables from some distribution such that $\| x_{i}\|_{2}\leq 1$ . If $\lambda \gtrsim \log (\frac{dn}{\delta})\geq 1$ and $G_{1}\succeq \lambda I$ then with probability at least $1 - \delta$ jointly for all $n = 1,2,\ldots$ it holds that + +$$ +\frac {1}{4} \log \frac {\det (G _ {1} + n \mathbb {E} x x ^ {\top})}{\det G _ {1}} - (8 \sqrt {2} + 4) \log \frac {8 n ^ {2}}{\delta} \leq \log \frac {\det \left(G _ {1} + \sum_ {i = 1} ^ {n} x _ {i} x _ {i} ^ {\top}\right)}{\det G _ {1}} \leq 8 \log \frac {\det (G _ {1} + n \mathbb {E} x x ^ {\top})}{\det G _ {1}} + 8 \log \frac {8 n ^ {2}}{\delta}. +$$ + +Let us now prove it. Let $G_{i} = G_{1} + \sum_{j=1}^{i-1} x_{j} x_{j}^{\top}$ . Using Lemma 11 in (Abbasi-Yadkori et al., 2011) we can write + +$$ +\frac {1}{2} \sum_ {i = 1} ^ {n} \| x _ {i} \| _ {G _ {i} ^ {- 1}} ^ {2} \leq \log \frac {\det \left(G _ {0} + \sum_ {i = 1} ^ {n} x _ {i} x _ {i} ^ {\top}\right)}{\det G _ {0}} \leq \sum_ {i = 1} ^ {n} \| x _ {i} \| _ {G _ {i} ^ {- 1}} ^ {2}. +$$ + +Thus, we will now focus on bounding the sums of the quadratic functions. Proposition 1 together with a double union bound over $n$ ensures that if $\lambda \gtrsim \log \left(\frac{dn}{\delta}\right)$ then for all $n$ with probability at least $1 - \delta /2$ , we have + +$$ +\begin{array}{l} \sum_ {i = 1} ^ {n} \left\| x _ {i} \right\| _ {G _ {i} ^ {- 1}} ^ {2} = \sum_ {i = 1} ^ {n} x _ {i} G _ {i} ^ {- 1} x _ {i} \leq 2 x _ {i} \left(G _ {1} + \mathbb {E} \sum_ {j = 1} ^ {i - 1} x _ {j} x _ {j} ^ {\top}\right) ^ {- 1} x _ {i} \\ = 2 x _ {i} \Big (\underbrace {G _ {1} + (i - 1) \mathbb {E} x x ^ {\top}} _ {= \mathbb {E} G _ {i}} \Big) ^ {- 1} x _ {i} = 2 \| x _ {i} \| _ {(\mathbb {E} G _ {i}) ^ {- 1}} ^ {2}. \\ \end{array} +$$ + +Similarly, under the same event specified by Proposition 1, we have + +$$ +\begin{array}{l} \sum_ {i = 1} ^ {n} \| x _ {i} \| _ {G _ {i} ^ {- 1}} ^ {2} = \sum_ {i = 1} ^ {n} x _ {i} G _ {i} ^ {- 1} x _ {i} \geq \frac {1}{2} x _ {i} \left(G _ {1} + \mathbb {E} \sum_ {j = 1} ^ {i - 1} x _ {j} x _ {j} ^ {\top}\right) ^ {- 1} x _ {i} \\ = \frac {1}{2} x _ {i} \Big (\underbrace {G _ {1} + (i - 1) \mathbb {E} x x ^ {\top}} _ {= \mathbb {E} G _ {i}} \Big) ^ {- 1} x _ {i} = \frac {1}{2} \| x _ {i} \| _ {(\mathbb {E} G _ {i}) ^ {- 1}} ^ {2}. \\ \end{array} +$$ + +Now consider the random variable $X_{i} = \| x_{i}\|_{(\mathbb{E}G_{i})^{-1}}^{2} - \mathbb{E}\| x_{i}\|_{(\mathbb{E}G_{i})^{-1}}^{2}$ . Since $\mathbb{E}G_{i}\succeq I$ , we have + +$$ +\mathbb {E} X _ {i} ^ {2} \leq \mathbb {E} \| x _ {i} \| _ {(\mathbb {E} G _ {i}) ^ {- 1}} ^ {4} \leq \mathbb {E} \| x _ {i} \| _ {(\mathbb {E} G _ {i}) ^ {- 1}} ^ {2} \leq 1. +$$ + +Applying a Bernstein martingale inequality (cf. Theorem 1 from the paper (Beygelzimer et al., 2011)) and combining with the union bound yields + +$$ +\left| \sum_ {i = 1} ^ {n} X _ {i} \right| \leq 2 \sqrt {\left(\sum_ {i = 1} ^ {n} \mathbb {E} \| x _ {i} \| _ {(\mathbb {E} G _ {i}) ^ {- 1}} ^ {2}\right) \log (\frac {8 n ^ {2}}{\delta})} + 2 \log (\frac {8 n ^ {2}}{\delta}) +$$ + +with probability at least $1 - \delta /2$ + +It remains to bound the sum of the predictable expectations under square root. Coupling Lemma 11 (Information gain bounds) with Lemma 11 (Information gain bounds) under the conditions $\alpha = 1, L = 2 > e - 1$ we obtain + +$$ +\log \frac {\det \left(\mathbb {E} G _ {i} + \mathbb {E} x _ {i} x _ {i} ^ {\top}\right)}{\det \mathbb {E} G _ {i}} \leq \mathbb {E} \| x _ {i} \| _ {\left(\mathbb {E} G _ {i}\right) ^ {- 1}} ^ {2} \leq 2 \log \frac {\det \left(\mathbb {E} G _ {i} + \mathbb {E} x _ {i} x _ {i} ^ {\top}\right)}{\det \mathbb {E} G _ {i}}. \tag {73} +$$ + +Summing over $i\in [n]$ , recalling $\mathbb{E}G_{i + 1} = \mathbb{E}G_i + \mathbb{E}x_ix_i^\top$ and cancelling the terms in the telescoping sum gives + +$$ +\log \frac {\det \mathbb {E} G _ {n + 1}}{\det G _ {1}} \leq \sum_ {i = 1} ^ {n} \mathbb {E} \| x _ {i} \| _ {(\mathbb {E} G _ {i}) ^ {- 1}} ^ {2} \leq 2 \log \frac {\det \mathbb {E} G _ {n + 1}}{\det G _ {1}}. +$$ + +We are now ready to show the upper bound. Removing the absolute value, using Eq. (73) to bound the quadratic sum one obtains with probability $1 - \delta$ + +$$ +\begin{array}{l} \sum_ {i = 1} ^ {n} \| x _ {i} \| _ {G _ {i} ^ {- 1}} ^ {2} \leq 4 \log \frac {\det (\mathbb {E} G _ {n + 1})}{\det G _ {1}} + 4 \sqrt {2 \log \frac {\det (\mathbb {E} G _ {n + 1})}{\det G _ {1}} \log \frac {8 n ^ {2}}{\delta}} + 4 \log \frac {8 n ^ {2}}{\delta} \\ \leq 8 \log \frac {\det (\mathbb {E} G _ {n + 1})}{\det G _ {1}} + 8 \log \frac {8 n ^ {2}}{\delta}. \\ \end{array} +$$ + +The last inequality follows from completing the square and using Cauchy-Schwartz to simplify the statement. + +We show the lower bound on the similar fashion. By lifting the absolute value one obtains with probability at least $1 - \delta$ + +$$ +\begin{array}{l} \sum_ {i = 1} ^ {n} \| x _ {i} \| _ {G _ {i} ^ {- 1}} ^ {2} \geq \frac {1}{2} \log \frac {\det (\mathbb {E} G _ {n + 1})}{\det G _ {1}} - 4 \sqrt {2 \log \frac {\det (\mathbb {E} G _ {n + 1})}{\det G _ {1}} \log \frac {8 n ^ {2}}{\delta}} - 4 \log \frac {8 n ^ {2}}{\delta} \\ \geq \frac {1}{4} \log \frac {\det (\mathbb {E} G _ {n + 1})}{\det G _ {1}} - (8 \sqrt {2} + 4) \log \frac {8 n ^ {2}}{\delta}. \\ \end{array} +$$ + +# D.6. Constrained Loss Lemmas + +In this section, let $\mathbb{E}$ denote the expectation operator for a pair $(X,Y)\sim \mu$ , where $x\in \mathbb{R}^d$ and $y\in \mathbb{R}$ . Assume that the second moment matrix $\mathbb{E}[XX^\top]$ is strictly positive definite. Define the loss function $\mathcal{L}(\theta) = \mathbb{E}(\langle X,\theta \rangle -Y)^2$ , along with the unconstrained minimizer $\theta^{\star}\stackrel {def}{=}\arg \min_{\theta \in \mathbb{R}^d}\mathcal{L}(\theta)$ . Our first result gives an equivalent expression for the excess loss $\mathcal{L}(\theta) - \mathcal{L}(\theta^{\star})$ . + +Lemma 15 (Excess Loss). The excess loss can be written as + +$$ +\mathcal {L} (\theta) - \mathcal {L} \left(\theta^ {\star}\right) = \| \theta - \theta^ {\star} \| _ {\mathbb {E} [ X X ^ {\top} ]} ^ {2}. \tag {74} +$$ + +Proof. Since the loss is a strongly convex quadratic function, the minimizer must satisfy the zero-gradient condition + +$$ +0 = \frac {1}{2} \nabla_ {\theta} \mathcal {L} \left(\theta^ {\star}\right) = \mathbb {E} [ X (\langle X, \theta \rangle - Y) ] \big | _ {\theta = \theta^ {\star}} \Longrightarrow \mathbb {E} \left[ X X ^ {\top} \right] \theta^ {\star} = \mathbb {E} [ X Y ]. \tag {75} +$$ + +We now use this relation to establish the claim. We have + +$$ +\begin{array}{l} \mathcal {L} (\theta) - \mathcal {L} \left(\theta^ {\star}\right) = \mathbb {E} \left(\left\langle X, \theta \right\rangle - Y\right) ^ {2} - \mathbb {E} \left(\left\langle X, \theta^ {\star} \right\rangle - Y\right) ^ {2} \\ = \mathbb {E} \left[ \left(\left\langle X, \theta \right\rangle - Y\right) - \left(\left\langle X, \theta^ {\star} \right\rangle - Y\right) \right] \left[ \left(\left\langle X, \theta \right\rangle - Y\right) + \left(\left\langle X, \theta^ {\star} \right\rangle - Y\right) \right] \\ = \mathbb {E} \left[ (\theta - \theta^ {\star}) ^ {\top} X \right] \left[ X ^ {\top} (\theta - \theta^ {\star}) - Y + 2 \langle X, \theta^ {\star} \rangle - Y \right] \\ = \left[ (\theta - \theta^ {\star}) ^ {\top} \left(\mathbb {E} X X ^ {\top}\right) (\theta - \theta^ {\star}) \right] + 2 \mathbb {E} \left[ (\theta - \theta^ {\star}) ^ {\top} \left(X X ^ {\top} \theta^ {\star} - X Y\right) \right] \\ = \| \theta - \theta^ {\star} \| _ {\mathbb {E} X X ^ {\top}} ^ {2} + 2 (\theta - \theta^ {\star}) ^ {\top} \underbrace {\left[ \mathbb {E} (X X ^ {\top}) \theta^ {\star} - \mathbb {E} [ X Y ] \right]} _ {= 0 \text {b y E q . (7 5)}}. \\ \end{array} +$$ + +Lemma 16 (Excess Risk with Regularization). For a fixed $\lambda >0$ , define + +$$ +\mathcal{L}(w) = \frac{1}{2}\mathbb{E}_{(X,Y)}\big(\big\langle X,w\big\rangle - Y\big)^{2},\quad and\quad w^{\star}\in \operatorname *{arg min}_{\| w\|_{2}\leq B}\mathcal{L}(w). +$$ + +Then for any scalar $M > 0$ , we have + +$$ +\left\| w - w ^ {\star} \right\| _ {(M \mathbb {E} _ {X} [ X X ^ {\top} ] + \lambda I)} ^ {2} \leq 2 M \left(\mathcal {L} (w) - \mathcal {L} \left(w ^ {\star}\right)\right) + \lambda \| w - w ^ {\star} \| _ {2} ^ {2}. \tag {76} +$$ + +Proof. We adopt the shorthand $\mathbb{E}$ for $\mathbb{E}_{(X,Y)}$ . We can write (two times) the excess risk as + +$$ +\begin{array}{l} 2 \left[ \mathcal {L} (w) - \mathcal {L} \left(w ^ {\star}\right) \right] = \mathbb {E} \left(\left\langle X, w \right\rangle - y\right) ^ {2} - \mathbb {E} \left(\left\langle X, w \right\rangle^ {\star} - y\right) ^ {2} \\ = \mathbb {E} \left[ \left(\langle X, w \rangle - y\right) - \left(\langle X, w \rangle^ {\star} - Y\right) \right] \left[ \langle X, w \rangle - Y + \langle X, w \rangle^ {\star} - Y \right] \\ = \mathbb {E} \left[ X ^ {\top} (w - w ^ {\star}) \right] \left[ \langle X, w \rangle - Y + \langle X, w \rangle^ {\star} - y \right] \\ = \mathbb {E} \left[ X ^ {\top} \left(w - w ^ {\star}\right) \right] \left[ X ^ {\top} \left(w - w ^ {\star}\right) + \left\langle X, w \right\rangle^ {\star} - y + \left\langle X, w ^ {\star} \right\rangle - Y \right] \\ = \left(w - w ^ {\star}\right) ^ {\top} \mathbb {E} \left(X X ^ {\top}\right) \left(w - w ^ {\star}\right) + 2 \mathbb {E} \left[ x ^ {\top} \left(w - w ^ {\star}\right) \right] \left[ \langle X, w ^ {\star} \rangle - Y \right]. \tag {77} \\ \end{array} +$$ + +The optimality condition for $w^{\star}$ reads + +$$ +\mathbb {E} \left[ \left(\left\langle X, w ^ {\star} \right\rangle - Y\right) X ^ {\top} \right] (w - w ^ {\star}) \geq 0 \quad \text {f o r a n y f e a s i b l e} w. +$$ + +Applying this inequality to equation (77) yields + +$$ +\begin{array}{l} 2 \left[ \mathcal {L} (w) - \mathcal {L} \left(w ^ {\star}\right) \right] \geq \left(w - w ^ {\star}\right) ^ {\top} \mathbb {E} \left(X X ^ {\top}\right) \left(w - w ^ {\star}\right) \\ = \left(w - w ^ {\star}\right) ^ {\top} \left[ \mathbb {E} X X ^ {\top} + \frac {\lambda}{M} I \right] \left(w - w ^ {\star}\right) - \frac {\lambda}{M} \| w - w ^ {\star} \| _ {2} ^ {2}, \\ \end{array} +$$ + +as claimed. + +![](images/d149dee5582d3c4db5d6f0d2bfb19579cb6c7ca3e5e1e1d15383b5ba579b6a27.jpg) \ No newline at end of file diff --git a/stabilizingqlearningwithlineararchitecturesforprovableefficientlearning/images.zip b/stabilizingqlearningwithlineararchitecturesforprovableefficientlearning/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..5cf94048ef7646d6dd20407288bf3f428f808c69 --- /dev/null +++ b/stabilizingqlearningwithlineararchitecturesforprovableefficientlearning/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:958dad72731bcb0f65f9cc516080b189ba920a67f9e1d434d14282e510b92b4e +size 1537046 diff --git a/stabilizingqlearningwithlineararchitecturesforprovableefficientlearning/layout.json b/stabilizingqlearningwithlineararchitecturesforprovableefficientlearning/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..4e24f6aa6f7bcc453732ea5ce274e68aa239ef2b --- /dev/null +++ b/stabilizingqlearningwithlineararchitecturesforprovableefficientlearning/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:462cfbfaf2fb821ad1a9976320d2918fc897871498ebcc378fde335c58425d0b +size 1678515 diff --git a/stableconformalpredictionsets/d8987cfa-d425-47d9-b9d2-4b2f0d31ff8b_content_list.json b/stableconformalpredictionsets/d8987cfa-d425-47d9-b9d2-4b2f0d31ff8b_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..f12f5dd4b1c79c4aa3b7a50ce2824d304749bb33 --- /dev/null +++ b/stableconformalpredictionsets/d8987cfa-d425-47d9-b9d2-4b2f0d31ff8b_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dca3865c6c3028862dac8f4914ec99a0870861e3b9dde7e34178f35f9e266ccd +size 120371 diff --git a/stableconformalpredictionsets/d8987cfa-d425-47d9-b9d2-4b2f0d31ff8b_model.json b/stableconformalpredictionsets/d8987cfa-d425-47d9-b9d2-4b2f0d31ff8b_model.json new file mode 100644 index 0000000000000000000000000000000000000000..9c1e8a28db6d848420a63fb6bd793d9ef248ae7a --- /dev/null +++ b/stableconformalpredictionsets/d8987cfa-d425-47d9-b9d2-4b2f0d31ff8b_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:50e4d74c9e8c5245cef111b119d2890831f7a569f267f239f19ac5b0f660fb69 +size 144251 diff --git a/stableconformalpredictionsets/d8987cfa-d425-47d9-b9d2-4b2f0d31ff8b_origin.pdf b/stableconformalpredictionsets/d8987cfa-d425-47d9-b9d2-4b2f0d31ff8b_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..177ec8b151b050bc6155ee09da981ff4594520f3 --- /dev/null +++ b/stableconformalpredictionsets/d8987cfa-d425-47d9-b9d2-4b2f0d31ff8b_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0b9d935ac41764b146d0a45ca21e7ea8bc713cf8dcc1469b9342b9146598db5a +size 936972 diff --git a/stableconformalpredictionsets/full.md b/stableconformalpredictionsets/full.md new file mode 100644 index 0000000000000000000000000000000000000000..8ae075eccc6a343164fcdf19b21fe5ca1120d639 --- /dev/null +++ b/stableconformalpredictionsets/full.md @@ -0,0 +1,723 @@ +# Eugene Ndiaye + +# Abstract + +When one observes a sequence of variables $(x_{1},y_{1}),\ldots ,(x_{n},y_{n})$ , Conformal Prediction (CP) is a methodology that allows to estimate a confidence set for $y_{n + 1}$ given $x_{n + 1}$ by merely assuming that the distribution of the data is exchangeable. CP sets have guaranteed coverage for any finite population size $n$ . While appealing, the computation of such a set turns out to be infeasible in general, e.g., when the unknown variable $y_{n + 1}$ is continuous. The bottleneck is that it is based on a procedure that readjusts a prediction model on data where we replace the unknown target by all its possible values in order to select the most probable one. This requires computing an infinite number of models, which often makes it intractable. In this paper, we combine CP techniques with classical algorithmic stability bounds to derive a prediction set computable with a single model fit. We demonstrate that our proposed confidence set does not lose any coverage guarantees while avoiding the need for data splitting as currently done in the literature. We provide some numerical experiments to illustrate the tightness of our estimation when the sample size is sufficiently large, on both synthetic and real datasets. + +# 1. Introduction + +Modern machine learning algorithms can predict the label of an object based on its observed characteristics with impressive accuracy. They are often trained on historical datasets sampled from the same distribution and it is important to quantify the uncertainty of their predictions. Conformal prediction is a versatile and simple method introduced in (Vovk et al., 2005; Shafer & Vovk, 2008) that provides a finite sample and distribution free $100(1 - \alpha)\%$ confidence region on the predicted object based on past observations. The + +$^{1}$ H. Milton Stewart School of Industrial and Systems Engineering, Georgia Institute of Technology, Atlanta, GA, USA. Correspondence to: Eugene Ndiaye . + +Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s). + +main idea can be subsumed as a hypothesis testing between + +$$ +H _ {0}: y _ {n + 1} = z \qquad \text {a n d} \qquad H _ {1}: y _ {n + 1} \neq z , +$$ + +where $z$ is any replacement candidate for the unknown response $y_{n + 1}$ . The conformal prediction set will consist of the collection of candidates whose tests are not rejected. The construction of a $p$ -value function is simple. We start by fitting a model with training set $\{(x_1,y_1),\ldots ,(x_n,y_n),(x_{n + 1},z)\}$ and sort the prediction scores/errors for each instance in ascending order. A candidate $z$ will be considered as conformal or typical if the rank of its score is sufficiently small compared to the others. The key assumption is that the predictive model and the joint probability distribution of the sequence $\{(x_i,y_i)\}_{i = 1}^{n + 1}$ are invariant w.r.t. permutation of the data. As a consequence, the ranks of the scores are equally likely and thus follow a uniform distribution which allows to calibrate a threshold on the rank statistics leading to a valid confidence set. This method has a strong coverage guarantee without any further assumptions on the distribution and is valid for any finite sample size $n$ ; see more details in Section 2. + +Conformal prediction technique has been applied for designing uncertainty sets in active learning (Ho & Wechsler, 2008), anomaly detection (Laxhammar & Falkman, 2015; Bates et al., 2021), few shot learning (Fisch et al., 2021), time series (Chernozhukov et al., 2018; Xu & Xie, 2021; Chernozhukov et al., 2021), robust optimization (Johnstone & Cox, 2021) or to infer the performance guarantee for statistical learning algorithms (Holland, 2020; Cella & Ryan, 2020). Currently, we are seeing a growing interest in these approaches due to their flexibility and ease of deployment even for very complex problems where classical approaches offer limited performance (Efron, 2021). We refer to (Balasubramanian et al., 2014) for other AI applications. + +Despite its nice properties, the computation of conformal prediction sets requires fitting a model on a new augmented dataset where the unknown quantity $y_{n + 1}$ is replaced by a set of candidates. In a regression setting where an object can take an uncountable possible value, the set of candidates is infinite. Therefore, computing the conformal prediction is infeasible without additional structural assumptions about the underlying model fit, and even so, the current computational costs remain very high. Hence the prevailing recommendation to use less efficient data splitting methods. + +Contribution. We leverage algorithmic stability to bound the variation of the predictive model w.r.t. to changes in the input data. This results in a circumvention of the computational bottleneck induced by the necessary readjustment of the model each time we want to assess the typicalness of a candidate replacement of the target variable. As such, we can provide a tight estimation of the confidence sets without loss in the coverage guarantee. Our method is computationally and statistically efficient since it requires only a single model fit and does not involve any data splitting. + +Notation. For a nonzero integer $n$ , we denote $[n]$ to be the set $\{1, \dots, n\}$ . The dataset of size $n$ is denoted $\mathcal{D}_n = (x_i, y_i)_{i \in [n]}$ , the row-wise input feature matrix $X = [x_1, \dots, x_n, x_{n+1}]^\top$ . Given a set $\{u_1, \dots, u_n\}$ , the rank of $u_j$ for $j \in [n]$ is defined as + +$$ +\operatorname {R a n k} (u _ {j}) = \sum_ {i = 1} ^ {n} \mathbb {1} _ {u _ {i} \leq u _ {j}}. +$$ + +We denote $u_{(i)}$ the $i$ -th order statistics. + +# 2. Conformal Prediction + +Conformal prediction (Vovk et al., 2005) is a framework for constructing online confidence sets, with the remarkable properties of being distribution free, having a finite sample coverage guarantee, and being able to be adapted to any estimator under mild assumptions. We recall the arguments in (Shafer & Vovk, 2008; Lei et al., 2018) to construct a conformity/typicalness function based on rank statistics that yields to distribution-free inference methods. The main tool is that the rank of one variable among an exchangeable and identically distributed sequence follows a (sub)-uniform distribution (Brocker & Kantz, 2011). + +Lemma 2.1. Let $U_{1},\ldots ,U_{n},U_{n + 1}$ be an exchangeable and identically distributed sequence of random variables. Then for any $\alpha \in (0,1)$ , we have + +$$ +\mathbb {P} ^ {n + 1} (\mathrm {R a n k} (U _ {n + 1}) \leq (n + 1) (1 - \alpha)) \geq 1 - \alpha . +$$ + +We remind that $y_{n + 1}$ is the unknown target variable. We introduce a learning problem with the augmented training data $\mathcal{D}_{n + 1}(z)\coloneqq \mathcal{D}_n\cup \{(x_{n + 1},z)\}$ for $z\in \mathbb{R}$ and with the augmented vector of labels $y(z) = (y_{1},\dots ,y_{n},z)$ : + +$$ +\beta (z) \in \underset {\beta \in \mathbb {R} ^ {p}} {\arg \min } \mathcal {L} (y (z), \Phi (X, \beta)) + \Omega (\beta) , \tag {1} +$$ + +where $\Phi$ is a feature map and for any parameter $\beta \in \mathbb{R}^p$ + +$$ +\Phi (X, \beta) = [ \Phi (x _ {1}, \beta), \dots , \Phi (x _ {n + 1}, \beta) ] \in \mathbb {R} ^ {n + 1}. +$$ + +Given an input feature vector $x$ , the prediction of its output/label adjusted on the augmented data, can be defined as + +$$ +\mu_ {z} (x) := \Phi (x, \beta (z)) . +$$ + +For example in case of empirical risk minimization, we have + +$$ +\mathcal {L} (y (z), \Phi (X, \beta)) = \sum_ {i = 1} ^ {n} \ell \left(y _ {i}, \Phi \left(x _ {i}, \beta\right)\right) + \ell \left(z, \Phi \left(x _ {n + 1}, \beta\right)\right). +$$ + +There are many examples of cost functions in the literature. A popular example is the power norm regression, where $\ell(a, b) = |a - b|^q$ . When $q = 2$ , this corresponds to the classical linear regression. The cases where $q = (1, 2)$ are frequent in robust statistics where the case $q = 1$ is known as the least absolute deviation. The loss $\log \cosh \ell(a, b) = \gamma \log (\cosh (a - b) / \gamma)$ is a differentiable alternative to the $\ell_{\infty}$ norm (Chebychev approximation). One can also have the loss function Linex (Gruber, 2010; Chang & Hung, 2007) which provides an asymmetric loss function $\ell(a, b) = \exp(\gamma (a - b)) - \gamma (a - b) - 1$ , for $\gamma \neq 0$ . Any convex regularization function $\Omega$ e.g., Ridge (Hoerl & Kennard, 1970) or norm inducing sparsity (Bach et al., 2012) can be considered. Also the feature map $\Phi$ can be parameterized and learned à la neural network. Equation (1) includes many modern formulations of statistical learning estimators. The only requirement on these is to be invariant with respect to the data permutation; this leaves a very large degree of freedom on their choice. For example, $\beta(z)$ can be the output of an iterative model $e.g.$ , proximal gradient descent, with early stopping. + +Let us define the conformity measure for $\mathcal{D}_{n + 1}(z)$ as + +$$ +\forall i \in [ n ], E _ {i} (z) = S \left(y _ {i}, \mu_ {z} \left(x _ {i}\right)\right), \tag {2} +$$ + +$$ +E _ {n + 1} (z) = S \left(z, \mu_ {z} \left(x _ {n + 1}\right)\right), \tag {3} +$$ + +where $S$ is a real-valued function e.g., in a linear regression problem, one can take $s(a,b) = |a - b|$ . The main idea for constructing a conformal confidence set is to consider the typicalness/conformity of a candidate point $z$ measured as + +$$ +\pi (z) := 1 - \frac {1}{n + 1} \operatorname {R a n k} \left(E _ {n + 1} (z)\right). \tag {4} +$$ + +The conformal set gathers all the real values $z$ such that $\pi (z)\geq \alpha$ , if and only if, the score $E_{n + 1}(z)$ is ranked no higher than $\lceil (n + 1)(1 - \alpha)\rceil$ , among $\{E_i(z)\}_{i\in [n + 1]}$ i.e., + +$$ +\Gamma^ {(\alpha)} \left(x _ {n + 1}\right) := \left\{z \in \mathbb {R}: \pi (z) \geq \alpha \right\}. \tag {5} +$$ + +A direct application of Lemma 2.1 to $U_{i} = E_{i}(y_{n + 1})$ reads $\mathbb{P}(\pi (y_{n + 1})\leq \alpha)\leq \alpha$ i.e., the random variable $\pi (y_{n + 1})$ takes small values with small probability and it reads the coverage guarantee + +$$ +\mathbb {P} \left(y _ {n + 1} \in \Gamma^ {(\alpha)} \left(x _ {n + 1}\right)\right) \geq 1 - \alpha . +$$ + +Figure 1 illustrates the candidates selected for inclusion in the confidence set as the most likely variables. + +![](images/765c1097e785f31eb9f04c17209b954f7130c3caa6c551e868f62546623cb735.jpg) +Figure 1. Illustration of a conformal prediction set with a confidence level level 0.9 i.e., $\alpha = 0.1$ . The ends of the CP set are indicated by the red cross. + +# 2.1. Computational Limitations and Previous Works + +For regression problems where $y_{n + 1}$ lies in a subset of $\mathbb{R}$ , obtaining the conformal set $\Gamma^{(\alpha)}(x_{n + 1})$ in Equation (5) is computationally challenging. It requires re-fitting the prediction model $\beta(z)$ for infinitely many candidates $z$ in order to compute the map of conformity measure such as $z \mapsto E_i(z) = |y_i - x_i^\top \beta(z)|$ . Except for a few examples, the computation of a conformal prediction set is infeasible in general. We describe below some successful computational strategies while pointing out their potential shortcomings. + +In Ridge regression, for any $x$ in $\mathbb{R}^p$ , $z \mapsto x^\top \beta(z)$ is a linear function of $z$ , implying that $E_i(z)$ is piecewise linear. Exploiting this fact, an exact conformal set $\Gamma^{(\alpha)}(x_{n+1})$ for Ridge regression was efficiently constructed in (Nouretdinov et al., 2001). Similarly, using the piecewise linearity w.r.t. sparsity level of the Lasso path provided by the Lars algorithm (Efron et al., 2004), (Hebiri, 2010) builds a sequence of conformal sets for the Lasso associated to the transition points of the Lars with the observed data $\mathcal{D}_n$ . Nevertheless, such procedure breaks the proof technique for the coverage guarantee as the exchangeability of the sequence $(E_i(y_{n+1}))_{i \in [n+1]}$ is not necessarily maintained. However, a slight adaptation can fix the previous problem. Indeed using the piecewise linearity in $z$ of the Lasso solution, (Lei, 2019) proposed a piecewise linear homotopy under mild assumptions, when a single input sample point is perturbed. This finally allows to compute the whole solution path $z \mapsto \beta(z)$ and successfully provides a conformal set for the Lasso and Elastic Net. These processes are however limited to quadratic loss function. Later, (Ndiaye & Takeuchi, 2019) proposed an adaptation using approximate solution path (Ndiaye et al., 2019) instead of exact solution. This results + +in a careful discretization of the set of candidates restricted into a preselected compact $[z_{\min}, z_{\max}]$ . Assuming that the optimization problem in Equation (1) is convex and that the loss function is smooth, this leads to a computational complexity of $O(1 / \sqrt{\epsilon})$ where $\epsilon > 0$ is a prescribed optimization error. All these previous methods are at best restricted to convex optimization formulations. A different road consists in merely assuming that the conformal set $\Gamma^{(\alpha)}(x_{n+1})$ in Equation (5) itself is a bounded interval. As such, its endpoints can be estimated by approximating the roots of the function $z \mapsto \pi(z) - \alpha$ . Under slight additional assumptions, a direct bisection search can then compute a conformal set with a complexity of $O(\log_2(1 / \epsilon_r))$ (Ndiaye & Takeuchi, 2021) where $\epsilon_r > 0$ is the tolerance error w.r.t. to exact root. + +Cross-conformal Predictors was initially introduced in its one split version in (Papadopoulos et al., 2002). The idea is to separate the data into two independent parts, fit the model on one part and rank the scores on the other part where Lemma 2.1 remains applicable and thus preserves the coverage guarantee. Although this approach avoids the computational bottleneck by requiring only one data adjustment, the statistical efficiency of the model may be reduced due to a much smaller sample size available during the training and calibration phases. In general, the proportion of the training set to the calibration set is a hyperparameter that requires appropriate tuning: a small calibration set leads to highly variable conformational scores and a small training set leads to poor model fit. Such trade-off is very recurrent in machine learning and often appears in the debate between bias reduction and variance reduction. It is often decided by the cross-validation method with several folds (Arlot & Celisse, 2010). Cross-conformal predictors (Vovk, 2015) follow the same ideas and exploit the full dataset for calibration and significant proportions for training the model. The dataset is partitioned into $K$ folds and one performs a split conformal set by sequentially defining the $k$ th fold as calibration set and the remaining as training set for $k \in \{1, \dots, K\}$ . The leave-one-out aka Jackknife CP set, requires $K = n$ model fit which is prohibitive even when $n$ is moderately large. On the other hand, the $K$ -fold version will require $K$ model fit but will come at the cost of fitting on a lower sample size and will leads to an additional excess coverage of $O(\sqrt{2 / n})$ and requires a subtle aggregation of the different pi-values obtained; see (Carlsson et al., 2014; Linusson et al., 2017). (Barber et al., 2021) shown that the confidence level attained is $1 - 2\alpha$ instead of $1 - \alpha$ and can only approximately reach the target coverage $1 - \alpha$ under additional stability assumption. + +Although these recent advances have drastically improved the tractability of the calculations, in practice multiple re-adjustments of the data are required. This remains very expensive especially for complex models. Imagine having to re-train a neural network from scratch ten or twenty times + +to get a reasonable estimate. In this paper, we actually show that a single model fit is enough to tightly approximate the conformal set when the underlying model fitting is stable. + +# 3. Approximation via Algorithmic Stability + +The Section 2 guarantees that $\pi(y_{n+1}) \geq \alpha$ with high probability. Therefore, since $y_{n+1}$ is unknown, the conformal set just selects all $z$ that satisfies the same inequality i.e., $\Gamma^{(\alpha)}(x_{n+1}) = \{z : \pi(z) \geq \alpha\}$ . This leads to fitting a new model for any $z$ . Here, we take a different strategy. The main remark is that only one element of the dataset changes at a time, then with mild stability assumptions, one can expect that the model prediction will not change drastically. Instead of inverting $\pi(\cdot)$ , we will bound it with quantities independent of the model fit $\mu_z$ for any $z$ . + +Definition 3.1 (Algorithmic Stability). A prediction function $\mu$ , is stable if for any observed features $x_{i}$ , $i \in [n + 1]$ , we have + +$$ +\left| S \left(q, \mu_ {z} \left(x _ {i}\right)\right) - S \left(q, \mu_ {z _ {0}} \left(x _ {i}\right)\right) \right| \leq \tau_ {i} \quad \forall z, z _ {0}, q \in \mathbb {R}. \tag {6} +$$ + +In the literature, it is common to make assumptions about the stability of a predictive model to obtain upper bounds on its generalization error and thus ensure that it does not overfit the training data e.g., (O. Bousquet & Elisseeff, 2002). Although the conformal prediction framework applies even when the underlying model is not stable, we show that this additional assumption allows for efficient evaluation of confidence sets. We also add that in cases where the generalization capabilities of the model are poor, the size of the confidence intervals can become very large; even unbounded, and not at all informative. + +Proposition 3.2. Assume that the model fit $\mu$ . is stable as in Definition 3.1. Then, we have: + +$$ +\forall z, \hat {z}, \quad \pi_ {\mathrm {l o}} (z, \hat {z}) \leq \pi (z) \leq \pi_ {\mathrm {u p}} (z, \hat {z}), +$$ + +with + +$$ +\pi_ {\mathrm {l o}} (z, \hat {z}) := 1 - \frac {1}{n + 1} \sum_ {i = 1} ^ {n + 1} \mathbb {1} _ {L _ {i} (z, \hat {z}) \leq U _ {n + 1} (z, \hat {z})}, +$$ + +$$ +\pi_ {\mathrm {u p}} (z, \hat {z}) := 1 - \frac {1}{n + 1} \sum_ {i = 1} ^ {n + 1} \mathbb {1} _ {U _ {i} (z, \hat {z}) \leq L _ {n + 1} (z, \hat {z})}, +$$ + +where, we define, for any index $i$ in $[n]$ + +$$ +L _ {i} (z, \hat {z}) = E _ {i} (\hat {z}) - \tau_ {i}, +$$ + +$$ +U _ {i} (z, \hat {z}) = E _ {i} (\hat {z}) + \tau_ {i}, +$$ + +$$ +L _ {n + 1} (z, \hat {z}) = S (z, \mu_ {\hat {z}} (x _ {n + 1})) - \tau_ {n + 1}, +$$ + +$$ +U _ {n + 1} (z, \hat {z}) = S (z, \mu_ {\hat {z}} (x _ {n + 1})) + \tau_ {n + 1}. +$$ + +Proof. By stability, for any $q$ , we have: + +$$ +\left| S \left(q, \mu_ {z} \left(x _ {i}\right)\right) - S \left(q, \mu_ {\hat {z}} \left(x _ {i}\right)\right) \right| \leq \tau_ {i}. +$$ + +Applying the previous inequality to $q = y_{i}$ for any index $i$ in $[n + 1]$ , we have $L_{i}(z,\hat{z})\leq E_{i}(z)\leq U_{i}(z,\hat{z})$ and it holds: + +$$ +\begin{array}{l} U _ {i} (z, \hat {z}) \leq L _ {n + 1} (z, \hat {z}) \Longrightarrow E _ {i} (z) \leq E _ {n + 1} (z) \\ \Longrightarrow L _ {i} (z, \hat {z}) \leq U _ {n + 1} (z, \hat {z}). \\ \end{array} +$$ + +Taking the indicator of the corresponding sets, we obtain the result. + +A direct consequence of Proposition 3.2 is that the exact conformal set can be wrapped as follows. + +Corollary 3.3 (Stable Conformal Sets). Under the assumption of Proposition 3.2, the conformal prediction set is lower and upper approximated as + +$$ +\Gamma_ {\mathrm {l o}} ^ {(\alpha)} (x _ {n + 1}) \subset \Gamma^ {(\alpha)} (x _ {n + 1}) \subset \Gamma_ {\mathrm {u p}} ^ {(\alpha)} (x _ {n + 1}), +$$ + +where + +$$ +\Gamma_ {\mathrm {l o}} ^ {(\alpha)} (x _ {n + 1}) = \left\{z: \pi_ {\mathrm {l o}} (z, \hat {z}) \geq \alpha \right\}, +$$ + +$$ +\Gamma_ {\mathrm {u p}} ^ {(\alpha)} \left(x _ {n + 1}\right) = \left\{z: \pi_ {\mathrm {u p}} (z, \hat {z}) \geq \alpha \right\}. +$$ + +Since our proposal arises from a combination of the conformal prediction sets with a correction from the stability bounds, we call the resulting (upper) confidence set $\Gamma_{\mathrm{up}}^{(\alpha)}(x_{n + 1})$ stabCP for stable conformal set. By construction, it contains the exact confidence set $\Gamma^{(\alpha)}(x_{n + 1})$ and therefore enjoys at least the same statistical benefits displayed in the following result. + +Proposition 3.4 (Coverage guarantee). Assume that the model fit $\mu$ . is stable as in Definition 3.1. Then the stabCP set is an upper envelope of the exact conformal prediction set in Equation (5) and is thus valid i.e., + +$$ +\mathbb {P} \left(y _ {n + 1} \in \Gamma_ {\mathrm {u p}} ^ {(\alpha)} \left(x _ {n + 1}\right)\right) \geq 1 - \alpha . +$$ + +As promised in the abstract, our proposed method suffers no loss of statistical coverage, requires only one model adjustment to the data at an arbitrary candidate point $\hat{z}$ , and fully uses all the data (no splitting). Thus we can benefit both from statistical efficiency with a smaller confidence interval as in the case of the exact calculation; but also we completely break the computational difficulty as in the case of splitting methods. To our knowledge, there is no equivalent method that can benefit from such a double performance. + +# 3.1. Practical Computation of stabCP sets + +By construction, the computation of stable conformal sets is equivalent to collecting all $z$ such that $\pi_{\mathrm{up}}(z,\hat{z})\geq \alpha$ . Let's begin by noting that $U_{n + 1}(z,\hat{z}) > L_{n + 1}(z,\hat{z})$ when $\tau_{n + 1} > 0$ which we will assume for simplicity. We have + +$$ +\pi_ {\mathrm {u p}} (z, \hat {z}) \geq \alpha \Leftrightarrow \sum_ {i = 1} ^ {n} \mathbb {1} _ {U _ {i} (z, \hat {z}) \leq L _ {n + 1} (z, \hat {z})} \leq (1 - \alpha) (n + 1). +$$ + +![](images/543ce9839f39eaf16d25b0892a726c5bcdbb59077e44f33c4b00e030c523fc1b.jpg) +(a) $n = 30$ + +![](images/6c9853fb89a0ab1629f4a217762bffb26d30e14d89b3732273ce717a7250f79f.jpg) +(b) $n = 90$ + +![](images/9a27bedf906464d2546510cf42d334ded514dc6ee2e4fcac9d70ce178fe535b5.jpg) +(c) $n = 300$ + +![](images/007f0340cd5b3c23b15bac9e591e2777164e22d366c67ccd557b061291b0d5bc.jpg) +(d) Convergence of the approximation gap $\operatorname{Gap}(\mathbf{z},\hat{\mathbf{z}})$ + +![](images/980e211d1b2fe1a52a18089b52618e6560b30cf207755a2a241ff50df50b2abc.jpg) +(e) Diabetes (442, 10) + +![](images/228e026deeff95b750938405443ef504d2ab09187f0e51c4ebdce431563bb70e.jpg) +(f) Synthetic (30,100) +Figure 2. Illustration of the evolution of the conformity function as a function of sample size. The underlying model fit is $\beta (z)\in \arg \min_{\beta \in \mathbb{R}^p}\| y(z) - X\beta \| _1 / (n + 1) + \lambda \| \beta \| ^2$ where $y(z) = (y_{1},\dots ,y_{n},z)$ and we use sklearn synthetic dataset make_regression(n, p = 100, noise = 1). We fixed $\hat{z} = 0$ and $\lambda = 0.5$ . The set $Z$ is a linear grid in the interval $[y_{(1)},y_{(n)}]$ . We also illustrate the batch approximation for different values of $\hat{z}$ . + +This means that a candidate $z$ is selected, if at most $(1 - \alpha)(n + 1)$ elements of $\{U_i(z,\hat{z})\}_{i\in [n]}$ are smaller than $L_{n + 1}(z,\hat{z})$ . Which is equivalent to + +$$ +L _ {n + 1} (z, \hat {z}) \leq U _ {(\lceil (1 - \alpha) (n + 1) \rceil)} (z, \hat {z}) =: Q _ {1 - \alpha} (\hat {z}). +$$ + +Hence, we can conclude that + +$$ +\Gamma_ {\mathrm {u p}} ^ {(\alpha)} (x _ {n + 1}) = \{z: S (z, \mu_ {\hat {z}} (x _ {n + 1})) \leq Q _ {1 - \alpha} (\hat {z}) + \tau_ {n + 1} \}. +$$ + +For the absolute value score, it reduces to the interval + +$$ +\Gamma_ {\mathrm {u p}} ^ {(\alpha)} (x _ {n + 1}) = \left[ \mu_ {\hat {z}} (x _ {n + 1}) \pm \left(Q _ {1 - \alpha} (\hat {z}) + \tau_ {n + 1}\right) \right]. +$$ + +For the sake of clarity, we summarize the computations for this simplest case in Algorithm 1 and discuss the generalization in the appendix. In general terms, $\mathsf{stabCP}$ sets are convex sets when the score function $z\mapsto S(z,\mu_{\hat{z}}(x_{n + 1}))$ has convex level sets. This presumes that our strategy will also facilitate the calculations in cases where the target $y_{n + 1}$ is multi-dimensional. + +# Algorithm 1 Stable Conformal Prediction Set + +Input: data $\{(x_1,y_1),\ldots ,(x_n,y_n)\}$ and $x_{n + 1}$ + +Coverage level $\alpha \in (0,1)$ , any estimate $\hat{z} \in \mathbb{R}$ + +Stability bounds $\tau_{1},\ldots ,\tau_{n + 1}$ of the learning algorithm + +Output: prediction interval at $x_{n+1}$ + +Fit a model $\mu_{\hat{z}}$ on the training data $\mathcal{D}_{n + 1}(\hat{z})$ + +Compute the quantile $Q_{1 - \alpha}(\hat{z}) = U_{([\hat{1} (1 - \alpha)(n + 1)]}(z,\hat{z})$ + +where the $U_{i}$ s are defined in Proposition 3.2 + +Return: $[\mu_{\hat{z}}(x_{n + 1})\pm (Q_{1 - \alpha}(\hat{z}) + \tau_{n + 1})]$ + +# 3.2. Batch Approximation + +The stable conformal sets require a single model fit $\mu_{\hat{z}}$ for an arbitrary candidate $\hat{z}$ . The approximation gaps are computable as + +$$ +\max \left\{\pi (z) - \pi_ {\mathrm {l o}} (z, \hat {z}), \pi_ {\mathrm {u p}} (z, \hat {z}) - \pi (z) \right\} \leq \operatorname {G a p} (\mathrm {z}, \hat {z}), +$$ + +where + +$$ +\operatorname {G a p} (\mathrm {z}, \hat {\mathrm {z}}) := \pi_ {\mathrm {u p}} (\mathrm {z}, \hat {\mathrm {z}}) - \pi_ {\mathrm {l o}} (\mathrm {z}, \hat {\mathrm {z}}). +$$ + +Since the above upper and lower bounds hold for any $\hat{z}$ , tighter approximations are obtained with a batch of candi + +dates $\mathcal{Z} = \hat{z}_1,\dots ,\hat{z}_d$ as + +$$ +\pi_ {\mathrm {u p}} (z, \mathcal {Z}) = \inf _ {\hat {z} \in \mathcal {Z}} \pi_ {\mathrm {u p}} (z, \hat {z}) \mathrm {a n d} \pi_ {\mathrm {l o}} (z, \mathcal {Z}) = \sup _ {\hat {z} \in \mathcal {Z}} \pi_ {\mathrm {l o}} (z, \hat {z}). +$$ + +Another possibility is to build an interpolation of $z \mapsto \mu_z(\cdot)$ based on query points $\hat{z}_1, \dots, \hat{z}_d \in (z_{\min}, z_{\max}) \subset \mathbb{R}$ . For example, one can consider as predictive model the following piecewise linear interpolation + +$$ +\tilde {\mu} _ {z} = \left\{ \begin{array}{l l} \frac {\hat {z} _ {1} - z}{\hat {z} _ {1} - z _ {\mathrm {m i n}}} \mu_ {z _ {\mathrm {m i n}}} + \frac {z _ {\mathrm {m i n}} - z}{\hat {z} _ {1} - z _ {\mathrm {m i n}}} \mu_ {\hat {z} _ {1}} & \mathrm {i f} z \leq z _ {\mathrm {m i n}}, \\ \frac {z - \hat {z} _ {t + 1}}{\hat {z} _ {t} - \hat {z} _ {t + 1}} \mu_ {\hat {z} _ {t}} + \frac {z - \hat {z} _ {t}}{\hat {z} _ {t + 1} - \hat {z} _ {t}} \mu_ {\hat {z} _ {t + 1}} & \mathrm {i f} z \in [ \hat {z} _ {t}, \hat {z} _ {t + 1} ], \\ \frac {z - \hat {z} _ {d}}{z _ {\mathrm {m a x}} - \hat {z} _ {d}} \mu_ {z _ {\mathrm {m a x}}} + \frac {z _ {\mathrm {m a x}} - z}{z _ {\mathrm {m a x}} - \hat {z} _ {d}} \mu_ {\hat {z} _ {d}} & \mathrm {i f} z \geq z _ {\mathrm {m a x}}, \end{array} \right. +$$ + +An important point is that, by using the stability bound, the coverage guarantee of the interpolated conformal set is preserved without the need of the expensive symmetrization proposed in (Ndiaye & Takeuchi, 2021). Such techniques are more relevant when the sample size is small or when precise estimates of the stability bounds are not available. The corresponding conformity function is defined in a similar way as the previous versions, where we simply plugin the interpolated model. We refer to the appendix for more details. Remark 3.5 (Categorical Variables). In this article, we have essentially limited ourselves to regression problems which, in general, pose intractable computational difficulties. However, the methods remain applicable for classification problems where the set of candidates can only take a finite number of values in $\mathcal{C} \coloneqq c_1, \ldots, c_m$ . In this case, an additional precaution of encoding the categories in real numbers is necessary. Considering the leave-one-out score function, our proposal is therefore an alternative to the approximations via influence function used in (Alaa & Schaar, 2020; Abad et al., 2022) when an exact computation (Cherubin et al., 2021) would be unusable or too costly. + +# 3.3. Stability Bounds + +In this section, we recall some stability bounds. The proof techniques rely on regularity assumptions on the function to be minimized and are relatively standard in optimization (Shalev-Shwartz & Ben-David, 2014, Chapter 13). Stability is a widely used assumption to provide generalization bounds for machine learning algorithms (O. Bousquet & Elisseeff, 2002; Hardt et al., 2016). We specify that here the notion of stability that we require is related to the variation of the score and not of the loss function in the optimization objective. However, the ideas for establishing the stability bounds are essentially the same and we recall the core strategies here for the sake of completeness. + +Let us start with the unregularized model where $\Omega = 0$ i.e., + +$$ +\beta (z) \in \underset {\beta \in \mathbb {R} ^ {p}} {\arg \min } \mathcal {L} (y (z), \Phi (X, \beta)) = F _ {z} (\Phi (X, \beta)). \tag {7} +$$ + +Definition 3.6. A function $f$ is $\lambda$ -strongly convex if for any $w_0, w$ and $\varsigma \in (0,1)$ + +$$ +\begin{array}{l} f (\varsigma w _ {0} + (1 - \varsigma) w) \leq \varsigma f (w _ {0}) + (1 - \varsigma) f (w) \\ - \frac {\lambda}{2} \varsigma (1 - \varsigma) \| w _ {0} - w \| ^ {2}. \\ \end{array} +$$ + +Proposition 3.7. Assume that for any $z$ , $F_{z}$ is $\lambda$ -strongly convex and $\rho$ -Lipschitz. It holds + +$$ +\left\| \mu_ {z} (X) - \mu_ {z _ {0}} (X) \right\| \leq \frac {2 \rho}{\lambda}. +$$ + +Proof. By optimality of $\beta (z)$ , we have + +$$ +F _ {z} (\Phi (X, \beta (z))) \leq F _ {z} (\Phi (X, \beta)) \quad \forall \beta . \tag {8} +$$ + +We simply apply the optimality condition and strong convexity of the function $F_{z}$ to the vectors $w_{0} = \Phi(X, \beta(z_{0})) = \mu_{z_{0}}(X)$ and $w = \Phi(X, \beta(z)) = \mu_{z}(X)$ , it holds + +$$ +\begin{array}{l} 0 \leq \frac {F _ {z} (\varsigma w _ {0} + (1 - \varsigma) w) - F _ {z} (w)}{\varsigma} \\ \stackrel {(3. 6)} {\leq} F _ {z} \left(w _ {0}\right) - F _ {z} (w) - \frac {\lambda}{2} (1 - \varsigma) \| w _ {0} - w \| ^ {2}. \\ \end{array} +$$ + +Since $F_{z}$ is $\rho$ -Lipschitz, we have + +$$ +\frac {\lambda}{2} \left\| w _ {0} - w \right\| ^ {2} \leq F _ {z} \left(w _ {0}\right) - F _ {z} (w) \leq \rho \left\| w - w _ {0} \right\|. +$$ + +Therefore, $\frac{\lambda}{2}\| w_0 - w\| \leq \rho$ , hence the result. + +![](images/eb4ba65637c31150a19713de532dfe1c9d2323283e1a80e0b46c4f3773fb5c0e.jpg) + +The Proposition 3.7 does not assume that the optimization problem in Equation (7) is convex in the model parameter $\beta$ . We can now easily deduce a stability bound according to the Definition 3.1. + +Corollary 3.8. If the score function $S(q, \cdot)$ is $\gamma$ -Lipschitz for any $q$ , then + +$$ +\tau_ {i} = \frac {2 \gamma \rho}{\lambda}, \quad \forall i \in [ n + 1 ] . +$$ + +When the loss function is not strongly convex, it is known that adding a strongly convex regularization can stabilize the algorithm (Shalev-Shwartz & Ben-David, 2014, Chapter 13). The proof technique is similar to the previous one with the difference that now the bound is on the arg min of the optimization problem and not the predictions of the model. This requires stronger assumptions. + +Proposition 3.9. Assume the optimization problem Equation (1) is convex, $\Omega$ is $\lambda$ -strongly convex. If the loss $\mathcal{L}$ is convex- $\rho$ -Lipschitz, then + +$$ +\left\| \beta (z) - \beta \left(z _ {0}\right) \right\| \leq \frac {2 \rho}{\lambda}. +$$ + +When the loss function $\mathcal{L}$ is convex- $\nu$ -smooth with $\nu < \lambda$ and $\mathcal{L}(y(z),\mu_z(X))\leq C$ for any $z$ ,then + +$$ +\left\| \beta (z) - \beta \left(z _ {0}\right) \right\| \leq \frac {2 \sqrt {2 \nu C}}{\lambda - \nu}. +$$ + +These optimization error bounds also imply the following stability bounds. + +Corollary 3.10. Assume that the score function $S(q, \cdot)$ is $\gamma$ -Lipschitz for any $q$ , and that the prediction model $\mu(x) \coloneqq \Phi(x, \beta(\cdot))$ satisfies for any $x \in \mathbb{R}^p$ , $z, z_0 \in \mathbb{R}$ , + +$$ +\left| \mu_ {z} (x) - \mu_ {z _ {0}} (x) \right| \leq L _ {\Phi} \left| x ^ {\top} \beta (z) - x ^ {\top} \beta \left(z _ {0}\right) \right|. +$$ + +If the loss is $\rho$ -Lipschitz, then + +$$ +\tau_ {i} = \frac {2 \gamma \rho L _ {\Phi} \| x _ {i} \|}{\lambda}, \quad \forall i \in [ n + 1 ] . +$$ + +If the loss is $\nu$ -smooth with $\nu < \lambda$ and bounded by $C$ , then + +$$ +\tau_ {i} = \frac {2 \gamma L _ {\Phi} \| x _ {i} \| \sqrt {2 \nu C}}{\lambda - \nu}, \quad \forall i \in [ n + 1 ] . +$$ + +Another way to understand such regularized bounds, is to leverage duality. A smoothness assumption in the primal space will translate into a strongly concave assumption in the dual space (Hiriart-Urruty & Lemaréchal, 1993, Theorem 4.2.2, p. 83). The dual formulation (Rockafellar, 1997, Chapter 31) of Equation (1) reads: + +$$ +\theta (z) \in \underset {\theta \in \mathbb {R} ^ {n + 1}} {\arg \max } - \mathcal {L} ^ {*} (y (z), - \theta) - \Omega^ {*} \left(X ^ {\top} \theta\right), \tag {9} +$$ + +where, given a proper, closed and convex function $f: \mathbb{R}^n \to \mathbb{R} \cup \{+\infty\}$ , we denoted its Fenchel-Legendre transform as $f^*: \mathbb{R}^n \to \mathbb{R} \cup \{+\infty\}$ defined by $f^*(x^*) = \sup_{x \in \operatorname{dom} f} \langle x^*, x \rangle - f(x)$ with $\operatorname{dom} f = \{x \in \mathbb{R}^n : f(x) < +\infty\}$ . + +Let $P_{z}$ and $D_{z}$ denote the primal and dual objective functions. We have the following classical error bounds for the dual optimization problem. If the loss function $\mathcal{L}$ is $\nu$ -smooth, then $\mathcal{L}^{*}$ is $1 / \nu$ -strongly convex and we have for $\forall (\beta ,\theta)\in \operatorname {dom}P_z\times \operatorname {dom}D_z$ + +$$ +\begin{array}{l} \frac {1}{2 \nu} \| \theta (z) - \theta \| ^ {2} \leq D _ {z} (\theta (z)) - D _ {z} (\theta) \\ = P _ {z} (\beta (z)) - D _ {z} (\theta) \\ \leq \operatorname {D u a l i t y} _ {-} \operatorname {G a p} _ {z} (\beta , \theta), \\ \end{array} +$$ + +where the equality follows from strong duality and we recall from weak duality that the duality gap upper bounds the optimization error as follow: + +$$ +\begin{array}{l} \text {D u a l i t y} _ {-} \operatorname {G a p} _ {z} (\beta , \theta) := P _ {z} (\beta) - D _ {z} (\theta) \\ \geq P _ {z} (\beta) - P _ {z} (\beta (z)). \\ \end{array} +$$ + +This readily leads to several possible bounds. If the dual function $D_z(\cdot)$ is $\rho^*$ -Lipschitz for any $z$ , then + +$$ +\left\| \theta (z) - \theta \right\| \leq \sqrt {2 \nu \rho^ {*}}. +$$ + +If the duality gap can be assumed to be bounded by $C$ for any $z \in [z_{\min}, z_{\max}]$ , then + +$$ +\left\| \theta (z) - \theta \right\| \leq \sqrt {2 \nu C} . +$$ + +We obtain stability bounds when one uses the dual solution (which is a function of the residual) as a conformity score $S(y(z), \mu_z(X)) = |\theta(z)|$ where the absolute value is taken coordinate wise. For example, these dual based score functions were used in (Ndiaye & Takeuchi, 2019). + +Remark 3.11 (Bound on the loss). The assumption of a bounded loss function that we make, is not rigorously feasible and some adaptations are necessary. For simplicity, let us consider that $\Phi(x,0) = 0$ and $\Omega(0) = 0$ . Using the optimality of $\beta(z)$ , we obtain for any candidate $z$ + +$$ +\begin{array}{l} \mathcal {L} (y (z), \mu_ {z} (X)) \leq \mathcal {L} (y (z), \mu_ {z} (X)) + \Omega (\beta (z)) \\ \leq \mathcal {L} (y (z), 0). \\ \end{array} +$$ + +Unfortunately, for common examples such as least squares, the right hand side is unbounded. Nevertheless, since the data are assumed to be exchangeable, we have + +$$ +\mathbb {P} \left(y _ {n + 1} \in \left[ y _ {(1)}, y _ {(n)} \right]\right) \geq 1 - \frac {2}{n + 1}. +$$ + +Hence it is reasonable to restrict the range of candidates as $z\in [y_{(1)},y_{(n)}]$ , which implies + +$$ +\begin{array}{l} \mathcal {L} (y (z), \mu_ {z} (X)) \leq \sup _ {\text {}} \mathcal {L} (y (z), 0) =: C. \\ z \in [ y _ {(1)}, y _ {(n)} ] \\ \end{array} +$$ + +# 4. Numerical Experiments + +We conduct all the experiments with a coverage level of 0.9 i.e., $\alpha = 0.1$ . For comparisons, we run the evaluations on 100 repetitions of examples and display the average of the following performance statistics for different methods: the empirical coverage i.e., the percentage of times the prediction set contains the held-out target $y_{n+1}$ , the length of the confidence intervals, and the execution time. We compare the method we propose stabCP with the conformal prediction set computed with an oracle method defined below, with a splitting strategy splitCP (Papadopoulos et al., 2002; Lei et al., 2018), and finally with an estimation of the $\alpha$ -level set of the conformity function rootCP (Ndiaye & Takeuchi, 2021) by root-finding solvers. Note that, when the conformal set is a bounded interval, stabCP approximates rootCP as in Figure 2. In all experiments conducted, we observed that the exact conformal prediction set is indeed an interval. Although this is often the case, we recall that it might not be in general. Just for the comparisons, we therefore estimated the stabCP sets with a root-finding solver as well, as if a closed form solution was not available. A python package with our implementation is available at https://github.com/EugeneNdiaye/stable_conformal_prediction where additional numerical experiments (e.g., using large pre-trained neural net) and benchmarks will be provided. + +![](images/b47aabf0128bb56386805b265ecf891044a9f3d08f97ee467b0456cfd0963f3f.jpg) +(a) Boston (506, 13) + +![](images/41a89feb3747786afe296c7fe511b41e4fc0c61dfc028c458c7c51fdf878106e.jpg) +(b) Diabetes (442, 10) + +![](images/2210c96f2296f050991c017cc098601d9f125e06b36589ebbe0ea7f419eaea75.jpg) +(c) Housingcalifornia (20640,8) + +![](images/d7f715af675d7509f59ba6cf2f267146c1ede6cd30b0b0f73932fcdb0c965629.jpg) +(d) Friedman1 (500, 100) +Figure 3. Benchmarking conformal sets for the least absolute deviation regression models with a ridge regularization on real datasets. We display the lengths of the confidence sets over 100 random permutation of the data. We denoted $\overline{cov}$ the average coverage and $\overline{T}$ the average computational time normalized with the average time for computing oracleCP which requires a single full data model fit. The full and exact CP set can always be approximated with a fine (costly) grid discretization of the output space and can then be used as a default baseline. Here, it is represented by rootCP since in the examples displayed the full CP set turns out to be an interval and then rootCP is equal to the full CP up to $\epsilon_r$ digit precision on the decimals; we used a default value of $\epsilon_r = 10^{-4}$ . + +oracleCP. To define an oracle prediction set as reference, we follow in (Ndiaye & Takeuchi, 2019; 2021) and assume that the unavailable target variable $y_{n+1}$ is observed by the algorithm. Hence, we define the oracle scores + +$$ +\begin{array}{l} \forall i \in [ n ], \quad E _ {i} ^ {\mathrm {o r}} = S (y _ {i}, \mu_ {y _ {n + 1}} (x _ {i})) , \\ E _ {n + 1} ^ {\mathrm {o r}} (z) = S (z, \mu_ {y _ {n + 1}} (x _ {n + 1})) , \\ \end{array} +$$ + +and the oracle conformal set as + +$$ +\begin{array}{l} \Gamma_ {\mathrm {o r a c l e}} ^ {(\alpha)} \left(x _ {n + 1}\right) := \left\{z: \pi_ {\mathrm {o r a c l e}} (z) \geq \alpha \right\}, \\ \pi_ {\mathrm {o r a c l e}} (z) = 1 - \frac {1}{n + 1} \sum_ {i = 1} ^ {n + 1} \mathbb {1} _ {E _ {i} ^ {\mathrm {o r}} \leq E _ {n + 1} ^ {\mathrm {o r}} (z)}. \\ \end{array} +$$ + +splitCP. A popular and classical estimation of conformal prediction sets relies on splitting the dataset. The split conformal prediction set introduced in (Papadopoulos et al., 2002), separates the model fitting and the calibration steps. Let us define + +the training set + +$$ +\mathcal {D} _ {\mathrm {t r}} = \left\{\left(x _ {1}, y _ {1}\right), \dots , \left(x _ {m}, y _ {m}\right) \right\} \text {w i t h} m < n, +$$ + +the calibration set + +$$ +\mathcal {D} _ {\mathrm {c a l}} = \left\{\left(x _ {m + 1}, y _ {m + 1}\right), \dots , \left(x _ {n}, y _ {n}\right) \right\}. +$$ + +Then the model is fitted on the training set $\mathcal{D}_{\mathrm{tr}}$ to get $\mu_{\mathrm{tr}}(\cdot)$ and define the score function on the calibration set $\mathcal{D}_{\mathrm{cal}}$ : + +$$ +\begin{array}{l} \forall i \in [ m + 1, n ], \quad E _ {i} ^ {\mathrm {c a l}} = S (y _ {i}, \mu_ {\mathrm {t r}} (x _ {i})) , \\ E _ {n + 1} ^ {\mathrm {c a l}} (z) = S (z, \mu_ {\mathrm {t r}} (x _ {n + 1})) . \\ \end{array} +$$ + +Thus, we obtain the split conformal set as + +$$ +\begin{array}{l} \Gamma_ {\mathrm {s p l i t}} ^ {(\alpha)} (x _ {n + 1}) = \left\{z: \pi_ {\mathrm {s p l i t}} (z) \geq \alpha \right\}, \\ \pi_ {\mathrm {s p l i t}} (z) = 1 - \frac {1}{n - m + 1} \sum_ {i = m + 1} ^ {n + 1} \mathbb {1} _ {E _ {i} ^ {\mathrm {c a l}} \leq E _ {n + 1} ^ {\mathrm {c a l}} (z)}. \\ \end{array} +$$ + +# 5. Discussion + +The data splitting approach does not use all the data in the training phase. It is often less statistically efficient, and its interval length can vary greatly depending on the additional randomness of the split. On the contrary, our approach does not use any splitting, provides an approximation of the exact conformal set that is pretty accurate depending on the stability of the model as can be observed on Figure 3. All this requires one and only one data fitting of the underlying learning model. You will notice that splitCP and stabCP have the same structure and are simple intervals if the score functions are reasonably simple. The presence + +of data splitting in the former is replaced by an additional stability term in the latter. So if the predictive model is very stable,stabCP benefits from all the data, and very little regularization to get closer to the oracle version that includes the unknown target $y_{n + 1}$ . To date, we are not aware of any other method that can obtain a full conformal prediction set with such computational efficiency while ensuring no loss on the coverage guarantee. We observe on the benchmarks with real data Figure 3 that the stabCP is often very similar to the rootCP which approximates with a very fine precision the exact set (under the assumption that the latter is a bounded interval). Our proposal has the net advantage of being twenty to thirty times faster and can often be computed in closed form. + +However, as can be seen in Figure 2, our proposed method loses precision when the sample size is small. This reflects the difficulty of estimating a reliable confidence set in the absence of algorithmic stability. At the same time, it is difficult to have an algorithm that generalizes well with so little training data. Otherwise, when the size of the data is important, the influence of the stability bound is very little felt because they are often of the order of magnitude $O(1/n)$ . + +Finally, a notorious limitation is that one needs to know explicitly the stability bounds. This can be difficult to estimate for some models. The bounds we presented in Section 3.3 cover a wide range of examples and can be completed by bounds displayed in (Hardt et al., 2016; Bassily et al., 2020; Lei et al., 2021; Klochkov & Zhivotovskiy, 2021) for stochastic gradient descent. Even if the notion of stability required here is slightly different, any error bound on the estimator can be naturally converted into a stability bound for conformal prediction sets. So we don't lose much generality as long as we make the assumption that the score function is sufficiently regular e.g., Lipschitz. This is precisely what allowed us to obtain the bounds presented in this article. Yet, if the parameter of the predictive model is defined iteratively by a gradient descent process on a non-convex objective function, obtaining stability bounds becomes quite delicate. Moreover, the Lipschitz constant of neural network objectives can be poorly estimated. In this case, our approach could not be applied safely or could lead to uninformative confidence intervals. The splitting strategy remains more flexible. It would be interesting to study fine combinations of data splitting and inclusion of stability bounds to reduce the size of the confidence intervals and their variance while being pivotal to explicit stability bounds. + +# Acknowledgements + +We warmly thank the reviewers for their insightful comments and contributions to improve the presentation of this paper. We also thank Elvis Dohmatob and Xiaoming Huo for proofreading and for pointing out mistakes in notations. + +# References + +Abad, J., Bhatt, U., Weller, A., and Cherubin, G. Approximating full conformal prediction at scale via influence functions. arXiv preprint arXiv:2202.01315, 2022. +Alaa, A. and Schaar, M. V. D. Discriminative jackknife: Quantifying uncertainty in deep learning via higher-order influence functions. International Conference on Machine Learning, 2020. +Arlot, S. and Celisse, A. A survey of cross-validation procedures for model selection. Statistics surveys, 2010. +Bach, F., Jenatton, R., Mairal, J., and Obozinski, G. Optimization with sparsity-inducing penalties. Foundations and Trends in Machine Learning, 2012. +Balasubramanian, V., Ho, S.-S., and Vovk, V. Conformal prediction for reliable machine learning: theory, adaptations and applications. Elsevier, 2014. +Barber, R. F., Candes, E. J., Ramdas, A., and Tibshirani, R. J. Predictive inference with the jackknife+. The Annals of Statistics, 2021. +Bassily, R., Feldman, V., Guzmán, C., and Talwar, K. Stability of stochastic gradient descent on nonsmooth convex losses. Advances in Neural Information Processing Systems, 2020. +Bates, S., Candès, E., Lei, L., Romano, Y., and Sesia, M. Testing for outliers with conformal p-values. arXiv preprint arXiv:2104.08279, 2021. +Bröcker, J. and Kantz, H. The concept of exchangeability in ensemble forecasting. *Nonlinear Processes in Geophysics*, 2011. +Carlsson, L., Eklund, M., and Norinder, U. Aggregated conformal prediction. IFIP International Conference on Artificial Intelligence Applications and Innovations, 2014. +Cella, L. and Ryan, R. Valid distribution-free inferential models for prediction. arXiv preprint arXiv:2001.09225, 2020. +Chang, Y.-C. and Hung, W.-L. Linex loss functions with applications to determining the optimum process parameters. Quality & Quantity, 2007. +Chernozhukov, V., Wüthrich, K., and Zhu, Y. Exact and robust conformal inference methods for predictive machine learning with dependent data. Conference On Learning Theory, 2018. + +Chernozhukov, V., Withrich, K., and Zhu, Y. An exact and robust conformal inference method for counterfactual and synthetic controls. Journal of the American Statistical Association, 2021. +Cherubin, G., Chatzikokolakis, K., and Jaggi, M. Exact optimization of conformal predictors via incremental and decremental learning. International Conference on Machine Learning, 2021. +Efron, B. Resampling plans and the estimation of prediction error. Stats, 2021. +Efron, B., Hastie, T., Johnstone, I. M., and Tibshirani, R. Least angle regression. The Annals of Statistics, 2004. +Fisch, A., Schuster, T., Jaakkola, T., and Barzilay, R. Few-shot conformal prediction with auxiliary tasks. ICML, 2021. +Gruber, M. Regression estimators: A comparative study. JHU Press, 2010. +Hardt, M., Recht, B., and Singer, Y. Train faster, generalize better: Stability of stochastic gradient descent. International Conference on Machine Learning, 2016. +Hebiri, M. Sparse conformal predictors. Statistics and Computing, 2010. +Hiriart-Urruty, J.-B. and Lemarechal, C. Convex analysis and minimization algorithms. II. Springer-Verlag, 1993. +Ho, S.-S. and Wechsler, H. Query by transduction. IEEE transactions on pattern analysis and machine intelligence, 2008. +Hoerl, A. E. and Kennard, R. W. Ridge regression: Biased estimation for nonorthogonal problems. Technometrics, 1970. +Holland, M. J. Making learning more transparent using conformalized performance prediction. arXiv preprint arXiv:2007.04486, 2020. +Johnstone, C. and Cox, B. Conformal uncertainty sets for robust optimization. Conformal and Probabilistic Prediction and Applications, 2021. +Klochkov, Y. and Zhivotovsky, N. Stability and deviation optimal risk bounds with convergence rate $o(1/n)$ . Advances in Neural Information Processing Systems, 2021. +Laxhammar, R. and Falkman, G. Inductive conformal anomaly detection for sequential detection of anomalous sub-trajectories. Annals of Mathematics and Artificial Intelligence, 2015. +Lei, J. Fast exact conformalization of lasso using piecewise linear homotopy. Biometrika, 2019. + +Lei, J., GSell, M., Rinaldo, A., Tibshirani, R. J., and Wasserman, L. Distribution-free predictive inference for regression. Journal of the American Statistical Association, 2018. +Lei, Y., Yang, Z., Yang, T., and Ying, Y. Stability and generalization of stochastic gradient methods for minimax problems. 2021. +Linusson, H., Norinder, U., Bostrom, H., Johansson, U., and Lofstrom, T. On the calibration of aggregated conformal predictors. Conformal and probabilistic prediction and applications, 2017. +Ndiaye, E. and Takeuchi, I. Computing full conformal prediction set with approximate homotopy. NeurIPS, 2019. +Ndiaye, E. and Takeuchi, I. Root-finding approaches for computing conformal prediction set. arXiv preprint arXiv:2104.06648, 2021. +Ndiaye, E., Le, T., Fercoq, O., Salmon, J., and Takeuchi, I. Safe grid search with optimal complexity. ICML, 2019. +Nouretdinov, I., Melluish, T., and Vovk, V. Ridge regression confidence machine. ICML, 2001. +O. Bousquet, O. and Elisseeff, A. Stability and generalization. The Journal of Machine Learning Research, 2002. +Papadopoulos, H., Proedrou, K., Vovk, V., and Gammerman, A. Inductive confidence machines for regression. European Conference on Machine Learning, 2002. +Rockafellar, R. T. Convex analysis. Princeton University Press, 1997. Reprint of the 1970 original, Princeton Paperbacks. +Shafer, G. and Vovk, V. A tutorial on conformal prediction. Journal of Machine Learning Research, 2008. +Shalev-Shwartz, S. and Ben-David, S. Understanding machine learning: From theory to algorithms. Cambridge university press, 2014. +Vovk, V. Cross-conformal predictors. Annals of Mathematics and Artificial Intelligence, 2015. +Vovk, V., Gammerman, A., and Shafer, G. Algorithmic learning in a random world. Springer, 2005. +Xu, C. and Xie, Y. Conformal prediction interval for dynamic time-series. ICML, 2021. + +# 6. Appendix + +In these supplementary notes, we complete some proofs and bring algorithmic precisions of our approach as well as additional numerical experiments. + +# 6.1. StabCP Set with General Score Function + +We explain a simple procedure to approximate the set prediction with an arbitrary pre-defined accuracy. We recall that + +$$ +\begin{array}{l} \Gamma_ {\mathrm {u p}} ^ {(\alpha)} (x _ {n + 1}) = \{z: \pi_ {\mathrm {u p}} (z, \hat {z}) \geq \alpha \} \\ = \left\{z: S \left(z, \mu_ {\hat {z}} \left(x _ {n + 1}\right)\right) \leq Q _ {1 - \alpha} (\hat {z}) + \tau_ {n + 1} \right\}, \\ \end{array} +$$ + +which is a convex set when the level-set of the score function is convex. By simplicity, we assume that the score function is such that $\Gamma_{\mathrm{up}}^{(\alpha)}(x_{n + 1})$ is a bounded interval. Algorithm 2 summarizes the process. + +Algorithm 2 Stable conformal prediction set for score function with convex level-set + +Input: data $\{(x_{1},y_{1}),\ldots ,(x_{n},y_{n})\}$ and $x_{n + 1}$ + +Coverage level $\alpha \in (0,1)$ , any estimate $\hat{z} \in \mathbb{R}$ + +Stability bounds $\tau_{1},\ldots ,\tau_{n + 1}$ of the learning algorithm + +Output: prediction interval at $x_{n + 1}$ + +Fit a model $\mu_{\hat{z}}$ on the training data $\mathcal{D}_{n + 1}(\hat{z})$ + +Compute the quantile $Q_{1 - \alpha}(\hat{z}) = U_{([\Gamma (1 - \alpha)(n + 1)])}(z,\hat{z})$ where the $U_{i}$ s are defined in Proposition 3.2 + +Compute $\Gamma_{\mathrm{up}}^{(\alpha)}(x_{n + 1}) = [\ell_{\alpha}(x_{n + 1}),u_{\alpha}(x_{n + 1})]$ up to $\epsilon_r > 0$ tolerance error as follow: + +1. find $z_{\min} < z_0 < z_{\max}$ such that + +$$ +\pi_ {\mathrm {u p}} \left(z _ {\min }, \hat {z}\right) < \alpha < \pi_ {\mathrm {u p}} \left(z _ {0}, \hat {z}\right) \text {a n d} \alpha > \pi_ {\mathrm {u p}} \left(z _ {\max }, \hat {z}\right). \tag {10} +$$ + +2. Perform a bisection search in $[z_{\min}, z_0]$ . It will output a point $\hat{\ell}$ such that $\ell_{\alpha}(x_{n+1})$ belongs to $[\hat{\ell} \pm \epsilon_r]$ after at most $\log_2\left(\frac{z_0 - z_{\min}}{\epsilon_r}\right)$ iterations. +3. Perform a bisection search in $[z_0, z_{\max}]$ . It will output a point $\hat{u}$ such that $u_{\alpha}(x_{n+1})$ belongs to $[\hat{u} \pm \epsilon_r]$ after at most $\log_2\left(\frac{z_{\max} - z_0}{\epsilon_r}\right)$ iterations. + +Return: $\Gamma_{\mathrm{up}}^{(\alpha)}(x_{n + 1})$ + +# 6.2. Stability of the Linear Interpolation + +We discussed in Section 3.2 the potential gain in accuracy when approximating the conformity function using not a single point but a batch of points. Here we justify the interpolation approach when the score function $S$ is sufficiently regular. + +Proposition 6.1. Let us assume that the score function $S(q,\cdot)$ is $\gamma$ -Lipschitz for any $q$ , and consider the interpolated prediction model defined as + +$$ +\tilde {\mu} _ {z} = \left\{ \begin{array}{l l} \frac {\hat {z} _ {1} - z}{\hat {z} _ {1} - z _ {\min }} \mu_ {z _ {\min }} + \frac {z _ {\min } - z}{\hat {z} _ {1} - z _ {\min }} \mu_ {\hat {z} _ {1}} & i f z \leq z _ {\min }, \\ \frac {z - \hat {z} _ {t + 1}}{\hat {z} _ {t} - \hat {z} _ {t + 1}} \mu_ {\hat {z} _ {t}} + \frac {z - \hat {z} _ {t}}{\hat {z} _ {t + 1} - \hat {z} _ {t}} \mu_ {\hat {z} _ {t + 1}} & i f z \in [ \hat {z} _ {t}, \hat {z} _ {t + 1} ], \\ \frac {z - \hat {z} _ {d}}{z _ {\max } - \hat {z} _ {d}} \mu_ {z _ {\max }} + \frac {z _ {\max } - z}{z _ {\max } - \hat {z} _ {d}} \mu_ {\hat {z} _ {d}} & i f z \geq z _ {\max }, \end{array} \right. \tag {11} +$$ + +where $\mu$ . is stable according to Definition 3.1. It holds + +$$ +\left| S \left(q, \tilde {\mu} _ {z} \left(x _ {i}\right)\right) - S \left(q, \tilde {\mu} _ {z _ {0}} \left(x _ {i}\right)\right) \right| \leq 3 \gamma \tau_ {i}. \tag {12} +$$ + +Proof. Using the triangle inequality, we have + +$$ +\begin{array}{l} \tilde {\operatorname {s t a b}} := | S (q, \tilde {\mu} _ {z} (x _ {i})) - S (q, \tilde {\mu} _ {z _ {0}} (x _ {i})) | \\ \leq | S (q, \tilde {\mu} _ {z} (x _ {i})) - S (q, \mu_ {z} (x _ {i})) | + | S (q, \mu_ {z} (x _ {i})) - S (q, \mu_ {z _ {0}} (x _ {i})) | + | S (q, \mu_ {z _ {0}} (x _ {i})) - S (q, \tilde {\mu} _ {z _ {0}} (x _ {i})) |. \\ \end{array} +$$ + +If $\mu$ . is stable, then the second term of the right hand side of the previous inequality is bounded by $\tau_{i}$ . Now, assuming that $S$ is $\gamma$ -Lipschitz in its second argument, for any $q$ , we have: + +$$ +\left| S \left(q, \tilde {\mu} _ {z} \left(x _ {i}\right)\right) - S \left(q, \mu_ {z} \left(x _ {i}\right)\right) \right| \leq \gamma \mathcal {E} _ {z} ^ {i}, +$$ + +where + +$$ +\begin{array}{l} \mathcal {E} _ {z} ^ {i} = \left| \mu_ {z} \left(x _ {i}\right) - \tilde {\mu} _ {z} \left(x _ {i}\right) \right| \\ \leq \left| \mu_ {z} \left(x _ {i}\right) - \alpha_ {t} \mu_ {z _ {t}} \left(x _ {i}\right) - \left(1 - \alpha_ {t}\right) \mu_ {z _ {t + 1}} \left(x _ {i}\right) \right| \\ \leq \alpha_ {t} \left| \mu_ {z} \left(x _ {i}\right) - \mu_ {z _ {t}} \left(x _ {i}\right) \right| + \left(1 - \alpha_ {t}\right) \left| \mu_ {z} \left(x _ {i}\right) - \mu_ {z _ {t + 1}} \left(x _ {i}\right) \right| \\ \leq \alpha_ {t} \tau_ {i} + (1 - \alpha_ {t}) \tau_ {i} = \tau_ {i}, \\ \end{array} +$$ + +with $\alpha_{t} \in \left\{\frac{z_{1} - z}{z_{1} - z_{\min}}, \frac{z - z_{t + 1}}{z_{t} - z_{t + 1}}, \frac{z - z_{d}}{z_{\max} - z_{d}}\right\}$ is the scaling of interpolation points. Thus, we obtain + +$$ +\tilde {\mathrm {s t a b}} \leq \gamma (\mathcal {E} _ {z} ^ {i} + \tau_ {i} + \mathcal {E} _ {z _ {0}} ^ {i}) \leq 3 \gamma \tau_ {i}. +$$ + +The upper and lower approximation of the conformity function obtained with the interpolated model fit along with stability bounds are defined as: + +$$ +\tilde {\pi} _ {\mathrm {l o}} (z) = 1 - \frac {1}{n + 1} \sum_ {i = 1} ^ {n + 1} \mathbb {1} _ {\tilde {L} _ {i} (z) \leq \tilde {U} _ {n + 1} (z)} , +$$ + +$$ +\tilde {\pi} _ {\mathrm {u p}} (z) = 1 - \frac {1}{n + 1} \sum_ {i = 1} ^ {n + 1} \mathbb {1} _ {\tilde {U} _ {i} (z) \leq \tilde {L} _ {n + 1} (z)}, +$$ + +where for any index $i$ in $[n + 1]$ , using the stability bound in Equation (12), we define + +$$ +\tilde {L} _ {i} (z) = \tilde {E} _ {i} (z) - 3 \gamma \tau_ {i} \text {a n d} \tilde {U} _ {i} (z) = \tilde {E} _ {i} (z) + 3 \gamma \tau_ {i}, +$$ + +$$ +\tilde {E} _ {i} (z) = S \left(y _ {i}, \tilde {\mu} _ {z} \left(x _ {i}\right)\right) \text {a n d} \tilde {E} _ {n + 1} (z) = S \left(z, \tilde {\mu} _ {z} \left(x _ {i}\right)\right). +$$ + +In general, approximating the entire model path with respect to output/label changes using finite grid points is not always safe for calculating the conformal prediction set because it breaks the exchangeability assumptions of the data set. Incorporating the stability bound will regularize the conformity function to restore the validity of the method. However, the procedure proves to be quite robust to wrong estimation of the stability bounds. The experiments in (Ndiaye & Takeuchi, 2021) are conducted with estimates $\tau_{i} = 0$ and the prediction sets obtained are essentially the same as the exact one. More detailed experiments will be proposed in our github implementation. + +# 6.3. Additional Experiments + +In this appendix, we add some numerical experiments to illustrate how stabCP can behave when using an estimator that is not defined as an argmin but rather as an output of an iterative process. In this case, we use a Multi-Layer Perceptron regressor trained with $T = n$ -iter number of gradient descent iterations. Recent analyses (Hardt et al., 2016) have shown that any model trained with the stochastic gradient method in a reasonable amount of time achieves low generalization error. The proof of these results consists in showing that the estimator verifies a stability condition when the input data are slightly perturbed. The bounds on the iterates of stochastic gradient methods are often proportional to $\frac{T}{n}$ . They also depend on the Lipschitz regularity constants which unfortunately can be hard to estimate in practice. Here, we will be satisfied with the order of magnitude and evaluate the behavior of the conformity function according to the number of iterations performed. We run the experiments on two different datasets with a sample size of 442 and 20640. + +![](images/b0ac5e90c93c69b0f6d05038518a13fb83f1ad4c9ee33f0ff8f4aeee0ca3f19a.jpg) + +![](images/9892bf75f2a0a5c830b342afaef2dc78e2e9ae24c3327d72305efb4b8e9ec15e.jpg) + +![](images/8800d3d475aed7d76950b5adc5a5f7fa8f820f0e74125d3198f5d06a79c1f9f3.jpg) + +![](images/5a2f243ad095147776e865aadcdeb4ea7ffcfe02284ae95e1fabde18137d226c.jpg) +Figure 4. Illustration of different conformity functions with respect to a sequence of stability bounds. We observe that by merely staking an order of magnitude $O(1/n)$ as stability bound, gives a good estimate of the conformal prediction set even if the bound is not safe. These experiments are conducted with a Multi-Layer Perceptron regressor on the Diabetes (442, 10) dataset, trained with $T = n$ -iter iterations of Stochastic Gradient Descent. + +![](images/b258fafd2d04d0f247bb0b8807a408e28fc8b149c7714542ac5fef9981fb81f6.jpg) + +![](images/efb438f9aa02b387c45d7ad496139e617962672a74857738e48bb0508cd75c9f.jpg) + +![](images/10aa29b1618963390242abf9a26111de94ebecd5a6b603da7309a13c3f394adb.jpg) + +![](images/a444dd63f2271f94cdf58a5783a9235d6e410c2e94e6e907ee9efab9b3904821.jpg) +Figure 5. Illustration of different conformity functions with respect to a sequence of stability bounds. We observe that by merely staking an order of magnitude $O(1/n)$ as stability bound, gives a good estimate of the conformal prediction set even if the bound is not safe. These experiments are conducted with a Multi-Layer Perceptron regressor on the Housingcalifornia (20640, 8) dataset, trained with $T = n$ -iter iterations of Stochastic Gradient Descent. + +![](images/e785a97867a8793e1bc87c79c8fc392b1624b26e71d4dfdc4b638f514b121ad3.jpg) + +![](images/67ed5bcb43bbbc05538c39c5c21b7a465ded764786981c6241a74b63726cfe98.jpg) +(a) Boston (506, 13) + +![](images/eccad1de19c905527ecebb7cbce676548a5634b8f2369ea20ca0f93bdd4d68bb.jpg) +(b) Diabetes (442, 10) + +![](images/2e16caf0c86df58898d10e1c51adc6d34a8113e91b55c0d497b7032e8f84c178.jpg) +(c) Housingcalifornia (20640,8) + +![](images/bbb2dd2801be50f8088aa1ad1cc5b80b654d34a4972a1ef6aaa0348dc6c01313.jpg) +(d) Friedman1 (500, 100) +Figure 6. Benchmarking conformal sets for MLP regression models with a ridge regularization on real datasets. The parameter of the model is obtained after $T = n / 10$ iterations of stochastic gradient descent. For stabCP, we use a stability bound estimate $\tau_{i} = T\| x_{i}\| /(n + 1)$ . We display the lengths of the confidence sets over 100 random permutation of the data. We denoted $\overline{cov}$ the average coverage and $\overline{T}$ the average computational time normalized with the average time for computing oracleCP which requires a single full data model fit. + +![](images/06a45e2badf62dd5e4037ce44e9052eef32fe3339891ec264d07df9627850465.jpg) +(a) Boston (506, 13) + +![](images/08e99252a2f293b8cb55da7e202d41526cc4a176fdf313dcb2e365ae6cb99730.jpg) +(b) Diabetes (442, 10) + +![](images/bbbd9e7669d9e7c4bcfcb3615d08c786fab03ad3078563636e40974a7176d68f.jpg) +(c) Housingcalifornia (20640,8) + +![](images/aea64e8dfaf5bd7bd56520038bd10ec95189807c742c4a49d8060ddb4a760804.jpg) +(d) Friedman1 (500, 100) +Figure 7. Benchmarking conformal sets for Gradient Boosting regression models with a ridge regularization on real datasets. For stabCP, we use a stability bound estimate $\tau_{i} = \| x_{i}\| /(n + 1)$ . We display the lengths of the confidence sets over 100 random permutation of the data. We denoted $\overline{cov}$ the average coverage and $\overline{T}$ the average computational time normalized with the average time for computing oracleCP which requires a single full data model fit. + +![](images/31a2427dd5cd644905d47f406e29a9202b93859a23b34912921b7ada6dbb96d5.jpg) +(a) Boston (506, 13) + +![](images/24be66c518860118a9660e90f84232c7389180b8bf0f869fcb53d21224840cb9.jpg) +(b) Diabetes (442,10) + +![](images/df1a633c6a20280445b5034d9eee8867e71aaa7332a34d9fa1a5ff3fde2f3f4d.jpg) +(c) Housingcalifornia (20640,8) + +![](images/9d77cad904eb52786142b627a9c2fca9a1ace2312c31f1a32f7915a3dae8dcff.jpg) +(d) Friedman1 (500, 100) +Figure 8. Benchmarking conformal sets for Gradient Boosting regression models with a ridge regularization on real datasets. For stabCP, we use a rough stability bound estimate $\tau_{i} \approx \| x_{i}\| /10$ . We display the lengths of the confidence sets over 100 random permutation of the data. We denoted $\overline{cov}$ the average coverage and $\bar{T}$ the average computational time normalized with the average time for computing oracleCP which requires a single full data model fit. This example shows that for unstable models such as decision trees, a coarse estimation of the stability bound can result in an overestimation of the confidence interval, which is a notable limitation of the proposed method. \ No newline at end of file diff --git a/stableconformalpredictionsets/images.zip b/stableconformalpredictionsets/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..1d86ce7837d657d268b97e97ff0cf24d533c7e76 --- /dev/null +++ b/stableconformalpredictionsets/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c54777d49ba18ef971f968243cf9cc3e5becf35a2cc7da1af4915260a6cf81cb +size 906743 diff --git a/stableconformalpredictionsets/layout.json b/stableconformalpredictionsets/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..0ebbfcde22bb0c9679e539d3f9a4867d4106bee8 --- /dev/null +++ b/stableconformalpredictionsets/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c0e8a67bc24474171dc433e32164e714b97b2a54d6d302a34b9d827bd0f6f3f1 +size 763384 diff --git a/stagedtrainingfortransformerlanguagemodels/713e4c6a-d7d4-4700-8b35-ab1f581f03e2_content_list.json b/stagedtrainingfortransformerlanguagemodels/713e4c6a-d7d4-4700-8b35-ab1f581f03e2_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..a4d11f2409cbc62c24cd74a4e2ef83bab6394544 --- /dev/null +++ b/stagedtrainingfortransformerlanguagemodels/713e4c6a-d7d4-4700-8b35-ab1f581f03e2_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6a35ad930856a854a726eecab94b058c5585fd9563e6906e7e4c9bc74f93d094 +size 103859 diff --git a/stagedtrainingfortransformerlanguagemodels/713e4c6a-d7d4-4700-8b35-ab1f581f03e2_model.json b/stagedtrainingfortransformerlanguagemodels/713e4c6a-d7d4-4700-8b35-ab1f581f03e2_model.json new file mode 100644 index 0000000000000000000000000000000000000000..d9f744eccd6a25fa90ea835b9bc4b33716598de6 --- /dev/null +++ b/stagedtrainingfortransformerlanguagemodels/713e4c6a-d7d4-4700-8b35-ab1f581f03e2_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:24cdd3a95c9e7b2576df229f5b86ece3aeadd6f24bf4d6c0ff1292b8122606c2 +size 122989 diff --git a/stagedtrainingfortransformerlanguagemodels/713e4c6a-d7d4-4700-8b35-ab1f581f03e2_origin.pdf b/stagedtrainingfortransformerlanguagemodels/713e4c6a-d7d4-4700-8b35-ab1f581f03e2_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..9a170ce0e897c1fd5ff2a88218849babbafadce5 --- /dev/null +++ b/stagedtrainingfortransformerlanguagemodels/713e4c6a-d7d4-4700-8b35-ab1f581f03e2_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:80c12b8d8ad9040b9eab5da49ddd0692b62220c100030f6d21b55d98e6a76ab7 +size 788782 diff --git a/stagedtrainingfortransformerlanguagemodels/full.md b/stagedtrainingfortransformerlanguagemodels/full.md new file mode 100644 index 0000000000000000000000000000000000000000..95e953b0e75702e220f86e16b1f0e41803a425d0 --- /dev/null +++ b/stagedtrainingfortransformerlanguagemodels/full.md @@ -0,0 +1,460 @@ +Sheng Shen $^{1}$ Pete Walsh $^{2}$ Kurt Keutzer $^{1}$ Jesse Dodge $^{2}$ Matthew Peters $^{2}$ Iz Beltagy $^{2}$ + +# Abstract + +The current standard approach to scaling transformer language models trains each model size from a different random initialization. As an alternative, we consider a staged training setup that begins with a small model and incrementally increases the amount of compute used for training by applying a "growth operator" to increase the model depth and width. By initializing each stage with the output of the previous one, the training process effectively re-uses the compute from prior stages and becomes more efficient. Our growth operators each take as input the entire training state (including model parameters, optimizer state, learning rate schedule, etc.) and output a new training state from which training continues. We identify two important properties of these growth operators, namely that they preserve both the loss and the "training dynamics" after applying the operator. While the loss-preserving property has been discussed previously, to the best of our knowledge this work is the first to identify the importance of preserving the training dynamics (the rate of decrease of the loss during training). To find the optimal schedule for stages, we use the scaling laws from (Kaplan et al., 2020) to find a precise schedule that gives the most compute saving by starting a new stage when training efficiency starts decreasing. We empirically validate our growth operators and staged training for autoregressive language models, showing up to $22\%$ compute savings compared to a strong baseline trained from scratch. Our code is available at https://github.com/allenai/staged-training. + +![](images/a72f70294d24e68ec6b3318af723992ac3d35b1e810128cecaf1e751256f59ba.jpg) +Figure 1: We train a GPT2 $_{\text{LARGE}}$ (768M parameters) transformer language model by first training a model 1/4 the size (orange line), then increasing the model size by $4x$ by applying a growth operator to the entire training state, and restarting training (green line). The result is a large size model with comparable loss to one trained from scratch (blue line) but with reduced compute cost illustrated initially by the dashed red arrow. + +# 1. Introduction + +Language models form the backbone of many modern NLP systems, and these language models have become progressively larger in recent years. Parameter counts for these models have grown significantly from ELMo (94 M) (Peters et al., 2018) to GPT-3 (175 B) (Brown et al., 2020). While larger models with more learnable parameters perform better on a wide range of tasks, the computational cost to train or even just to evaluate these models has become prohibitively expensive (Schwartz et al., 2020). In this paper, we demonstrate a method to reduce the compute cost of training transformer language models (Vaswani et al., 2017) through a staged training setup that iteratively builds a large model from a smaller one. + +Most prior work on scaling language models initializes each model size from a random initialization and trains to convergence (Kaplan et al., 2020). This work illustrated an intriguing property of model training shown in Figure 1, namely that smaller models are initially more compute efficient than larger models, but eventually the larger model will reach a lower loss. Our central idea is to take advantage of this property by first training a smaller model in the compute efficient region, applying a growth operator to the en + +tire training state, and restarting training with a larger sized model. We introduce two operators to perform this growing operation along the model depth and width dimensions. We also identify two important properties of the operators: first, the loss before growing the model is preserved, and second, the training dynamics of the grown model match that of an equivalent model trained from scratch. To maintain training dynamics, growth operators must take into the entire training state, including the optimizer state and learning rate schedule, in addition to the model weights. As can be seen in Figure 1 our growth operator is loss-preserving, and we show in subsequent sections that it also preserves the training dynamics. These properties also make applying the growth operators conceptually and algorithmically simple as they won't disrupt the training process, and prior results regarding the model size needed to converge to a particular loss still hold. + +While prior work (Rusu et al., 2016; Wei et al., 2016; Gong et al., 2019; Liu et al., 2019; Li et al., 2020b; Press et al., 2020; Gu et al., 2021; Li et al., 2021; Rae et al., 2021; Evci et al., 2022; Hoffmann et al., 2022) has examined some aspects of staged training, our work is the first to address all aspects including how to grow the entire training state and set the stage schedule. We begin by describing the details of our growth operators for the model weights and optimizer state. We then present a principled way to chose the stage schedule, including how to chose the model sizes and number of gradient for each stage. Intuitively, we should start a new stage when the training efficiency decreases and the rate of loss decrease starts to slow down. To formalize this intuition, we use the scaling laws from (Kaplan et al., 2020) to find the optimal schedule that gives the maximum compute saving. We then show how to approximate the optimal schedule in the realistic scenario without perfect knowledge of the scaling laws. We empirically validate our approach with GPT2 style (Radford et al., 2019) autoregressive language model models and demonstrate 5-30 % compute savings measured by validation loss, and zero-shot perplexity using two benchmark datasets. + +# 2. Definitions and Properties of Growth Operators + +# 2.1. Definitions + +We begin by defining some terms which will be used throughout the paper. We consider a model $\mathbf{y} = \phi (\mathbf{x},\theta)$ which takes input $\mathbf{x}$ , outputs $\mathbf{y}$ , with parameters $\theta$ . The model is trained by minimizing a loss function $loss(\mathbf{y},\hat{\mathbf{y}})\in \mathbb{R}$ through a sequence of parameter updates, obtained by running an optimizer. We will also write $loss(\phi ,\mathcal{D})$ for the total loss over a dataset $\mathcal{D} = \{\mathbf{x}_i,\mathbf{y}_i\}$ (or just $loss(\phi)$ ). The parameter updates for a particular mini-batch are determined by both the mini-batch and the training state, + +$\mathcal{T} = \{\theta ,(m,v),\lambda (t)\}$ , including the model parameters $\theta$ , optimizer state $(m,v,$ here the first and second moments of the Adam optimizer), and learning rate schedule $\lambda (t)$ . Given a training state, we apply a growth operator $\mathbb{G}(\mathcal{T}_{\mathrm{orig}}) = \mathcal{T}_{\mathrm{grow}}$ that takes the original training state and outputs a grown training state where the model size has increased, along with a corresponding compatible optimizer state and learning rate schedule. + +# 2.2. Desired properties + +In this section, we define two key properties of growth operators. Building on (Chen et al., 2016) we revisit the loss-preserving property, and we introduce a more challenging property, the training-dynamic-preserving property. + +# 2.2.1. PRESERVING LOSS + +A function-preserving growth operator is one that takes as input an original model and returns a grown model that represents the same function as the original model. If an operator is function-preserving then it is also loss-preserving1. + +Mathematically, we can formulate loss-preserving as + +$$ +\operatorname {l o s s} (\mathbb {G} (\phi) (\mathbf {x}), \mathbf {y}) = \operatorname {l o s s} (\phi (\mathbf {x}), \mathbf {y}) \tag {1} +$$ + +for any $(\mathbf{x},\mathbf{y})$ . A growth operator that is not loss-preserving wastes time and compute initially until it recovers the same performance of the original model. Figure 2 (and the more detailed Figure 4) show examples of the proposed width and depth growth operators being loss-preserving. + +# 2.2.2. PRESERVING TRAINING DYNAMICS + +We define the training dynamics as the rate of decrease of loss relative to the amount of compute, and a training-dynamics-preserving growth operator is one that allows the grown model's loss curve to match that of a target model (a model of the same size as the grown model but trained from scratch). + +Formally, let $\phi_{k + 1}$ be the resulting model after applying the optimizer update to model $\phi_{k}$ with training state $\mathcal{T}_k$ . Applying the update requires some amount of compute $C_k$ . The training process produces a loss curve that associates the loss with the total amount of compute used for training + +$$ +\mathcal {L} (\phi , C) = \left\{\left(\bar {C} _ {k}, \operatorname {l o s s} \left(\phi_ {k}, \mathcal {D} _ {k}\right)\right), k = 1, 2, \dots \right\} +$$ + +where $\overline{C}_k = \sum_{i < = k}C_i$ is the total compute used at step $k$ The training dynamics is the compute efficiency of training, + +![](images/bb56145681b332a2ff6abe619f538b2c12fdf75c95cf011c808faf85fe29ab2e.jpg) +(a) Width growth with GPT2Large as target + +![](images/f531bb7dde5ec006c5289646d12a611f82f85f9926c5a3646a102d2486656ab1.jpg) +(b) Depth growth with GPT2LARGE as target +Figure 2: Our growth operators are loss-preserving and training-dynamics preserving. Using (a) as an example, $\mathrm{GPT2}_{\mathrm{LARGE}/4}$ is the original model which is $4\mathrm{x}$ smaller than the target model $\mathrm{GPT2}_{\mathrm{LARGE}}$ . The model $\mathrm{GPT2}_{\mathrm{LARGE}/4\mathrm{x}4}$ is the grown model resulting from growing $\mathrm{GPT2}_{\mathrm{LARGE}/4}$ by $4\mathrm{x}$ (doubling model width). The PRE-GROWTH point is highlighted on the original model $\mathrm{GPT2}_{\mathrm{LARGE}/4}$ , and the POST-GROWTH point is highlighted on the grown model $\mathrm{GPT2}_{\mathrm{LARGE}/4\mathrm{x}4}$ . The PRE-GROWTH and POST-GROWTH points have the same loss, showing that the width growth operator is loss-preserving. To demonstrate that it is also training dynamics-preserving, we overlay the loss curve for the grown model over the target model and confirm the rate of loss decrease with respect to the number of tokens is the same as the target model trained from scratch. The x-axis is number of training tokens since random initialization, or from the start of the training stage (for $\mathrm{GPT2}_{\mathrm{LARGE}/4\mathrm{x}4}$ ). A similar result is seen in (b) for the depth growth operator. + +the expected decrease in the loss relative to the amount of compute: + +$$ +\frac {\partial}{\partial C} \mathcal {L} (\phi , C) = \mathbb {E} _ {D} \left[ \frac {\operatorname {l o s s} \left(\phi_ {k} , \mathcal {D}\right) - \operatorname {l o s s} \left(\phi_ {k + 1} , \mathcal {D}\right)}{C _ {k}} \right] +$$ + +which we denote by $\frac{\partial\mathcal{L}}{\partial C}$ as an abuse of notation. Practically it is easy to estimate during training by monitoring the model's loss. + +We can now define a training-dynamics-preserving growth operator $\mathbb{G}$ at a point on the loss curve with loss $L_{\mathbb{G}}$ as one that preserves the efficiency of training of the grown model vs. a target model trained from scratch: + +$$ +\frac {\partial}{\partial C} \mathcal {L} (\mathbb {G} (\phi_ {\text {o r i g}}), C) = \frac {\partial}{\partial C} \mathcal {L} (\phi_ {\text {t a r g e t}}, C) \tag {2} +$$ + +where efficiency is evaluated at $L_{\mathbb{G}}$ + +Notice that while loss-preserving is a property comparing the original and grown models, training-dynamics-preserving is a property comparing the grown and target models. This property makes it possible for the grown model to "jump" from the loss curve of the smaller model to the large model and always benefit from faster convergence. A growth operator that does not satisfy this requirement could be creating a larger model but with limited capacity or one that is more difficult to train. Figure 2 (and the more detailed Figure 4) shows examples of the width and depth growth operators preserving the training dynamics, where the grown model perfectly follows the loss curves of the target model. + +While the function-preserving property of a growth operator can be confirmed based on the implementation itself, preserving the training dynamics goes beyond just growing the model size; it must be empirically evaluated. To preserve training dynamics, one must address the whole training state including the learning rate and the optimizer state, which are hardly discussed in prior work. We discuss this further in the next section. + +# 3. Growth Operators + +We introduce two growth operators below; the operators are described generally, though of course the implementations are model-specific. Our experiments are using the GPT2 transformer architecture (Radford et al., 2019). + +# 3.1. Width + +Our width operator doubles the hidden dimension of the entire model, and therefore increases the number of parameters by approximately $4\mathrm{x}$ . This operator applies to all weights in the network including embeddings, feed forward layers, bias, and normalization layers, not just the feed forward layers as in prior work (Gu et al., 2021). It grows each layer in slightly different ways. Layer-normalization layers and bias terms with weights $W \in \mathbb{R}^d$ are duplicated: + +$$ +\mathbb {G} (W) = [ W, W ]. +$$ + +where $[\cdot, \cdot]$ represents concatenation and we have overloaded $\mathbb{G}(\cdot)$ to apply to a weight matrix instead of the entire training state. Embedding layers are handled in a similar + +manner. For the feed forward weights $W \in R^{nxm}$ , we design the growth operators as + +$$ +\mathbb {G} (W) = \left( \begin{array}{c c} W & Z \\ Z & W \end{array} \right) +$$ + +where $Z$ is a zero matrix of size similar to $W$ . + +In this case, the input before the grown last feed forward layer that produces the logits is two times wider and the final logits are two times larger. To keep the whole network loss-preserving, we divide the grown weights of the last feed forward layer by a factor of two. + +# 3.2. Depth + +Our depth operator doubles the number of layers, and therefore increases the number of non-embedding parameters by $2\mathbf{x}$ . Given a model with layers $(\phi_0,\phi_1,\ldots)$ , the depth operator adds an identity layer $\phi_{\mathrm{id}}$ after each layer in the original model, so that the grown model has layers $(\phi_0,\phi_{\mathrm{id}},\phi_1,\phi_{\mathrm{id}},\ldots)$ . The identity layer is a layer where the input matches the output $\phi_{\mathrm{id}}(\mathbf{x}) = \mathbf{x}$ . + +To construct the identity layer, we start with the formulation of each layer in GPT2 as two sublayers: + +$$ +\begin{array}{l} \mathbf {x} ^ {\prime} = \mathbf {x} + \text {A t t e n t i o n} (\mathrm {L N} (\mathbf {x})), \\ \mathbf {y} = \mathbf {x} ^ {\prime} + \operatorname {F F N} (\operatorname {L N} (\mathbf {x} ^ {\prime})) \tag {3} \\ \end{array} +$$ + +where $\mathbf{x} \in \mathbb{R}^{\mathrm{d}}$ is the input, $\mathbf{y} \in \mathbb{R}^{\mathrm{d}}$ is the output. LN, Attention, and FFN stands for the layer normalization, multihead attention and feed-forward operations. We initialize both the scale and bias parameters of each LN in the identity layers to zero, so that $\mathrm{LN}(\mathbf{x}) = \mathbf{0}$ . We also set the bias parameters of all linear layers to zero, which combined with the LN initialization gives $\mathrm{Attention}(\mathrm{LN}(\mathbf{x})) = \mathbf{0}$ and $\mathrm{FFN}(\mathrm{LN}(\mathbf{x}')) = \mathbf{0}$ , and the entire layer reduces to an identity layer at initialization. Overall, the resulting depth growth operator is loss-preserving. + +# 3.3. Growth operator's impact on training state + +In practice, to build a growth operator that preserves training dynamics, we find it important that optimizer state should be grown in a similar way to the model parameters; initial experiments indicated that it can take many training steps to re-estimate the optimizer state, and the initial phase after growth can be unstable. This is expected because training dynamics is the rate of loss change $\frac{\partial\mathcal{L}}{\partial C}$ . To match the rate of loss change of the target model, the growth operator needs to reproduce the same scale of model updates, which are controlled by the update rule of the optimizer. Using the ADAM (Kingma & Ba, 2014) optimizer as an + +example², the update rules are + +$$ +\begin{array}{l} m _ {t} = \beta_ {1} * m _ {t - 1} + (1 - \beta_ {1}) g _ {t} \\ v _ {t} = \beta_ {2} * v _ {t - 1} + (1 - \beta_ {2}) g _ {t} ^ {2} \tag {4} \\ \theta_ {t + 1} = \theta_ {t} - \frac {\lambda (t)}{\sqrt {v _ {t}} + \epsilon} m _ {t} \\ \end{array} +$$ + +where $g$ and $g^2$ are the first-order gradients and the element-wise squared first-order gradients, $m$ is the first moment (average of $g$ ), $v$ is the second moment (average of $g^2$ ), $\beta_1, \beta_2, \in [0,1)$ are the exponential decay rates for the moment estimates, $\epsilon$ is a small constant, and $t$ is the time-step. For the grown model to be updated at a rate similar to that of the target model, it needs to match its learning rate $\lambda(t)$ which we discuss in the next section. It also needs to produce an optimizer state $m, v$ that's compatible with the gradients of the grown model, $g(\mathbb{G}(\phi))$ and $g^2(\mathbb{G}(\phi))$ . Given that $m, v$ are averages of $g, g^2$ , we argue that $m, v$ should be grown with growth operators $\mathbb{G}_m$ , $\mathbb{G}_v$ that satisfy the following properties: + +$$ +g \left(\mathbb {G} _ {m} (\phi)\right) = \mathbb {G} _ {m} (g (\phi)) \tag {5} +$$ + +$$ +g ^ {2} \left(\mathbb {G} _ {v} (\phi)\right) = \mathbb {G} _ {v} \left(g ^ {2} (\phi)\right) \tag {6} +$$ + +The first condition states that the "gradients of the grown model" should match "growing the gradients of the original model". The second condition is similar but for the squared gradients. To satisfy Eq. 5 and 6, the implementations of $\mathbb{G}_m$ , $\mathbb{G}_v$ are slightly different from $\mathbb{G}$ . For the width growth operator, some of the weights need to be scaled by $0.5x$ or $0.25x$ to account for the $2x$ scaling in the forward pass (see Section 3.1). For the depth growth operator, we copy $m$ and $v$ for the original model layers and set $m$ and $v$ to zero for the identity layers. + +Along with the loss-preserving property, the training dynamics preserving property ensures that the new optimizer state is compatible with the grown model weights. + +Learning rate To match training dynamics, the learning rate schedule of the grown model must match that of the target model. The intuition is that our growth operators allow the model state to "jump" from the loss curve of the original model $\mathcal{L}(\phi_{orig},C)$ to $\mathcal{L}(\phi_{target},C)$ at a point with loss $L_{\mathbb{G}}$ . Because our growth operator is loss preserving, the loss $L_{\mathbb{G}}$ defines two points on the loss curves, PRE-GROWTH on $\mathcal{L}(\phi_{orig},C)$ and GROWTH-TARGET on $\mathcal{L}(\phi_{target},C)$ . To match the training dynamics of $\mathcal{L}(\phi_{target},C)$ , we start training the grown model with a learning rate schedule that matches the target model + +but starts from GROWTH-TARGET. We discuss finding that matched GROWTH-TARGET point in Section 4 and 5. + +# 4. Optimal Schedule + +Prior work (Gu et al., 2021; Gong et al., 2019) used heuristics to determine the training schedule. In contrast, our goal is to find the optimal training schedule. An optimal training schedule is one that, given a target model size, specifies the optimal sequence of growth operators, intermediate model sizes, and number of training steps in each stage leading to the most compute saving. This section will explain our intuition behind our optimal schedule, then explains how to mathematically find it. + +Training to OPTIMALITY We start from the scaling laws (Kaplan et al., 2020), which showed that the training of transformer language models is initially efficient with fast loss reduction, then the compute-efficient regime ends and the rate of the loss reduction slows down. In addition, the initial compute-efficient regime is longer for larger models. These ideas are illustrated in Figure 1 where $\frac{\partial\mathcal{L}}{\partial C}$ is initially large then it slows down. As shown in Kaplan et al. (2020) and Li et al. (2020b), the optimal compute allocation should favor a large model size and stop the training by the end of the initial compute-efficient regime when $\frac{\partial\mathcal{L}}{\partial C} = \tau_{opt}$ , where $\tau_{opt}$ is some threshold. We call this training to "Optimality" as opposed to training to "Completion" or to convergence. We follow this setup because it is used by most modern large language models, (e.g. GPT-3(Brown et al., 2020) and Gopher (Rae et al., 2021)) which is the main use case for staged training. We discuss later this section how to find the point of OPTIMALITY using constrained optimization in an idealistic scenario, then later in Section 5 using a more practical method that estimates $\tau_{opt}$ . + +Intermediate Stages We next discuss where in training to grow a model. Intuitively, the optimal schedule is one where the original small model is trained until its compute-efficient regime ends, then grown to a larger model to continue its compute-efficient regime. Figure 1 highlights one such potential schedule. Notice that there's a specific point on the loss curve of the original model that leads to the most compute saving; growing the model earlier means a wasted opportunity skipping some of the fast loss reduction stage of the original model, and growing the model later means wasting compute by continuing to train after the loss of the original model begins to plateau. + +Schedule which minimizes compute Next, we describe how to mathematically find this optimal schedule. For that, we use the scaling laws (Kaplan et al., 2020) which derived empirical fits for the language model loss $L$ as it relates + +to compute $C$ , number of non-embedding parameters $N$ , number of gradient update steps $S$ , and batch size $B$ . The total compute and the loss are given by + +$$ +C \approx 6 N B S, +$$ + +$$ +L (N, S) = \left(\frac {N _ {c}}{N}\right) ^ {\alpha_ {N}} + \left(\frac {S _ {c}}{S}\right) ^ {\alpha_ {S}} \tag {7} +$$ + +where $\alpha_{N},\alpha_{S},\alpha_{B},N_{c},S_{c},B_{*}$ are all model-specific constants. Thus, finding the optimal schedule can be formulated as a constrained optimization problem. The output is the intermediate model sizes, and the amount of compute for each stage. We discuss the details in Appendix C. + +# 5. Practical Schedule + +While the general scaling laws are known, re-estimating their constants $(\alpha_{N},\alpha_{S},\alpha_{B},N_{c},S_{c},B_{*})$ for our setup is challenging because it requires running a large number of models of different sizes. Instead of estimating all the constants, we make the observation that we only need to find three key points: + +- PRE-GROWTH $\in \mathcal{L}(\phi_{orig}, C)$ at which we grow the original model +GROWTH-TARGET $\in \mathcal{L}(\phi_{\text{target}}, C)$ that the model is grown towards to +- OPTIMALITY $\in \mathcal{L}(\phi_{\text{grown}}, C)$ at which we stop training the grown model. + +Next we discuss the mathematical definition of each point, how to find them, and how to use them in the actual training procedure. + +PRE-GROWTH and OPTIMALITY points We define PRE-GROWTH and OPTIMALITY using the slope of the loss curve, as they depend on the rate of change of the loss. Formally, + +$$ +\text {P R E - G R O W T H}: \frac {\partial}{\partial C} \mathcal {L} \left(\phi_ {\text {o r i g}}, C\right) = \tau_ {\mathbb {G}} \tag {8} +$$ + +$$ +\begin{array}{c} \text {O C} \\ \text {O P T I M A L I T Y}: \frac {\partial}{\partial C} \mathcal {L} (\phi_ {\text {g r o w n}}, C) = \tau_ {\text {o p t}} \end{array} +$$ + +where $\tau_{\mathbb{G}}$ and $\tau_{opt}$ are empirically estimated thresholds. + +Importantly, both thresholds are independent of the model size, and this independence can be derived from Eq. $7^{4}$ . We also empirically confirmed the model-size independence by training many models of different sizes; reconfirming results from Kaplan et al. (2020), the shape of the loss curves for different sized models were similar, just shifted and scaled. Additionally, while both thresholds are model-size independent, $\tau_{\mathbb{G}}$ is a function of the growth operator. + +GROWTH-TARGET point The importance of the GROWTH-TARGET point is that it specifies the learning rate schedule of the grown model (Section 3.3). We will specify GROWTH-TARGET using the number of training steps $S_{\text{GROWTH-TARGET}}$ . We found that it can be simply defined using + +$$ +S _ {\text {G R O W T H - T A R G E T}} = \rho \times S _ {\text {P R E - G R O W T H}} \tag {9} +$$ + +where $\rho$ is an empirically estimated constant, and $S_{\mathrm{PRE - GROWTH}}$ is number of training steps at PRE-GROWTH. + +As above, and knowing that the loss curves of models of different sized models are scaled and shifted versions of each other, we can use Eq. 7 to show that $\rho$ is independent of the model size, and it is only a function of the growth operator. We also verified this empirically using different model sizes. + +Estimating $\tau$ and $\rho$ Given that equations 8 and 9 are independent of model sizes, it is enough to estimate the values of $\tau$ and $\rho$ using small models. To estimate them, we first identify the three necessary points. Specifically, for a single growth operator, we train an original model and a target model from scratch then follow the intuition discussed in Section 4 to choose a PRE-GROWTH point (on $\mathcal{L}(\phi_{orig},C)$ ) and an OPTIMALITY point (on $\mathcal{L}(\phi_{target},C)$ ). The GROWTH-TARGET point is simply the point on $\mathcal{L}(\phi_{target},C)$ with the same loss at PRE-GROWTH. A plot like Figure 1 (and the more detailed Figure 5) makes it easy to manually identify the three points, and we leave it to future work to automatically find these points. + +Notice that this method required training a target model from scratch, but in practice we can estimate the constants once for smaller model sizes and apply them to larger sizes. Using the identified points, we use equations 8 and 9 to estimate values of $\tau_{\mathbb{G}}$ and $\rho$ for each growth operator, and the value of $\tau_{opt}$ . The empirical values we estimated are in Appendix D. Notice that estimating these constants is much simpler than estimating all the constants of the scaling laws $(\alpha_N, \alpha_S, \alpha_B, N_c, S_c, B_*)$ making this procedure simpler to apply to a new setup. + +Training Procedure Algorithm 1 summarizes the staged training procedure. Notice that it extends it to the $M$ stage case. The algorithm starts with the model $\phi$ , trains it from scratch until PRE-GROWTH, grows the model, sets number of steps for the grown model, and repeats until no more stages, then continues training to OPTIMALITY. + +# 6. Experiments + +In this section we present our main empirical results, focusing on the amount of compute saving. We show results + +Algorithm 1 Staged training for transformer LMs +Input: + $\phi$ original model + $\lambda (t)$ : learning rate schedule + $M$ number of stages + $(\mathbb{G}_i,\tau_{\mathbb{G},i},\rho_{\mathbb{G},i})$ : (growth op, $\tau ,\rho$ ) for stage i + $\mathbb{G}_1$ : first stage operator assumed to be identity operator + $\tau_{opt}$ : last stage's $\tau$ +Begin: + $t\gets 0$ // number of training steps +for $i = 1$ to $M$ do if $i = M$ then $\tau \leftarrow \tau_{opt}$ // last stage, stop at optimality else $\tau \leftarrow \tau_{\mathbb{G},i}$ +end if while $\frac{\partial}{\partial C}\mathcal{L}(\phi ,C)\leq \tau$ do Run training step and update $\phi$ $t\gets t + 1$ // update learning rate using $\lambda (t)$ +end while $\phi \leftarrow \mathbb{G}(\phi)$ $t\gets t\times \rho_{\mathbb{G},i}$ // set learning rate for next stage +end for +return $\phi$ + +on in-domain data (validation loss) and in the zero-shot transfer setting. We also compare our work to prior work in growing transformer language models, establishing that previous methods fall short in one or more areas. + +# 6.1. Experimental setting + +We experiment with GPT2 from (Radford et al., 2019) (in base and large sizes) using the public C4 (Raffel et al., 2020) dataset. We follow the learning rate schedule in Kaplan et al. (2020) for all model sizes, where the warmup period is set to 3,000 steps, the batch size is set to 512 and the sequence length is 1,024. For the zero-shot transfer learning, we experiment on two tasks: Wikitext-103 (Mery et al., 2017) and LAMBADA (Paperno et al., 2016), similar to (Li et al., 2021). We report the compute saving for in-domain validation loss and zero-shot performance. We compare our practical schedule in Section 5 with the manual schedule that directly matches the loss of the PRE-GROWTH model with the target model to select the GROWTH-TARGET point. We choose and report different thresholds to decide the OPTIMALITY of the training in each stage. + +# 6.2. Main results + +Figure 1 shows the compute saving for growing $\mathrm{GPT2}_{\mathrm{LARGE}/4}$ original model to a target model of + +
GPT2LARGEGPT2BASE
5k10k14k3.75k7k11k
Baseline(loss)3.213.032.973.613.453.38
Compute savings (percent saved vs. baseline)
1 stage manual2xW19.35.64.023.814.513.8
2xD33.57.86.324.023.621.8
1 stage practical2xW22.57.35.224.320.219.7
4xW18.05.33.816.08.65.5
2xD37.011.06.124.720.419.8
4xD22.57.35.218.810.16.4
2xDxW28.85.43.819.09.56.83
2 stage practical2x2xW26.810.97.826.817.911.4
2x2xD30.014.510.433.321.415.9
+ +Table 1: Percentage compute savings for GPT2Large and GPT2BASE on in-domain validation loss on C4, “W” is width and “D” is depth growth operators. Percent savings is how much less compute our approach takes than the baseline to train a model to equal or better loss than the baseline. Significant savings can be found using our both width and depth growth operators, and two growth stages can lead to even more savings than one growth stage. The derivative threshold at 5k steps is -0.1, at 10k steps it's -0.05, and at 14k steps it's -0.04; thus, 5k is undertrained, 10k is approximately at the optimality threshold of -0.052, and 14k is trained beyond optimality. Similar for GPT2BASE. + +GPT2 $_{\text{LARGE}}$ (we show the results of other combinations of growth operators and the results of growing to GPT2 $_{\text{BASE}}$ in Appendix A in Figure 5). It is clear that our grown models are reaching the same loss as the target models but with less compute. It is important to note that as both models train longer, the amount of compute saving drops. This illustrates a key design in our schedule where we stop training of the grown model at OPTIMALITY when the compute-efficient regime ends. Figure 1 also demonstrates that small models achieve better loss trade-off when the total compute is limited, but saturate at higher loss when more compute is added, highlighting the advantages of our schedule in applying the growth operator to them before convergence. + +Table 1 shows the amount of compute saving of our growth operators for two different model sizes. The table shows that our grown model reaches the same performance of the baseline (target model) trained from scratch while having considerable compute saving ranging from $30\%$ to $5\%$ for different thresholds. The first row in Table 1 denotes the number of steps we used to train the baseline model. Given that our growth operator is loss-preserving and training-dynamic preserving, we can always reach the same loss of the target model with less compute and the compute saving becomes larger when we decide to stop the target model earlier. Also, given the same growth ratio (4x growth), the depth growth operator is preferable versus width concerning the compute saving. + +We also evaluate our pretrained models on other language modeling tasks in the zero-shot setting to verify that the grown models maintain their transfer learning capabilities. Table 2 shows results on Wikitext-103 and LAMBADA. It can be seen that using our practical schedule, we achieve comparable and sometimes better performance versus using the manual schedule for both in-domain loss and zero-shot transfer learning. In some cases we have negative compute saving with the width operator or when combing the width and depth operator on zero-shot transfer learning tasks early in training (indicating the grown model used more compute to get to the same (or better) performance), but the compute saving is always positive when training for longer. We assume that this is due to instabilities in optimization right after applying the growth operator. When the training proceeds, the zero-shot performance will shortly recover and the grown models will have better positive compute saving at OPTIMALITY for the two model sizes. It is also less of an issue for the base model size as GROWTH-TARGET. Moreover, the depth growth operator leads to better performance compute saving trade-off compared to the width operator under the same growth ratio. Finally, we show that applying the growth operator twice (in two stages) lead to the best-performing compute saving and performance. See Figure 7 for detailed evaluation plots. + +# 6.3. Ablations and prior work comparison + +We experiment with prior work and conduct ablation studies for our method. We show that prior works fall short in one or more of the key components of our proposed method; preserving loss, preserving training dynamics, or following an optimal schedule. + +Prior work comparison. We evaluate against two growth operators from previous work (Gu et al., 2021; Gong et al., 2019); one uses weight sharing to make a feedforward network module wider, and the other makes an entire network deeper. Given the nature of these growth operators, the grown models do not represent the same function as the original model; as shown in Figure 3, neither retain the same loss as the original model, and thus they do not satisfy our loss-preserving property. This directly translates to wasted compute; our width grown saves $13.8\%$ while that of Gu et al. (2021) wastes more compute than it saves. Similarly, out depth operator saves $21.8\%$ while that of Gong et al. (2019) saves $9.6\%$ because it is not loss preserving (starts at a higher loss and wastes compute to recover). + +Prior work also mostly ignored the optimizer state. In Figure 3, we explore this as an ablation by simply setting the optimizer state to zero for our width and depth growth operators. Though the loss can be retained at the starting + +
Zero-shot Wikitext-103 (PPL)Zero-shot LAMBADA (accuracy)
GPT2LARGE5k10k14k3.75k7k11kGPT2LARGE5k10k14k3.75k7k11k
Baseline41.032.330.368.557.150.039.643.244.731.133.034.7
+ +Compute savings (percent saved vs. baseline, negative means more compute than baseline) + +
1 stage manual2xwidth-18.56.25.8-19.70.32.43.26.78.3-8.30.213.6
2xdepth28.511.812.024.028.017.333.516.813.824.022.918.2
1 stage practical2xwidth-20.5-0.258.7-15.75.93.8-15.512.314.8-15.73.310.6
4xwidth-13.41.37.4-12.01.16.4-11.018.018.2-12.010.18.6
2xdepth32.013.511.431.333.517.532.023.521.424.716.813.9
4xdepth21.017.59.514.67.93.121.020.514.614.69.47.8
2xdepthxwidth-10.5-0.31.6-12.03.64.5-95.0-37.50.75.46.46.4
2 stage practical2x2xwidth-2.56.39.33.35.48.0-3.313.420.3-3.31.811.8
2x2xdepth30.012.512.833.314.311.819.014.523.619.910.615.0
+ +Table 2: Percentage compute savings for GPT2_LARGE and GPT2_BASE on out-of-domain Wikitext-103 (perplexity) and LAM-BADA (accuracy). Percent savings is how much less compute our approach takes than the baseline to train a model to equal or better perplexity or accuracy than the baseline; negative numbers mean our approach took more compute than the baseline to achieve equal or better performance. Results are mixed in the early stages of training, but our approach leads to compute savings for all experiments later in training (14k for large, 11k for base). The derivative threshold at 5k steps is -0.1, at 10k steps it's -0.05, and at 14k steps it's -0.04; thus, 5k is undertrained, 10k is approximately at the optimality threshold of -0.052, and 14k is trained beyond optimality. Similar for GPT2_BASE. + +pointing for the grown model, the training dynamic becomes extreme unstable after applying the growth operators, and thus such a growth operator will not have the training-dynamics-preserving property. + +Ablation studies We further perform two ablation studies concerning the learning rate schedule and growth schedule in Figure 3. For the learning rate schedule, we compare our setting of the learning rate to the GROWTH-TARGET point with restarting the learning rate schedule as in Rae et al. (2021). Figure 3c shows that resetting the learning rate schedule leads to much unstable training dynamics that are not aligned with the GROWTH-TARGET. Additionally, Figure 3d shows that it wastes more compute than it saves (red curve intersects blue). + +For the growth schedule, we experiment with growing the small model earlier or later than the GROWTH-TARGET point computed with our proposed practical schedule. Figure 3d shows that growing the model too late/early is still loss-preserving and training-dynamics-preserving but the grown models lose the compute saving advantages (brown and purple curves are higher than green). + +Training to completion vs. to OPTIMALITY. While training to OPTIMALITY is not one of our contributions, it is an important part of our training schedule. Here we compare our models in Table 2 with equivalent models + +trained to completion5. In Radford et al. (2019), GPT2BASE trained to completion achieves 37.5 PPL on Wikitext-103 and 45.9 accuracy on LAMBADA. Our best-performing 2x2xdepth grown GPT2LARGE model achieves the same PPL on Wikitext-103 as this model with only $15\%$ of the compute and the same accuracy as the this model on LAMBADA with $33\%$ of the compute. Notice that we are comparing different model sizes, a large model trained to OPTIMALITY vs. a smaller model trained to completion. + +# 7. Related Work + +Perhaps the most similar prior work is (Gu et al., 2021). However, this work did not provide a method to decide when to apply a growth operator and instead evaluated the performance of their operators at 100/300/500/700K steps of a small model, or applied a heuristic to equally distribute training steps among different model sizes. They did not discuss the optimizer state, and they reset the learning rate to the maximum value of 1e-4 at the beginning of each state without warmup. Their work built on progressive stacking (discussed below), and their proposed method to grow the width only grew the feed-forward layers instead of the entire model width. + +![](images/6d80be484822aea2a60634ff0614aea3e74409a064834d30ed6744d6e7e8490e.jpg) +(a) Width op. and optimizer + +![](images/c0bb88b67954098b8f92aff0a28c6180d772dd6c46e64daff8c86f3823dc71a4.jpg) +(b) Depth op. and optimizer +Figure 3: Comparing with three different baselines from prior work and ablation studies. The width growth operator of Gu et al. (2021) in $\mathrm{GPT2_{BASE} / 4x4width}$ and the depth growth operator of Gong et al. (2019) in $\mathrm{GPT2_{BASE} / 2x2depth}$ copy are not loss preserving (higher initial loss). Also, $\mathrm{GPT2_{BASE} / 4x4width}$ is significantly underperforming the target model $\mathrm{GPT2_{BASE}}$ . Resetting the optimizer state to zero instead of growing it (the zero_opt runs) have large instabilities and not preserving of the training dynamics. 3c shows that restarting the learning rate schedule as in Rae et al. (2021) is not training-dynamics-preserving. 3c, 3d also show that not following our optimal schedule and grow the model too early or too late is still loss-preserving and training-dynamics-preserving but leads to lower compute saving. + +![](images/ca2f814359d2f00fe85dc8870300bcdbf5f82e38a15b497cfd9ae5b177a62155.jpg) +(c) LR and optimal schedule + +![](images/4e0de531fbe2cfef068aa3f437e90967588a706c3c4b5d167b8498b1c1863aa1.jpg) +(d) LR and optimal schedule + +(Gong et al., 2019) proposed "progressive stacking" which doubles the depth of a BERT transformer model by copying layers; to construct a $2L$ -layer model from a $L$ layer model it copies layer $i \leq L$ in the smaller model to layer $(i + L)$ in the larger model. The optimizer state is reset at the beginning of each stage, but the learning rate is kept the same as the prior stage. They use heuristics to set the stacking schedule: 50K steps for 3-layer, 70K steps for 6-layer model, 280K steps for 12-layer model. In an ablation study they examined the sensitivity to the number of steps before applying their growth operator and concluded that there is a threshold number of steps and for switching times such that switching to the larger model before the threshold led to compute savings, but switching after the threshold didn't. This is consistent with our results that showed the amount of compute saving is closely related to the stage length. + +(Li et al., 2020a) proposed growing encoder-decoder transformers in the context of training a machine translation system. Their depth growth operator is identical to progressive stacking, although they explore operations that increase the model by only copying some of the layers from the small to large model (e.g. growing from 12 to 18 layers). They do not mention optimizer state, and reset the learning rate to max value at each stage. + +In contemporaneous work, Gopher (Rae et al., 2021) and Chinchilla (Hoffmann et al., 2022) introduced a method which tiles the weights from a small model to a larger one. However, their growth operator does not satisfy our two properties from Section 2, and they focus on training their models to completion. Evci et al. (2022) proposes a way to initialize the grown weights by maximizing the gradient norm of the new weights for vision models. Their growth operator also requires specified activation functions + +that can not be directly applied to transformers. Finally, Li et al. (2021) proposed applying a curriculum learning strategy to the sequence length to reduce the training cost when training large language models. Their work is orthogonal to our method and our methods could be combined; we leave this to future work. + +# 8. Conclusion and future work + +One direction of future work is to combine batch size warmup (Brown et al., 2020) and sequence length growth (Li et al., 2021) with our depth and width growth operators. Another applies our proposed methods to train a massive transformer. + +We presented a staged training method for large transformer-based language models that grows the model size during training. We demonstrated the importance of two properties of the growth operators (loss-preserving and training-dynamics-preserving), and provided depth and width operators that satisfy both requirements. Finally, we devised a principled method that connects LM scaling laws (Kaplan et al., 2020) and our two properties to find a provably optimal time (during training) to grow the model, and how to sufficiently re-estimate the necessary components of the scaling laws in practice leading to the maximum compute saving. Empirical evaluations show up to $22\%$ compute saving. + +# References + +Brown, T. B., Mann, B., Ryder, N., Subbiah, M., Kaplan, J., Dhariwal, P., Neelakantan, A., Shyam, P., Sastry, G., Askell, A., Agarwal, S., Herbert-Voss, A., Krueger, G., Henighan, T., Child, R., Ramesh, A., Ziegler, D. M., Wu, + +J., Winter, C., Hesse, C., Chen, M., Sigler, E., Litwin, M., Gray, S., Chess, B., Clark, J., Berner, C., McCandlish, S., Radford, A., Sutskever, I., and Amodei, D. Language models are few-shot learners. In Neural Information Processing Systems (NeurIPS), 2020. +Chen, T., Goodfellow, I., and Shlens, J. Net2net: Accelerating learning via knowledge transfer. In International Conference on Learning Representations, 2016. +Evci, U., Vlademyrov, M., Unterthiner, T., van Merrienboer, B., and Pedregosa, F. Gradmax: Growing neural networks using gradient information. arXiv preprint arXiv:2201.05125, 2022. +Gong, L., He, D., Li, Z., Qin, T., Wang, L., and Liu, T. Efficient training of bert by progressively stacking. In International Conference on Machine Learning, pp. 2337-2346. PMLR, 2019. +Gu, X., Liu, L., Yu, H., Li, J., Chen, C., and Han, J. On the transformer growth for progressive bert training. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 5174-5180, 2021. +Hoffmann, J., Borgeaud, S., Mensch, A., Buchatskaya, E., Cai, T., Rutherford, E., Casas, D. d. L., Hendricks, L. A., Welbl, J., Clark, A., et al. Training compute-optimal large language models. arXiv preprint arXiv:2203.15556, 2022. +Kaplan, J., McCandlish, S., Henighan, T., Brown, T. B., Chess, B., Child, R., Gray, S., Radford, A., Wu, J., and Amodei, D. Scaling laws for neural language models, 2020. +Kingma, D. P. and Ba, J. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. +Li, B., Wang, Z., Liu, H., Jiang, Y., Du, Q., Xiao, T., Wang, H., and Zhu, J. Shallow-to-deep training for neural machine translation. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 995-1005, Online, November 2020a. Association for Computational Linguistics. doi: 10.18653/v1/2020.emnlp-main.72. URL https://aclanthology.org/2020.emnlp-main.72. +Li, C., Zhang, M., and He, Y. Curriculum learning: A regularization method for efficient and stable billion-scale gpt model pre-training. arXiv preprint arXiv:2108.06084, 2021. +Li, Z., Wallace, E., Shen, S., Lin, K., Keutzer, K., Klein, D., and Gonzalez, J. Train big, then compress: Rethinking + +model size for efficient training and inference of transformers. In International Conference on Machine Learning, pp. 5958-5968. PMLR, 2020b. +Liu, Q., Wu, L., and Wang, D. Splitting steepest descent for growing neural architectures. Advances in neural information processing systems, 2019. +Merit, S., Xiong, C., Bradbury, J., and Socher, R. Pointer sentinel mixture models. In International Conference on Learning Representations, 2017. +Paperno, D., Kruszewski, G., Lazaridou, A., Pham, Q. N., Bernardi, R., Pezzelle, S., Baroni, M., Boleda, G., and Fernández, R. The lambada dataset: Word prediction requiring a broad discourse context. In ACL, 2016. +Peters, M. E., Neumann, M., Iyyer, M., Gardner, M., Clark, C., Lee, K., and Zettlemoyer, L. Deep contextualized word representations. In Proc. of NAACL, 2018. +Press, O., Smith, N. A., and Lewis, M. Shortformer: Better language modeling using shorter inputs. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing, 2020. +Radford, A., Wu, J., Child, R., Luan, D., Amodei, D., Sutskever, I., et al. Language models are unsupervised multitask learners. OpenAI blog, 1(8):9, 2019. +Rae, J. W., Borgeaud, S., Cai, T., Millican, K., Hoffmann, J., Song, F., Aslanides, J., Henderson, S., Ring, R., Young, S., et al. Scaling language models: Methods, analysis & insights from training gopher. arXiv preprint arXiv:2112.11446, 2021. +Raffel, C., Shazeer, N., Roberts, A., Lee, K., Narang, S., Matena, M., Zhou, Y., Li, W., and Liu, P. J. Exploring the limits of transfer learning with a unified text-to-text transformer. Journal of Machine Learning Research (JMLR), 21(140), 2020. +Rusu, A. A., Rabinowitz, N. C., Desjardins, G., Soyer, H., Kirkpatrick, J., Kavukcuoglu, K., Pascanu, R., and Hadsell, R. Progressive neural networks. arXiv preprint arXiv:1606.04671, 2016. +Schwartz, R., Dodge, J., Smith, N. A., and Etzioni, O. Green AI. Communications of the ACM (CACM), 63 (12):54-63, November 2020. ISSN 0001-0782. doi: 10.1145/3381831. URL https://doi.org/10. 1145/3381831. +Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, L., and Polosukhin, I. Attention is all you need. In Proceedings of the 31st International Conference on Neural Information Processing Systems, pp. 6000-6010, 2017. + +Wei, T., Wang, C., Rui, Y., and Chen, C. W. Network morphism. In International Conference on Machine Learning, pp. 564-572. PMLR, 2016. + +(a) Width growth with GPT2LARGE as target +![](images/5dde55f1d97fc13f94ca8f059378384d779168d61c81ab44e7fd7ee8e60efc16.jpg) +GPT2 $\mathrm{LARGE / 16x16 - }$ width indicates starting from a 16x smaller model then growing it 16x by doubling the width twice. + +(b) Depth growth with GPT2LARGE as target +Figure 4: Similar to Figure 2, our width and depth growth operators are loss-preserving and training dynamics preserving. +![](images/7d25655b23fbdab389f083340a08d160f1cd0f1f3e630efbdcf3e9a7e449a788.jpg) +- GPT2 $_{\text{LARGE}/16x4x4\text{-WIDTH}}$ indicates growing the model 16x over two stages, by doubling the width once, continue training the model, then doubling the width again. The same applies to the depth growth operator. + +# A. Additional Plots and Results + +In Figure 4 and 5, we show loss curve plot and compute plot for applying growth operator to $\mathrm{GPT2}_{\mathrm{BASE}}$ model. These suggest our growth operator is loss-preserving, training dynamic preserving and saves compute to train the target BASE size model. + +In Figure 6, we demonstrate the loss curve and derivatives regarding the validation loss and compute in log scale. It clearly shows the used practical threshold gives us a good estimate of the OPTIMALITY of the loss curve. The first derivative is found empirically using the slope of the learning curve at each point. + +In Figure 7, we present the evaluation results for every checkpoints across the steps for target and grown GPT2BASE model. The performance of the GPT2BASE/2x2depth can always perform on par with or better than the baseline while GPT2BASE/4x4width underperforms baseline in the initial phase after growing but can catch up quickly. This also explains the potential negative compute we have in the main text in the early phase of the evaluation and better compute saving at OPTIMALITY. + +# B. Model Architecture + +We use GPT2BASE and GPT2LARGE models. For GPT2BASE model, it consists of 12 layers, 768 hidden dimensions, 12 heads and 125M parameters. For GPT2LARGE model, it consists of 24 layers, 1536 hidden dimensions, 16 heads and 760M parameters. + +# C. Optimal Stage Schedule + +This appendix defines a constrained optimization problem that produces the optimal staged-training schedule. The scaling laws of Kaplan et al. (2020) derived empirical fits for the language model loss $L$ as it relates to the total amount of compute $C$ , number of non-embedding parameters $N$ , number of gradient update steps $S$ , and batch size $B$ . The total compute6 is given by + +$$ +C \approx 6 N B S, \tag {10} +$$ + +and the loss $L$ for any model size $N$ and number of steps $S$ is given by: + +$$ +L (N, S) = \left(\frac {N _ {c}}{N}\right) ^ {\alpha_ {N}} + \left(\frac {S _ {c}}{S}\right) ^ {\alpha_ {S}} \tag {11} +$$ + +![](images/c35cd3b35b2dd27ecfa3e6aef0bf9240f25ffc2c5a4e13b93e4a0fc47fe02e67.jpg) +(a) Width growth with GPT2LARGE as target + +![](images/014626900058e3000e209303c85ba92e21cfa00ee17455669e5f63cab8f443cb.jpg) +(b) Width growth with GPT2BASE as target + +![](images/8a57b05fd4f2253316e553f5474552a5c34be2d837b23f5eaf12dc88eb2b7d98.jpg) +(c) Depth growth with GPT2Large as target + +![](images/9d724f4128fc8065c05b62b278d9844a12ec92b28dd333e955a529527b4ed885.jpg) +(d) Depth growth with GPT2BASE as target +Figure 5: Growth operator and total compute. Our grown models are saving compute compared with target model. + +when training at the critical batch size $B_{crit} = \frac{B_*}{L^{1 / \alpha_B}}$ , and where $\alpha_N, \alpha_S, \alpha_B, N_c, S_c, B_*$ are all model-specific constants. + +Our goal is to minimize the total compute to train a model of a given size $N_{target}$ to a given target loss $L_{target}$ . We assume we have access to perfect growth operators that are loss-preserving and training dynamics-preserving, and that can grow from any model size to any other size7. We consider a training regime consisting of a number of stages. In each stage $k$ we train a model with size $N_{k}$ for $S_{k}$ gradient steps, with the goal of reaching size $N_{target}$ and achieving a target loss $L_{target}$ at the end of the final stage. We assume that $N_{k} \geq N_{k-1}$ , and that there exists some way to initialize the model with size $N_{k}$ from one of size $N_{k-1}$ without changing the loss. For simplicity, we neglect the batch size contribution to compute, and assume training is always at the critical batch size $B_{*} / L_{target}^{1/\alpha_{B}}$ . + +With these assumptions the total compute at the end of training for $M$ stages is: + +$$ +C = \sum_ {k = 1} ^ {M} 6 N _ {k} \frac {B _ {*}}{L _ {\text {t a r g e t}} ^ {1 / \alpha_ {B}}} S _ {k} \tag {12} +$$ + +We can compute the loss at the end of each stage in an iterative fashion. The loss at the end of the first stage is given by $L_{1}(N_{1},S_{1})$ from Eqn. 11. Then for each subsequent stage, we assume the loss curves can be translated and the loss at the end of stage $k$ is computed by starting with the loss at the end of the prior stage and decreased for $S_{k}$ steps. To do so, first compute the effective number of steps $S_{eff,k}$ needed to reach initial loss for the stage $L_{k-1}$ with model size $N_{k}$ , and then + +![](images/9198d28f3a29e4d106e7601063e193d25eea4705b9fc3baf60c9ad15cd4d4c5d.jpg) +(a) First derivative on the validation loss curve for $\mathrm{GPT2_{BASE}}$ and $\mathrm{GPT2_{LARGE}}$ . This is an approximation to the training dynamics $\frac{\partial\mathcal{L}}{\partial C}$ . + +Figure 6: 6a shows the first derivative of the validation loss curve for $\mathrm{GPT2}_{\mathrm{BASE}}$ and $\mathrm{GPT2}_{\mathrm{LARGE}}$ . The horizontal dotted lines show the empirical value of the derivative threshold we use to identify the point of OPTIMALITY. 6b shows how the threshold value in 6a maps to a point in the loss curve for both model sizes (the first vertical line for $\mathrm{GPT2}_{\mathrm{BASE}}$ and the second for $\mathrm{GPT2}_{\mathrm{LARGE}}$ ). Both points show slowed training and the end of the compute-efficient regime. +![](images/b59e3d82d92974253268a3456dff9880bf5c71dc3c8684eeb1b8ab04c26f4209.jpg) +(b) Validation loss curve for GPT2_BASE and GPT2 LARGE + +compute the loss at the end of the stage by $L_{k}(N_{k}, S_{eff,k} + S_{k})$ . In summary: + +$$ +L _ {1} = \left(\frac {N _ {c}}{N _ {1}}\right) ^ {\alpha_ {N}} + \left(\frac {S _ {c}}{S _ {1}}\right) ^ {\alpha_ {S}} +$$ + +$$ +{L _ {k}} = {\left(\frac {N _ {c}}{N _ {k}}\right) ^ {\alpha_ {N}} + \left(\frac {S _ {c}}{S _ {e f f , k} + S _ {k}}\right) ^ {\alpha_ {S}}, k > 1} +$$ + +$$ +{S _ {e f f, k}} = {\frac {S _ {c}}{(L _ {k - 1} - (N _ {c} / N _ {k}) ^ {\alpha_ {N}}) ^ {1 / \alpha_ {S}}}.} +$$ + +With this in hand, we can use a constrained optimizer to solve for the optimal schedule by minimizing Eqn. 12, subject to the constraint that the final model size is the target size, and loss at the end of training is the target loss. Formally, + +$$ +\min _ {\left\{(N _ {k}, S _ {k}) \right\}} \sum_ {k = 1} ^ {M} 6 N _ {k} \frac {B _ {*}}{L _ {t a r g e t} ^ {1 / \alpha_ {B}}} S _ {k} +$$ + +![](images/fd0e8747f040d9c31fe50904cbc6d697d0e2bc5ada5f5a6be10f4f0493504cee.jpg) +(a) Wikitext-103 evaluation with $\mathrm{GPT2_{BASE}}$ as target + +![](images/e1c19ed56cdc1c6038a3622579596b4b0497f25df42f6592c60490f4b44f8168.jpg) +(b) LAMBADA evaluation with GPT2BASE as target. +Figure 7: The detailed evaluation plots on Wikitext-103 and LAMBADA for GPT2BASE trained from scratch and two grown model using depth or width operator. The performance of the GPT2BASE/2x2depth perfectly follows or even outperforms the target model, while GPT2BASE/4x4width underperforms the target model initially after growing but it catches up quickly. This explains the initial “negative” compute saving in Table 2 for the width growth operator, followed by positive compute saving as the model trains longer. + +
Number of stagesCompute reduction factor
11.0
20.83
30.792
40.779
50.771
100.763
+ +Table 3: Decrease in compute costs over an optimal single stage training regime. + +subject to + +$$ +\begin{array}{l} L _ {M} = L _ {\text {t a r g e t}} \\ N _ {M} = N _ {\text {t a r g e t}} \\ 0 < N _ {1} \\ N _ {k - 1} \leq N _ {k}, k > 1 \\ \begin{array}{r c l} 0 & \leq & S _ {k} \end{array} \\ \end{array} +$$ + +Note that in the single stage case ( $M = 1$ ) with no $N_{target}$ condition, this formulation reduces to the optimal calculation in Appendix C of Kaplan et al. (2020) to find the optimal model size to reach a target loss. This matches our training to OPTIMALITY. + +Measuring compute saving To measure the compute saving from staged training to reach a certain $L_{target}$ , we use a single staged training ( $M = 1$ ) with no $N_{target}$ condition, and use our optimization algorithm to find the optimal compute and model size; this becomes $N_{target}$ . Next, we run the optimization problem with $N_{target}$ , $L_{target}$ , and $M > 1$ to get the optimal training schedule and the expected compute, which we compare with $M = 1$ to find the expected compute saving. + +Observations An implementation of this optimization shows that the increase in compute efficiency for using multiple stages is independent of the target loss $L_{target}$ , and quickly approaches 0.76 as the number of stages increases (using the scaling parameters for autoregressive transformer language models). + +We also found that constraining the ratio between consecutive model sizes $\left(\frac{N_k}{N_{k-1}}\right)$ to be 2, 4 or 8, leads to almost the same + +
StageNkSkLkCk
12.7M15.4K4.090.0033
222.1M24.3K3.580.0154
371.9M30.8K3.310.0365
4163M36.0K3.130.0665
5306M40.5K3.000.1056
+ +Table 4: Sample optimal schedule for a five stage regime to train to $L_{target} = 3$ showing the number of non-embedding parameters $N_{k}$ , the number of gradient steps $S_{k}$ , the loss at the end of the stage $L_{k}$ , and the compute in the stage $C_k$ . +compute savings. These constraints come from the practical constraints of our implementation of the growth operators. + +# D. Practical Stage Schedule + +The empirical values we estimated for the constants are: + +$$ +\begin{array}{l} \tau_ {o p t} = - 0. 0 5 2 \\ \tau_ {d e p t h} = - 0. 0 5 7 5 \\ \tau_ {w i d t h} = - 0. 0 4 7 5 \\ \tau_ {d e p t h - w i d t h} = - 0. 0 3 \\ \rho_ {d e p t h} = 0. 7 0 \\ \rho_ {w i d t h} = 0. 5 5 \\ \rho_ {d e p t h - w i d t h} = 0. 4 0 \\ \end{array} +$$ \ No newline at end of file diff --git a/stagedtrainingfortransformerlanguagemodels/images.zip b/stagedtrainingfortransformerlanguagemodels/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..7ef8f562437907bda0ac67d6890859c2b7e83d37 --- /dev/null +++ b/stagedtrainingfortransformerlanguagemodels/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a00f29059a7a56e5499d32b8d758c2ffe9525f34950adbe3ab1316f83604099a +size 660206 diff --git a/stagedtrainingfortransformerlanguagemodels/layout.json b/stagedtrainingfortransformerlanguagemodels/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..eab71cc7772b7591585fe089c4923db34f35c746 --- /dev/null +++ b/stagedtrainingfortransformerlanguagemodels/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:31b3f74ccaed054b5c77224608ffc552562d5c7cbb3e33f69d390695ec72bdfc +size 594090 diff --git a/statetransitionofdendriticspinesimproveslearningofsparsespikingneuralnetworks/38dcfcb0-f55f-42f7-b5ab-bfc03d756cce_content_list.json b/statetransitionofdendriticspinesimproveslearningofsparsespikingneuralnetworks/38dcfcb0-f55f-42f7-b5ab-bfc03d756cce_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..af4d0ba8d86490da6796b9d6e71dc27ebc676b18 --- /dev/null +++ b/statetransitionofdendriticspinesimproveslearningofsparsespikingneuralnetworks/38dcfcb0-f55f-42f7-b5ab-bfc03d756cce_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:57b9a67045697052df600197da9f415a5c0c4ded3536e02348cf93b28b6c4f7d +size 104402 diff --git a/statetransitionofdendriticspinesimproveslearningofsparsespikingneuralnetworks/38dcfcb0-f55f-42f7-b5ab-bfc03d756cce_model.json b/statetransitionofdendriticspinesimproveslearningofsparsespikingneuralnetworks/38dcfcb0-f55f-42f7-b5ab-bfc03d756cce_model.json new file mode 100644 index 0000000000000000000000000000000000000000..e8097419039eb8e4dbe96df147e4ed89af4b1857 --- /dev/null +++ b/statetransitionofdendriticspinesimproveslearningofsparsespikingneuralnetworks/38dcfcb0-f55f-42f7-b5ab-bfc03d756cce_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0113812c7ff5099d662de2c713b7870aa514ed3375b5d528d874345bdbd35524 +size 129331 diff --git a/statetransitionofdendriticspinesimproveslearningofsparsespikingneuralnetworks/38dcfcb0-f55f-42f7-b5ab-bfc03d756cce_origin.pdf b/statetransitionofdendriticspinesimproveslearningofsparsespikingneuralnetworks/38dcfcb0-f55f-42f7-b5ab-bfc03d756cce_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..fab87f9ba1ffeee8c5c22eeab38e1c93c9988258 --- /dev/null +++ b/statetransitionofdendriticspinesimproveslearningofsparsespikingneuralnetworks/38dcfcb0-f55f-42f7-b5ab-bfc03d756cce_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cec359e4ac3c340e248afe5e81ae553c927c2f986314947fc72519d8f7bb32b3 +size 737235 diff --git a/statetransitionofdendriticspinesimproveslearningofsparsespikingneuralnetworks/full.md b/statetransitionofdendriticspinesimproveslearningofsparsespikingneuralnetworks/full.md new file mode 100644 index 0000000000000000000000000000000000000000..b5b273ced5e762c3232f02db98d4fc8c4655179d --- /dev/null +++ b/statetransitionofdendriticspinesimproveslearningofsparsespikingneuralnetworks/full.md @@ -0,0 +1,492 @@ +# State Transition of Dendritic Spines Improves Learning of Sparse Spiking Neural Networks + +Yanqi Chen $^{12}$ Zhaofei Yu $^{†123}$ Wei Fang $^{12}$ Zhengyu Ma $^{†2}$ Tiejun Huang $^{123}$ Yonghong Tian $^{†12}$ + +# Abstract + +Spiking Neural Networks (SNNs) are considered a promising alternative to Artificial Neural Networks (ANNs) for their event-driven computing paradigm when deployed on energy-efficient neuromorphic hardware. Recently, deep SNNs have shown breathtaking performance improvement through cutting-edge training strategy and flexible structure, which also scales up the number of parameters and computational burdens in a single network. Inspired by the state transition of dendritic spines in the filopodial model of spinogenesis, we model different states of SNN weights, facilitating weight optimization for pruning. Furthermore, the pruning speed can be regulated by using different functions describing the growing threshold of state transition. We organize these techniques as a dynamic pruning algorithm based on nonlinear reparameterization mapping from spine size to SNN weights. Our approach yields sparse deep networks on the large-scale dataset (SEW ResNet18 on ImageNet) while maintaining state-of-the-art low performance loss ( $\sim 3\%$ at $88.8\%$ sparsity) compared to existing pruning methods on directly trained SNNs. Moreover, we find out pruning speed regulation while learning is crucial to avoiding disastrous performance degradation at the final stages of training, which may shed light on future work on SNN pruning. + +# 1. Introduction + +Spiking neural networks (SNNs), acclaimed as the third generation of neural network models (Maass, 1997), have + +$^{1}$ National Engineering Research Center of Visual Technology, School of Computer Science, Peking University $^{2}$ Peng Cheng Laboratory $^{3}$ Institute for Artificial Intelligence, Peking University. Correspondence to: Zhaofei Yu $<$ yuzf12@pku.edu.cn>, Zhengyu Ma $<$ mazhy@pcl.ac.cn>, Yonghong Tian $<$ yhtian@pku.edu.cn>. + +Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s). + +drawn more and more attention from researchers in the past few years. Compared to artificial neural networks (ANNs), SNNs go a step further in mimicking the computing pattern of human brains. Neurons in SNNs release discrete events, namely "spikes", to communicate with each other and thereby called spiking neurons. As human brains consume only around 20W (Mink et al., 1981) while processing various complicated tasks, SNNs are also energy efficient when deployed on neuromorphic hardwares (Merolla et al., 2014; Furber et al., 2014; Ma et al., 2017; Davies et al., 2018; Pei et al., 2019). Furthermore, the spiking neuron models follow their biological counterparts and inherit complex temporal dynamics from them, endowing SNNs with a strong ability to extract spatio-temporal features on multiple tasks such as recognition (Payeur et al., 2021; Stöckl & Maass, 2021; Wu et al., 2021; Fang et al., 2021a;b), detection (Kim et al., 2020), segmentation (Kirkland et al., 2020), and tracking (Luo et al., 2019; 2021). + +Larger and deeper SNNs are demanded to handle tasks with growing scales of datasets. In the field of ANNs, large-scale datasets like ImageNet require networks with an enormous number of parameters, such as GoogLeNet (Szegedy et al., 2015) or ResNet (He et al., 2016). The situation for SNNs is similar, thereby large SNNs with the same structures like Spiking ResNet (Zheng et al., 2021; Hu et al., 2021) and SpikingGoogleNet (Zhou et al., 2021) are built. However, the number of parameters in these architectures is far beyond what neuromorphic chips can now support, especially for those with one hundred or more layers. For example, a 48-node SpiNNaker board is able to simulate networks with up to 250,000 neurons and 80 million synapses (Furber et al., 2014), which is not enough for any single network mentioned above. Therefore, pruning redundant weights in SNNs is a promising approach to deploy large networks to event-based hardware. + +The sparsification of network weights, or pruning of networks has been a flourishing area (Han et al., 2015) since deep ANNs show their power on real-life tasks. Compared with ANNs, SNNs make better use of unstructured sparsity for their event-driven nature. This is because the computation on event-driven hardware is triggered only when both incoming spikes and network weights are nonzero (Merolla + +et al., 2014), which does not require coarse-grained sparsity to reduce running costs as in ANNs. Based on the above reason, we need a feasible unstructured pruning algorithm. In previous studies of SNN pruning, researchers show a preference for existing methods from ANN pruning. These methods work well on smaller datasets like MNIST or CIFAR-10, whereas they have not been evaluated on large-scale networks or complex datasets like ImageNet. Some studies turn to biological mechanisms and propose heuristic methods. However, these techniques are more or less confined to biological facts and hence lack rationality from the perspective of sparse optimization. + +In this paper, we develop a reparameterization framework from the size of the spine to the real connection weights based on the state transition of the dendritic spine in the neural system, enabling us to prune connections of SNNs. Our modeling facilitates the sparsification of deep SNNs while maintaining low performance loss, reaching the state-of-the-art balance between accuracy and sparsity on large-scale datasets. Furthermore, we show the importance of scheduling threshold between the state "mature spine" and the state "filopodium" by extensive experiments on the performance of sparse SNNs. + +The main contributions of this paper can be summarized as follows: + +- Inspired by the filopodial model of spinogenesis, we manage to model two kinds of state transitions of dendritic spines: 1) Mature dendritic spines and filopodia 2) Excitatory and inhibitory synapses; by using a nonlinear reparameterization function. It gets rid of Dale's law and keeps exchanging the signs of weights for efficiency optimization, while still maintaining the ability to sparsify weights of SNNs. +- We provide proof of convergence and theoretical analysis of the sparsity springhead in our algorithm from the perspective of sparse optimization. +- We conduct extensive experiments on pruning of SEW ResNet18 on ImageNet classification tasks and it achieves state-of-the-art low performance loss. To the best of our knowledge, it is the first time highly sparse SNNs (88.8% sparsity) achieve so little performance loss ( $\sim 3\%$ ) on ImageNet dataset. +- We make an in-depth discussion of excellence and disadvantages between different settings (threshold schedulers) of our approach by tracking multiple properties during learning. We also show a preliminary explanation of the performance variation. + +# 2. Related Work + +Previous researches on lightweight SNNs are principally conducted from five aspects: 1) Pruning 2) Quantization 3) Reduction of firing rates 4) Sparse training 5) Knowledge distillation. + +Quantization methods for SNNs have been developed for a long time since the same techniques were applied to ANNs (Stromatias et al., 2015; Neftci et al., 2016). Recent advances in quantization for SNNs (Qiao et al., 2021; Wang et al., 2021; Kheradpisheh et al., 2021) are mainly focused on binary weights and different tasks. Introducing firing rate as an explicit regularization term to the loss is the most general way to suppress firing rates (Neil et al., 2016; Zenke & Vogels, 2021; Deng et al., 2021). Sparse approximation to gradients reduces training costs of SNNs (Zenke & Neftci, 2021; Perez-Nieves & Goodman, 2021). Distilling knowledge from large ANN (Takuya et al., 2021) or SNN (Kushawaha et al., 2021) to smaller SNN is also a substitute for direct compression. + +By comparison, the pruning for SNNs draws more attention since it has corresponding physiological processes, which leads a way to efficient SNN structure. To the best of our knowledge, the earliest series of researches concerning pruning of networks with firing neurons (Chechik et al., 1998; 1999) borrows biological mechanisms like synaptic turnover. + +Recent researches on SNN pruning are primarily from two starting points: 1) Learning from successful experience of ANN pruning 2) Exploring biological counterparts. The former technical route is much more popular, which initially enables some tentative work inserting magnitude-based pruning to different training methods of SNNs, e.g., event-driven contrastive divergence (eCD) (Neftci et al., 2016), STDP (Rathi et al., 2019; Nguyen et al., 2021), ANN2SNN (Mern et al., 2017; Liu et al., 2020). The success of training deep SNNs using the surrogate gradient method (Neftci et al., 2019), or STBP (Wu et al., 2018), arouses a swarm of pruning strategies (Martinelli et al., 2020; Deng et al., 2021; Yin et al., 2021) via integrating newly developed ANN pruning algorithms. Meanwhile, in view of the similarity between SNNs and neural systems, there are some attempts to bioinspired pruning algorithms. Modeling the regrowth process (Kundu et al., 2021) is proved to be a competent strategy. This idea can be further combined with the modeling of dendritic spines in SNNs to enhance pruning, which introduces spine motility (Kappel et al., 2015; Bellec et al., 2018b) or gradient (Chen et al., 2021) as a criterion of regrowth. Both criteria achieve a reasonable trade-off between sparsity and accuracy on deep SNNs and also provide solid theoretical proof for their algorithms. + +![](images/14486ffc81adb7cd6ff35d5d36a403340a06b4a5fb500956ca72510e228dad02.jpg) +Figure 1. Scheme for weight reparameterization and transitions between filopodia and mature dendritic spines, and transitions between different types of synapses. Yellow areas represent the axon terminal. Blue and green areas distinguish two types of dendritic spines, i.e. inhibitory and excitatory. GABA and glutamate exemplify the main kinds of inhibitory and excitatory neurotransmitters in the mammalian cortex respectively. + +# 3. Preliminaries + +# 3.1. Spiking Neuron Model + +The Leaky Integrate-and-Fire (LIF) model (Gerstner & Kistler, 2002) is among the most popular neuron models for its low computing costs. For a layer of spiking neurons, we denote $I_{i}(t)$ as the input from the $i$ -th presynaptic neuron and $w_{i}$ as the corresponding synaptic weights. The subthreshold membrane potential $u(t)$ of the postsynaptic neuron can be expressed in the form of an ordinary differential equation (ODE). + +$$ +\tau_ {m} \frac {\mathrm {d} u (t)}{\mathrm {d} t} = - (u (t) - u _ {\text {r e s t}}) + \sum_ {i} w _ {i} I _ {i} (t), \tag {1} +$$ + +where $\tau_{m}$ is a positive membrane time constant, and $u_{\mathrm{rest}}$ is the resting potential. When $u(t)$ reaches the firing threshold $u_{\mathrm{th}}$ at time $t^f$ , a spike is generated and at the same time, the membrane potential $u(t)$ is reset to the resting potential $u_{\mathrm{rest}}$ . + +$$ +\lim _ {\Delta t \rightarrow 0 ^ {+}} u \left(t ^ {f} + \Delta t\right) = u _ {\text {r e s t}}, \text {i f} u \left(t ^ {f}\right) \geq u _ {\text {t h}}. \tag {2} +$$ + +In computer simulation, we generally need to consider a discrete version of Eq. (1) and Eq. (2). By Euler method, Eq. (1) and Eq. (2) can be discretized as follows: + +$$ +\begin{array}{l} u [ t ^ {-} ] = u [ t - 1 ] \\ + \frac {1}{\tau_ {m}} \left(- (u [ t - 1 ] - u _ {\text {r e s t}}) + \sum_ {i} w _ {i} I _ {i} [ t ]\right), \\ \end{array} +$$ + +$$ +\begin{array}{l} s [ t ] = H (u [ t ^ {-} ] - u _ {\mathrm {t h}}), \\ u [ t ] = s [ t ] u _ {\text {r e s t}} + (1 - s [ t ]) u \left[ t ^ {-} \right], \tag {3} \\ \end{array} +$$ + +where $u[t^{-}]$ , $u[t]$ are the membrane potential before and after firing at timestep $t$ respectively, and $H(\cdot)$ is the Heaviside step function. If $u[t^{-}] \geq u_{\mathrm{th}}$ , it will produce a binary + +spike $s[t]$ and the $u[t]$ will reset to $u_{\mathrm{rest}}$ or otherwise left unchanged. + +# 3.2. Dendritic Spine + +Dendritic spines (or simply spines) are small membranous protrusions that arise from dendrites, which connect dendrites to axon terminals (Yuste, 2010), allowing presynaptic spikes to be delivered to postsynaptic neurons. Fig. 1 illustrates the status of contact between spines, which has two types (excitatory and inhibitory) and various sizes, and axons. It is widely recognized that synaptic weights in the mammalian brain are significantly correlated to the size factor, e.g., head size (Matsuzaki et al., 2001; 2004; Beïque et al., 2006), neck length (Noguchi et al., 2005) and neck width (Tønnesen et al., 2014) of spines, which affects the long-term dynamics like long-term potentiation (LTP) and long-term depression (LTD) (Engert & Bonhoeffer, 1999). Larger spines have more receptors and thus inject more current into the dendrite, arousing stronger inhibitory postsynaptic potential (IPSP) or excitatory postsynaptic potential (EPSP). The type of synapse is determined by neurotransmitters released from axon terminals of presynaptic neurons and receptors on spines. As shown in Fig. 1, glutamate and gamma-aminobutyric acid (GABA) are, respectively, the major excitatory and the major inhibitory neurotransmitters in the mature mammalian brain (Fonnum, 1984; Bhat et al., 2010). Spikes from excitatory synapses increase the firing rates of neurons while spikes from inhibitory synapses do the opposite, which corresponds to the positive and negative weights in SNNs, respectively. Weight changes in SNNs are similar and usually considered analogical to enlargement or shrinkage of spines (Kappel et al., 2015). + +# 4. Methodology + +# 4.1. Reparameterization of Weights + +The synaptic weights in SNNs are generally treated as their counterparts in ANNs. Despite the previous success in deep learning of SNNs, there are few attempts to model pruning in SNNs as a gradient-based optimization problem since it is hard to restrict the synaptic weights exactly to zero, where it generally has a nonzero gradient. We point out that the status "pruned" should not be modeled as a single point but an interval on the real axis. Furthermore, it is wise to allow the exchange of positive (excitatory) and negative (inhibitory) weights, since they may be initialized improperly if the types are fixed. + +In fact, researches in neuroscience have revealed that there exists an intermediate state, namely "dendritic filopodia", for renascent spines in hippocampal neurons (Fiala et al., 1998). Filopodia are deemed the structural precursors of dendritic spines (Zuo et al., 2005), and they rarely form connections to presynaptic axons. We model such behavior as reparameterization mapping from the size of the spine/filopodium $|\theta|$ to the real connection weights $w$ , the sign of weights represents the type of synapses (excitatory/inhibitory), which is formulated as + +$$ +w = \operatorname {s i g n} (\theta) \cdot (| \theta | - d) _ {+}, d \geq 0, \tag {4} +$$ + +where $(x)_{+} := \max(x, 0)$ . When the size of the connection is below threshold $d$ , it is considered a filopodium, and the equivalent weight is zero. As shown in Fig. 1, filopodia lack synaptic contact to axons, since they are not large enough to form links. It becomes an existent connection when the size increases to above $d$ . During each update of the weights, the threshold $d$ will increase gradually and turn mature spines to filopodia progressively. Specifically, there are two kinds of state transitions: (1) Transition between filopodia and mature spines (pruning and regrowth), (2) Transition between excitatory and inhibitory synapses (flip sign). A scheme for the weight reparameterization and corresponding state of the spine is shown in Fig. 1. It should be noted that our approach will not change the default initialization of weights. In practice, the weight $\boldsymbol{w}$ is first initialized and then we calculate corresponding spine size $\boldsymbol{\theta}$ . + +Notice that similar modeling has also been proposed in a series of works of rewiring in ANNs/SNNs. The existing work adheres to Dale's law that the sign of weight (type of neurotransmitter) should not change during learning, i.e., $d \rightarrow +\infty$ and fixed (Bellec et al., 2018a; Chen et al., 2021) or using exponential reparameterization (Kappel et al., 2015), which is true for biological synapses. However, these settings are inflexible and introduce unnecessary restrictions to the representation capacity of SNNs. The form of reparameterization function in Eq. (4) is consistent with the model in a previous work (Kusupati et al., 2020) + +with trainable $d$ concerning ANN pruning. Instead, we focus on finding the best evolution strategy of $d$ , rather than giving an optimal choice of fixed $d$ . Besides, our algorithm is biology-inspired from a completely different perspective. + +# 4.2. Direct Training using Surrogate Gradient + +With the proposed reparameterization framework (Eq. (4)), the gradient descent algorithm can be directly applied to optimize the spine size $\theta$ and synaptic weights $w$ of the SNN. Specifically, we manage to derive the gradients of loss function $\mathcal{L}$ with respect to SNN weights $\nabla_{\boldsymbol{w}}\mathcal{L}$ by applying backpropagation through time (BPTT) along the path in the computational graph defined by iterative computing in Eq. (3). Additionally, the gradient with respect to spine size $\nabla_{\theta}\mathcal{L}$ is given through reparameterization mapping by + +$$ +\nabla_ {\boldsymbol {\theta}} \mathcal {L} = \nabla_ {\boldsymbol {w}} \mathcal {L} \cdot \frac {\partial \boldsymbol {w}}{\partial \boldsymbol {\theta}}. \tag {5} +$$ + +Note that unlike in ANNs, gradient based training methods in SNNs must deal with nondifferentiable Heaviside function $H(\cdot)$ in Eq. (3). The actual derivative of Heaviside function is undefined at zero and 0 elsewhere. The pioneers of SNN learning (Zenke & Ganguli, 2018; Wu et al., 2018; Neftci et al., 2019) introduce some differentiable functions as alternatives of $H(\cdot)$ , namely surrogate function, making calculation of gradients tractable. We choose a recently proposed function (Fang et al., 2021a) + +$$ +H ^ {*} (x) = \frac {1}{\pi} \arctan \left(\frac {\pi}{2} \beta x\right) + \frac {1}{2} \tag {6} +$$ + +as surrogate function during training, where $\beta$ is the slope parameter. + +# 4.3. Case Study: How sparsity is induced? + +To clarify how this algorithm enforces sparsity in SNN learning, we discuss three different cases of update rules. If not otherwise specified, the superscript $t$ here, e.g. $d^t$ , denotes the corresponding symbol after the $t$ -th training step. For convenience, we define the notation of element-wise soft threshold operator as + +$$ +\mathcal {S} _ {\lambda} (x) = \operatorname {s i g n} (x) \cdot (| x | - \lambda) _ {+} = \left\{ \begin{array}{l l} x - \operatorname {s i g n} (x) \cdot \lambda , & | x | > \lambda \\ 0, & | x | \leq \lambda \end{array} \right. \tag {7} +$$ + +To begin with, we derive the actual gradient with Eq. (4) and Eq. (5). + +$$ +\nabla_ {\boldsymbol {\theta}} \mathcal {L} \left(\boldsymbol {\theta} ^ {t - 1}\right) = \nabla_ {\boldsymbol {w}} \mathcal {L} \left(\boldsymbol {w} ^ {t - 1}\right) \cdot \operatorname {d i a g} \left(\mathbf {1} _ {| \theta^ {t - 1} | > d}\right), \tag {8} +$$ + +where $\mathbf{1}_{|\theta^{t - 1}| > d}$ is an indicator vector, of which the corresponding element is 0 when $\theta_i^{t - 1} \in [-d, d]$ and 1 otherwise. The general update rule for spine sizes in SNN is given as + +$$ +\begin{array}{l} \boldsymbol {\theta} ^ {t} = \boldsymbol {\theta} ^ {t - 1} - \eta \nabla_ {\boldsymbol {\theta}} \mathcal {L} (\boldsymbol {\theta} ^ {t - 1}) \\ = \boldsymbol {\theta} ^ {t - 1} - \eta \nabla_ {\boldsymbol {w}} \mathcal {L} (\boldsymbol {w} ^ {t - 1}) \cdot \operatorname {d i a g} \left(\mathbf {1} _ {| \theta^ {t - 1} | > d}\right), \tag {9} \\ \end{array} +$$ + +![](images/e11c3e74ed6b5ae57da13f375266f14a4bed237d02869213326e6b0bb61301af.jpg) +Figure 2. Illustration of different cases discussed in Section 4.3. The red points represent the starting points $(\theta^{t - 1},w^{t - 1})$ . They move to blue points $(\theta^t,w^{t^-})$ according to gradient update. The increment from $d^{t - 1}$ to $d^{t}$ shrinks the weights and moves the blue points to green points $(\theta^t,w^t)$ . The solid and dashed black lines represent mapping $\mathcal{S}_{d^{t - 1}}(\cdot)$ and $\mathcal{S}_{d^t}(\cdot)$ respectively. + +![](images/d02552bd9d3c652beaa4c494bc533ac86a8423747da3aedfb8303847f2a60dff.jpg) + +![](images/e48225f7cdf5f3d71203da3032e8a3d75c86b92a60ce59d2d232864a6bdacde3.jpg) + +where $\eta$ is the learning rate. The corresponding gradient update rule for weights is + +$$ +\boldsymbol {w} ^ {t ^ {-}} = \mathcal {S} _ {d ^ {t - 1}} \left(\boldsymbol {\theta} ^ {t}\right), \tag {10} +$$ + +where $\boldsymbol{w}^{t^{-}}$ is the intermediate weights before shrinkage (update of the threshold $d$ ). The above update is followed by the increment of $d$ , which is + +$$ +\boldsymbol {w} ^ {t} = \mathcal {S} _ {d ^ {t}} \left(\boldsymbol {\theta} ^ {t}\right) = \mathcal {S} _ {\Delta d ^ {t}} \left(\boldsymbol {w} ^ {t ^ {-}}\right) = \mathcal {S} _ {\Delta d ^ {t}} \left(\mathcal {S} _ {d ^ {t - 1}} \left(\boldsymbol {\theta} ^ {t}\right)\right), \tag {11} +$$ + +where $\Delta d^t \coloneqq d^t - d^{t-1} > 0$ . + +We classify different cases according to whether an element $w^{t-1}$ of $w^{t-1}$ changes its sign, i.e. $\mathrm{sign}(w^{t^-}w^{t-1}) = 1$ or $-1$ after gradient update described in Eq. (10), and whether the weight $w^{t-1}$ is zero or not. For a nonzero weight $w$ , the corresponding spine size $\theta$ satisfy $|\theta| > d$ . Hence, Eq. (10) can be rewritten to: + +$$ +w ^ {t ^ {-}} = \mathcal {S} _ {d ^ {t - 1}} \left(\theta^ {t - 1} - \eta \nabla_ {w} \mathcal {L} \left(w ^ {t - 1}\right)\right). \tag {12} +$$ + +Notice that a trivial case is $w^{t^{-}} = 0$ . In this case, the increment of $d$ has no influence on $w$ . Other cases of nonzero weight are shown in the first two cases below. + +Case 1: Same sign, nonzero weight. When the sign of nonzero weight $w$ does not change after applying gradient update, that is, $\mathrm{sign}(\theta^t) = \mathrm{sign}(\theta^{t - 1})$ and $|\theta^{t - 1}|, |\theta^t| > d$ . As shown in Fig. 2, this usually happens when the step size of gradient update is relatively small. By definition in Eq. (7) and Eq. (12), we have + +$$ +\begin{array}{l} w ^ {t} = \theta^ {t - 1} - \eta \nabla_ {w} \mathcal {L} (w ^ {t - 1}) - \operatorname {s i g n} (\theta^ {t}) d ^ {t - 1} \\ = \left(\theta^ {t - 1} - \operatorname {s i g n} \left(\theta^ {t - 1}\right) d ^ {t - 1}\right) - \eta \nabla_ {w} \mathcal {L} \left(w ^ {t - 1}\right) \tag {13} \\ = w ^ {t - 1} - \eta \nabla_ {w} \mathcal {L} (w ^ {t - 1}). \\ \end{array} +$$ + +The last equality holds the nonzero wight assumption and Eq. (4). By combining Eq. (11) and Eq. (13), the overall update rule of weight has the form + +$$ +w ^ {t} = \mathcal {S} _ {\Delta d ^ {t}} \left(w ^ {t - 1} - \eta \nabla_ {w} \mathcal {L} \left(w ^ {t - 1}\right)\right). \tag {14} +$$ + +This update rule is equivalent to the Iterative Shrinkage and Thresholding Algorithm (ISTA) (Daubechies et al., 2004), which iteratively acquires the closed-form solution of the problem + +$$ +\begin{array}{l} \boldsymbol {w} ^ {t} = \operatorname * {a r g m i n} _ {\boldsymbol {w}} \\ \left. \left\{\frac {1}{2 \eta} \| \boldsymbol {w} - \left(\boldsymbol {w} ^ {t - 1} - \eta \nabla_ {\boldsymbol {w}} \mathcal {L} \left(\boldsymbol {w} ^ {t - 1}\right)\right) \| _ {2} ^ {2} + \Delta d ^ {t} \| \boldsymbol {w} \| _ {1} \right\}. \right. \tag {15} \\ \end{array} +$$ + +It evaluates the proximal gradient under $\ell_1$ -based regularization $\Delta d^t\| \pmb{w}\| _1$ and induces sparsity. A well-known conclusion (Nesterov, 2007) is that assuming loss function $\mathcal{L}$ is $L$ -smooth and convex, the ISTA has sublinear convergence rate for constant step size $\eta \in (0,1 / L]$ . + +Further, if $d$ increases linearly, $\Delta d^t$ is a constant and thereby the regularization term is invariant during learning. + +Case 2: Altered sign, nonzero weight. If the step is sufficiently large to change the sign of a weight after gradient update, i.e., $\mathrm{sign}(\theta^t) = -\mathrm{sign}(\theta^{t-1})$ and $|\theta^{t-1}|, |\theta^t| > d$ , which implies a alteration of synapse type shown in Fig. 2. By definition in Eq. (7) and Eq. (12), we have + +$$ +\begin{array}{l} w ^ {t ^ {-}} = \theta^ {t - 1} - \eta \nabla_ {w} \mathcal {L} (w ^ {t - 1}) - \operatorname {s i g n} (\theta^ {t}) d ^ {t - 1} \\ = \theta^ {t - 1} - \eta \nabla_ {w} \mathcal {L} (w ^ {t - 1}) - (\mathrm {s i g n} (\theta^ {t - 1}) \\ \begin{array}{l} + 2 \operatorname {s i g n} \left(\theta^ {t}\right)) d ^ {t - 1} \\ \left(\theta^ {t - 1} - \operatorname {s i g n} \left(\theta^ {t - 1}\right) d ^ {t - 1}\right) - \eta \nabla_ {w} \mathcal {L} \left(w ^ {t - 1}\right) \end{array} \tag {16} \\ - 2 \operatorname {s i g n} \left(\theta^ {t}\right) d ^ {t - 1} \\ = \mathcal {S} _ {2 d ^ {t - 1}} \left(w ^ {t - 1} - \eta \nabla_ {w} \mathcal {L} \left(w ^ {t - 1}\right)\right). \\ \end{array} +$$ + +By Eq. (11), we have + +$$ +w ^ {t} = \mathcal {S} _ {\Delta d ^ {t}} \left(\mathcal {S} _ {2 d ^ {t - 1}} \left(w ^ {t - 1} - \eta \nabla_ {w} \mathcal {L} \left(w ^ {t - 1}\right)\right)\right), \tag {17} +$$ + +which implies a shrinkage on the length of step followed by a shrinkage on weight. + +Case 3: Zeroed weight. For a zeroed weight, the corresponding $\theta \in [-d,d]$ . The derivative $\frac{\partial w}{\partial\theta}$ is always zero, which is caused by plateau landscape of mapping $w = S_{d}(\theta)$ . Hence, $w$ will be fixed to zero after $\theta$ occasionally lies in the interval. For this reason, a regrowth mechanism is necessary for reviving pruned weights. Modifying gradient as Grad R (Chen et al., 2021) did is a promising method. Specifically, we manually set $\frac{\partial w}{\partial\theta} \equiv 1$ for zeroed $w$ . Notice that the authors of Grad R proved that under some smooth conditions, the loss will be non-increasing if the learning rate is constant and carefully chosen. Similarly, we adopt the idea and derive a similar explanation for our case of soft threshold mapping as follows + +Theorem 4.1 (Convergence). For a spiking neural network, where each synaptic weight $w$ is dominated by corresponding spine size $\theta$ through a soft threshold mapping + +$$ +w = \operatorname {s i g n} (\theta) \cdot (| \theta | - d) _ {+}, d \geq 0, \tag {18} +$$ + +if we apply a smooth approximation + +$$ +w = f (\theta) := \frac {1}{\alpha} \log \left(\frac {1 + e ^ {\alpha (\theta - d)}}{1 + e ^ {- \alpha (\theta + d)}}\right), \alpha \gg 1, \tag {19} +$$ + +and define the pseudo partial derivative during computing gradients as $\frac{\partial w}{\partial\theta} p\equiv 1$ , the loss function $\mathcal{L}$ is $L$ -smooth and lower bounded, the sequence $\{\mathcal{L}(\pmb {\theta}^t)\}_{t\in \mathbb{N}}$ must converge if learning rate $\eta < \frac{4}{L(1 + e^{\alpha d})}$ + +The detailed proof is provided in the Appendix B. Distinct from the aforementioned two cases, the step size of zeroed weights is dictated by filopodia size $\theta$ and gradient w.r.t. zeroed weight $\left.\frac{\partial\mathcal{L}}{\partial w}\right|_{w = 0}$ as opposed to weights themselves. The update rule takes the form + +$$ +\boldsymbol {w} ^ {t} = \mathcal {S} _ {\Delta d ^ {t}} \left(\mathcal {S} _ {d ^ {t - 1}} \left(\boldsymbol {\theta} ^ {t - 1} - \eta \nabla_ {\boldsymbol {w}} \mathcal {L}\right)\right) \tag {20} +$$ + +Analysis In all the cases of the update rule, the weights are always pushed to zero by a soft shrinkage $S_{\Delta dt}(\cdot)$ brought by increasing threshold throughout the training progress, which acts as a proximal gradient descent under $\ell_1$ -regularized loss as mentioned in Case 1, encouraging the transition from mature spines to filopodia. Despite this, the modified gradient introduced in Case 3 ensures that state transition between different kinds of synapses is unobstructed, theoretically guaranteeing convergence. The nested soft threshold operator in Case 2 suggests it is increasingly difficult to directly flip signs of weight immediately in the late stages of training since $d$ is growing larger. Such a phenomenon indicates that most updates of nonzero weight in the late stages will follow Case 1. + +![](images/cd6df3524c44c61632fbd064a72b42b7de8732996d878a77af62794ef99b4274.jpg) +Figure 3. Performance comparison of different pruning algorithms on the ImageNet dataset. The accuracy of unpruned model is shown as a black dashed line. + +![](images/db28ec41f7873b6a331b952a0110f5b2ac459da6922b82a816ec6694e85f8e5b.jpg) +Figure 4. Performance comparison of two schedulers on the ImageNet dataset. The accuracy of unpruned model is shown as a black dashed line. + +# 4.4. Scheduling of Threshold Growth + +Deciding on an appropriate schedule of threshold $d$ at each training steps is non-trivial. Assuming the total steps of parameter updating is $T_{\mathrm{param}}$ , and the target threshold after training is $D > 0$ , which are decided before training, we propose two schedulers: + +- Linear scheduler: $d^{t} = \frac{t}{T_{\mathrm{param}}} D$ +- Sine scheduler: $d^{t} = \frac{1}{2}\left(\sin \left(\frac{t\pi}{T_{\mathrm{param}}} - \frac{\pi}{2}\right) + 1\right)D$ + +These schedulers show different behaviors and will be further discussed in the experimental results section. + +# 5. Experiments + +In this section, we validate the effectiveness of our pruning algorithm for classification tasks on the ImageNet + +![](images/8052063e940540dd983001565c2f5eccdc9308cde5095e75dc88a94ba50155ab.jpg) + +![](images/09f08b0c2e21be4532477974db93bb0bcf89300540d74da7856c6766c3224bca.jpg) +Figure 5. Top-1 accuracy during training (320 epochs in total). Lines are smoothed by window size 10, and the error bars (areas with lighter colors) indicate the standard deviations within the windows. The lines in the early stage are clipped for highlighting the latter stage. + +dataset (Russakovsky et al., 2015). We first compare our algorithm with Grad R to demonstrate the significance of transition between positive and negative weights (different types of synapses). Further, we investigate the performance of the two proposed schedulers of threshold $d$ and make an empirical explanation of their different performance. Finally, we compare our method with other state-of-the-art approaches. Considering the training cost of deep SNNs, we select SEW ResNet18 (Fang et al., 2021a) as a testbed and follow ALL the training setting of SEW ResNet. Notice that the computation concerning spikes is from the layer behind neuron layers, which are usually convolutional or fully-connected layers. Adding that pruning the final fully-connected layer will hurt the performance, our pruning algorithm only applies to all convolutional layers. The detailed extra settings for pruning are shown in Appendix A. + +# 5.1. Effects of Transition between Excitatory and Inhibitory Synapses + +We implement Grad R (Chen et al., 2021) as a baseline, which also can be viewed as a pruning and regrowth algorithm. In fact, Grad R is a degenerate case of our algorithm, where $d$ is extremely large and fixed during training so that the transition of different types of synapses is forbidden. The comparison of performance with SEW ResNet18 structure on ImageNet dataset is illustrated in Fig. 3. One can find that the performance of our method (blue curve) is much better than Grad R (yellow curve). The performance of Grad R drops drastically even under low sparsity $(\sim 50\%)$ + +![](images/ff8b228759d420ed20cc4cc5df761ec4f48b0179335d1c82ef10b309de2798ae.jpg) + +![](images/8a37b7ca29f165ff37d942a29cc383e539662f84694711dbc8a6beea55fae729.jpg) +Figure 6. Overall sparsity of parameters in Conv. layers during training (320 epochs in total). + +in default of the transition of different types of synapses. It indicates that Grad R fails to achieve impressive performance loss as it did on smaller datasets, which is no match for our proposed algorithm. All these results demonstrate the effects of transition between excitatory and inhibitory synapses. + +# 5.2. Comparison of Threshold Scheduler + +As it can be seen, our algorithm has only one tunable hyperparameter $D$ , which actually transfers the complexity of the parameter space to the function space, namely the choice of schedulers. Here, we compare the performance and other properties of the two proposed schedulers, namely linear scheduler and sine scheduler. As shown in Fig. 4 and Tab. 2, the performance of the linear scheduler drops drastically when the sparsity is above $80\%$ . In contrast, the performance of the sine scheduler is close to the performance of the fully connected network when the connectivity is above $10\%$ . Besides, it reaches a top-1 accuracy of $58.06\%$ ( $\sim 5.2\%$ accuracy loss) when constrained to $6.74\%$ connectivity. These results imply that the sine scheduler is superior than the linear scheduler. + +To dive deep into the root cause of such performance variation, we further analyze the top-1 accuracy and total sparsity of SNN during training with these two schedulers. Fig. 5 illustrates the top-1 accuracy during training. An interesting finding is that some training processes $(D = 0.4, 0.6)$ using the linear scheduler severe performance degradation in the last 50 epochs (270~320). On the contrary, all processes applying the sine scheduler maintain the rising trend + +Table 1. Comparison of performance in recent studies on SNN pruning. + +
Pruning MethodTraining MethodArch.DatasetTop-1 Acc. (%)Sparsity (%)Acc. Loss (%)
Martinelli et al., 2020Surrogate Gradient2 FCQUT-NOISE-TIMIT-4.6185-0.1
-12.4-0.1
-25.2-0.6
Chen et al., 2021Surrogate Gradient6 Conv, 2 FCCIFAR-1092.8497.65-1.47
99.27-3.52
Deng et al., 2021Surrogate Gradient7 Conv, 2 FCCIFAR-1089.5375-2.15
Kundu et al., 2021ANN2SNN & Surrogate GradientResNet12 VGG16CIFAR-100 Tiny-ImageNet63.5290-0.5
57.0060-4.3
Nguyen et al., 2021STDP3 ConvCaltech-101 (2 Classes)95.792.830
This workSurrogate Gradient6 Conv, 2 FCCIFAR-1092.8497.77-0.35
99.25-2.63
Chen et al., 20212Surrogate GradientSEW ResNet18ImageNet63.2250.94-3.17
53.65-38.6
Deng et al., 20212Surrogate GradientSEW ResNet18ImageNet63.2282.58-3.74
88.84-7.37
93.24-12.65
This workSurrogate GradientSEW ResNet18ImageNet63.2282.58-1.92
88.84-3.29
93.24-5.16
95.30-6.94
+ +1 The accuracy here represents -HTER for low, medium and high noise levels, where $HTER = 0.5MR + 0.5FAR$ denotes the Half Total Error Rate. MR and FAR are miss and false alarm rates +2 Our implementation. + +throughout training. Some trials with the sine schedulers $(D = 1.5, 3.0)$ even show an apparent accelerated, increasing accuracy at the final stages. Fig. 6 indicates that these two schedulers show different behavior in the growth of sparsity. The sine scheduler tends to produce a more steady growth of sparsity in the late stages of training, while the linear one usually has a sharp growth. + +It should be noted that the scheduler of the learning rate applied in the SEW ResNet is the cosine annealing scheduler (Loshchilov & Hutter, 2017). For the $n$ -th epoch, the learning rate $\eta^n$ decays as + +$$ +\eta^ {n} = \frac {1}{2} \eta_ {\max } \left(1 + \cos \left(\frac {n}{T _ {\mathrm {e p o c h}}} \pi\right)\right), \tag {21} +$$ + +where $T_{\mathrm{epoch}}$ denotes the total number of training epochs. In the last few epochs, the learning rate is quite small, suggesting that the update step should be infinitesimal, which matches the Case 1 in Section 4.3. Recall that Eq. (15) shows the equivalent optimization problem under $\ell_1$ -regularized loss. In the context of the linear scheduler, the regularizing term $\Delta d^t \| \boldsymbol{w} \|_1 \equiv \frac{1}{T_{\mathrm{param}}} D \| \boldsymbol{w} \|_1$ is invariant and far outweigh the update step at last, resulting in a pure shrinkage of weights in the absence of learning signal. For the sine scheduler, since $T_{\mathrm{param}} \gg 1$ , we have the following + +approximation + +$$ +\begin{array}{l} \Delta d ^ {t} = \frac {1}{2} \left(\sin \left(\frac {t \pi}{T _ {\mathrm {p a r a m}}} - \frac {\pi}{2}\right) - \sin \left(\frac {(t - 1) \pi}{T _ {\mathrm {p a r a m}}} - \frac {\pi}{2}\right)\right) D \\ = \sin \left(\frac {(t - \frac {1}{2}) \pi}{T _ {\mathrm {p a r a m}}}\right) \sin \left(\frac {\pi}{T _ {\mathrm {p a r a m}}}\right) D \\ \approx \sin \left(\frac {t}{T _ {\mathrm {p a r a m}}} \pi\right) \frac {\pi}{T _ {\mathrm {p a r a m}}} D \tag {22} \\ \end{array} +$$ + +which converges to zero when $t \to T_{\mathrm{param}}$ . In particular, $d$ converges faster than $\eta$ for $T_{\mathrm{param}} \gg T_{\mathrm{epoch}}$ , ensuring the magnitude of the learning signal is always over the regularized term and thereby facilitating learning until the last moment. + +# 5.3. Comparison with the State-of-the-Art + +We compare the proposed method to some other state-of-the-art pruning algorithms of SNNs and report the results in Tab. 1. To make a fair comparison, we also conduct experiments on shallow networks and small-scale datasets like CIFAR-10. The results are shown in Fig. 7. + +For the trials on CIFAR-10, we follow the setting in Grad R that pruning is applied to all layers except batch normal + +Table 2. Comparison of different threshold schedulers on the ImageNet dataset. + +
SchedulerTop-1 Acc. (Dense) (%)Sparsity (%)Top-1 Acc. (Pruned) (%)Acc. Loss (%)
Sine33.4562.84-0.38
78.6461.51-1.71
82.5861.30-1.92
88.8459.93-3.29
93.2458.06-5.16
63.2295.3056.28-6.94
Linear34.1062.99-0.23
56.4962.28-0.94
82.1158.02-5.20
93.1545.76-17.46
+ +![](images/1d9f8470d1a1f88b2b6c0056b1d118c78b331efa0f5851a41741bf3fac6e4f9d.jpg) +Figure 7. Performance comparison of different pruning algorithms on the CIFAR-10 dataset. The accuracy of unpruned model is shown as a black dashed line. + +ization layers. The detailed setting of hyperparameters in trials on CIFAR-10 are shown in Appendix A. Most of these works fail to achieve the low performance loss as ours even on datasets much simpler than ImageNet, which demonstrates the advanced nature of our approach. Besides, we can find that Grad R, which has an impressive performance on CIFAR-10, cannot generalize to larger datasets and networks. + +# 6. Conclusion and Discussion + +In this paper, we design a novel pruning algorithm based on modeling the transition of dendritic spines containing different types of neurotransmitters and the transition between development stages of dendritic spines. We theoretically explain the convergence and the source of the sparsity in our approach. Extensive experimental results show that our approach outperforms previous SNN pruning algorithms by a substantial degree, which encourages the subsequent work to validate its performance on more realistic tasks. The results also reveal the significance of choice in threshold + +schedule, which is correlated to the scheduler of learning rates. The optimal threshold scheduler for our pruning algorithm remains to be discussed and discovered in future work. + +# Acknowledgements + +This work is supported by grants from the National Natural Science Foundation of China under contract No. 62027804, No. 61825101, No. 62088102 and No. 62176003. The computing resources of Pengcheng Cloudbrain are used in this research. + +# References + +Béique, J.-C., Lin, D.-T., Kang, M.-G., Aizawa, H., Takamiya, K., and Huganir, R. L. Synapse-specific regulation of ampa receptor function by psd-95. Proceedings of the National Academy of Sciences, 103(51):19535-19540, 2006. +Bellec, G., Kappel, D., Maass, W., and Legenstein, R. Deep rewiring: Training very sparse deep networks. In International Conference on Learning Representations, 2018a. +Bellec, G., Salaj, D., Subramoney, A., Legenstein, R., and Maass, W. Long short-term memory and learning-to-learn in networks of spiking neurons. In Bengio, S., Wallach, H., Larochelle, H., Grauman, K., Cesa-Bianchi, N., and Garnett, R. (eds.), Advances in Neural Information Processing Systems, volume 31. Curran Associates, Inc., 2018b. +Bhat, R., Axtell, R., Mitra, A., Miranda, M., Lock, C., Tsien, R. W., and Steinman, L. Inhibitory role for gaba in autoimmune inflammation. Proceedings of the National Academy of Sciences, 107(6):2580-2585, 2010. +Chechik, G., Meilijson, I., and Ruppin, E. Synaptic pruning in development: A computational account. *Neural Computation*, 10(7):1759-1777, 1998. + +Chechik, G., Meilijson, I., and Ruppin, E. Neuronal Regulation: A Mechanism for Synaptic Pruning During Brain Maturation. Neural Computation, 11(8):2061-2080, 11 1999. +Chen, Y., Yu, Z., Fang, W., Huang, T., and Tian, Y. Pruning of deep spiking neural networks through gradient rewiring. In Zhou, Z.-H. (ed.), Proceedings of the Thirtieth International Joint Conference on Artificial Intelligence, IJCAI-21, pp. 1713-1721. International Joint Conferences on Artificial Intelligence Organization, 8 2021. Main Track. +Daubechies, I., Defrise, M., and De Mol, C. An iterative thresholding algorithm for linear inverse problems with a sparsity constraint. Communications on Pure and Applied Mathematics, 57(11):1413-1457, 2004. +Davies, M., Srinivasa, N., Lin, T., Chinya, G., Cao, Y., Choday, S. H., Dimou, G., Joshi, P., Imam, N., Jain, S., Liao, Y., Lin, C., Lines, A., Liu, R., Mathaikutty, D., McCoy, S., Paul, A., Tse, J., Venkataramanan, G., Weng, Y., Wild, A., Yang, Y., and Wang, H. Loihi: A neuromorphic manycore processor with on-chip learning. IEEE Micro, 38(1):82-99, 2018. +Deng, L., Wu, Y., Hu, Y., Liang, L., Li, G., Hu, X., Ding, Y., Li, P., and Xie, Y. Comprehensive snn compression using admm optimization and activity regularization. IEEE Transactions on Neural Networks and Learning Systems, pp. 1-15, 2021. +Engert, F. and Bonhoeffer, T. Dendritic spine changes associated with hippocampal long-term synaptic plasticity. Nature, 399(6731):66-70, 1999. +Fang, W., Chen, Y., Ding, J., Chen, D., Yu, Z., Zhou, H., Tian, Y., and other contributors. Spikingjelly. https://github.com/fangwei123456/spikingjelly, 2020. Accessed: 2022-01-18. +Fang, W., Yu, Z., Chen, Y., Huang, T., Masquelier, T., and Tian, Y. Deep residual learning in spiking neural networks. In Ranzato, M., Beygelzimer, A., Dauphin, Y., Liang, P., and Vaughan, J. W. (eds.), Advances in Neural Information Processing Systems, volume 34, pp. 21056-21069. Curran Associates, Inc., 2021a. +Fang, W., Yu, Z., Chen, Y., Masquelier, T., Huang, T., and Tian, Y. Incorporating learnable membrane time constant to enhance learning of spiking neural networks. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), pp. 2661-2671, October 2021b. +Fiala, J. C., Feinberg, M., Popov, V., and Harris, K. M. Synaptogenesis via dendritic filopodia in developing hippocampal area ca1. Journal of Neuroscience, 18(21): 8900-8911, 1998. + +Fonnum, F. Glutamate: a neurotransmitter in mammalian brain. Journal of neurochemistry, 42(1):1-11, 1984. +Furber, S. B., Galluppi, F., Temple, S., and Plana, L. A. The spinnaker project. Proceedings of the IEEE, 102(5): 652-665, 2014. +Gerstner, W. and Kistler, W. M. Spiking Neuron Models: Single Neurons, Populations, Plasticity. Cambridge University Press, 2002. +Han, S., Pool, J., Tran, J., and Dally, W. Learning both weights and connections for efficient neural network. In Cortes, C., Lawrence, N., Lee, D., Sugiyama, M., and Garnett, R. (eds.), Advances in Neural Information Processing Systems, volume 28. Curran Associates, Inc., 2015. +He, K., Zhang, X., Ren, S., and Sun, J. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2016. +Hu, Y., Tang, H., and Pan, G. Spiking deep residual networks. IEEE Transactions on Neural Networks and Learning Systems, pp. 1-6, 2021. +Kappel, D., Habenschuss, S., Legenstein, R., and Maass, W. Network plasticity as bayesian inference. PLOS Computational Biology, 11(11):1-31, 11 2015. +Kheradpisheh, S. R., Mirsadeghi, M., and Masquelier, T. Bs4nn: Binarized spiking neural networks with temporal coding and learning. *Neural Processing Letters*, pp. 1-19, 2021. +Kim, S., Park, S., Na, B., and Yoon, S. Spiking-yolo: Spiking neural network for energy-efficient object detection. Proceedings of the AAAI Conference on Artificial Intelligence, 34(07):11270-11277, Apr. 2020. +Kirkland, P., Di Caterina, G., Soraghan, J., and Matich, G. Spikeseg: Spiking segmentation via stdp saliency mapping. In 2020 International Joint Conference on Neural Networks (IJCNN), pp. 1-8, 2020. +Kundu, S., Datta, G., Pedram, M., and Beerel, P. A. Spike-thrift: Towards energy-efficient deep spiking neural networks by limiting spiking activity via attention-guided compression. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision (WACV), pp. 3953-3962, January 2021. +Kushawaha, R. K., Kumar, S., Banerjee, B., and Velmurugan, R. Distilling spikes: Knowledge distillation in spiking neural networks. In 2020 25th International Conference on Pattern Recognition (ICPR), pp. 4536-4543, 2021. + +Kusupati, A., Ramanujan, V., Somani, R., Wortzman, M., Jain, P., Kakade, S., and Farhadi, A. Soft threshold weight reparameterization for learnable sparsity. In III, H. D. and Singh, A. (eds.), Proceedings of the 37th International Conference on Machine Learning, volume 119 of Proceedings of Machine Learning Research, pp. 5544-5555. PMLR, 13-18 Jul 2020. +Liu, Y., Qian, K., Hu, S., An, K., Xu, S., Zhan, X., Wang, J. J., Guo, R., Wu, Y., Chen, T.-P., Yu, Q., and Liu, Y. Application of deep compression technique in spiking neural network chip. IEEE Transactions on Biomedical Circuits and Systems, 14(2):274-282, 2020. +Loshchilov, I. and Hutter, F. SGDR: stochastic gradient descent with warm restarts. In International Conference on Learning Representations, 2017. +Luo, Y., Yi, Q., Wang, T., Lin, L., Xu, Y., Zhou, J., Yuan, C., Guo, J., Feng, P., and Feng, Q. A spiking neural network architecture for object tracking. In Zhao, Y., Barnes, N., Chen, B., Westermann, R., Kong, X., and Lin, C. (eds.), Image and Graphics, pp. 118-132, Cham, 2019. Springer International Publishing. +Luo, Y., Xu, M., Yuan, C., Cao, X., Zhang, L., Xu, Y., Wang, T., and Feng, Q. Siamsnn: Siamese spiking neural networks for energy-efficient object tracking. In Farkas, I., Masulli, P., Otte, S., and Wermter, S. (eds.), Artificial Neural Networks and Machine Learning - ICANN 2021, pp. 182-194, Cham, 2021. Springer International Publishing. +Ma, D., Shen, J., Gu, Z., Zhang, M., Zhu, X., Xu, X., Xu, Q., Shen, Y., and Pan, G. Darwin: A neuromorphic hardware co-processor based on spiking neural networks. Journal of Systems Architecture, 77:43 - 51, 2017. +Maass, W. Networks of spiking neurons: The third generation of neural network models. Neural Networks, 10(9): 1659-1671, 1997. +Martinelli, F., Dellaferrella, G., Mainar, P., and Cernak, M. Spiking neural networks trained with backpropagation for low power neuromorphic implementation of voice activity detection. In ICASSP 2020 - 2020 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 8544-8548, 2020. +Matsuzaki, M., Ellis-Davies, G. C. R., Nemoto, T., Miyashita, Y., Iino, M., and Kasai, H. Dendritic spine geometry is critical for ampa receptor expression in hippocampal cal pyramidal neurons. Nature Neuroscience, 4(11):1086-1092, 2001. +Matsuzaki, M., Honkura, N., Ellis-Davies, G. C. R., and Kasai, H. Structural basis of long-term potentiation in single dendritic spines. Nature, 429(6993):761-766, 2004. + +Mern, J., Gupta, J. K., and Kochenderfer, M. J. Layer-wise synapse optimization for implementing neural networks on general neuromorphic architectures. In 2017 IEEE Symposium Series on Computational Intelligence (SSCI), pp. 1-8, 2017. +Merolla, P. A., Arthur, J. V., Alvarez-Icaza, R., Cassidy, A. S., Sawada, J., Akopyan, F., Jackson, B. L., Imam, N., Guo, C., Nakamura, Y., Brezzo, B., Vo, I., Esser, S. K., Appuswamy, R., Taba, B., Amir, A., Flickner, M. D., Risk, W. P., Manohar, R., and Modha, D. S. A million spiking-neuron integrated circuit with a scalable communication network and interface. Science, 345(6197): 668-673, 2014. +Mink, J. W., Blumenschine, R. J., and Adams, D. B. Ratio of central nervous system to body metabolism in vertebrates: its constancy and functional basis. American Journal of Physiology-Regulatory, Integrative and Comparative Physiology, 241(3):R203-R212, 1981. +Neftci, E. O., Pedroni, B. U., Joshi, S., Al-Shedivat, M., and Cauwenberghs, G. Stochastic synapses enable efficient brain-inspired learning machines. Frontiers in Neuroscience, 10:241, 2016. +Neftci, E. O., Mostafa, H., and Zenke, F. Surrogate gradient learning in spiking neural networks: Bringing the power of gradient-based optimization to spiking neural networks. IEEE Signal Processing Magazine, 36(6):51-63, 2019. +Neil, D., Pfeiffer, M., and Liu, S.-C. Learning to be efficient: Algorithms for training low-latency, low-compute deep spiking neural networks. In Proceedings of the 31st Annual ACM Symposium on Applied Computing, SAC '16, pp. 293-298, New York, NY, USA, 2016. Association for Computing Machinery. +Nesterov, Y. Gradient methods for minimizing composite objective function (technical report 2007/76). CORE, Université catholique de Louvain, 2007. +Nguyen, T. N. N., Veeravalli, B., and Fong, X. Connection pruning for deep spiking neural networks with on-chip learning. In International Conference on Neuromorphic Systems 2021, ICONS 2021, New York, NY, USA, 2021. Association for Computing Machinery. +Noguchi, J., Matsuzaki, M., Ellis-Davies, G. C., and Kasai, H. Spine-neck geometry determines nmda receptor-dependent ca2+ signaling in dendrites. *Neuron*, 46(4): 609-622, 2005. +Payeur, A., Guerguiev, J., Zenke, F., Richards, B. A., and Naud, R. Burst-dependent synaptic plasticity can coordinate learning in hierarchical circuits. Nature Neuroscience, 24(7):1010-1019, 2021. + +Pei, J., Deng, L., Song, S., Zhao, M., Zhang, Y., Wu, S., Wang, G., Zou, Z., Wu, Z., He, W., Chen, F., Deng, N., Wu, S., Wang, Y., Wu, Y., Yang, Z., Ma, C., Li, G., Han, W., Li, H., Wu, H., Zhao, R., Xie, Y., and Shi, L. Towards artificial general intelligence with hybrid tianjic chip architecture. Nature, 572(7767):106-111, 2019. +Perez-Nieves, N. and Goodman, D. Sparse spiking gradient descent. In Ranzato, M., Beygelzimer, A., Dauphin, Y., Liang, P., and Vaughan, J. W. (eds.), Advances in Neural Information Processing Systems, volume 34, pp. 11795-11808. Curran Associates, Inc., 2021. +Qiao, G., Ning, N., Zuo, Y., Hu, S., Yu, Q., and Liu, Y. Direct training of hardware-friendly weight binarized spiking neural network with surrogate gradient learning towards spatio-temporal event-based dynamic data recognition. Neurocomputing, 457:203-213, 2021. +Rathi, N., Panda, P., and Roy, K. Stdp-based pruning of connections and weight quantization in spiking neural networks for energy-efficient recognition. IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems, 38(4):668-677, 2019. +Russakovsky, O., Deng, J., Su, H., Krause, J., Satheesh, S., Ma, S., Huang, Z., Karpathy, A., Khosla, A., Bernstein, M., Berg, A. C., and Fei-Fei, L. Imagenet large scale visual recognition challenge. International Journal of Computer Vision, 115(3):211-252, 2015. +Stöckl, C. and Maass, W. Optimized spiking neurons can classify images with high accuracy through temporal coding with two spikes. Nature Machine Intelligence, 3(3): 230-238, 2021. +Stromatias, E., Neil, D., Pfeiffer, M., Galluppi, F., Furber, S. B., and Liu, S.-C. Robustness of spiking deep belief networks to noise and reduced bit precision of neuro-inspired hardware platforms. Frontiers in Neuroscience, 9:222, 2015. +Szegedy, C., Liu, W., Jia, Y., Sermanet, P., Reed, S., Anguelov, D., Erhan, D., Vanhoucke, V., and Rabinovich, A. Going deeper with convolutions. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2015. +Takuya, S., Zhang, R., and Nakashima, Y. Training low-latency spiking neural network through knowledge distillation. In 2021 IEEE Symposium in Low-Power and High-Speed Chips (COOL CHIPS), pp. 1-3, 2021. +Tønnesen, J., Katona, G., Rózsa, B., and Nagerl, U. V. Spine neck plasticity regulates compartmentalization of synapses. Nature neuroscience, 17(5):678-685, 2014. + +Wang, Y., Xu, Y., Yan, R., and Tang, H. Deep spiking neural networks with binary weights for object recognition. IEEE Transactions on Cognitive and Developmental Systems, 13(3):514-523, 2021. +Wu, J., Xu, C., Han, X., Zhou, D., Zhang, M., Li, H., and Tan, K. C. Progressive tandem learning for pattern recognition with deep spiking neural networks. IEEE Transactions on Pattern Analysis and Machine Intelligence, pp. 1-1, 2021. +Wu, Y., Deng, L., Li, G., Zhu, J., and Shi, L. Spatiotemporal backpropagation for training high-performance spiking neural networks. Frontiers in Neuroscience, 12: 331, 2018. +Yin, H., Lee, J. B., Kong, X., Hartvigsen, T., and Xie, S. Energy-efficient models for high-dimensional spike train classification using sparse spiking neural networks. In Proceedings of the 27th ACM SIGKDD Conference on Knowledge Discovery & Data Mining, pp. 2017-2025, 2021. +Yuste, R. Dendritic spines. MIT press, 2010. +Zenke, F. and Ganguli, S. SuperSpike: Supervised Learning in Multilayer Spiking Neural Networks. Neural Computation, 30(6):1514-1541, 06 2018. +Zenke, F. and Neftci, E. O. Brain-inspired learning on neuromorphic substrates. Proceedings of the IEEE, 109 (5):935-950, 2021. +Zenke, F. and Vogels, T. P. The Remarkable Robustness of Surrogate Gradient Learning for Instilling Complex Function in Spiking Neural Networks. *Neural Computation*, 33(4):899–925, 03 2021. +Zheng, H., Wu, Y., Deng, L., Hu, Y., and Li, G. Going deeper with directly-trained larger spiking neural networks. Proceedings of the AAAI Conference on Artificial Intelligence, 35(12):11062-11070, May 2021. +Zhou, S., Li, X., Chen, Y., Chandrasekaran, S. T., and Sanyal, A. Temporal-coded deep spiking neural network with easy training and robust performance. Proceedings of the AAAI Conference on Artificial Intelligence, 35(12): 11143-11151, May 2021. +Zuo, Y., Lin, A., Chang, P., and Gan, W.-B. Development of long-term dendritic spine stability in diverse regions of cerebral cortex. Neuron, 46(2):181-189, 2005. + +# A. Detailed Setting of Pruning Experiments + +# A.1. Setting of Our Propose Method + +There is only one hyperparameter in our algorithm, namely $D$ , which represents the final width of the "plateau" landscape as illustrated in Fig. 1. The $D$ in our trials and corresponding performances are shown in Tab. 3 and Tab. 4. + +Table 3. Experimental settings of proposed algorithm on ImageNet. + +
SchedulerDSparsity (%)Top-1 Acc. (Pruned) (%)Acc. Loss (%)
Sine0.133.4562.84-0.38
0.678.6461.51-1.71
0.882.5861.30-1.92
1.588.8459.93-3.29
3.093.2458.06-5.16
5.095.3056.28-6.94
Linear0.134.1062.99-0.23
0.256.4962.28-0.94
0.482.1158.02-5.20
0.693.1545.76-17.46
+ +Table 4. Experimental settings of proposed algorithm on CIFAR-10. + +
SchedulerDSparsity (%)Top-1 Acc. (Pruned) (%)Acc. Loss (%)
Sine1.095.3692.49-0.35
2.097.7792.49-0.35
3.098.691.64-1.20
4.099.0191.06-1.78
5.099.2590.21-2.63
+ +All the convolutional layer in SEW ResNet18 are pruned. + +# A.2. Setting of Grad R + +For the reproduction of the Grad R algorithm (Chen et al., 2021), there are several parameters including scale and location parameter $\alpha, \mu$ , which are related to the target sparsity $p$ as + +$$ +\mu \alpha = \log (2 - 2 p) \tag {23} +$$ + +Our experimental settings are shown in Tab. 5. + +Table 5. Experimental settings of our implementation of Grad R on ImageNet. + +
μαpSparsity (%)Top-1 Acc. (Pruned) (%)Acc. Loss (%)
-10000.550.9460.052-3.168
-10010-50.500553.6524.616-38.604
+ +# A.3. Setting of (Deng et al., 2021) + +For the reproduction of (Deng et al., 2021), most retraining hyperparameters are inherited from training of dense model, which has a $63.22\%$ top-1 accuracy. The extra hyperparameters are shown in Tab. 6. + +The sparsity of each pruned layer are set identical to the corresponding sparse model using sine scheduler. + +Table 6. Experimental settings of our implementation of (Deng et al., 2021) on ImageNet. + +
ParametersDescriptionsValue
N1Retraining Epochs for ADMM-Compression40
N2Retraining Epochs for Hard-Compression(HC)20
ρPenalty Coefficient for ADMM1e-4
lrInitial Learning Rate during ADMM and HC Retraining0.05
-Optimizer during ADMM and HC RetrainingSGD
-l2Penalty5e-5
-Learning Rate SchedulerCosine Annealing
+ +# A.4. Software and Hardware Platform + +The implementation is based on the SpikingJelly framework (Fang et al., 2020). Each trial on ImageNet is carried out on 8 NVIDIA V100 GPUs. Each trial on CIFAR-10 is carried out on a single NVIDIA V100 GPU. + +# B. Proof of Theorem 4.1 + +Theorem B.1 (Convergence). For a spiking neural network, where each synaptic weight $w$ is dominated by corresponding spine size $\theta$ through a soft threshold mapping + +$$ +w = \operatorname {s i g n} (\theta) \cdot (| \theta | - d) _ {+}, d \geq 0, \tag {24} +$$ + +if we apply a smooth approximation + +$$ +w = f (\theta) := \frac {1}{\alpha} \log \left(\frac {1 + e ^ {\alpha (\theta - d)}}{1 + e ^ {- \alpha (\theta + d)}}\right), \alpha \gg 1, \tag {25} +$$ + +and define the pseudo partial derivative during computing gradients as $\frac{\partial w}{\partial\theta} p \equiv 1$ , the loss function $\mathcal{L}$ is $L$ -smooth and lower bounded, the sequence $\{\mathcal{L}(\pmb{\theta}^t)\}_{t \in \mathbb{N}}$ must converge if learning rate $\eta < \frac{4}{L(1 + e^{\alpha d})}$ . + +Proof. Denote the pseudo gradient calculated using $\frac{\partial w}{\partial\theta}{}_{p}\equiv 1$ as $\nabla_p\mathcal{L}(\pmb {\theta})$ , the update follows the rule $\pmb{\theta}^{t + 1} = \pmb{\theta}^t -\eta \nabla_p\mathcal{L}(\pmb {\theta})$ . Since $\mathcal{L}$ is $L$ -smooth, we have + +$$ +\begin{array}{l} \mathcal {L} \left(\boldsymbol {\theta} ^ {t + 1}\right) - \mathcal {L} \left(\boldsymbol {\theta} ^ {t}\right) \leq \langle \nabla \mathcal {L} \left(\boldsymbol {\theta} ^ {t}\right), \boldsymbol {\theta} ^ {t + 1} - \boldsymbol {\theta} ^ {t} \rangle + \frac {L}{2} \| \boldsymbol {\theta} ^ {t + 1} - \boldsymbol {\theta} ^ {t} \| ^ {2} \tag {26} \\ = - \eta \langle \nabla \mathcal {L} (\pmb {\theta} ^ {t}), \nabla_ {p} \mathcal {L} (\pmb {\theta} ^ {t}) \rangle + \frac {L \eta^ {2}}{2} \| \nabla_ {p} \mathcal {L} (\pmb {\theta} ^ {t}) \| ^ {2} \\ \end{array} +$$ + +Notice that + +$$ +\frac {\left\| \nabla_ {p} \mathcal {L} (\boldsymbol {\theta}) \right\| ^ {2}}{\langle \nabla \mathcal {L} (\boldsymbol {\theta}), \nabla_ {p} \mathcal {L} (\boldsymbol {\theta}) \rangle} = \frac {\sum_ {k} \left(\frac {\partial \mathcal {L}}{\partial w _ {k}}\right) ^ {2}}{\sum_ {k} \left[ \frac {\partial w _ {k}}{\partial \theta_ {k}} \left(\frac {\partial \mathcal {L}}{\partial w _ {k}}\right) ^ {2} \right]} \tag {27} +$$ + +and the actual derivative has the form + +$$ +\frac {\partial w}{\partial \theta} = f ^ {\prime} (\theta) = \frac {1 + e ^ {2 \alpha \theta} + 2 e ^ {\alpha (\theta - d)}}{\left(1 + e ^ {\alpha (\theta - d)}\right) \left(1 + e ^ {\alpha (\theta + d)}\right)}. \tag {28} +$$ + +It is clear that $f^{\prime}(\theta)$ is continuously differentiable on $\mathbb{R}$ and + +$$ +f ^ {\prime \prime} (\theta) = \frac {4 \alpha e ^ {2 \alpha \theta} \sinh (\alpha d) \sinh (\alpha \theta)}{\left[ (1 + e ^ {\alpha (\theta - d)}) (1 + e ^ {\alpha (\theta + d)}) \right] ^ {2}} \tag {29} +$$ + +has a unique zero point $\theta = 0$ . It is actually a global minimum $f'(0) = \frac{2}{1 + e^{\alpha d}}$ and thereby we have + +$$ +\begin{array}{l} \frac {\left\| \nabla_ {p} \mathcal {L} (\boldsymbol {\theta}) \right\| ^ {2}}{\langle \nabla \mathcal {L} (\boldsymbol {\theta}) , \nabla_ {p} \mathcal {L} (\boldsymbol {\theta}) \rangle} \leq \frac {\sum_ {k} \left(\frac {\partial \mathcal {L}}{\partial w _ {k}}\right) ^ {2}}{\sum_ {k} \left[ f ^ {\prime} (0) \left(\frac {\partial \mathcal {L}}{\partial w _ {k}}\right) ^ {2} \right]} \tag {30} \\ = \frac {1 + e ^ {\alpha d}}{2} \\ \end{array} +$$ + +Denote $A = \frac{1 + e^{\alpha d}}{2}$ , the last term in Eq. (26) can be further estimate as + +$$ +\mathcal {L} \left(\boldsymbol {\theta} ^ {t + 1}\right) - \mathcal {L} \left(\boldsymbol {\theta} ^ {t}\right) \leq - \eta \left(1 - \frac {A L \eta}{2}\right) \left\langle \nabla \mathcal {L} \left(\boldsymbol {\theta} ^ {t}\right), \nabla_ {p} \mathcal {L} \left(\boldsymbol {\theta} ^ {t}\right) \right\rangle \tag {31} +$$ + +Since $\langle \nabla \mathcal{L}(\pmb{\theta}^t), \nabla_p \mathcal{L}(\pmb{\theta}^t) \rangle \geq A \| \nabla_p \mathcal{L}(\pmb{\theta}^t) \|^2 \geq 0$ , to form a non-increasing sequence $\{\mathcal{L}(\pmb{\theta}^t)\}_{t \in \mathbb{N}}$ , a proper learning rate should satisfy $\eta < 2 / AL = \frac{4}{L(1 + e^{\alpha d})}$ . + +Under the above conditions, the lower bounded, non-increasing loss sequence must converge, which completes the proof. Further, the best choice is $\eta = 1 / AL = \frac{2}{L(1 + e^{\alpha d})}$ . \ No newline at end of file diff --git a/statetransitionofdendriticspinesimproveslearningofsparsespikingneuralnetworks/images.zip b/statetransitionofdendriticspinesimproveslearningofsparsespikingneuralnetworks/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..529254c468fdb3e20d708090963030b1f9768528 --- /dev/null +++ b/statetransitionofdendriticspinesimproveslearningofsparsespikingneuralnetworks/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e83898bfe9960c0799c535106a63dc9b9f308d8ad8d941fd68470938c6681aed +size 727804 diff --git a/statetransitionofdendriticspinesimproveslearningofsparsespikingneuralnetworks/layout.json b/statetransitionofdendriticspinesimproveslearningofsparsespikingneuralnetworks/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..bdc891ea5b0c6b69084a0cc6696029447e2adec9 --- /dev/null +++ b/statetransitionofdendriticspinesimproveslearningofsparsespikingneuralnetworks/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7278ad5f81d545c2e22c685f7f0379e5343f174630a05955af471dd5daca7381 +size 556812 diff --git a/statisticalinferencewithimplicitsgdproximalrobbinsmonrovspolyakruppert/a2a97d49-665d-4ae0-8a7c-e66f934ebe52_content_list.json b/statisticalinferencewithimplicitsgdproximalrobbinsmonrovspolyakruppert/a2a97d49-665d-4ae0-8a7c-e66f934ebe52_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..a50a6d2cab74e6fc71e638234fba5093bf7ea82e --- /dev/null +++ b/statisticalinferencewithimplicitsgdproximalrobbinsmonrovspolyakruppert/a2a97d49-665d-4ae0-8a7c-e66f934ebe52_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:76750e16563c7ae96b358933bd51a4587ba68a947a428656f7a77944bad8b557 +size 306318 diff --git a/statisticalinferencewithimplicitsgdproximalrobbinsmonrovspolyakruppert/a2a97d49-665d-4ae0-8a7c-e66f934ebe52_model.json b/statisticalinferencewithimplicitsgdproximalrobbinsmonrovspolyakruppert/a2a97d49-665d-4ae0-8a7c-e66f934ebe52_model.json new file mode 100644 index 0000000000000000000000000000000000000000..c744de77aa15e17f4dbb6323211787ceb16df1cf --- /dev/null +++ b/statisticalinferencewithimplicitsgdproximalrobbinsmonrovspolyakruppert/a2a97d49-665d-4ae0-8a7c-e66f934ebe52_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c106f2a9d0a75fbe0f68426bc8a576f7a187eba7293ac8be0a87b05b7f0b875e +size 338220 diff --git a/statisticalinferencewithimplicitsgdproximalrobbinsmonrovspolyakruppert/a2a97d49-665d-4ae0-8a7c-e66f934ebe52_origin.pdf b/statisticalinferencewithimplicitsgdproximalrobbinsmonrovspolyakruppert/a2a97d49-665d-4ae0-8a7c-e66f934ebe52_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e522c236c38d4c0faa41428c7ae92bd125c915b4 --- /dev/null +++ b/statisticalinferencewithimplicitsgdproximalrobbinsmonrovspolyakruppert/a2a97d49-665d-4ae0-8a7c-e66f934ebe52_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8098bdba1074e836052dc39cafebede223df41c242ebff345b3751de233c396e +size 1203808 diff --git a/statisticalinferencewithimplicitsgdproximalrobbinsmonrovspolyakruppert/full.md b/statisticalinferencewithimplicitsgdproximalrobbinsmonrovspolyakruppert/full.md new file mode 100644 index 0000000000000000000000000000000000000000..fdad620a3475e5cbfeff1018803d4d01f59a5185 --- /dev/null +++ b/statisticalinferencewithimplicitsgdproximalrobbinsmonrovspolyakruppert/full.md @@ -0,0 +1,1693 @@ +# Statistical inference with implicit SGD: proximal Robbins-Monro vs. Polyak-Ruppert + +Yoonhyung Lee $^{*1}$ Sungdong Lee $^{*2}$ Joong-Ho Won + +# Abstract + +The implicit stochastic gradient descent (ISGD), a proximal version of SGD, is gaining interest in the literature due to its stability over (explicit) SGD. In this paper, we conduct an in-depth analysis of the two modes of ISGD for smooth convex functions, namely proximal Robbins-Monro (proxRM) and proximal Poylak-Ruppert (proxPR) procedures, for their use in statistical inference on model parameters. Specifically, we derive non-asymptotic point estimation error bounds of both proxRM and proxPR iterates and their limiting distributions, and propose on-line estimators of their asymptotic covariance matrices that require only a single run of ISGD. The latter estimators are used to construct valid confidence intervals for the model parameters. Our analysis is free of the generalized linear model assumption that has limited the preceding analyses, and employs feasible procedures. Our on-line covariance matrix estimators appear to be the first of this kind in the ISGD literature. + +# 1. Introduction + +Consider the optimization problem of the form + +$$ +\min _ {\theta} L (\theta) := \mathbf {E} [ \ell (Z, \theta) ] \tag {1} +$$ + +where $\theta \in \mathbb{R}^p$ is the variable (parameter) of interest, $Z$ is a random variable, and $\mathbf{E}[\cdot ]$ denotes the expectation over the distribution of $Z$ . Function $\ell$ is a real-valued sample function, information on which can only be obtained by observing independent copies of $Z$ . For example, if $\ell$ refers to the negative log-likelihood of the model parameter $\theta$ given data $Z$ , then problem (1) reduces to finding the "true parameter" $\theta_{\star}$ of the model. + +*Equal contribution ${}^{1}$ Kakao Entertainment Corp. ${}^{2}$ Department of Statistics, Seoul National University. Correspondence to: JoongHo Won . + +Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s). + +A popular method for solving problem (1) is the stochastic gradient descent (SGD) method + +$$ +\theta_ {n} = \theta_ {n - 1} - \gamma_ {n} \nabla \ell \left(Z _ {n}, \theta_ {n - 1}\right), \tag {2} +$$ + +where the gradient is with respect to the second argument of $\ell$ . The $\gamma_{n}$ is the algorithm parameter called either step size or learning rate. Assuming $\nabla L(\theta) = \mathbf{E}[\nabla \ell(Z, \theta)]$ , $\nabla \ell(Z_{n}, \theta)$ is an unbiased estimator of $\nabla L(\theta)$ , and SGD (2) is an instance of stochastic approximation due to Robbins & Monro (1951) for finding the root of $\nabla L$ . The past decade witnessed a renewed interest in the Robbins-Monro procedure, mainly due to its adaptivity to large-scale data in machine learning problems (Nemirovski et al., 2009; Bottou, 2010; Bach & Moulines, 2011; Bottou et al., 2018). In particular, SGD and its variants are among the major driving forces of deep learning (LeCun et al., 2015; Abadi et al., 2016). Its convergence property has been extensively studied (Zinkevich, 2003; Nemirovski et al., 2009; Bach & Moulines, 2011). More recently, SGD has been studied as a tool for statistical inference from large datasets (Li et al., 2018; Liang & Su, 2019; Chen et al., 2020). + +A notable issue with SGD is its sensitivity to the step size selection. If it is too small, the convergence can be arbitrarily slow; if it is too large, then the iterate $\{\theta_n\}$ can diverge (Bach & Moulines, 2011; Ryu & Boyd, 2014). + +As an alternative to SGD, consider the following iteration. + +$$ +\theta_ {n} = \operatorname {p r o x} _ {\gamma_ {n} \ell \left(Z _ {n}, \cdot\right)} \left(\theta_ {n - 1}\right), \tag {3} +$$ + +where $\mathrm{prox}_{\gamma f}(\theta) = \mathrm{argmin}_{\theta' \in \mathbb{R}^p} \left\{f(\theta') + \frac{1}{2\gamma} \| \theta' - \theta \|^2 \right\}$ is the proximity operator of $f$ . Here the norm $\|\cdot\|$ is the Euclidean $(\ell_2)$ norm. Using the optimality condition of the minimand in the definition of the operator, iteration (3) can be written as an implicit equation + +$$ +\theta_ {n} = \theta_ {n - 1} - \gamma_ {n} \nabla \ell \left(Z _ {n}, \theta_ {n}\right). \tag {3'} +$$ + +Iteration (3) can be considered as a noisy version of the proximal point algorithm due to Rockafellar (1976), introduced to alleviate the sensitivity to the step size in the (noiseless) gradient descent method. Being relatively new in the literature, iteration (3) has been called in various names: + +incremental proximal method (Bertsekas, 2011), stochastic proximal point method (Ryu & Boyd, 2014; Bianchi, 2016), and implicit SGD (ISGD, Toulis et al., 2014; Toulis & Airoldi, 2017a). + +Convergence of ISGD is studied for the finite population case (Bertsekas, 2011). For infinite population, its stability (that the iterates do not diverge) and asymptotic rate of convergence are studied in Toulis et al. (2014); Ryu & Boyd (2014). Non-asymptotic estimation error bounds are studied in Toulis & Airoldi (2017a); Patrascu & Necoara (2017); Asi & Duchi (2019). These results can be summarized as that ISGD enjoys the same asymptotic rate of convergence as (explicit) SGD, while the former is much more stable and less sensitive to the choice of the step size. + +Asymptotic normality of the ISGD is shown in Toulis & Airoldi (2017a) under several assumptions. However, the result of Toulis & Airoldi (2017a) is limited by the assumption that the sample function $\ell$ takes the form of $\ell(Z,\theta) = g(X^T\theta,Y)$ where $Z = (X,Y)$ , which we shall call the generalized linear model (GLM) assumption. While the GLM model family is one of the most widely used in practice and the GLM assumption simplifies the computation of the proximity operator, it may not fit when dealing with the general problem (1). For example, consider estimating the $\alpha$ quantile of a univariate distribution with CDF $F(\theta)$ . Then $\ell(Z,\theta) = \max(0,\theta - Z) - \alpha(\theta - Z)$ where $Z$ is drawn from $F$ . This function does not satisfy the GLM assumption. In addition, it is assumed that the Fisher information matrix coincides with the Hessian of the objective function $L$ , which is not in general true unless $\ell$ is the negative log-likelihood of $P$ . Furthermore, Toulis & Airoldi (2017a) assume that $L$ is both globally Lipschitz and globally strongly convex, a contradiction (Bach & Moulines, 2011; Asi & Duchi, 2019). + +These restriction and contradiction are relaxed in some sense by Toulis et al. (2021), who consider the proximal Robbins-Monro procedure that idealizes ISGD: + +$$ +\begin{array}{l} \theta_ {n} ^ {+} = \mathrm {p r o x} _ {\gamma_ {n} L} (\theta_ {n - 1}), \\ \theta_ {n} = \theta_ {n - 1} - \gamma_ {n} \nabla \ell \left(Z _ {n}, \theta_ {n} ^ {+}\right), \tag {4} \\ \end{array} +$$ + +and show asymptotic normality of $\theta_{n}$ under the assumption that $L$ is locally strongly convex at $\theta_{\star}$ and the gradient of $L$ is globally Lipschitz (Toulis et al., 2021, Theorem 2.4). Nevertheless, procedure (4) is not feasible since $\theta_{n}^{+}$ cannot be computed ( $L$ is unknown or difficult to compute). ISGD (3) can be understood as a plug-in procedure mimicking (4), since $\theta_{n}$ in (3) is an unbiased estimator of $\theta_{n}^{+}$ . In the sequel, we shall call the ISGD iteration (3) simply proximal Robbins-Monro (proxRM) and distinguish it from (4) by calling the latter the idealized proxRM. Unlike the idealized counterpart, the consistency (convergence) and limiting distribution of proxRM has not been studied well, except for + +the special case mentioned above. + +In the explicit SGD literature, averaging the iterates, known as the Polyak-Ruppert averaging (Polyak & Juditsky, 1992; Ruppert, 1988) has been studied as a means to achieve the optimal asymptotic rate and adapt to large step sizes (Bach & Moulines, 2011). Averaging the ISGD iterates (3), i.e., taking $\bar{\theta}_n = \frac{1}{n}\sum_{k=0}^{n-1}\theta_k$ , can thus be called the proximal Polyak-Ruppert (proxPR) procedure. Asymptotic normality of proxPR is shown by Asi & Duchi (2019). However, non-asymptotic (point) estimation error bounds, which capture the transient behavior of $\{\bar{\theta}_n\}$ , has not been studied well, although was conjectured to improve the rate (Toulis et al., 2021). + +The goal of this paper is to fill these gaps in the literature, as well as to propose a device for efficient statistical inference with ISGD, in line with the similar works in explicit SGD (Li et al., 2018; Liang & Su, 2019; Chen et al., 2020). The latter goal is important since it enables to construct a valid confidence interval for the true parameter. Building the interval on-line is also important as it means a single run of ISGD iteration suffices for legitimate inference. + +Contributions. Specifically, our contributions are as follows. (i) We extend the work by Toulis & Airoldi (2017a) on proxRM for GLM models to non-GLM settings. The relevant results include a non-asymptotic error bound on model parameter estimation, stability of the procedure, and its asymptotic normality under strong convexity. (ii) We elucidate that the above properties agree with those of the idealized proxRM (Toulis et al., 2021), thereby asserting the feasibility of the procedure. (iii) We derive a non-asymptotic estimation error bound for proxPR, featuring the transient behavior of averaged ISGD. (iv) We propose consistent online estimators of the asymptotic covariance matrices of both proxRM and proxPR iterates, enabling statistical inference on the model parameter. In addition to these results toward statistical inference, which requires strong convexity for identifiability of the parameter, (v) we provide a non-asymptotic analysis of the two procedures in the absence of strong convexity. In particular, we show that proxPR achieves the minimax optimal rate up to a logarithmic factor, confirming the conjecture by Toulis et al. (2021). Table 1 summarizes the contributions. + +# 2. Preliminary + +Let us begin with formally defining the objective function of problem (1). + +$$ +L (\theta) \triangleq \mathbf {E} [ \ell (Z, \theta) ] = \int_ {\Omega} \ell (z, \theta) d P (z), +$$ + +where $z$ is an element of the probability space $(\Omega, \mathcal{F}, P)$ , for which the probability measure $P$ can be considered as + +Table 1. Summary of contributions to implicit SGD. Learning rate schedule (R) is assumed. + +
GLM freeFeasibilityNon-asymptoticAsympt. normalityInference
Toulis & Airoldi (2017a)✗✓✓ (RM)✓ (RM)✗
Patrascu & Necoara (2017)✓✓✓ (RM)✗✗
Asi & Duchi (2019)✓✓△ (PR)*✓ (PR)✗
Toulis et al. (2021)✓✗✓ (RM)✓ (RM)✗
This work✓✓✓ (RM, PR)✓ (RM)✓ (RM, PR)
+ +* Restricted to a certain class of "easy" problems. RM = proximal Robbins-Monro; PR = proximal Polyak-Ruppert. + +the distribution of a random variable $Z: \Omega \to \Omega: z \mapsto z$ . In most practical situations $\Omega$ is the Euclidean space $\mathbb{R}^m$ , $\mathcal{F}$ is the Borel sets of $\mathbb{R}^m$ . The sample function $\ell: \Omega \times \mathbb{R}^p \to \mathbb{R}$ is a real-valued. The ISGD procedure is implemented by sampling $Z_1, \ldots, Z_n, \ldots$ from $P$ independently and applying the update equation (3). Finally, the filtration $\mathcal{F}_n$ is the smallest $\sigma$ -algebra generated by $Z_1, \ldots, Z_n$ . + +We make the following basic assumptions on the sample function $\ell$ . + +Assumption A1. Function $\ell(z, \cdot)$ is real-valued convex function in $\mathbb{R}^p$ for each $z \in \Omega$ ; Function $\ell(\cdot, \theta)$ is integrable for each $\theta \in \mathbb{R}^p$ . + +Assumption A2. Function $\ell(Z, \cdot)$ is $\beta(Z)$ -smooth almost surely (a.s.), with $\mathbf{E}[\beta^2(Z)] = \beta_0^2 < \infty$ around a minimizer $\theta_\star$ of $L(\cdot) = \mathbf{E}[\ell(Z, \cdot)]$ . That is, a sample function $\ell(Z, \theta)$ is continuously differentiable in $\theta$ and $\|\nabla \ell(Z, \theta) - \nabla \ell(Z, \theta_\star)\| \leq \beta(Z)\|\theta - \theta_\star\|$ for all $\theta$ , with probability one. + +Definition 2.1 (M-convexity (Ryu & Boyd, 2014)). An extended real-valued function $f: \mathbb{R}^p \to \mathbb{R} \cup \{\infty\}$ is called M-convex at $x \in \mathbb{R}^p$ for a symmetric, positive semidefinite matrix $M \in \mathbb{R}^{p \times p}$ (denoted by $M \succeq 0$ ) if for $s \in \partial f(x)$ + +$$ +f (y) \geq f (x) + s ^ {T} (y - x) + \frac {1}{2} \left\| y - x \right\| _ {M} ^ {2}, \quad \forall y \in \mathbb {R} ^ {p}, (5) +$$ + +where $\| z\| _M = (z^T Mz)^{1 / 2}$ + +Assumption A3. Suppose $\theta_{\star}$ minimizes $L(\theta) = \mathbf{E}[\ell (Z,\theta)]$ . Then $\ell (Z,\cdot)$ is $\Lambda (Z)$ -convex at $\theta_{\star}$ a.s. with $\Lambda (Z)\succeq 0$ and $\Lambda_0 = \mathbf{E}[\Lambda (Z)]$ is positive definite so that $\lambda = \lambda_{\mathrm{min}}(\Lambda_0) > 0$ , where $\lambda_{\mathrm{min}}(M)$ is the smallest eigenvalue of symmetric matrix $M$ . + +Assumption A4. E $\| \nabla \ell (Z,\theta_{\star})\|^{2}\leq \sigma^{2} < \infty$ + +Remark 2.1. If $f$ is differentiable, then condition (5) is equivalent to + +$$ +\left(y - x\right) ^ {T} \left(\nabla f (y) - \nabla f (x)\right) \geq \| y - x \| _ {M} ^ {2}. +$$ + +Observe that if $f$ is $M$ -convex, then it is $\mu I$ -convex with $\mu = \lambda_{\min}(M)$ , where $I$ is the identity matrix. The latter is equivalent to the standard notion of $\mu$ -convexity (if $\mu > 0$ , then $f$ is strongly convex) (Bauschke & Combettes, 2011). + +Remark 2.2. From Assumptions A1, A2, and A4 the objective function $L(\theta) = \mathbf{E}[\ell(Z, \theta)]$ is well-defined for all + +$\theta \in \mathbb{R}^p$ . Furthermore, $L$ is continuously differentiable and its gradient has a representation $\nabla L(\theta) = \mathbf{E}[\nabla \ell(Z,\theta)]$ (Bertsekas, 1973). Assumption A3 implies that $L$ is $\lambda$ -convex at $\theta_{\star}$ . Since $\lambda > 0$ , it also implies that the minimizer $\theta_{\star}$ is unique. + +Throughout, we fix the learning rate schedule as follows. + +$$ +\gamma_ {n} = \gamma_ {1} n ^ {- \gamma} \quad \text {f o r s o m e} \gamma_ {1} > 0 \text {a n d} \gamma > 0. \tag {R} +$$ + +The valid range of the exponent $\gamma$ depends on the algorithm and the conditions on $L$ ; the subsequent discussions will elaborate on this. + +Notation. We employ the following asymptotic notation. For a sequence of random vectors/matrices $\{A_n\}$ defined on $(\Omega, \mathcal{F}, P)$ and a positive scalar sequence $\{b_n\}$ , $A_n = O(b_n)$ means $\mathbf{E}[\| A_n \|] \leq c b_n$ for some $c > 0$ and for all $n = 1, 2, \ldots$ . On the other hand, $A_n = o(b_n)$ means $\mathbf{E}[\| A_n \|] / b_n \to 0$ as $n \to \infty$ . Here the norm $\|\cdot\|$ refers to the (operator) 2-norm. Notation $b_n \downarrow 0$ means that $\{b_n\}$ is positive and converges monotonically toward zero. + +# 3. Approximation of ISGD by SGD + +The results presented in Sects. 4 and 5 rely on the following proposition bounding the difference between ISGD (proxRM) and (explicit) SGD iterates. This result holds without strong convexity. + +Proposition 3.1 (Approximation of ISGD by SGD). In addition to Assumptions A1, A2, and A4, also assume that a minimizer $\theta_{\star}$ of $L$ exists (not necessarily unique). Then, + +$$ +\theta_ {n} = \theta_ {n - 1} - \gamma_ {n} \nabla \ell \left(Z _ {n}, \theta_ {n - 1}\right) + R _ {n}, +$$ + +with + +$$ +\mathbf {E} \left[ \| R _ {n} \| | \mathcal {F} _ {n - 1} \right] \leq \gamma_ {n} ^ {2} \beta_ {0} ^ {2} \| \theta_ {n - 1} - \theta_ {\star} \| + \frac {\gamma_ {n} ^ {2}}{2} \left(\beta_ {0} ^ {2} + \sigma^ {2}\right) \tag {6a} +$$ + +$$ +\mathbf {E} \left[ \| R _ {n} \| ^ {2} \mid \mathcal {F} _ {n - 1} \right] \leq 8 \gamma_ {n} ^ {2} \beta_ {0} ^ {2} \left\| \theta_ {n - 1} - \theta_ {\star} \right\| ^ {2} + 8 \gamma_ {n} ^ {2} \sigma^ {2} \tag {6b} +$$ + +$$ +\mathbf {E} \| R _ {n} \| \leq \gamma_ {n} ^ {2} \left[ \beta_ {0} ^ {2} (r + 1 / 2) + \sigma^ {2} / 2 \right] \tag {6c} +$$ + +$$ +\mathbf {E} \| R _ {n} \| ^ {2} \leq 8 \gamma_ {n} ^ {2} \left(\beta_ {0} ^ {2} r ^ {2} + \sigma^ {2}\right), \tag {6d} +$$ + +where $r = \left(\|\theta_0 - \theta_\star\|^2 + \sigma^2 \sum_{k=1}^\infty \gamma_k^2\right)^{1/2}$ . Inequalities (6a) and (6b) hold for $\gamma \in (0,1]$ , and inequalities (6c) and (6d) hold for $\gamma \in (1/2,1]$ . + +Proposition 3.1 relies on the following intermediate result: + +Lemma 3.1. Under Assumptions A1, we have + +$$ +\left\| \theta_ {n} - \theta_ {n - 1} \right\| = \gamma_ {n} \left\| \nabla \ell \left(Z _ {n}, \theta_ {n}\right) \right\| \leq \gamma_ {n} \left\| \nabla \ell \left(Z _ {n}, \theta_ {n - 1}\right) \right\|. +$$ + +Proposition 3.1 and Lemma 3.1 jointly play the role of Theorem 3.1 in Toulis & Airoldi (2017a), which states that $\nabla \ell(Z_n, \theta_n)$ has the same direction as $\nabla \ell(Z_n, \theta_{n-1})$ under the GLM assumption, expressing ISGD as a variant of SGD. In the absence of this special relation, knowing that the norm of $R_n$ is $O(\gamma_n^2)$ , not just $O(\gamma_n)$ as can be inferred from $\| R_n\|^2 = O(\gamma_n^2)$ , is crucial since it allows (in principle) the techniques of bounding the estimation errors of explicit SGD (e.g., Bach & Moulines, 2011) can be employed by controlling the impact of the additional term $R_n$ (e.g., Theorem 4.1). Furthermore, in the proof of asymptotic normality (Theorem 4.3), Proposition 3.1 is used to obtain the $o(\gamma_n^{3/2}) = n^{-\frac{3}{2}\gamma} \cdot o(1)$ error term in the recursive equation for the estimation error $\theta_n - \theta_\star$ (see Eqs. (A.16) and (A.17)). The resulting recursion admits the use of the central limit theorem due to Fabian (1968, Theorem 2.2) for classical stochastic approximation (including the explicit SGD) can be employed almost directly. Proposition 3.1 is also indispensable (through Theorem 4.3) in showing consistency of the proposed on-line estimators of the asymptotic covariance matrices (Theorem 4.4 and Corollary 4.1). + +# 4. Strongly convex objectives + +# 4.1. Proximal Robbins-Monro + +# 4.1.1. STABILITY + +Under Assumptions A1-A4, Bianchi (2016) and Asi & Duchi (2019, Proposition 3.8) show that the proxRM iterate $\theta_{n}$ converges to the unique solution $\theta_{\star}$ a.s. A finite-sample (non-asymptotic) mean-squared error bound of $\theta_{n}$ in estimating model parameter $\theta_{\star}$ is obtained by Patrascu & Necoara (2017, Theorem 14) for $\gamma \in (0,1]$ . A simpler bound for $\gamma \in (1/2,1]$ can be found as follows. We provide the proof in Appendix A since it shows how the analysis of Toulis & Airoldi (2017a) extends to non-GLM settings (and without the contradictory assumptions). + +Definition 4.1. $\phi_{\gamma}(n) \triangleq (n^{1 - \gamma} - 1) / (1 - \gamma)$ if $\gamma \neq 1$ , and $\phi_{\gamma}(n) \triangleq \log n$ if $\gamma = 1$ . + +Theorem 4.1 (Non-asymptotic point estimation error bound). Under Assumptions A1-A4, for any initial step size $\gamma_1 > 0$ when $\gamma \in (1/2, 1)$ and for $\gamma_1 > 1/(2\lambda)$ when $\gamma = 1$ , there exist a fixed integer $n_0$ and constants $K_1, D_{n_0}$ such that + +$$ +\begin{array}{l} \mathbf {E} \left\| \theta_ {n} - \theta_ {\star} \right\| ^ {2} \leq K _ {1} n ^ {- \gamma} + \exp \left(- \frac {1}{2} \log (1 + 2 \lambda \gamma_ {1}) \phi_ {\gamma} (n)\right) \\ \times \left(\left\| \theta_ {0} - \theta_ {\star} \right\| ^ {2} + D _ {n _ {0}}\right), \quad n \in \mathbb {N}. \tag {7} \\ \end{array} +$$ + +All of the constants in inequality (7) are explicit, and are presented at the end of the proof given in Appendix A.3. + +The result of Theorem 4.1 can be summarized as $\mathbf{E}\left\| \theta_{n} - \theta_{\star}\right\|^{2} = O(\gamma_{n})$ . This asymptotic rate of $O(n^{-\gamma})$ matches that of SGD (Bach & Moulines, 2011) and the idealized proxRM with the same learning rate schedule (R) with $\gamma \in (0,1]$ . For $\gamma < 1$ , the effect of the initial point is forgotten at an exponential rate (second term in the right-hand side of the inequality (7)). For $\gamma = 1$ , the rate is also $O(\gamma_{n})$ provided that $\gamma_{1} \geq (e^{2} - 1) / (2\lambda)$ , although the "exponential forgetting" behavior is not so much prominent (it is polynomial). Either way, this insensitivity to the initial step size is one that features ISGD in contrast to SGD, where in the latter the impact of the initial point may exponentially increase with the initial step size $\gamma_{1}$ in the transient phase (Bach & Moulines, 2011), while in the former it always decreases. + +The stability of proxRM can also be formalized in a nonMSE fashion. In order to analyze the error $\theta_{n} - \theta_{\star}$ (not $\| \theta_n - \theta_\star \| ^2$ ), we need an additional assumption: + +Assumption B1. The objective function $L$ is twice differentiable at $\theta_{\star}$ . + +The Hessian $\nabla^2 L$ of $L$ at $\theta_{\star}$ is denoted by $\mathcal{H}(\theta_{\star})$ . Note $0 < \lambda \leq \lambda_{\min}(\mathcal{H}(\theta_{\star}))$ . + +Theorem 4.2 (Stability). Under Assumptions A1-A4 and B1, if $\gamma \in (1/2, 1)$ or $\gamma = 1$ and $\gamma_1 \geq (e^2 - 1)/\lambda$ , then the proxRM iterate $\{\theta_n\}$ satisfies the following. + +$$ +\mathbf {E} \left[ \theta_ {n} - \theta_ {\star} \right] = Q _ {1} ^ {n} \left(\theta_ {0} - \theta_ {\star}\right) + o (1) \tag {8} +$$ + +where $Q_{1}^{n} = \prod_{i = 1}^{n}[I + \gamma_{i}\mathcal{H}(\theta_{\star})]^{-1}$ + +In contrast, if $\{\vartheta_n\}$ denotes the explicit SGD iterate (started from the same initial point), then + +$$ +\mathbf {E} \left[ \vartheta_ {n} - \theta_ {\star} \right] = P _ {1} ^ {n} \left(\theta_ {0} - \theta_ {\star}\right), \quad P _ {1} ^ {n} = \prod_ {i = 1} ^ {n} \left[ I - \gamma_ {i} \mathcal {H} \left(\theta_ {\star}\right) \right], +$$ + +ignoring the remainder term in the second-order Taylor expansion of $L$ at $\theta_{\star}$ . To avoid the explosion of the leading eigenvalue of $P_1^n$ , it is desirable to control the initial step size $\gamma_1 < 2 / \lambda_{\max}(\mathcal{H}(\theta_{\star})) \leq 2 / \lambda$ . In other words, in SGD the initial step size should not be large. On the other hand, in proxRM the eigenvalues of $Q_1^n$ is always strictly smaller than 1 regardless of the choice of $\gamma_1$ (when $\gamma < 1$ ). Thus in proxRM the step sizes can be taken large to promote fast convergence. A similar informal discussion can be found in (Toulis & Airoldi, 2017a, Sect. 2.5); we derive equation (8) formally under weaker assumptions on differentiability and without the GLM model. + +# 4.1.2. INFERENCE + +Asymptotic normality. The following result generalizes that of Toulis & Airoldi (2017a) under weaker differentia + +bility assumptions and without the GLM model. As already mentioned in Sect. 3, the key instrument for deriving this result is Proposition 3.1, which quantifies the degree of approximation to SGD by ISGD. Our proof also fixes a flaw in the proof of Toulis & Airoldi (2017a, Theorem 2.4); see Remark A.1. + +In order to establish asymptotic normality, we need additionally the following assumption on the stochastic error: + +Assumption B2. Let $\sigma_{n,s}^2 = \mathbf{E}(I_{\| \varepsilon_n(\theta_\star)\|^2\geq s / \gamma_n}\| \varepsilon_n(\theta_\star)\|)$ where $\varepsilon_{n}(\theta_{\star}) = \nabla \ell (Z_{n},\theta_{\star}) - \nabla L(\theta_{\star})$ . Then for all $s > 0$ $\sum_{i = 1}^{n}\sigma_{i,s}^{2} = o(n)$ if $\gamma = 1$ , and $\sigma_{n,s}^2 = o(1)$ otherwise. + +Theorem 4.3 (Asymptotic normality). Suppose Assumptions A1-A4 and B1-B2 hold. Then, the proxRM iterate $\theta_{n}$ is asymptotically normal, such that + +$$ +n ^ {\gamma / 2} \left(\theta_ {n} - \theta_ {\star}\right) \stackrel {d} {\rightarrow} \mathcal {N} _ {p} (0, \Sigma) \tag {9} +$$ + +where + +$$ +\Sigma = \left\{ \begin{array}{l l} \gamma_ {1} ^ {2} \mathcal {L} _ {2 \gamma_ {1}} ^ {- 1} \mathcal {H} (\theta_ {\star}) - I (\mathcal {I} (\theta_ {\star})), & \gamma = 1, \gamma_ {1} \geq \frac {e ^ {2} - 1}{\lambda}, \\ \gamma_ {1} ^ {2} \mathcal {L} _ {2 \gamma_ {1}} ^ {- 1} \mathcal {H} (\theta_ {\star})) (\mathcal {I} (\theta_ {\star})), & \gamma \in (1 / 2, 1), \end{array} \right. \tag {10} +$$ + +for $\mathcal{I}(\theta_{\star}) = \mathbf{E}[\nabla \ell (Z,\theta_{\star})\nabla \ell (Z,\theta_{\star})^{T}]$ . Here, $\mathcal{L}_P^{-1}$ denotes the inverse operator of the Lyapunov linear map $\mathcal{L}_P(X) = \frac{1}{2} (PX + XP)$ for symmetric, positive definite matrix $P$ . + +Remark 4.1. The inverse of the Lyapunov map has a closed form: + +$$ +\operatorname {v e c} \left(\mathcal {L} _ {2 B} ^ {- 1} (Y)\right) = \left(I \otimes B + B \otimes I\right) ^ {- 1} \operatorname {v e c} (Y) +$$ + +where $\otimes$ denotes the Kronecker product and $\operatorname{vec}(\cdot)$ refers to the usual vectorization operator for matrices. + +Theorem 4.3 emphasizes that, in order for proxRM to converge (in distribution), $\gamma_1 > 1 / (2\lambda) \geq 1 / [2\lambda_{\min}(\mathcal{H}(\theta_\star))]$ is necessary, at least for $\gamma = 1$ . (Note $\gamma_1 \geq (e^2 - 1) / \lambda$ implies this condition.) Thus in proxRM a large initial step is promoted, rather than prohibited for a stability concern as in explicit SGD; see the discussion after Theorem 4.2. + +Estimation of the asymptotic covariance matrix. An obvious way of consistently estimating the covariance matrix $\Sigma$ of the asymptotic distribution (9) is to run $n$ proxRM iterations $B$ times independently, and take + +$$ +B ^ {- 1} \sum_ {i = 1} ^ {B} \left(\theta_ {n} ^ {(i)} - \bar {\theta}\right) \left(\theta_ {n} ^ {(i)} - \bar {\theta}\right) ^ {T}, \tag {11} +$$ + +where $\theta_{n}^{(i)}$ denotes the $n$ th iterate for the $i$ th run. This estimator is of course not very practical since many runs are required. Here we show a consistent estimator based on only a single run can be constructed. Specifically, we propose to use + +$$ +\hat {\Sigma} _ {n} = \left\{ \begin{array}{l l} \gamma_ {1} ^ {2} \mathcal {L} _ {2 \gamma_ {1} \hat {H} _ {n} - I} ^ {- 1} (\hat {I} _ {n}), & \gamma = 1, \gamma_ {1} \geq \frac {e ^ {2} - 1}{\lambda}, \\ \gamma_ {1} ^ {2} \mathcal {L} _ {2 \gamma_ {1} \hat {H} _ {n}} ^ {- 1} (\hat {H} _ {n}), & \gamma \in (1 / 2, 1), \end{array} \right. +$$ + +where + +$$ +\hat {H} _ {n} = \frac {1}{n} \sum_ {k = 1} ^ {n} \nabla^ {2} \ell \left(Z _ {k}, \theta_ {k - 1}\right), \tag {12} +$$ + +$$ +\hat {I} _ {n} = \frac {1}{n} \sum_ {k = 1} ^ {n} \nabla \ell \left(Z _ {k}, \theta_ {k - 1}\right) \nabla \ell \left(Z _ {k}, \theta_ {k - 1}\right) ^ {T} +$$ + +are plug-in estimators of $\mathcal{H}(\theta_{\star})$ and $\mathcal{I}(\theta_{\star})$ , respectively. It is clear that both $\hat{H}_n$ and $\hat{I}_n$ can be computed in an on-line fashion, so can $\hat{\Sigma}_n$ . Since $\hat{H}_n$ may not be positive definite in practice, a bit of adjustment on its eigenvalues may be needed to ensure invertibility (see Remark 4.1). + +In Theorem 4.4 below, we show that with additional regulatory assumptions along with the positive-definite adjustment, $\hat{\Sigma}_n$ is a consistent estimator of $\Sigma$ , from which valid inference on $\theta_{\star}$ can be implemented. The following assumptions are adopted from Chen et al. (2020). + +Assumption B3. For the error sequence $\varepsilon_{n} = \nabla L(\theta_{n - 1}) - \nabla \ell (Z_{n},\theta_{n - 1})$ , the fourth conditional moment is bounded as follows. + +$$ +\mathbf {E} \big [ \| \varepsilon_ {n} \| ^ {4} | \mathcal {F} _ {n - 1} \big ] \leq \Sigma_ {3} + \Sigma_ {4} \left\| \theta_ {n - 1} - \theta_ {\star} \right\| ^ {4} +$$ + +for some constants $\Sigma_3$ and $\Sigma_4$ . + +Assumption B4. The sample function $\ell(Z, \cdot)$ is twice differentiable a.s., and is $M$ -Lipschitz continuous at the minimizer $\theta_{\star}$ of $L(\cdot) = \mathbf{E}[\ell(Z, \cdot)]$ . That is, $\nabla^2 \ell(Z, \theta)$ exists for all $\theta$ and $\left\| \nabla^2 \ell(Z, \theta) - \nabla^2 \ell(Z, \theta_{\star}) \right\|\leq M\|\theta - \theta_{\star}\|$ for all $\theta$ , with probability one. + +Assumption B5. The sample function $\ell (Z,\cdot)$ is twice differentiable a.s. The second moment of the Hessian is bounded: + +$$ +\left\| \mathbf {E} \left[ \left(\nabla^ {2} \ell (Z, \theta_ {\star})\right) ^ {2} \right] - \left[ \mathcal {H} (\theta_ {\star}) \right] ^ {2} \right\| \leq L _ {4} +$$ + +for some constant $L_4$ . + +Remark 4.2. According to Lemma 3.1 of Chen et al. (2020), Assumption B3 is satisfied if $||\nabla^2\ell(\theta, Z)|| \leq H(Z)$ for some $H$ with a bounded fourth moment. Thus, it can be easily checked that these assumptions hold for common losses such as quadratic or logistic loss. In fact Assumptions B3-B5 correspond to part 3 of Assumption 3.2 and Assumption 4.1 of Chen et al. (2020). Note part 2 of their Assumption 3.2 is not used in the present paper. + +Theorem 4.4 (Consistency of plug-in estimator). Suppose Assumptions A1-A4, B1, and B3-B5 hold. Let $\hat{H}_n$ and $\hat{I}_n$ be as given in Equation (12). Let $\beta_{+} = 1$ if $\gamma = 1$ and $\beta_{+} = 0$ otherwise. Choose $\delta \in (\beta_{+} / (2\gamma_{1}), \lambda_{\min}(\mathcal{H}(\theta_{\star})))$ and let $\tilde{H}_n = P\mathrm{diag}(\max(d_1, \delta), \ldots, \max(d_p, \delta))P^T$ for the spectral decomposition $P\mathrm{diag}(d_1, \ldots, d_p)P^T$ of $\hat{H}_n$ . Then, for the asymptotic covariance matrix (10), + +$$ +\mathbf {E} \left\| \gamma_ {1} ^ {2} \mathcal {L} _ {2 \gamma_ {1} \tilde {H} _ {n} - I} ^ {- 1} (\hat {I} _ {n}) - \Sigma \right\| = O \left(\gamma_ {n} ^ {1 / 2}\right) +$$ + +$$ +\begin{array}{l} i f \gamma = 1, \gamma_ {1} \geq \frac {e ^ {2} - 1}{\lambda}, 2 \gamma_ {1} \mathcal {H} (\theta_ {\star}) \succ I; i f \gamma \in (\frac {1}{2}, 1), \\ \mathbf {E} \left\| \gamma_ {1} ^ {2} \mathcal {L} _ {2 \gamma_ {1} \tilde {H} _ {n}} (\hat {I} _ {n}) - \Sigma \right\| = O (\gamma_ {n} ^ {1 / 2}). \\ \end{array} +$$ + +Thus the $100(1 - \alpha)\%$ confidence interval for the $j$ -th component of $\theta_{\star}$ can be approximated by $\theta_{n,j} \pm z_{\alpha/2} \hat{\sigma}_{n,j}$ where $z_{\alpha/2}$ is the $1 - \alpha/2$ quantile of the standard normal distribution, and + +$$ +\hat {\sigma} _ {n, j} = \left\{ \begin{array}{l l} n ^ {- 1 / 2} \gamma_ {1} \sqrt {\left[ \mathcal {L} _ {2 \gamma_ {1} \tilde {H} _ {n} - I} (\hat {I} _ {n}) \right] _ {j j}}, & \gamma = 1, \\ n ^ {- \gamma / 2} \gamma_ {1} \sqrt {\left[ \mathcal {L} _ {2 \gamma_ {1} \tilde {H} _ {n}} (\hat {I} _ {n}) \right] _ {j j}}, & \gamma \in (1 / 2, 1). \end{array} \right. \tag {13} +$$ + +# 4.2. Proximal Polyak-Ruppert + +# 4.2.1. STABILITY + +With slightly stronger assumptions on the objective function, the stability of proxPR can be analyzed: + +Assumption A2'. Function $\ell(Z, \cdot)$ is $\beta_0$ -smooth a.s. around the minimizer $\theta_{\star}$ of $L(\cdot) = \mathbf{E}[\ell(Z, \cdot)]$ . That is, a sample function $\ell(Z, \theta)$ is continuously differentiable in $\theta$ and $\|\nabla \ell(Z, \theta) - \nabla \ell(Z, \theta_{\star})\| \leq \beta_0 \| \theta - \theta_{\star}\|$ for all $\theta$ , with probability one. + +Assumption A4'. E $\| \nabla \ell (Z,\theta_{\star})\|^{4}\leq \sigma^{4} < \infty$ + +Note Assumption A2' (resp. A4') implies Assumption A2 (resp. A4). + +Theorem 4.5 (Non-asymptotic point estimation error bound). Under Assumptions A1, $A2'$ , A3, $A4'$ , B1, and B4, for $\bar{\theta}_n = \frac{1}{n}\sum_{k=0}^{n-1}\theta_k$ , the following holds for $\gamma \in (1/3, 1)$ . + +$$ +\begin{array}{l} \left(\mathbf {E} \left\| \bar {\theta} _ {n} - \theta_ {\star} \right\| ^ {2}\right) ^ {1 / 2} \leq \frac {1}{\sqrt {n}} \left[ \operatorname {t r} \left(\mathcal {H} \left(\theta_ {\star}\right) ^ {- 1} \mathcal {I} \left(\theta_ {\star}\right) \mathcal {H} \left(\theta_ {\star}\right) ^ {- 1}\right) \right] ^ {1 / 2} \\ + \frac {K _ {1} ^ {1 / 2}}{\lambda^ {1 / 2} n} \Big ((\beta_ {0} + \gamma_ {1} ^ {- 1}) n ^ {\gamma / 2} + 2 \beta_ {0} \phi_ {\gamma} ^ {1 / 2} (n) \\ + \gamma (\beta_ {0} + \gamma_ {1} ^ {- 1}) \phi_ {1 - \gamma / 2} (n) + \frac {M}{2} \phi_ {\gamma} (n) \Bigg) \\ + \frac {\tilde {\mathcal {A}}}{\lambda^ {1 / 2} n} + \frac {M \tilde {\mathcal {B}}}{2 \lambda^ {1 / 2} n} \\ + \frac {\beta_ {0} + \gamma_ {1} ^ {- 1}}{\lambda^ {1 / 2}} \exp \left(- \frac {1}{4} \log (1 + 2 \lambda \gamma_ {1}) \phi_ {\gamma} (n)\right) \\ \times \left(\left\| \theta_ {0} - \theta_ {\star} \right\| ^ {2} + D _ {n _ {0}}\right) ^ {1 / 2}, \tag {14} \\ \end{array} +$$ + +where $n_0, K_1, D_{n_0}$ are the same as in Theorem 4.1. + +The constants $\tilde{\mathcal{A}}$ and $\tilde{\mathcal{B}}$ in inequality (14) are explicit, and are presented at the end of the proof given in Appendix A.7. + +Compared with the (explicit) SGD (Bach & Moulines, 2011, Theorem 3), the allowed range of $\gamma$ is a bit narrower. (This is due to Lemma A.2 and Corollary A.1 in the Appendix A.) However, when $M > 0$ , to obtain the optimal $O(1/n)$ rate (in mean square error) independent of $\gamma_{n}$ , we need $\gamma \in (1/2, 1]$ , just as SGD (for $\gamma = 1$ we get a simpler bound + +by averaging the bound in Theorem 4.1); when $M = 0$ ( $L$ is quadratic) then the rate is $O(1/n)$ for all $\gamma \in (1/3, 1]$ . The second slowest term has an order of either $O(n^{-(2 - \gamma)})$ or $O(n^{-(1 + \gamma)})$ due to the second line in inequality (14), suggesting $\gamma = 2/3$ to get a balance. + +The rate of "forgetting the initial condition" consists of two parts, one with the rate of $O(1/n^2)$ involving quantities $\tilde{A}$ and $\tilde{B}$ and the other with an exponential rate of $O(\exp\left(-\frac{1}{2}\log(1 + 2\lambda\gamma_1)\phi_\gamma(n)\right))$ . Furthermore, the constant $\tilde{B}$ can be quite large: it involves the term exponential in $\phi_{\frac{5}{3}\gamma}(k)$ , which is increasing if $\gamma < 3/5$ (see Appendix A). Thus, unlike proxRM, the impact of the initial condition many remain for a long time, and this is what we observed in the experiments in Sect. 6. Like in SGD, having a burn-in period before taking averages appears to be beneficial. + +The key difference between proxPR the forward Polyak-Ruppert (averaged explicit SGD) is that there is no exponential term multiplied to the constant $\tilde{\mathcal{B}}$ in (14), which corresponds to the constant “ $A$ ” in Theorem 3 of Bach & Moulines (2011). Thus there is no “catastrophic term” in proxPR. This suggests that we can take $\gamma_{1}$ large. + +Remark 4.3. In Toulis et al. (2016), a non-asymptotic error bound with rate $O(1/n)$ for any $\gamma \in (1/2, 1]$ is obtained for the averaged iterate, however under the contradictory assumption that the objective function $L$ is both globally Lipschitz and globally strongly convex, as well as the GLM assumption. In particular, their Lemma 5 crucially depends on the Lipschitz continuity of $L$ . + +# 4.2.2. INFERENCE + +Asymptotic normality. The asymptotic normality of proxPR, i.e., that of $\bar{\theta}_n = \frac{1}{n}\sum_{k=0}^{n-1}\theta_k$ , is established in Asi & Duchi (2019, Theorem 3.11) for $\gamma \in (1/2,1)$ . The asymptotic covariance matrix is $n^{-1}\mathcal{H}(\theta_\star)^{-1}\mathcal{I}(\theta_\star)\mathcal{H}(\theta_\star)^{-1}$ , which achieves the Cramér-Rao lower bound. Its rate of vanishing matches that of the asymptotic covariance matrix of the proxRM iterate $\theta_n$ , but $\bar{\theta}_n$ is statistically more efficient. + +Estimation of the asymptotic covariance matrix. The proof of Theorem 4.4 involves consistency of $\hat{H}_n$ and $\hat{I}_n$ in estimating $\mathcal{H}(\theta_{\star})$ and $\mathcal{I}(\theta_{\star})$ respectively (see Lemma A.4) and that $\hat{H}_n$ is asymptotically equivalent to $\hat{H}_n$ . Hence $\tilde{H}_n^{-1}\hat{I}_n\tilde{H}_n^{-1}$ is a consistent estimator of $\mathcal{H}(\theta_{\star})^{-1}\mathcal{I}(\theta_{\star})\mathcal{H}(\theta_{\star})^{-1}$ , the asymptotic covariance matrix of the scaled Polyak-Ruppert average $\sqrt{n}\bar{\theta}_n = \frac{1}{\sqrt{n}}\sum_{k=0}^{n-1}\theta_k$ . It follows: + +Corollary 4.1 (Plug-in estimator). Suppose Assumptions A1-A4, B1, and B3-B5 hold. Then, for $\tilde{H}_n$ and $\hat{I}_n$ as appeared in Theorem 4.4 and for $\gamma \in (1/2,1)$ , + +$$ +\mathbf {E} \left\| \tilde {H} _ {n} ^ {- 1} \hat {I} _ {n} \tilde {H} _ {n} ^ {- 1} - \mathcal {H} \left(\theta_ {\star}\right) ^ {- 1} \mathcal {I} \left(\theta_ {\star}\right) \mathcal {H} \left(\theta_ {\star}\right) ^ {- 1} \right\| = O \left(\gamma_ {n} ^ {1 / 2}\right). +$$ + +An asymptotic $100(1 - \alpha)\%$ confidence interval for the $j$ -th component of $\theta_{\star}$ is given by $\bar{\theta}_{n,j} \pm z_{\alpha / 2} \tilde{\sigma}_{n,j}$ where + +$$ +\tilde {\sigma} _ {n, j} = n ^ {- 1 / 2} \sqrt {\left[ \tilde {H} _ {n} ^ {- 1} \hat {I} _ {n} \tilde {H} _ {n} ^ {- 1} \right] _ {j j}}, \quad \gamma \in (1 / 2, 1). \tag {15} +$$ + +# 5. Non-strongly convex objectives + +# 5.1. Proximal Robbins-Monro + +In this and the next subsection, we do not assume that the objective function $L$ is strongly convex. However we do assume that the minimum is attained. In other words, we replace Assumption A3 with a weaker one: + +Assumption A3'. There exists a minimizer $\theta_{\star}$ of the objective $L$ . The minimizer may not be unique. + +Since the minimizer is not unique, we derive a finite-sample bound on the objective value. + +Theorem 5.1 (Non-asymptotic optimization error bound). Under Assumptions A1, $A2'$ , $A3'$ , and A4, the following holds for the proxRM iterate (3): + +$$ +\mathbf {E} \left[ L \left(\theta_ {n}\right) - L \left(\theta_ {\star}\right) \right] \leq +$$ + +$$ +\left\{ \begin{array}{l l} \Gamma_ {1} \cdot \frac {\delta_ {0} + \gamma_ {1} ^ {2} (1 + \phi_ {2 \gamma} (n))}{\phi_ {1 - \gamma / 2} (n) - \phi_ {1 - \gamma / 2} (n _ {1} - 1)}, & \gamma \in (0, \frac {1}{2} ], \\ \Gamma_ {2} \cdot \frac {\delta_ {0} + \gamma_ {1} ^ {2} \zeta (2 \gamma)}{\phi_ {1 - \gamma / 2} (n) - \phi_ {1 - \gamma / 2} (n _ {1} - 1)}, & \gamma \in (\frac {1}{2}, \frac {2}{3}), \\ \Gamma_ {3} \cdot \frac {\delta_ {0} + \gamma_ {1} ^ {2} \zeta (2 \gamma)}{\phi_ {\gamma} (n) - \phi_ {\gamma} (n _ {1} - 1)}, & \gamma \in [ \frac {2}{3}, 1 ], \end{array} \right. +$$ + +for $n \geq n_1 \triangleq \max \{\inf \{n \in \mathbb{N} : \gamma_n \leq 1 / \beta_0\}, 3\}$ , where $\delta_0 = \| \theta_0 - \theta_\star \|^2$ ; $\zeta(\alpha) = \sum_{k=1}^{\infty} k^{-\alpha}$ is the Riemann zeta function. + +The constants $\Gamma_1, \Gamma_2$ , and $\Gamma_3$ are explicit, and are presented at the end of the proof given in Appendix A.8. + +This bound is decreasing only if $\gamma > 2/5$ . Thus the rate is $O(n^{-(1 - 5\gamma / 2)})$ if $2/5 < \gamma < 1/2$ , $O(n^{-1/4} \log n)$ if $\gamma = 1/2$ , $O(n^{-\gamma/2})$ if $1/2 < \gamma < 2/3$ , $O(n^{-(1 - \gamma)})$ if $2/3 < \gamma < 1$ , and $O(1 / \log n)$ if $\gamma = 1$ . The best rate is attained for $\gamma = 2/3$ which is $O(n^{-1/3})$ . This is the same rate as the explicit SGD counterpart (Bach & Moulines, 2011, Theorem 4), while the latter is valid for $\gamma \in [1/2, 1]$ . Furthermore, no catastrophic term appears in the bounds in Theorem 5.1. + +The convergence rates and stability implied in Theorem 5.1 fully agree with Toulis et al. (2021, Theorem 2) obtained for the idealized, but infeasible, proxRM procedure $(\gamma \in (1/2, 1])$ . Therefore, realizing the ideal procedure (4) by equation (3) loses nothing. + +# 5.2. Proximal Poylak-Ruppert + +Theorem 5.2 (Non-asymptotic optimization error bound). Under Assumptions A1, $A2'$ , $A3'$ , and A4, the following + +holds. + +$$ +\mathbf {E} \left[ L \left(\bar {\theta} _ {n}\right) - L \left(\theta_ {\star}\right) \right] \leq +$$ + +$$ +\left\{ \begin{array}{l l} \frac {\tilde {\Gamma} _ {1}}{n} + \frac {\sigma^ {2} \gamma_ {1} ^ {2}}{(1 - 2 \gamma) n ^ {\gamma}} + \frac {2 \tilde {\sigma} ^ {2} \gamma_ {1}}{(1 - \gamma) n ^ {\gamma}}, & \gamma \in (0, \frac {1}{2}), \\ \frac {\tilde {\Gamma} _ {2}}{n} + \frac {\sigma^ {2} \gamma_ {1} ^ {2} (1 + \log n)}{\sqrt {n}} + \frac {2 \tilde {\sigma} ^ {2} \gamma_ {1}}{(1 - \gamma) \sqrt {n}}, & \gamma = \frac {1}{2}, \\ \frac {\tilde {\Gamma} _ {3}}{n} + \frac {\sigma^ {2} \gamma_ {1} ^ {2} \zeta (2 \gamma)}{n ^ {1 - \gamma}} + \frac {2 \tilde {\sigma} ^ {2} \gamma_ {1}}{(1 - \gamma) n ^ {\gamma}}, & \gamma \in (\frac {1}{2}, 1), \\ \frac {\tilde {\Gamma} _ {3}}{n} + \sigma^ {2} \gamma_ {1} ^ {2} \zeta (2) + \frac {2 \tilde {\sigma} ^ {2} \gamma_ {1} \log n}{(1 - \gamma) n}, & \gamma = 1 \end{array} \right. +$$ + +for $n\geq n_{*}\triangleq \inf \{k\in \mathbb{N}:(\gamma_{k}\beta_{0})\geq 1 / 2\}$ . Also, + +$$ +\mathbf {E} \left[ L \left(\bar {\theta} _ {n}\right) - L \left(\theta_ {\star}\right) \right] \leq +$$ + +$$ +\left\{ \begin{array}{l l} \frac {\beta_ {0}}{2} \Big (\delta_ {0} + \frac {\sigma^ {2} \gamma_ {1} ^ {2}}{(1 - 2 \gamma) (2 - 2 \gamma)} n ^ {1 - 2 \gamma} \Big), & \gamma \in (0, \frac {1}{2}), \\ \frac {\beta_ {0}}{2} \Big (\delta_ {0} + \sigma^ {2} \gamma_ {1} ^ {2} \frac {\log (n + 1)}{n} \Big), & \gamma = \frac {1}{2}, \\ \frac {\beta_ {0}}{2} \Big (\delta_ {0} + \frac {\sigma^ {2} \gamma_ {1} ^ {2} \zeta (2 \gamma)}{n} \Big), & \gamma \in (\frac {1}{2}, 1 ], \end{array} \right. +$$ + +for $n < n_{*}$ , where $\delta_0 = \| \theta_0 - \theta_\star \|^2$ . + +The constants $\tilde{\Gamma}_1, \tilde{\Gamma}_2, \tilde{\Gamma}_3$ , and $\tilde{\sigma}^2$ are explicit, and are presented at the end of the proof given in Appendix A.9. + +The convergence rate can be summarized as $O(n^{-\gamma} \vee n^{-(1 - \gamma)})$ . Thus with $\gamma = 1/2$ , we attain the minimax optimal asymptotic rate of $O(n^{-1/2})$ (Ruppert, 1988) up to a logarithmic factor. We have thereby confirmed the conjecture by Toulis et al. (2021, Remark 3.1) that the minimax rate may be achieved by averaging the (ideal) proxRM iterates, i.e., proxPR. Moreover, our procedure is feasible. Compared to explicit SGD (Bach & Moulines, 2011, Theorem 6), again no catastrophic term is involved and the initial step size $\gamma_1$ can be taken large to obtain the best rate. + +# 6. Experiments + +# 6.1. Point estimation and optimization + +![](images/1cb48620b2ce68114918e0a7cbc5767cd145d541bd3f93a94fd0b46840d0403a.jpg) + +![](images/fb9caac8675c259480b7d0f5e07938c8e65acb16f6026972822e3c4a03e069ea.jpg) + +![](images/0f17dd03ad1d1f26aa9be957aee2af12f2d098dfbeef82894c00472d93e0d64c.jpg) +Figure 1. Error reduction for various learning rates. + +![](images/d46b13487d3a8e7ac7b3b10a4080454b379606d30d28371fb4420c6c62ff1140.jpg) + +$$ +\text {t y p e - - p r o x P R - - p r o x R M} +$$ + +$$ +\begin{array}{c c c c c} \vee & 1 / 5 & - 2 / 5 & 2 / 3 \\ & 1 / 3 & + 1 / 2 & * 1 \end{array} +$$ + +![](images/024a485551bb9a78be1775c0520a08629b773785478b7bdd82cb54cdffb842a0.jpg) +Figure 2. Error reduction for various values of initial step size. + +Following Bach & Moulines (2011), we examined the convergence behavior of proxRM and proxPR using two univariate functions: $L(\theta) = \frac{1}{2}\theta^2$ (strongly convex) and $L(\theta) = \frac{1}{4}\theta^4$ (non-strongly convex); the sample functions were chosen $\ell(Z, \theta) = \frac{1}{2}\theta^2 + Z\theta$ and $\ell(Z, \theta) = \frac{1}{4}\theta^4 + Z\theta$ where $Z \sim N(0, 4^2)$ . We fixed the initial point $\theta_0 = 10$ for the quadratic and $\theta_0 = 2$ for the quartic function, and observed 100 independent runs of $n = 10^6$ ISGD iterations for initial step size $\gamma_1 \in \{1/5, 1, 5, 20, 100\}$ and exponent $\gamma \in \{1/5, 1/3, 2/5, 1/2, 2/3, 1\}$ . + +Figs. 1 and 2 plot the squared estimation $(\|\theta_{n} - \theta_{\star}\|^2)$ or optimization $(L(\theta_{n}) - L(\theta_{\star}))$ error averaged over all replications for each iteration. The trend generally aligns with the results in Sects. 4 and 5. First, several instances of proxPR showed slower reduction than proxRM in the early stage of the iteration, as expected by the theory. For the strongly convex case, the error reduction was proportional to $\gamma$ in proxRM and at the same fastest convergence rate in proxPR for all values except for $\gamma = 1$ , for which too small an initial step size showed a noticeable slowdown. For a given $\gamma$ , the rate was proportional to $\gamma_{1}$ in proxRM, ending up with parallel lines in Fig. 2; in proxPR, the rate was independent of $\gamma$ and $\gamma_{1}$ . Note that an initial step size as large as 100 was allowed, with no explosion, confirming the stability of ISGD over SGD. For the non-strongly convex case, $\gamma = 1$ was the fastest among proxRM if $\gamma_{1}$ was not too small but became the slowest among proxPR, for which slower decays led to faster convergence. + +# 6.2. Interval estimation and inference + +To evaluate the performance of the plug-in estimators of the asymptotic covariance matrices (Theorem 4.4 and Corollary 4.1), we conducted statistical inference on model parameters in linear regression and quantile estimation models using ISGD; see Chen et al. (2020); Toulis et al. (2021). Based on the observations on proxPR in the previous subsection, we discarded the first tenth of the iterations when calculating $\tilde{H}_n$ , $\hat{I}_n$ , and $\bar{\theta}_n$ . Then, we gathered the average rate of the nominal $95\%$ confidence interval (13), (15) covering $\theta_*$ for each coordinate ("cover"), mean squared error from $\theta_*$ ("MSE"), and the length of the $95\%$ confidence interval ("lenCI") from $B = 500$ independent replications. + +We also compared the plug-in estimator of each run with the multi-run estimator (11) using the Frobenius norm (normalized by dimension $p$ ); its average is reported ("covdiff"). + +Linear regression. We generated $Z_{n} = (y_{n},\mathbf{x}_{n})$ where $y_{n} = \mathbf{x}_{n}^{T}\theta_{*} + \epsilon_{n}$ , $\mathbb{R}^p\ni N(0,\Sigma)$ , and $\epsilon_{n}\sim N(0,1)$ , for $\ell (Z_n,\theta) = \frac{1}{2} (y_n - \mathbf{x}_n^T\theta)^2$ . Three different covariance structures were considered: identity $(\Sigma = I_p)$ , Toeplitz $(\Sigma_{ij} = (0.5)^{|i - j|})$ , and equicorrelation $(\Sigma_{ij} = 0.2$ for $i\neq j$ , $\Sigma_{ii} = 1$ ). We fixed $\theta_{\star} = (1,\dots ,1)^T$ and ran $n = 10^5$ iterations of ISGD for $\gamma \in \{0.6,1.0\}$ , $p\in \{5,20,100,200\}$ with $\theta_0 = 0$ for each type of $\Sigma$ . Table 2 collects the results. The coverage rates generally observed the nominal level, with proxRM showing a slightly better coverage, possibly because proxPR exhibited shorter confidence intervals. + +Quantile estimation. Since the sample function for quantile estimation introduced in Sect. 1 is nondifferentiable, we instead used a smoothed version in which the $\max(0, \cdot)$ part is replaced by a quadratic function $(4\mu)^{-1}(x + \mu)^2$ on $[- \mu, \mu]$ . The smoothing parameter $\mu$ makes $\nabla \ell(Z, \theta)$ $(2\mu)^{-1}$ -Lipschitz and introduces a bias. We nevertheless set $\theta_{\star}$ to be the $99\%$ -ile of the standard normal and let $Z \sim N(0, 1)$ . The $n = 10^6$ iterations were started with $\theta_0 = 0$ for each replication, where $\gamma \in \{0.6, 1\}$ and $\mu \in \{10^{-1}, 10^{-2}, 10^{-3}\}$ ; we used $\gamma_1 = 250$ when $\gamma = 1$ and $\gamma_1 = 30$ when $\gamma = 0.6$ . Table 3 summarizes the results. While proxPR exhibits smaller MSE and covdiff, the coverage rate of proxRM was close to $95\%$ and there are few cases that proxPR deteriorates. This result may be misleading since the actual minimizer of $L$ is not $\theta_{\star}$ here, and the length of the confidence interval is smaller for proxPR. On the other hand, if the genuine goal is to find the quantile, the better coverage of (biased) proxRM might be a blessing. + +# 7. Conclusion + +In both point estimation of the model parameter for the strongly convex case and optimization of non-strongly convex functionals, the behavior of implicit SGD as revealed by our non-asymptotic analysis, either proxRM or proxPR, resembles the explicit SGD when the gradient is uniformly bounded a.s. on a bounded domain (Bach & Moulines, 2011, Theorems 2, 5, 7), which replaces Assumption(s) A4 (and, with strong convexity, A2). Thus ISGD effectively imposes the latter condition without requiring it, operating under weaker assumptions on the gradient map. + +Like its explicit counterpart, our analysis (and experiments) states that averaging brings to ISGD robustness to the initial step size and lack of strong convexity. On the other hand, averaged ISGD (proxPR) may suffer from slow progress in the early phase of iterations. Burn-in is a viable option. + +It is interesting to note that the plug-in estimators of the asymptotic covariance matrices of proxRM and proxPR, + +Table 2. Statistical inference for linear regression model parameters. + +
ΣγpProxRMProxPR
coverMSElenCIcovdiffcoverMSElenCIcovdiff
Identity0.6595.924.991e-30.2855.817e-495.001.177e-50.0131.299e-6
2097.544.424e-30.2981.640e-395.011.270e-50.0142.657e-6
10099.593.348e-30.3344.180e-395.111.611e-50.0167.309e-6
20099.972.511e-30.3525.783e-395.051.782e-50.0171.129e-5
1594.565.278e-50.0283.436e-694.521.170e-50.0131.344e-6
2095.145.245e-50.0281.050e-594.701.151e-50.0132.361e-6
10095.335.260e-50.0292.353e-594.391.184e-50.0135.456e-6
20095.485.197e-50.0293.299e-594.441.192e-50.0137.547e-6
Toeplitz0.6595.884.890e-30.2856.979e-494.961.766e-50.0172.037e-6
2097.404.439e-30.2981.617e-394.962.082e-50.0184.247e-6
10099.613.347e-30.3344.185e-394.992.679e-50.0201.194e-5
20099.962.525e-30.3525.779e-395.192.959e-50.0211.894e-5
1594.925.486e-50.0294.976e-694.321.809e-50.0161.874e-6
2095.055.518e-50.0291.066e-593.951.985e-50.0174.767e-6
10094.965.520e-50.0292.487e-593.612.067e-50.0179.691e-6
20095.475.396e-50.0293.424e-593.882.083e-50.0171.337e-5
EquiCorr0.6595.644.968e-30.2856.030e-494.681.306e-50.0141.490e-6
2097.424.454e-30.2981.604e-394.901.532e-50.0153.125e-6
10099.603.394e-30.3344.159e-395.201.985e-50.0188.990e-6
20099.952.583e-30.3535.773e-395.132.228e-50.0191.412e-5
1594.725.307e-50.0293.199e-694.001.307e-50.0141.518e-6
2095.155.326e-50.0291.058e-594.491.403e-50.0142.853e-6
10095.195.337e-50.0292.391e-594.251.480e-50.0156.827e-6
20095.455.267e-50.0293.334e-594.361.497e-50.0159.483e-6
+ +Table 3. Statistical inference for quantile estimation. + +
MethodγμcoverMSElenCIcovdiff
ProxRM0.61e-395.201.339e-30.1481.185e-4
1e-295.601.315e-30.1469.965e-5
1e-195.401.191e-30.1408.716e-5
11e-396.604.933e-50.0281.689e-6
1e-296.004.887e-50.0281.021e-6
1e-191.405.769e-50.0276.967e-7
ProxPR0.61e-373.802.626e-50.0164.363e-6
1e-273.402.587e-50.0153.262e-6
1e-196.401.266e-50.0152.755e-6
11e-394.601.603e-50.0161.246e-6
1e-295.601.589e-50.0155.692e-7
1e-187.402.872e-50.0155.506e-7
+ +indispensable for valid statistical inference on the model parameter, does not benefit from averaging. Since this paper appears to be the first to propose estimators based only on a single run, investigation of more statistically efficient estimators as well as online ones as in SGD (Chen et al., 2020) will make a promising avenue of future research. + +# References + +Abadi, M., Barham, P., Chen, J., Chen, Z., Davis, A., Dean, J., Devin, M., Ghemawat, S., Irving, G., Isard, M., 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. +Asi, H. and Duchi, J. C. Stochastic (approximate) proximal point methods: Convergence, optimality, and adaptivity. SIAM J. Optim., 29(3):2257-2290, 2019. +Bach, F. and Moulines, E. Non-asymptotic analysis of stochastic approximation algorithms for machine learning. Advances in Neural Information Processing Systems, 24: 451-459, 2011. Full-length version: https://hal.archives-ouvertes.fr/hal-00608041. +Bauschke, H. H. and Combettes, P. L. Convex analysis and monotone operator theory in Hilbert spaces. Springer Science & Business Media, 2011. +Bertsekas, D. P. Stochastic optimization problems with nondifferentiable cost functionals. J. Optim. Theory Appl., 12(2):218-231, 1973. +Bertsekas, D. P. Incremental proximal methods for large scale convex optimization. Math. Program., Ser. B., 129 (163), 2011. + +Bianchi, P. Ergodic convergence of a stochastic proximal point algorithm. SIAM J. Optim., 26(4):2235-2260, 2016. +Bottou, L. Large-scale machine learning with stochastic gradient descent. In Proceedings of COMPSTAT 2010, pp. 177-186. Springer, 2010. +Bottou, L., Curtis, F. E., and Nocedal, J. Optimization methods for large-scale machine learning. SIAM Rev., 60 (2):223-311, 2018. +Chen, X., Lee, J. D., Tong, X. T., and Zhang, Y. Statistical inference for model parameters in stochastic gradient descent. Ann. Statist., 48(1):251-273, 2020. +Fabian, V. On asymptotic normality in stochastic approximation. Ann. Math. Stat., 39(4):1327-1332, 1968. +LeCun, Y., Bengio, Y., and Hinton, G. Deep learning. Nature, 521(7553):436-444, 2015. +Li, T., Liu, L., Kyrillidis, A., and Caramanis, C. Statistical inference using sgd. In Thirty-Second AAAI Conference on Artificial Intelligence (AAAI-18), 2018. +Liang, T. and Su, W. J. Statistical inference for the population landscape via moment-adjusted stochastic gradients. *J. R. Stat. Soc.*, 2019. +Nemirovski, A., Juditsky, A., Lan, G., and Shapiro, A. Robust stochastic approximation approach to stochastic programming. SIAM J. Optim., 19(4):1574-1609, 2009. +Patrascu, A. and Necoara, I. Nonasymptotic convergence of stochastic proximal point methods for constrained convex optimization. J. Mach. Learn. Res. (JMLR), 18(1):7204-7245, 2017. + +Polyak, B. T. and Juditsky, A. B. Acceleration of stochastic approximation by averaging. SIAM J. Control Optim., 30 (4):838-855, 1992. +Robbins, H. and Monro, S. A stochastic approximation method. Ann. Math. Stat., 22(3):400-407, 1951. +Rockafellar, R. T. Monotone operators and the proximal point algorithm. SIAM J. Control Optim., 14(5):877-898, 1976. +Ruppert, D. Efficient estimations from a slowly convergent robbins-monro process. Technical report, Cornell University Operations Research and Industrial Engineering, 1988. +Ryu, E. K. and Boyd, S. Stochastic proximal iteration: A non-asymptotic improvement upon stochastic gradient descent. Manuscript, 2014. +Toulis, P. and Airoldi, E. M. Asymptotic and finite-sample properties of estimators based on stochastic gradients. Ann. Statist., 45(4):1694-1727, 2017a. +Toulis, P. and Airoldi, E. M. Supplement to 'asymptotic and finite-sample properties of estimators based on stochastic gradients', 2017b. +Toulis, P., Airoldi, E., and Rennie, J. Statistical analysis of stochastic gradient methods for generalized linear models. In International Conference on Machine Learning, pp. 667-675. PMLR, 2014. +Toulis, P., Tran, D., and Airoldi, E. Towards stability and optimality in stochastic gradient descent. In Artificial Intelligence and Statistics, pp. 1290-1298. PMLR, 2016. +Toulis, P., Horel, T., and Airoldi, E. M. The proximal Robbins-Monro method. J. R. Stat. Soc. Ser. B. Stat. Methodol., 83(1):188-212, 2021. +Zinkevich, M. Online convex programming and generalized infinitesimal gradient ascent. In Proc. 20th Int. Conf. Mach. Learn. (ICML 2003), pp. 928-936, 2003. + +# A. Proofs of main results + +# A.1. Preliminary + +In this section, we collect known facts useful for the subsequent proofs. + +Proposition A.1 (Bach & Moulines (2011), p. 17). + +$$ +\left\| a + b \right\| ^ {k} \leq 2 ^ {k - 1} \left(\left\| a \right\| ^ {k} + \left\| b \right\| ^ {k}\right), \quad k = 1, 2, 3, 4. +$$ + +Proposition A.2. + +$$ +\gamma_ {n} \leq \gamma_ {n - 1} \leq 2 \gamma_ {n}, \quad n \geq 2; +$$ + +$$ +\gamma_ {n} ^ {1 / 2} - \gamma_ {n + 1} ^ {1 / 2} \geq \frac {\gamma_ {1} ^ {1 / 2}}{4 n ^ {\gamma / 2}}, \quad n \geq 3. +$$ + +Proposition A.3. Let $\phi_{\gamma}(n) = (n^{1 - \gamma} - 1) / (1 - \gamma)$ if $\gamma >0$ and $\gamma \neq 1$ , and $\phi_{\gamma}(n) = \log n$ if $\gamma = 1$ . Then, + +$$ +\sum_ {k = 1} ^ {n} \frac {1}{k ^ {\gamma}} \leq 1 + \phi_ {\gamma} (n) \leq \left\{ \begin{array}{l l} \frac {n ^ {1 - \gamma}}{1 - \gamma}, & \gamma \in (0, 1), \\ 1 + \log n, & \gamma = 1, \\ \zeta (\gamma) := \sum_ {k = 1} ^ {\infty} \frac {1}{k ^ {\gamma}} < \infty , & \gamma > 1 \end{array} \right. +$$ + +and + +$$ +\frac {1}{2} [ \phi_ {\gamma} (n) - \phi_ {\gamma} (m) ] \leq \sum_ {k = m + 1} ^ {n} \frac {1}{k ^ {\gamma}} \leq \phi_ {\gamma} (n) - \phi_ {\gamma} (m), \quad n > m \geq 1. +$$ + +The last inequality is from Bach & Moulines (2011, p. 13). + +# A.2. Proof of Proposition 3.1 + +Proposition 3.1 can be proved by combining the following intermediate result and Lemma 3.1. + +Lemma A.1 (Theorem 3.3 and Corollary 3.3 of Asi & Duchi (2019)). In addition to Assumptions A1, A2, and A4, also assume that a minimizer $\theta_{\star}$ of $L$ exists (not necessarily unique). Then, the iterates from the ISGD update (3) with learning rate sequence (R) satisfies + +$$ +\mathbf {E} [ \| \theta_ {n} - \theta_ {\star} \| ^ {2} | \mathcal {F} _ {n - 1} ] \leq \| \theta_ {n - 1} - \theta_ {\star} \| ^ {2} + \sigma^ {2} \gamma_ {n} ^ {2}, \quad \gamma \in (0, 1 ], +$$ + +$$ +\mathbf {E} \left\| \theta_ {n} - \theta_ {\star} \right\| ^ {2} \leq \left\| \theta_ {0} - \theta_ {\star} \right\| ^ {2} + \sigma^ {2} \sum_ {k = 1} ^ {\infty} \gamma_ {k} ^ {2} = r ^ {2} < \infty , \quad \gamma \in (1 / 2, 1 ]. +$$ + +for all $n = 1,2,\ldots$ + +Proof of Proposition 3.1. Note that + +$$ +\begin{array}{l} \theta_ {n} = \theta_ {n - 1} - \gamma_ {n} \nabla \ell \left(Z _ {n}, \theta_ {n}\right) \\ = \left[ \theta_ {n - 1} - \gamma_ {n} \nabla \ell \left(Z _ {n}, \theta_ {n - 1}\right) \right] + \left[ \gamma_ {n} \nabla \ell \left(Z _ {n}, \theta_ {n - 1}\right) - \gamma_ {n} \nabla \ell \left(Z _ {n}, \theta_ {n}\right) \right]. \\ \end{array} +$$ + +Thus $R_{n} = \gamma_{n}[\nabla \ell (Z_{n},\theta_{n - 1}) - \nabla \ell (Z_{n},\theta_{n})]$ . Then, + +$$ +\begin{array}{l} \| R _ {n} \| = \gamma_ {n} \| \nabla \ell \left(Z _ {n}, \theta_ {n - 1}\right) - \nabla \ell \left(Z _ {n}, \theta_ {n}\right) \| \tag {A.1} \\ \leq \gamma_ {n} \beta (Z _ {n}) \| \theta_ {n - 1} - \theta_ {n} \| \leq \gamma_ {n} ^ {2} \beta (Z _ {n}) \| \nabla \ell (Z _ {n}, \theta_ {n - 1}) \|, \\ \end{array} +$$ + +where the first inequality is due to Assumption A2, and the second due to Lemma 3.1. + +We show the bounds on $\| R_n\|$ . First, observe from the triangular inequality and Assumption A2 that + +$$ +\left\| \nabla \ell \left(Z _ {n}, \theta_ {n - 1}\right) \right\| \leq \beta \left(Z _ {n}\right) \left\| \theta_ {n - 1} - \theta_ {\star} \right\| + \left\| \nabla \ell \left(Z _ {n}, \theta_ {\star}\right) \right\|. \tag {A.2} +$$ + +Then, + +$$ +\begin{array}{l} \mathbf {E} \left[ \| R _ {n} \| | \mathcal {F} _ {n - 1} \right] \leq \gamma_ {n} ^ {2} \mathbf {E} \left[ \beta^ {2} (Z _ {n}) \right] \| \theta_ {n - 1} - \theta_ {\star} \| \\ + (1 / 2) \gamma_ {n} ^ {2} \mathbf {E} [ \beta^ {2} (Z _ {n}) ] + (1 / 2) \gamma_ {n} ^ {2} \mathbf {E} \| \nabla \ell (Z _ {n}, \theta_ {\star}) \| ^ {2} \tag {A.3} \\ \leq \gamma_ {n} ^ {2} \beta_ {0} ^ {2} \| \theta_ {n - 1} - \theta_ {\star} \| + (1 / 2) \gamma_ {n} ^ {2} \beta_ {0} ^ {2} + (1 / 2) \gamma_ {n} ^ {2} \sigma^ {2} \\ \end{array} +$$ + +using $2ab \leq a^2 + b^2$ and Assumption A2. Therefore for $\gamma \in (1/2, 1]$ with which $r < \infty$ , + +$$ +\mathbf {E} \left\| R _ {n} \right\| \leq \gamma_ {n} ^ {2} \beta_ {0} ^ {2} \mathbf {E} \left\| \theta_ {n - 1} - \theta_ {\star} \right\| + (1 / 2) \gamma_ {n} ^ {2} (\beta_ {0} ^ {2} + \sigma^ {2}) \leq \gamma_ {n} ^ {2} [ \beta_ {0} ^ {2} (r + 1 / 2) + \sigma^ {2} / 2 ]. +$$ + +The last inequality is due to Lemma A.1 and Jensen's inequality. + +To establish bounds on $\| R_n\| ^2$ , from inequality (A.2), + +$$ +\left\| \nabla \ell (Z _ {n}, \theta_ {n - 1}) \right\| ^ {2} \leq 2 \beta^ {2} (Z _ {n}) \left\| \theta_ {n - 1} - \theta_ {\star} \right\| ^ {2} + 2 \left\| \nabla \ell (Z _ {n}, \theta_ {\star}) \right\| ^ {2} +$$ + +using $(a + b)^2\leq 2a^2 +2b^2$ .So + +$$ +\mathbf {E} \left[ \| \nabla \ell \left(Z _ {n}, \theta_ {n - 1}\right) \| ^ {2} \mid \mathcal {F} _ {n - 1} \right] \leq 2 \beta_ {0} ^ {2} \| \theta_ {n - 1} - \theta_ {\star} \| ^ {2} + 2 \sigma^ {2} \tag {A.4} +$$ + +from Assumption A4. Then, by the definition of $R_{n}$ + +$$ +\begin{array}{l} \mathbf {E} \left[ \left\| R _ {n} \right\| ^ {2} \mid \mathcal {F} _ {n - 1} \right] = \gamma_ {n} ^ {2} \mathbf {E} \left[ \left\| \nabla \ell (Z _ {n}, \theta_ {n}) - \nabla \ell (Z _ {n}, \theta_ {n - 1}) \right\| ^ {2} \mid \mathcal {F} _ {n - 1} \right] \\ = \gamma_ {n} ^ {2} \mathbf {E} \left[ \left\| \nabla \ell (Z _ {n}, \theta_ {n}) \right\| ^ {2} | \mathcal {F} _ {n - 1} \right] - 2 \gamma_ {n} ^ {2} \mathbf {E} \left[ \nabla \ell (Z _ {n}, \theta_ {n}) ^ {T} \nabla \ell (Z _ {n}, \theta_ {n - 1}) | \mathcal {F} _ {n - 1} \right] \\ + \gamma_ {n} ^ {2} \mathbf {E} \left[ \left\| \nabla \ell (Z _ {n}, \theta_ {n - 1}) \right\| ^ {2} \mid \mathcal {F} _ {n - 1} \right] \\ \leq 4 \gamma_ {n} ^ {2} \mathbf {E} \left[ \| \nabla \ell \left(Z _ {n}, \theta_ {n - 1}\right) \| ^ {2} \mid \mathcal {F} _ {n - 1} \right] \leq 8 \gamma_ {n} ^ {2} \beta_ {0} ^ {2} \| \theta_ {n - 1} - \theta_ {\star} \| ^ {2} + 8 \gamma_ {n} ^ {2} \sigma^ {2} \\ \end{array} +$$ + +using the Cauchy-Schwarz inequality and Lemma 3.1. Then, for $\gamma \in (1/2, 1]$ , + +$$ +\mathbf {E} \left\| R _ {n} \right\| ^ {2} \leq 8 \gamma_ {n} ^ {2} \beta_ {0} ^ {2} \mathbf {E} \left\| \theta_ {n - 1} - \theta_ {\star} \right\| ^ {2} + 8 \gamma_ {n} ^ {4} \sigma^ {2} \leq 8 \gamma_ {n} ^ {2} \left(\beta_ {0} ^ {2} r ^ {2} + \sigma^ {2}\right) \tag {A.5} +$$ + +from Lemma A.1. + +# A.3. Proof of Theorem 4.1 + +We enhance the result by Toulis & Airoldi (2017a, Lemma 2.2 in the Supplement): + +Lemma A.2. Consider positive sequences $a_{n}$ such that $\sum_{k = 1}^{\infty}a_{k} = A < \infty$ , $b_{n}\downarrow 0$ , and $c_{n}\downarrow 0$ , and there is $n'$ such that $c_{n} / b_{n} < 1$ for all $n > n'$ . Let + +$$ +\delta_ {n} = \frac {1}{a _ {n}} \left(\frac {a _ {n - 1}}{b _ {n - 1}} - \frac {a _ {n}}{b _ {n}}\right), \quad \zeta_ {n} = \frac {c _ {n}}{b _ {n - 1}} \frac {a _ {n - 1}}{a _ {n}} +$$ + +and suppose $\delta_n \downarrow \delta \geq 0$ and $\zeta_n \downarrow 0$ . Then, for a nonnegative sequence $y_n$ such that + +$$ +y _ {n} \leq \frac {1 + c _ {n}}{1 + (1 + \delta) b _ {n}} y _ {n - 1} + a _ {n}, \tag {A.6} +$$ + +there holds + +$$ +y _ {n} \leq K _ {0} \frac {a _ {n}}{b _ {n}} + Q _ {1} ^ {n} y _ {0} + Q _ {n _ {0} + 1} ^ {n} \left[ \left(1 + c _ {1}\right) ^ {n _ {0}} A + B \right] \tag {A.7} +$$ + +for every $n = 1,2,\ldots$ , where $n_0$ is an integer such that $\delta_n + \zeta_n < 1 + \delta$ and $c_{n} < (1 + \delta)b_{n}$ for all $n\geq n_0$ , $K_{0} = [1 + (1 + \delta)b_{1}] / (1 + \delta -\delta_{n_{0}} - \zeta_{n_{0}})$ , $B = K_{0}a_{n_{0}} / b_{n_{0}}$ , and $Q_{i}^{n} = \prod_{j = i}^{n}(1 + c_{j}) / (1 + (1 + \delta)b_{j})$ if $n\geq i$ and $Q_{i}^{n} = 1$ otherwise. + +Proof. See Sect. B. + +![](images/61c3853766c8422bd65ee7004653dfa91910a99e1275c6186c39a3d9c9e012ef.jpg) + +Corollary A.1. Let $\alpha >\beta >\gamma$ where $\alpha >1$ and $\gamma \in (0,1]$ . Consider a nonnegative sequence $\{y_{n}\}$ such that + +$$ +y _ {n} \leq (1 - \eta n ^ {- \gamma} + \nu n ^ {- \beta}) y _ {n - 1} + a _ {1} n ^ {- \alpha} \tag {A.8} +$$ + +with $\eta > 0$ , $\nu \geq 0$ , and $a_1 \geq 0$ . If $\gamma = 1$ , assume that $\eta > \alpha - \gamma$ . Then, there holds + +$$ +y _ {n} \leq K _ {1} n ^ {- (\alpha - \gamma)} + K _ {2} (n) \exp \left(- \frac {1}{2} \log (1 + \eta) \phi_ {\gamma} (n)\right) \left(y _ {0} + D _ {n _ {0}}\right), \tag {A.9} +$$ + +where + +$$ +\phi_ {\gamma} (n) = \left\{ \begin{array}{l l} (n ^ {1 - \gamma} - 1) / (1 - \gamma), & \gamma \in (0, 1), \\ \log n, & \gamma = 1, \end{array} \right. a n d \delta = \left\{ \begin{array}{l l} 0, & \gamma \in (0, 1), \\ 1 / (\frac {\eta}{\alpha - \gamma} - 1), & \gamma = 1. \end{array} \right. +$$ + +and + +$$ +K _ {1} = K _ {0} \frac {a _ {1} (1 + \delta)}{\eta}, \tag {A.10a} +$$ + +$$ +K _ {2} (n) = \left\{ \begin{array}{l l} \exp (\nu (1 + \eta) \sum_ {k = 1} ^ {\infty} k ^ {- \beta}) < \infty , & \beta > 1, \\ \exp (\nu (1 + \eta) \phi_ {\beta} (n)), & \beta \leq 1, \end{array} \right. \tag {A.10b} +$$ + +$$ +D _ {n _ {0}} = (1 + \eta) ^ {n _ {0}} \left([ 1 + \nu (1 + \eta) ] ^ {n _ {0}} A + B\right), \tag {A.10c} +$$ + +$$ +A = a _ {1} \sum_ {k = 1} ^ {\infty} k ^ {- \alpha} < \infty , \quad B = K _ {0} (1 + \delta) \eta^ {- 1} a _ {1} n _ {0} ^ {- (\alpha - \gamma)}. \tag {A.10d} +$$ + +The $n_0$ is an integer such that + +$$ +n ^ {\gamma} \left([ n / (n - 1) ] ^ {\alpha - \gamma} - 1\right) + \nu (1 + \eta) [ n / (n - 1) ] ^ {\alpha - \gamma} n ^ {- \gamma} < \eta \tag {A.11a} +$$ + +$$ +\nu (1 + \eta) n ^ {- \gamma} < \eta \tag {A.11b} +$$ + +for all $n \geq n_0$ . The constant $K_0$ is given by + +$$ +K _ {0} = \frac {(1 + \eta) / (1 + \delta)}{1 - \left(\frac {n _ {0} ^ {- \gamma}}{\eta} ([ \frac {n _ {0}}{n _ {0} - 1} ] ^ {\alpha - \gamma} - 1) + \frac {\nu (1 + \eta)}{\eta} n _ {0} ^ {- (\beta - \gamma)} [ \frac {n _ {0}}{n _ {0} - 1} ] ^ {\alpha - \gamma}\right)}. +$$ + +In particular, if $\nu = 0$ , then $K_{2}(n) \equiv 1$ . + +Proof. See Sect. B. + +Proof of Theorem 4.1. From Proposition 3.1, one can obtain + +$$ +\begin{array}{l} \mathbf {E} \left\| \theta_ {n} - \theta_ {\star} \right\| ^ {2} = \mathbf {E} \left\| \theta_ {n - 1} - \theta_ {\star} \right\| ^ {2} (A.12a) \\ - 2 \gamma_ {n} \mathbf {E} \left[ \left(\theta_ {n - 1} - \theta_ {\star}\right) ^ {T} \nabla \ell \left(Z _ {n}, \theta_ {n - 1}\right) \right] (A.12b) \\ + \gamma_ {n} ^ {2} \mathbf {E} \| \nabla \ell \left(Z _ {n}, \theta_ {n - 1}\right) \| ^ {2} (A.12c) \\ + 2 \mathbf {E} \left[ \left(\theta_ {n - 1} - \theta_ {\star}\right) ^ {T} R _ {n} \right] (A.12d) \\ - 2 \mathbf {E} \left[ R _ {n} ^ {T} \nabla \ell \left(Z _ {n}, \theta_ {n - 1}\right) \right] (A.12e) \\ + \mathbf {E} \| R _ {n} \| ^ {2}. (A.12f) \\ \end{array} +$$ + +The second term (A.12b) is upper bounded as follows. + +$$ +\begin{array}{l} - 2 \gamma_ {n} \mathbf {E} [ (\theta_ {n - 1} - \theta_ {\star}) ^ {T} \nabla \ell (Z _ {n}, \theta_ {n - 1}) ] \\ = - 2 \gamma_ {n} \mathbf {E} \mathbf {E} \left[ \left(\theta_ {n - 1} - \theta_ {\star}\right) ^ {T} \nabla \ell \left(Z _ {n}, \theta_ {n - 1}\right) \mid \mathcal {F} _ {n - 1} \right] \\ = - 2 \gamma_ {n} \mathbf {E} \left[ \left(\theta_ {n - 1} - \theta_ {\star}\right) ^ {T} \mathbf {E} \left[ \nabla \ell \left(Z _ {n}, \theta_ {n - 1}\right) \mid \mathcal {F} _ {n - 1} \right] \right] \tag {A.13} \\ = - 2 \gamma_ {n} \mathbf {E} \left[ \left(\theta_ {n - 1} - \theta_ {\star}\right) ^ {T} \nabla L \left(\theta_ {n - 1}\right) \right] \\ = - 2 \gamma_ {n} \mathbf {E} \left[ \left(\theta_ {n - 1} - \theta_ {\star}\right) ^ {T} \left(\nabla L \left(\theta_ {n - 1}\right) - \nabla L \left(\theta_ {\star}\right)\right) \right] \\ \leq - 2 \gamma_ {n} \lambda \mathbf {E} \| \theta_ {n - 1} - \theta_ {\star} \| ^ {2}. \\ \end{array} +$$ + +The last inequality is due to Assumption A3 and Remark 2.2; the penultimate inequality is due to $\nabla L(\theta_{\star}) = 0$ + +In order to bound the third term (A.12c), from inequality (A.4) in the proof of Proposition 3.1, + +$$ +\begin{array}{l} \gamma_ {n} ^ {2} \mathbf {E} \left\| \nabla \ell \left(Z _ {n}, \theta_ {n - 1}\right) \right\| ^ {2} \leq 2 \gamma_ {n} ^ {2} \beta_ {0} ^ {2} \mathbf {E} \left\| \theta_ {n - 1} - \theta_ {\star} \right\| ^ {2} + 2 \gamma_ {n} ^ {2} \sigma^ {2} \\ \leq 2 \gamma_ {n} ^ {2} (\beta_ {0} ^ {2} r ^ {2} + \sigma^ {2}). \\ \end{array} +$$ + +The last line follows from Lemma A.1. + +Also for the term (A.12d), from the Cauchy-Schwarz and inequality (6a) in Proposition 3.1 we have + +$$ +\begin{array}{l} \mathbf {E} \left[ \left(\theta_ {n - 1} - \theta_ {\star}\right) ^ {T} R _ {n} | \mathcal {F} _ {n - 1} \right] \leq \mathbf {E} \left[ \left\| \theta_ {n - 1} - \theta_ {\star} \right\| | | R _ {n} | | \mathcal {F} _ {n - 1} \right] \\ = \left\| \theta_ {n - 1} - \theta_ {\star} \right\| \mathbf {E} \left[ \left\| R _ {n} \right\| \mid \mathcal {F} _ {n - 1} \right] \\ \leq \gamma_ {n} ^ {2} \beta_ {0} ^ {2} \left\| \theta_ {n - 1} - \theta_ {\star} \right\| ^ {2} + \gamma_ {n} ^ {2} (\beta_ {0} ^ {2} + \sigma^ {2}) \left\| \theta_ {n - 1} - \theta_ {\star} \right\|. \\ \end{array} +$$ + +Thus + +$$ +2 \mathbf {E} \left[ (\theta_ {n - 1} - \theta_ {\star}) ^ {T} R _ {n} \right] \leq 2 \gamma_ {n} ^ {2} \left[ \beta_ {0} ^ {2} r ^ {2} + \left(\beta_ {0} ^ {2} + \sigma^ {2}\right) r \right] +$$ + +using Lemma A.1 and Jensen's inequality. + +For the term (A.12e), we obtain + +$$ +\begin{array}{l} - \mathbf {E} \left[ R _ {n} ^ {T} \nabla \ell (Z _ {n}, \theta_ {n - 1}) | \mathcal {F} _ {n - 1} \right] = - \mathbf {E} \left[ \gamma_ {n} [ \nabla \ell (Z _ {n}, \theta_ {n - 1}) - \nabla \ell (Z _ {n}, \theta_ {n}) ] ^ {T} \nabla \ell (Z _ {n}, \theta_ {n - 1}) | \mathcal {F} _ {n - 1} \right] \\ = - \gamma_ {n} \mathbf {E} \left[ \left\| \nabla \ell (Z _ {n}, \theta_ {n - 1}) \right\| ^ {2} \mid \mathcal {F} _ {n - 1} \right] + \gamma_ {n} \mathbf {E} \nabla \ell (Z _ {n}, \theta_ {n}) ^ {T} \nabla \ell (Z _ {n}, \theta_ {n - 1}) \mid \mathcal {F} _ {n - 1} ] \\ \leq - \gamma_ {n} \mathbf {E} \left[ \| \nabla \ell \left(Z _ {n}, \theta_ {n - 1}\right) \| ^ {2} \mid \mathcal {F} _ {n - 1} \right] + \gamma_ {n} \mathbf {E} \| \nabla \ell \left(Z _ {n}, \theta_ {n}\right) \| \| \nabla \ell \left(Z _ {n}, \theta_ {n - 1}\right) \| \mid \mathcal {F} _ {n - 1} ] \\ \leq - \gamma_ {n} \mathbf {E} \left[ \left\| \nabla \ell (Z _ {n}, \theta_ {n - 1}) \right\| ^ {2} | \mathcal {F} _ {n - 1} \right] + \gamma_ {n} \mathbf {E} \left[ \left\| \nabla \ell (Z _ {n}, \theta_ {n - 1}) \right\| ^ {2} | \mathcal {F} _ {n - 1} \right] \\ = 0, \\ \end{array} +$$ + +where the last inequality is due to Lemma 3.1. Thus we have $-2\mathbf{E}\left[R_n^T\nabla \ell (Z_n,\theta_{n - 1})\right]\leq 0$ + +The final term (A.12) is bounded by inequality (6d) in Proposition 3.1. + +Combining these results yields + +$$ +\mathbf {E} \left\| \theta_ {n} - \theta_ {\star} \right\| ^ {2} \leq (1 - 2 \lambda \gamma_ {n}) \mathbf {E} \left\| \theta_ {n - 1} - \theta_ {\star} \right\| ^ {2} + 2 [ 6 \beta_ {0} ^ {2} r ^ {2} + 5 \sigma^ {2} + (\beta_ {0} ^ {2} + \sigma^ {2}) r ] \gamma_ {n} ^ {2}. +$$ + +Now we can apply Corollary A.1 by setting $y_{n} = \mathbf{E}\| \theta_{n} - \theta_{\star}\|^{2}$ , $\alpha = 2\gamma$ , $a_1 = 2[6\beta_0^2 r^2 +5\sigma^2 +(\beta_0^2 +\sigma^2)r]$ , $\gamma_1^2$ $\eta = 2\lambda \gamma_{1} > 0$ , and $\nu = 0$ . This proves the claim. + +Below we put the explicit values of the constants: + +$$ +\delta = \left\{ \begin{array}{l l} 0, & \gamma \in (1 / 2, 1), \\ 1 / (2 \lambda \gamma_ {1} - 1), & \gamma = 1, \end{array} \right. +$$ + +$$ +K _ {0} = \frac {1 / (1 + \delta) + \gamma_ {1}}{1 - \frac {n _ {0} ^ {\gamma}}{2 \lambda \gamma_ {1}} ([ \frac {n _ {0}}{n _ {0} - 1} ] ^ {\gamma} - 1)}, +$$ + +$$ +K _ {1} = K _ {0} \frac {2 [ 6 \beta_ {0} ^ {2} r ^ {2} + 5 \sigma^ {2} + (\beta_ {0} ^ {2} + \sigma^ {2}) r ] \gamma_ {1} (1 + \delta)}{2 \lambda}, +$$ + +$$ +K _ {2} (n) \equiv 1, +$$ + +$$ +D _ {n _ {0}} = (1 + 2 \lambda \gamma_ {1}) ^ {n _ {0}} (A + B), +$$ + +$$ +A = 2 \left[ 6 \beta_ {0} ^ {2} r ^ {2} + 5 \sigma^ {2} + \left(\beta_ {0} ^ {2} + \sigma^ {2}\right) r \right] \gamma_ {1} ^ {2} \sum_ {k = 1} ^ {\infty} k ^ {- 2 \gamma} < \infty , +$$ + +$$ +B = 2 K _ {0} [ 6 \beta_ {0} ^ {2} r ^ {2} + 5 \sigma^ {2} + (\beta_ {0} ^ {2} + \sigma^ {2}) r ] \gamma_ {1} n _ {0} ^ {- \gamma}. +$$ + +![](images/0efc509483d43df8304a484db3b12bcde1840ee0881f650118e80c342fb71405.jpg) + +# A.4. Proof of Theorem 4.2 + +Proof of Theorem 4.2. Suppose the following holds. + +$$ +\mathbf {E} \left[ \nabla \ell \left(Z _ {n}, \theta_ {n}\right) \right] = \mathcal {H} \left(\theta_ {\star}\right) \mathbf {E} \left[ \theta_ {n} - \theta_ {\star} \right] + O \left(\gamma_ {n} ^ {1 / 2}\right). \tag {A.14} +$$ + +Taking expectations on the update equation $\theta_{n} = \theta_{n - 1} - \gamma_{n}\nabla \ell (Z_{n},\theta_{n})$ , equation (A.14) entails + +$$ +\mathbf {E} \left[ \theta_ {n} - \theta_ {\star} \right] = \mathbf {E} \left[ \theta_ {n - 1} - \theta_ {\star} \right] - \gamma_ {n} \mathcal {H} (\theta_ {\star}) \mathbf {E} \left[ \theta_ {n} - \theta_ {\star} \right] + O (\gamma_ {n} ^ {1 / 2}), +$$ + +or + +$$ +\mathbf {E} \left[ \theta_ {n} - \theta_ {\star} \right] = \left[ I + \gamma_ {n} \mathcal {H} (\theta_ {\star}) \right] ^ {- 1} \mathbf {E} \left[ \theta_ {n - 1} - \theta_ {\star} \right] + \left[ I + \gamma_ {n} \mathcal {H} (\theta_ {\star}) \right] ^ {- 1} O (\gamma_ {n} ^ {1 / 2}). +$$ + +By recursively applying the above equation, we see + +$$ +\mathbf {E} \left[ \theta_ {n} - \theta_ {\star} \right] = Q _ {1} ^ {n} (\theta_ {0} - \theta_ {\star}) + Q _ {1} ^ {n} O (\sum_ {k = 1} ^ {n} \gamma_ {k} ^ {1 / 2}) = Q _ {1} ^ {n} (\theta_ {0} - \theta_ {\star}) + Q _ {1} ^ {n} O (n ^ {1 - \gamma / 2}). +$$ + +Note $\| Q_1^n\| = \left\|\prod_{i=1}^n[I + \gamma_i\mathcal{H}(\theta_\star)]^{-1}\right\| \leq (\prod_{i=1}^n(1 + \lambda \gamma_i))^{-1}$ where $\lambda \leq \lambda_{\min}(\mathcal{H}(\theta_\star))$ . From inequality (B.5), $Q_1^n = O(\exp(-\kappa n^{1 - \gamma}))$ if $\gamma \in (1/2, 1)$ and $Q_1^n = O(n^{-\kappa})$ if $\gamma = 1$ , where $\kappa = \log(1 + \lambda \gamma_1) > 0$ . In either case, we have $Q_1^n O(n^{1 - \gamma/2}) = o(1)$ as desired (when $\gamma = 1$ , we are given $\gamma_1 \geq (e^2 - 1)/\lambda$ with which $\kappa \geq 1$ ). + +To see equation (A.14) holds, recall that the objective function $L$ is twice differentiable at $\theta_{\star}$ . It follows that + +$$ +\begin{array}{l} \nabla \ell \left(Z _ {n}, \theta_ {n}\right) = W _ {n} + \mathcal {H} \left(\theta_ {\star}\right) \left(\theta_ {n} - \theta_ {\star}\right) + o \left(\left\| \theta_ {n} - \theta_ {\star} \right\|\right), \\ = W _ {n} + \mathcal {H} \left(\theta_ {\star}\right) \left(\theta_ {n} - \theta_ {\star}\right) + o \left(\gamma_ {n} ^ {1 / 2}\right), \tag {A.15} \\ \end{array} +$$ + +$$ +W _ {n} = \nabla \ell (Z _ {n}, \theta_ {n}) - \nabla L (\theta_ {n}), +$$ + +From Proposition 3.1, we see $\nabla \ell (Z_n,\theta_n) = \nabla \ell (Z_n,\theta_{n - 1}) - \gamma_n^{-1}R_n$ and $\mathbf{E}[R_n] = O(\gamma_n^2)$ . In other words, $W_{n} = \nabla \ell (Z_{n},\theta_{n - 1}) - L(\theta_{n}) - \gamma_{n}^{-1}R_{n}$ and + +$$ +\mathbf {E} \left[ W _ {n} \right] = \nabla L \left(\theta_ {n - 1}\right) - \nabla L \left(\theta_ {n}\right) + O \left(\gamma_ {n}\right). +$$ + +The difference of the first two terms are bounded as follows. + +$$ +\begin{array}{l} \| \nabla L (\theta_ {n}) - \nabla L (\theta_ {n - 1}) \| = \| \mathbf {E} [ \nabla \ell (Z, \theta_ {n}) - \nabla \ell (Z, \theta_ {n - 1}) ] \| \\ \leq \mathbf {E} \| \nabla \ell (Z, \theta_ {n}) - \nabla \ell (Z, \theta_ {n - 1}) \| \quad (\text {J e s s e n ' s i n e q u a l i t y}) \\ \leq \mathbf {E} \| \nabla \ell (Z, \theta_ {n}) - \nabla \ell (Z, \theta_ {\star}) \| + \mathbf {E} \| \nabla \ell (Z, \theta_ {n - 1}) - \nabla \ell (Z, \theta_ {\star}) \| \\ \leq \mathbf {E} [ \beta (Z) \| \theta_ {n} - \theta_ {\star} \| ] + \mathbf {E} [ \beta (Z) \| \theta_ {n - 1} - \theta_ {\star} \| ] \quad (\text {A s s u m p t i o n A 2}) \\ \leq \left(\mathbf {E} \left[ \beta^ {2} (Z) \right]\right) ^ {1 / 2} \left(\mathbf {E} \left\| \theta_ {n} - \theta_ {\star} \right\| ^ {2}\right) ^ {1 / 2} \\ + \left(\mathbf {E} \left[ \beta^ {2} (Z) \right]\right) ^ {1 / 2} \left(\mathbf {E} \left\| \theta_ {n - 1} - \theta_ {\star} \right\| ^ {2}\right) ^ {1 / 2} \quad (\text {C a u c h y - S c h w a r z}) \\ = O \left(\gamma_ {n} ^ {1 / 2}\right), \\ \end{array} +$$ + +where the last inequality is due to Assumption A2 and Theorem 4.1. Hence $\mathbf{E}[W_n] = O(\gamma_n^{1/2})$ . Finally, by taking expectations on both sides of equation (A.15), equation (A.14) follows. + +# A.5. Proof of Theorem 4.3 + +The proof utilizes Fabian's central limit theorem for stochastic approximation Fabian (1968, Theorem 2.2) to show the asymptotic normality (9). + +Lemma A.3 (Fabian). Let $U_{n}$ , $V_{n}$ , $T_{n} \in \mathbb{R}^{p}$ and $\Phi_{n}$ , $\Gamma_{n} \in \mathbb{R}^{p \times p}$ satisfy the following equation + +$$ +U _ {n} = (I - n ^ {- \alpha} \Gamma_ {n}) U _ {n - 1} + n ^ {- (\alpha + \beta) / 2} \Phi_ {n} V _ {n} + n ^ {- \alpha - \beta / 2} T _ {n} +$$ + +for $\alpha \in (0,1]$ and $\beta \geq 0$ , where $\Gamma_n \to \Gamma \succ 0$ , $\Phi_n \to \Phi$ , $T_n \to T$ or $\mathbf{E}\|T_n - T\| \to 0$ , $\mathbf{E}[V_n|\mathcal{F}_{n-1}] = 0$ , $C > \left\|\mathbf{E}[V_nV_n^T - \Sigma |\mathcal{F}_{n-1}]\right\| \to 0$ for some $C$ and $\mathcal{F}_n$ a non-decreasing sequence of $\sigma$ -fields such that $\Gamma_n$ , $\Phi_n$ , and $V_n$ are $\mathcal{F}_n$ -measurable. Suppose $\sigma_{j,r}^2 = \mathbf{E}[I_{\|V_j\|^2 \geq rj^\alpha}\|V_j\|^2]$ , and either $\lim_{j \to \infty} \sigma_{j,r}^2 = 0$ for every $r > 0$ or $\alpha = 1$ and $\lim_{n \to \infty} n^{-1} \sum_{j=1}^{n} \sigma_{j,r}^2 = 0$ for every $r > 0$ . Let $\beta_+ = \beta$ if $\alpha = 1$ , $\beta_+ = 0$ if $\alpha \neq 1$ and assume $\Gamma \succ (\beta_+ / 2)I$ . Then the asymptotic distribution of $n^{\beta/2}U_n$ is normal with mean $(\Gamma - (\beta_+ / 2)I)^{-1}T$ and covariance matrix $\mathcal{L}_{2\Gamma - \beta_+ I}^{-1}(\Phi\Sigma \Phi^T)$ , where $\mathcal{L}_P: X \mapsto (1/2)(PX + XP)$ is the Lyapunov linear map. + +If $P\succ 0$ , the inverse linear map $\mathcal{L}_P^{-1}$ is well-defined; if furthermore $C\succ 0$ , then $\mathcal{L}_P^{-1}(C)\succ 0$ + +Proof of Theorem 4.3. Using Proposition 3.1, the implicit update equation becomes + +$$ +\begin{array}{l} \theta_ {n} = \theta_ {n - 1} - \gamma_ {n} \nabla \ell (Z _ {n}, \theta_ {n}) \\ = \theta_ {n - 1} - \gamma_ {n} \nabla \ell \left(Z _ {n}, \theta_ {n - 1}\right) + R _ {n} \\ = \theta_ {n - 1} - \gamma_ {n} \left[ \nabla L \left(\theta_ {n - 1}\right) + \nabla \ell \left(Z _ {n}, \theta_ {n - 1}\right) - \nabla L \left(\theta_ {n - 1}\right) \right] + O \left(\gamma_ {n} ^ {2}\right) \tag {A.16} \\ = \theta_ {n - 1} - \gamma_ {n} \nabla L (\theta_ {n - 1}) + \gamma_ {n} \varepsilon_ {n} + O (\gamma_ {n} ^ {2}), \\ \end{array} +$$ + +where $\varepsilon_{n} = \nabla L(\theta_{n - 1}) - \nabla \ell (Z_{n},\theta_{n - 1})$ . Since $L$ is twice differentiable at $\theta_{\star}$ , we further have + +$$ +\begin{array}{l} \theta_ {n} - \theta_ {\star} = \theta_ {n - 1} - \theta_ {\star} - \gamma_ {n} \mathcal {H} (\theta_ {\star}) (\theta_ {n - 1} - \theta_ {\star}) + \gamma_ {n} o \left(\left\| \theta_ {n - 1} - \theta_ {\star} \right\|\right) + \gamma_ {n} \varepsilon_ {n} + O \left(\gamma_ {n} ^ {2}\right) \\ = \theta_ {n - 1} - \theta_ {\star} - \gamma_ {n} \mathcal {H} \left(\theta_ {\star}\right) \left(\theta_ {n - 1} - \theta_ {\star}\right) + \gamma_ {n} o \left(\gamma_ {n - 1} ^ {1 / 2}\right) + \gamma_ {n} \varepsilon_ {n} + O \left(\gamma_ {n} ^ {2}\right) \tag {A.17} \\ = \theta_ {n - 1} - \theta_ {\star} - \gamma_ {n} \mathcal {H} (\theta_ {\star}) (\theta_ {n - 1} - \theta_ {\star}) + o \left(\gamma_ {n} ^ {3 / 2}\right) + \gamma_ {n} \varepsilon_ {n} + O \left(\gamma_ {n} ^ {2}\right) \\ = [ I - \gamma_ {n} \mathcal {H} (\theta_ {\star}) ] (\theta_ {n - 1} - \theta_ {\star}) + \gamma_ {n} \varepsilon_ {n} + o (\gamma_ {n} ^ {3 / 2}), \\ \end{array} +$$ + +where the second line is due to Theorem 4.1 and $\theta_{n - 1}\rightarrow \theta_{\star}$ a.s. For the third line, recall that $\gamma_{n} = \gamma_{1}n^{-\gamma}$ (R). + +In order to apply Lemma A.3, observe that $\mathbf{E}[\varepsilon_n|\mathcal{F}_{n - 1}] = 0$ and + +$$ +\begin{array}{l} \mathbf {E} \left[ \varepsilon_ {n} \varepsilon_ {n} ^ {T} | \mathcal {F} _ {n - 1} \right] = \mathbf {E} \left[ (\nabla L (\theta_ {n - 1}) - \nabla \ell (Z _ {n}, \theta_ {n - 1})) (\nabla L (\theta_ {n - 1}) - \nabla \ell (Z _ {n}, \theta_ {n - 1})) ^ {T} | \mathcal {F} _ {n - 1} \right] \\ = \mathbf {E} \left[ \left(\nabla L \left(\theta_ {n - 1}\right) - \nabla \ell \left(Z, \theta_ {n - 1}\right)\right) \left(\nabla L \left(\theta_ {n - 1}\right) - \nabla \ell \left(Z, \theta_ {n - 1}\right)\right) ^ {T} \right] \\ = \mathcal {I} (\theta_ {n - 1}) \\ \end{array} +$$ + +since $\theta_{n - 1}\in \mathcal{F}_{n - 1}$ . To meet the conditions for Lemma A.3, it suffices to show that $\mathcal{I}$ is continuous at $\theta_{\star}$ . Consider a non-random convergent sequence $\{\vartheta_n\}$ such that $\vartheta_{n}\to \theta_{\star}$ . Fix $\epsilon >0$ . Then there exists $n_0$ such that for all $n\geq n_0$ , $\| \vartheta_{n} - \theta_{\star}\| \leq \epsilon$ . Then, + +$$ +\begin{array}{l} \left\| \nabla \ell (Z, \vartheta_ {n}) \nabla \ell (Z, \vartheta_ {n}) ^ {T} \right\| \leq \| \nabla \ell (Z, \vartheta_ {n}) \| ^ {2} \\ \leq 2 \beta^ {2} (Z) \| \vartheta_ {n} - \vartheta_ {\star} \| ^ {2} + 2 \| \nabla \ell (Z, \theta_ {\star}) \| ^ {2} \\ \leq 2 \beta^ {2} (Z) \epsilon^ {2} + 2 \| \nabla \ell (Z, \theta_ {\star}) \| ^ {2} \\ \end{array} +$$ + +for all $n \geq n_0$ . The last line is integrable due to Assumptions A2 and A4. Therefore, by the dominated convergence theorem, $\mathcal{I}(\vartheta_n) = \mathbf{E}\left[\nabla \ell(Z, \vartheta_n)\nabla \ell(Z, \vartheta_n)^T\right] - \nabla L(\vartheta_n)L(\vartheta_n)^T < \infty$ and $\mathcal{I}(\vartheta_n) \to \mathcal{I}(\theta_\star)$ and $\mathcal{I}$ is continuous at $\theta_\star$ . + +Letting $U_{n} = \theta_{n} - \theta_{\star}$ , $V_{n} = \varepsilon_{n}$ , $T_{n} = o(1)$ , $\Phi_{n} = \Phi = \gamma_{1}I$ , $\Gamma_{n} = \Gamma = \gamma_{1}\mathcal{H}(\theta_{\star})$ , $T = 0$ , $\Sigma = \mathcal{I}(\theta_{\star})$ , and $\alpha = \beta = \gamma$ in Lemma A.3 results in the desired asymptotic normality. + +Remark A.1. The approximation of ISGD to SGD in Proposition 3.1 is crucial since otherwise $\varepsilon_{n}$ would equal to $\nabla L(\theta_n) - \nabla \ell (Z_n,\theta_n)$ . Since $\theta_{n}\notin \mathcal{F}_{n - 1}$ , we do not have $\mathbf{E}[\varepsilon_n|\mathcal{F}_{n - 1}] = 0$ . That is, $\varepsilon_{n}$ is not a martingale difference sequence and it is difficult to see if $\mathbf{E}[\varepsilon_n\varepsilon_n^T |\mathcal{F}_{n - 1}]$ would converge to a known quantity. Toulis et al. (Toulis & Airoldi, 2017a;b) instead employ $\nabla \ell (Z_n,\theta_\star)$ in place of $\varepsilon_{n}$ , but assume $\nabla^2\ell (Z_n,\theta_\star)$ converges to $\mathcal{H}(\theta_{\star}) = \nabla^{2}L(\theta_{\star})$ almost surely, which rarely holds in general. + +# A.6. Proof of Theorem 4.4 + +The following result can be deduced from the proof of Chen et al. (2020, Lemma 4.1). + +Lemma A.4. Suppose Assumptions A1-A4, B1, and B3-B5 hold. Then, + +$$ +\mathbf {E} \left\| \hat {H} _ {n} - \mathcal {H} (\theta_ {\star}) \right\| = O (\gamma_ {n} ^ {1 / 2}), \quad a n d \quad \mathbf {E} \left\| \hat {I} _ {n} - \mathcal {I} (\theta_ {\star}) \right\| = O (\gamma_ {n} ^ {1 / 2}). +$$ + +A key in the proof of Chen et al. (2020, Lemma 4.1) is Chen et al. (2020, Lemma 3.2) showing that $\mathbf{E}\left\| \theta_{n} - \theta_{\star}\right\| = O(n^{-\gamma /2}) = O(\gamma_n^{1 / 2})$ in (explicit) SGD, which can be replaced by Theorem 4.1 in implicit SGD. + +Proof of Theorem 4.4. Let $B = \gamma_{1}\mathcal{H}(\theta_{\star}) - (\beta_{+} / 2)I$ , $\tilde{B}_n = \gamma_1\tilde{H}_n - (\beta_+ / 2)I$ , and $\hat{B}_n = \gamma_1\hat{H}_n - (\beta_+ / 2)I$ , where $\beta_{+} = 1$ if $\gamma = 1$ and $\beta_{+} = 0$ if $\gamma \in (0.5,1)$ . By construction, $\lambda_{\min}(\tilde{B}_n) \geq \gamma_1\delta -\beta_+ / 2 > 0$ and $\lambda_{\min}(B) \geq \gamma_1\lambda_{\min}(\mathcal{H}(\theta_\star)) - \beta_+ / 2 > 0$ . + +Recall that $\operatorname{vec}\left(\mathcal{L}_{2B_n}^{-1}(\hat{I}_n)\right) = (I\otimes B_n + B_n\otimes I)^{-1}\operatorname{vec}(\hat{I}_n)$ and $\operatorname{vec}\left(\mathcal{L}_{2B}^{-1}(\mathcal{I}(\theta_{\star}))\right) = (I\otimes B + B\otimes I)^{-1}\operatorname{vec}(\mathcal{I}(\theta_{\star})$ It suffices to show that + +$$ +\mathbf {E} \left\| \operatorname {v e c} \left(\mathcal {L} _ {2 B _ {n}} ^ {- 1} (\hat {I} _ {n})\right) - \operatorname {v e c} \left(\mathcal {L} _ {2 B} ^ {- 1} (\mathcal {I} (\theta_ {\star}))\right) \right\| = O \left(\gamma_ {n} ^ {1 / 2}\right). \tag {A.18} +$$ + +To see this, let + +$$ +E _ {B} = \left(I \otimes \tilde {B} _ {n} + \tilde {B} _ {n} \otimes I\right) - (I \otimes B + B \otimes I), \quad E _ {I} = \hat {I} _ {n} - \mathcal {I} (\theta_ {\star}), +$$ + +$$ +F _ {B} = \left(I \otimes \tilde {B} _ {n} + \tilde {B} _ {n} \otimes I\right) ^ {- 1} - \left(I \otimes B + B \otimes I\right) ^ {- 1}. +$$ + +Then, + +$$ +\begin{array}{l} \operatorname {v e c} \left(\mathcal {L} _ {2 B _ {n}} ^ {- 1} (\hat {I} _ {n})\right) - \operatorname {v e c} \left(\mathcal {L} _ {2 B} ^ {- 1} (\mathcal {I} (\theta_ {\star}))\right) = \\ [ (I \otimes B + B \otimes I) ^ {- 1} + F _ {B} ] (\operatorname {v e c} (\mathcal {I} (\theta_ {\star}) + E _ {I}) - (I \otimes B + B \otimes I) ^ {- 1} \operatorname {v e c} (\mathcal {I} (\theta_ {\star}) \\ = (I \otimes B + B \otimes I) ^ {- 1} E _ {I} + F _ {B} E _ {I} + F _ {B} \operatorname {v e c} (\mathcal {I} (\theta_ {\star})). \\ \end{array} +$$ + +Since the eigenvalues of $I\otimes A + A\otimes I$ consist of $\lambda_i(A) + \lambda_j(A)$ for $i,j = 1,\ldots ,p$ if $A$ is a $p\times p$ symmetric matrix, + +$$ +\| F _ {B} \| \leq \left\| (I \otimes \tilde {B} _ {n} + \tilde {B} _ {n} \otimes I) ^ {- 1} \right\| + \left\| (I \otimes B + B \otimes I) ^ {- 1} \right\| \leq \frac {1}{2 \gamma_ {1} \delta - \beta_ {+}} + \frac {1}{2 \lambda_ {\min } (B)}. +$$ + +Therefore, by Lemma A.4, + +$$ +\mathbf {E} \left\| (I \otimes B + B \otimes I) ^ {- 1} E _ {I} + F _ {B} E _ {I} \right\| \leq \left(\frac {1}{2 \gamma_ {1} \delta - \beta_ {+}} + \frac {1}{\lambda_ {\min } (B)}\right) \mathbf {E} \| E _ {I} \| = O \left(\gamma_ {n} ^ {1 / 2}\right). \tag {A.19} +$$ + +In order to bound $F_{B}\operatorname {vec}(\mathcal{I}(\theta_{\star}))$ , recall from Chen et al. (2020, Lemma C.1) that + +$$ +\left\| F _ {B} \right\| \leq \left\| E _ {B} \right\| \left\| (I \otimes B + B \otimes I) ^ {- 1} \right\| ^ {2} \leq \frac {1}{4 \lambda_ {\min } ^ {2} (B)} \left\| E _ {B} \right\| +$$ + +under the event $\left\| (I \otimes B + B \otimes I)^{-1} E_B \right\| < 1/2$ . Thus + +$$ +\begin{array}{l} \mathbf {E} \| F _ {B} \| \leq \frac {1}{4 \lambda_ {\min } ^ {2} (B)} \mathbf {E} \| E _ {B} \| P (\left\| (I \otimes B + B \otimes I) ^ {- 1} E _ {B} \right\| < 1 / 2) \\ + \left(\frac {1}{2 \gamma_ {1} \delta - \beta_ {+}} + \frac {1}{2 \lambda_ {\min } (B)}\right) P \left(\left\| (I \otimes B + B \otimes I) ^ {- 1} E _ {B} \right\| \geq 1 / 2\right) \\ \leq \frac {1}{4 \lambda_ {\min} ^ {2} (B)} \mathbf {E} \| E _ {B} \| + \left(\frac {1}{2 \gamma_ {1} \delta - \beta_ {+}} + \frac {1}{2 \lambda_ {\min} (B)}\right) \frac {1}{\lambda_ {\min} (B)} \mathbf {E} \| E _ {B} \|, \\ \end{array} +$$ + +where the last line is due to Markov's inequality + +$$ +P \left(\left\| (I \otimes B + B \otimes I) ^ {- 1} E _ {B} \right\| \geq 1 / 2\right) \leq 2 \left\| (I \otimes B + B \otimes I) ^ {- 1} \right\| \mathbf {E} \left\| E _ {B} \right\|. +$$ + +It remains to bound $\mathbf{E}\| E_B\|$ . If $\tilde{H}_n\succeq \delta I$ , then $\tilde{H}_n = \hat{H}_n$ . Otherwise, $\lambda_{\min}(\hat{H}_n) < \delta$ and + +$$ +\begin{array}{l} \left\| E _ {B} \right\| = \left\| \left(I \otimes \tilde {B} _ {n} + \tilde {B} _ {n} \otimes I\right) - \left(I \otimes B + B \otimes I\right) \right\| \\ \leq \left\| \left(I \otimes \tilde {B} _ {n} + \tilde {B} _ {n} \otimes I\right) - \left(I \otimes \hat {B} _ {n} + \hat {B} _ {n} \otimes I\right) \right\| \\ + \left\| \left(I \otimes \hat {B} _ {n} + \hat {B} _ {n} \otimes I\right) - (I \otimes B + B \otimes I) \right\| \\ \leq 2 \delta + \left\| \left(I \otimes \hat {B} _ {n} + \hat {B} _ {n} \otimes I\right) - \left(I \otimes B + B \otimes I\right) \right\|. \\ \end{array} +$$ + +Thus, by using Lemma A.4, + +$$ +\begin{array}{l} \mathbf {E} \| E _ {B} \| \leq \mathbf {E} \left\| \left(I \otimes \hat {B} _ {n} + \hat {B} _ {n} \otimes I\right) - \left(I \otimes B + B \otimes I\right) \right\| + 2 \delta P \left(\lambda_ {\min } \left(\hat {H} _ {n}\right) < \delta\right) \\ \leq \mathbf {E} \left\| I \otimes (\hat {B} _ {n} - B) + (\hat {B} _ {n} - B) \otimes I \right\| \\ + 2 \delta P \left(\left\| \hat {H} _ {n} - \mathcal {H} \left(\theta_ {\star}\right) \right\| \geq \lambda_ {\min } \left(\mathcal {H} \left(\theta_ {\star}\right)\right) - \delta\right) \\ \leq 2 \mathbf {E} \left\| \hat {H} _ {n} - \mathcal {H} (\theta_ {\star}) \right\| + \frac {2 \delta}{\lambda_ {\min} (\mathcal {H} (\theta_ {\star})) - \delta} \mathbf {E} \left\| \hat {H} _ {n} - \mathcal {H} (\theta_ {\star}) \right\|, \\ \end{array} +$$ + +where the second line is due to Weyl's inequality + +$$ +\lambda_ {\min } (\mathcal {H} (\theta_ {\star})) \leq \lambda_ {\max } (\mathcal {H} (\theta_ {\star}) - \hat {H} _ {n}) + \lambda_ {\min } (\hat {H} _ {n}) \leq \left\| \mathcal {H} (\theta_ {\star}) - \hat {H} _ {n} \right\| + \delta +$$ + +and the third line is Markov's inequality. Hence, + +$$ +\begin{array}{l} \mathbf {E} \| F _ {B} \operatorname {v e c} \mathcal {I} \left(\theta_ {\star}\right) \| \leq \| \mathcal {I} \left(\theta_ {\star}\right) \| _ {F} \left(\frac {1}{4 \lambda_ {\min } ^ {2} (B)} + \left(\frac {1}{2 \gamma_ {1} \delta - \beta_ {+}} + \frac {1}{2 \lambda_ {\min } (B)}\right) \frac {1}{\lambda_ {\min } (B)}\right) \times \tag {A.20} \\ \left(2 + \frac {2 \delta}{\lambda_ {\operatorname* {m i n}} (\mathcal {H} (\theta_ {\star})) - \delta}\right) \mathbf {E} \left\| \hat {H} _ {n} - \mathcal {H} (\theta_ {\star}) \right\| = O \left(\gamma_ {n} ^ {1 / 2}\right) \\ \end{array} +$$ + +by Lemma A.4. + +Combining inequalities (A.19) and (A.20), we obtain inequality (A.18). + +# A.7. Proof of Theorem 4.5 + +Lemma A.5. Under Assumptions $A1, A2', A3, A4', B4,$ and $B1$ , if $\gamma \in (1/3, 1]$ , it follows + +$$ +\begin{array}{l} \mathbf {E} \left\| \theta_ {n} - \theta_ {\star} \right\| ^ {4} \leq \tilde {K} _ {1} n ^ {- 2 \gamma} + \exp \left(\nu (1 + \lambda \gamma_ {1} / 2) \phi_ {\frac {5}{3} \gamma} (n) - \frac {1}{2} \log (1 + \lambda \gamma_ {1} / 2) \phi_ {\gamma} (n)\right) \\ \times \left(\| \theta_ {0} - \theta_ {\star} \| ^ {4} + \frac {8 (\beta_ {0} ^ {2} + \sigma^ {2})}{\lambda} \gamma_ {1} \| \theta_ {0} - \theta_ {\star} \| ^ {3} + \tilde {D} _ {\tilde {n} _ {0}}\right) \\ \end{array} +$$ + +where + +$$ +\nu = \frac {6 (\beta_ {0} ^ {2} + \sigma^ {2})}{\lambda} \beta_ {0} ^ {2 / 3} \gamma_ {1} ^ {5 / 3} + 1 4 \beta_ {0} ^ {2} \gamma_ {1} ^ {2} + 1 6 \beta_ {0} ^ {3} \gamma_ {1} ^ {3} + 8 \beta_ {0} ^ {4} \gamma_ {1} ^ {4} + 2 K _ {2} [ (1 0 \sigma^ {2} + \frac {3 2 \sigma (\beta_ {0} ^ {2} + \sigma^ {2})}{\lambda}) \gamma_ {1} ^ {2} + \frac {1 6 (\beta_ {0} ^ {2} + \sigma^ {2}) ^ {2}}{\lambda} \gamma_ {1} ^ {3} + 8 \gamma_ {1} ^ {4} ], +$$ + +and + +$$ +K _ {2} = \left(K _ {1} + \left\| \theta_ {0} - \theta_ {\star} \right\| ^ {2} + D _ {n _ {0}}\right) / \gamma_ {1} +$$ + +with $K_{1}$ and $D_{n_0}$ as defined in Theorem 4.1. Here, $\tilde{n}_0$ is an integer such that + +$$ +n ^ {\gamma} \left([ n / (n - 1) ] ^ {2 \gamma} - 1\right) + \nu (1 + \eta) [ n / (n - 1) ] ^ {2 \gamma} n ^ {- \gamma} < \eta a n d \nu (1 + \lambda \gamma_ {1} / 2) n ^ {- \gamma} < \eta \tag {A.21} +$$ + +for all $n \geq \tilde{n}_0$ , and + +$$ +\tilde {K} _ {1} = \frac {1 + \lambda \gamma_ {1} / 2}{1 - \left(\frac {\tilde {n} _ {0} ^ {- \gamma}}{\eta} \left(\left[ \frac {\tilde {n} _ {0}}{\tilde {n} _ {0} - 1} \right] ^ {2 \gamma} - 1\right) + \frac {\nu (1 + \lambda \gamma_ {1} / 2)}{\lambda \gamma_ {1} / 2} \tilde {n} _ {0} ^ {- 2 \gamma / 3} \left[ \frac {\tilde {n} _ {0}}{\tilde {n} _ {0} - 1} \right] ^ {2 \gamma}\right) \frac {C _ {1} \gamma_ {1} ^ {3}}{\lambda \gamma_ {1} / 2}}, \tag {A.22a} +$$ + +$$ +C _ {1} = \frac {2 \left(\beta_ {0} ^ {2} + \sigma^ {2}\right)}{\lambda} \beta_ {0} ^ {2} + \left(1 6 \sigma^ {4} + \frac {5 6 \left(\beta_ {0} ^ {2} + \sigma^ {2}\right)}{\lambda} \sigma^ {3}\right) \gamma_ {1} \tag {A.22b} +$$ + +$$ +\tilde {D} _ {\tilde {n} _ {0}} = (1 + \lambda \gamma_ {1} / 2) ^ {\tilde {n} _ {0}} \left([ 1 + \nu (1 + \lambda \gamma_ {1} / 2) ] ^ {\tilde {n} _ {0}} \tilde {A} + \tilde {B}\right), \tag {A.22c} +$$ + +$$ +\tilde {A} = C _ {1} \gamma_ {1} ^ {3} \sum_ {k = 1} ^ {\infty} k ^ {- 3 \gamma} < \infty , \tag {A.22d} +$$ + +$$ +\tilde {B} = \frac {1 + \lambda \gamma_ {1} / 2}{1 - \left(\frac {\tilde {n} _ {0} ^ {- \gamma}}{\eta} \left([ \frac {\tilde {n} _ {0}}{\tilde {n} _ {0} - 1} ] ^ {2 \gamma} - 1\right) + \frac {\nu (1 + \lambda \gamma_ {1} / 2)}{\lambda \gamma_ {1} / 2} \tilde {n} _ {0} ^ {- 2 \gamma / 3} \left[ \frac {n _ {0}}{\tilde {n} _ {0} - 1} \right] ^ {2 \gamma}\right) \frac {C _ {1} \gamma_ {1} ^ {3}}{\lambda \gamma_ {1} / 2} \tilde {n} _ {0} ^ {- 2 \gamma}}. \tag {A.22e} +$$ + +Proof of Theorem 4.5. We follow the decomposition by Bach & Moulines (2011, section C) for explicit SGD. The only difference is that + +$$ +\nabla \ell (Z _ {n}, \theta_ {n}) = \frac {1}{\gamma_ {n}} (\theta_ {n - 1} - \theta_ {n}) +$$ + +instead of $\nabla \ell (Z_n,\theta_{n - 1}) = \frac{1}{\gamma_n} (\theta_{n - 1} - \theta_n)$ , which leads to + +$$ +\begin{array}{l} \left\| \nabla \ell \left(Z _ {n}, \theta_ {n - 1}\right) \right\| \leq \left\| \nabla \ell \left(Z _ {n}, \theta_ {n - 1}\right) - \nabla \ell \left(Z _ {n}, \theta_ {n}\right) \right\| + \left\| \nabla \ell \left(Z _ {n}, \theta_ {n}\right) \right\| \\ \leq \beta_ {0} \| \theta_ {n - 1} - \theta_ {n} \| + \frac {1}{\gamma_ {n}} \| \theta_ {n - 1} - \theta_ {n} \| = \frac {\beta_ {0} \gamma_ {n} + 1}{\gamma_ {n}} \| \theta_ {n - 1} - \theta_ {n} \| \\ \leq \frac {\beta_ {0} \gamma_ {1} + 1}{\gamma_ {n}} \| \theta_ {n - 1} - \theta_ {n} \| \\ \end{array} +$$ + +and + +$$ +\begin{array}{l} \left\| \frac {1}{n} \sum_ {k = 1} ^ {n} \nabla \ell \left(Z _ {k}, \theta_ {k - 1}\right) \right\| \leq \frac {\beta_ {0} \gamma_ {1} + 1}{n} \sum_ {k = 1} ^ {n - 1} \left| \gamma_ {k + 1} ^ {- 1} - \gamma_ {k} ^ {- 1} \right| \| \theta_ {k} - \theta_ {\star} \| \\ + \frac {\beta_ {0} \gamma_ {1} + 1}{n \gamma_ {n}} \| \theta_ {n} - \theta_ {\star} \| + \frac {\beta_ {0} \gamma_ {1} + 1}{n \gamma_ {1}} \| \theta_ {0} - \theta_ {\star} \|. \\ \end{array} +$$ + +This in turn yields + +$$ +\begin{array}{l} \left(\mathbf {E} \left\| \bar {\theta} _ {n} - \theta_ {\star} \right\| ^ {2}\right) ^ {1 / 2} \leq \frac {1}{\sqrt {n}} \left[ \operatorname {t r} \left(\mathcal {H} \left(\theta_ {\star}\right) ^ {- 1} \mathcal {I} \left(\theta_ {\star}\right) \mathcal {H} \left(\theta_ {\star}\right) ^ {- 1}\right) \right] ^ {1 / 2} \\ + \frac {\beta_ {0} \gamma_ {1} + 1}{\lambda^ {1 / 2} n} \sum_ {k = 1} ^ {n - 1} | \gamma_ {k + 1} ^ {- 1} - \gamma_ {k} ^ {- 1} | (\mathbf {E} \| \theta_ {k} - \theta_ {\star} \| ^ {2}) ^ {1 / 2} \\ + \frac {\beta_ {0} \gamma_ {1} + 1}{\lambda^ {1 / 2} n \gamma_ {n}} (\mathbf {E} \| \theta_ {n} - \theta_ {\star} \| ^ {2}) ^ {1 / 2} + \frac {\beta_ {0} \gamma_ {1} + 1}{\lambda^ {1 / 2} \gamma_ {1} n} \| \theta_ {0} - \theta_ {\star} \| \\ + \frac {M}{2 \lambda^ {1 / 2} n} \sum_ {k = 1} ^ {n} (\mathbf {E} \| \theta_ {k} - \theta_ {\star} \| ^ {4}) ^ {1 / 2} + \frac {2 \beta_ {0}}{\lambda^ {1 / 2} n} (\sum_ {k = 0} ^ {n - 1} \mathbf {E} \| \theta_ {k} - \theta_ {\star} \| ^ {2}) ^ {1 / 2}, \\ \end{array} +$$ + +which corresponds to inequality (26) of (Bach & Moulines, 2011). The above bound can be simplified to + +$$ +\begin{array}{l} \left(\mathbf {E} \left\| \bar {\theta} _ {n} - \theta_ {\star} \right\| ^ {2}\right) ^ {1 / 2} \leq \frac {1}{\sqrt {n}} \left[ \operatorname {t r} \left(\mathcal {H} (\theta_ {\star}) ^ {- 1} \mathcal {I} (\theta_ {\star}) \mathcal {H} (\theta_ {\star}) ^ {- 1}\right) \right] ^ {1 / 2} + \frac {1 / \gamma_ {1} + 3 \beta_ {0}}{\lambda^ {1 / 2} n} \| \theta_ {0} - \theta_ {\star} \| \\ + \frac {\beta_ {0} \gamma_ {1} + 1}{\lambda^ {1 / 2} n \gamma_ {n}} \left(\mathbf {E} \| \theta_ {n} - \theta_ {\star} \| ^ {2}\right) ^ {1 / 2} (A.23a) \\ + \frac {2 \beta_ {0}}{\lambda^ {1 / 2} n} \left(\sum_ {k = 1} ^ {n} \mathbf {E} \left\| \theta_ {k} - \theta_ {\star} \right\| ^ {2}\right) ^ {1 / 2} (A.23b) \\ + \frac {\beta_ {0} \gamma_ {1} + 1}{\lambda^ {1 / 2} n} \sum_ {k = 1} ^ {n - 1} \left| \gamma_ {k + 1} ^ {- 1} - \gamma_ {k} ^ {- 1} \right| \left(\mathbf {E} \| \theta_ {k} - \theta_ {\star} \| ^ {2}\right) ^ {1 / 2} (A.23c) \\ + \frac {M}{2 \lambda^ {1 / 2} n} \sum_ {k = 1} ^ {n} \left(\mathbf {E} \left\| \theta_ {k} - \theta_ {\star} \right\| ^ {4}\right) ^ {1 / 2} (A.23d) \\ \end{array} +$$ + +The terms (A.23a)-(A.23c) can be further bounded using Theorem 4.1 and Minkowski's inequality: + +$$ +\begin{array}{l} \mathrm {(A . 2 3 a)} \leq \frac {\left(\beta_ {0} \gamma_ {1} + 1\right) K _ {1} ^ {1 / 2}}{\lambda^ {1 / 2} \gamma_ {1} n ^ {1 - \gamma / 2}} \\ + \frac {\beta_ {0} \gamma_ {1} + 1}{\lambda^ {1 / 2} \gamma_ {1} n ^ {1 - \gamma}} \exp \left(- \frac {1}{4} \log (1 + 2 \lambda \gamma_ {1}) \phi_ {\gamma} (n)\right) \left(\| \theta_ {0} - \theta_ {\star} \| ^ {2} + D _ {n _ {0}}\right) ^ {1 / 2} \\ \leq \frac {\beta_ {0} \gamma_ {1} + 1}{\lambda^ {1 / 2} \gamma_ {1}} \frac {K _ {1} ^ {1 / 2}}{n ^ {1 - \gamma / 2}} + \frac {\beta_ {0} \gamma_ {1} + 1}{\lambda^ {1 / 2} \gamma_ {1}} \exp \left(- \frac {1}{4} \log (1 + 2 \lambda \gamma_ {1}) \phi_ {\gamma} (n)\right) \left(\| \theta_ {0} - \theta_ {\star} \| ^ {2} + D _ {n _ {0}}\right) ^ {1 / 2}, \\ \end{array} +$$ + +$$ +\begin{array}{l} \left. \left. \left(\mathrm {A}. 2 3 \mathrm {b}\right) \leq \frac {2 \beta_ {0}}{\lambda^ {1 / 2} n} \left[ K _ {1} \sum_ {k = 1} ^ {n} k ^ {- \gamma} + \sum_ {k = 1} ^ {n} \exp \left(- \frac {1}{2} \log (1 + 2 \lambda \gamma_ {1}) \phi_ {\gamma} (k)\right) \left(\| \theta_ {0} - \theta_ {\star} \| ^ {2} + D _ {n _ {0}}\right) \right] ^ {1 / 2} \right. \right. \\ \leq \frac {2 \beta_ {0} K _ {1} ^ {- 1 / 2}}{\lambda^ {1 / 2}} \frac {\phi_ {\gamma} ^ {1 / 2} (n)}{n} + \frac {2 \beta_ {0}}{\lambda^ {1 / 2}} \frac {\mathcal {A} ^ {1 / 2}}{n} (\| \theta_ {0} - \theta_ {\star} \| ^ {2} + D _ {n _ {0}}) ^ {1 / 2}, \\ \end{array} +$$ + +$$ +\begin{array}{l} \left. \text {(A . 2 3 c)} \leq \frac {\gamma \left(\beta_ {0} + 1 / \gamma_ {1}\right)}{\lambda^ {1 / 2} n} \right] K _ {1} ^ {1 / 2} \sum_ {k = 1} ^ {n} k ^ {\gamma / 2 - 1} \\ \left. + \sum_ {k = 1} ^ {n} k ^ {\gamma - 1} \exp \left(- \frac {1}{4} \log (1 + 2 \lambda \gamma_ {1}) \phi_ {\gamma} (k)\right) \left(\left\| \theta_ {0} - \theta_ {\star} \right\| ^ {2} + D _ {n _ {0}}\right) ^ {1 / 2} \right] \\ \leq \frac {\gamma K _ {1} ^ {1 / 2} (\beta_ {0} + 1 / \gamma_ {1})}{\lambda^ {1 / 2}} \frac {\phi_ {1 - \gamma / 2} (n)}{n} + \frac {\gamma (\beta_ {0} + 1 / \gamma_ {1})}{\lambda^ {1 / 2}} \frac {\mathcal {A}}{n} (\| \theta_ {0} - \theta_ {\star} \| ^ {2} + D _ {n _ {0}}) ^ {1 / 2}, \\ \end{array} +$$ + +where + +$$ +\mathcal {A} = \sum_ {k = 1} ^ {\infty} \exp \left(- \frac {1}{4} \log (1 + 2 \lambda \gamma_ {1}) \phi_ {\gamma} (k)\right) < \infty . +$$ + +The first inequality for (A.23c) is due to $|\gamma_{k + 1}^{-1} - \gamma_k^{-1}| = \frac{1}{\gamma_1} [(k + 1)^\gamma - k^\gamma] = \frac{k^\gamma}{\gamma_1} [(1 + 1 / k)^\gamma - 1] \leq \frac{\gamma}{\gamma_1} k^{\gamma - 1}$ . + +In order to bound the term (A.23d), from Lemma A.5, + +$$ +\begin{array}{l} \left(\mathbf {E} \left\| \theta_ {n} - \theta_ {\star} \right\| ^ {4}\right) ^ {1 / 2} \leq \tilde {K} _ {1} ^ {1 / 2} n ^ {- \gamma} + \exp \left(\frac {1}{2} \nu (1 + \lambda \gamma_ {1} / 2) \phi_ {\frac {5}{3} \gamma} (n) - \frac {1}{4} \log (1 + \lambda \gamma_ {1} / 2) \phi_ {\gamma} (n)\right) \\ \times \left(\| \theta_ {0} - \theta_ {\star} \| ^ {4} + \frac {8 (\beta_ {0} ^ {2} + \sigma^ {2})}{\lambda} \gamma_ {1} \| \theta_ {0} - \theta_ {\star} \| ^ {3} + \tilde {D} _ {n _ {0}}\right) ^ {1 / 2}. \\ \end{array} +$$ + +It follows that + +$$ +\begin{array}{l} \left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left.\right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left. \right.\left\{ \right.1 / 2\left. \right) = 0\left. \right) = 0\left. \right) = 0\left. \right) = 0\left. \right) = 0\left. \right) = 0\left. \right) = 0\left. \right) = 0\left. \right) = 0\left. \right) = 0\left. \right) = 0\left. \right) = 0\left. \right) = 0\left. \right) = 0\left. \right) = 0\left. \right) = 0\left. \right) = 0\left. \right) + D _ {n _ {0}}\left. \right) ^ {1 / 2} + D _ {n _ {0}}\left. \right) ^ {1 / 2} + D _ {n _ {0}}\left. \right) ^ {1 / 2} + D _ {n _ {0}}\left. \right) ^ {1 / 2} + D _ {n _ {0}}\left. \right) ^ {1 / 2} + D _ {n _ {0}}\left. \right)\left. \right) ^ {1 / 2} + D _ {n _ {0}}\left. \right)\left. \right) ^ {1 / 2} + D _ {n _ {0}}\left. \right)\left. \right) ^ {1 / 2} + D _ {n _ {0}} \\ \times \sum_ {k = 1} ^ {n} \exp \left(\frac {1}{2} \nu (1 + \lambda \gamma_ {1} / 2) \phi_ {\frac {5}{3} \gamma} (k) - \frac {1}{4} \log (1 + \lambda \gamma_ {1} / 2) \phi_ {\gamma} (k)\right) \\ \leq \frac {M \tilde {K} _ {1} ^ {1 / 2}}{2 \lambda^ {1 / 2}} \frac {\phi_ {\gamma} (n)}{n} + \frac {M}{2 \lambda^ {1 / 2}} \frac {\mathcal {B}}{n} \left(\| \theta_ {0} - \theta_ {\star} \| ^ {4} + \frac {8 \left(\beta_ {0} ^ {2} + \sigma^ {2}\right)}{\lambda} \gamma_ {1} \| \theta_ {0} - \theta_ {\star} \| ^ {3} + D _ {n _ {0}}\right) ^ {1 / 2}, \\ \end{array} +$$ + +where + +$$ +\mathcal {B} = \sum_ {k = 1} ^ {\infty} \exp \left(\frac {1}{2} \nu (1 + \lambda \gamma_ {1} / 2) \phi_ {\frac {5}{3} \gamma} (k) - \frac {1}{4} \log (1 + \lambda \gamma_ {1} / 2) \phi_ {\gamma} (k)\right) < \infty . +$$ + +Combining these bounds, we get + +$$ +\begin{array}{l} \left(\mathbf {E} \left\| \bar {\theta} _ {n} - \theta_ {\star} \right\| ^ {2}\right) ^ {1 / 2} \leq \frac {1}{\sqrt {n}} \left[ \operatorname {t r} \left(\mathcal {H} \left(\theta_ {\star}\right) ^ {- 1} \mathcal {I} \left(\theta_ {\star}\right) \mathcal {H} \left(\theta_ {\star}\right) ^ {- 1}\right) \right] ^ {1 / 2} + \frac {1 / \gamma_ {1} + 3 \beta_ {0}}{\lambda^ {1 / 2}} \frac {\left\| \theta_ {0} - \theta_ {\star} \right\|}{n} \\ + \frac {\beta_ {0} \gamma_ {1} + 1}{\lambda^ {1 / 2} \gamma_ {1}} \frac {\tilde {K} _ {1} ^ {1 / 2}}{n ^ {1 - \gamma / 2}} + \frac {\beta_ {0} \gamma_ {1} + 1}{\lambda^ {1 / 2} \gamma_ {1}} \exp \left(- \frac {1}{4} \log (1 + 2 \lambda \gamma_ {1}) \phi_ {\gamma} (n)\right) \left(\| \theta_ {0} - \theta_ {\star} \| ^ {2} + \tilde {D} _ {n _ {0}}\right) ^ {1 / 2} \\ + \frac {2 \beta_ {0} \tilde {K} _ {1} ^ {1 / 2}}{\lambda^ {1 / 2}} \frac {\phi_ {\gamma} ^ {1 / 2} (n)}{n} + \frac {2 \beta_ {0}}{\lambda^ {1 / 2}} \frac {\mathcal {A} ^ {1 / 2}}{n} \left(\| \theta_ {0} - \theta_ {\star} \| ^ {2} + \tilde {D} _ {n _ {0}}\right) ^ {1 / 2} \\ \end{array} +$$ + +$$ +\begin{array}{l} + \frac {\gamma \tilde {K} _ {1} ^ {1 / 2} (\beta_ {0} + 1 / \gamma_ {1})}{\lambda^ {1 / 2}} \frac {\phi_ {1 - \gamma / 2} (n)}{n} + \frac {\gamma (\beta_ {0} + 1 / \gamma_ {1})}{\lambda^ {1 / 2}} \frac {\mathcal {A}}{n} \left(\| \theta_ {0} - \theta_ {\star} \| ^ {2} + \tilde {D} _ {n _ {0}}\right) ^ {1 / 2} \\ + \frac {M \tilde {K} _ {1} ^ {1 / 2}}{2 \lambda^ {1 / 2}} \frac {\phi_ {\gamma} (n)}{n} + \frac {M}{2 \lambda^ {1 / 2}} \frac {\mathcal {B}}{n} (\| \theta_ {0} - \theta_ {\star} \| ^ {4} + \frac {8 (\beta_ {0} ^ {2} + \sigma^ {2})}{\lambda} \gamma_ {1} \| \theta_ {0} - \theta_ {\star} \| ^ {3} + \tilde {D} _ {n _ {0}}) ^ {1 / 2}, \\ \end{array} +$$ + +which further simplifies to + +$$ +\begin{array}{l} \left(\mathbf {E} \left\| \bar {\theta} _ {n} - \theta_ {\star} \right\| ^ {2}\right) ^ {1 / 2} \leq \frac {1}{\sqrt {n}} \left[ \operatorname {t r} \left(\mathcal {H} \left(\theta_ {\star}\right) ^ {- 1} \mathcal {I} \left(\theta_ {\star}\right) \mathcal {H} \left(\theta_ {\star}\right) ^ {- 1}\right) \right] ^ {1 / 2} \\ + \frac {\tilde {K} _ {1} ^ {1 / 2}}{\lambda^ {1 / 2} n} \left((\beta_ {0} + \gamma_ {1} ^ {- 1}) n ^ {\gamma / 2} + 2 \beta_ {0} \phi_ {\gamma} ^ {1 / 2} (n) + \gamma (\beta_ {0} + \gamma_ {1} ^ {- 1}) \phi_ {1 - \gamma / 2} (n) + \frac {M}{2} \phi_ {\gamma} (n)\right) \\ + \frac {1}{\lambda^ {1 / 2} n} \left(\left(\gamma_ {1} ^ {- 1} + 3 \beta_ {0}\right) \| \theta_ {0} - \theta_ {\star} \| + 2 \beta_ {0} \mathcal {A} ^ {1 / 2} \left(\| \theta_ {0} - \theta_ {\star} \| ^ {2} + \tilde {D} _ {n _ {0}}\right) ^ {1 / 2} \right. \\ \left. + \gamma \left(\beta_ {0} + \gamma_ {1} ^ {- 1}\right) \mathcal {A} \left(\left\| \theta_ {0} - \theta_ {\star} \right\| ^ {2} + \tilde {D} _ {n _ {0}}\right) ^ {1 / 2}\right) \\ + \frac {M \mathcal {B}}{2 \lambda^ {1 / 2} n} (\| \theta_ {0} - \theta_ {\star} \| ^ {4} + \frac {8 (\beta_ {0} ^ {2} + \sigma^ {2})}{\lambda} \gamma_ {1} \| \theta_ {0} - \theta_ {\star} \| ^ {3} + \tilde {D} _ {n _ {0}}) ^ {1 / 2} \\ + \frac {\beta_ {0} + \gamma_ {1} ^ {- 1}}{\lambda^ {1 / 2}} \exp \left(- \frac {1}{4} \log (1 + 2 \lambda \gamma_ {1}) \phi_ {\gamma} (n)\right) \left(\| \theta_ {0} - \theta_ {\star} \| ^ {2} + \tilde {D} _ {n _ {0}}\right) ^ {1 / 2}. \\ \end{array} +$$ + +Below we put the explicit values of the constants: + +$$ +\begin{array}{l} \tilde {\mathcal {A}} = (\gamma_ {1} ^ {- 1} + 3 \beta_ {0}) \| \theta_ {0} - \theta_ {\star} \| + 2 \beta_ {0} \mathcal {A} ^ {1 / 2} (\| \theta_ {0} - \theta_ {\star} \| ^ {2} + D _ {n _ {0}}) ^ {1 / 2} + \gamma (\beta_ {0} + \gamma_ {1} ^ {- 1}) \mathcal {A} (\| \theta_ {0} - \theta_ {\star} \| ^ {2} + D _ {n _ {0}}) ^ {1 / 2}, \\ \tilde {\mathcal {B}} = \mathcal {B} \cdot \left(\| \theta_ {0} - \theta_ {\star} \| ^ {4} + \frac {8 \left(\beta_ {0} ^ {2} + \sigma^ {2}\right)}{\lambda} \gamma_ {1} \| \theta_ {0} - \theta_ {\star} \| ^ {3} + D _ {n _ {0}}\right) ^ {1 / 2}, \\ \mathcal {A} = \sum_ {k = 1} ^ {\infty} \exp \left(- \frac {1}{4} \log (1 + 2 \lambda \gamma_ {1}) \phi_ {\gamma} (k)\right), \\ \mathcal {B} = \sum_ {k = 1} ^ {\infty} \exp \left(\frac {1}{2} \nu (1 + \lambda \gamma_ {1} / 2) \phi_ {\frac {5}{3} \gamma} (k) - \frac {1}{4} \log (1 + \lambda \gamma_ {1} / 2) \phi_ {\gamma} (k)\right), \\ \nu = \frac {6 (\beta_ {0} ^ {2} + \sigma^ {2})}{\lambda} \beta_ {0} ^ {2 / 3} \gamma_ {1} ^ {5 / 3} + 1 4 \beta_ {0} ^ {2} \gamma_ {1} ^ {2} + 1 6 \beta_ {0} ^ {3} \gamma_ {1} ^ {3} + 8 \beta_ {0} ^ {4} \gamma_ {1} ^ {4} + 2 K _ {2} [ (1 0 \sigma^ {2} + \frac {3 2 \sigma (\beta_ {0} ^ {2} + \sigma^ {2})}{\lambda}) \gamma_ {1} ^ {2} + \frac {1 6 (\beta_ {0} ^ {2} + \sigma^ {2}) ^ {2}}{\lambda} \gamma_ {1} ^ {3} + 8 \gamma_ {1} ^ {4} ], \\ K _ {2} = \left(K _ {1} + \left\| \theta_ {0} - \theta_ {\star} \right\| ^ {2} + D _ {n _ {0}}\right) / \gamma_ {1}. \\ \end{array} +$$ + +# A.8. Proof of Theorem 5.1 + +Proof of Theorem 5.1. Pick a minimizer $\theta_{\star}$ of $L$ . From Assumption A2', $\nabla L$ is also $\beta_0$ -Lipschitz continuous. Therefore, + +$$ +\begin{array}{l} L (\theta_ {n}) - L (\theta_ {\star}) \leq L (\theta_ {n - 1}) - L (\theta_ {\star}) + \nabla L (\theta_ {n - 1}) ^ {T} (\theta_ {n} - \theta_ {n - 1}) + \frac {\beta_ {0}}{2} \| \theta_ {n} - \theta_ {n - 1} \| ^ {2} \\ \leq L \left(\theta_ {n - 1}\right) - L \left(\theta_ {\star}\right) + \nabla L \left(\theta_ {n - 1}\right) ^ {T} \left(\theta_ {n} - \theta_ {n - 1}\right) + \frac {\beta_ {0} \gamma_ {n} ^ {2}}{2} \| \nabla \ell \left(Z _ {n}, \theta_ {n}\right) \| ^ {2}, \tag {A.24} \\ \end{array} +$$ + +where the last inequality is due to equation $(3^{\prime})$ + +In order to find a recursive relation for the sequence $\Delta_n \triangleq \mathbf{E}\left[L(\theta_n) - L(\theta_\star)\right]$ , observe that + +$$ +\begin{array}{l} \left\| \nabla \ell \left(Z _ {n}, \theta_ {n}\right) \right\| ^ {2} = \left\| \nabla \ell \left(Z _ {n}, \theta_ {n}\right) - \nabla \ell \left(Z _ {n}, \theta_ {\star}\right) + \nabla \ell \left(Z _ {n}, \theta_ {\star}\right) \right\| ^ {2} \\ \leq 2 \left\| \nabla \ell \left(Z _ {n}, \theta_ {n}\right) - \nabla \ell \left(Z _ {n}, \theta_ {\star}\right) \right\| ^ {2} + 2 \left\| \nabla \ell \left(Z _ {n}, \theta_ {\star}\right) \right\| ^ {2} \\ \leq 2 \beta_ {0} ^ {2} \| \theta_ {n} - \theta_ {\star} \| ^ {2} + 2 \| \nabla \ell (Z _ {n}, \theta_ {\star}) \| ^ {2}. \\ \end{array} +$$ + +Let $r_n^2 = \delta_0 + \sigma^2\sum_{k = 1}^n\gamma_k^2 = \left\| \theta_0 - \theta_\star \right\|^2 +\sigma^2\sum_{k = 1}^n\gamma_k^2$ Since $\mathbf{E}\left\| \theta_n - \theta_\star \right\|^2 \leq r_n^2$ due to Lemma A.1, we see + +$$ +\mathbf {E} \| \nabla \ell (Z _ {n}, \theta_ {n}) \| ^ {2} \leq 2 \beta_ {0} ^ {2} \mathbf {E} \| \theta_ {n} - \theta_ {\star} \| ^ {2} + 2 \mathbf {E} \| \nabla \ell (Z _ {n}, \theta_ {\star}) \| ^ {2} \leq 2 \beta_ {0} ^ {2} r _ {n} ^ {2} + 2 \sigma^ {2}. \tag {A.25} +$$ + +In addition, from equation $(3^{\prime})$ and Lemma 3.1, + +$$ +\nabla L \left(\theta_ {n - 1}\right) ^ {T} \left(\theta_ {n} - \theta_ {n - 1}\right) = - \gamma_ {n} \nabla L \left(\theta_ {n - 1}\right) ^ {T} \nabla \ell \left(Z _ {n}, \theta_ {n}\right) +$$ + +$$ +\begin{array}{l} = - \gamma_ {n} \nabla L \left(\theta_ {n - 1}\right) ^ {T} \nabla \ell \left(Z _ {n}, \theta_ {n - 1}\right) \\ + \nabla L \left(\theta_ {n - 1}\right) ^ {T} \left(\gamma_ {n} \left[ \nabla \ell \left(Z _ {n}, \theta_ {n - 1}\right) + \nabla \ell \left(Z _ {n}, \theta_ {n}\right) \right]\right) \\ \leq - \gamma_ {n} \nabla L \left(\theta_ {n - 1}\right) ^ {T} \nabla \ell \left(Z _ {n}, \theta_ {n - 1}\right) + \| \nabla L \left(\theta_ {n - 1}\right) \| \| R _ {n} \|, \\ \end{array} +$$ + +which leads to + +$$ +\begin{array}{l} \mathbf {E} \left[ \nabla L \left(\theta_ {n - 1}\right) ^ {T} \left(\theta_ {n} - \theta_ {n - 1}\right) \mid \mathcal {F} _ {n - 1} \right] \leq - \gamma_ {n} \nabla L \left(\theta_ {n - 1}\right) ^ {T} \nabla L \left(\theta_ {n - 1}\right) + \| \nabla L \left(\theta_ {n - 1}\right) \| \mathbf {E} \left[ \| R _ {n} \| \mid \mathcal {F} _ {n - 1} \right] \\ \leq - \gamma_ {n} \| \nabla L (\theta_ {n - 1}) \| ^ {2} \\ + \| \nabla L (\theta_ {n - 1}) - \nabla L (\theta_ {\star}) \| \left(\gamma_ {n} ^ {2} \beta_ {0} ^ {2} \| \theta_ {n - 1} - \theta_ {\star} \| + \frac {\beta_ {0} ^ {2} + \sigma^ {2}}{2} \gamma_ {n} ^ {2}\right) \\ \leq - \gamma_ {n} \| \nabla L (\theta_ {n - 1}) \| ^ {2} \\ + \beta_ {0} \| \theta_ {n - 1} - \theta_ {\star} \| \left(\gamma_ {n} ^ {2} \beta_ {0} ^ {2} \| \theta_ {n - 1} - \theta_ {\star} \| + \frac {\beta_ {0} ^ {2} + \sigma^ {2}}{2} \gamma_ {n} ^ {2}\right) \\ = - \gamma_ {n} \| \nabla L (\theta_ {n - 1}) \| ^ {2} \\ + \gamma_ {n} ^ {2} \beta_ {0} ^ {3} \left\| \theta_ {n - 1} - \theta_ {\star} \right\| ^ {2} + \frac {\beta_ {0} \left(\beta_ {0} ^ {2} + \sigma^ {2}\right)}{2} \gamma_ {n} ^ {2} \left\| \theta_ {n - 1} - \theta_ {\star} \right\|. \\ \end{array} +$$ + +Then by convexity of $L$ + +$$ +L \left(\theta_ {n - 1}\right) - L \left(\theta_ {\star}\right) \leq \nabla L \left(\theta_ {n - 1}\right) ^ {T} \left(\theta_ {n - 1} - \theta_ {\star}\right) \leq \| \nabla L \left(\theta_ {n - 1}\right) \| \| \theta_ {n - 1} - \theta_ {\star} \|. +$$ + +Thus + +$$ +\begin{array}{l} \Delta_ {n - 1} = \mathbf {E} [ L (\theta_ {n - 1}) - L (\theta_ {\star}) ] \leq \mathbf {E} [ \| \nabla L (\theta_ {n - 1}) \| \| \theta_ {n - 1} - \theta_ {\star} \| ] \\ \leq (\mathbf {E} \| \nabla L (\theta_ {n - 1}) \| ^ {2}) ^ {1 / 2} (\mathbf {E} \| \theta_ {n - 1} - \theta_ {\star} \| ^ {2}) ^ {1 / 2} \\ \leq \mathbf {E} \| \nabla L (\theta_ {n - 1}) \| ^ {2 ^ {1 / 2}} r _ {n} \\ \end{array} +$$ + +to obtain + +$$ +\mathbf {E} \| \nabla L (\theta_ {n - 1}) \| ^ {2} \geq \frac {1}{r _ {n} ^ {2}} \Delta_ {n - 1} ^ {2}. +$$ + +Therefore + +$$ +\begin{array}{l} \mathbf {E} \left[ \nabla L (\theta_ {n - 1}) ^ {T} (\theta_ {n} - \theta_ {n - 1}) \right] \leq - \gamma_ {n} \mathbf {E} \left\| \nabla L (\theta_ {n - 1}) \right\| ^ {2} + \gamma_ {n} ^ {2} \beta_ {0} ^ {3} \mathbf {E} \left\| \theta_ {n - 1} - \theta_ {\star} \right\| ^ {2} + \frac {\beta_ {0} (\beta_ {0} ^ {2} + \sigma^ {2})}{2} \gamma_ {n} ^ {2} \mathbf {E} \left\| \theta_ {n - 1} - \theta_ {\star} \right\| \\ \leq - \frac {\gamma_ {n}}{r _ {n} ^ {2}} \Delta_ {n - 1} ^ {2} + \gamma_ {n} ^ {2} \beta_ {0} ^ {3} r _ {n} ^ {2} + \gamma_ {n} ^ {2} \frac {\beta_ {0} \left(\beta_ {0} ^ {2} + \sigma^ {2}\right)}{2} r _ {n}. \tag {A.26} \\ \end{array} +$$ + +Combining inequalities (A.24), (A.25), and (A.26), we have + +$$ +\Delta_ {n} \leq \Delta_ {n - 1} - \frac {\gamma_ {n}}{r _ {n} ^ {2}} \Delta_ {n - 1} ^ {2} + \frac {1}{2} \gamma_ {n} ^ {2} \bar {\beta} _ {n} \sigma^ {2}, \tag {A.27} +$$ + +where $\bar{\beta}_n = \sigma^{-2}(4\beta_0^3 r_n^2 +\beta_0^3 r_n + \beta_0\sigma^2 r_n + 2\beta_0\sigma^2)$ + +If we let $\psi_n(t) = t - \frac{\gamma_n}{r_n^2} t^2$ , then $\Delta_n \leq \psi_n(\Delta_{n-1}) + \frac{1}{2}\gamma_n^2\bar{\beta}_n\sigma^2$ . Since $\psi$ is increasing for $t \in [0, \frac{r_n^2}{2\gamma_n}]$ and $\Delta_n = \mathbf{E}[L(\theta_n) - L(\theta_\star)] \leq \mathbf{E}[\nabla L(\theta_\star)^T(\theta_n - \theta_\star) + \frac{\beta_0}{2}\|\theta_n - \theta_\star\|^2] = \frac{\beta_0}{2}\mathbf{E}\|\theta_n - \theta_\star\|^2] \leq \frac{\beta_0}{2}r_n^2$ , if we let $n_1 = \max\{\inf\{n \in \mathbb{N} : \gamma_n \leq 1/\beta_0\}, 3\}$ , then $\psi_n(\Delta_n)$ is increasing for $n \geq n_1$ . + +Now let us consider a surrogate sequence defined as + +$$ +\tilde {\Delta} _ {n} = \tilde {\Delta} _ {n - 1} - \frac {\gamma_ {n}}{r _ {n} ^ {2}} \tilde {\Delta} _ {n - 1} ^ {2} + \frac {1}{2} \gamma_ {n} ^ {2} \bar {\beta} _ {n} \sigma^ {2}, \quad \tilde {\Delta} _ {n _ {1}} = \Delta_ {n _ {1}}. +$$ + +Then $\Delta_{n} \leq \tilde{\Delta}_{n}$ for $n \geq n_{1}$ , since if we suppose $\Delta_{n-1} \leq \tilde{\Delta}_{n-1}$ , then + +$$ +\Delta_ {n} \leq \psi_ {n} (\Delta_ {n - 1}) + \frac {1}{2} \gamma_ {n} ^ {2} \bar {\beta} _ {n} \sigma^ {2} \leq \psi_ {n} (\tilde {\Delta} _ {n - 1}) + \frac {1}{2} \gamma_ {n} ^ {2} \bar {\beta} _ {n} \sigma^ {2} = \tilde {\Delta} _ {n} +$$ + +from the monotonicity of $\psi_{n}$ + +It suffices to bound $\tilde{\Delta}_n$ . Let $\varepsilon_n = (4\bar{\beta}_n^{1/2}\sigma\gamma_1^{3/2})^{-1}\min\{r_1, r_n n^{3\gamma/2-1}\}$ , which is decreasing. Since $\gamma_n^{1/2} - \gamma_{n-1}^{1/2} \geq \frac{\gamma_1^{1/2}}{4n^{\gamma/2}}$ for $n \geq 3$ (Proposition A.2), we have for all $n \geq n_1$ , + +$$ +\begin{array}{l} \gamma_ {n} ^ {1 / 2} (1 + \varepsilon_ {n}) ^ {1 / 2} - \gamma_ {n + 1} ^ {1 / 2} (1 + \varepsilon_ {n + 1}) ^ {1 / 2} \geq \gamma_ {n} ^ {1 / 2} (1 + \varepsilon_ {n + 1}) ^ {1 / 2} - \gamma_ {n + 1} ^ {1 / 2} (1 + \varepsilon_ {n + 1}) ^ {1 / 2} \\ \geq \frac {\gamma_ {1} ^ {1 / 2}}{4 n ^ {\gamma / 2}} (1 + \varepsilon_ {n + 1}) ^ {1 / 2} \geq \frac {\gamma_ {1} ^ {1 / 2}}{4 n ^ {\gamma / 2}}. \\ \end{array} +$$ + +On the other hand, + +$$ +\begin{array}{l} \varepsilon_ {n} \bar {\beta} _ {n} ^ {1 / 2} \sigma \gamma_ {n} ^ {2} r _ {n} ^ {- 1} = (1 / 4) \bar {\beta} _ {n} ^ {- 1 / 2} \sigma^ {- 1} \gamma_ {1} ^ {- 3 / 2} \bar {\beta} _ {n} ^ {1 / 2} \sigma \gamma_ {1} ^ {2} n ^ {- 2 \gamma} r _ {n} ^ {- 1} \min \{r _ {1}, r _ {n} n ^ {3 \gamma / 2 - 1} \} \\ = \frac {\gamma_ {1} ^ {1 / 2}}{4 n ^ {2 \gamma}} \min \left\{\frac {r _ {1}}{r _ {n}}, n ^ {3 \gamma / 2 - 1} \right\} \leq \frac {\gamma_ {1} ^ {1 / 2}}{4 n ^ {2 \gamma}} \leq \frac {\gamma_ {1} ^ {1 / 2}}{4 n ^ {\gamma / 2}}. \\ \end{array} +$$ + +Thus + +$$ +\gamma_ {n} ^ {1 / 2} \left(1 + \varepsilon_ {n}\right) ^ {1 / 2} - \gamma_ {n + 1} ^ {1 / 2} \left(1 + \varepsilon_ {n + 1}\right) ^ {1 / 2} \geq \varepsilon_ {n} \bar {\beta} _ {n} ^ {1 / 2} \sigma \gamma_ {n} ^ {2} r _ {n} ^ {- 1}, \quad n \geq n _ {1}. \tag {A.28} +$$ + +Let $n_2 = \inf \{n\geq n_1:\tilde{\Delta}_{n - 1}^2\geq (1 + \varepsilon_n)\bar{\beta}_n\gamma_n^2\sigma^2 r_n^2 /2\}$ . Assume for now $n_2$ is finite. We want to show that + +$$ +\tilde {\Delta} _ {n - 1} ^ {2} \geq (1 + \varepsilon_ {n}) \bar {\beta} _ {n} \gamma_ {n} \sigma^ {2} r _ {n} ^ {2} / 2, \quad n \geq n _ {2}. \tag {A.29} +$$ + +Indeed, inequality (A.29) is true for $n = n_2$ by construction. If $\tilde{\Delta}_{n - 1}\geq (1 + \varepsilon_n)^{1 / 2}\bar{\beta}_n^{1 / 2}\gamma_n^{1 / 2}\sigma r_n / \sqrt{2}$ , then since $\psi_{n}$ is increasing, + +$$ +\begin{array}{l} \tilde {\Delta} _ {n} = \psi_ {n} (\tilde {\Delta} _ {n - 1}) + \frac {1}{2} \gamma_ {n} ^ {2} \bar {\beta} _ {n} \sigma^ {2} \\ \geq \psi_ {n} ((1 + \varepsilon_ {n}) ^ {1 / 2} \bar {\beta} _ {n} ^ {1 / 2} \gamma_ {n} ^ {1 / 2} \sigma r _ {n} / \sqrt {2}) + \frac {1}{2} \gamma_ {n} ^ {2} \bar {\beta} _ {n} \sigma^ {2} \\ = (1 + \varepsilon_ {n}) ^ {1 / 2} \bar {\beta} _ {n} ^ {1 / 2} \gamma_ {n} ^ {1 / 2} \sigma r _ {n} / \sqrt {2} - \frac {\gamma_ {n}}{2 r _ {n} ^ {2}} (1 + \varepsilon_ {n}) \bar {\beta} _ {n} \gamma_ {n} \sigma^ {2} r _ {n} ^ {2} + \frac {1}{2} \gamma_ {n} ^ {2} \bar {\beta} _ {n} \sigma^ {2} \\ = \left(\frac {1 + \varepsilon_ {n}}{2}\right) ^ {1 / 2} \bar {\beta} _ {n} ^ {1 / 2} \gamma_ {n} ^ {1 / 2} \sigma r _ {n} - \frac {1}{2} (1 + \varepsilon_ {n}) \gamma_ {n} ^ {2} \bar {\beta} _ {n} \sigma^ {2} + \frac {1}{2} \gamma_ {n} ^ {2} \bar {\beta} _ {n} \sigma^ {2} \\ = \left(\frac {1 + \varepsilon_ {n + 1}}{2}\right) ^ {1 / 2} \bar {\beta} _ {n} ^ {1 / 2} \gamma_ {n + 1} ^ {1 / 2} \sigma r _ {n} - \frac {1}{2} \varepsilon_ {n} \gamma_ {n} ^ {2} \bar {\beta} _ {n} \sigma^ {2} - \left(\frac {1 + \varepsilon_ {n + 1}}{2}\right) ^ {1 / 2} \bar {\beta} _ {n} ^ {1 / 2} \gamma_ {n + 1} ^ {1 / 2} \sigma r _ {n} + \left(\frac {1 + \varepsilon_ {n}}{2}\right) ^ {1 / 2} \bar {\beta} _ {n} ^ {1 / 2} \gamma_ {n} ^ {1 / 2} \sigma r _ {n} \\ = \left(\frac {1 + \varepsilon_ {n + 1}}{2}\right) ^ {1 / 2} \bar {\beta} _ {n} ^ {1 / 2} \gamma_ {n + 1} ^ {1 / 2} \sigma r _ {n} - \frac {1}{2} \varepsilon_ {n} \gamma_ {n} ^ {2} \bar {\beta} _ {n} \sigma^ {2} + \frac {1}{\sqrt {2}} \bar {\beta} _ {n} ^ {1 / 2} \sigma r _ {n} [ \gamma_ {n} ^ {1 / 2} (1 + \varepsilon_ {n}) ^ {1 / 2} - \gamma_ {n + 1} ^ {1 / 2} (1 + \varepsilon_ {n + 1}) ^ {1 / 2} ] \\ \stackrel {(A. 2 8)} {\geq} \left(\frac {1 + \varepsilon_ {n + 1}}{2}\right) ^ {1 / 2} \bar {\beta} _ {n} ^ {1 / 2} \gamma_ {n + 1} ^ {1 / 2} \sigma r _ {n} - \frac {1}{2} \varepsilon_ {n} \gamma_ {n} ^ {2} \bar {\beta} _ {n} \sigma^ {2} + \frac {1}{\sqrt {2}} \varepsilon_ {n} \gamma_ {n} ^ {2} \bar {\beta} _ {n} \sigma^ {2} \\ \geq \left(\frac {1 + \varepsilon_ {n + 1}}{2}\right) ^ {1 / 2} \bar {\beta} _ {n} ^ {1 / 2} \gamma_ {n + 1} ^ {1 / 2} \sigma r _ {n}. \\ \end{array} +$$ + +Hence inequality (A.29) holds for all $n \geq n_2$ . + +Therefore, for $n \geq n_2$ , + +$$ +\begin{array}{l} \tilde {\Delta} _ {n} = \tilde {\Delta} _ {n - 1} - \frac {\gamma_ {n}}{r _ {n} ^ {2}} \tilde {\Delta} _ {n - 1} ^ {2} + \frac {1}{2} \gamma_ {n} ^ {2} \bar {\beta} _ {n} \sigma^ {2} \\ \stackrel {(A. 2 9)} {\leq} \tilde {\Delta} _ {n - 1} - \frac {\gamma_ {n}}{r _ {n} ^ {2}} \tilde {\Delta} _ {n - 1} ^ {2} + \frac {\gamma_ {n}}{2} \frac {\tilde {\Delta} _ {n - 1} ^ {2}}{1 + \varepsilon_ {n}} = \tilde {\Delta} _ {n - 1} - \frac {\gamma_ {n}}{r _ {n} ^ {2}} \frac {\varepsilon_ {n}}{1 + \varepsilon_ {n}} \tilde {\Delta} _ {n - 1} ^ {2} \\ \end{array} +$$ + +Divide the preceding inequality by $\tilde{\Delta}_{n - 1}\tilde{\Delta}_n$ to obtain + +$$ +\tilde {\Delta} _ {n - 1} ^ {- 1} \leq \tilde {\Delta} _ {n} ^ {- 1} - \frac {\gamma_ {n}}{r _ {n} ^ {2}} \frac {\varepsilon_ {n}}{1 + \varepsilon_ {n}} \frac {\tilde {\Delta} _ {n - 1}}{\tilde {\Delta} _ {n}} \leq \tilde {\Delta} _ {n} ^ {- 1} - \frac {\gamma_ {n}}{r _ {n} ^ {2}} \frac {\varepsilon_ {n}}{1 + \varepsilon_ {n}}, +$$ + +where the last inequality is from $\tilde{\Delta}_n\leq \tilde{\Delta}_{n - 1}$ . It follows $\tilde{\Delta}_{n_2 - 1}^{-1}\leq \tilde{\Delta}_n^{-1} - \sum_{k = n_2}^n\frac{1}{r_k^2}\frac{\varepsilon_k}{1 + \varepsilon_k}\gamma_k$ , or + +$$ +\tilde {\Delta} _ {n} \leq \frac {1}{\tilde {\Delta} _ {n _ {2}} ^ {- 1} + \sum_ {k = n _ {2}} ^ {n} \frac {1}{r _ {k} ^ {2}} \frac {\varepsilon_ {k}}{1 + \varepsilon_ {k}} \gamma_ {k}}, \quad n \geq n _ {2}. +$$ + +By the definition of $n_2$ , $\tilde{\Delta}_{n_2 - 1} \leq (1 + \varepsilon_{n_2})^{1/2} \bar{\beta}_{n_2}^{1/2} \gamma_{n_2} \sigma r_{n_2} / \sqrt{2}$ . Hence $\tilde{\Delta}_{n_2}^{-1} \geq \tilde{\Delta}_{n_2 - 1}^{-1} \geq (1 + \varepsilon_{n_2})^{-1/2} \bar{\beta}_{n_2}^{-1/2} \gamma_{n_2}^{-1} \sigma^{-1} r_{n_2}^{-1} \sqrt{2}$ . Now from inequality (A.28), since both $\varepsilon_n$ and $\gamma_n$ are decreasing, and $\bar{\beta}_n$ is increasing, + +$$ +\begin{array}{l} \gamma_ {n + 1} ^ {- 1 / 2} (1 + \varepsilon_ {n + 1}) ^ {- 1 / 2} - \gamma_ {n} ^ {- 1 / 2} (1 + \varepsilon_ {n}) ^ {- 1 / 2} \geq \bar {\beta} _ {n} ^ {1 / 2} \sigma r _ {n} ^ {- 1} \frac {\varepsilon_ {n}}{(1 + \varepsilon_ {n}) ^ {1 / 2} (1 + \varepsilon_ {n + 1}) ^ {1 / 2}} \frac {\gamma_ {n} ^ {2}}{\gamma_ {n} ^ {1 / 2} \gamma_ {n + 1} ^ {1 / 2}} \\ \geq \sigma \bar {\beta} _ {n} ^ {1 / 2} r _ {n} ^ {- 1} \frac {\varepsilon_ {n}}{1 + \varepsilon_ {n}} \gamma_ {n}, \quad n \geq n _ {1}. \\ \end{array} +$$ + +Also since $\gamma_{n_1}^{1 / 2}(1 + \varepsilon_{n_1})^{1 / 2}\geq \varepsilon_{n_1}\bar{\beta}_{n_1}^{1 / 2}\sigma \gamma_{n_1}r_{n_1}^{-1},$ + +$$ +\gamma_ {n _ {1}} ^ {- 1 / 2} (1 + \varepsilon_ {n _ {1}}) ^ {- 1 / 2} \geq \sigma \frac {\varepsilon_ {n _ {1}}}{1 + \varepsilon_ {n _ {1}}} \bar {\beta} _ {n _ {1}} ^ {1 / 2} r _ {n _ {1}} ^ {- 1} \gamma_ {n _ {1}}, \quad n \geq n _ {1}. +$$ + +Therefore + +$$ +\begin{array}{l} \gamma_ {n} ^ {- 1 / 2} (1 + \varepsilon_ {n}) ^ {- 1 / 2} = \sum_ {k = n _ {1}} ^ {n - 1} [ \gamma_ {k + 1} ^ {- 1 / 2} (1 + \varepsilon_ {k + 1}) ^ {- 1 / 2} - \gamma_ {k} ^ {- 1 / 2} (1 + \varepsilon_ {k}) ^ {- 1 / 2} ] + \gamma_ {n _ {1}} ^ {- 1 / 2} (1 + \varepsilon_ {n _ {1}}) ^ {- 1 / 2} \\ \geq \sigma \sum_ {k = n _ {1}} ^ {n - 1} \frac {\bar {\beta} _ {k} ^ {1 / 2}}{r _ {k}} \frac {\varepsilon_ {k}}{1 + \varepsilon_ {k}} \gamma_ {k} + \sigma \frac {\bar {\beta} _ {n _ {1}} ^ {1 / 2}}{r _ {n _ {1}}} \frac {\varepsilon_ {n _ {1}}}{1 + \varepsilon_ {n _ {1}}} \gamma_ {n _ {1}} \\ \geq \sigma \sum_ {k = n _ {1}} ^ {n - 1} \frac {\bar {\beta} _ {k} ^ {1 / 2}}{r _ {k}} \frac {\varepsilon_ {k}}{1 + \varepsilon_ {k}} \gamma_ {k}. \\ \end{array} +$$ + +Since $\bar{\beta}_n^{1 / 2} / r_n$ is decreasing, + +$$ +\tilde {\Delta} _ {n _ {2}} ^ {- 1} \geq \frac {\sqrt {2}}{\gamma_ {n _ {2}}} \frac {1}{r _ {n _ {2}} ^ {2}} \sum_ {k = n _ {1}} ^ {n _ {2} - 1} \frac {\bar {\beta} _ {k} ^ {1 / 2}}{r _ {k}} \frac {r _ {n _ {2}}}{\bar {\beta} _ {n _ {2}} ^ {1 / 2}} \frac {\varepsilon_ {k}}{1 + \varepsilon_ {k}} \gamma_ {k} \geq \frac {\sqrt {2}}{\gamma_ {n _ {2}}} \frac {1}{r _ {n _ {2}} ^ {2}} \sum_ {k = n _ {1}} ^ {n _ {2} - 1} \frac {\varepsilon_ {k}}{1 + \varepsilon_ {k}} \gamma_ {k}. \tag {A.30} +$$ + +This entails, as $r_n^2$ is increasing, for $n \geq n_2$ , + +$$ +\tilde {\Delta} _ {n} \leq \frac {1}{\frac {\sqrt {2}}{\gamma_ {n 2}} \frac {1}{r _ {n 2} ^ {2}} \sum_ {k = n _ {1}} ^ {n _ {2} - 1} \frac {\varepsilon_ {k}}{1 + \varepsilon_ {k}} \gamma_ {k} + \sum_ {k = n _ {2}} ^ {n} \frac {1}{r _ {k} ^ {2}} \frac {\varepsilon_ {k}}{1 + \varepsilon_ {k}} \gamma_ {k}} \leq \frac {\max \left\{\frac {\gamma_ {n 2}}{\sqrt {2}} , 1 \right\} r _ {n} ^ {2}}{\sum_ {k = n _ {1}} ^ {n} \frac {\varepsilon_ {k}}{1 + \varepsilon_ {k}} \gamma_ {k}}. \tag {A.31} +$$ + +Given the derivation of inequality (A.30), inequality (A.31) holds for $n_1 \leq n < n_2$ , thus it is true even if $n_2$ is infinite. Therefore, inequality (A.31) holds for $n \geq n_1$ . + +In order to obtain the rate, note + +$$ +r _ {n} ^ {2} = \delta_ {0} + \gamma_ {1} ^ {2} \sum_ {k = 1} ^ {n} k ^ {- 2 \gamma} \leq \left\{ \begin{array}{l l} r ^ {2} \triangleq \delta_ {0} + \gamma_ {1} ^ {2} \zeta (2 \gamma) < \infty , & \gamma \in (1 / 2, 1 ], \\ \delta_ {0} + \gamma_ {1} ^ {2} (1 + \phi_ {2 \gamma} (n)), & \gamma \in (0, 1 / 2 ]. \end{array} \right. +$$ + +Also, for $\gamma \in [2/3, 1]$ , $\varepsilon_n = (4\bar{\beta}_n^{1/2}\sigma\gamma_1^{1/2})^{-1}r_1$ . Since $\bar{\beta}_n \leq \bar{\beta}_{\infty} \triangleq \sigma^2[4\beta_0^3r^2 + (\beta_0^3 + \beta_0\sigma^2)r + 2\beta_0\sigma^2] < \infty$ , + +$$ +\begin{array}{l} \sum_ {k = n _ {1}} ^ {n} \frac {\varepsilon_ {k}}{1 + \varepsilon_ {k}} \gamma_ {k} = \sum_ {k = n _ {1}} ^ {n} \frac {1}{\varepsilon_ {k} ^ {- 1} + 1} \gamma_ {k} = \sum_ {k = n _ {1}} ^ {n} \frac {1}{\frac {4 \sigma \gamma_ {1} ^ {1 / 2}}{r _ {1}} \bar {\beta} _ {k} ^ {1 / 2} + 1} \gamma_ {k} \\ \geq \frac {\gamma_ {1}}{\frac {4 \sigma \gamma_ {1} ^ {1 / 2}}{r _ {1}} \bar {\beta} _ {\infty} ^ {1 / 2} + 1} \sum_ {k = n _ {1}} ^ {n} \frac {1}{k ^ {\gamma}} \geq \frac {\gamma_ {1} / 2}{\frac {4 \sigma \gamma_ {1} ^ {1 / 2}}{r _ {1}} \bar {\beta} _ {\infty} ^ {1 / 2} + 1} [ \phi_ {\gamma} (n) - \phi_ {\gamma} (n _ {1} - 1) ]. \\ \end{array} +$$ + +If $\gamma \in (0,2 / 3)$ , then $\varepsilon_{n} = (4\bar{\beta}_{n}^{1 / 2}\sigma \gamma_{1}^{1 / 2})^{-1}r_{n}n^{3\gamma /2 - 1}$ . Since $\bar{\beta}_n^{1 / 2} / r_n$ is decreasing, + +$$ +\begin{array}{l} \sum_ {k = n _ {1}} ^ {n} \frac {1}{\varepsilon_ {k} ^ {- 1} + 1} \gamma_ {k} = \sum_ {k = n _ {1}} ^ {n} \frac {1}{4 \sigma \gamma_ {1} ^ {1 / 2} \frac {\bar {\beta} _ {k} ^ {1 / 2}}{r _ {k}} k ^ {1 - 3 \gamma / 2} + 1} \gamma_ {k} = \sum_ {k = n _ {1}} ^ {n} \frac {\gamma_ {1}}{4 \sigma \gamma_ {1} ^ {1 / 2} \frac {\bar {\beta} _ {k} ^ {1 / 2}}{r _ {k}} k ^ {1 - \gamma / 2} + k ^ {\gamma / 2}} \\ \geq \frac {\gamma_ {1}}{4 \sigma \gamma_ {1} ^ {1 / 2} \frac {\bar {\beta} _ {1} ^ {1 / 2}}{r _ {1}} + 1} \sum_ {k = n _ {1}} ^ {n} \frac {1}{k ^ {1 - \gamma / 2}} \geq \frac {\gamma_ {1} / 2}{4 \sigma \gamma_ {1} ^ {1 / 2} \frac {\bar {\beta} _ {1} ^ {1 / 2}}{r _ {1}} + 1} [ \phi_ {1 - \gamma / 2} (n) - \phi_ {1 - \gamma / 2} (n _ {1} - 1) ]. \\ \end{array} +$$ + +Therefore, + +$$ +\Delta_ {n} \leq \left\{ \begin{array}{l l} \frac {2 \max \{\frac {\gamma n _ {1}}{\sqrt {2}} , 1 \}}{4 \sigma \gamma_ {1} ^ {3 / 2} \bar {\beta} _ {1} ^ {1 / 2} r _ {1} ^ {- 1} + \gamma_ {1}} \frac {\delta_ {0} + \gamma_ {1} ^ {2} (1 + \phi_ {2 \gamma} (n))}{\phi_ {1 - \gamma / 2} (n) - \phi_ {1 - \gamma / 2} (n _ {1} - 1)}, & \gamma \in (0, 1 / 2 ], \\ \frac {2 \max \{\frac {\gamma n _ {1}}{\sqrt {2}} , 1 \}}{4 \sigma \gamma_ {1} ^ {3 / 2} \bar {\beta} _ {1} ^ {1 / 2} r _ {1} ^ {- 1} + \gamma_ {1}} \frac {\delta_ {0} + \gamma_ {1} ^ {2} \zeta (2 \gamma)}{\phi_ {1 - \gamma / 2} (n) - \phi_ {1 - \gamma / 2} (n _ {1} - 1)}, & \gamma \in (1 / 2, 2 / 3), \\ \frac {2 \max \{\frac {\gamma n _ {1}}{\sqrt {2}} , 1 \}}{4 \sigma \gamma_ {1} ^ {3 / 2} \bar {\beta} _ {\infty} ^ {1 / 2} r _ {1} ^ {- 1} + \gamma_ {1}} \frac {\delta_ {0} + \gamma_ {1} ^ {2} \zeta (2 \gamma)}{\phi_ {\gamma} (n) - \phi_ {\gamma} (n _ {1} - 1)}, & \gamma \in [ 2 / 3, 1 ], \end{array} \right. +$$ + +for $n\geq n_1$ (note $\gamma_{n_2}\leq \gamma_{n_1}$ + +Below we put the explicit values of the constants: + +$$ +\begin{array}{l} \Gamma_ {1} = \frac {2 \max \{\frac {\gamma_ {n _ {1}}}{\sqrt {2}} , 1 \}}{4 \sigma \gamma_ {1} ^ {3 / 2} \bar {\beta} _ {1} ^ {- 1 / 2} r _ {1} ^ {- 1} + \gamma_ {1}}, \quad \Gamma_ {2} = \frac {2 \max \{\frac {\gamma_ {n _ {1}}}{\sqrt {2}} , 1 \}}{4 \sigma \gamma_ {1} ^ {3 / 2} \bar {\beta} _ {1} ^ {- 1 / 2} r _ {1} ^ {- 1} + \gamma_ {1}} \quad \Gamma_ {3} = \frac {2 \max \{\frac {\gamma_ {n _ {1}}}{\sqrt {2}} , 1 \}}{4 \sigma \gamma_ {1} ^ {3 / 2} \bar {\beta} _ {\infty} ^ {1 / 2} r _ {1} ^ {- 1} + \gamma_ {1}} \\ r _ {n} ^ {2} = \delta_ {0} + \sigma^ {2} \sum_ {k = 1} ^ {n} \gamma_ {k} ^ {2}, \\ \bar {\beta} _ {n} = \sigma^ {- 2} \left(4 \beta_ {0} ^ {3} r _ {n} ^ {2} + \beta_ {0} ^ {3} r _ {n} + \beta_ {0} \sigma^ {2} r _ {n} + 2 \beta_ {0} \sigma^ {2}\right), \\ \bar {\beta} _ {\infty} = \sigma^ {2} [ 4 \beta_ {0} ^ {3} r ^ {2} + (\beta_ {0} ^ {3} + \beta_ {0} \sigma^ {2}) r + 2 \beta_ {0} \sigma^ {2} ] < \infty , \\ r = \delta_ {0} + \sigma^ {2} \sum_ {k = 1} ^ {\infty} \gamma_ {k} ^ {2}. \\ \end{array} +$$ + +# A.9. Proof of Theorem 5.2 + +Proof of Theorem 5.2. Pick a minimizer $\theta_{\star}$ of $L$ . From the main iteration $(3')$ , we have $\theta_{k} - \theta_{\star} = \theta_{k-1} - \theta_{\star} - \gamma_{k} \nabla \ell(Z_{k}, \theta_{k})$ and + +$$ +\begin{array}{l} \left\| \theta_ {k} - \theta_ {\star} \right\| ^ {2} = \left\| \theta_ {k - 1} - \theta_ {\star} \right\| ^ {2} - 2 \gamma_ {k} \nabla \ell \left(Z _ {k}, \theta_ {k}\right) ^ {T} \left(\theta_ {k - 1} - \theta_ {\star}\right) + \gamma_ {k} ^ {2} \left\| \nabla \ell \left(Z _ {k}, \theta_ {k}\right) \right\| ^ {2} \\ = \left\| \theta_ {k - 1} - \theta_ {\star} \right\| ^ {2} - 2 \gamma_ {k} \nabla \ell \left(Z _ {k}, \theta_ {k - 1}\right) ^ {T} \left(\theta_ {k - 1} - \theta_ {\star}\right) \\ + 2 \gamma_ {k} (\nabla \ell (Z _ {k}, \theta_ {k - 1}) - \nabla \ell (Z _ {k}, \theta_ {k})) ^ {T} (\theta_ {k - 1} - \theta_ {\star}) + \gamma_ {k} ^ {2} \| \nabla \ell (Z _ {k}, \theta_ {k}) \| ^ {2} \\ \leq \left\| \theta_ {k - 1} - \theta_ {\star} \right\| ^ {2} - 2 \gamma_ {k} \nabla \ell \left(Z _ {k}, \theta_ {k - 1}\right) ^ {T} \left(\theta_ {k - 1} - \theta_ {\star}\right) \\ + 2 \left\| R _ {k} \right\| \left\| \theta_ {k - 1} - \theta_ {\star} \right\| + \gamma_ {k} ^ {2} \left\| \nabla \ell \left(Z _ {k - 1}, \theta_ {k}\right) \right\| ^ {2}, \\ \end{array} +$$ + +where the final inequality is due to Lemma 3.1. Therefore + +$$ +\begin{array}{l} \mathbf {E} \left[ \| \theta_ {k} - \theta_ {\star} \| ^ {2} \mid \mathcal {F} _ {k - 1} \right] \leq \| \theta_ {k - 1} - \theta_ {\star} \| ^ {2} - 2 \gamma_ {k} \nabla L \left(\theta_ {k - 1}\right) ^ {T} \left(\theta_ {k - 1} - \theta_ {\star}\right) \\ + 2 \mathbf {E} \left[ \| R _ {k} \| | \mathcal {F} _ {k - 1} \right] \left\| \theta_ {k - 1} - \theta_ {\star}\right) \| + \gamma_ {k} ^ {2} \mathbf {E} \left[ \| \nabla \ell \left(Z _ {k - 1}, \theta_ {k}\right) \| ^ {2} \mid \mathcal {F} _ {k - 1} \right]. \tag {A.32} \\ \end{array} +$$ + +From the cocoercivity of Lipschitz continuous gradient operator (Bauschke & Combettes, 2011), we see + +$$ +\beta_ {0} ^ {- 1} \left\| \nabla \ell (Z _ {k}, \theta_ {k - 1}) - \nabla \ell (Z _ {k}, \theta_ {\star}) \right\| ^ {2} \leq (\nabla \ell (Z _ {k}, \theta_ {k - 1}) - \nabla \ell (Z _ {k}, \theta_ {\star})) ^ {T} (\theta_ {k - 1} - \theta_ {\star}) +$$ + +and thus + +$$ +\left\| \nabla \ell (Z _ {k}, \theta_ {k - 1}) \right\| ^ {2} = \left\| \ell (Z _ {k}, \theta_ {k - 1}) - \ell (Z _ {k}, \theta_ {\star}) + \ell (Z _ {k}, \theta_ {\star}) \right\| ^ {2} +$$ + +$$ +\begin{array}{l} \leq 2 \left\| \ell \left(Z _ {k}, \theta_ {k - 1}\right) - \ell \left(Z _ {k}, \theta_ {\star}\right) \right\| ^ {2} + 2 \left\| \ell \left(Z _ {k}, \theta_ {\star}\right) \right\| ^ {2} \\ \leq 2 \beta_ {0} (\nabla \ell (Z _ {k}, \theta_ {k - 1}) - \nabla \ell (Z _ {k}, \theta_ {\star})) ^ {T} (\theta_ {k - 1} - \theta_ {\star}) + 2 \| \ell (Z _ {k}, \theta_ {\star}) \| ^ {2}. \\ \end{array} +$$ + +Therefore from inequality (A.32) + +$$ +\begin{array}{l} \mathbf {E} \left\| \theta_ {k} - \theta_ {\star} \right\| ^ {2} \leq \mathbf {E} \left\| \theta_ {k - 1} - \theta_ {\star} \right\| ^ {2} - 2 \gamma_ {k} \mathbf {E} \left[ \nabla L \left(\theta_ {k - 1}\right) ^ {T} \left(\theta_ {k - 1} - \theta_ {\star}\right) \right] \\ + 2 \gamma_ {k} ^ {2} \beta_ {0} ^ {2} \mathbf {E} \| \theta_ {k - 1} - \theta_ {\star} \| ^ {2} + (\beta_ {0} ^ {2} + \sigma^ {2}) \gamma_ {k} ^ {2} \mathbf {E} \| \theta_ {k - 1} - \theta_ {\star} \| ^ {2} \\ + 2 \gamma_ {k} ^ {2} \beta_ {0} \mathbf {E} [ \nabla L (\theta_ {k - 1}) ^ {T} (\theta_ {k - 1} - \theta_ {\star}) ] + 2 \gamma_ {k} ^ {2} \sigma^ {2} \\ \leq \mathbf {E} \left\| \theta_ {k - 1} - \theta_ {\star} \right\| ^ {2} - 2 \gamma_ {k} \left(1 - \beta_ {0} \gamma_ {k}\right) \mathbf {E} \left[ \nabla L \left(\theta_ {k - 1}\right) ^ {T} \left(\theta_ {k - 1} - \theta_ {\star}\right) \right] + 2 \gamma_ {k} ^ {2} \tilde {\sigma} ^ {2}, \\ \end{array} +$$ + +where $\tilde{\sigma}^2 = \beta_0^2 r^2 +r(\beta_0^2 +\sigma^2) / 2 + \sigma^2$ ; the last inequality is due to Lemma A.1. Let $\delta_{k}$ denote $\mathbf{E}\left\| \theta_k - \theta_\star \right\|^2$ . The previous inequality implies + +$$ +2 \gamma_ {k} \left(1 - \beta_ {0} \gamma_ {k}\right) \mathbf {E} \left[ \nabla L \left(\theta_ {k - 1}\right) ^ {T} \left(\theta_ {k - 1} - \theta_ {\star}\right) \right] \leq \delta_ {k - 1} - \delta_ {k} + 2 \gamma_ {k} ^ {2} \tilde {\sigma} ^ {2}. +$$ + +If we let $n_* = \inf \{k \in \mathbb{N} : (1 - \gamma_k\beta_0) \geq 1/2\}$ , then $\mathbf{E}[\nabla L(\theta_{k-1})^T (\theta_{k-1} - \theta_\star)] \leq \gamma_k^{-1} (\delta_{k-1} - \delta_k + 2\gamma_k^2 \tilde{\sigma}^2)$ for all $k \geq n_*$ . + +Lipschitz continuity of $\nabla L$ implies $L(\theta_{k - 1}) - L(\theta_{\star})\leq \frac{\beta_0}{2}\| \theta_{k - 1} - \theta_{\star}\| ^2$ . Also, by convexity, $L(\theta_{k - 1}) - L(\theta_{\star})\leq \nabla L(\theta_{k - 1})^T (\theta_{k - 1} - \theta_{\star})$ . Therefore, for $n > n_*$ , + +$$ +\begin{array}{l} L (\bar {\theta} _ {n}) - L (\theta_ {\star}) = L \left(\frac {1}{n} \sum_ {k = 0} ^ {n - 1} \theta_ {k}\right) - L (\theta_ {\star}) \\ \leq \frac {1}{n} \sum_ {k = 1} ^ {n} \left(L \left(\theta_ {k - 1}\right) - L \left(\theta_ {\star}\right)\right) \\ = \frac {1}{n} \sum_ {k = 1} ^ {n _ {*}} \left(L \left(\theta_ {k - 1}\right) - L \left(\theta_ {\star}\right)\right) + \frac {1}{n} \sum_ {k = n _ {*} + 1} ^ {n} \left(L \left(\theta_ {k - 1}\right) - L \left(\theta_ {\star}\right)\right) \\ \leq \frac {\beta_ {0}}{2 n} \sum_ {k = 1} ^ {n _ {*}} \| \theta_ {k - 1} - \theta_ {\star} \| ^ {2} + \frac {1}{n} \sum_ {k = n _ {*} + 1} ^ {n} \nabla L (\theta_ {k - 1}) ^ {T} (\theta_ {k - 1} - \theta_ {\star}). \\ \end{array} +$$ + +Then it follows + +$$ +\mathbf {E} \left[ L \left(\bar {\theta} _ {n}\right) - L \left(\theta_ {\star}\right) \right] \leq \frac {1}{n} \left(\frac {\beta_ {0}}{2} \sum_ {k = 1} ^ {n _ {*}} \delta_ {k - 1} + \sum_ {k = n _ {*} + 1} ^ {n} \gamma_ {k} ^ {- 1} \left(\delta_ {k - 1} - \delta_ {k} + 2 \gamma_ {k} ^ {2} \tilde {\sigma} ^ {2}\right)\right). +$$ + +Observe that $\delta_{k - 1}\leq r_k^2\triangleq \delta_0 + \sigma^2\sum_{j = 1}^k\gamma_j^2\leq \delta_0 + \sigma^2\gamma_1^2 [1 + \phi_{2\gamma}(k)]$ Since $1 + \phi_{2\gamma}(k)\leq k^{1 - 2\gamma} / (1 - 2\gamma)$ if $\gamma < 1 / 2$ and $\phi_{2\gamma}(k) = \log k$ if $\gamma = 1 / 2$ , and $\sum_{j = 1}^{k}j^{-2\gamma}\leq \sum_{j = 1}^{\infty}j^{-2\gamma} = \zeta (2\gamma) < \infty$ if $\gamma >1 / 2$ where $\zeta (\cdot)$ is the Riemann zeta function, it follows that + +$$ +\sum_ {k = 1} ^ {n _ {*}} r _ {k} ^ {2} \leq \left\{ \begin{array}{l l} n _ {*} \delta_ {0} + \frac {\sigma^ {2} \gamma_ {1} ^ {2}}{1 - 2 \gamma} \phi_ {2 \gamma - 1} (n _ {*}), & \gamma < 1 / 2, \\ n _ {*} \delta_ {0} + \sigma^ {2} \gamma_ {1} ^ {2} \log (n _ {*} + 1), & \gamma = 1 / 2, \\ n _ {*} [ \delta_ {0} + \sigma^ {2} \gamma_ {1} ^ {2} \zeta (2 \gamma) ], & \gamma > 1 / 2. \end{array} \right. +$$ + +On the other hand, + +$$ +\begin{array}{l} \sum_ {n _ {*} + 1} ^ {n} \gamma_ {k} ^ {- 1} (\delta_ {k - 1} - \delta_ {k}) = \gamma_ {n _ {*} + 1} ^ {- 1} \delta_ {n _ {*}} + \sum_ {k = n _ {*} + 1} ^ {n - 1} \delta_ {k} (\gamma_ {k + 1} ^ {- 1} - \gamma_ {k} ^ {- 1}) - \gamma_ {n} ^ {- 1} \delta_ {n} \\ \leq r _ {n} ^ {2} \gamma_ {n _ {*} + 1} ^ {- 1} + r _ {n} ^ {2} \sum_ {k = n _ {*} + 1} ^ {n - 1} \left(\gamma_ {k + 1} ^ {- 1} - \gamma_ {k} ^ {- 1}\right) - \gamma_ {n} ^ {- 1} \delta_ {n} \\ = r _ {n} ^ {2} \gamma_ {n} ^ {- 1} - \gamma_ {n} ^ {- 1} \delta_ {n} \leq r _ {n} ^ {2} \gamma_ {n} ^ {- 1} \\ \end{array} +$$ + +(Bach & Moulines, 2011, p. 27). Thus + +$$ +\begin{array}{l} \mathbf {E} \left[ L (\bar {\theta} _ {n}) - L (\theta_ {\star}) \right] \leq \frac {1}{n} \Big (\frac {\beta_ {0}}{2} \sum_ {k = 1} ^ {n _ {*}} r _ {k} ^ {2} + r _ {n} ^ {2} \gamma_ {n} ^ {- 1} + 2 \tilde {\sigma} ^ {2} \sum_ {k = 1} ^ {n} \gamma_ {k} \Big) \\ \leq \frac {1}{n} \left(\frac {\beta_ {0}}{2} \sum_ {k = 1} ^ {n _ {*}} r _ {k} ^ {2} + \delta_ {0} \gamma_ {n} ^ {- 1} + \sigma^ {2} \gamma_ {1} ^ {2} [ 1 + \phi_ {2 \gamma} (n) ] \gamma_ {n} ^ {- 1} + 2 \tilde {\sigma} ^ {2} \gamma_ {1} \phi_ {\gamma} (n)\right) \\ = \frac {\beta_ {0}}{2 n} \sum_ {k = 1} ^ {n _ {*}} r _ {k} ^ {2} + \frac {\delta_ {0}}{\gamma_ {1} n ^ {1 - \gamma}} + \sigma^ {2} \gamma_ {1} ^ {2} \frac {1 + \phi_ {2 \gamma} (n)}{n ^ {1 - \gamma}} + 2 \tilde {\sigma} ^ {2} \gamma_ {1} \frac {\phi_ {\gamma} (n)}{n} \\ \leq \left\{ \begin{array}{l l} \frac {\beta_ {0} [ n _ {*} \delta_ {0} + \frac {\sigma^ {2} \gamma_ {1} ^ {2}}{1 - 2 \gamma} \phi_ {2 \gamma - 1} (n _ {*}) ]}{2 n} + \frac {\sigma^ {2} \gamma_ {1} ^ {2}}{(1 - 2 \gamma) n ^ {\gamma}} + \frac {2 \tilde {\sigma} ^ {2} \gamma_ {1}}{(1 - \gamma) n ^ {\gamma}}, & \gamma < 1 / 2, \\ \frac {\beta_ {0} [ n _ {*} \delta_ {0} + \sigma^ {2} \gamma_ {1} ^ {2} \log (n _ {*} + 1) ]}{2 n} + \sigma^ {2} \gamma_ {1} ^ {2} \frac {1 + \log n}{\sqrt {n}} + \frac {2 \tilde {\sigma} ^ {2} \gamma_ {1}}{(1 - \gamma) \sqrt {n}}, & \gamma = 1 / 2. \end{array} \right. \\ \end{array} +$$ + +When $\gamma > 1/2$ , we can replace the $1 + \phi_{2\gamma}(n)$ with $\zeta(2\gamma)$ , hence + +$$ +\mathbf {E} \left[ L (\bar {\theta} _ {n}) - L (\theta_ {\star}) \right] \leq \left\{ \begin{array}{l l} \frac {\beta_ {0} n _ {*} [ \delta_ {0} + \sigma^ {2} \gamma_ {1} ^ {2} \zeta (2 \gamma) ]}{2 n} + \frac {\sigma^ {2} \gamma_ {1} ^ {2} \zeta (2 \gamma)}{n ^ {1 - \gamma}} + \frac {2 \bar {\sigma} ^ {2} \gamma_ {1}}{(1 - \gamma) n ^ {\gamma}}, & \gamma \in (1 / 2, 1), \\ \frac {\beta_ {0} n _ {*} [ \delta_ {0} + \sigma^ {2} \gamma_ {1} ^ {2} \zeta (2 \gamma) ]}{2 n} + \sigma^ {2} \gamma_ {1} ^ {2} \zeta (2) + \frac {2 \bar {\sigma} ^ {2} \gamma_ {1} \log n}{(1 - \gamma) n}, & \gamma = 1. \end{array} \right. +$$ + +The preceding argument immediately yields that for $n \leq n_*$ , + +$$ +\mathbf {E} \left[ L (\bar {\theta} _ {n}) - L (\theta_ {\star}) \right] \leq \left\{ \begin{array}{l l} \frac {\beta_ {0}}{2} \left(\delta_ {0} + \frac {\sigma^ {2} \gamma_ {1} ^ {2}}{(1 - 2 \gamma) (2 - 2 \gamma)} n ^ {1 - 2 \gamma}\right), & \gamma < 1 / 2, \\ \frac {\beta_ {0}}{2} \left(\delta_ {0} + \sigma^ {2} \gamma_ {1} ^ {2} \frac {\log (n + 1)}{n}\right), & \gamma = 1 / 2, \\ \frac {\beta_ {0}}{2} \left(\delta_ {0} + \frac {\sigma^ {2} \gamma_ {1} ^ {2} \zeta (2 \gamma)}{n}\right), & \gamma > 1 / 2, \end{array} \right. +$$ + +Since $\phi_{2\gamma -1}(n)\leq n^{2 - 2\gamma} / (2 - 2\gamma)$ when $\gamma < 1 / 2$ + +Below we put the explicit values of the constants: + +$$ +\begin{array}{l} \tilde {\Gamma} _ {1} = \frac {\beta_ {0} [ n _ {*} \delta_ {0} + \frac {\sigma^ {2} \gamma_ {1} ^ {2}}{1 - 2 \gamma} \phi_ {2 \gamma - 1} (n _ {*}) ]}{2}, \quad \tilde {\Gamma} _ {2} = \frac {\beta_ {0} [ n _ {*} \delta_ {0} + \sigma^ {2} \gamma_ {1} ^ {2} \log (n _ {*} + 1) ]}{2} \quad \tilde {\Gamma} _ {3} = \frac {\beta_ {0} n _ {*} [ \delta_ {0} + \sigma^ {2} \gamma_ {1} ^ {2} \zeta (2 \gamma) ]}{2}, \\ \tilde {\sigma} ^ {2} = \beta_ {0} ^ {2} r ^ {2} + r (\beta_ {0} ^ {2} + \sigma^ {2}) / 2 + \sigma^ {2}, \\ r = \delta_ {0} + \sigma^ {2} \sum_ {k = 1} ^ {\infty} \gamma_ {k} ^ {2}. \\ \end{array} +$$ + +# B. Proofs of technical lemmas + +Proof of Lemma 3.1. Note from the ISGD update (3) that $\theta_{n - 1} - \theta_n = \gamma_n\nabla \ell (Z_n,\theta_n)$ . Therefore + +$$ +\gamma_ {n} [ \ell (Z _ {n}, \theta_ {n}) - \ell (Z _ {n}, \theta_ {n - 1}) ] \leq \gamma_ {n} \nabla \ell (Z _ {n}, \theta_ {n}) ^ {T} (\theta_ {n} - \theta_ {n - 1}) = - \left\| \theta_ {n} - \theta_ {n - 1} \right\| ^ {2}, +$$ + +where the first inequality follows from the convexity of $\ell(Z_n, \cdot)$ , i.e., Assumptions A1. Using this convexity once more, we see $\ell(Z_n, \theta_n) - \ell(Z_n, \theta_{n-1}) \geq \nabla \ell(Z_n, \theta_{n-1})^T (\theta_n - \theta_{n-1})$ . It follows that + +$$ +\left\| \theta_ {n} - \theta_ {n - 1} \right\| ^ {2} \leq \gamma_ {n} \nabla \ell (Z _ {n}, \theta_ {n - 1}) (\theta_ {n - 1} - \theta_ {n}) \leq \gamma_ {n} \left\| \nabla \ell (Z _ {n}, \theta_ {n - 1}) \right\| \left\| \theta_ {n - 1} - \theta_ {n} \right\| +$$ + +and the claim is proved. + +Proof of Lemma A.2. Let us first consider the case $n < n_0$ . Since $c_n \downarrow 0$ , $Q_{i+1}^n < (1 + c_{i+1}) \cdots (1 + c_n) \leq (1 + c_1)^{n_0}$ . + +By expanding inequality (A.6), we see + +$$ +\begin{array}{l} y _ {n} \leq Q _ {1} ^ {n} y _ {0} + \sum_ {i = 1} ^ {n} Q _ {i + 1} ^ {n} a _ {i} \leq Q _ {1} ^ {n} y _ {0} + (1 + c _ {1}) ^ {n _ {0}} \sum_ {i = 1} ^ {n} a _ {i} \\ \leq Q _ {1} ^ {n} y _ {0} + \left(1 + c _ {1}\right) ^ {n _ {0}} A \tag {B.1} \\ \leq K _ {0} \frac {a _ {n}}{b _ {n}} + Q _ {1} ^ {n} y _ {0} + (1 + c _ {1}) ^ {n _ {0}} A + B, \\ \end{array} +$$ + +where the last line is inequality (A.7). + +Now consider the case $n \geq n_0$ . Since + +$$ +\frac {1 + (1 + \delta) b _ {1}}{1 + \delta - \delta_ {n} - \zeta_ {n}} \leq \frac {1 + (1 + \delta) b _ {1}}{1 + \delta - \delta_ {n _ {0}} - \zeta_ {n _ {0}}} = K _ {0} +$$ + +and $b_{n}\downarrow 0$ , it follows that $K_{0}(\delta_{n} + \zeta_{n}) + 1 + (1 + \delta)b_{n}\leq K_{0}(1 + \delta)$ , or + +$$ +\frac {K _ {0}}{a _ {n}} \left(\frac {a _ {n - 1}}{b _ {n - 1}} - \frac {a _ {n}}{b _ {n}} + \frac {c _ {n} a _ {n - 1}}{b _ {n - 1}}\right) + 1 + (1 + \delta) b _ {n} \leq K _ {0} (1 + \delta). +$$ + +This implies + +$$ +a _ {n} [ 1 + (1 + \delta) b _ {n} ] \leq K _ {0} \left(\frac {[ 1 + (1 + \delta) b _ {n} ] a _ {n}}{b _ {n}} - \frac {(1 + c _ {n}) a _ {n - 1}}{b _ {n - 1}}\right) +$$ + +and + +$$ +a _ {n} \leq K _ {0} \left(\frac {a _ {n}}{b _ {n}} - \frac {1 + c _ {n}}{1 + (1 + \delta) b _ {n}} \frac {a _ {n - 1}}{b _ {n - 1}}\right). \tag {B.2} +$$ + +Combining inequalities (A.6) and (B.2), we obtain + +$$ +y _ {n} - K _ {0} \frac {a _ {n}}{b _ {n}} \leq \frac {1 + c _ {n}}{1 + (1 + \delta) b _ {n}} \left(y _ {n - 1} - K _ {0} \frac {a _ {n - 1}}{b _ {n - 1}}\right). +$$ + +Define $s_n = y_n - K_0 a_n / b_n$ . Then $|s_n| \leq (1 + c_n)[1 + (1 + \delta) b_n]^{-1} |s_{n-1}|$ and thus $|s_n| \leq Q_{n_0+1}^n |s_{n_0}|$ . Therefore, + +$$ +\begin{array}{l} y _ {n} - K _ {0} \frac {a _ {n}}{b _ {n}} \leq | s _ {n} | \leq Q _ {n _ {0} + 1} ^ {n} \left| y _ {n _ {0}} - K _ {0} \frac {a _ {n _ {0}}}{b _ {n _ {0}}} \right| \\ \leq Q _ {n _ {0} + 1} ^ {n} \left(y _ {n _ {0}} + K _ {0} \frac {a _ {n _ {0}}}{b _ {n _ {0}}}\right) \\ = Q _ {n _ {0} + 1} ^ {n} y _ {n _ {0}} + Q _ {n _ {0} + 1} ^ {n} B \\ \leq Q _ {1} ^ {n} y _ {0} + Q _ {n _ {0} + 1} ^ {n} \left(1 + c _ {1}\right) ^ {n _ {0}} A + Q _ {n _ {0} + 1} ^ {n} B, \\ \end{array} +$$ + +where the last line follows from inequality (B.1). + +Proof of Corollary A.1. It is easy to verify that + +$$ +1 - \eta n ^ {- \gamma} + \nu n ^ {- \beta} \leq \frac {1 + \nu (1 + \eta) n ^ {- \beta}}{1 + \eta n ^ {- \gamma}} +$$ + +for all $n \geq 1$ . Let $a_{n} = a_{1}n^{-\alpha}$ , $b_{n} = \eta n^{-\gamma} / (1 + \delta)$ , $c_{n} = \nu (1 + \eta)n^{-\beta}$ . Then inequality (A.6) in Lemma A.2 holds for $(a_{n}, b_{n}, c_{n})$ . + +To see if the conditions for Lemma A.2 hold, verify that $a_{n} \downarrow 0$ , $\sum_{n=1}^{\infty} a_{n} < \infty$ , $b_{n} \downarrow 0$ , $c_{n} \downarrow 0$ , $c_{n}/b_{n} \propto n^{-(\beta - \alpha)} \downarrow 0$ , hence $c_{n}/b_{n} < 1$ for all sufficiently large $n$ , and + +$$ +\delta_ {n} = \frac {1}{a _ {n}} \left(\frac {a _ {n - 1}}{b _ {n - 1}} - \frac {a _ {n}}{b _ {n}}\right) = \frac {1 + \delta}{\eta} n ^ {\gamma} \left(\left[ \frac {n}{n - 1} \right] ^ {\alpha - \gamma} - 1\right) \downarrow \delta , +$$ + +$$ +\zeta_ {n} = \frac {c _ {n}}{b _ {n - 1}} \frac {a _ {n - 1}}{a _ {n}} = \nu (1 + \eta) (1 + \delta) \left(\frac {n}{n - 1}\right) ^ {\alpha - \gamma} n ^ {- (\beta - \gamma)} \downarrow 0. +$$ + +Recall that $\delta = \frac{1 + \delta}{\eta} (\alpha -\gamma)$ if $\gamma = 1$ + +Therefore inequality (A.7) from Lemma A.2 translates to + +$$ +y _ {n} \leq K _ {1} n ^ {- (\alpha - \gamma)} + Q _ {1} ^ {n} y _ {0} + Q _ {n _ {0} + 1} ^ {n} \left[ \left(1 + c _ {1}\right) ^ {n _ {0}} A + B \right], \tag {B.3} +$$ + +where $K_{1}$ , $A$ , and $B$ are given in equations (A.10a) and (A.10d); the conditions for the $n_0$ translates to inequalities (A.11). Furthermore, + +$$ +Q _ {i} ^ {n} = \left\{ \begin{array}{l l} \prod_ {j = i} ^ {n} \frac {1 + \nu (1 + \eta) n ^ {- \beta}}{1 + \eta n ^ {- \gamma}}, & n \geq i, \\ 1, & n < i. \end{array} \right. +$$ + +Since $b_n, c_n \downarrow 0$ , $Q_1^n = \prod_{j=1}^n \frac{1 + c_j}{1 + (1 + \delta)b_j} \geq \prod_{j=1}^n \frac{1}{1 + (1 + \delta)b_j} \geq (1 + \eta)^{-n}$ . Hence + +$$ +Q _ {n _ {0} + 1} ^ {n} = Q _ {1} ^ {n} / Q _ {1} ^ {n _ {0}} \leq (1 + \eta) ^ {n _ {0}} Q _ {1} ^ {n} = (1 + \eta) ^ {n _ {0}} Q _ {1} ^ {n}. \tag {B.4} +$$ + +In order to bound $Q_1^n$ , take a logarithm to see + +$$ +\log Q _ {1} ^ {n} = \sum_ {k = 1} ^ {n} \log (1 + \nu (1 + \eta) k ^ {- \beta}) - \sum_ {k = 1} ^ {n} \log (1 + \eta k ^ {- \gamma}). +$$ + +For the first term, use $\log (1 + x)\leq x$ for $x\geq 0$ to get + +$$ +\sum_ {k = 1} ^ {n} \log (1 + \nu (1 + \eta) k ^ {- \beta}) \leq \nu (1 + \eta) \sum_ {k = 1} ^ {n} \frac {1}{k ^ {\beta}} \leq \left\{ \begin{array}{l l} \nu (1 + \eta) \sum_ {k = 1} ^ {\infty} \frac {1}{k ^ {\beta}}, & \beta > 1, \\ \nu (1 + \eta) \phi_ {\beta} (n), & \beta \leq 1, \end{array} \right., +$$ + +since $\sum_{k=1}^{n} k^{-\beta} \leq \phi_{\beta}(n)$ for $\beta \leq 1$ . For the second term, since $x \mapsto x^{-1} \log(1 + x)$ is decreasing for $x > -1$ and $k^{-\gamma} \downarrow 0$ , we have $\log(1 + \eta k^{-\gamma}) \geq k^{-\gamma} \log(1 + \eta)$ to get + +$$ +- \sum_ {i = 1} ^ {n} \log (1 + \eta k ^ {- \gamma}) \leq - \log (1 + \eta) \sum_ {k = 1} ^ {n} \frac {1}{k ^ {\gamma}} \leq - \frac {1}{2} \log (1 + \eta) \phi_ {\gamma} (n), \tag {B.5} +$$ + +since $\sum_{k = 1}^{n}k^{-\gamma}\geq \frac{1}{2}\phi_{\gamma}(n)$ for $\gamma \leq 1$ . Thus + +$$ +Q _ {1} ^ {n} \leq K _ {2} (n) \exp \left(- \frac {1}{2} \log (1 + \eta) \phi_ {\gamma} (n)\right), \tag {B.6} +$$ + +where $K_{2}(n)$ is given in equation (A.10b). Combining inequalities (B.3), (B.4), and (B.6), we finally obtain inequality (A.9), with $D_{n_0}$ given in equation (A.10c). + +Proof of Lemma A.5. Recall that $\theta_{n} - \theta_{\star} = \theta_{n - 1} - \theta_{\star} - \gamma_{n}\nabla \ell (Z_{n},\theta_{n})$ . Therefore, + +$$ +\begin{array}{l} \left\| \theta_ {n} - \theta_ {\star} \right\| ^ {2} = \left\| \theta_ {n - 1} - \theta_ {\star} \right\| ^ {2} - 2 \gamma_ {n} (\theta_ {n - 1} - \theta_ {\star}) ^ {T} \nabla \ell (Z _ {n}, \theta_ {n}) + \gamma_ {n} ^ {2} \left\| \nabla \ell (Z _ {n}, \theta_ {n}) \right\| ^ {2} \\ \leq \left\| \theta_ {n - 1} - \theta_ {\star} \right\| ^ {2} - 2 \gamma_ {n} W _ {n} + \gamma_ {n} ^ {2} V _ {n}, \tag {B.7} \\ \end{array} +$$ + +where $W_{n} = (\theta_{n - 1} - \theta_{\star})^{T}\nabla \ell (Z_{n},\theta_{n})$ and $V_{n} = \| \nabla \ell (Z_{n},\theta_{n - 1})\|^{2}$ ; the last line follows from Lemma 3.1. + +We first bound the fourth moment. Squaring both sides of inequality (B.7) yields + +$$ +\begin{array}{l} \left\| \theta_ {n} - \theta_ {\star} \right\| ^ {4} \leq \left\| \theta_ {n - 1} - \theta_ {\star} \right\| ^ {4} + 4 \gamma_ {n} ^ {2} W _ {n} ^ {2} + \gamma_ {n} ^ {4} V _ {n} ^ {2} \\ - 4 \gamma_ {n} \| \theta_ {n - 1} - \theta_ {\star} \| ^ {2} W _ {n} + 2 \gamma_ {n} ^ {2} \| \theta_ {n - 1} - \theta_ {\star} \| ^ {2} V _ {n} - 4 \gamma_ {n} ^ {3} W _ {n} V _ {n}. \\ \end{array} +$$ + +In order to bound $\mathbf{E}\left[\| \theta_n - \theta_\star \|^4\mid \mathcal{F}_{n - 1}\right]$ , first note that + +$$ +\mathbf {E} \left[ W _ {n} | \mathcal {F} _ {n - 1} \right] = \mathbf {E} \left[ \left(\theta_ {n - 1} - \theta_ {\star}\right) ^ {T} \nabla \ell \left(Z _ {n}, \theta_ {n - 1}\right) - \gamma_ {n} ^ {- 1} \left(\theta_ {n - 1} - \theta_ {\star}\right) ^ {T} R _ {n}) | \mathcal {F} _ {n - 1} \right] +$$ + +$$ +\begin{array}{l} \geq \left(\theta_ {n - 1} - \theta_ {\star}\right) ^ {T} \mathbf {E} \left[ \nabla \ell \left(Z _ {n}, \theta_ {n - 1}\right) \mid \mathcal {F} _ {n - 1} \right] - \gamma_ {n} ^ {- 1} \| \theta_ {n - 1} - \theta_ {\star} \| \mathbf {E} \left[ \| R _ {n} \| \mid \mathcal {F} _ {n - 1} \right] \\ \geq \left(\theta_ {n - 1} - \theta_ {\star}\right) ^ {T} \mathbf {E} \left[ \nabla \ell \left(Z _ {n}, \theta_ {n - 1}\right) \mid \mathcal {F} _ {n - 1} \right] - \gamma_ {n} \beta_ {0} ^ {2} \left\| \theta_ {n - 1} - \theta_ {\star} \right\| ^ {2} - \gamma_ {n} \left(\beta_ {0} ^ {2} + \sigma^ {2}\right) \left\| \theta_ {n - 1} - \theta_ {\star} \right\| \\ = \left(\theta_ {n - 1} - \theta_ {\star}\right) ^ {T} (\nabla L \left(\theta_ {n - 1}\right) - \nabla L \left(\theta_ {\star}\right)) - \gamma_ {n} \beta_ {0} ^ {2} \| \theta_ {n - 1} - \theta_ {\star} \| ^ {2} - \gamma_ {n} \left(\beta_ {0} ^ {2} + \sigma^ {2}\right) \| \theta_ {n - 1} - \theta_ {\star} \| \\ \geq \lambda \left\| \theta_ {n - 1} - \theta_ {\star} \right\| ^ {2} - \gamma_ {n} \beta_ {0} ^ {2} \left\| \theta_ {n - 1} - \theta_ {\star} \right\| ^ {2} - \gamma_ {n} \left(\beta_ {0} ^ {2} + \sigma^ {2}\right) \left\| \theta_ {n - 1} - \theta_ {\star} \right\|. \tag {B.8} \\ \end{array} +$$ + +The first inequality is Cauchy-Schwarz, the second is inequality (A.3), and the last inequality is from the strong convexity of $L$ . In addition, + +$$ +\mathbf {E} \left[ V _ {n} \mid \mathcal {F} _ {n - 1} \right] \leq 2 \beta_ {0} ^ {2} \left\| \theta_ {n - 1} - \theta_ {\star} \right\| ^ {2} + 2 \sigma^ {2} \tag {B.9} +$$ + +from inequality (A.4), and + +$$ +\begin{array}{l} \mathbf {E} \left[ - W _ {n} V _ {n} | \mathcal {F} _ {n - 1} \right] = - \mathbf {E} \left[ (\theta_ {n - 1} - \theta_ {\star}) ^ {T} \nabla \ell (Z _ {n}, \theta_ {n}) \left\| \nabla \ell (Z _ {n}, \theta_ {n - 1}) \right\| ^ {2} | \mathcal {F} _ {n - 1} \right] \\ \leq \left\| \theta_ {n - 1} - \theta_ {\star} \right\| \mathbf {E} \left[ \| \nabla \ell \left(Z _ {n}, \theta_ {n}\right) \| \| \nabla \ell \left(Z _ {n}, \theta_ {n - 1}\right) \| ^ {2} \mid \mathcal {F} _ {n - 1} \right] \\ \leq \left\| \theta_ {n - 1} - \theta_ {\star} \right\| \mathbf {E} \left[ \left\| \nabla \ell (Z _ {n}, \theta_ {n - 1}) \right\| ^ {3} \mid \mathcal {F} _ {n - 1} \right] \\ \end{array} +$$ + +again by Lemma 3.1. Since $\| \nabla \ell (Z_n,\theta_{n - 1})\| \leq \beta_0\| \theta_{n - 1} - \theta_\star \| +\| \nabla \ell (Z_n,\theta_\star)\|$ by Assumption A2', combining with Assumption A4' we have + +$$ +\begin{array}{l} \mathbf {E} \left[ \left\| \nabla \ell (Z _ {n}, \theta_ {n - 1}) \right\| ^ {3} | \mathcal {F} _ {n - 1} \right] \leq 4 \beta_ {0} ^ {3} \left\| \theta_ {n - 1} - \theta_ {\star} \right\| ^ {3} + 4 \mathbf {E} \left\| \nabla \ell (Z _ {n}, \theta_ {\star}) \right\| ^ {3} \\ \leq 4 \beta_ {0} ^ {3} \left\| \theta_ {n - 1} - \theta_ {\star} \right\| ^ {3} + 4 \sigma^ {3}. \\ \end{array} +$$ + +by Proposition A.1. Therefore + +$$ +\mathbf {E} \left[ - W _ {n} V _ {n} \mid \mathcal {F} _ {n - 1} \right] \leq 4 \beta_ {0} ^ {3} \left\| \theta_ {n - 1} - \theta_ {\star} \right\| ^ {4} + 4 \sigma^ {3} \left\| \theta_ {n - 1} - \theta_ {\star} \right\|. \tag {B.10} +$$ + +Finally, + +$$ +\begin{array}{l} \mathbf {E} \left[ W _ {n} ^ {2} | \mathcal {F} _ {n - 1} \right] = \mathbf {E} \left[ \left(\left(\theta_ {n - 1} - \theta_ {\star}\right) ^ {T} \nabla \ell \left(Z _ {n}, \theta_ {n}\right)\right) ^ {2} | \mathcal {F} _ {n - 1} \right] \\ \leq \left\| \theta_ {n - 1} - \theta_ {\star} \right\| ^ {2} \mathbf {E} \left[ \left\| \ell \left(Z _ {n}, \theta_ {n}\right) \right\| ^ {2} \mid \mathcal {F} _ {n - 1} \right] \\ \leq \left\| \theta_ {n - 1} - \theta_ {\star} \right\| ^ {2} \mathbf {E} \left[ \| \ell \left(Z _ {n}, \theta_ {n - 1}\right) \| ^ {2} \mid \mathcal {F} _ {n - 1} \right] \\ \leq 2 \beta_ {0} ^ {2} \| \theta_ {n - 1} - \theta_ {\star} \| ^ {4} + 2 \sigma^ {2} \| \theta_ {n - 1} - \theta_ {\star} \| ^ {2} \tag {B.11} \\ \end{array} +$$ + +from inequality (B.9), and + +$$ +\begin{array}{l} \mathbf {E} \left[ V _ {n} ^ {2} \mid \mathcal {F} _ {n - 1} \right] \leq \mathbf {E} \left[ \left\| \ell \left(Z _ {n}, \theta_ {n - 1}\right) \right\| ^ {4} \mid \mathcal {F} _ {n - 1} \right] \\ \leq 8 \beta_ {0} ^ {4} \left\| \theta_ {n - 1} - \theta_ {\star} \right\| ^ {4} + 8 \mathbf {E} \left[ \left\| \ell \left(Z _ {n}, \theta_ {\star}\right) \right\| ^ {4} \mid \mathcal {F} _ {n - 1} \right] \\ \leq 8 \beta_ {0} ^ {4} \| \theta_ {n - 1} - \theta_ {\star} \| ^ {4} + 8 \sigma^ {4} \tag {B.12} \\ \end{array} +$$ + +from Proposition A.1 and Assumption $\mathrm{A4^{\prime}}$ + +Combining inequalities (B.8), (B.9), (B.10), (B.11), and (B.12), we see + +$$ +\begin{array}{l} \mathbf {E} \left[ \left\| \theta_ {n} - \theta_ {\star} \right\| ^ {4} \mid \mathcal {F} _ {n - 1} \right] \leq \left(1 - 4 \lambda \gamma_ {n} + 1 4 \beta_ {0} ^ {2} \gamma_ {n} ^ {2} + 1 6 \beta_ {0} ^ {3} \gamma_ {n} ^ {3} + 8 \beta_ {0} ^ {4} \gamma_ {n} ^ {4}\right) \left\| \theta_ {n - 1} - \theta_ {\star} \right\| ^ {4} \\ + 4 \left(\beta_ {0} ^ {2} + \sigma^ {2}\right) \gamma_ {n} ^ {2} \left\| \theta_ {n - 1} - \theta_ {\star} \right\| ^ {3} + 2 \sigma^ {2} \left(\gamma_ {n} ^ {2} + 4 \gamma_ {n} ^ {4}\right) \left\| \theta_ {n - 1} - \theta_ {\star} \right\| ^ {2} \\ + 1 6 \sigma^ {3} \gamma_ {n} ^ {3} \| \theta_ {n - 1} - \theta_ {\star} \| + 8 \sigma^ {4} \gamma_ {n} ^ {4} \tag {B.13} \\ \leq \left(1 - 4 \lambda \gamma_ {n} + 1 4 \beta_ {0} ^ {2} \gamma_ {n} ^ {2} + 1 6 \beta_ {0} ^ {3} \gamma_ {n} ^ {3} + 8 \beta_ {0} ^ {4} \gamma_ {n} ^ {4}\right) \| \theta_ {n - 1} - \theta_ {\star} \| ^ {4} \\ + 4 \left(\beta_ {0} ^ {2} + \sigma^ {2}\right) \gamma_ {n} ^ {2} \left\| \theta_ {n - 1} - \theta_ {\star} \right\| ^ {3} \\ + 2 \left(5 \sigma^ {2} \gamma_ {n} ^ {2} + 4 \gamma_ {n} ^ {4}\right) \left\| \theta_ {n - 1} - \theta_ {\star} \right\| ^ {2} + 1 6 \sigma^ {4} \gamma_ {n} ^ {4}, \\ \end{array} +$$ + +where the last inequality follows from $16\sigma^3\gamma_n^3\|\theta_{n-1} - \theta_\star\| \leq 8\sigma^2\gamma_n^2\|\theta_{n-1} - \theta_\star\|^2 + 8\sigma^4\gamma_n^4$ . + +We now bound the third moment. Multiplying inequality (B.7) with + +$$ +\begin{array}{l} \left\| \theta_ {n} - \theta_ {\star} \right\| \leq \left\| \theta_ {n - 1} - \theta_ {\star} \right\| + \gamma_ {n} \| \nabla \ell \left(Z _ {n}, \theta_ {n}\right) \| \\ \leq \left\| \theta_ {n - 1} - \theta_ {\star} \right\| + \gamma_ {n} V _ {n} ^ {1 / 2} \\ \end{array} +$$ + +yields + +$$ +\begin{array}{l} \left\| \theta_ {n} - \theta_ {\star} \right\| ^ {3} \leq \left\| \theta_ {n - 1} - \theta_ {\star} \right\| ^ {3} - 2 \gamma_ {n} \left\| \theta_ {n} - \theta_ {\star} \right\| W _ {n} + \gamma_ {n} ^ {2} \left\| \theta_ {n} - \theta_ {\star} \right\| V _ {n} \\ + \gamma_ {n} \| \theta_ {n} - \theta_ {\star} \| ^ {2} V _ {n} ^ {1 / 2} - 2 \gamma_ {n} W _ {n} V _ {n} ^ {1 / 2} + \gamma_ {n} ^ {3} V _ {n} ^ {3 / 2}. \\ \end{array} +$$ + +In addition to inequalities (B.9) and (B.12), we have + +$$ +\begin{array}{l} \mathbf {E} \left[ V _ {n} ^ {3 / 2} | \mathcal {F} _ {n - 1} \right] = \mathbf {E} \left[ \| \nabla \ell (Z _ {n}, \theta_ {n - 1}) \| ^ {3} | \mathcal {F} _ {n - 1} \right] \leq 4 \beta_ {0} ^ {3} \| \theta_ {n} - \theta_ {\star} \| ^ {3} + 4 \sigma^ {3} \\ \mathbf {E} \left[ V _ {n} ^ {1 / 2} | \mathcal {F} _ {n - 1} \right] = \mathbf {E} \left[ \| \nabla \ell (Z _ {n}, \theta_ {n - 1}) \| | \mathcal {F} _ {n - 1} \right] \leq \beta_ {0} \left[ \| \nabla \ell (Z _ {n}, \theta_ {n - 1}) \| + \mathbf {E} \| \nabla \ell (Z _ {n}, \theta_ {\star}) \| \right. \\ \leq \beta_ {0} [ \| \nabla \ell (Z _ {n}, \theta_ {n - 1}) \| + \sigma \\ \end{array} +$$ + +$$ +\begin{array}{l} \mathbf {E} \left[ - W _ {n} V _ {n} ^ {1 / 2} | \mathcal {F} _ {n - 1} \right] = - \mathbf {E} \left[ \left(\theta_ {n - 1} - \theta_ {\star}\right) ^ {T} \nabla \ell \left(Z _ {n}, \theta_ {n}\right) \| \nabla \ell \left(Z _ {n}, \theta_ {n - 1}\right) \| | \mathcal {F} _ {n - 1} \right] \\ \leq \left\| \theta_ {n - 1} - \theta_ {\star} \right\| \mathbf {E} \left[ \| \nabla \ell \left(Z _ {n}, \theta_ {n}\right) \| \| \nabla \ell \left(Z _ {n}, \theta_ {n - 1}\right) \| \mid \mathcal {F} _ {n - 1} \right] \\ \leq \left\| \theta_ {n - 1} - \theta_ {\star} \right\| \mathbf {E} \left[ \| \nabla \ell \left(Z _ {n}, \theta_ {n - 1}\right) \| ^ {2} \mid \mathcal {F} _ {n - 1} \right] \\ \stackrel {(B. 9)} {\leq} 2 \beta_ {0} ^ {2} \left\| \theta_ {n - 1} - \theta_ {\star} \right\| ^ {3} + 2 \sigma^ {2} \left\| \theta_ {n - 1} - \theta_ {\star} \right\|. \\ \end{array} +$$ + +Therefore + +$$ +\begin{array}{l} \mathbf {E} \left[ \| \theta_ {n} - \theta_ {\star} \| ^ {3} \mid \mathcal {F} _ {n - 1} \right] \leq \left[ 1 + (\beta_ {0} - 2 \lambda) \gamma_ {n} + 8 \beta_ {0} ^ {2} \gamma_ {n} ^ {2} + 4 \beta_ {0} ^ {3} \gamma_ {n} ^ {3} \right] \| \theta_ {n} - \theta_ {\star} \| ^ {3} \\ + \left[ \sigma \gamma_ {n} + 2 \left(\beta_ {0} ^ {2} + \sigma^ {2}\right) \gamma_ {n} ^ {2} \right] \left\| \theta_ {n} - \theta_ {\star} \right\| ^ {2} + 6 \sigma^ {2} \gamma_ {n} ^ {2} \left\| \theta_ {n} - \theta_ {\star} \right\| + 4 \sigma^ {3} \gamma_ {n} ^ {3} \\ \leq \left[ 1 + \left(\beta_ {0} - 2 \lambda\right) \gamma_ {n} + 8 \beta_ {0} ^ {2} \gamma_ {n} ^ {2} + 4 \beta_ {0} ^ {3} \gamma_ {n} ^ {3} \right] \left\| \theta_ {n} - \theta_ {\star} \right\| ^ {3} \\ + \left[ 4 \sigma \gamma_ {n} + 2 \left(\beta_ {0} ^ {2} + \sigma^ {2}\right) \gamma_ {n} ^ {2} \right] \| \theta_ {n} - \theta_ {\star} \| ^ {2} + 7 \sigma^ {3} \gamma_ {n} ^ {3} \tag {B.14} \\ \end{array} +$$ + +since $6\sigma^2\gamma_n^2\| \theta_n - \theta_\star \| \leq 3\sigma \gamma_n\| \theta_n - \theta_\star \| ^2 +3\sigma^3\gamma_n^3$ + +Now, let + +$$ +U _ {n} = \left\| \theta_ {n} - \theta_ {\star} \right\| ^ {4} + c \beta_ {0} \gamma_ {n + 1} \left\| \theta_ {n} - \theta_ {\star} \right\| ^ {3}, \quad c = \frac {8 (\beta_ {0} ^ {2} + \sigma^ {2})}{\beta_ {0} \lambda}. +$$ + +Then, from inequalities (B.13) and (B.14) + +$$ +\begin{array}{l} \mathbf {E} \left[ U _ {n} \mid \mathcal {F} _ {n - 1} \right] \leq \left\| \theta_ {n - 1} - \theta_ {\star} \right\| ^ {4} \left[ 1 - 4 \lambda \gamma_ {n} + 1 4 \beta_ {0} ^ {2} \gamma_ {n} ^ {2} + 1 6 \beta_ {0} ^ {3} \gamma_ {n} ^ {3} + 8 \beta_ {0} ^ {4} \gamma_ {n} ^ {4} \right] \\ + \left\| \theta_ {n - 1} - \theta_ {\star} \right\| ^ {3} \left[ 4 \left(\beta_ {0} ^ {2} + \sigma^ {2}\right) \gamma_ {n} ^ {2} + c \beta_ {0} \gamma_ {n + 1} (1 + (\beta_ {0} - 2 \lambda) \gamma_ {n} + 8 \beta_ {0} ^ {2} \gamma_ {n} ^ {2} + 4 \beta_ {0} ^ {3} \gamma_ {n} ^ {3}) \right] \\ + \left\| \theta_ {n - 1} - \theta_ {\star} \right\| ^ {2} \left[ 1 0 \sigma^ {2} \gamma_ {n} ^ {2} + 8 \gamma_ {n} ^ {4} + c \beta_ {0} \gamma_ {n + 1} \left(4 \sigma \gamma_ {n} + 2 \left(\beta_ {0} ^ {2} + \sigma^ {2}\right) \gamma_ {n} ^ {2}\right) \right] \\ + 1 6 \sigma^ {4} \gamma_ {n} ^ {4} + 7 c \beta_ {0} \sigma^ {3} \gamma_ {n + 1} \gamma_ {n} ^ {3} \\ \leq \left\| \theta_ {n - 1} - \theta_ {\star} \right\| ^ {4} \left[ 1 - \frac {1}{2} \lambda \gamma_ {n} + 1 4 \beta_ {0} ^ {2} \gamma_ {n} ^ {2} + 1 6 \beta_ {0} ^ {3} \gamma_ {n} ^ {3} + 8 \beta_ {0} ^ {4} \gamma_ {n} ^ {4} \right] \\ + \left\| \theta_ {n - 1} - \theta_ {\star} \right\| ^ {3} \left[ 4 \left(\beta_ {0} ^ {2} + \sigma^ {2}\right) \gamma_ {n} ^ {2} + c \beta_ {0} \gamma_ {n} \left(1 - 2 \lambda \gamma_ {n} + 8 \beta_ {0} ^ {2} \gamma_ {n} ^ {2} + 4 \beta_ {0} ^ {3} \gamma_ {n} ^ {3}\right) \right] \\ + c \beta_ {0} ^ {2} \gamma_ {n} ^ {2} \| \theta_ {n} - \theta_ {\star} \| ^ {3} \\ + \left\| \theta_ {n - 1} - \theta_ {\star} \right\| ^ {2} \left[ 1 0 \sigma^ {2} \gamma_ {n} ^ {2} + 8 \gamma_ {n} ^ {4} + c \beta_ {0} \gamma_ {n} \left(4 \sigma \gamma_ {n} + 2 \left(\beta_ {0} ^ {2} + \sigma^ {2}\right) \gamma_ {n} ^ {2}\right) \right] \\ + 1 6 \sigma^ {4} \gamma_ {n} ^ {4} + 7 c \beta_ {0} \sigma^ {3} \gamma_ {n} ^ {4} \\ \leq \left\| \theta_ {n - 1} - \theta_ {\star} \right\| ^ {4} \left[ 1 - \frac {1}{2} \lambda \gamma_ {n} + \frac {3 c}{4} \beta_ {0} ^ {5 / 3} \gamma_ {n} ^ {5 / 3} + 1 4 \beta_ {0} ^ {2} \gamma_ {n} ^ {2} + 1 6 \beta_ {0} ^ {3} \gamma_ {n} ^ {3} + 8 \beta_ {0} ^ {4} \gamma_ {n} ^ {4} \right] \\ + \left\| \theta_ {n - 1} - \theta_ {\star} \right\| ^ {3} \left[ 4 \left(\beta_ {0} ^ {2} + \sigma^ {2}\right) \gamma_ {n} ^ {2} + c \beta_ {0} \gamma_ {n} \left(1 - 2 \lambda \gamma_ {n} + 8 \beta_ {0} ^ {2} \gamma_ {n} ^ {2} + 4 \beta_ {0} ^ {3} \gamma_ {n} ^ {3}\right) \right] \\ + \left\| \theta_ {n - 1} - \theta_ {\star} \right\| ^ {2} \left[ 1 0 \sigma^ {2} \gamma_ {n} ^ {2} + 8 \gamma_ {n} ^ {4} + c \beta_ {0} \gamma_ {n} \left(4 \sigma \gamma_ {n} + 2 \left(\beta_ {0} ^ {2} + \sigma^ {2}\right) \gamma_ {n} ^ {2}\right) \right] \\ \end{array} +$$ + +$$ +\begin{array}{l} + \frac {c}{4} \beta_ {0} ^ {3} \gamma_ {n} ^ {3} + 1 6 \sigma^ {4} \gamma_ {n} ^ {4} + 7 c \beta_ {0} \sigma^ {3} \gamma_ {n} ^ {4} \\ \leq \left(\left\| \theta_ {n - 1} - \theta_ {\star} \right\| ^ {4} + c \beta_ {0} \gamma_ {n} \left\| \theta_ {n} - \theta_ {\star} \right\| ^ {3}\right) \\ \times \left[ 1 - \frac {1}{2} \lambda \gamma_ {n} + \frac {3 c}{4} \beta_ {0} ^ {5 / 3} \gamma_ {n} ^ {5 / 3} + 1 4 \beta_ {0} ^ {2} \gamma_ {n} ^ {2} + 1 6 \beta_ {0} ^ {3} \gamma_ {n} ^ {3} + 8 \beta_ {0} ^ {4} \gamma_ {n} ^ {4} \right] \\ + \left\| \theta_ {n - 1} - \theta_ {\star} \right\| ^ {3} \left[ 4 \left(\beta_ {0} ^ {2} + \sigma^ {2}\right) \gamma_ {n} ^ {2} + c \beta_ {0} \gamma_ {n} \left(1 - \lambda \gamma_ {n} + 8 \beta_ {0} ^ {2} \gamma_ {n} ^ {2} + 4 \beta_ {0} ^ {3} \gamma_ {n} ^ {3}\right) \right. \\ \left. - c \beta_ {0} \gamma_ {n} \left(1 - \frac {1}{2} \lambda \gamma_ {n} + \frac {3 c}{4} \beta_ {0} ^ {5 / 3} \gamma_ {n} ^ {5 / 3} + 1 4 \beta_ {0} ^ {2} \gamma_ {n} ^ {2} + 1 6 \beta_ {0} ^ {3} \gamma_ {n} ^ {3} + 8 \beta_ {0} ^ {4} \gamma_ {n} ^ {4}\right) \right] \\ + \left\| \theta_ {n - 1} - \theta_ {\star} \right\| ^ {2} \left[ 1 0 \sigma^ {2} \gamma_ {n} ^ {2} + 8 \gamma_ {n} ^ {4} + c \beta_ {0} \gamma_ {n} (4 \sigma \gamma_ {n} + 2 (\beta_ {0} ^ {2} + \sigma^ {2}) \gamma_ {n} ^ {2}) \right] \\ + \frac {c}{4} \beta_ {0} ^ {3} \gamma_ {n} ^ {3} + 1 6 \sigma^ {4} \gamma_ {n} ^ {4} + 7 c \beta_ {0} \sigma^ {3} \gamma_ {n} ^ {4} \\ \leq \left(\left\| \theta_ {n - 1} - \theta_ {\star} \right\| ^ {4} + c \beta_ {0} \gamma_ {n} \left\| \theta_ {n} - \theta_ {\star} \right\| ^ {3}\right) \\ \times \left[ 1 - \frac {1}{2} \lambda \gamma_ {n} + \frac {3 c}{4} \beta_ {0} ^ {5 / 3} \gamma_ {n} ^ {5 / 3} + 1 4 \beta_ {0} ^ {2} \gamma_ {n} ^ {2} + 1 6 \beta_ {0} ^ {3} \gamma_ {n} ^ {3} + 8 \beta_ {0} ^ {4} \gamma_ {n} ^ {4} \right] \\ + \left\| \theta_ {n - 1} - \theta_ {\star} \right\| ^ {3} \left[ \left(4 \left(\beta_ {0} ^ {2} + \sigma^ {2}\right) - \frac {1}{2} c \beta_ {0} \lambda\right) \gamma_ {n} ^ {2} \right] \\ + \left\| \theta_ {n - 1} - \theta_ {\star} \right\| ^ {2} \left[ 1 0 \sigma^ {2} \gamma_ {n} ^ {2} + 8 \gamma_ {n} ^ {4} + c \beta_ {0} \gamma_ {n} (4 \sigma \gamma_ {n} + 2 (\beta_ {0} ^ {2} + \sigma^ {2}) \gamma_ {n} ^ {2}) \right] \\ + \frac {c}{4} \beta_ {0} ^ {3} \gamma_ {n} ^ {3} + 1 6 \sigma^ {4} \gamma_ {n} ^ {4} + 7 c \beta_ {0} \sigma^ {3} \gamma_ {n} ^ {4} \\ = U _ {n - 1} \left[ 1 - \frac {1}{2} \lambda \gamma_ {n} + \frac {6 (\beta_ {0} ^ {2} + \sigma^ {2})}{\lambda} \beta_ {0} ^ {2 / 3} \gamma_ {n} ^ {5 / 3} + 1 4 \beta_ {0} ^ {2} \gamma_ {n} ^ {2} + 1 6 \beta_ {0} ^ {3} \gamma_ {n} ^ {3} + 8 \beta_ {0} ^ {4} \gamma_ {n} ^ {4} \right] \\ + \left\| \theta_ {n - 1} - \theta_ {\star} \right\| ^ {2} \left[ (1 0 \sigma^ {2} + \frac {3 2 \sigma (\beta_ {0} ^ {2} + \sigma^ {2})}{\lambda}) \gamma_ {n} ^ {2} + \frac {1 6 (\beta_ {0} ^ {2} + \sigma^ {2}) ^ {2}}{\lambda} \gamma_ {n} ^ {3} + 8 \gamma_ {n} ^ {4} \right] \\ + \frac {2 \left(\beta_ {0} ^ {2} + \sigma^ {2}\right)}{\lambda} \beta_ {0} ^ {2} \gamma_ {n} ^ {3} + \left(1 6 \sigma^ {4} + \frac {5 6 \left(\beta_ {0} ^ {2} + \sigma^ {2}\right)}{\lambda} \sigma^ {3}\right) \gamma_ {n} ^ {4}, \\ \end{array} +$$ + +where the third inequality is due to Young's inequality + +$$ +c \beta_ {0} ^ {2} \gamma_ {n} ^ {2} \left\| \theta_ {n - 1} - \theta_ {\star} \right\| ^ {3} \leq \frac {3 c}{4} \beta_ {0} ^ {5 / 3} \gamma_ {n} ^ {5 / 3} \left\| \theta_ {n - 1} - \theta_ {\star} \right\| ^ {4} + \frac {c}{4} \beta_ {0} ^ {3} \gamma_ {n} ^ {3}. +$$ + +Therefore, + +$$ +\begin{array}{l} \mathbf {E} \left[ U _ {n} \right] \leq \left[ 1 - \frac {1}{2} \lambda \gamma_ {n} + \frac {6 \left(\beta_ {0} ^ {2} + \sigma^ {2}\right)}{\lambda} \beta_ {0} ^ {2 / 3} \gamma_ {n} ^ {5 / 3} + 1 4 \beta_ {0} ^ {2} \gamma_ {n} ^ {2} + 1 6 \beta_ {0} ^ {3} \gamma_ {n} ^ {3} + 8 \beta_ {0} ^ {4} \gamma_ {n} ^ {4} \right] \mathbf {E} \left[ U _ {n - 1} \right] \\ + \left[ \left(1 0 \sigma^ {2} + \frac {3 2 \sigma \left(\beta_ {0} ^ {2} + \sigma^ {2}\right)}{\lambda}\right) \gamma_ {n} ^ {2} + \frac {1 6 \left(\beta_ {0} ^ {2} + \sigma^ {2}\right) ^ {2}}{\lambda} \gamma_ {n} ^ {3} + 8 \gamma_ {n} ^ {4} \right] \mathbf {E} \| \theta_ {n - 1} - \theta_ {\star} \| ^ {2} \\ + \frac {2 \left(\beta_ {0} ^ {2} + \sigma^ {2}\right)}{\lambda} \beta_ {0} ^ {2} \gamma_ {n} ^ {3} + \left(1 6 \sigma^ {4} + \frac {5 6 \left(\beta_ {0} ^ {2} + \sigma^ {2}\right)}{\lambda} \sigma^ {3}\right) \gamma_ {n} ^ {4} \\ \end{array} +$$ + +Since from Theorem 4.1 + +$$ +\mathbf {E} \left\| \theta_ {n} - \theta_ {\star} \right\| ^ {2} \leq \left(K _ {1} + \left\| \theta_ {0} - \theta_ {\star} \right\| ^ {2} + D _ {n _ {0}}\right) n ^ {- \gamma} = K _ {2} \gamma_ {n}, \quad K _ {2} = \left(K _ {1} + \left\| \theta_ {0} - \theta_ {\star} \right\| ^ {2} + D _ {n _ {0}}\right) / \gamma_ {1} +$$ + +and $\gamma_{n - 1}\leq 2\gamma_{n}$ (Proposition A.2), + +$$ +\mathbf {E} \left[ U _ {n} \right] \leq \left(1 - \frac {1}{2} \lambda \gamma_ {n} + C _ {0} \gamma_ {n} ^ {5 / 3}\right) \mathbf {E} \left[ U _ {n - 1} \right] + C _ {1} \gamma_ {n} ^ {3}, +$$ + +where + +$$ +\begin{array}{l} C _ {0} = \frac {6 \left(\beta_ {0} ^ {2} + \sigma^ {2}\right)}{\lambda} \beta_ {0} ^ {2 / 3} + 1 4 \beta_ {0} ^ {2} \gamma_ {1} ^ {1 / 3} + 1 6 \beta_ {0} ^ {3} \gamma_ {1} ^ {4 / 3} + 8 \beta_ {0} ^ {4} \gamma_ {1} ^ {7 / 3} \\ + 2 K _ {2} \left[ \left(1 0 \sigma^ {2} + \frac {3 2 \sigma \left(\beta_ {0} ^ {2} + \sigma^ {2}\right)}{\lambda}\right) \gamma_ {1} ^ {1 / 3} + \frac {1 6 \left(\beta_ {0} ^ {2} + \sigma^ {2}\right) ^ {2}}{\lambda} \gamma_ {1} ^ {4 / 3} + 8 \gamma_ {1} ^ {7 / 3} \right] \\ \end{array} +$$ + +$$ +C _ {1} = \frac {2 \left(\beta_ {0} ^ {2} + \sigma^ {2}\right)}{\lambda} \beta_ {0} ^ {2} + \left(1 6 \sigma^ {4} + \frac {5 6 \left(\beta_ {0} ^ {2} + \sigma^ {2}\right)}{\lambda} \sigma^ {3}\right) \gamma_ {1}. +$$ + +It follows from Corollary A.1 that + +$$ +\mathbf {E} \left[ U _ {n} \right] \leq \tilde {K} _ {1} n ^ {- 2 \gamma} + \exp \left(\nu (1 + \frac {\lambda \gamma_ {1}}{2}) \phi_ {\frac {5}{3} \gamma} (n) - \frac {1}{2} \log (1 + \frac {\lambda \gamma_ {1}}{2}) \phi_ {\gamma} (n)\right) (U _ {0} + \tilde {D} _ {\tilde {n} _ {0}}), +$$ + +where $\nu = C_0\gamma_1^{5 / 3}$ and the $\tilde{n}_0$ is as given in equation (A.21). The other constants are as given in equation (A.22). Noting $\mathbf{E}\left\| \theta_{n} - \theta_{\star}\right\|^{4}\leq \mathbf{E}\left[U_{n}\right]$ completes the proof. \ No newline at end of file diff --git a/statisticalinferencewithimplicitsgdproximalrobbinsmonrovspolyakruppert/images.zip b/statisticalinferencewithimplicitsgdproximalrobbinsmonrovspolyakruppert/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..4fba32ddf230cd5159cae07c044f9d259cc0df4a --- /dev/null +++ b/statisticalinferencewithimplicitsgdproximalrobbinsmonrovspolyakruppert/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:36eb5a146335de43cc7d5185f0a63dba3cb39e6f28abab10cc626d108580ade7 +size 3134801 diff --git a/statisticalinferencewithimplicitsgdproximalrobbinsmonrovspolyakruppert/layout.json b/statisticalinferencewithimplicitsgdproximalrobbinsmonrovspolyakruppert/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..d9332708993d61ced776870424e11af31c0c6476 --- /dev/null +++ b/statisticalinferencewithimplicitsgdproximalrobbinsmonrovspolyakruppert/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:950a3241a03097b324a40fa2a31bdfa5cbe559e647d410de3de320633a1696ea +size 1628918 diff --git a/steerable3dsphericalneurons/38f30070-519d-413b-9119-1655695d527c_content_list.json b/steerable3dsphericalneurons/38f30070-519d-413b-9119-1655695d527c_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..e25fdff3b47e35480b6f32b3e07d286e13780a54 --- /dev/null +++ b/steerable3dsphericalneurons/38f30070-519d-413b-9119-1655695d527c_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5abd0c284af49799b541cff7974a91213018c43f3767c20558ec5fa45f0e590c +size 85781 diff --git a/steerable3dsphericalneurons/38f30070-519d-413b-9119-1655695d527c_model.json b/steerable3dsphericalneurons/38f30070-519d-413b-9119-1655695d527c_model.json new file mode 100644 index 0000000000000000000000000000000000000000..924b0655053c1aca9ae69b5815a5343ac323a3f3 --- /dev/null +++ b/steerable3dsphericalneurons/38f30070-519d-413b-9119-1655695d527c_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1deeb0de82ee52334bd7a8bafb175c44168d0792a7a6c0485f4737839cc7869d +size 101290 diff --git a/steerable3dsphericalneurons/38f30070-519d-413b-9119-1655695d527c_origin.pdf b/steerable3dsphericalneurons/38f30070-519d-413b-9119-1655695d527c_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..58c1b9a2d7b33f9130d19a1e647def7493da169c --- /dev/null +++ b/steerable3dsphericalneurons/38f30070-519d-413b-9119-1655695d527c_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9207a495c6f5dc367cb8a2068e11ac4db52863a9650c07aae142af96b084503e +size 502962 diff --git a/steerable3dsphericalneurons/full.md b/steerable3dsphericalneurons/full.md new file mode 100644 index 0000000000000000000000000000000000000000..eddf22101e94c158a9f2d3540d238c461f6997de --- /dev/null +++ b/steerable3dsphericalneurons/full.md @@ -0,0 +1,398 @@ +# Pavlo Melnyk1 Michael Felsberg1 Mårten Wadenback1 + +# Abstract + +Emerging from low-level vision theory, steerable filters found their counterpart in prior work on steerable convolutional neural networks equivariant to rigid transformations. In our work, we propose a steerable feed-forward learning-based approach that consists of neurons with spherical decision surfaces and operates on point clouds. Such spherical neurons are obtained by conformal embedding of Euclidean space and have recently been revisited in the context of learning representations of point sets. Focusing on 3D geometry, we exploit the isometry property of spherical neurons and derive a 3D steerability constraint. After training spherical neurons to classify point clouds in a canonical orientation, we use a tetrahedron basis to quadruplicate the neurons and construct rotation-equivariant spherical filter banks. We then apply the derived constraint to interpolate the filter bank outputs and, thus, obtain a rotation-invariant network. Finally, we use a synthetic point set and real-world 3D skeleton data to verify our theoretical findings. The code is available at https://github.com/pavlo-melnyk/steerable-3d-neurons. + +# 1. Introduction + +We present a feed-forward model consisting of steerable 3D neurons for point cloud classification, an important and challenging problem with many applications such as autonomous driving, human-robot interaction, and mixed-reality installations. Constructing rotation-equivariant (steerable) models allows us to use the feature of a given point cloud to synthesize features of the same point cloud with different orientations. Further, rotation-equivariant networks + +1Computer Vision Laboratory, Department of Electrical Engineering, Linköping University, SE-581 83 Linköping, Sweden. Correspondence to: Pavlo Melnyk , Michael Felsberg . + +Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s). + +![](images/4f054b47625b81b4abfca887f068cd2f97b54706c26a0eac538bbf13be08de0b.jpg) +Figure 1. Our approach overview: First, we train a classifier (Ancestor) consisting of the spherical neurons (necessarily in the first layer) to classify 3D point clouds in a canonical orientation. We then fix all the learned parameters and construct rotation-equivariant spherical filter banks $B(S)$ (8) from the first layer parameters. Next, we compute the interpolation coefficients $v(\mathbf{R})$ (15) to fulfill the steerability constraint (12). The result is a Steerable classifier, where $\mathbf{y}$ is equivariant and $\mathbf{h}$ is invariant to rotations of the model input. + +enable producing rotation-invariant predictions and, therefore, lowered data augmentation requirements for learning. + +In this paper, we achieve the steerability using a conformal embedding to obtain higher-order decision surfaces. Following the motivation in the recent work of Melnyk et al. (2021), we focus on 3D geometry and spherical decision surfaces, arguing for their natural suitability for problems in Euclidean space. We show how a spherical neuron, i.e., the hypersphere neuron (Baner et al., 2003b) or its generalization for 3D input point sets — the geometric neuron (Melnyk et al., 2021) — can be turned into a steerable neuron. Making spherical neurons steerable adds to the practical value of the prior work by Melnyk et al. (2021). + +We prove that the aforementioned spherical neurons in any dimension require only up to first-degree spherical harmonics to accommodate the effect of rotation. This allows us to derive a 3D steerability constraint for such neurons and to describe a recipe for creating a steerable model from a pretrained classifier (see Figure 1). Using the synthetic Tetris dataset (Thomas et al., 2018) and the skeleton data from the UTKinet-Action3D dataset (Xia et al., 2012), we verify the derived constraint and check its stability with respect to + +perturbations in the input. + +Importantly, we focus on theoretical aspects of our steerable method to produce rotation-invariant predictions, and show that it is attainable by using both synthetic and real 3D data (Section 5.3). What remains to do is to devise a practical way to achieve it. + +The core of our contributions are the novel theoretical results on steerability and equivariance and can be summarized as follows: + +(a) We prove that the activation of spherical neurons (Banarer et al., 2003b; Melnyk et al., 2021) on rotated input only varies by up to first-degree spherical harmonics in the rotation angle (Section 4.1). + +(b) Based on a minimal set of four spherical neurons that are rotated to the corresponding vertices of a regular tetrahedron, we construct a rotation-equivariant spherical filter bank (Section 4.2) and derive the main result of our paper (Section 4.3) — a 3D steerability constraint for spherical neurons (12) and (16). + +# 2. Related work + +# 2.1. Steerability and equivariance + +Steerability is a powerful concept from early vision and image processing (Freeman et al., 1991; Knutsson et al., 1992; Simoncelli et al., 1992; Perona, 1995; Simoncelli & Freeman, 1995; Teo & Hel-Or, 1998) that resonates in the era of deep learning. The utility of steerable filters and the main theorems for their construction are presented in the seminal work of Freeman et al. (1991). + +Geometric equivariance in the context of computer vision has been an object of extensive research over the last decades (Van Gool et al., 1995). Equivariance is a necessary property for steerability since steerability requires changing the function output depending on the actions of a certain group. Thus, the output needs to contain a representation of the group that acts on the input. Therefore, the operator must commute with the group (note that the representation might change from input to output). For this reason, Lie theory can be used to study steerable filters for equivariance and invariance (Reisert, 2008). + +Nowadays, equivariance-related research extends into deep learning, e.g., the SE(3)-equivariant models of Fuchs et al. (2020), Thomas et al. (2018), and Zhao et al. (2020), and the SO(3)-equivariant network of Anderson et al. (2019), as well as Marcos et al. (2017) and Kondor et al. (2018). Also steerable filter concepts are increasingly used in current works. For example, the work of Cohen & Welling (2016) considered image data and proposed a CNN architecture to produce equivariant representations with steerable features, + +which involves fewer parameters than traditional CNNs. They considered the dihedral group (discrete rotation, translation, and reflection), and the steerable representations in their work are proposed as formation of elementary feature types. One limitation of their approach is that rotations are restricted to four orientations, i.e., by multiples $\pi /2$ . More recently, Weiler et al. (2018b) utilized group convolutions and introduced steerable filter convolutional neural networks (SFCNNs) operating on images to jointly attain equivariance under translations and discrete rotations. In their work, the filter banks are learned rather than fixed. Further, the work of Weiler & Cesa (2019) proposed a unified framework for E(2)-equivariant steerable CNNs and presented their general theory. + +The steerable CNNs for 3D data proposed by Weiler et al. (2018a) are closely related to our work. The authors employed a combination of scalar, vector and tensor fields as features transformed by SO(3) representations and presented a model that is equivariant to SE(3) transformations. They also considered different types of nonlinearities suitable for nonscalar components of the feature space. The novel SE(3)-equivariant approach by Fuchs et al. (2020) introduced a self-attention mechanism that is invariant to global rotations and translations of its input and solves the limitation of angularly constrained filters in other equivariant methods, e.g., Thomas et al. (2018). Noteworthy, the work of Jing et al. (2020) proposed the geometric vector perceptron (GVP) consisting of two linear transformations for the input scalar and vector features, followed by nonlinearities. The GVP scalar and vector outputs are invariant and equivariant, respectively, with respect to an arbitrary composition of rotations and reflections in the 3D Euclidean space. + +# 2.2. Conformal modeling and the hypersphere neuron + +The utility of conformal embedding for Euclidean geometry and the close connection to Minkowski spaces are thoroughly discussed by Li et al. (2001a). An important result is that one can construct hyperspherical decision surfaces using representations in the conformal space (Li et al., 2001b), as done in the work of Perwass et al. (2003). The hypersphere neuron proposed by Banarer et al. (2003b) is such a spherical classifier. Remarkably, since a hypersphere can be seen as a generalization of a hyperplane, the standard neuron can be considered as a special case of the hypersphere neuron. + +Stacking multiple hypersphere neurons in a feed-forward network results in a multilayer hypersphere perceptron (MLHP), which was shown by Banarer et al. (2003a) to outperform the standard MLP for some classification tasks. However, its application to point sets was not discussed. This motivated the work of Melnyk et al. (2021) on the ge + +ometric neuron, where the learned parameters were shown to represent a combination of spherical decision surfaces. Moreover, the geometric (and hypersphere) neuron activations were proved to be isometric in the 3D Euclidean space. In our work, we use the latter observation as the necessary condition for deriving the steerability constraint. + +# 2.3. Comparison to other methods + +Steerability requires filters that either are (combinations of) spherical harmonics (see, e.g., Fuchs et al. (2020)) or are constructed based on learned neurons and that behave as such (our work). + +The key point distinguishing our approach from other equivariant networks is that we do not constrain the space of learnable parameters (as opposed to, e.g., Thomas et al. (2018), Weiler et al. (2018a), and Fuchs et al. (2020)), but construct our steerable model from a freely trained base network, as we discuss in detail in Section 4. That is, the related work uses spherical harmonics as atoms, i.e., a hand-designed basis, and learns only the linear coefficients under constraints. In contrast, the only thing we inherit from the hand design is the constraint of first-degree harmonics (see Theorem 4.1) – all other degrees of freedom are learnable. + +In addition, even though we only consider scalar fields in the present work, the theoretical results of Section 4 can be applied to broader classes of feature fields. + +# 3. Background + +# 3.1. Steerability + +As per Freeman et al. (1991), a 2D function $f(x,y)$ is said to steer if it can be written as a linear combination of rotated versions of itself, i.e., when it satisfies the constraint + +$$ +f ^ {\theta} (x, y) = \sum_ {j = 1} ^ {M} v _ {j} (\theta) f ^ {\theta_ {j}} (x, y), \tag {1} +$$ + +where $v_{j}(\theta)$ are the interpolation functions, $\theta_{j}$ are the basis function orientations, and $M$ is the number of basis function terms required to steer the function. An alternative formulation can be found in the work of Knutsson et al. (1992). In 3D, the steering equation becomes + +$$ +f ^ {\boldsymbol {R}} (x, y, z) = \sum_ {j = 1} ^ {M} v _ {j} (\boldsymbol {R}) f ^ {\boldsymbol {R} _ {j}} (x, y, z), \tag {2} +$$ + +where $f^{\mathbf{R}}(x,y,z)$ is $f(x,y,z)$ rotated by $\mathbf{R} \in \mathrm{SO}(3)$ , and each $R_{j} \in \mathrm{SO}(3)$ orients the corresponding $j$ th basis function. + +Theorems 1, 2 and 4 in Freeman et al. (1991) describe the conditions under which the steerability constraints (1) and + +![](images/8c6a668e5176203185ac4a5a1d81493c8f0d0f08f4b3f701c5acc1602d1cc1ec.jpg) +Figure 2. The geometric neuron $(\ell_{k} = -\frac{1}{2}\| \mathbf{x}_{k}\|^{2})$ + +(2) hold, and how to determine the minimum number of basis functions for the 2D and 3D case, respectively. + +# 3.2. Conformal embedding + +We refer the reader to Section 3 in the work of Melnyk et al. (2021) for more details, and only briefly introduce important notation in this section. The conformal space for the Euclidean $\mathbb{R}^n$ counterpart can be formed as $\mathbb{M}\mathbb{E}^n\equiv \mathbb{R}^{n + 1,1} = \mathbb{R}^n\oplus \mathbb{R}^{1,1}$ , where $\mathbb{R}^{1,1}$ is the Minkowski plane (Li et al., 2001a) with orthonormal basis defined as $\{e_{+},e_{-}\}$ and null basis $\{e_0,e_\infty \}$ representing the origin $e_0 = \frac{1}{2} (e_{-} - e_{+})$ and point at infinity $e_{\infty} = e_{-} + e_{+}$ . Thus, a Euclidean vector $\mathbf{x}\in \mathbb{R}^n$ can be embedded in the conformal space $\mathbb{M}\mathbb{E}^n$ as + +$$ +X = \mathcal {C} (\mathbf {x}) = \mathbf {x} + \frac {1}{2} \| \mathbf {x} \| ^ {2} e _ {\infty} + e _ {0}, \tag {3} +$$ + +where $X \in \mathbb{M}\mathbb{E}^n$ is called normalized. The conformal embedding (3) represents the stereographic projection of $\mathbf{x}$ onto a projection sphere in $\mathbb{M}\mathbb{E}^n$ and is homogeneous, i.e., all embedding vectors in the equivalence class $[X] = \{Z \in \mathbb{R}^{n+1,1} : Z = \gamma X, \gamma \in \mathbb{R} \setminus \{0\}\}$ are taken to represent the same vector $\mathbf{x}$ . Importantly, given the conformal embedding $X$ and some $Y = \mathbf{y} + \frac{1}{2} \| \mathbf{y} \|^2 e_{\infty} + e_0$ , their scalar product in the conformal space corresponds to their Euclidean distance, $X \cdot Y = -\frac{1}{2} \| \mathbf{x} - \mathbf{y} \|^2$ . This interpretation of the scalar product in the conformal space is the main motivation in constructing spherical neurons. + +# 3.3. Spherical neurons + +By spherical neurons, we collectively refer to hypersphere (Banarer et al., 2003a) and geometric (Melnyk et al., 2021) neurons, which have spherical decision surfaces. + +As discussed by Banarer et al. (2003a), by embedding both a data vector $\mathbf{x} \in \mathbb{R}^n$ and a hypersphere $S \in \mathbb{M}\mathbb{E}^n$ in $\mathbb{R}^{n+2}$ as + +$$ +\boldsymbol {X} = \left(x _ {1}, \dots , x _ {n}, - 1, - \frac {1}{2} \| \mathbf {x} \| ^ {2}\right) \in \mathbb {R} ^ {n + 2}, \tag {4} +$$ + +$$ +\boldsymbol {S} = \left(c _ {1}, \dots , c _ {n}, \frac {1}{2} \left(\| \boldsymbol {\mathsf {c}} \| ^ {2} - r ^ {2}\right), 1\right) \in \mathbb {R} ^ {n + 2}, +$$ + +where $\mathbf{c} = (c_1, \ldots, c_n) \in \mathbb{R}^n$ is the hypersphere center and $r \in \mathbb{R}$ is the radius, their scalar product $X \cdot S$ in the conformal space $\mathbb{M}\mathbb{E}^n$ can be computed equivalently in $\mathbb{R}^{n+2}$ as $X^\top S$ : + +$$ +X \cdot S = X ^ {\top} S = - \frac {1}{2} \| \mathbf {x} - \mathbf {c} \| ^ {2} + \frac {1}{2} r ^ {2}. \tag {5} +$$ + +This result enables the implementation of a hypersphere neuron in $\mathbb{M}\mathbb{E}^n$ using the standard dot product in $\mathbb{R}^{n + 2}$ . The hypersphere vector components are treated as independent learnable parameters during training. Thus, a spherical classifier effectively learns non-normalized hyperspheres of the form $\widetilde{\boldsymbol{S}} = (s_1,\dots ,s_{n + 2})\in \mathbb{R}^{n + 2}$ . Due to the homogeneity of the representation, both normalized and non-normalized hyperspheres represent the same decision surface. More details can be found in Section 3.2 in the work of Melnyk et al. (2021). + +The geometric neuron is a generalization of the hypersphere neuron for point sets as input, see Figure 2. A single geometric neuron output is thus the sum of the signed distances of $K$ input points to $K$ learned hyperspheres + +$$ +z = \sum_ {k = 1} ^ {K} \gamma_ {k} \boldsymbol {X} _ {k} ^ {\top} \boldsymbol {S} _ {k}, \tag {6} +$$ + +where $z \in \mathbb{R}$ , $X_{k} \in \mathbb{R}^{5}$ is a properly embedded 3D input point, $\gamma_{k} \in \mathbb{R}$ is the scale factor, i.e., the last element of the learned parameter vector $\widetilde{S}_{k}$ , and $S_{k} = \widetilde{S}_{k} / \gamma_{k} \in \mathbb{R}^{5}$ are the corresponding normalized learned parameters (spheres). + +Furthermore, Melnyk et al. (2021) demonstrated that the hypersphere (and geometric) neuron activations are isometric in 3D. That is, rotating the input is equivalent to rotating the decision spheres. This result is a necessary condition to consider rotation and translation equivariance of models constructed with spherical neurons and forms the foundation of our methodology. + +In the following sections, we use the same notation for a 3D rotation $\pmb{R}$ represented in the Euclidean space $\mathbb{R}^3$ , the homogeneous (projective) space $P(\mathbb{R}^3)$ , and $\mathbb{M}\mathbb{E}^3 \cong \mathbb{R}^5$ , depending on the context. This is possible since we can append the required number of ones to the diagonal of the original rotation matrix without changing the transformation representation. + +# 4. Method + +In this section, we identify the conditions under which a spherical neuron as a function of its 3D input can be steered. In other words, we derive an expression that gives us the response of a hypothetical spherical neuron for some input, using rotated versions of the learned spherical neuron parameters. We start by considering the steerability conditions for a single sphere classifying the corresponding input + +![](images/f89fcb881eb53cefba38087f5594166eda7350bd1179116350026a5c1f98b52f.jpg) +Figure 3. The effect of rotation on the spherical neuron activation in 2D; $t(\theta)$ denotes the tangent length as a function of rotation angle, i.e., $t(0)^2 = \| \mathbf{x} - \mathbf{c}_0\|^2 - r^2 = -2X^\top S$ . + +point $X$ , i.e., $f(\boldsymbol{X}) = \boldsymbol{X}^{\top}\boldsymbol{S}$ , where $\boldsymbol{X}$ and $\boldsymbol{S}$ are embedded in $\mathbb{M}\mathbb{E}^3 \cong \mathbb{R}^5$ according to (4). + +# 4.1. Basis construction + +To formulate a steerability constraint for a spherical neuron that has one sphere as a decision surface, we first need to determine the minimum number of basis functions, i.e., the number of terms $M$ in (2). This number only depends on the degree of the spherical harmonics that are required to compute the steered result (Freeman et al., 1991). Thus, we need to determine the required degrees. + +Theorem 4.1. Let $S \in \mathbb{R}^{n + 2}$ be an $nD$ spherical classifier with center $\mathbf{c}_0 \in \mathbb{R}^n$ ( $R \coloneqq \| \mathbf{c}_0\|$ ) and radius $r$ , and $\mathbf{x} \in \mathbb{R}^n$ be a point represented by $X \in \mathbb{R}^{n + 2}$ , see (4). Let further $S'$ be the classifier that is obtained by rotating $S$ in $nD$ space (i.e., using an element of $\mathrm{SO}(n)$ ), then $X^\top S'$ and $X^\top S$ are related by spherical harmonics up to first degree. + +Proof. Without loss of generality, the rotation is defined by the plane of rotation $\pi$ and the angle $\theta$ . Denote the projection of a vector $\mathbf{v} \in \mathbb{R}^n$ on $\pi$ by $\mathbf{v}_{\pi}$ and define $\mathbf{v}_{\perp \pi} = \mathbf{v} - \mathbf{v}_{\pi}$ . From (5) we obtain + +$$ +\begin{array}{l} 2 \boldsymbol {X} ^ {\top} \boldsymbol {S} = r ^ {2} - \left\| \mathbf {x} - \mathbf {c} _ {0} \right\| ^ {2} \\ = r ^ {2} - \left\| \left(\mathbf {x} - \mathbf {c} _ {0}\right) _ {\perp \pi} \right\| ^ {2} - \left\| \left(\mathbf {x} - \mathbf {c} _ {0}\right) _ {\pi} \right\| ^ {2}. \\ \end{array} +$$ + +A rotation in $\pi$ only affects the rightmost term above and there exists a $\phi \in [0,2\pi)$ such that + +$$ +\begin{array}{l} \left\| \left(\mathbf {x} - \mathbf {c} _ {0}\right) _ {\pi} \right\| ^ {2} = \left\| \mathbf {x} _ {\pi} - \mathbf {c} _ {0} \pi \right\| ^ {2} \\ = \| \mathbf {x} _ {\pi} \| ^ {2} + \| \mathbf {c} _ {0 \pi} \| ^ {2} - 2 \| \mathbf {x} _ {\pi} \| \| \mathbf {c} _ {0 \pi} \| \cos \phi . \\ \end{array} +$$ + +With a similar argument, we obtain + +$$ +\begin{array}{l} 2 \boldsymbol {X} ^ {\top} \boldsymbol {S} ^ {\prime} = r ^ {2} - \left\| (\mathbf {x} - \mathbf {c} _ {0}) _ {\perp \pi} \right\| ^ {2} \\ - \left\| \mathbf {x} _ {\pi} \right\| ^ {2} - \left\| \mathbf {c} _ {0 \pi} \right\| ^ {2} + 2 \left\| \mathbf {x} _ {\pi} \right\| \left\| \mathbf {c} _ {0 \pi} \right\| \cos (\phi + \theta). \\ \end{array} +$$ + +![](images/021058ef407baa6a549287b3cc4390652a357d97c3d9e7093cc5a8dc89d325a9.jpg) + +![](images/eccb1dc1b99fb49234844fbeea0c0ac1bf60b6eb20153917f07ebf69c300dd6b.jpg) +Figure 4. The effect of rotation on the spherical neuron activation in 3D; $t(\theta)$ denotes the tangent length as a function of rotation angle. + +This result is valid in any dimension, but we are primarily interested in $n = 2$ , as illustrated in Figure 3 for the case $\phi = 0$ , and $n = 3$ , shown in Figure 4. + +Following the result of Theorem 4 in Freeman et al. (1991) and using $N = 1$ , we have that $M = (N + 1)^2 = 4$ basis functions suffice in the 3D case (2). + +# 4.2. Spherical filter banks in 3D + +In 3D, we thus select four rotated versions of the function $f(\pmb{X})$ , as the basis functions. The rotations $\{\pmb{R}_j\}_{j=1}^4$ must be chosen to satisfy the condition (b) in Theorem 4 (Freeman et al., 1991). Therefore, we transform $f(\pmb{X})$ such that the resulting four spheres are spaced in three dimensions equally, i.e., form a regular tetrahedron with the vertices $(1,1,1)$ , $(1,-1,-1)$ , $(-1,1,-1)$ , and $(-1,-1,1)$ , as shown in Figure 5. We stack the homogeneous coordinates of the tetrahedron vertices $\mathbf{m}_j$ in a matrix column-wise (scaled by $1/2$ ) to get the orthogonal matrix + +$$ +\mathbf {M} = \left[ \begin{array}{l l l l} \mathbf {m} _ {1} & \mathbf {m} _ {2} & \mathbf {m} _ {3} & \mathbf {m} _ {4} \end{array} \right] = \frac {1}{2} \left[ \begin{array}{r r r r} 1 & 1 & - 1 & - 1 \\ 1 & - 1 & 1 & - 1 \\ 1 & - 1 & - 1 & 1 \\ 1 & 1 & 1 & 1 \end{array} \right]. \tag {7} +$$ + +We will use this matrix operator $\mathbf{M}$ to compute the linear coefficients in the vector space generated by the vertices of the regular tetrahedron (Granlund & Knutsson, 1995). This will be necessary to find the appropriate interpolation functions and formulate the steerability constraint in Section 4.3. + +The four rotated versions of the function $f(\pmb{X})$ will constitute the basis functions that we call a spherical filter bank. To construct this filter bank, we choose the following convention. The originally learned spherical classifier $f(\pmb{X}) = \pmb{X}^{\top}\pmb{S}$ is first rotated to $\| \mathbf{c}_0\| \cdot (1,1,1)$ (see Figure 5) with the corresponding (geodesic) transformation denoted as $R_O$ . Next, we rotate the transformed sphere into the other three vertices of the regular tetrahedron and transform back to the original coordinate system (see Figure 6 for the case of $(1, -1, -1)$ ). + +The resulting filter bank for one spherical classifier is thus + +![](images/004e208366459f7606df83a662e16550d9c0279815e85a31fd18ef5afccf251e.jpg) +Figure 5. A regular tetrahedron as a basis. Without loss of generality, assume $\| \mathbf{c}_0\| = \sqrt{3}$ . + +composed as the following $4 \times 5$ matrix: + +$$ +B (\boldsymbol {S}) = \left[ \boldsymbol {R} _ {O} ^ {\top} \boldsymbol {R} _ {T _ {i}} \boldsymbol {R} _ {O} \boldsymbol {S} \right] _ {i = 0 \dots 3}, \tag {8} +$$ + +where each of $\{\pmb{R}_{T_i}\}_{i = 0}^3$ is the rotation isomorphism in $\mathbb{R}^5$ corresponding to a 3D rotation from $(1,1,1)$ to the vertex $i + 1$ of the regular tetrahedron. Therefore, $\pmb{R}_{T_0} = \pmb{I}_5$ . + +As we show by Theorem 4.2, the spherical filter bank $B(S)$ is equivariant under 3D rotations. + +Theorem 4.2. Let $S \in \mathbb{R}^5$ be a 3D spherical classifier (i.e., the hypersphere neuron) and $\mathbf{x} \in \mathbb{R}^3$ be an input point represented by $X \in \mathbb{R}^5$ , see (4). Let further $B(S) \in \mathbb{R}^{4 \times 5}$ be a filter bank obtained according to (8). Then the filter bank output $\mathbf{y} = B(S)X \in \mathbb{R}^4$ is equivariant to 3D rotations of $\mathbf{x}$ . + +Proof. Since rotations in $\mathbb{R}^3$ are embedded into $\mathbb{R}^5$ acting on the first three components (for details, see Melnyk et al. (2021)), we need to show that the left sub-matrix $B_{3}(S) \in \mathbb{R}^{4 \times 3}$ of $B(S)$ is of rank 3. By construction, the four rows of $B_{3}(S)$ form the vertices of a tetrahedron, thus span $\mathbb{R}^3$ . + +Note that the right sub-matrix $B_{2}(S) \in \mathbb{R}^{4 \times 2}$ of $B(S)$ results in a constant vector $B_{2}(S)[x_{4}, x_{5}]^{\top} \in \mathbb{R}^{4}$ independent of the rotation, where $x_{4}$ and $x_{5}$ are the last two components of $X$ (see (4)). This additional constant vector requires the use of the fourth vertex of the tetrahedron. + +Furthermore, we can explicitly show how the representation $V_{R} \in \mathbb{R}^{4 \times 4}$ of the 3D rotation $R$ can be obtained in the filter bank $B(S)$ output space. + +Proposition 4.3. Let $\mathbf{M}$ be the $4\times 4$ orthogonal matrix defined in (7), $R_O^k\in \mathbb{R}^{4\times 4}$ be the $P(\mathbb{R}^3)$ representation (constructed by appending ones to the main diagonal - see the last paragraph in Section 3.3) of the 3D rotation (geodesic) from the center $\mathbf{c}_0^k$ of the learned kth spherical classifier $S_{k}$ to $\| \mathbf{c}_0^k\| \cdot (1,1,1)$ , and, slightly abusing notation, $\pmb {R}\in \mathbb{R}^{4\times 4}$ be the $P(\mathbb{R}^3)$ representation of the 3D rotation $\pmb{R}$ . + +Then $V_{R}^{k} \in \mathbb{R}^{4 \times 4}$ defined below is the representation of the 3D rotation $\pmb{R}$ in the filter bank $B(\pmb{S}_{k})$ output space: + +$$ +V _ {\boldsymbol {R}} ^ {k} = \mathbf {M} ^ {\top} \boldsymbol {R} _ {O} ^ {k} \boldsymbol {R} \boldsymbol {R} _ {O} ^ {k \top} \mathbf {M}. \tag {9} +$$ + +![](images/b14cd6083d0eef64c69f23b1eabea65d455673f70c3b69e671128ce7aac71ba7.jpg) +Figure 6. A rotation from $\mathbf{c}_0$ to $\mathbf{c}$ described by a tetrahedron rotation. Without loss of generality, assume $\| \mathbf{c}_0\| = \sqrt{3}$ . + +Proof. Since $\operatorname{det} \mathbf{M} = 1$ , we have that $\mathbf{M} \in \mathrm{SO}(4)$ , and thus, all terms on the right-hand-side of (9) are $4 \times 4$ rotation matrices with only one variable $-\mathbf{R}$ . Therefore, $V_{R}^{k}$ is also a rotation matrix and is a unique map. The inverse transformation can be computed straightforwardly as + +$$ +\boldsymbol {R} = \boldsymbol {R} _ {O} ^ {k ^ {\top}} \mathbf {M} V _ {R} ^ {k} \mathbf {M} ^ {\top} \boldsymbol {R} _ {O} ^ {k} \tag {10} +$$ + +with subsequent extraction of the upper-left $3 \times 3$ sub-matrix as the original 3D rotation matrix $\pmb{R}$ . Hence, there is a one-to-one mapping between $V_{\pmb{R}}^{k}$ and $\pmb{R}$ . + +Thus, both $V_{R}$ and $R$ are representations of the 3D rotation, and we can write the rotation equivariance property of the spherical filter bank $B(S)$ as + +$$ +V _ {\boldsymbol {R}} B (\boldsymbol {S}) \boldsymbol {X} = B (\boldsymbol {S}) \boldsymbol {R X}. \tag {11} +$$ + +# 4.3. 3D steerability constraint + +The steerability constraint can be formulated as follows. For an arbitrary rotation $\pmb{R}$ applied to the input of the function $f(\pmb {X})$ , we want the output of the spherical filter bank $B(S)$ in (8) to be interpolated with $v_{j}(\pmb {R})$ such that the response is equal to the original function output, i.e., + +$$ +\begin{array}{l} f (\boldsymbol {X}) = f ^ {\boldsymbol {R}} (\boldsymbol {R} \boldsymbol {X}) = \sum_ {j = 1} ^ {M} v _ {j} (\boldsymbol {R}) f ^ {\boldsymbol {R} _ {j}} (\boldsymbol {R} \boldsymbol {X}) \tag {12} \\ = v (\boldsymbol {R}) ^ {\top} B (\boldsymbol {S}) \boldsymbol {R X}, \\ \end{array} +$$ + +where $X \in \mathbb{R}^5$ is a single, appropriately embedded, 3D point, and $v(\pmb{R}) \in \mathbb{R}^4$ is a vector of the interpolation coefficients. + +The coefficients $v(\mathbf{R})$ should conform to the basis function construction (condition (b) in Theorem 4 in Freeman et al. (1991)), which is why they are computed with $\mathbf{M}$ defined in (7). Given $X \in \mathbb{R}^5$ as input and an unknown rotation $\mathbf{R}$ acting on it, the steering equation (12) implies + +$$ +v (\boldsymbol {R}) ^ {\top} B (\boldsymbol {S}) \boldsymbol {R} \boldsymbol {X} = v (\mathbf {I}) ^ {\top} B (\boldsymbol {S}) \boldsymbol {X}. \tag {13} +$$ + +Given a tetrahedron rotation, e.g., $\pmb{R}_{T_1}$ , as shown in the diagram in Figure 6, we can define the unknown rotation + +accordingly as $\pmb{R} = \pmb{R}_O^\top \pmb{R}_{T_1}\pmb{R}_O$ . In this case, it is easy to see that to satisfy the constraint (13), $v(\pmb{R})$ must be $(0,1,0,0)$ i.e., the second filter in the filter bank $B(S)$ must be chosen. This can be achieved by transforming a constant vector $\mathbf{m}_1 = (\frac{1}{2},\frac{1}{2},\frac{1}{2},\frac{1}{2})$ by rotation $\pmb{R}_{T_1}$ and multiplying it by the basis matrix $\mathbf{M}$ as follows: + +$$ +\begin{array}{l} v (\boldsymbol {R}) = \mathbf {M} ^ {\top} \left(\boldsymbol {R} _ {T _ {1}} \mathbf {m} _ {1}\right) \\ = \mathbf {M} ^ {\top} \left(\frac {1}{2}, - \frac {1}{2}, - \frac {1}{2}, \frac {1}{2}\right) = (0, 1, 0, 0). \tag {14} \\ \end{array} +$$ + +Note that, in general, a geometric neuron (6) takes a set of embedded points as input. Therefore, with the setup above, the rotation of $\mathbf{m}_1$ will be different for each input shape point $k$ if the same $v$ is used for all $k$ , which contradicts that the shape is transformed by a rigid body motion, i.e., the same $\pmb{R}$ for all $k$ . Thus, we need to consider a suitable vector $v^k$ for each input shape point $k$ , such that the resulting $\pmb{R}$ is the same for all $k$ . This can be achieved by recalling how we construct the basis functions in the spherical filter bank (8): we need to consider the respective initial rotation $\pmb{R}_O^k$ . The desired interpolation coefficients $v^k$ are thus computed as + +$$ +v ^ {k} (\boldsymbol {R}) = \mathbf {M} ^ {\top} \left(\boldsymbol {R} _ {O} ^ {k} \boldsymbol {R} \boldsymbol {R} _ {O} ^ {k \top} \mathbf {m} _ {1}\right). \tag {15} +$$ + +The resulting $v^{k}(\pmb{R}) \in \mathbb{R}^{4}$ interpolate the responses of the tetrahedron-copies of the originally learned sphere $S_{k}$ to replace the rotated sphere. + +Remarkably, the interpolation vector $v^{k}(\mathbf{R})$ is the first column of $V_{\mathbf{R}}^{k}$ (9). Note that $v^{k}(\mathbf{R})$ has only three degrees of freedom since the four vertices of the regular tetrahedron sum to zero (see Figure 5). Thus, $v^{k}(\mathbf{R})$ is equivariant under 3D rotations. + +By plugging (12) into (6), we can now establish the steerability constraint for a geometric neuron, $f_{\mathrm{GN}}$ , which takes a set of $K$ embedded points $\{X_1,\ldots ,X_k\}$ as input: + +$$ +\begin{array}{l} f _ {\mathrm {G N}} ^ {\boldsymbol {R}} (\boldsymbol {R} \boldsymbol {X}) = \sum_ {k = 1} ^ {K} \gamma_ {k} f ^ {k R} (\boldsymbol {R} \boldsymbol {X} _ {k}) \\ = \sum_ {k = 1} ^ {K} \gamma_ {k} v ^ {k} (\boldsymbol {R}) ^ {\top} B (\boldsymbol {S} _ {k}) \boldsymbol {R} \boldsymbol {X} _ {k}. \\ \end{array} +$$ + +# 4.4. Steerable model overview + +To build a 3D steerable model, we perform the following steps (see Figure 1): We first train an ancestor model, which consists of spherical neurons. After training the model parameters to classify data in a canonical orientation, we freeze them and transform the first layer weights according to the 3D steerability constraint (12) (for hypersphere neurons) or (16) (for geometric neurons). Finally, by combining the resulting parameters in spherical filter banks according to (8) and adding interpolation coefficients (15) as free parameters, we create a steerable model. If the interpolation + +coefficients are computed correctly, the model will produce rotation-invariant predictions. + +# 5. Experiments + +In this section, we describe the experiments we conducted to confirm our findings presented in Section 4. + +# 5.1. Datasets + +3D Tetris Following the experiments reported by Thomas et al. (2018), Weiler et al. (2018a), and Melnyk et al. (2021), we use the following synthetic point set of eight 3D Tetris shapes (Thomas et al., 2018) consisting of four points each (see, e.g., Figure 3 in Melnyk et al. (2021)): + +
chiral_shape_1:[(0,0,0), (0,0,1), (1,0,0), (1,1,0)],
chiral_shape_2:[(0,0,0), (0,0,1), (1,0,0), (1,-1,0)],
square:[(0,0,0), (1,0,0), (0,1,0), (1,1,0)],
line:[(0,0,0), (0,0,1), (0,0,2), (0,0,3)],
corner:[(0,0,0), (0,0,1), (0,1,0), (1,0,0)],
L:[(0,0,0), (0,0,1), (0,0,2), (0,1,0)],
T:[(0,0,0), (0,0,1), (0,0,2), (0,1,1)],
zigzag:[(0,0,0), (1,0,0), (1,1,0), (2,1,0)].
+ +3D skeleton data We also perform experiments on real-world data to substantiate the validity of our theoretical results. We use the UTKinet-Action3D dataset introduced by Xia et al. (2012), in particular, the 3D skeletal joint locations extracted from Kinect depth maps. For each action sequence and from each frame, we extract the skeleton consisting of twenty points and assign it to the class of actions (ten categories) this frame is part of. Therefore, we formulate the task as shape recognition (i.e., a kind of action recognition from a static point cloud), where each shape is of size $20 \times 3$ . + +Since the orientations of the shapes vary significantly across the sequences, we perform the following standardization: We first center each shape at the origin, and then compute the orientation from its three hip joints and de-rotate the shape in the $xy$ -plane (viewer coordinate system) accordingly. We illustrate the effect of de-rotation in Figure 7. From each action sequence, we randomly select $50\%$ of the skeletons for the test set and $20\%$ of the remainder as validation data. The resulting data split is as follows: 2295 training shapes, 670 shapes for validation, and 3062 test shapes, approximately corresponding to $38\%$ , $11\%$ , $51\%$ of the total amount of the skeletons, respectively. + +# 5.2. Steerable model construction + +To construct and test steerable models, we perform the same steps for both datasets. The minor differences are the choice of training hyperparameters and the presence of validation and test subsets in the 3D skeleton dataset. + +We first train a two-layer (ancestor) multilayer geometric perceptron (MLGP) model (Melnyk et al., 2021), where the + +![](images/0cb7ded7806db20944a5a34e98f2b88c0866438e2f006f795aeb703df1164e03.jpg) +Figure 7. The effect of standardizing the orientation of the 3D skeleton representing waveHands action: the original (left) and the de-rotated (right) shape; the arrow is the normal vector of the plane formed by the three hip joints. + +![](images/e754cf5a547c3c27550fe8be5fa9680e6e6a5c594efb183a717cec3f81e24467.jpg) + +first layer consists of geometric neurons and the output layer of hypersphere neurons, to classify the shapes. Since the architecture choice is not the objective of the experiments, when building the MLGP, we use only one configuration with five hidden units for the Tetris data and twelve hidden units (determined by using the validation data) for the 3D skeleton dataset throughout the experiments. + +Similar to Melnyk et al. (2021), we do not use any activation function in the first layer due to the nonlinearity of the conformal embedding. We implement both MLGP models in PyTorch (Paszke et al., 2019) and keep the default parameter initialization for the linear layers. We train both models by minimizing the cross-entropy loss function and use the Adam optimizer (Kingma & Ba, 2015) with the default hyperparameters (the learning rate is 0.001). The Tetris MLGP learns to classify the eight shapes in the canonical orientation perfectly after 2000 epochs, whereas the Skeleton model trained for 10000 epochs achieves a test set accuracy of $92.9\%$ . + +For both, we then freeze the trained parameters and construct a steerable model. Note that we form steerable units only in the first layer and keep the output, i.e., classification, layer hypersphere neurons as they are. The steerability is not required for the subsequent layers as the output of the first layer becomes rotation-independent. The steerable units are formed from the corresponding frozen parameters as the (fixed) filter banks according to (8). + +The only free parameters of this constructed steerable model are interpolation coefficients $v^{k}(\mathbf{R}) \in \mathbb{R}^{4}$ defined in (15), where $k$ indexes the learned first layer parameters (spheres) in the ancestor MLGP model. + +Note that the interpolation coefficients (15) are all parameterized by the input orientation $\mathbf{R}$ . If the interpolation coefficients are computed correctly, the model output will be rotation-invariant. However, in this paper, we focus on the steerability as such, and a practical way of determining $v^{k}(\mathbf{R})$ remains to be done in future work, including the experimental comparison with rotation-invariant classifiers from related work. Therefore, the following experiment + +Table 1. The steerable model classification accuracy for the distorted (the noise units are specified in the square brackets) rotated shapes and the ancestor accuracy for the distorted shapes in their canonical orientation (mean and std over 1000 runs, %). + +
3D Tetris3D skeleton data (test set)
Noise (a), [1]SteerableAncestorNoise (a), [m]SteerableAncestor
0.00100.0 ± 0.0100.0 ± 0.00.00092.9 ± 0.092.9 ± 0.0
0.05100.0 ± 0.0100.0 ± 0.00.00592.4 ± 0.292.4 ± 0.2
0.10100.0 ± 0.0100.0 ± 0.00.01091.1 ± 0.391.1 ± 0.3
0.20100.0 ± 0.4100.0 ± 0.00.02087.1 ± 0.587.1 ± 0.5
0.3099.7 ± 1.999.8 ± 1.60.03082.3 ± 0.682.2 ± 0.6
0.5094.9 ± 7.795.0 ± 7.90.05072.0 ± 0.771.9 ± 0.7
+ +Table 2. The L1 distance between the steerable model hidden activations and the ground truth activations given the distorted (the noise units are specified in the square brackets) rotated shapes and between the ancestor hidden activations given the distorted shapes in their canonical orientation (mean and std over 1000 runs). + +
3D Tetris3D skeleton data (test set)
Noise (a), [1]SteerableAncestorNoise (a), [m]SteerableAncestor
0.000.00 ± 0.000.00 ± 0.000.0000.00 ± 0.000.00 ± 0.00
0.050.33 ± 0.050.33 ± 0.050.0050.53 ± 0.000.53 ± 0.00
0.100.66 ± 0.100.66 ± 0.100.0101.06 ± 0.011.06 ± 0.01
0.201.32 ± 0.191.32 ± 0.190.0202.12 ± 0.012.12 ± 0.01
0.302.00 ± 0.312.00 ± 0.290.0303.18 ± 0.013.18 ± 0.01
0.503.33 ± 0.483.32 ± 0.480.0505.30 ± 0.025.30 ± 0.02
+ +serves as an empirical validation of the derived constraint rather than rotation-invariant predictions. + +# 5.3. Known rotation experiment + +Using the trained ancestor MLGP, we verify the correctness of (16) (and, therefore, (12)). We first rotate the original data and then use this ground truth rotation to compute the interpolation coefficients of the constructed steerable model according to (15). Our intuition is that if the steerability constraint (16) is correct, then, given the transformed point set, the activations of the steerable units in the steerable model will be equal to the activations of the geometric neurons in the ancestor MLGP model fed with the point set in the canonical orientation. Hence, the classification accuracies of the ancestor and steerable models on the original and transformed datasets, respectively, should be equal. + +We run this experiment 1000 times. Each time, we generate a random rotation and apply it to the original point set (in case of the 3D skeleton data, we use the test split). We use this ground-truth rotation information to compute the interpolation coefficients for the steerable model, which we then evaluate on the transformed point set. + +To verify the stability of the steerable unit activations, we add uniform noise to the transformed points, $\pmb{n} \sim U(-a, a)$ , where the range of $a$ is motivated by the magnitude of the points in the datasets: for the Tetris data, the highest $a$ + +is chosen to be 0.5, making it impossible for the noise to perturb a shape of one category into a shape of another class; for the skeleton data, the highest $a$ is set to $0.05\mathrm{m}$ - a reasonable amount of distortion for a human of average size (see, e.g., Figure 7), which should be insufficient to completely change the representation of the skeleton action. + +For reference, we also present the accuracy of the ancestor model classifying the data in the canonical orientation. We summarize the results in Table 1. Additionally, by computing the L1 distance, we compare the hidden unit activations of the ancestor MLGP fed with the shapes in the canonical orientation (ground truth activations) and those of the constructed steerable models fed with the rotated data (see Table 2). + +# 6. Discussion and Conclusion + +Enabled by the complete understanding of the geometry of the spherical neurons, we show in Section 4 that we only need the spherical harmonics of degree up to $N = 1$ to determine the effect of rotation on the activations in 3D. Using this result, we derive a novel 3D steerability constraintt (12) (and (16)), adding to the practical value of prior work (Baner et al., 2003b; Perwass et al., 2003; Melnyk et al., 2021). + +The experiment conducted in Section 5.3 shows that the derived constraint is correct since the constructed steerable + +model produces equally (up to a numerical precision) accurate predictions for the rotated shapes as the ancestor for the shapes in the canonical orientation, provided that the interpolation coefficients are computed with the known rotation. From Table 1 and 2, we can see that the steerable model classification error and the L1 distance to the ground truth activations only moderately increase with the level of noise in the input data, which is a clear indication of the robustness of the classifier. + +Noteworthy, invariance to point permutations in the input is not attained with the ancestor MLGP model that we used in the experiments. However, one can address the problem of permutation invariance quite straightforwardly: For example, one could follow the construction of, e.g., PointNet (Qi et al., 2017), and replace the shared MLPs applied to each point in isolation with shared spherical neurons taking one point as input (i.e., hypersphere neurons), and then apply a global aggregation function to the extracted features. One would then apply the steerability constraint (12) to the first layer learned parameters to create a steerable model. + +In general, one can build an ancestor model containing spherical neurons only in the first layer, with subsequent layers of various flavors (see Figure 1). As we mentioned in Section 5.2, steerability is not required for the subsequent layers as the output of the first layer ( $\mathbf{h}$ in Figure 1) becomes rotation-independent, given that the interpolation coefficients are computed correctly. + +The interpolation coefficients $v^{k}$ could be learned directly, e.g., by using a regression network. However, this would be a much more complex learning problem than determining $v^{k}$ indirectly by regressing $\mathbf{R}$ , since all $K$ interpolation vectors $v^{k}(\mathbf{R})$ are by definition uniquely parameterized by $\mathbf{R}$ . + +Rotation regression with NNs is per se an important and continuously studied problem that is often considered in the context of pose estimation (Zhou et al., 2019; Chen et al., 2022). Therefore, it is more efficient and intuitive to combine a rotation regressor with our steerable approach for creating a rotation-invariant classifier as compared to the approaches where the rotation information is naively encompassed in the learned parameters of a generic network by training on rotation-augmented data. + +Finally, the main theoretical results of this paper provide a rigorous and geometrically lucid mechanism for constructing steerable feature extractors, the practical utility of which can be fully unveiled in future work. + +# Acknowledgments + +This work was supported by the Wallenberg AI, Autonomous Systems and Software Program (WASP), by the Swedish Research Council through a grant for the project Al + +gebraically Constrained Convolutional Networks for Sparse Image Data (2018-04673), and the strategic research environment ELLIIT. + +# References + +Anderson, B., Hy, T. S., and Kondor, R. Cormorant: Covariant molecular neural networks. In Advances in Neural Information Processing Systems, pp. 14510-14519, 2019. +Banarer, V., Perwass, C., and Sommer, G. Design of a multilayered feed-forward neural network using hypersphere neurons. In International Conference on Computer Analysis of Images and Patterns, pp. 571-578. Springer, 2003a. +Banarer, V., Perwass, C., and Sommer, G. The hypersphere neuron. In *ESANN*, pp. 469-474, 2003b. +Chen, J., Yin, Y., Birdal, T., Chen, B., Guibas, L. J., and Wang, H. Projective manifold gradient layer for deep rotation regression. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 6646-6655, June 2022. +Cohen, T. S. and Welling, M. Steerable CNNs. arXiv preprint arXiv:1612.08498, 2016. In Proceedings of the International Conference on Learning Representations (ICLR), 2017. +Freeman, W. T., Adelson, E. H., et al. The design and use of steerable filters. IEEE Transactions on Pattern analysis and machine intelligence, 13(9):891-906, 1991. +Fuchs, F., Worrall, D., Fischer, V., and Welling, M. Se(3)-transformers: 3d roto-translation equivariant attention networks. In Larochelle, H., Ranzato, M., Hadsell, R., Balcan, M. F., and Lin, H. (eds.), Advances in Neural Information Processing Systems, volume 33, pp. 1970-1981. Curran Associates, Inc., 2020. +Granlund, G. and Knutsson, H. (eds.). Signal Processing for Computer Vision. Kluwer, Dordrecht, 1995. +Jing, B., Eismann, S., Suriana, P., Townshend, R. J., and Dror, R. Learning from protein structure with geometric vector perceptrons. arXiv preprint arXiv:2009.01411, 2020. Published as a conference paper at ICLR 2021. +Kingma, D. P. and Ba, J. Adam: A method for stochastic optimization. In Proceedings of the International Conference on Learning Representations (ICLR), 2015. +Knutsson, H., Haglund, L., Bärman, H., and Granlund, G. H. A framework for anisotropic adaptive filtering and analysis of image sequences and volumes. In [Proceedings] ICASSP-92: 1992 IEEE International Conference on Acoustics, Speech, and Signal Processing, volume 3, pp. 469-472 vol.3, 1992. doi: 10.1109/ICASSP.1992.226174. + +Kondor, R., Lin, Z., and Trivedi, S. Clebsch-Gordan Nets: a Fully Fourier Space Spherical Convolutional Neural Network. In Bengio, S., Wallach, H., Larochelle, H., Grauman, K., Cesa-Bianchi, N., and Garnett, R. (eds.), Advances in Neural Information Processing Systems, volume 31. Curran Associates, Inc., 2018. +Li, H., Hestenes, D., and Rockwood, A. Generalized homogeneous coordinates for computational geometry. In Geometric Computing with Clifford Algebras, pp. 27-59. Springer, 2001a. +Li, H., Hestenes, D., and Rockwood, A. A universal model for conformal geometries of Euclidean, spherical and double-hyperbolic spaces. In Geometric computing with Clifford algebras, pp. 77-104. Springer, 2001b. +Marcos, D., Volpi, M., Komodakis, N., and Tuia, D. Rotation Equivariant Vector Field Networks. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), Oct 2017. +Melnyk, P., Felsberg, M., and Wadenback, M. Embed Me if You Can: A Geometric Perceptron. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), pp. 1276-1284, October 2021. +Paszke, A., Gross, S., Massa, F., Lerer, A., Bradbury, J., Chanan, G., Killeen, T., Lin, Z., Gimelshein, N., Antiga, L., et al. Pytorch: An imperative style, high-performance deep learning library. In Advances in Neural Information Processing Systems, pp. 8024-8035, 2019. +Perona, P. Deformable kernels for early vision. IEEE Transactions on Pattern Analysis and Machine Intelligence, 17 (5):488-499, 1995. doi: 10.1109/34.391394. +Perwass, C., Banarer, V., and Sommer, G. Spherical decision surfaces using conformal modelling. In Joint Pattern Recognition Symposium, pp. 9-16. Springer, 2003. +Qi, C. R., Su, H., Mo, K., and Guibas, L. J. 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. +Reisert, M. Group integration techniques in pattern analysis - a kernel view. PhD thesis, University of Freiburg, Freiburg im Breisgau, Germany, 2008. +Simoncelli, E. P. and Freeman, W. T. The steerable pyramid: a flexible architecture for multi-scale derivative computation. In Proceedings., International Conference on Image Processing, volume 3, pp. 444-447 vol.3, 1995. doi: 10.1109/ICIP.1995.537667. +Simoncelli, E. P., Freeman, W. T., Adelson, E. H., and Heeger, D. J. Shiftable multiscale transforms. IEEE + +Transactions on Information Theory, 38(2):587-607, 1992. doi: 10.1109/18.119725. +Teo, P. C. and Hel-Or, Y. Lie generators for computing steerable functions. Pattern Recognition Letters, 19(1): 7-17, 1998. ISSN 0167-8655. doi: https://doi.org/10. 1016/S0167-8655(97)00156-6. +Thomas, N., Smidt, T., Kearnes, S., Yang, L., Li, L., Kohlhoff, K., and Riley, P. Tensor field networks: Rotation-and translation-equivariant neural networks for 3D point clouds. arXiv preprint arXiv:1802.08219, 2018. +Van Gool, L., Moons, T., Pauwels, E., and Oosterlinck, A. Vision and Lie's approach to invariance. Image and Vision Computing, 13(4):259-277, 1995. ISSN 0262-8856. doi: https://doi.org/10.1016/0262-8856(95)99715-D. +Weiler, M. and Cesa, G. General $E(2)$ -Equivariant Steerable CNNs. Advances in Neural Information Processing Systems, 32, 2019. +Weiler, M., Geiger, M., Welling, M., Boomsma, W., and Cohen, T. S. 3D steerable CNNs: Learning rotationally equivariant features in volumetric data. In Advances in Neural Information Processing Systems, pp. 10381-10392, 2018a. +Weiler, M., Hamprecht, F. A., and Storath, M. Learning steerable filters for rotation equivariant CNNs. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 849-858, 2018b. +Xia, L., Chen, C.-C., and Aggarwal, J. K. View invariant human action recognition using histograms of 3d joints. In 2012 IEEE Computer Society Conference on Computer Vision and Pattern Recognition Workshops, pp. 20-27, 2012. doi: 10.1109/CVPRW.2012.6239233. +Zhao, Y., Birdal, T., Lenssen, J. E., Menegatti, E., Guibas, L., and Tombari, F. Quaternion equivariant capsule networks for 3d point clouds. In European Conference on Computer Vision, pp. 1-19. Springer, 2020. +Zhou, Y., Barnes, C., Lu, J., Yang, J., and Li, H. On the continuity of rotation representations in neural networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 5745-5753, 2019. \ No newline at end of file diff --git a/steerable3dsphericalneurons/images.zip b/steerable3dsphericalneurons/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..8e46ba4b7ba6bf70a22d6dcd2e57223c4dc8990e --- /dev/null +++ b/steerable3dsphericalneurons/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4cb15052470060e15672f3cf1df87dec664538e3caf7d7154347caf87e25e355 +size 331410 diff --git a/steerable3dsphericalneurons/layout.json b/steerable3dsphericalneurons/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..2024c2d965728515e20dbe1fee12b91447800574 --- /dev/null +++ b/steerable3dsphericalneurons/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:41b7a45eb1da499ec6d50fb1237329dadae87ee71708133d0734e1b856c612a1 +size 513565 diff --git a/stochasticcontextualduelingbanditsunderlinearstochastictransitivitymodels/ef6d4281-6035-4853-8877-8d424befa2f8_content_list.json b/stochasticcontextualduelingbanditsunderlinearstochastictransitivitymodels/ef6d4281-6035-4853-8877-8d424befa2f8_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..0221e666699d9cd833bab4bf2d21cc0c9b127882 --- /dev/null +++ b/stochasticcontextualduelingbanditsunderlinearstochastictransitivitymodels/ef6d4281-6035-4853-8877-8d424befa2f8_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0b47b94b0e66968f9a1ed100a557f94a23582f9d099e32b99d2f4dc800e16a74 +size 183699 diff --git a/stochasticcontextualduelingbanditsunderlinearstochastictransitivitymodels/ef6d4281-6035-4853-8877-8d424befa2f8_model.json b/stochasticcontextualduelingbanditsunderlinearstochastictransitivitymodels/ef6d4281-6035-4853-8877-8d424befa2f8_model.json new file mode 100644 index 0000000000000000000000000000000000000000..86fb613e5988d366b14d441e9db3dcb93a3d6a9e --- /dev/null +++ b/stochasticcontextualduelingbanditsunderlinearstochastictransitivitymodels/ef6d4281-6035-4853-8877-8d424befa2f8_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3b29bc6236c85b07bbd1b0c110af28d6830fd9ab16c10f6b21876eda73094dfc +size 212818 diff --git a/stochasticcontextualduelingbanditsunderlinearstochastictransitivitymodels/ef6d4281-6035-4853-8877-8d424befa2f8_origin.pdf b/stochasticcontextualduelingbanditsunderlinearstochastictransitivitymodels/ef6d4281-6035-4853-8877-8d424befa2f8_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..7efe574fec28de2bfc49014d5a64f1b4c9cc1ffc --- /dev/null +++ b/stochasticcontextualduelingbanditsunderlinearstochastictransitivitymodels/ef6d4281-6035-4853-8877-8d424befa2f8_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:89dea002394fabb4badf6fb59949501518dc000d36aeb404721f5d22c50ff954 +size 3739273 diff --git a/stochasticcontextualduelingbanditsunderlinearstochastictransitivitymodels/full.md b/stochasticcontextualduelingbanditsunderlinearstochastictransitivitymodels/full.md new file mode 100644 index 0000000000000000000000000000000000000000..3b5f6df8e336ddd551240ab8db15e94fcad0dafd --- /dev/null +++ b/stochasticcontextualduelingbanditsunderlinearstochastictransitivitymodels/full.md @@ -0,0 +1,854 @@ +# Stochastic Contextual Dueling Bandits under Linear Stochastic Transitivity Models + +Viktor Bengs1 Aadirupa Saha2 Eyke Hüllermeier1 + +# Abstract + +We consider the regret minimization task in a dueling bandits problem with context information. In every round of the sequential decision problem, the learner makes a context-dependent selection of two choice alternatives (arms) to be compared with each other and receives feedback in the form of noisy preference information. We assume that the feedback process is determined by a linear stochastic transitivity model with contextualized utilities (CoLST), and the learner's task is to include the best arm (with highest latent context-dependent utility) in the duel. We propose a computationally efficient algorithm, CoLSTIM, which makes its choice based on imitating the feedback process using perturbed context-dependent utility estimates of the underlying CoLST model. If each arm is associated with a $d$ -dimensional feature vector, we show that CoLSTIM achieves a regret of order $\tilde{O}(\sqrt{dT})$ after $T$ learning rounds. Additionally, we also establish the optimality of CoLSTIM by showing a lower bound for the weak regret that refines the existing average regret analysis. Our experiments demonstrate its superiority over state-of-art algorithms for special cases of CoLST models. + +# 1. Introduction + +The multi-armed bandit (MAB) problem represents a class of online machine learning problems in which a learner can perform different actions (metaphorically referred to as "pulling arms") resulting in numerical rewards within a sequential decision process (Lattimore & Szepesvári, 2020). From a learning perspective, the main challenge of this problem is the exploration-exploitation dilemma. The learner's + +$^{1}$ Institute of Informatics, LMU Munich, Germany $^{2}$ Microsoft Research, New York City, US. Correspondence to: Viktor Bengs . + +Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s). + +lack of knowledge about the underlying reward mechanism associated with the actions forces it to try different actions often enough, so as to gradually understand these mechanisms better in the course of time (exploration). On the other side, the learner is inclined to choose actions deemed rewarding, as as to maximize the rewards cumulated over time (exploitation). + +Although this learning scenario has been used in many application areas, such as web advertising or medical treatments, it has been generalized in various ways to take specific aspects arising in practical problems into account. In many applications, for example, additional information is available about the context in which an action is performed, for instance, the user profile in web advertising or a patient's medical record. In the contextual MAB setting (Chu et al., 2011; Valko et al., 2013), an action's reward mechanism might depend on the contextual information, so that one or the other action is optimal depending on the context. + +Another practically relevant extension of the classical MAB problem is the dueling (Yue & Joachims, 2009) or preference-based (Bengs et al., 2021) bandit problem, where the learner's action is to select a pair of arms resulting in a noisy qualitative comparison between these arms (which arm generated the highest reward?) rather than selecting a single arm resulting in a numerical reward (what is the generated reward?). An example is A/B testing, where users are presented with two options from which the more preferred one should be selected, but no (meaningful) numerical reward can be measured for that choice. Although the dueling bandits problem itself—just like the standard MAB problem—has already been the starting point for various generalizations, little attention has been paid to a contextual learning scenario in the same spirit as the contextual bandits. One reason might be that, in contrast to numerical reward learning scenarios, in preference-based learning scenarios it is often far from obvious to specify basic characteristics such as the optimal (pair of) arm(s) or a practically meaningful model assumption for the feedback mechanism. + +One way to get around these issues, which we propose in this paper, is to use the so-called linear stochastic transi + +tivity (LST) models1, which enjoy great popularity in the fields of economics, behavioral science (Cattelan, 2012) with the Bradley-Terry-Luce and the Thurstone-Mosteller model being their most well-known instantiations. They are especially famous for their use in rating or ranking systems like the Elo system (Elo, 1978) or TrueSkill (Herbrich et al., 2006). These LST models describe the mechanism leading to the observation of the outcome of a comparison between two objects (choice alternatives, players, etc.) in a probabilistic way by assuming latent utility values of the objects and a noisy perception of these utility values. The probability of the outcome of the pairwise comparison, say A over B, is then equal to the probability that A's noisy utility value is greater than B's. + +# Our Contributions + +(1). Contextual dueling bandits under linear stochastic transitivity models: We tackle the contextualized dueling bandits problem and extend the class of possible contextualized feedback mechanisms beyond the contextual Plackett-Luce model by allowing it to be determined by an LST model in which the utility values of the arms (choice alternatives) depend linearly on the context. +(2). A computationally efficient and near-optimal algorithm: We construct a learning algorithm, CoLSTIM, which for the choice of its "first arm" in the duel imitates the selection mechanism of an LST model, while the choice of the second arm is tailored towards the task of regret minimization. CoLSTIM enjoys under mild assumptions a bound on its average regret of order $O(\sqrt{dT}\log (T))$ matching the minimax lower bound up to logarithmic terms. From a practical point of view, CoLSTIM is computationally more efficient than current algorithms for more restrictive assumptions on the feedback mechanism and performs quite well in numerical simulations in comparison. +(3). Stronger lower bound: We show a lower bound for weak regret—a weaker form of the usual average regret—which has the same order as the stronger average regret. This result shows that it is not possible to derive stronger regret guarantees for minimizing weak regret in the contextual dueling bandits problem. + +Outline. The paper is organized as follows. In Section 2, we recall the linear stochastic transitivity model along with all important definitions and theoretical notions. We give a formal description of the contextualized dueling problem under LST in Section 3 and propose with CoLSTIM a learning algorithm for tackling this problem, which we also analyze theoretically in the form of an upper bound on its expected average regret. In an experimental study we + +show its empirical superiority over state-of-art algorithms for special cases of LST models in Section 4. Finally, we discuss the works closest related to ours in Section 5, prior to concluding the paper with an outlook on future work in Section 6. All proofs are given in the supplementary materials. + +Notation. For $n\in \mathbb{N}$ , we denote by $[n]$ the set $\{1,\dots ,n\}$ and by $1_{[\cdot ]}$ the indicator function. We write $\| \pmb {x}\| _A = \sqrt{\pmb{x}^\top A\pmb{x}}$ for any $\pmb {x}\in \mathbb{R}^d$ and any positive semi-definite matrix $A\in \mathbb{R}^{d\times d}$ , while $\| \pmb {x}\| = \| \pmb {x}\|_{I_d}$ for $I_{d}$ being the $d\times d$ identity matrix. For symmetric matrices $A,B$ , we write $A\leq B$ if $B - A$ is positive semi-definite. Let $\mathcal{B}_r(p)$ be the $\ell_p$ ball of radius $r\geq 0$ , i.e., $\mathcal{B}_r(p) = \{\mathbf{x}\mid \| \mathbf{x}\| _p\leq r\}$ , where $\| \cdot \| _p$ denotes the standard $\ell_p$ -norm. + +# 2. Linear Stochastic Transitivity + +The linear stochastic transitivity (LST) model is a class of parameterized probability models describing the outcome of a comparison between two choice alternatives from a set of $n$ choice alternatives. An LST model has two parameters: An $n$ -dimensional parameter $\boldsymbol{u} = (u_{1},\dots,u_{n})^{\top}\in \mathbb{R}^{n}$ , where each component represents the (latent) utility of a choice alternative, and another functional parameter in the form of a symmetric cumulative distribution function $F:\mathbb{R}\to [0,1]$ called comparison function. According to an LST model, the probability that alternative $i$ is preferred over alternative $j$ , denoted by $i\succ j$ , is + +$$ +\mathbb {P} \left(1 _ {[ i > j ]} = 1\right) = F \left(u _ {i} - u _ {j}\right). \tag {1} +$$ + +Sorting Perturbed Utilities. One equivalent way to obtain the probability in (1) is as follows. Suppose $\epsilon_{i},\epsilon_{j}$ are two iid random variables with distribution $G$ and such that $\epsilon_{j} - \epsilon_{i}\sim F$ . Now let $v_{i}$ be the perturbed utility of $i$ by adding the noise term $\epsilon_{i}$ to $u_{i}$ . If $F$ is continuous, then the probability that $i$ is the choice alternative with the higher perturbed utility is exactly as in (1): + +$$ +\mathbb{P}\Big(i = \operatorname *{argmax}_{k = i,j}v_{k}\Big) = \mathbb{P}(\epsilon_{j} - \epsilon_{i}\leq u_{i} - u_{j}) = F(u_{i} - u_{j}). +$$ + +This process of sorting the perturbed utilities is a fairly intuitive way to model how a decision about preferences between two options has come about by a decision maker such as a human user or the environment. It will also be exactly this process based on the perturbation distribution $G$ that will lead to the key algorithmic idea of our approach. + +Examples. Specific choices of the perturbation distribution $G$ have gained much popularity, as the corresponding + +comparison function $F$ has a known form: + +- Bradley-Terry-Luce (BTL) model — Setting $G$ to be the standard Gumbel distribution, it is well known that the difference of two iid standard Gumbel distributed random variables is standard logistic distributed. In this case, we have $F(u_{i} - u_{j}) = \exp (u_{i}) / (\exp (u_{i}) + \exp (u_{j}))$ . +- Thurstone-Mosteller model — The distribution of the difference of two iid standard Gaussian distributed random variables is Gaussian with zero mean and variance 2. Hence, if $G$ is the standard Gaussian distribution, it holds that $F(u_{i} - u_{j}) = \Phi \left(\frac{(u_{i} - u_{j})}{\sqrt{2}}\right)$ , where $\Phi$ is the cumulative distribution function of a standard Gaussian. +- Exponential Noise — If $G$ is the exponential distribution with rate $\lambda > 0$ , then $F$ is the cumulative distribution function of a Laplace distribution with location 0 and scale $\lambda^{-1}$ . Thus, if $\operatorname{sgn}(\lambda - 1) = \frac{1}{2} + \frac{1}{2}\operatorname{sgn}(u_i - u_j)(1 - \exp(-|u_i - u_j| / \lambda))$ , + +Context Information. In order to take context information $\boldsymbol{x}_i \in \mathbb{R}^d$ about the $i^{th}$ choice alternative into account, we follow the approach by Cheng et al. (2010); Schäfer & Hüllermeier (2018) for the BTL model and replace the constant latent utility $u_i$ by a linear function of the features, leading to a contextualized LST (CoLST) model. Formally, given $n$ choice alternatives, which define a contextual decision problem, we summarize all context vectors $\boldsymbol{x}_1, \dots, \boldsymbol{x}_n$ in a matrix $\mathbf{X} \in \mathbb{R}^{d \times n}$ and define the context-dependent utilities of the choice alternatives via + +$$ +u _ {i} (\mathbf {X}) = \boldsymbol {\theta} ^ {\top} \boldsymbol {x} _ {i} = \left\langle \boldsymbol {\theta}, \boldsymbol {x} _ {i} \right\rangle , \quad \forall i = 1, \dots , n, \tag {2} +$$ + +where $\theta \in \mathbb{R}^d$ is some weight vector. With this, the probability that alternative $i$ is preferred over $j$ given the context $\mathbf{X}$ , according to a CoLST model, is + +$$ +\mathbb {P} \left(1 _ {[ i > j ]} = 1 \mid \mathbf {X}\right) = F \left(u _ {i} (\mathbf {X}) - u _ {j} (\mathbf {X})\right). \tag {3} +$$ + +The log-likelihood function $l\left(\cdot \mid 1_{[i\succ j]},\{i,j\} ,\mathbf{X}\right)$ (in short just $l(\cdot))$ for an observation $(1_{[i\succ j]},\{i,j\} ,\mathbf{X})$ is + +$$ +\begin{array}{l} \boldsymbol {l} (\boldsymbol {\theta}) = 1 _ {[ i \succ j ]} \log \left(F \left(\boldsymbol {\theta} ^ {\top} \left(\boldsymbol {x} _ {i} - \boldsymbol {x} _ {j}\right)\right)\right) \tag {4} \\ + \left(1 - 1 _ {[ i \succ j ]}\right) \log \left(F \left(\boldsymbol {\theta} ^ {\top} \left(\boldsymbol {x} _ {j} - \boldsymbol {x} _ {i}\right)\right)\right). \\ \end{array} +$$ + +The log-likelihood function can be expressed in a more convenient way, if $F$ is of an exponential family type, i.e., if for $Y = 1_{[i > j]}$ we can write $\mathbb{P}(Y|\mathbf{X})$ as + +$$ +\exp \left(\frac {Y \langle \boldsymbol {\theta} , \boldsymbol {z} _ {i , j} \rangle - \tilde {F} (\langle \boldsymbol {\theta} , \boldsymbol {z} _ {i , j} \rangle)}{v (\eta)} + c (Y, \eta)\right), \tag {5} +$$ + +where $\boldsymbol{z}_{i,j} = \boldsymbol{x}_i - \boldsymbol{x}_j$ , $\tilde{F}$ is the anti-derivative of $F$ , $\eta$ is some scale parameter and $v$ as well as $c$ are normalization functions. The comparison functions $F$ in the examples above all admit such a representation. + +# 3. Contextual Dueling Bandits + +In this section, we first introduce the problem setting prior to the suggested learning algorithm for this setting. + +# 3.1. Problem Setting + +We consider a set of $n \in \mathbb{N}_{\geq 2}$ available choice alternatives that we refer to as arms, and simply denote them by their index: $\mathcal{A} = \{1,\dots ,n\}$ . The learning problem proceeds in a time horizon $T$ , where in each time step $t \in \{1,\ldots ,T\}$ , the learner observes a context $\mathbf{X}_t = (\pmb{x}_{t,1}\dots \pmb{x}_{t,n})$ with $\pmb{x}_{t,i} \in \mathcal{X}$ for any arm $i$ , where $\mathcal{X} \subset \mathbb{R}^d$ is the context space, e.g., $\mathcal{X} = \mathcal{B}_1(2) = \{\pmb{x} \mid \| \pmb{x} \| \leq 1\}$ could be the $\ell_2$ -unit ball of radius 1. Each vector $\pmb{x}_{t,i}$ encodes features of the context in which an arm must be chosen, but possibly also of the arm $i$ itself. In other words, $\pmb{x}_{t,i}$ contains properties of both the context (determined by the environment) and the arm, for instance obtained by a joint feature map. In what follows it will turn out to be convenient to consider the contrast vectors $\pmb{z}_{t,i,j} = \pmb{x}_{t,i} - \pmb{x}_{t,j}$ and assume that we equivalently obtain in each time step the $d \times \binom{n}{2}$ dimensional contrast matrix + +$$ +\mathbf {Z} _ {t} = \left(\boldsymbol {z} _ {t, 1, 2} \boldsymbol {z} _ {t, 1, 3} \dots \boldsymbol {z} _ {t, 1, n} \boldsymbol {z} _ {t, 2, 3} \dots \boldsymbol {z} _ {t, n - 1, n}\right). +$$ + +After observing the context (or contrast) information $\mathbf{X}_t$ (or $\mathbf{Z}_t$ ), the learner selects a pair of arms $S_{t} = (i_{t},j_{t})\in [n]^{2}$ , whereupon the learner obtains preference feedback, which is either $i_t\succ j_t$ or $j_{t}\prec i_{t}$ , i.e., $i_{t}$ is preferred over $j_{t}$ or the opposite. We assume that the feedback is generated by means of a CoLST model with a known perturbation distribution $G^{*}$ (and corresponding comparison function $F^{*}$ ) and an unknown weight parameter $\theta^{*}$ . Formally, let $Y_{t} = 1_{[i_{t}\succ j_{t}]}$ be the binary feedback, then for any timestep $t\in [T]$ + +$$ +\begin{array}{l} \mathbb {P} \left(Y _ {t} = 1 \mid \mathbf {Z} _ {t}\right) = F ^ {*} \left(\left\langle \boldsymbol {z} _ {t, i _ {t}, j _ {t}}, \boldsymbol {\theta} ^ {*} \right\rangle\right) \tag {6} \\ = F ^ {*} \left(u _ {i _ {t}} ^ {*} (\mathbf {X} _ {t}) - u _ {j _ {t}} ^ {*} (\mathbf {X} _ {t})\right), \\ \end{array} +$$ + +where $u_{i}^{*}(\mathbf{X}_{t}) = \pmb{x}_{t,i}^{\top}\pmb{\theta}^{*}$ + +The goal of the learner is to select, in each time step $t$ , a pair of arms $S_{t} = (i_{t}, j_{t})$ involving the arm which is best for the current context $\mathbf{X}_{t}$ . In the realm of preference-based multi-armed bandits, the notion of a best arm can be defined in various ways (Bengs et al., 2021). In our setting, where we assume choices to be guided by a linear stochastic transitivity model (with fixed but unknown weight parameter $\theta^{*}$ ), it is natural to define the best arm for a time step $t$ by the arm with the highest (latent) utility (see (2)). More specifically, the best arm for the current time step $t$ is + +$$ +i ^ {*} (t) = \arg \max _ {i \in \mathcal {A}} u _ {i} ^ {*} (\mathbf {X} _ {t}). \tag {7} +$$ + +With this, one can leverage the two most prevalent notions of instantaneous regret a learner suffers for selecting a pair of + +arms $S_{t} = (i_{t},j_{t})$ at time $t$ from the non-contextual dueling bandits, namely the average regret and the weak regret: + +$$ +r _ {t} ^ {a} (S _ {t}, \mathbf {X} _ {t}) = \frac {2 u _ {i ^ {*} (t)} ^ {*} (\mathbf {X} _ {t}) - u _ {i _ {t}} ^ {*} (\mathbf {X} _ {t}) - u _ {j _ {t}} ^ {*} (\mathbf {X} _ {t})}{2}, +$$ + +$$ +r _ {t} ^ {w} (S _ {t}, \mathbf {X} _ {t}) = u _ {i ^ {*} (t)} ^ {*} (\mathbf {X} _ {t}) - \max _ {k \in S _ {t}} u _ {k} ^ {*} (\mathbf {X} _ {t}). +$$ + +Thus, the average and weak cumulative regret for selecting pairs $(S_{t})_{t\in [T]}$ for context information $(\mathbf{X}_t)_{t\in [T]}$ during the time horizon $T$ are, respectively, + +$$ +R _ {T} ^ {a} \left(\left(S _ {t}\right) _ {t \in [ T ]}\right) = \sum_ {\substack {t = 1 \\ T}} ^ {T} r _ {t} ^ {a} \left(S _ {t}, \mathbf {X} _ {t}\right), \tag{8} +$$ + +$$ +R _ {T} ^ {w} ((S _ {t}) _ {t \in [ T ]}) = \sum_ {t = 1} ^ {T} r _ {t} ^ {w} (S _ {t}, \mathbf {X} _ {t}). +$$ + +It holds that $R_T^w((S_t)_{t \in [T]}) \leq R_T^a((S_t)_{t \in [T]}),$ so that a learner with theoretical guarantees for the average regret satisfies theoretical guarantees for the weak regret as well. However, being a weaker notion of regret, the weak regret may permit stronger theoretical guarantees than average regret. Saha (2021) has shown a lower bound of order $\Omega(\sqrt{dT})$ for the average regret, and the following result shows that this bound also holds for the weak regret, indicating that stronger theoretical guarantees cannot be obtained for weak regret learners. + +Theorem 3.1. For any learning algorithm $\mathcal{A}$ for the contextual dueling bandits problem under linear stochastic transitivity models in dimension $d$ , there exists an instance of the problem characterized by a weight vector $\pmb{\theta}^{*} \in \mathcal{B}_{1}(2)$ , context space $\mathcal{X} \subseteq \mathcal{B}_1(\infty)$ , and a comparison function $F: \mathbb{R} \to [0,1]$ , such that the expected weak regret incurred by $\mathcal{A}$ in any $T > \max(d, 16)$ rounds is + +$$ +\mathbb {E} \left[ R _ {T} ^ {w} \left(\left(S _ {t} ^ {\mathcal {A}}\right) _ {t \in [ T ]}\right) \right] = \Omega \left(d \sqrt {T}\right). +$$ + +Further, if we restrict $\mathcal{X} \subseteq \mathcal{B}_1(2)$ , then + +$$ +\mathbb {E} \left[ R _ {T} ^ {w} \left(\left(S _ {t} ^ {\mathcal {A}}\right) _ {t \in [ T ]}\right) \right] = \Omega \left(\sqrt {d T}\right). +$$ + +It is worth noting that our proof of Theorem 3.1 does not use a reduction to contextual linear bandits as the proof by Saha (2021) for the average regret (see Theorem 10), but is rather based on a direct proof technique (see Section B in the supplementary material). + +# 3.2. CoLST Imitator + +At the core of the learning task is the estimation of the unknown weight parameter $\theta^{*}$ , which basically determines the underlying CoLST model of the feedback mechanism. Assuming that we have a compact parameter space $\Theta$ such that $\theta^{*} \in \Theta$ , the arguably most natural way to derive an estimate is to use the maximum likelihood estimate (MLE): + +$$ +\hat {\boldsymbol {\theta}} _ {t} \in \operatorname {a r g m a x} _ {\boldsymbol {\theta} \in \Theta} \sum_ {s = 1} ^ {t - 1} l (\boldsymbol {\theta} \mid Y _ {s}, \left\{i _ {s}, j _ {s} \right\}, \mathbf {X} _ {s}). \tag {9} +$$ + +If the log-likelihood function is of the form (5), then $\hat{\theta}_t$ can be computed by solving + +$$ +0 = \sum_ {s = 1} ^ {t - 1} \left(Y _ {s} - F \left(\left\langle \boldsymbol {z} _ {s, i _ {s}, j _ {s}}, \boldsymbol {\theta} \right\rangle\right)\right) \boldsymbol {z} _ {s, i _ {s}, j _ {s}}. \tag {10} +$$ + +Equipped with an estimate of the underlying weight parameter, the question now becomes how to choose an appropriate pair of arms to deal with the exploration-exploitation trade-off. Our approach is essentially to imitate the choice process of the underlying CoLST model using the current estimator and their confidence widths to generate perturbed, context-dependent utilities giving rise to our CoLST Imitator (CoLSTIM) algorithm (see Algorithm 1). + +Algorithm 1 CoLSTIM + +1: Input: Exploration length $\tau > 0$ , perturbation distribution $G$ with induced comparison (or cumulative distribution) function $F$ , threshold $C_{\mathrm{thresh}} > 0$ , coupling probabilities $(p_t)_t$ , confidence width constant $c_1 > 0$ +2: Initialization: Randomly choose $\{i_t,j_t\} \subset [n]$ for $\tau$ many time steps +3: Set $\mathbf{M}_{\tau +1} = \sum_{s = 1}^{\tau}\pmb {z}_{s,i_s,j_s}\pmb{z}_{s,\bar{i}_s,j_s}^\top$ +4: for $t = \tau + 1, 2, \dots, T$ do +5: Observe context vectors $\mathbf{X}_t = (\pmb{x}_{t,1}\dots \pmb{x}_{t,n})$ +6: Compute MLE $\hat{\theta}_t$ via (9) (or (10)) +7: Sample $B_{t} \sim \mathrm{Ber}(p_{t})$ +8: if $B_{t} = 1$ then +9: Sample $\tilde{e}_{t,i} \sim G$ for each $i \in [n]$ +10: else +11: Sample $\tilde{\epsilon} \sim G$ and set $\tilde{\epsilon}_{t,i} = \tilde{\epsilon}$ for each $i \in [n]$ . +12: end if +13: $\epsilon_{t,i} = \min (C_{\mathrm{thresh}},\max (-C_{\mathrm{thresh}},\tilde{\epsilon}_{t,i}))\forall i\in [n]$ +14: $i_{t} = \arg \max_{i\in [n]}\pmb{x}_{t,i}^{\top}\hat{\pmb{\theta}}_{t} + \epsilon_{t,i}\| \pmb{x}_{t,i}\|_{\mathbf{M}_{t}^{-1}}$ +15: $j_{t} = \arg \max_{i\in [n]}\langle \pmb{z}_{t,i,i_{t}},\hat{\pmb{\theta}}_{t}\rangle +c_{1}\| \pmb{z}_{t,i_{t},i}\|_{\mathbf{M}_{t}^{-1}}$ +16: Choose $(i_t,j_t)$ and observe $Y_{t} = 1_{[i_{t}\succ j_{t}]}$ +17: Update $\mathbf{M}_{t + 1}\gets \mathbf{M}_t + \pmb {z}_{t,i_t,j_t}\pmb{z}_{t,i_t,j_t}^\top$ +18: end for + +More specifically, we first generate additive noise terms by sampling for each arm a random observation of the underlying perturbation distribution $G$ and multiply it with the corresponding confidence width. Due to technical reasons we need to (a) threshold the generated perturbation variables from above (and below) by means of some constant $C_{\mathrm{thresh}}$ (and $-C_{\mathrm{thresh}}$ ), and (b) use the same perturbation variable with a sufficient high probability (coupling). These additive noise terms are added to the current utility estimates resulting in perturbed, context-dependent utilities, which in turn specify our imitated CoLST model. The arm having the largest perturbed context-dependent utilities is used as the "first arm" $i_t$ for the action pair, as this one is most likely to win any duel according to our imitated CoLST model. Roughly speaking, the multiplication of the generated per + +turbation variables with the confidence widths (of the current estimate) takes the degree of accuracy of the imitated CoLST model into account. The "second arm" $j_{t}$ is chosen as the first arm's toughest competitor, i.e., the arm that has the highest (optimistic) chance to win the duel against the latter according to the current upper confidence width (represented by $c_{1}\| \pmb{z}_{t,i_{t},i}\|_{\mathbf{M}_{t}^{-1}}$ ). Such a choice mechanism for the second arm is common in the realm of non-contextual dueling bandits and is tailored towards the task of average regret minimization (Bengs et al., 2021). + +The underlying idea of choosing the first arm is inspired by randomized exploration strategies used in the follow-the-perturbed-leader approach (Kim & Tewari, 2019) or the RandUCB algorithm (Vaswani et al., 2020) for numerical bandit problems. However, in our preference-based setting, we have to deal with a more complex action space leading to a different theoretical analysis. In addition, unlike the numerical setting, we do not necessarily need to adopt the optimism in the face of uncertainty principle in the sense that only positive perturbation values need to be sampled. Finally, thanks to the underlying CoLST model, we have a natural candidate for the perturbation distribution. + +# 3.2.1. NEAR-OPTIMALITY + +For our theoretical analysis of CoLSTIM, we make the following assumptions: + +(A1) $\mathcal{X} = \mathcal{B}_1(2)$ and there exist basis vectors $\{b_j\}_{j=1}^d \subset \{\pmb{x}_{t,i}\}_{i=1}^n$ such that $\rho \pmb{I}_d \leq \sum_{j=1}^d b_j b_j^\top$ for some $\rho > 0$ , i.e., the context vectors span the $d$ -dimensional Euclidean space. + +(A2) There exists some $L > 0$ such that the derivative of the comparison function $F^{*}$ is $L$ -Lipschitz continuous, i.e., $\left|(F^{*})'(x) - (F^{*})'y\right| \leq L|x - y|$ for any $x, y \in \mathbb{R}$ . Moreover, + +$$ +\mu := \inf \left\{\left(F ^ {*}\right) ^ {\prime} \left(\boldsymbol {x} ^ {\top} \boldsymbol {\theta}\right) \mid \| \boldsymbol {x} \| \leq 2, \| \boldsymbol {\theta} - \boldsymbol {\theta} ^ {*} \| \leq 1 \right\} > 0. +$$ + +These assumptions are quite common in the realm of contextual bandits (Li et al., 2017; Vaswani et al., 2020). Note that assumption (A2) holds for the comparison functions of the prominent LST models such as the Bradley-Terry-Luce and the Thurstone-Mosteller model (see Section 2). We obtain the following theoretical guarantees for CoLSTIM (proven in Section C in the supplementary material). + +Theorem 3.2. Let $c_{1} = \frac{1}{2\mu}\sqrt{d\log(T / d) + 2\log(T)}$ and $\tau = d + \max \left\{ \frac{d^2\log(T)}{\mu^2\rho}, \frac{d}{\rho} \right\}$ . Further, let $c_{2} \in (0, c_{1}]$ be some constant, and for any time step $t$ , set $p_{t} = \min \left( 1, \frac{\sqrt{2d}}{2\sqrt{t - \tau}} \left( 3c_{1} + c_{2} \right) \sqrt{\log \left( \frac{2T}{d} \right)} \right)$ . For any $C_{\mathrm{thresh}} \in (0, c_{2})$ , it holds that the expected cumulative average regret of CoLSTIM is in $O(d\sqrt{T}\log (T))$ for any CoLST model with weight vector $\pmb{\theta}^{*}$ such that $\| \pmb{\theta}^{*} \| \in \mathcal{B}_{1}(2)$ and comparison function $F^{*}$ satisfying assumption (A2), and any $(\mathbf{X}_t)_{t \in [T]}$ satisfying assumption (A1). + +If we make an additional assumption on the smallest eigenvalues of the Gram matrix $\mathbf{M}_t$ , we can show a bound $\tilde{O}(\sqrt{dT})$ almost matching (up to logarithmic terms) the lower bound $\Omega(\sqrt{dT})$ shown by Saha (2021). The proof is deferred to Section C in the supplementary material. + +Corollary 3.3. Under the assumptions of Theorem 3.2 and if $\sum_{t = \tau +1}^{T}\lambda_{\mathrm{min}}^{-1 / 2}(\mathbf{M}_t)\leq c\sqrt{T}$ , where $c$ is some positive constant and $\lambda_{\mathrm{min}}(A)$ denotes the smallest eigenvalue of a square matrix $A$ , the expected cumulative average regret of CoLSTIM is in $O(\sqrt{dT}\log (T))$ . + +The condition on the Gram matrix in the Corollary 3.3 is satisfied if the context vectors are dense (Li et al., 2017). + +Algorithm 2 SUP-COLSTIM +1: Input: $\tau > 0, G, F, C_{\mathrm{thresh}} > 0, p_t \in [0,1], c_1 > 0$ +2: Initialization: Same as in CoLSTIM +3: Set $S = \lfloor \log_2 T \rfloor$ , $\Psi^{(0)} = \emptyset$ , $\Psi^{(1)} = \ldots = \Psi^{(S)} = [\tau]$ +4: for $t = \tau + 1, 2, \ldots, T$ do +5: Observe context vectors $\mathbf{X}_t = (\mathbf{x}_{t,1} \ldots \mathbf{x}_{t,n})$ +6: Set $s = 1$ and $A_t^{(s)} = [n]$ +7: while $i_t, j_t$ not found do +8: Compute MLE $\hat{\theta}_t^{(s)}$ via (9) (or (10)) using only data from the time steps in $\Psi^{(s)}$ +9: Set $\mathbf{M}_t^{(s)} = \sum_{l \in \Psi^{(s)}} \mathbf{z}_{l,i_l,j_l} \mathbf{z}_{l,i_l,j_l}^{\top}$ +10: Set $w_{i,j}^{(s)}(\mathbf{X}_t) = c_1 \| \mathbf{z}_{t,i,j} \|_{(\mathbf{M}_t^{(s)})^{-1}} \forall i, j \in [n]$ +11: if $w_{i,j}^{(s)}(\mathbf{X}_t) \leq 1 / \sqrt{T}$ , $\forall i, j \in A_t^{(s)}$ then +12: Sample $\epsilon_{t,i} \forall i \in [n]$ as in lines 7-13 of Alg.1 +13: $\Psi^{(0)} = \Psi^{(0)} \cup \{t\}$ +14: $i_t = \arg \max_{i \in A_t^{(s)}} \mathbf{x}_{t,i}^{\top} \hat{\boldsymbol{\theta}}_t^{(s)} + \epsilon_{t,i} \| \mathbf{x}_{t,i} \|_{(\mathbf{M}_t^{(s)})^{-1}}$ +15: $j_t = \arg \max_{i \in A_t^{(s)}} \langle z_{t,i,i_t}, \hat{\boldsymbol{\theta}}_t^{(s)} \rangle + w_{t,i_t,j}^{(s)}(\mathbf{X}_t)$ +16: else if $w_{i,j}^{(s)}(\mathbf{X}_t) \leq 1 / 2^s$ , $\forall i, j \in A_t^{(s)}$ then +17: $A_t^{(s+1)} = \{i \in A_t^{(s)} | x_{t,i}^{\top} \hat{\boldsymbol{\theta}}_t^{(s)} + 2^{-s} \geq \max_{j \in A_t^{(s)}} x_{t,j}^{\top} \hat{\boldsymbol{\theta}}_t^{(s)}\}$ +18: $s \gets s + 1$ +19: else +20: $\Psi^{(s)} = \Psi^{(s)} \cup \{t\}$ +21: Choose $(i_t, j_t)$ uniformly at random from $\{i, j \in A_t^{(s)} | w_{i,j}^{(s)}(\mathbf{X}_t) > 1 / 2^s\}$ +22: end if +23: end while +24: Choose $(i_t, j_t)$ and observe $Y_t = 1_{[i_t > j_t]}$ +25: end for + +Note that the theoretical results in fact do not depend on the knowledge of the true perturbation distribution $G^{*}$ , but rather it is sufficient to know the true comparison function $F^{*}$ . Finally, it is worth noting that the threshold $C_{\mathrm{thresh}}$ can be made arbitrarily small, while the theoretical results will + +still hold (as long as $c_2$ is not even smaller). In this case, the choice of the first arm $i_t$ would essentially correspond to a greedy choice, which prevents exploration from the outset. However, thanks to the (optimistic) choice mechanism of the second arm $j_t$ , the algorithm would still explore (i.e., learn about the structure of the bandit problem) and not "get stuck". + +# 3.2.2. SUP-COLST IMITATOR + +By adapting the technique introduced by Auer (2002) for the underlying learning scenario (cf. (Chu et al., 2011; Li et al., 2017; Xue et al., 2020)), we can extend the CoLSTIM algorithm to Sup-CoLSTIM (Algorithm 2) in order to obtain a regret bound of order $\tilde{O} (\sqrt{dT\log(n)})$ without making an additional assumptions on the Gram matrix as in Corollary 3.3. The idea is to embed the choice mechanism of CoLSTIM into a stage-wise approach which keeps track of "sufficiently accurately estimated promising arms" (cf. Section 3.2 in (Saha, 2021)). + +Theorem 3.4. Let $c_{1} = \frac{3}{2\mu}\sqrt{2\log(3nT^{2})}$ and $\tau$ as in Theorem 3.2. Further, let $c_{2} \in (0, c_{1}]$ be some constant and $p_{t}$ be as in Theorem 3.2. Under the assumptions of Theorem 3.2, it holds for any $C_{\mathrm{thresh}} < c_{2}$ that the expected cumulative average regret of SUP-COLSTIM is in $O(\sqrt{dT\log(n)}\log^{3 / 2}(T))$ . + +To the best of our knowledge, this is the first time that the technique introduced by Auer (2002) is combined with a randomized learning strategy and analyzed theoretically (see Section D in the supplementary material for the proof). + +# 3.2.3. COMPUTATIONAL ASPECTS + +It is evident that the computation of the MLE involves a computationally expensive operation, as the entire history is used for this estimation step—an issue shared by most of the algorithms for logistic bandits (Filippi et al., 2010; Li et al., 2017; Vaswani et al., 2020) or stochastic contextual dueling bandits (Saha, 2021). However, instead of optimizing the (log-)likelihood function based on the entire history in each time step, we could also optimize the (log-)likelihood function more efficiently in an online manner using stochastic gradient descent. More precisely, we could replace line 6 in Algorithm 1 (and line 9 in Algorithm 2 accordingly) by + +$$ +\hat {\pmb {\theta}} _ {t} \gets \hat {\pmb {\theta}} _ {t - 1} + \eta_ {t} \nabla l \big (\hat {\pmb {\theta}} _ {t - 1} \mid Y _ {t - 1}, \{i _ {t - 1}, j _ {t - 1} \}, \mathbf {X} _ {t - 1} \big) +$$ + +for some suitable parameter $\eta_t > 0$ (learning rate). Although the theoretical guarantees shown do not hold for this SGD variant, we do not see much of a difference regarding the regret in our experiments by using the SGD variant instead of maximizing the likelihood on the entire history of data in each time step (see Section E). However, we see a clear advantage of the former over the latter with respect to the cumulative elapsed time to make a choice. It is worth + +mentioning that the computational costs of CoLSTIM's arm selection (lines 7-15) is quite low due to the simple form of the two maximization problems to be solved. + +# 4. Experiments + +In this section, we present experimental results for our learning algorithm for the contextual dueling bandits setting for the two most prominent LST models, namely the Bradley-Terry-Luce (BTL) model and the Thurstone-Mosteller (TM) model. We compare our approach with Double-Thompson Sampling (DTS) (Wu & Liu, 2016) and Self-Sparring (SS) with independent beta priors for each arm (Sui et al., 2017), which are state-of-the-art algorithms for the non-contextual dueling bandits setting, as well as Maximum-Informative-Pair (MaxInP) (Saha, 2021), which is suitable for the contextual dueling bandits setting under the contextualized BTL model. Moreover, we include the random choice strategy (Random), which is choosing the pair of arms in each time step uniformly at random. For DTS and SS, we used the same hyperparameters as in the corresponding experiments, while for MaxInP, we simply use $t_0 = dn$ and $\eta = \sqrt{d\log(T)}$ , as the hyperparameters are not reported in the experiments by Saha (2021). Note that our choices are simplified versions of the parameters for which the theoretical guarantees hold. For CoLSTIM, we use $\tau = t_0$ and $c_1 = C_{\mathrm{thresh}} = \eta$ , as $\tau$ has a similar role as $t_0$ and $c_1$ or $C_{\mathrm{thresh}}$ have a similar role as $\eta$ , respectively. For the coupling probability $p_t$ of CoLSTIM, we use a simplified version of the one derived in Theorem 3.2, namely $p_t = \min \left(1, \frac{d}{\sqrt{t - \tau}}\log(dT)\right)$ . In every experiment, the performances of the algorithms are measured in terms of cumulative average regret (cf. (8)), averaged across 100 runs and reported with their standard deviation. Moreover, for both MaxInP and CoLSTIM, we use the SGD-based variant described in Section 3.2 with a fixed learning rate of $\eta_t = 1/2$ . For a comparison of the SGD-based variant and the "full MLE" variants see Section E. We omit SupCoLSTIM and Sta'D (Saha, 2021) since it is known that algorithms adopting the stage-wise approach of Auer (2002) tend to perform poorly in numerical simulations. All these experiments were conducted on a machine featuring an Intel(R) Xeon E5-2670 @2.6GHz with 16 cores and 64 GB of RAM. + +# 4.1. Contextual Setting + +Recall that a problem instance $P$ in our setting is specified by the number of available arms $n$ , the dimension of the context vectors $d$ , the perturbation distribution $G^{*}$ and the weight parameter $\pmb{\theta}^{*}$ , such that we accordingly write $P = P(n,d,G,\pmb{\theta}^{*})$ . Following Saha (2021), for fixed $n,d,G^{*}$ we distinguish three problem scenarios with respect to the $\ell_2$ -norm of the weight parameter $\pmb{\theta}^{*}$ : + +![](images/379acf2d074734e33577877c3b80a1e23cc5d73156d06eda31e64a3cca9c175d.jpg) +easy, $d = 10$ , $n = 50$ + +![](images/b35d467e3948999f810f85a3fc7855510c5f08367e37e70d2a80989f8924e080.jpg) +medium, $d = 10$ , $n = 50$ + +![](images/41a9ae0978fb746b376b238f53a00a6e0894cd243a03102638639ca02f91cf04.jpg) +hard, $d = 10$ , $n = 50$ + +![](images/495972df09b4a7d0da10507a8c352284d43f1cf5a69dc5072c92092d975d047d.jpg) +easy, $d = 10$ , $n = 50$ + +![](images/3ca6aaeb571adc83c11ad68ba978ed85a5f58942556267d67d2475e0fd005682.jpg) +medium, $d = 10$ , $n = 50$ + +![](images/4f963da13779e104fbefc0dc42ee93abed8c0a90cb1a1b4c7c29ed9c564a8ccf.jpg) +hard, $d = 10$ , $n = 50$ +Figure 1. Top panel: Averaged cumulative regret of the different methods on $E(d,n,G^{*})$ (left), $M(d,n,G^{*})$ (middle) and $H(d,n,G^{*})$ (right) for $G^{*}$ being standard Gumbel. Bottom panel: Averaged cumulative regret of the different methods on $E(d,n,G^{*})$ (left), $M(d,n,G^{*})$ (middle) and $H(d,n,G^{*})$ (right) for $G^{*}$ being the standard normal distribution. + +$E(d,n,G^{*}) = \bigcup_{\| \pmb{\theta}^{*}\| < 1 / \sqrt{d}}P(n,d,G^{*},\pmb{\theta}^{*});$ +- $M(d, n, G^{*}) = \bigcup_{1/\sqrt{d} < \| \pmb{\theta}^{*} \| \leq 1} P(n, d, G^{*}, \pmb{\theta}^{*})$ ; +- $H(d,n,G^{*}) = \bigcup_{1\leq \| \pmb{\theta}^{*}\| \leq \sqrt{d}}P(n,d,G^{*},\pmb{\theta}^{*}).$ + +which we refer to as the easy, medium and hard problem scenario, respectively. + +Table 1. Averaged cumulative runtimes (in seconds) and the corresponding standard deviations (in brackets) of the different methods for the different problem scenarios. + +
G* = GumbelE(d,n,G*)M(d,n,G*)H(d,n,G*)
Random0.19 (0.02)0.18 (0.01)0.18 (0.01)
MaxInP164.58 (6.58)155.54 (4.92)155.51 (3.49)
COLSTIM7.44 (0.51)7.08 (0.41)6.98 (0.17)
SS9.92 (0.66)9.43 (0.56)9.39 (0.22)
DTS52.01 (2.63)49.73(2.04)50.15 (1.08)
G* = GaussianE(d,n,G*)M(d,n,G*)H(d,n,G*)
Random0.19 (0.02)0.18 (0.02)0.18 (0.02)
MaxInP159.33 (6.00)157.70 (8.54)156.56 (7.48)
COLSTIM7.09 (0.38)7.05 (0.51)7.03 (0.48)
SS9.49 (0.50)9.47 (0.67)9.47 (0.60)
DTS50.94 (2.45)50.19 (2.99)49.93 (2.69)
+ +In each run on one of the scenarios, the weight parameters are sampled uniformly at random from the corresponding + +subset of the $\ell_2$ -Ball, while the context vectors are sampled uniformly at random from $\mathcal{B}_1(2)$ , i.e., the unit $\ell_2$ -Ball, for each time step $t$ within one run. + +The results for $G^{*}$ being the standard Gumbel distribution are illustrated in the top panel of Figure 1, while the bottom panel of Figure 1 shows the results for $G^{*}$ being the standard normal distribution, both for $n = 50$ and $d = 10$ . Our CoLSTIM method using the corresponding perturbation distribution $G = G^{*}$ outperforms the other methods in all scenarios, while MaxInP performs only slightly better than the naive random selection strategy. Unsurprisingly, the noncontextual methods DTS and SS are hardly distinguishable from the latter. + +Table 1 reports the averaged cumulative runtimes and the corresponding standard deviations of each of the considered methods for making the choice of the pairs (i.e., the MLE step for CoLSTIM and MaxInP are neglected). The results confirm the discussion in Section 1 regarding the computational efficiency of CoLSTIM's choice mechanism, which, quite interestingly, is competitive to the noncontextual methods. + +![](images/24481678bf8d55d3e14c7dc711dbaa783ce546fe796d475c8949b223399c5dcb.jpg) + +![](images/df05b51174223754b1ababa629c85ff001599312a1bec330dfb58a2dd5577c88.jpg) + +![](images/704f1d62a99f5d34bb1cebff05ec89dd6ced7152adc726ce0f001622147f3d55.jpg) + +![](images/012fafd9ef43ca6ea06d6f4658e54406a068c08a8bdef14f8a51e0b178e15f60.jpg) +Figure 2. Top panel: Averaged cumulative regret of the different methods on $E(d,n,G^{*})$ (left), $M(d,n,G^{*})$ (middle) and $H(d,n,G^{*})$ (right) for $G^{*}$ being standard Gumbel. Bottom panel: Averaged cumulative regret of the different methods on $E(d,n,G^{*})$ (left), $M(d,n,G^{*})$ (middle) and $H(d,n,G^{*})$ (right) for $G^{*}$ being the normal distribution with zero and variance 5. Here, CoLSTIM is used with $G$ being the standard normal distribution (misspecification). + +![](images/abe600d601dd6b19fca35e59d27b3195a0a28e9580e501ef5ac2f1a5d5eb5565.jpg) + +![](images/f08a6fd92317450a6a46f29f817e92c022733bd299f7b70c881099274d398651.jpg) + +# 4.2. Misspecification + +Given the results of the previous section, one may wonder how sensitive our CoLSTIM method is to misspecification of the perturbation distribution $G$ , i.e., how it performs when $G \neq G^{*}$ ? To this end, we repeat the experiments for the easy, medium and hard problem instances with $G^{*}$ being the standard Gumbel distribution, while the CoLSTIM method is used with $G$ being the standard normal distribution. Note that MaxInP is designed for exactly this case, in which the perturbation distribution of the underlying CoLST feedback model is the standard Gumbel distribution, so that MaxInP is in a favorable position. The top panel in Figure 2 illustrates the result for this setting, which shows a similar picture as Figure 1, where no misspecification is present. + +Finally, we also consider the case where there is an incorrect specification of the parameters in the correct parametric distribution family. More specifically, the bottom panel shows the result of the experiments for the easy, medium and hard problem instances with $G^{*}$ being the normal distribution with zero mean and variance 5 and CoLSTIM still uses the standard normal distribution for $G$ . Although our algorithm now performs slightly worse and also has a higher variance, + +it still performs better than the other algorithms as they still do not show a convergence behavior at all, and our algorithm will probably outperform them eventually for longer time horizons $T$ . + +# 5. Related Work + +So far, a contextualized extension of preference-based bandits with pairwise comparisons (i.e., dueling bandits) has only been studied explicitly by Dudík et al. (2015) and recently by Saha (2021). In the former work, it is assumed that the learner has access to a space of learning policies from which the contextualized von Neumann winner should be found. This learning setting is different from ours, due to the absence of a learning policy space. Saha (2021) assumes a latent linear utility score for each arm as well as a logit link function for modeling the feedback governed by the pairwise preference probabilities. This modeling assumption is a special case of the linear stochastic transitivity models considered in this paper and corresponds to the (contextualized) Bradley-Terry-Luce model. Nevertheless, a lower bound for the regret in this special case of order $\Omega(\sqrt{dT})$ is derived, which is also a lower bound for our + +more general setting. Further, two learning algorithms are suggested and theoretically analyzed, which both essentially use the pair of arms having the highest uncertainty in each round. Our proposed learning algorithm, however, uses the idea of randomized learning strategies, which have gained popularity in reward-based bandit problems in recent years (see Vaswani et al. (2020) for a detailed overview). This can be attributed to the fact that, unlike the well-known Thompson sampling algorithm, no closed posterior distribution is needed, but only a sampling distribution. + +Finally, it should be mentioned that the utility-based dueling bandits learning scenario with infinitely many arms, where each arm is a $d$ -dimensional point, is closely related to the learning scenario considered here. In fact, in the latter scenario, if only $K$ many arms, which can vary, are allowed to be selected in each learning round, this corresponds to the contextual learning scenario considered here. However, not all learning algorithms are directly amenable to this adaptation (Yue & Joachims, 2009), or if they are, they no longer have theoretical guarantees (Ailon et al., 2014; Kumagai, 2017), or even did not have them before (González et al., 2017). + +# 6. Conclusion and Future Work + +We studied the contextualized version of theueling bandits problem under linear stochastic transitivity models and proposed an algorithm for effective learning in this setting. The algorithm is inspired by randomized learning strategies for numerical bandit problems and has both satisfactory regret bounds as well as excellent numerical performance. In addition, we have also shown a lower bound on the weak regret, which is of the same order as for the average regret. This indicates that stronger theoretical guarantees in the worst case sense cannot be obtained for weak regret learners. + +For future work, an extension to more general action sets than pairs of arms would be interesting from both a theoretical and a practical point of view as considered by recent works (Brost et al., 2016; Saha & Gopalan, 2018; 2019; Bengs & Hüllermeier, 2020; Agarwal et al., 2020). Context-dependent random utility models (Train, 2009) could be a practically meaningful counterpart for linear stochastic transitivity models. Another interesting question would be whether one could replace the linearity assumption on the latent utility values with more general assumptions such as a kernel-based correlation as considered by Sui et al. (2017) for the non-contextual dueling bandits setting. Although our experiments show that our proposed method is robust to misspecification of the perturbation distribution and the corresponding comparison function, one could imagine learning this perturbation distribution online as well. For this purpose, the work by Oliveira et al. (2018) could be relevant, which, however, deals with the batch learning scenario. + +Yet another interesting question would be to investigate whether Assumption (A1) can be relaxed to an assumption like in (Li et al., 2017), which is also used by MaxInP (Saha, 2021). Last but not least, it would certainly be worthwhile to investigate the performance of our suggested algorithm in real-world applications, e.g., in realtime algorithm configuration or online learning-to-rank problems for which preference-based bandit algorithms have been used before (Brost et al., 2016; Schuth et al., 2016; Oosterhuis et al., 2016; Zhao & King, 2016; Schäfer & Hüllermeier, 2018; El Mesaoudi-Paul et al., 2020). + +# ACKNOWLEDGMENTS + +The authors would like to thank the Paderborn Center for Parallel Computation (PC2) for the use of the OCuLUS cluster. + +# References + +Abbasi-Yadkori, Y., Pál, D., and Szepesvári, C. Improved algorithms for linear stochastic bandits. In Proceedings of Advances in Neural Information Processing Systems (NeurIPS), pp. 2312-2320, 2011. +Agarwal, A., Johnson, N., and Agarwal, S. Choice bandits. In Proceedings of Advances in Neural Information Processing Systems (NeurIPS), volume 33, pp. 18399-18410, 2020. +Ailon, N., Karnin, Z., and Joachims, T. Reducing dueling bandits to cardinal bandits. In Proceedings of the International Conference on Machine Learning (ICML), pp. 856-864, 2014. +Auer, P. Using confidence bounds for exploitation-exploration trade-offs. The Journal of Machine Learning Research, 3:397-422, 2002. +Bengs, V. and Hüllermeier, E. Preselection bandits. In Proceedings of the International Conference on Machine Learning (ICML), pp. 778-787, 2020. +Bengs, V., Busa-Fekete, R., El Mesaoudi-Paul, A., and Hüllermeier, E. Preference-based online learning with dueling bandits: A survey. The Journal of Machine Learning Research, 22(7):1-108, 2021. +Brost, B., Seldin, Y., Cox, I. J., and Lioma, C. Multidueling bandits and their application to online ranker evaluation. In Proceedings of ACM International Conference on Information and Knowledge Management (CIKM), pp. 2161-2166, 2016. +Cattelan, M. Models for paired comparison data: A review with emphasis on dependent data. Statistical Science, 27 (3):412-433, 2012. + +Cheng, W., Hüllermeier, E., and Dembczynski, K. J. Label ranking methods based on the Plackett-Luce model. In Proceedings of the International Conference on Machine Learning (ICML), pp. 215-222, 2010. +Chu, W., Li, L., Reyzin, L., and Schapire, R. E. Contextual bandits with linear payoff functions. In International Conference on Artificial Intelligence and Statistics (AISTATS), pp. 208-214, 2011. +Dudík, M., Hofmann, K., Schapire, R. E., Slivkins, A., and Zoghi, M. Contextual dueling bandits. In Proceedings of the Annual Conference on Learning Theory (COLT), pp. 563-587, 2015. +El Mesaoudi-Paul, A., Weiß, D., Bengs, V., Hüllermeier, E., and Tierney, K. Pool-based realtime algorithm configuration: A preselection bandit approach. In International Conference on Learning and Intelligent Optimization, pp. 216-232. Springer, 2020. +Elo, A. E. The Rating of Chessplayers, Past and Present. Arco Publishing, 1978. +Filippi, S., Cappe, O., Garivier, A., and Szepesvári, C. Parametric bandits: The generalized linear case. In Proceedings of Advances in Neural Information Processing Systems (NeurIPS), volume 23, pp. 586-594, 2010. +González, J., Dai, Z., Damianou, A., and Lawrence, N. D. Preferential Bayesian optimization. In Proceedings of the International Conference on Machine Learning (ICML), pp. 1282-1291, 2017. +Herbrich, R., Minka, T., and Graepel, T. Trueskill: A Bayesian skill rating system. In Proceedings of Advances in Neural Information Processing Systems (NeurIPS), pp. 569-576, 2006. +Hunter, D. R. MM algorithms for generalized Bradley-Terry models. The Annals of Statistics, 32(1):384-406, 2004. +Jin, T., Xu, P., Gu, Q., and Farnoud, F. Rank aggregation via heterogeneous Thurstone preference models. In Proceedings of the AAAI Conference on Artificial Intelligence (AAAI), volume 34, pp. 4353-4360, 2020. +Kim, B. and Tewari, A. On the optimality of perturbations in stochastic and adversarial multi-armed bandit problems. In Proceedings of Advances in Neural Information Processing Systems (NeurIPS), pp. 2695-2704, 2019. +Kumagai, W. Regret analysis for continuous dueling bandit. In Proceedings of Advances in Neural Information Processing Systems (NeurIPS), pp. 1488-1497, 2017. +Lattimore, T. and Szepesvári, C. Bandit Algorithms. Cambridge University Press, 2020. + +Li, L., Lu, Y., and Zhou, D. Provably optimal algorithms for generalized linear contextual bandits. In Proceedings of the International Conference on Machine Learning (ICML), pp. 2071-2080. PMLR, 2017. +Oliveira, I. F., Ailon, N., and Davidov, O. A new and flexible approach to the analysis of paired comparison data. The Journal of Machine Learning Research, 19(1): 2458-2486, 2018. +Oosterhuis, H., Schuth, A., and de Rijke, M. Probabilistic multileave gradient descent. In Proceedings of European Conference on Information Retrieval (ECIR), pp. 661-668, 2016. +Popescu, P. G., Dragomir, S., Slusanschi, E. I., and Stanašila, O. N. Bounds for Kullback-Leibler divergence. *Electronic Journal of Differential Equations*, 2016, 2016. +Saha, A. Optimal algorithms for stochastic contextual preference bandits. In Proceedings of Advances in Neural Information Processing Systems (NeurIPS), volume 34, pp. 30050-30062, 2021. +Saha, A. and Gopalan, A. Battle of bandits. In Proceedings of Conference on Uncertainty in Artificial Intelligence (UAI), pp. 805-814, 2018. +Saha, A. and Gopalan, A. Combinatorial bandits with relative feedback. pp. 983-993, 2019. +Schäfer, D. and Hüllermeier, E. Dyad ranking using Plackett-Luce models based on joint feature representations. Machine Learning, 107(5):903-941, 2018. +Schuth, A., Oosterhuis, H., Whiteson, S., and de Rijke, M. Multileave gradient descent for fast online learning to rank. In Proceedings of ACM International Conference on Web Search and Data Mining (WSDM), pp. 457-466, 2016. +Sui, Y., Zhuang, V., Burdick, J. W., and Yue, Y. Multidueling bandits with dependent arms. In Proceedings of Conference on Uncertainty in Artificial Intelligence (UAI), 2017. +Train, K. E. Discrete Choice Methods with Simulation. Cambridge University Press, 2009. +Valko, M., Korda, N., Munos, R., Flaounas, I., and Cristianini, N. Finite-time analysis of kernelised contextual bandits. In Proceedings of Conference on Uncertainty in Artificial Intelligence (UAI), pp. 654-663, 2013. +Vaswani, S., Mehrabian, A., Durand, A., and Kveton, B. Old dog learns new tricks: Randomized UCB for bandit problems. In International Conference on Artificial Intelligence and Statistics (AISTATS), pp. 1988-1998, 2020. + +Wu, H. and Liu, X. Double Thompson sampling for dueling bandits. In Proceedings of Advances in Neural Information Processing Systems (NeurIPS), pp. 649-657, 2016. +Xue, B., Wang, G., Wang, Y., and Zhang, L. Nearly optimal regret for stochastic linear bandits with heavy-tailed payoffs. In Proceedings of the International Joint Conference on Artificial Intelligence (IJCAI), pp. 2936-2942, 2020. +Yue, Y. and Joachims, T. Interactively optimizing information retrieval systems as a dueling bandits problem. In Proceedings of the International Conference on Machine Learning (ICML), pp. 1201-1208, 2009. +Zhao, T. and King, I. Constructing reliable gradient exploration for online learning to rank. In Proceedings of ACM International Conference on Information and Knowledge Management (CIKM), pp. 1643-1652, 2016. + +# A. List of Symbols + +The following table contains a list of symbols that are frequently used in the main paper as well as in the following supplementary material. + +
Basics
<, >preference relation for objects, i.e., o > o' (or o < o') iff object o is (not) preferred over object o'
1[.]indicator function
Nset of natural numbers (without 0), i.e., N = {1, 2, 3, ...}
Rset of real numbers
[n]the set {1, 2, ..., n} for some n ∈ N
x, zd - dimensional (column) vectors
A^Ttranspose of a matrix A ∈ Rd×d'
{x, y}inner product of two vectors x, y ∈ Rd
I_dd × d identity matrix
0_dd × d zero matrix
||x||the Euclidean norm of a vector x ∈ Rd, i.e., √{x, x}
||x||_Aweighted norm of a vector x ∈ Rd for some positive semi-definite matrix A ∈ Rd×d, i.e., √x^T A x
B_r(p)l_p ball of radius r ≥ 0, i.e., B_r(p) = {x | ||x||_p ≤ r}, where ||·|_p denotes the standard l_p-norm
Modelling related
nnumber of arms
A=[n]set of arms
Tthe time horizon
Xthe context space (subset of Rd)
xt_i(d - dimensional) context vector related to arm i at time step t ∈ [T] (element in X)
X_t(d × n - dimensional) context matrix at time step t, i.e., X_t = (xt,1 ... xt, n)
zt_i, jthe contrast vector of arm i and j at time step t, i.e., z_t, i, j = xt, i - xt, j
Z_t(d × (n)/2 - dimensional) contrast matrix at time step t, i.e., Z_t = (zt,1,2 z_t,1,3 ... z_t,1, n z_t,2,3 ... z_t, n-1, n)
θ*ground truth weight parameter of the underlying CoLST model (see (6))
G*, F*ground truth perturbation distribution and corresponding comparison function of the underlying CoLST model (see (6))
St = {it, j_t}selected pair of arms at time step t
Y_t(binary) feedback for the selected pair of arms St, i.e., Y_t = 1[xt > j_t]
ui*mapping from Rd×n to Rd according to ui*(X) = x^T_1 θ*, where ui is the ith column of X
i*(t) = i_t*optimal arm at time step t, i.e., the arm with the highest context-dependent utility at time t
rtw(S_t, X_t)instantaneous weak regret at time step t for selecting St i.e., rt^w(S_t, X_t) = ui*(t)(X_t) - maxk∈St u_k*(X_t)
rta(S_t, X_t)instantaneous average regret at time step t for selecting St i.e., rt^a(S_t, X_t) = 2u_i*(t)(X_t) - u_i*(X_t) - u_j*(X_t) - u_j*(X_t) / 2
RTw, RTacumulative weak or average regret till time T for selecting (St)_{t∈[T]} (see (8))
CoLSTIM related
θ_tmaximum-likelihood estimate of the weight parameter of the underlying CoLSTIM (see (9))
c1 > 0confidence width parameter of CoLSTIM (hyperparameter of CoLSTIM)
Cthresh > 0threshold parameter of CoLSTIM (hyperparameter of CoLSTIM)
τ > 0pure exploration length of CoLSTIM (hyperparameter of CoLSTIM)
pt ∈ [0,1]coupling probability (hyperparameter of CoLSTIM)
G, Fperturbation distribution and comparison function used by CoLSTIM (hyperparameter of CoLSTIM)
MtGram matrix at time step t, i.e., Mt = ∑s=1t-1zs,is, jszT
εt, isampled perturbation variable for arm i at time step t, i.e., εt, i ∼ G (see line 7 of Alg. 1)
εt, itrimmed sampled perturbation variable for arm i at time step t, i.e., εt, i = min(Cthresh, max(-Cthresh, εt, i))
ˆt, i(X_t)estimated utility of arm i in time step t, i.e.,ˆt, i(X_t) = x^T_1 θ_t
ˆt, i(X_t)perturbed estimated utility of arm i in time step t, i.e.,ˆt, i(X_t) = ˆt, i(X_t) + εt, i||x_t, i||M_t^-1
Sup-COLSTIM related
c1, Cthresh, τ, pt, G, Fhyperparameters of Sup-COLSTIM (same meaning as for CoLSTIM)
s, Sstages in Sup-COLSTIM, maximal number of stages (set to [log_2(T)])
At(s)arms which are "sufficiently accurately estimated promising arms" at stage s and time step t
Ψ(0)all time steps, where the choice has been made at some stage s ∈ [S] according to CoLSTIM's choice mechanism
Ψ(s)all time steps, where the choice has been made at stage s ∈ [S], but not according to CoLSTIM's choice mechanism
θ(t)maximum-likelihood estimate of the weight parameter using only observations from the time steps in Ψ(s)
Mt(s)Gram matrix at time step t and stage s i.e., Mt(s) = ∑l∈Ψ(s)zl,il, jtztl,il, jt
εt, i, εt, i( trimmed) perturbation variables (same meaning as for CoLSTIM)
ˆt, i(X_t)estimated utility of arm i in stage s at time t, i.e.,ˆt, i(X_t) = x^T_1 θ_t
ˆt, i(X_t)perturbed estimated utility of arm i in stage s at time t, i.e.,ˆt, i(X_t) = ˆt, i(X_t) + εt, i||x_t, i||M_t^-1
+ +# B. Lower Bound: Proof of Theorem 3.1 + +Theorem 3.1 For any learning algorithm $\mathcal{A}$ for the contextual dueling bandit problem under linear stochastic transitivity models in dimension $d$ , there exists an instance of the problem characterized by a weight vector $\pmb{\theta}^{*} \in \mathcal{B}_{1}(2)$ , context space $\mathcal{X} \subseteq \mathcal{B}_{1}(\infty)$ , and a comparison function $F: \mathbb{R} \to [0,1]$ , such that the expected weak regret incurred by $\mathcal{A}$ in any $T > \max(d, 16)$ rounds is + +$$ +\mathbb {E} \left[ R _ {T} ^ {w} \left(\left(S _ {t} ^ {\mathcal {A}}\right) _ {t \in [ T ]}\right) \right] = \Omega \left(d \sqrt {T}\right). +$$ + +Further, if we restrict $\mathcal{X} \subseteq \mathcal{B}_1(2)$ , then + +$$ +\mathbb {E} \left[ R _ {T} ^ {w} \left(\left(S _ {t} ^ {\mathcal {A}}\right) _ {t \in [ T ]}\right) \right] = \Omega \left(\sqrt {d T}\right). +$$ + +Proof. Case 1. $\mathcal{X} \subseteq \mathcal{B}_1(\infty)$ : + +Our proof is based on a similar line of reasoning as that proposed by Lattimore & Szeptesvári (2020) (Chapter 24) for the analysis of linear bandit algorithms. We assume the context space $\mathcal{X}$ to be $\{-1,1\}^d \subset \mathcal{B}_1(\infty)$ , and let $\Theta = \left\{-\frac{1}{\sqrt{T}}, \frac{1}{\sqrt{T}}\right\}^d$ be the set of possible unknown weight vectors $\pmb{\theta}^{*} \in \Theta$ . Note since $d < T$ , we have $\|\pmb{\theta}\|_2 \leq 1$ for any $\pmb{\theta} \in \Theta$ , and hence $\Theta \subset \mathcal{B}_1(2)$ . Assume the perturbation distribution $G$ of the underlying CoLST is the standard Gumbel distribution, i.e., $F$ corresponds to the BTL model (see Examples in Section 1). Fix any algorithm, and suppose $(\ell_1, \mathbf{r}_1), \ldots, (\ell_T, \mathbf{r}_T)$ be the context vectors of the pairs chosen by the algorithm (learner) for $T$ rounds, i.e., $\ell_t := \mathbf{x}_{t,i_t}$ and $\mathbf{r}_t := \mathbf{x}_{t,j_t}$ for all $t \in [T]$ . Now, for any $t$ , let us denote by $\mathbf{k}_t \in \{\ell_t, \mathbf{r}_t\}$ the context vector of the chosen arms with the higher utility, i.e., + +$$ +\mathbf {k} _ {t} = \left\{ \begin{array}{l l} \boldsymbol {\ell} _ {t}, & \text {i f} \boldsymbol {\ell} _ {t} ^ {\top} \boldsymbol {\theta} ^ {*} > \mathbf {r} _ {t} ^ {\top} \boldsymbol {\theta} ^ {*}, \\ \mathbf {r} _ {t}, & \text {e l s e}. \end{array} \right. +$$ + +Denote by $\operatorname{sgn}(x)$ the sign function for any $x \in \mathbb{R}$ . Let the sequence of context information matrices $(\mathbf{X}_t)_{t \in [T]}$ be such that there exists exactly one arm $i^* \in [n]$ such that $x_{t,i}^{i^*} = \operatorname{sgn}(\theta_i^*)$ , $\forall i \in [d] \forall t \in [T]$ , where $x_{t,i}^{i^*}$ is the $i^{th}$ component of $i^*$ 's context vector $x_{t,i^*}$ at time $t$ , and $\theta_i^*$ is the $i^{th}$ component of $\pmb{\theta}^*$ . Thus, the best arm is $i^*$ for each time step $t$ . For sake of brevity, let us denote its corresponding context vector by $\pmb{x}^*$ . + +For any $\theta \in \Theta$ , we denote by $\mathbb{P}_{\theta}$ the measure on (preference) outcomes induced by the interaction of a fixed algorithm $\mathcal{A}$ and the contextual dueling bandit instance parametrized by $\theta$ for $F$ being the BTL model. Also, denote by $\mathbb{E}_{\theta^{*}}[\cdot]$ the expected regret of $\mathcal{A}$ under the problem instance, induced by the model parameter $\theta^{*}$ . + +Writing $k_{ti}$ for the $i^{th}$ component of $\mathbf{k}_t$ , note that the expected cumulative weak regret of the algorithm for $T$ rounds can be written as + +$$ +\begin{array}{l} \mathbb {E} _ {\boldsymbol {\theta} ^ {*}} \left[ R _ {T} ^ {w} (\mathcal {A}) \right] = \mathbb {E} _ {\boldsymbol {\theta} ^ {*}} \left[ \sum_ {t = 1} ^ {T} \left(\mathbf {x} _ {*} ^ {\top} \boldsymbol {\theta} ^ {*} - \mathbf {k} _ {t} ^ {\top} \boldsymbol {\theta} ^ {*}\right) \right] = \mathbb {E} _ {\boldsymbol {\theta} ^ {*}} \left[ \sum_ {t = 1} ^ {T} \sum_ {i = 1} ^ {d} \left(\operatorname {s g n} \left(\theta_ {i} ^ {*}\right) - k _ {t i}\right) \theta_ {i} ^ {*} \right] \\ = \frac {1}{\sqrt {T}} \sum_ {t = 1} ^ {T} \sum_ {i = 1} ^ {d} \mathbb {E} _ {\boldsymbol {\theta} ^ {*}} \left[ \operatorname {s g n} \left(\theta_ {i} ^ {*}\right) \neq \operatorname {s g n} \left(k _ {t i}\right) \right] = \frac {1}{\sqrt {T}} \sum_ {i = 1} ^ {d} \mathbb {E} _ {\boldsymbol {\theta} ^ {*}} \left[ \sum_ {t = 1} ^ {T} \operatorname {s g n} \left(\theta_ {i} ^ {*}\right) \neq \operatorname {s g n} \left(k _ {t i}\right) \right] \\ \geq \frac {1}{\sqrt {T}} \frac {T}{2} \sum_ {i = 1} ^ {d} \mathbb {P} _ {\boldsymbol {\theta} ^ {*}} \left(\sum_ {t = 1} ^ {T} \left(\operatorname {s g n} \left(\theta_ {i} ^ {*}\right) \neq \operatorname {s g n} \left(k _ {t i}\right)\right) \geq \frac {T}{2}\right) \\ = \frac {\sqrt {T}}{2} \sum_ {i = 1} ^ {d} \mathbb {P} _ {\boldsymbol {\theta} ^ {*}} (i), \tag {11} \\ \end{array} +$$ + +where $\mathbb{P}_{\pmb{\theta}}(i) \coloneqq \mathbb{P}_{\pmb{\theta}}\left(\sum_{t=1}^{T} (\operatorname{sgn}(\theta_i) \neq \operatorname{sgn}(k_{ti})) \geq \frac{T}{2}\right)$ for any $\pmb{\theta} \in \Theta$ . So the only task left is to suitably lower bound the quantity $\sum_{i=1}^{d} \mathbb{P}_{\pmb{\theta}^*}(i)$ . For this we appeal to the Bretagnolle-Huber inequality (see Theorem 14.2 in (Lattimore & Szepesvári, 2020)), which is used for analyzing the lower bound of linear bandit algorithms as well. + +For every $\theta \in \Theta$ , and $i \in [d]$ , we denote by $\pmb{\theta}^i \in \Theta$ such that $\theta_j^i = \theta_j$ , $\forall j \in [d] \setminus \{i\}$ and $\theta_i^i = -\theta_i$ . Let us define $\mathbb{P}_{\pmb{\theta}^i}^c(i) := \mathbb{P}_{\pmb{\theta}^i}\left(\sum_{t=1}^{T} (\operatorname{sgn}(\theta_i^i) \neq \operatorname{sgn}(k_{ti})) \leq \frac{T}{2}\right)$ . But interestingly note that $\mathbb{P}_{\pmb{\theta}^i}^c(i) = \mathbb{P}_{\pmb{\theta}}(i)$ , and now applying + +Bretagnolle-Huber inequality we have that for any $\pmb{\theta} \in \Theta$ : + +$$ +\mathbb {P} _ {\boldsymbol {\theta}} (i) + \mathbb {P} _ {\boldsymbol {\theta} ^ {i}} ^ {c} (i) = 2 \mathbb {P} _ {\boldsymbol {\theta}} (i) \geq \frac {1}{2} \exp (- K L (\mathbb {P} _ {\boldsymbol {\theta}} | | \mathbb {P} _ {\boldsymbol {\theta} ^ {i}})), +$$ + +where $KL(P, Q)$ denotes the KL-divergence between two probability measures $P$ and $Q$ . Recalling that $\mathbb{P}_{\theta}$ denotes the measure on (preference) outcomes induced by the contextual dueling bandit instance $\theta \in \Theta$ , we can further use the chain rule of KL-divergence to get + +$$ +2 \mathbb {P} _ {\boldsymbol {\theta}} (i) \geq \frac {1}{2} \exp (- K L (\mathbb {P} _ {\boldsymbol {\theta}} | | \mathbb {P} _ {\boldsymbol {\theta} ^ {i}})) = \frac {1}{2} \exp \left(- \sum_ {t = 1} ^ {T} K L \left(\mathbb {P} _ {\boldsymbol {\theta}} \left(Y _ {t}\right) | | \mathbb {P} _ {\boldsymbol {\theta} ^ {i}} \left(Y _ {t}\right)\right)\right), \tag {12} +$$ + +Now, since $Y_{t}\sim \mathrm{Ber}\big(F(\mathbf{z}_{t}^{\top}\pmb {\theta})\big)$ with $\mathbf{z}_t = (\ell_t - \mathbf{r}_t)$ , we have that $KL\big(\mathbb{P}_{\pmb{\theta}}(Y_t)||\mathbb{P}_{\pmb{\theta}^i}(Y_t)\big)$ is the KL-divergence between two Bernoulli distributions. We bound this by using the following upper bound: + +$$ +K L (\mathbf {p} | | \mathbf {q}) \leq \sum_ {y \in \mathcal {Y}} \frac {p ^ {2} (y)}{q (y)} - 1, \tag {13} +$$ + +where $\mathbf{p}$ and $\mathbf{q}$ are two probability mass functions on some finite set $\mathcal{V}$ (Popescu et al., 2016, Theorem 1.4). + +Recall that we assume a BTL model, so that $G$ is the standard Gumbel distribution and consequently $F$ is the cumulative distribution function of the standard logistic distribution, so that + +$$ +\mathbb {P} _ {\pmb {\theta}} (Y _ {t}) = \mathrm {B e r} \bigg (\frac {e ^ {\ell_ {t} ^ {\top} \pmb {\theta}}}{e ^ {\ell_ {t} ^ {\top} \pmb {\theta}} + e ^ {\mathbf {r} _ {t} ^ {\top} \pmb {\theta}}}, \qquad \forall t \in [ T ]. +$$ + +For sake of brevity, let us denote $\theta_{\ell} = e^{\ell_t^\top \theta}$ and $\pmb{\theta}_{\mathbf{r}} = e^{\mathbf{r}_t^\top \pmb{\theta}}$ ; similarly $\pmb{\theta}_{\ell}^{i} = e^{\ell_{t}^{\top}\pmb{\theta}^{i}}$ and $\pmb{\theta}_{\mathbf{r}}^{i} = e^{\mathbf{r}_{t}^{\top}\pmb{\theta}^{i}}$ . Further note that $\pmb{\theta}_{\ell}^{i} = \pmb{\theta}_{\ell}e^{-\frac{2}{\sqrt{T}}\mathrm{sgn}(\pmb{\theta}_{i})\ell_{ti}}$ , and $\pmb{\theta}_{\mathbf{r}}^{i} = \pmb{\theta}_{\mathbf{r}}e^{-\frac{2}{\sqrt{T}}\mathrm{sgn}(\pmb{\theta}_{i})r_{ti}}$ . Further, abbreviating $\phi := -\frac{2}{\sqrt{T}}\mathrm{sgn}(\theta_i)\ell_{ti}$ and $\psi := -\frac{2}{\sqrt{T}}\mathrm{sgn}(\theta_i)r_{ti}$ we finally get: + +$$ +\begin{array}{l} K L \left(\mathbb {P} _ {\boldsymbol {\theta}} (Y _ {t}) | | \mathbb {P} _ {\boldsymbol {\theta} ^ {i}} (Y _ {t})\right) = K L \left(\operatorname {B e r} \left(\frac {\boldsymbol {\theta} _ {\ell}}{\boldsymbol {\theta} _ {\ell} + \boldsymbol {\theta} _ {\mathbf {r}}}\right) | | \operatorname {B e r} \left(\frac {\boldsymbol {\theta} _ {\ell} ^ {i}}{\boldsymbol {\theta} _ {\ell} ^ {i} + \boldsymbol {\theta} _ {\mathbf {r}} ^ {i}}\right)\right) \\ \stackrel {(1 3)} {\leq} \frac {\left(1 - \frac {\theta_ {\ell}}{\theta_ {\ell} + \theta_ {\mathbf {r}}}\right) ^ {2}}{\left(1 - \frac {e ^ {\phi} \theta_ {\ell}}{e ^ {\phi} \theta_ {\ell} + e ^ {\psi} \theta_ {\mathbf {r}}}\right)} + \frac {\left(\frac {\theta_ {\ell}}{\theta_ {\ell} + \theta_ {\mathbf {r}}}\right) ^ {2}}{\frac {e ^ {\phi} \theta_ {\ell}}{e ^ {\phi} \theta_ {\ell} + e ^ {\psi} \theta_ {\mathbf {r}}}} - 1 \\ = \frac {\boldsymbol {\theta} _ {\mathbf {r}} ^ {2} (e ^ {\phi} \boldsymbol {\theta} _ {\ell} + e ^ {\psi} \boldsymbol {\theta} _ {\mathbf {r}})}{(\boldsymbol {\theta} _ {\ell} + \boldsymbol {\theta} _ {\mathbf {r}}) ^ {2} e ^ {\psi} \boldsymbol {\theta} _ {\mathbf {r}}} + \frac {\boldsymbol {\theta} _ {\ell} ^ {2} (e ^ {\phi} \boldsymbol {\theta} _ {\ell} + e ^ {\psi} \boldsymbol {\theta} _ {\mathbf {r}})}{(\boldsymbol {\theta} _ {\ell} + \boldsymbol {\theta} _ {\mathbf {r}}) ^ {2} e ^ {\phi} \boldsymbol {\theta} _ {\ell}} - 1 \\ = \frac {(e ^ {\phi} \pmb {\theta} _ {\ell} + e ^ {\psi} \pmb {\theta} _ {\mathbf {r}}) (\pmb {\theta} _ {\mathbf {r}} ^ {2} e ^ {\phi} \pmb {\theta} _ {\ell} + \pmb {\theta} _ {\ell} ^ {2} e ^ {\psi} \pmb {\theta} _ {\mathbf {r}})}{(\pmb {\theta} _ {\ell} + \pmb {\theta} _ {\mathbf {r}}) ^ {2} e ^ {\psi} \pmb {\theta} _ {\mathbf {r}} e ^ {\phi} \pmb {\theta} _ {\ell}} - 1 \\ = \frac {e ^ {\phi} \boldsymbol {\theta} _ {\ell} + e ^ {\psi} \boldsymbol {\theta} _ {\mathbf {r}}}{(\boldsymbol {\theta} _ {\ell} + \boldsymbol {\theta} _ {\mathbf {r}}) ^ {2}} \frac {e ^ {\psi} \boldsymbol {\theta} _ {\ell} + e ^ {\phi} \boldsymbol {\theta} _ {\mathbf {r}}}{e ^ {\phi} e ^ {\psi}} - 1 \\ = \frac {\pmb {\theta} _ {\ell} \pmb {\theta} _ {\mathbf {r}}}{(\pmb {\theta} _ {\ell} + \pmb {\theta} _ {\mathbf {r}}) ^ {2}} \frac {\left(e ^ {\phi} - e ^ {\psi}\right) ^ {2}}{e ^ {\phi} e ^ {\psi}} \\ \leq \frac {1}{4} \cdot \frac {4 8}{T} = \frac {1 2}{T}, \tag {14} \\ \end{array} +$$ + +where the last inequality (14) follows from the fact that $\frac{\theta_{\ell}\theta_{\mathbf{r}}}{(\theta_{\ell} + \theta_{\mathbf{r}})^2} = \frac{1}{\left(\sqrt{\frac{\theta_{\ell}}{\theta_{\mathbf{r}}}} + \sqrt{\frac{\theta_{\mathbf{r}}}{\theta_{\ell}}}\right)^2} \leq \frac{1}{2^2} = \frac{1}{4}$ , and the second term + +$\frac{\left(e^{\phi} - e^{\psi}\right)^{2}}{e^{\phi}e^{\psi}}$ can shown to be upper bounded by $\frac{48}{T}$ for all $T \geq 16$ as follows: + +$$ +\begin{array}{l} \frac {\left(e ^ {\phi} - e ^ {\psi}\right) ^ {2}}{e ^ {\phi} e ^ {\psi}} = \frac {(e ^ {\phi - \psi} - 1) ^ {2}}{e ^ {\phi - \psi}} \leq \frac {(e ^ {4 / \sqrt {T}} - 1) ^ {2}}{e ^ {4 / \sqrt {T}}} \\ \leq (e ^ {4 / \sqrt {T}} - 1) ^ {2} \\ \leq \left((e - 1) \frac {4}{\sqrt {T}}\right) ^ {2} \\ = \frac {1 6 (e - 1) ^ {2}}{T} \leq \frac {4 8}{T}. \\ \end{array} +$$ + +$$ +\text {s i n c e} \phi - \psi \in \left\{- \frac {4}{\sqrt {T}}, 0, \frac {4}{\sqrt {T}} \right\} +$$ + +$$ +\text {a s m u n i n g} (T \geq 1 6) \Rightarrow \left(e ^ {4 / \sqrt {T}} \geq 1\right) +$$ + +$$ +(\text {u s i n g}: e ^ {x} - 1 \leq (e - 1) x \text {f o r} x \in [ 0, 1 ]) +$$ + +Using this in (12) we further get that: + +$$ +\mathbb {P} _ {\pmb {\theta}} (i) \geq \frac {1}{4} \exp \left(- T \frac {1 2}{T}\right) = \frac {\exp (- 1 2)}{4}. +$$ + +Finally, since this holds for any $\theta \in \Theta$ , and $|\Theta| = 2^d$ , averaging over all $\theta \in \Theta$ we get: + +$$ +\frac {1}{| \Theta |} \sum_ {\boldsymbol {\theta} \in \Theta} \sum_ {i = 1} ^ {d} \mathbb {P} _ {\boldsymbol {\theta}} (i) \geq \frac {d \exp (- 1 2)}{4}, +$$ + +which implies that there exists at least one $\theta \in \Theta$ , say $\tilde{\theta}$ , such that $\sum_{i=1}^{d} \mathbb{P}_{\tilde{\theta}}(i) > \frac{d \exp(-12)}{4}$ . The claim now simply follows from (11) with the choice of $\theta^* = \tilde{\theta}$ . + +Case 2. $\mathcal{X} \subseteq \mathcal{B}_1(2)$ : + +For the second part of the proof, it requires us to restrict $\mathcal{X} \subseteq \mathcal{B}_1(2)$ . To achieve this, we use the context space $\mathcal{X} = \left\{-\frac{1}{\sqrt{d}}, \frac{1}{\sqrt{d}}\right\}^d$ . Note in this case the expected cumulative weak regret of any algorithm $\mathcal{A}$ for $T$ rounds becomes + +$$ +\mathbb {E} _ {\pmb {\theta} ^ {*}} [ R _ {T} ^ {w} (\mathcal {A}) ] = \mathbb {E} _ {\pmb {\theta} ^ {*}} \bigg [ \sum_ {t = 1} ^ {T} \big (\mathbf {x} _ {*} ^ {\top} \pmb {\theta} ^ {*} - \mathbf {k} _ {t} ^ {\top} \pmb {\theta} ^ {*} \big) \bigg ] = \frac {1}{\sqrt {d}} \mathbb {E} _ {\pmb {\theta} ^ {*}} \bigg [ \sum_ {t = 1} ^ {T} \sum_ {i = 1} ^ {d} (\mathrm {s g n} (\theta_ {i} ^ {*}) - k _ {t i}) \theta_ {i} ^ {*} \bigg ] \geq \frac {\sqrt {T}}{2 \sqrt {d}} \sum_ {i = 1} ^ {d} \mathbb {P} _ {\pmb {\theta} ^ {*}} (i), +$$ + +which gives the $1 / \sqrt{d}$ scaling in the regret bound. The rest of the proof follows same as analyzed for Case 1 before yielding the desired weak-regret lower bound for this case. + +# C. Proofs of Regret Upper Bounds for CoLSTIM + +For some fixed constants $c_{1}, c_{2} > 0$ define the MLE concentration event + +$$ +A _ {\mathrm {M L E}} = \{\forall \{i, j \} \subset [ n ], t > \tau : | \hat {u} _ {t, i} (\mathbf {X} _ {t}) - u _ {i} ^ {*} (\mathbf {X} _ {t}) + u _ {j} ^ {*} (\mathbf {X} _ {t}) - \hat {u} _ {t, j} (\mathbf {X} _ {t}) | \leq c _ {1} \| \boldsymbol {z} _ {t, i, j} \| _ {\mathbf {M} _ {t} ^ {- 1}} \} +$$ + +and the (time-dependent) perturbed estimated utility concentration event + +$$ +A _ {\mathrm {c o n c}, t} = \{\forall \{i, j \} \subset [ n ]: | \tilde {u} _ {t, i} (\mathbf {X} _ {t}) - \tilde {u} _ {t, j} (\mathbf {X} _ {t}) - \hat {u} _ {t, i} (\mathbf {X} _ {t}) + \hat {u} _ {t, j} (\mathbf {X} _ {t}) | \leq c _ {2} \| \boldsymbol {z} _ {t, i, j} \| _ {\mathbf {M} _ {t} ^ {- 1}} \}. +$$ + +Moreover, define the initial concentration event + +$$ +A _ {\text {i n i t}} = \left\{\forall t > \tau : \left| \hat {\boldsymbol {\theta}} _ {t} - \boldsymbol {\theta} ^ {*} \right| \leq 1 \text {a n d} \mathbf {M} _ {t} \geq I _ {d} \right\}. +$$ + +For sake of convenience, we will denote the average regret for selecting pairs $(i_t,j_t)$ at time $t$ by + +$$ +\Delta_ {i _ {t}, j _ {t}} = \frac {u _ {i ^ {*} (t)} ^ {*} (\mathbf {X} _ {t}) - u _ {i _ {t}} ^ {*} (\mathbf {X} _ {t}) + u _ {i ^ {*} (t)} ^ {*} (\mathbf {X} _ {t}) - u _ {j _ {t}} ^ {*} (\mathbf {X} _ {t})}{2}. +$$ + +# C.1. Proof of Theorem 3.2 and Corollary 3.3 + +We use the following theorem (proven in Section C.3) to prove Theorem 3.2 as well as Corollary 3.3. + +Theorem C.1. Let $(S_{t})_{t\in [T]}$ denote the selected pairs of arms by CoLSTIM and let $R_T^a (C) = R_T^a ((S_t)_{t\in [T]})$ be its corresponding cumulative average regret. Assume there exist constants $c_{1} > 0$ and $c_{2} > 0$ such that for some $p_1,p_2,p_{3,t}\in [0,1]$ it holds that $\mathbb{P}(A_{\mathrm{MLE}})\geq 1 - p_1,\mathbb{P}(A_{\mathrm{init}})\geq 1 - p_2$ , and for any given $t > \tau$ and for any possible history $\mathcal{H}_{t - 1}$ before the start of round $t$ , we have $\mathbb{P}(A_{\mathrm{conc},t}|\mathcal{H}_{t - 1})\geq 1 - p_{3,t}$ . Then, for any constant $c_{3}\geq \sqrt{2d}$ it holds that + +$$ +\mathbb {E} \left[ R _ {T} ^ {a} (\mathrm {C o L S T I M}) \right] \leq \Delta_ {m a x} \tau + \Delta_ {m a x} \sum_ {t = \tau + 1} ^ {T} p _ {3, t} + \Delta_ {m a x} (p _ {1} + p _ {2}) T + \frac {c _ {3}}{2} \Big (3 c _ {1} + c _ {2} \Big) \sqrt {T \log \left(\frac {2 T}{d}\right)}, +$$ + +where $\Delta_{max} = 2\sqrt{2}$ . Moreover, if $\sum_{t=\tau+1}^{T} \lambda_{\min}^{-1/2}(\mathbf{M}_t) \leq c\sqrt{T}$ , where $c$ is some positive constant and $\lambda_{\min}(A)$ denotes the smallest eigenvalue of a square matrix $A$ , then the previous inequality holds for any constant $c_3 \geq \sqrt{2}c$ . + +Proof of Theorem 3.2. By the choice of the initial exploration length $\tau$ and Assumption (A1) we can infer that the smallest eigenvalue of the Gram matrix $\mathbf{M}_t$ is at least $\rho \tau = \max \left(1, \frac{d\log(T / d) + 2\log(T)}{\mu^2}\right)$ , so that following the lines of proof of Theorem 4 in (Vaswani et al., 2020) we have that $\mathbb{P}(A_{\mathrm{init}}) \geq 1 - p_2$ , holds for $p_2 = 1 / T$ . Similarly, by the choice of $c_1$ and following the lines of proof of Theorem 4 in (Vaswani et al., 2020) we have that $\mathbb{P}(A_{\mathrm{MLE}}) \geq 1 - p_1$ holds for $p_1 = 1 / T$ . + +It remains to derive a suitable choice for $p_{3,t}$ . For this purpose, fix $t > \tau$ and $\mathcal{H}_{t-1}$ arbitrary such that we can leave out the conditioning on $\mathcal{H}_{t-1}$ in the following. With this, + +$$ +\begin{array}{l} \mathbb {P} \left(A _ {\mathrm {c o n c}, t} ^ {\complement}\right) = \mathbb {P} \left(\exists \{i, j \} \subset [ n ]: | \tilde {u} _ {t, i} (\mathbf {X} _ {t}) - \tilde {u} _ {t, j} (\mathbf {X} _ {t}) - \hat {u} _ {t, i} (\mathbf {X} _ {t}) + \hat {u} _ {t, j} (\mathbf {X} _ {t}) | > c _ {2} \| \boldsymbol {z} _ {t, i, j} \| _ {\mathbf {M} _ {t} ^ {- 1}}\right) \\ = \mathbb {P} \left(\exists \{i, j \} \subset [ n ]: | \tilde {u} _ {t, i} (\mathbf {X} _ {t}) - \tilde {u} _ {t, j} (\mathbf {X} _ {t}) - \hat {u} _ {t, i} (\mathbf {X} _ {t}) + \hat {u} _ {t, j} (\mathbf {X} _ {t}) | > c _ {2} \| \boldsymbol {z} _ {t, i, j} \| _ {\mathbf {M} _ {t} ^ {- 1}} \mid B _ {t} = 1\right) \mathbb {P} \left(B _ {t} = 1\right) \\ + \mathbb {P} (\exists \{i, j \} \subset [ n ]: | \tilde {u} _ {t, i} (\mathbf {X} _ {t}) - \tilde {u} _ {t, j} (\mathbf {X} _ {t}) - \hat {u} _ {t, i} (\mathbf {X} _ {t}) + \hat {u} _ {t, j} (\mathbf {X} _ {t}) | > c _ {2} \| \boldsymbol {z} _ {t, i, j} \| _ {\mathbf {M} _ {t} ^ {- 1}} | B _ {t} = 0) \mathbb {P} (B _ {t} = 0) \\ \leq p _ {t} + \mathbb {P} (\exists \{i, j \} \subset [ n ]: | \tilde {u} _ {t, i} (\mathbf {X} _ {t}) - \tilde {u} _ {t, j} (\mathbf {X} _ {t}) - \hat {u} _ {t, i} (\mathbf {X} _ {t}) + \hat {u} _ {t, j} (\mathbf {X} _ {t}) | > c _ {2} \| \boldsymbol {z} _ {t, i, j} \| _ {\mathbf {M} _ {t} ^ {- 1}} | B _ {t} = 0) \\ = p _ {t} + \mathbb {P} (\exists \{i, j \} \subset [ n ]: | \epsilon_ {t, i} \| \boldsymbol {x} _ {t, i} \| _ {\mathbf {M} _ {t} ^ {- 1}} - \epsilon_ {t, j} \| \boldsymbol {x} _ {t, j} \| _ {\mathbf {M} _ {t} ^ {- 1}} | > c _ {2} \| \boldsymbol {z} _ {t, i, j} \| _ {\mathbf {M} _ {t} ^ {- 1}} | B _ {t} = 0) \\ \leq p _ {t} + \mathbb {P} (\exists \{i, j \} \subset [ n ]: | \epsilon_ {t, i} \| \boldsymbol {x} _ {t, i} \| _ {\mathbf {M} _ {t} ^ {- 1}} - \epsilon_ {t, j} \| \boldsymbol {x} _ {t, j} \| _ {\mathbf {M} _ {t} ^ {- 1}} | > c _ {2} \| \boldsymbol {z} _ {t, i, j} \| _ {\mathbf {M} _ {t} ^ {- 1}} | B _ {t} = 0) \\ \end{array} +$$ + +Note that conditioned on $B_{t} = 0$ , we have that all perturbation variables $(\epsilon_{t,i})_{i\in [n]}$ are the same, i.e., for each $i\in [n]$ it holds that $\epsilon_{t,i} = \epsilon = \min (C_{\mathrm{thresh}},\max (-C_{\mathrm{thresh}},\tilde{\epsilon}))$ for some $\tilde{\epsilon}\sim G$ . Thus, + +$$ +\begin{array}{l} \mathbb {P} \left(A _ {\text {c o n c}, t} ^ {\complement}\right) \leq p _ {t} + \mathbb {P} \left(\exists \{i, j \} \subset [ n ]: | \epsilon | \cdot \left| \| \boldsymbol {x} _ {t, i} \| _ {\mathbf {M} _ {t} ^ {- 1}} - \| \boldsymbol {x} _ {t, j} \| _ {\mathbf {M} _ {t} ^ {- 1}} \right| > c _ {2} \| \boldsymbol {z} _ {t, i, j} \| _ {\mathbf {M} _ {t} ^ {- 1}} \mid B _ {t} = 0\right) \\ \leq p _ {t} + \mathbb {P} (| \epsilon | > c _ {2} \mid B _ {t} = 0) \\ = p _ {t}, \\ \end{array} +$$ + +where we used that by the reverse triangle inequality it holds that + +$$ +\left| \left\| \boldsymbol {x} _ {t, i} \right\| _ {\mathbf {M} _ {t} ^ {- 1}} - \left\| \boldsymbol {x} _ {t, j} \right\| _ {\mathbf {M} _ {t} ^ {- 1}} \right| \leq \left\| \boldsymbol {x} _ {t, i} - \boldsymbol {x} _ {t, j} \right\| _ {\mathbf {M} _ {t} ^ {- 1}} = \left\| \boldsymbol {z} _ {t, i, j} \right\| _ {\mathbf {M} _ {t} ^ {- 1}} +$$ + +for any $i,j\in [n]$ and that $|\epsilon |\leq C_{\mathrm{thresh}} < c_2$ . As a consequence, we can set + +$$ +p _ {3, t} = p _ {t} = \min \left(1, \frac {\sqrt {2 d}}{2 \sqrt {t - \tau}} \left(3 c _ {1} + c _ {2}\right) \sqrt {\log \left(\frac {2 T}{d}\right)}\right) +$$ + +such that $\mathbb{P}(A_{\mathrm{conc},t}|\mathcal{H}_{t - 1})\geq 1 - p_{3,t}$ and + +$$ +\sum_ {t = \tau + 1} ^ {T} p _ {3, t} \leq \frac {\sqrt {2 d}}{2} \left(3 c _ {1} + c _ {2}\right) \sqrt {\log \left(\frac {2 T}{d}\right)} \sum_ {t = 1} ^ {T} \frac {1}{\sqrt {t}} \leq \frac {\sqrt {2 d}}{2} \left(3 c _ {1} + c _ {2}\right) \sqrt {T \log \left(\frac {2 T}{d}\right)} = O (d \sqrt {T} \log (T)). \tag {15} +$$ + +Thus, using the fact that with the choices of $c_{1}$ and $\tau$ we can use $p_{1} = p_{2} = 1 / T$ , while by the choice of $c_{2}$ , $C_{\mathrm{thresh}}$ and $p_{t}$ , we can set $p_{3,t} = p_{t}$ , we obtain the claim by virtue of Theorem C.1, by using (15) as well as $c_{2} \leq c_{1} = O(\sqrt{d\log(T)})$ and $\tau = o(\sqrt{dT})$ . + +Proof of Corollary 3.3. Use the same choices of $c_{1}, c_{2}$ and $p_{1}, p_{2}, p_{3,t} \in [0,1]$ as in the proof of Theorem 3.2, but use the second statement of Theorem C.1. + +# C.2. Technical Lemmas + +The following lemma is an adaptation of Lemma 11 from (Abbasi-Yadkori et al., 2011) for our setting. + +Lemma C.2. Let $\mathbf{z}_1, \mathbf{z}_2, \ldots, \mathbf{z}_t \in \mathbb{R}^d$ be such that $\max_{s \in [t]} \| \mathbf{z}_s \|^2 \leq 2$ and $\mathbf{M}_{t+1} = \sum_{s=1}^{t} \mathbf{z}_s \mathbf{z}_s^\top$ . Further, let $\tau < t$ be such that $\mathbf{M}_{\tau+1} \geq I_d$ holds, then + +$$ +\sum_ {s = \tau + 1} ^ {t} \sqrt {2} \wedge \| \boldsymbol {z} _ {s} \| _ {\mathbf {M} _ {s} ^ {- 1}} \leq \sqrt {2 d t \log \left(\frac {2 t}{d}\right)}. +$$ + +Proof. Note that $x \leq 2\log(1 + x)$ holds for any $x \in [0,2]$ , so that + +$$ +\sum_ {s = \tau + 1} ^ {t} \left(\sqrt {2} \wedge \| \boldsymbol {z} _ {s} \| _ {\mathbf {M} _ {s} ^ {- 1}}\right) ^ {2} \leq \sum_ {s = \tau + 1} ^ {t} \| \boldsymbol {z} _ {s} \| _ {\mathbf {M} _ {s} ^ {- 1}} ^ {2} \leq \sum_ {s = \tau + 1} ^ {t} 2 \log \left(1 + \| \boldsymbol {z} _ {s} \| _ {\mathbf {M} _ {s} ^ {- 1}} ^ {2}\right) = 2 \log \left(\prod_ {s = \tau + 1} ^ {t} 1 + \| \boldsymbol {z} _ {s} \| _ {\mathbf {M} _ {s} ^ {- 1}} ^ {2}\right). \tag {16} +$$ + +Denoting by $\operatorname{det}(A)$ the determinant of a square matrix $A$ , we obtain by the matrix determinant lemma + +$$ +\begin{array}{l} \det (\mathbf {M} _ {t + 1}) = \det (\mathbf {M} _ {t} + \boldsymbol {z} _ {t} \boldsymbol {z} _ {t} ^ {\top}) = \det (\mathbf {M} _ {t}) (1 + \boldsymbol {z} _ {t} ^ {\top} \mathbf {M} _ {t} ^ {- 1} \boldsymbol {z} _ {t}) \\ = \det (\mathbf {M} _ {\tau + 1}) \prod_ {s = \tau + 1} ^ {t} \left(1 + z _ {s} ^ {\top} \mathbf {M} _ {s} ^ {- 1} z _ {s}\right) \\ = \det \left(\mathbf {M} _ {\tau + 1}\right) \prod_ {s = \tau + 1} ^ {t} 1 + \left\| \boldsymbol {z} _ {s} ^ {\top} \right\| _ {\mathbf {M} _ {s} ^ {- 1}} ^ {2} \tag {17} \\ \geq \prod_ {s = \tau + 1} ^ {t} 1 + \| \boldsymbol {z} _ {s} ^ {\top} \| _ {\mathbf {M} _ {s} ^ {- 1}} ^ {2}, \\ \end{array} +$$ + +where we used in the inequality that $\mathbf{M}_{\tau +1}\geq I_d$ holds. Further, by the determinant-trace inequality, i.e., $\operatorname *{det}(A)^{1 / d}\leq \frac{\operatorname{tr}(A)}{d}$ for any positive definite matrix $A\in \mathbb{R}^{d\times d}$ , we obtain + +$$ +d \det \left(\mathbf {M} _ {t + 1}\right) ^ {1 / d} \leq \operatorname {t r} \left(\mathbf {M} _ {t + 1}\right) = \operatorname {t r} \left(\sum_ {s = 1} ^ {t} \boldsymbol {z} _ {s} \boldsymbol {z} _ {s} ^ {\top}\right) = \sum_ {s = 1} ^ {t} \operatorname {t r} \left(\boldsymbol {z} _ {s} \boldsymbol {z} _ {s} ^ {\top}\right) = \sum_ {s = 1} ^ {t} \| \boldsymbol {z} _ {s} \| ^ {2} \leq 2 t, \tag {18} +$$ + +where $\operatorname{tr}(A)$ denotes the trace of a matrix $A$ . Combining (16), (17) and 18 we obtain + +$$ +\sum_ {s = \tau + 1} ^ {t} \left(\sqrt {2} \wedge \| \boldsymbol {z} _ {s} \| _ {\mathbf {M} _ {s} ^ {- 1}}\right) ^ {2} \leq 2 \log \left(\det (\mathbf {M} _ {t + 1})\right) \leq 2 d \log \left(\frac {2 t}{d}\right). +$$ + +Finally, by the Cauchy-Schwarz inequality we obtain + +$$ +\sum_ {s = \tau + 1} ^ {t} \sqrt {2} \wedge \| \pmb {z} _ {s} \| _ {\mathbf {M} _ {s} ^ {- 1}} \leq \sqrt {(t - \tau) \sum_ {s = \tau + 1} ^ {t} (\sqrt {2} \wedge \| \pmb {z} _ {s} \| _ {\mathbf {M} _ {s} ^ {- 1}}) ^ {2}} \leq \sqrt {2 d t \log \left(\frac {2 t}{d}\right)}. +$$ + +Lemma C.3. Let $c_{1}, c_{2}$ and $p_{1}, p_{2}, p_{3,t} \in [0,1]$ be as in Theorem C.1. Then, for any round $t > \tau$ and any history $\mathcal{H}_{t-1}$ , we have + +$$ +\mathbb {E} [ \Delta_ {i _ {t}, j _ {t}} 1 _ {A _ {\mathrm {M L E}} \cap A _ {\mathrm {i n i t}}} | \mathcal {H} _ {t - 1} ] \leq \Delta_ {m a x} p _ {3, t} + \frac {1}{2} \Big (3 c _ {1} + c _ {2} \Big) \mathbb {E} [ \| \pmb {z} _ {t, i _ {t}, j _ {t}} \| _ {\mathbf {M} _ {t} ^ {- 1}} 1 _ {A _ {\mathrm {i n i t}}} | \mathcal {H} _ {t - 1} ], +$$ + +where $c_{1} > 0$ and $c_{2} > 0$ . + +Proof of Lemma C.3. Fix $t$ and $\mathcal{H}_{t-1}$ arbitrary such that both events $A_{\mathrm{MLE}}$ and $A_{\mathrm{init}}$ in the indicator function are true. In this way, we can leave out the conditioning on $\mathcal{H}_{t-1}$ in the following. We first bound the (conditional) expected value as follows: + +$$ +\begin{array}{l} \mathbb {E} [ \Delta_ {i _ {t}, j _ {t}} 1 _ {A _ {\mathrm {M L E}} \cap A _ {\mathrm {i n i t}}} ] = \mathbb {E} [ \Delta_ {i _ {t}, j _ {t}} 1 _ {A _ {\mathrm {M L E}} \cap A _ {\mathrm {i n i t}}} 1 _ {A _ {\mathrm {c o n c}, t}} ] + \mathbb {E} [ \Delta_ {i _ {t}, j _ {t}} 1 _ {A _ {\mathrm {M L E}} \cap A _ {\mathrm {i n i t}}} 1 _ {A _ {\mathrm {c o n c}, t} ^ {\circ}} ] \\ \leq \mathbb {E} \left[ \Delta_ {i _ {t}, j _ {t}} 1 _ {A _ {\mathrm {M L E}} \cap A _ {\mathrm {i n i t}}} 1 _ {A _ {\mathrm {c o n c}, t}} \right] + \Delta_ {m a x} \mathbb {P} \left(A _ {\mathrm {c o n c}, t} ^ {\complement}\right) \\ \leq \mathbb {E} \left[ \Delta_ {i t, j t} 1 _ {A _ {\mathrm {M L E}} \cap A _ {\mathrm {i n i t}}} 1 _ {A _ {\mathrm {c o n c}, t}} \right] + \Delta_ {m a x} p _ {3, t}. \\ \end{array} +$$ + +On the event $A_{\mathrm{MLE}}$ it holds that + +$$ +\begin{array}{l} \langle \pmb {z} _ {t, i _ {t} ^ {*}, i _ {t}}, \pmb {\theta} ^ {*} - \hat {\pmb {\theta}} _ {t} \rangle = u _ {i _ {t} ^ {*}} ^ {*} (\mathbf {X} _ {t}) - \hat {u} _ {t, i _ {t} ^ {*}} (\mathbf {X} _ {t}) + \hat {u} _ {t, i _ {t}} (\mathbf {X} _ {t}) - u _ {i _ {t}} ^ {*} (\mathbf {X} _ {t}) \\ \leq \left| u _ {i _ {t} ^ {*}} ^ {*} (\mathbf {X} _ {t}) - \hat {u} _ {t, i _ {t} ^ {*}} (\mathbf {X} _ {t}) + \hat {u} _ {t, i _ {t}} (\mathbf {X} _ {t}) - u _ {i _ {t}} ^ {*} (\mathbf {X} _ {t}) \right| \tag {19} \\ \leq c _ {1} \left\| \pmb {z} _ {t, i _ {t} ^ {*}, i _ {t}} \right\| _ {\mathbf {M} _ {t} ^ {- 1}} \\ \end{array} +$$ + +and similarly $\langle \pmb{z}_{t,i_t^*,j_t},\pmb{\theta}^* -\hat{\pmb{\theta}}_t\rangle \leq c_1\| \pmb{z}_{t,i_t^*,j_t}\|_{\mathbf{M}_t^{-1}}$ . Further, note that + +$$ +\boldsymbol {z} _ {t, i _ {t} ^ {*}, j _ {t}} = \boldsymbol {x} _ {t, i _ {t} ^ {*}} - \boldsymbol {x} _ {t, j _ {t}} = \boldsymbol {x} _ {t, i _ {t} ^ {*}} - \boldsymbol {x} _ {t, i _ {t}} + \boldsymbol {x} _ {t, i _ {t}} - \boldsymbol {x} _ {t, j _ {t}} = \boldsymbol {z} _ {t, i _ {t} ^ {*}, i _ {t}} + \boldsymbol {z} _ {t, i _ {t}, j _ {t}} \tag {20} +$$ + +and by definition of $j_{t}$ it holds for all $i \in [n]$ that + +$$ +\left\langle \boldsymbol {z} _ {t, i, i _ {t}}, \hat {\boldsymbol {\theta}} _ {t} \right\rangle + c _ {1} \left\| \boldsymbol {z} _ {t, i, i _ {t}} \right\| _ {\mathbf {M} _ {t} ^ {- 1}} \leq \left\langle \boldsymbol {z} _ {t, j _ {t}, i _ {t}}, \hat {\boldsymbol {\theta}} _ {t} \right\rangle + c _ {1} \left\| \boldsymbol {z} _ {t, j _ {t}, i _ {t}} \right\| _ {\mathbf {M} _ {t} ^ {- 1}} = \left\langle \boldsymbol {z} _ {t, j _ {t}, i _ {t}}, \hat {\boldsymbol {\theta}} _ {t} \right\rangle + c _ {1} \left\| \boldsymbol {z} _ {t, i _ {t}, j _ {t}} \right\| _ {\mathbf {M} _ {t} ^ {- 1}} \tag {21} +$$ + +Finally, by the definition of $i_t$ it holds for all $i \in [n]$ that + +$$ +\left\langle \boldsymbol {x} _ {t, i}, \hat {\boldsymbol {\theta}} _ {t} \right\rangle + \epsilon_ {t, i} \left\| \boldsymbol {x} _ {t, i} \right\| _ {\mathbf {M} _ {t} ^ {- 1}} - \left(\left\langle \boldsymbol {x} _ {t, i _ {t}}, \hat {\boldsymbol {\theta}} _ {t} \right\rangle + \epsilon_ {t, i _ {t}} \left\| \boldsymbol {x} _ {t, i _ {t}} \right\| _ {\mathbf {M} _ {t} ^ {- 1}}\right) = \left\langle \boldsymbol {z} _ {t, i, i _ {t}}, \hat {\boldsymbol {\theta}} _ {t} \right\rangle + \epsilon_ {t, i} \left\| \boldsymbol {x} _ {t, i} \right\| _ {\mathbf {M} _ {t} ^ {- 1}} - \epsilon_ {t, i _ {t}} \left\| \boldsymbol {x} _ {t, i _ {t}} \right\| _ {\mathbf {M} _ {t} ^ {- 1}} \leq 0. \tag {22} +$$ + +With these considerations, + +$$ +\begin{array}{l} 2 \Delta_ {i _ {t}, j _ {t}} = u _ {i ^ {*} (t)} ^ {*} (\mathbf {X} _ {t}) - u _ {i _ {t}} ^ {*} (\mathbf {X} _ {t}) + u _ {i ^ {*} (t)} ^ {*} (\mathbf {X} _ {t}) - u _ {j _ {t}} ^ {*} (\mathbf {X} _ {t}) \\ = \left\langle \boldsymbol {z} _ {t, i _ {t} ^ {*}, i _ {t}}, \boldsymbol {\theta} ^ {*} \right\rangle + \left\langle \boldsymbol {z} _ {t, i _ {t} ^ {*}, j _ {t}}, \boldsymbol {\theta} ^ {*} \right\rangle \\ = \left\langle \boldsymbol {z} _ {t, i _ {t} ^ {*}, i _ {t}}, \boldsymbol {\theta} ^ {*} - \hat {\boldsymbol {\theta}} _ {t} \right\rangle + \left\langle \boldsymbol {z} _ {t, i _ {t} ^ {*}, i _ {t}}, \hat {\boldsymbol {\theta}} _ {t} \right\rangle + \left\langle \boldsymbol {z} _ {t, i _ {t} ^ {*}, j _ {t}}, \boldsymbol {\theta} ^ {*} - \hat {\boldsymbol {\theta}} _ {t} \right\rangle + \left\langle \boldsymbol {z} _ {t, i _ {t} ^ {*}, j _ {t}}, \hat {\boldsymbol {\theta}} _ {t} \right\rangle \\ \stackrel {(1 9)} {\leq} c _ {1} \left(\| \boldsymbol {z} _ {t, i _ {t} ^ {*}, i _ {t}} \| _ {\mathbf {M} _ {t} ^ {- 1}} + \| \boldsymbol {z} _ {t, i _ {t} ^ {*}, j _ {t}} \| _ {\mathbf {M} _ {t} ^ {- 1}}\right) + \langle \boldsymbol {z} _ {t, i _ {t} ^ {*}, i _ {t}}, \hat {\boldsymbol {\theta}} _ {t} \rangle + \langle \boldsymbol {z} _ {t, i _ {t} ^ {*}, j _ {t}}, \hat {\boldsymbol {\theta}} _ {t} \rangle \\ \stackrel {(2 0)} {\leq} c _ {1} \left(2 \left\| \boldsymbol {z} _ {t, i _ {t} ^ {*}, i _ {t}} \right\| _ {\mathbf {M} _ {t} ^ {- 1}} + \left\| \boldsymbol {z} _ {t, i _ {t}, j _ {t}} \right\| _ {\mathbf {M} _ {t} ^ {- 1}}\right) + 2 \left\langle \boldsymbol {z} _ {t, i _ {t} ^ {*}, i _ {t}}, \hat {\boldsymbol {\theta}} _ {t} \right\rangle + \left\langle \boldsymbol {z} _ {t, i _ {t}, j _ {t}}, \hat {\boldsymbol {\theta}} _ {t} \right\rangle \\ \stackrel {(2 1)} {\leq} 3 c _ {1} \left\| \boldsymbol {z} _ {t, i _ {t}, j _ {t}} \right\| _ {\mathbf {M} _ {t} ^ {- 1}} + 2 \langle \boldsymbol {z} _ {t, j _ {t}, i _ {t}}, \hat {\boldsymbol {\theta}} _ {t} \rangle + \langle \boldsymbol {z} _ {t, i _ {t}, j _ {t}}, \hat {\boldsymbol {\theta}} _ {t} \rangle \\ = 3 c _ {1} \left\| \boldsymbol {z} _ {t, i _ {t}, j _ {t}} \right\| _ {\mathbf {M} _ {t} ^ {- 1}} + \left\langle \boldsymbol {z} _ {t, j _ {t}, i _ {t}}, \hat {\boldsymbol {\theta}} _ {t} \right\rangle \\ \stackrel {(2 2)} {\leq} 3 c _ {1} \left\| \boldsymbol {z} _ {t, i _ {t}, j _ {t}} \right\| _ {\mathbf {M} _ {t} ^ {- 1}} + \epsilon_ {t, i _ {t}} \left\| \boldsymbol {x} _ {t, i _ {t}} \right\| _ {\mathbf {M} _ {t} ^ {- 1}} - \epsilon_ {t, j _ {t}} \left\| \boldsymbol {x} _ {t, j _ {t}} \right\| _ {\mathbf {M} _ {t} ^ {- 1}} \\ \leq 3 c _ {1} \| \boldsymbol {z} _ {t, i _ {t}, j _ {t}} \| _ {\mathbf {M} _ {t} ^ {- 1}} + c _ {2} \| \boldsymbol {z} _ {t, i _ {t}, j _ {t}} \| _ {\mathbf {M} _ {t} ^ {- 1}}, \\ \end{array} +$$ + +where the last inequality holds, since on $A_{\mathrm{conc},t}$ we have that + +$$ +\epsilon_ {t, i _ {t}} \left\| \boldsymbol {x} _ {t, i _ {t}} \right\| _ {\mathbf {M} _ {t} ^ {- 1}} - \epsilon_ {t, j _ {t}} \left\| \boldsymbol {x} _ {t, j _ {t}} \right\| _ {\mathbf {M} _ {t} ^ {- 1}} \leq c _ {2} \left\| \boldsymbol {z} _ {t, i _ {t}, j _ {t}} \right\| _ {\mathbf {M} _ {t} ^ {- 1}}. +$$ + +Thus, + +$$ +\mathbb {E} \left[ \Delta_ {i _ {t}, j _ {t}} 1 _ {A _ {\mathrm {M L E}} \cap A _ {\mathrm {i n i t}}} \right] \leq \frac {1}{2} \mathbb {E} \left[ \left(3 c _ {1} \| \boldsymbol {z} _ {t, i _ {t}, j _ {t}} \| _ {\mathbf {M} _ {t} ^ {- 1}} + c _ {2} \| \boldsymbol {z} _ {t, i _ {t}, j _ {t}} \| _ {\mathbf {M} _ {t} ^ {- 1}}\right) 1 _ {A _ {\mathrm {M L E}} \cap A _ {\mathrm {i n i t}}} 1 _ {A _ {\mathrm {c o n c}, t}} \right] + \Delta_ {m a x} p _ {3, t}, +$$ + +from which we can conclude the claim. + +![](images/6cf1dd95da5e2b7c5099b4b3613fb4ac595b3281212b0a4f42a1c1171bf10985.jpg) + +# C.3. Proof of Theorem C.1 + +Proof of Theorem C.1. Let $\Delta_{max} = 2\sqrt{2}$ then + +$$ +2 \Delta_ {i _ {t}, j _ {t}} = u _ {i ^ {*} (t)} ^ {*} (\mathbf {X} _ {t}) - u _ {i _ {t}} ^ {*} (\mathbf {X} _ {t}) + u _ {i ^ {*} (t)} ^ {*} (\mathbf {X} _ {t}) - u _ {j _ {t}} ^ {*} (\mathbf {X} _ {t}) \leq \Delta_ {\max}. +$$ + +Indeed, by assumption $\max \left( \| \pmb{x}_{t,i} \|^2, \| \pmb{x}_{t,j} \|^2 \right) \leq 1$ so that $\| \pmb{z}_{t,i,j} \|^2 \leq 2$ holds for all $i,j \in [n]$ . Further, by assumption $\| \pmb{\theta}^* \| \leq 1$ , so that by the Cauchy-Schwarz inequality + +$$ +\begin{array}{l} u _ {i ^ {*} (t)} ^ {*} (\mathbf {X} _ {t}) - u _ {i _ {t}} ^ {*} (\mathbf {X} _ {t}) + u _ {i ^ {*} (t)} ^ {*} (\mathbf {X} _ {t}) - u _ {j _ {t}} ^ {*} (\mathbf {X} _ {t}) \leq | u _ {i ^ {*} (t)} ^ {*} (\mathbf {X} _ {t}) - u _ {i _ {t}} ^ {*} (\mathbf {X} _ {t}) + u _ {i ^ {*} (t)} ^ {*} (\mathbf {X} _ {t}) - u _ {j _ {t}} ^ {*} (\mathbf {X} _ {t}) | \\ \leq \sqrt {\| z _ {t , i _ {t} * , i _ {t}} \| ^ {2} \| \boldsymbol {\theta} ^ {*} \| ^ {2}} + \sqrt {\| z _ {t , i _ {t} * , j _ {t}} \| ^ {2} \| \boldsymbol {\theta} ^ {*} \| ^ {2}} \\ \leq 2 \sqrt {2}. \\ \end{array} +$$ + +With this, we get + +$$ +\begin{array}{l} \mathbb {E} \left[ R _ {T} ^ {a} (\text {C o L S T I M}) \right] = \sum_ {t = 1} ^ {T} \mathbb {E} \left(\Delta_ {i _ {t}, j _ {t}}\right) \\ \leq \Delta_ {m a x} \tau + \sum_ {t = \tau + 1} ^ {T} \mathbb {E} \left[ \Delta_ {i _ {t}, j _ {t}} \right] \\ \leq \Delta_ {m a x} \tau + \Delta_ {m a x} T \left(\mathbb {P} \left(A _ {\text {i n i t}} ^ {\complement}\right) + \mathbb {P} \left(A _ {\mathrm {M L E}} ^ {\complement}\right)\right) + \sum_ {t = \tau + 1} ^ {T} \mathbb {E} \left[ \Delta_ {i _ {t}, j _ {t}} 1 _ {A _ {\mathrm {M L E}} \cap A _ {\mathrm {i n i t}}} \right] \\ = \Delta_ {m a x} \tau + \Delta_ {m a x} T \left(\mathbb {P} \left(A _ {\mathrm {i n i t}} ^ {\complement}\right) + \mathbb {P} \left(A _ {\mathrm {M L E}} ^ {\complement}\right)\right) + \sum_ {t = \tau + 1} ^ {T} \mathbb {E} \left[ \mathbb {E} \left[ \Delta_ {i _ {t}, j _ {t}} 1 _ {A _ {\mathrm {M L E}} \cap A _ {\mathrm {i n i t}}} \mid \mathcal {H} _ {t - 1} \right] \right], \\ \end{array} +$$ + +where the last equality is due to the tower property of the expected value. Using Lemma C.3, we obtain + +$$ +\begin{array}{l} \mathbb {E} \left[ R _ {T} ^ {a} (\text {C o L S T I M}) \right] \leq \Delta_ {m a x} \tau + \Delta_ {m a x} \sum_ {t = 1} ^ {T} p _ {3, t} + \Delta_ {m a x} T \left(\mathbb {P} \left(A _ {\text {i n i t}} ^ {\complement}\right) + \mathbb {P} \left(A _ {\text {M L E}} ^ {\complement}\right)\right) \\ + \frac {1}{2} \left(3 c _ {1} + c _ {2}\right) \sum_ {t = \tau + 1} ^ {T} \mathbb {E} \left[ \mathbb {E} [ \| \boldsymbol {z} _ {t, i _ {t}, j _ {t}} \| _ {\mathbf {M} _ {t} ^ {- 1}} 1 _ {A _ {\mathrm {i n i t}}} | \mathcal {H} _ {t - 1} ] \right]. \\ \end{array} +$$ + +On $A_{\mathrm{init}}$ it holds for any $i,j\in [n]$ and for each time step $t > \tau$ that + +$$ +\left\| \boldsymbol {z} _ {t, i, j} \right\| _ {\mathbf {M} _ {t} ^ {- 1}} = \sqrt {\boldsymbol {z} _ {t , i , j} ^ {\top} \mathbf {M} _ {t} ^ {- 1} \boldsymbol {z} _ {t , i , j}} \leq \sqrt {\boldsymbol {z} _ {t , i , j} ^ {\top} \boldsymbol {z} _ {t , i , j}} \leq \sqrt {2}. +$$ + +since $\| \pmb{z}_{t,i,j}\|^2 \leq 2$ holds by assumption (on the context vectors $(\pmb{x}_{t,i})_{i \in [n]}$ ) and $\mathbf{M}_t \geq \mathbf{I}_d$ holds on $A_{\mathrm{init}}$ . Thus, we can use Lemma C.2 to obtain + +$$ +\begin{array}{l} \mathbb {E} \left[ R _ {T} ^ {a} (\text {C o L S T I M}) \right] \leq \Delta_ {m a x} \tau + \Delta_ {m a x} \sum_ {t = \tau + 1} ^ {T} p _ {3, t} + \Delta_ {m a x} T \left(\mathbb {P} \left(A _ {\text {i n i t}} ^ {\complement}\right) + \mathbb {P} \left(A _ {\text {M L E}} ^ {\complement}\right)\right) \\ + \frac {c _ {3}}{2} \left(3 c _ {1} + c _ {2}\right) \sqrt {T \log \left(\frac {2 T}{d}\right)}, \\ \end{array} +$$ + +for any $c_3 \geq \sqrt{2d}$ . This lets us infer the first statement of the theorem, since $\mathbb{P}\big(A_{\mathrm{init}}^{\complement}\big) \leq p_2$ and $\mathbb{P}\big(A_{\mathrm{MLE}}^{\complement}\big) \leq p_1$ by assumption of the theorem. + +For the second statement note that by the Cauchy-Schwarz inequality + +$$ +\sum_ {t = \tau + 1} ^ {T} \sqrt {2} \wedge \| \boldsymbol {z} _ {t, i _ {t}, j _ {t}} \| _ {\mathbf {M} _ {t} ^ {- 1}} \leq \sum_ {t = \tau + 1} ^ {T} \sqrt {\boldsymbol {z} _ {t , i _ {t} , j _ {t}} ^ {\top} \mathbf {M} _ {t} ^ {- 1} \boldsymbol {z} _ {t , i _ {t} , j _ {t}}} \leq \sum_ {t = \tau + 1} ^ {T} \| \boldsymbol {z} _ {t, i _ {t}, j _ {t}} \| \| \mathbf {M} _ {t} ^ {- 1 / 2} \| \leq \sqrt {2} \sum_ {t = \tau + 1} ^ {T} \lambda_ {\min } ^ {- 1 / 2} (\mathbf {M} _ {t}), +$$ + +where we used the fact that the Euclidean matrix norm is consistent with the Euclidean vector norm. Thus, using the assumption on the smallest eigenvalue of $\mathbf{M}_t$ , we obtain + +$$ +\begin{array}{l} \mathbb {E} \left[ R _ {T} ^ {a} (\text {C o L S T I M}) \right] \leq \Delta_ {m a x} \tau + \Delta_ {m a x} \sum_ {t = \tau + 1} ^ {T} p _ {3, t} + \Delta_ {m a x} T \left(\mathbb {P} \left(A _ {\text {i n i t}} ^ {\complement}\right) + \mathbb {P} \left(A _ {\text {M L E}} ^ {\complement}\right)\right) \\ + \frac {c _ {3}}{2} \left(3 c _ {1} + c _ {2}\right) \sqrt {T \log \left(\frac {2 T}{d}\right)}, \\ \end{array} +$$ + +for any $c_{3} = \sqrt{2} c$ + +# D. Proof of Regret Upper Bounds for Sup-ColSTIM + +For some fixed constants $c_{1}, c_{2} > 0$ define the MLE concentration event + +$$ +A _ {\mathrm {M L E}} ^ {(S)} = \{\forall t > \tau , \forall s \in [ S ], \forall \{i, j \} \subset A _ {t} ^ {(s)}: | \hat {u} _ {t, i} ^ {(s)} (\mathbf {X} _ {t}) - u _ {i} ^ {*} (\mathbf {X} _ {t}) + u _ {j} ^ {*} (\mathbf {X} _ {t}) - \hat {u} _ {t, j} ^ {(s)} (\mathbf {X} _ {t}) | \leq c _ {1} \| \pmb {z} _ {t, i, j} \| _ {\mathbf {M} _ {t} ^ {- 1}} \} +$$ + +and the time-dependent perturbed estimated utility concentration event + +$$ +A _ {\mathrm {c o n c}, t} ^ {(S)} = \{\forall s \in [ S ], \forall \{i, j \} \subset A _ {t} ^ {(s)}: | \tilde {u} _ {t, i} (\mathbf {X} _ {t}) - \tilde {u} _ {t, j} (\mathbf {X} _ {t}) - \hat {u} _ {t, i} ^ {(s)} (\mathbf {X} _ {t}) + \hat {u} _ {t, j} ^ {(s)} (\mathbf {X} _ {t}) | \leq c _ {2} \| \pmb {z} _ {t, i, j} \| _ {\mathbf {M} _ {t} ^ {- 1}} \}. +$$ + +Moreover, define the initial concentration event + +$$ +A _ {\text {i n i t}} ^ {(S)} = \left\{\forall t > \tau , \forall s \in [ S ]: \left| \hat {\boldsymbol {\theta}} _ {t} ^ {(s)} - \boldsymbol {\theta} ^ {*} \right| \leq 1 \text {a n d} \mathbf {M} _ {t} ^ {(s)} \geq I _ {d} \right\}. +$$ + +As in Section C we denote the average regret for selecting pairs $(i_t,j_t)$ at time $t$ again by + +$$ +\Delta_ {i _ {t}, j _ {t}} = \frac {u _ {i ^ {*} (t)} ^ {*} (\mathbf {X} _ {t}) - u _ {i _ {t}} ^ {*} (\mathbf {X} _ {t}) + u _ {i ^ {*} (t)} ^ {*} (\mathbf {X} _ {t}) - u _ {j _ {t}} ^ {*} (\mathbf {X} _ {t})}{2}. +$$ + +Lemma D.1. For all time steps $t \in [T]$ and any stages $s \in [S]$ , given any realization of chosen arm-pairs $(i_t, j_t)_{t \in \Psi^{(s)}}$ , the corresponding preference observations $(Y_t)_{t \in \Psi^{(s)}}$ are independent Bernoulli distributed random variables with $Y_t$ having success probability $F^*(u_{i_t}^*(\mathbf{X}_t) - u_{j_t}^*(\mathbf{X}_t))$ . + +Proof. The proof is similar to Lemma 4 in (Li et al., 2017) or Lemma 14 in (Saha, 2021). + +Lemma D.2. Consider some time step $t \in [T] \setminus [\tau]$ and suppose that $(i_t, j_t)$ is chosen at stage $s_t \in [S]$ . Then, on the event $A_{\mathrm{MLE}}^{(S)}$ it holds that $i_t^* \in A_t^{(s)}$ for all $s \leq s_t$ . Moreover, on $A_{\mathrm{MLE}}^{(S)} \cap A_{\mathrm{conc},t}^{(S)}$ it holds that $\Delta_{i_t,j_t} \leq \left\{ \begin{array}{ll} \frac{2}{\sqrt{T}}, & \text{if } t \in \Psi^{(0)}, \\ \frac{4}{2^{s_t}}, & \text{else}. \end{array} \right.$ + +Proof. The proof of the first part (i.e., $i_t^* \in A_t^{(s)} \forall s \leq s_t$ ) is analogous to Lemma 6 in (Li et al., 2017) or Part-1 in Lemma 6 in (Saha, 2021), as $A_{\mathrm{MLE}}^{(S)}$ corresponds to the set $\mathcal{E}_X$ (Li et al., 2017) or $\mathcal{E}$ (Saha, 2021). + +Next, let us write for sake of brevity $s = s_t$ and let us assume that $t \in \Psi^{(0)}$ , i.e., it holds that + +$$ +w _ {i, j} ^ {(s)} \left(\mathbf {X} _ {t}\right) = c _ {1} \| \boldsymbol {z} _ {t, i, j} \| _ {\left(\mathbf {M} _ {t} ^ {(s)}\right) ^ {- 1}} \leq 1 / \sqrt {T}, \quad \forall i, j \in A _ {t} ^ {\left(s _ {t}\right)}. \tag {23} +$$ + +On the event $A_{\mathrm{MLE}}^{(S)}$ it holds that + +$$ +\begin{array}{l} \left\langle \boldsymbol {z} _ {t, i _ {t} ^ {*}, i _ {t}}, \boldsymbol {\theta} ^ {*} - \hat {\boldsymbol {\theta}} _ {t} ^ {(s)} \right\rangle = u _ {i _ {t} ^ {*}} ^ {*} (\mathbf {X} _ {t}) - \hat {u} _ {t, i _ {t} ^ {*}} ^ {(s)} (\mathbf {X} _ {t}) + \hat {u} _ {t, i _ {t}} ^ {(s)} (\mathbf {X} _ {t}) - u _ {i _ {t}} ^ {*} (\mathbf {X} _ {t}) \\ \leq \left| u _ {i _ {t} ^ {*}} ^ {*} (\mathbf {X} _ {t}) - \hat {u} _ {t, i _ {t} ^ {*}} ^ {(s)} (\mathbf {X} _ {t}) + \hat {u} _ {t, i _ {t}} ^ {(s)} (\mathbf {X} _ {t}) - u _ {i _ {t}} ^ {*} (\mathbf {X} _ {t}) \right| \tag {24} \\ \leq c _ {1} \left\| \boldsymbol {z} _ {t, i, j} \right\| _ {\left(\mathbf {M} _ {t} ^ {(s)}\right) ^ {- 1}} \\ \end{array} +$$ + +and similarly $\langle \pmb{z}_{t,i_t^*,j_t},\pmb{\theta}^* -\hat{\pmb{\theta}}_t\rangle \leq c_1\| \pmb{z}_{t,i_t^*,j_t}\|_{\mathbf{M}_t^{-1}}$ where we used that $i_t^*\in A_t^{(s)}$ for all $s\leq s_t$ from the first part of the lemma. On $A_{\mathrm{conc},t}^{(S)}$ we have that + +$$ +\epsilon_ {t, i _ {t}} \left\| \boldsymbol {x} _ {t, i _ {t}} \right\| _ {\left(\mathbf {M} _ {t} ^ {(s _ {t})}\right) ^ {- 1}} - \epsilon_ {t, j _ {t}} \left\| \boldsymbol {x} _ {t, j _ {t}} \right\| _ {\left(\mathbf {M} _ {t} ^ {(s _ {t})}\right) ^ {- 1}} \leq c _ {2} \left\| \boldsymbol {z} _ {t, i _ {t}, j _ {t}} \right\| _ {\left(\mathbf {M} _ {t} ^ {(s _ {t})}\right) ^ {- 1}}. \tag {25} +$$ + +Further, since $t \in \Psi^{(0)}$ the choice of $j_{t}$ implies for all $i \in A_t^{(s_t)}$ that + +$$ +\left\langle \boldsymbol {z} _ {t, i, i _ {t}}, \hat {\boldsymbol {\theta}} _ {t} ^ {(s _ {t})} \right\rangle + c _ {1} \left\| \boldsymbol {z} _ {t, i, i _ {t}} \right\| _ {\left(\mathbf {M} _ {t} ^ {(s _ {t})}\right) ^ {- 1}} \leq \left\langle \boldsymbol {z} _ {t, j _ {t}, i _ {t}}, \hat {\boldsymbol {\theta}} _ {t} ^ {(s _ {t})} \right\rangle + c _ {1} \left\| \boldsymbol {z} _ {t, i _ {t}, j _ {t}} \right\| _ {\left(\mathbf {M} _ {t} ^ {(s _ {t})}\right) ^ {- 1}} \leq \left\langle \boldsymbol {z} _ {t, j _ {t}, i _ {t}}, \hat {\boldsymbol {\theta}} _ {t} ^ {(s _ {t})} \right\rangle + 1 / \sqrt {T}, \tag {26} +$$ + +while the choice of $i_t$ implies for all $i \in A_t^{(s_t)}$ that + +$$ +\begin{array}{l} \left\langle \boldsymbol {x} _ {t, i}, \hat {\boldsymbol {\theta}} _ {t} ^ {(s _ {t})} \right\rangle + \epsilon_ {t, i} \| \boldsymbol {x} _ {t, i} \| _ {\left(\mathbf {M} _ {t} ^ {(s _ {t})}\right) ^ {- 1}} - \left(\left\langle \boldsymbol {x} _ {t, i _ {t}}, \hat {\boldsymbol {\theta}} _ {t} ^ {(s _ {t})} \right\rangle + \epsilon_ {t, i _ {t}} \| \boldsymbol {x} _ {t, i _ {t}} \| _ {\left(\mathbf {M} _ {t} ^ {(s _ {t})}\right) ^ {- 1}}\right) \tag {27} \\ = \langle \pmb {z} _ {t, i, i _ {t}}, \hat {\pmb {\theta}} _ {t} ^ {(s _ {t})} \rangle + \epsilon_ {t, i} \| \pmb {x} _ {t, i} \| _ {(\mathbf {M} _ {t} ^ {(s _ {t})}) ^ {- 1}} - \epsilon_ {t, i _ {t}} \| \pmb {x} _ {t, i _ {t}} \| _ {(\mathbf {M} _ {t} ^ {(s _ {t})}) ^ {- 1}} \leq 0. \\ \end{array} +$$ + +With these considerations, + +$$ +\begin{array}{l} 2 \Delta_ {i _ {t}, j _ {t}} = u _ {i ^ {*} (t)} ^ {*} (\mathbf {X} _ {t}) - u _ {i _ {t}} ^ {*} (\mathbf {X} _ {t}) + u _ {i ^ {*} (t)} ^ {*} (\mathbf {X} _ {t}) - u _ {j _ {t}} ^ {*} (\mathbf {X} _ {t}) \\ = \left\langle \boldsymbol {z} _ {t, i _ {t} ^ {*}, i _ {t}}, \boldsymbol {\theta} ^ {*} \right\rangle + \left\langle \boldsymbol {z} _ {t, i _ {t} ^ {*}, j _ {t}}, \boldsymbol {\theta} ^ {*} \right\rangle \\ = \langle \pmb {z} _ {t, i _ {t} ^ {*}, i _ {t}}, \pmb {\theta} ^ {*} - \hat {\pmb {\theta}} _ {t} ^ {(s _ {t})} \rangle + \langle \pmb {z} _ {t, i _ {t} ^ {*}, i _ {t}}, \hat {\pmb {\theta}} _ {t} ^ {(s _ {t})} \rangle + \langle \pmb {z} _ {t, i _ {t} ^ {*}, j _ {t}}, \pmb {\theta} ^ {*} - \hat {\pmb {\theta}} _ {t} ^ {(s _ {t})} \rangle + \langle \pmb {z} _ {t, i _ {t} ^ {*}, j _ {t}}, \hat {\pmb {\theta}} _ {t} ^ {(s _ {t})} \rangle \\ \stackrel {(2 4)} {\leq} c _ {1} \big (\| \pmb {z} _ {t, i _ {t} ^ {*}, i _ {t}} \| _ {(\mathbf {M} _ {t} ^ {(s)}) ^ {- 1}} + \| \pmb {z} _ {t, i _ {t} ^ {*}, j _ {t}} \| _ {(\mathbf {M} _ {t} ^ {(s)}) ^ {- 1}} \big) + \langle \pmb {z} _ {t, i _ {t} ^ {*}, i _ {t}}, \hat {\pmb {\theta}} _ {t} ^ {(s _ {t})} \rangle + \langle \pmb {z} _ {t, i _ {t} ^ {*}, j _ {t}}, \hat {\pmb {\theta}} _ {t} ^ {(s _ {t})} \rangle \\ \stackrel {(2 0)} {\leq} c _ {1} \left(2 \left\| \boldsymbol {z} _ {t, i _ {t} ^ {*}, i _ {t}} \right\| _ {(\mathbf {M} _ {t} ^ {(s)}) ^ {- 1}} + \left\| \boldsymbol {z} _ {t, i _ {t}, j _ {t}} \right\| _ {(\mathbf {M} _ {t} ^ {(s)}) ^ {- 1}}\right) + 2 \langle \boldsymbol {z} _ {t, i _ {t} ^ {*}, i _ {t}}, \hat {\boldsymbol {\theta}} _ {t} ^ {(s _ {t})} \rangle + \langle \boldsymbol {z} _ {t, i _ {t}, j _ {t}}, \hat {\boldsymbol {\theta}} _ {t} ^ {(s _ {t})} \rangle \\ \stackrel {(2 6)} {\leq} 3 c _ {1} \| \boldsymbol {z} _ {t, i _ {t}, j _ {t}} \| _ {(\mathbf {M} _ {t} ^ {(s)}) ^ {- 1}} + 2 \langle \boldsymbol {z} _ {t, j _ {t}, i _ {t}}, \hat {\boldsymbol {\theta}} _ {t} ^ {(s _ {t})} \rangle + \langle \boldsymbol {z} _ {t, i _ {t}, j _ {t}}, \hat {\boldsymbol {\theta}} _ {t} ^ {(s _ {t})} \rangle \\ = 3 c _ {1} \left\| \boldsymbol {z} _ {t, i _ {t}, j _ {t}} \right\| _ {\left(\mathbf {M} _ {t} ^ {(s)}\right) ^ {- 1}} + \left\langle \boldsymbol {z} _ {t, j _ {t}, i _ {t}}, \hat {\boldsymbol {\theta}} _ {t} ^ {(s _ {t})} \right\rangle \\ \stackrel {(2 7)} {\leq} 3 c _ {1} \left\| \boldsymbol {z} _ {t, i _ {t}, j _ {t}} \right\| _ {\left(\mathbf {M} _ {t} ^ {(s)}\right) ^ {- 1}} + \epsilon_ {t, i _ {t}} \left\| \boldsymbol {x} _ {t, i _ {t}} \right\| _ {\left(\mathbf {M} _ {t} ^ {(s)}\right) ^ {- 1}} - \epsilon_ {t, j _ {t}} \left\| \boldsymbol {x} _ {t, j _ {t}} \right\| _ {\left(\mathbf {M} _ {t} ^ {(s)}\right) ^ {- 1}} \\ \stackrel {(2 5)} {\leq} 3 c _ {1} \left\| \boldsymbol {z} _ {t, i _ {t}, j _ {t}} \right\| _ {\left(\mathbf {M} _ {t} ^ {(s)}\right) ^ {- 1}} + c _ {2} \left\| \boldsymbol {z} _ {t, i _ {t}, j _ {t}} \right\| _ {\left(\mathbf {M} _ {t} ^ {(s)}\right) ^ {- 1}} \\ \stackrel {(2 3)} {\leq} \frac {4}{\sqrt {T}}, \\ \end{array} +$$ + +where we used in the last inequality that by choice $c_{2} \leq c_{1}$ . This shows the case $t \in \Psi^{(0)}$ . + +Finally, showing $\Delta_{i_t,j_t} \leq \frac{4}{2^{s_t}}$ if $t \notin \Psi^{(0)}$ is analogous to Part-3 of Lemma 6 in (Saha, 2021), as the choice of the pair $(i_t,j_t)$ is the same as for Sta'D in this case. Note that we do not need to condition on the event $A_{\mathrm{conc},t}^{(S)}$ for this case. + +Lemma D.3. On the event $A_{\mathrm{init}}^{(S)}$ it holds for any $s \in [S]$ that $\sqrt{|\Psi^{(s)}|} \leq c_1 2^s \sqrt{2d \log(4T^2 / d)}$ . + +Proof. The proof is analogous to Lemma 7 in (Saha, 2021), as the event $A_{\mathrm{init}}^{(S)}$ ensures that the smallest eigenvalue of any stage-dependent Gram matrix $\mathbf{M}_t^{(s)}$ is at least $1^5$ . + +Proof of Theorem 3.4. By the choice of the initial exploration length $\tau = d + \max \left\{d^{2}\log (T) / \mu^{2}\rho ,d / \rho \right\}$ and Assumption (A1) we can infer that the smallest eigenvalue of the Gram matrix $\mathbf{M}_t$ is at least $\rho \tau = \max \left(1,\frac{d\log(T / d) + 2\log(T)}{\mu^2}\right)$ , so that following the lines of proof of Lemma 4 in (Saha, 2021) we have that $\mathbb{P}\big(A_{\mathrm{init}}^{(S)}\big)\geq 1 - 1 / T$ . Moreover, due to + +the choice of $c_{1} = \frac{3}{2\mu}\sqrt{2\log(3nT^{2})}$ as well as Lemma D.1 (corresponds to Lemma 14 in (Saha, 2021)) it holds that $\mathbb{P}\big(A_{\mathrm{MLE}}^{(S)}\big)\geq 1 - 1 / T$ . As in the proof of Theorem 3.2 it is straightforward to show that $\mathbb{P}(A_{\mathrm{conc},t}^{(S)}\mid \mathcal{H}_{t - 1})\geq 1 - p_t$ and + +$$ +\sum_ {t = \tau + 1} ^ {T} p _ {t} \leq \frac {\sqrt {2 d}}{2} \left(3 c _ {1} + c _ {2}\right) \sqrt {\log \left(\frac {2 T}{d}\right)} \sum_ {t = 1} ^ {T} \frac {1}{\sqrt {t}} \leq \frac {\sqrt {2 d}}{2} \left(3 c _ {1} + c _ {2}\right) \sqrt {T \log \left(\frac {2 T}{d}\right)} = O (\sqrt {d T \log (n)} \log (T)). \tag {28} +$$ + +With this, we get + +$$ +\begin{array}{l} \mathbb {E} \left[ R _ {T} ^ {a} (\operatorname {S u p - C o L S T I M}) \right] = \sum_ {t = 1} ^ {\tau} \mathbb {E} [ \Delta_ {i _ {t}, j _ {t}} ] + \sum_ {t \in \Psi^ {(0)}} \mathbb {E} [ \Delta_ {i _ {t}, j _ {t}} ] + \sum_ {s = 1} ^ {S} \sum_ {t \in \Psi^ {(s)}} \mathbb {E} [ \Delta_ {i _ {t}, j _ {t}} ] \\ \leq \Delta_ {m a x} \tau + \Delta_ {m a x} T \left(\mathbb {P} \big ((A _ {\mathrm {i n i t}} ^ {(S)}) ^ {\complement} \big) + \mathbb {P} \big ((A _ {\mathrm {M L E}} ^ {(S)}) ^ {\complement} \big)\right) + \sum_ {t = \tau + 1} ^ {T} p _ {t} \\ + \sum_ {t \in \Psi^ {(0)}} \mathbb {E} \left[ \mathbb {E} [ \Delta_ {i _ {t}, j _ {t}} 1 _ {A _ {\mathrm {i n i t}} ^ {(S)} \cap A _ {\mathrm {M L E}} ^ {(S)} \cap A _ {\mathrm {c o n c}, t} ^ {(S)}} | \mathcal {H} _ {t - 1} ] \right] \\ + \sum_ {s = 1} ^ {S} \sum_ {t \in \Psi^ {(s)}} \mathbb {E} \left[ \mathbb {E} [ \Delta_ {i _ {t}, j _ {t}} 1 _ {A _ {\mathrm {i n i t}} ^ {(S)} \cap A _ {\mathrm {M L E}} ^ {(S)} \cap A _ {\mathrm {c o n c}, t} ^ {(S)}} | \mathcal {H} _ {t - 1} ] \right] \\ \leq \Delta_ {m a x} \tau + 2 \Delta_ {m a x} + \sum_ {t = \tau + 1} ^ {T} p _ {t} + \frac {2 | \Psi^ {(0)} |}{\sqrt {T}} + 4 \sum_ {s = 1} ^ {S} \frac {| \Psi^ {(s)} |}{2 ^ {s}} (Lemma D.2) \\ \leq \Delta_ {m a x} \tau + 2 \Delta_ {m a x} + \sum_ {t = \tau + 1} ^ {T} p _ {t} + \frac {2 | \Psi^ {(0)} |}{\sqrt {T}} + 4 c _ {1} \sqrt {2 d \log (4 T ^ {2} / d)} \sum_ {s = 1} ^ {S} \sqrt {| \Psi^ {(s)} |} (Lemma D.3) \\ \leq \Delta_ {m a x} \tau + 2 \Delta_ {m a x} + \sum_ {t = \tau + 1} ^ {T} p _ {t} + 2 \sqrt {T} + 4 c _ {1} \sqrt {2 d \log (4 T ^ {2} / d)} \sqrt {T \log (T)}. \\ \end{array} +$$ + +(Cauchy-Schwarz inequality and $|\Psi^{(s)}| \leq T$ ) + +Using (28) and noting that $c_{1} = O\big(\sqrt{\log(nT)}\big)$ as well as $\tau = o\big(\sqrt{dT}\big)$ , we can conclude the proof. + +![](images/51d5cc8ef86a6c0d03b2c8fb98160aa64c100eef3bd03048072e4a6cafe23bf5.jpg) + +# E. SGD vs. Full Maximum-Likelihood-Estimation + +Figure 3 illustrates the difference in regret for the easy problem scenario $E(10,50,G^{*})$ for $G^{*}$ being the standard Gumbel distribution. There is not much of a difference between the resulting regret curves for MaxInP, while the full MLE variant of CoLSTIM performs slightly better than its SGD variant. Moreover, the full MLE variant of CoLSTIM has a smaller fluctuation in the sense that its range of the standard error is smaller than of its SGD variant. + +![](images/dd58676f2a529b5594e7cf3a66701b2ce7ce84e9bd02da13699c201fc2143752.jpg) +Figure 3. Averaged cumulative regret of the SGD variants of CoLSTIM and MaxInP and their full MLE variants on $E(d, n, G^{*})$ for $G^{*}$ being standard Gumbel. + +However, regarding the average elapsed runtimes (in seconds), we see a huge difference between the SGD variants and the full MLE variants as Table E shows. + +Table 2. Averaged cumulative runtimes and the corresponding standard deviations (in brackets) of the SGD variants of CoLSTIM and MaxInP and their full MLE variants on $E\left( {d,n,{G}^{ * }}\right)$ for ${G}^{ * }$ being standard Gumbel. + +
avg. runtimes (std)
MaxInP-SGD158.00 (4.04)
MaxInP-MLE910.13 (113.99)
CoLSTIM-SGD7.01 (0.15)
CoLSTIM-MLE747.04 (113.63)
\ No newline at end of file diff --git a/stochasticcontextualduelingbanditsunderlinearstochastictransitivitymodels/images.zip b/stochasticcontextualduelingbanditsunderlinearstochastictransitivitymodels/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..82a0060f619d9fa9615905aa26ab2f55e5cf9663 --- /dev/null +++ b/stochasticcontextualduelingbanditsunderlinearstochastictransitivitymodels/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c411df3634e7e76b4f9adbff043555c848b0c9e25c3877f815c0922e2e462569 +size 1646688 diff --git a/stochasticcontextualduelingbanditsunderlinearstochastictransitivitymodels/layout.json b/stochasticcontextualduelingbanditsunderlinearstochastictransitivitymodels/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..611f09dad36d3a65e76651e308f54f3964996bb3 --- /dev/null +++ b/stochasticcontextualduelingbanditsunderlinearstochastictransitivitymodels/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6d4ba0909a888a0aa08af1b194381deab8dec90de2aaa2048958e12d205910a9 +size 1125257 diff --git a/stochasticcontinuoussubmodularmaximizationboostingvianonobliviousfunction/4f8b7d33-8059-461d-950f-1176583803c9_content_list.json b/stochasticcontinuoussubmodularmaximizationboostingvianonobliviousfunction/4f8b7d33-8059-461d-950f-1176583803c9_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..96dcdbeeff8a4a1086b10e7ffa2c54e867c1b2fd --- /dev/null +++ b/stochasticcontinuoussubmodularmaximizationboostingvianonobliviousfunction/4f8b7d33-8059-461d-950f-1176583803c9_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:df3e1cc0f1eac6b6ba2edf18098e8e26d2d860bdd6f2b1f0496d321bdc87a6fd +size 159455 diff --git a/stochasticcontinuoussubmodularmaximizationboostingvianonobliviousfunction/4f8b7d33-8059-461d-950f-1176583803c9_model.json b/stochasticcontinuoussubmodularmaximizationboostingvianonobliviousfunction/4f8b7d33-8059-461d-950f-1176583803c9_model.json new file mode 100644 index 0000000000000000000000000000000000000000..dc4b133f85c2c5e1fbedecd2af2b93c390cbdc7d --- /dev/null +++ b/stochasticcontinuoussubmodularmaximizationboostingvianonobliviousfunction/4f8b7d33-8059-461d-950f-1176583803c9_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d85465077e75000231180f2b001911a85dbf9d2951cf1ee449594ca9200d3a50 +size 187529 diff --git a/stochasticcontinuoussubmodularmaximizationboostingvianonobliviousfunction/4f8b7d33-8059-461d-950f-1176583803c9_origin.pdf b/stochasticcontinuoussubmodularmaximizationboostingvianonobliviousfunction/4f8b7d33-8059-461d-950f-1176583803c9_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..da941a1ef9b48e1fddabbdbd8daf29f1aa71701d --- /dev/null +++ b/stochasticcontinuoussubmodularmaximizationboostingvianonobliviousfunction/4f8b7d33-8059-461d-950f-1176583803c9_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4fe8eb525fdbc2e55c056fa326d267ee4cae23ce495918b873c0c64deb9cd3f9 +size 581885 diff --git a/stochasticcontinuoussubmodularmaximizationboostingvianonobliviousfunction/full.md b/stochasticcontinuoussubmodularmaximizationboostingvianonobliviousfunction/full.md new file mode 100644 index 0000000000000000000000000000000000000000..f9c20cdd389bc0b976b1b6ee6b9e36d171a6eafb --- /dev/null +++ b/stochasticcontinuoussubmodularmaximizationboostingvianonobliviousfunction/full.md @@ -0,0 +1,751 @@ +# Stochastic Continuous Submodular Maximization: Boosting via Non-oblivious Function + +Qixin Zhang $^{12}$ Zengde Deng $^{2}$ Zaiyi Chen $^{2}$ Haoyuan Hu $^{2}$ Yu Yang $^{1}$ + +# Abstract + +In this paper, we revisit Stochastic Continuous Submodular Maximization in both offline and online settings, which can benefit wide applications in machine learning and operations research areas. We present a boosting framework covering gradient ascent and online gradient ascent. The fundamental ingredient of our methods is a novel non-oblivious function $F$ derived from a factor-revealing optimization problem, whose any stationary point provides a $(1 - e^{-\gamma})$ -approximation to the global maximum of the $\gamma$ -weakly DR-submodular objective function $f \in C_L^{1,1}(\mathcal{X})$ . Under the offline scenario, we propose a boosting gradient ascent method achieving $(1 - e^{-\gamma} - \epsilon^2)$ -approximation after $O(1 / \epsilon^2)$ iterations, which improves the $\left(\frac{\gamma^2}{1 + \gamma^2}\right)$ approximation ratio of the classical gradient ascent algorithm. In the online setting, for the first time we consider the adversarial delays for stochastic gradient feedback, under which we propose a boosting online gradient algorithm with the same non-oblivious function $F$ . Meanwhile, we verify that this boosting online algorithm achieves a regret of $O(\sqrt{D})$ against a $(1 - e^{-\gamma})$ -approximation to the best feasible solution in hindsight, where $D$ is the sum of delays of gradient feedback. To the best of our knowledge, this is the first result to obtain $O(\sqrt{T})$ regret against a $(1 - e^{-\gamma})$ -approximation with $O(1)$ gradient inquiry at each time step, when no delay exists, i.e., $D = T$ . Finally, numerical experiments demonstrate the effectiveness of our boosting methods. + +# 1. Introduction + +Due to the relatively low computational complexity, first-order optimization methods are widely used in machine learning, operations research, and statistics communities. Especially for convex objectives, there is an enormous literature (Bertsekas, 2015; Nesterov, 2013) deriving the convergence rate of first-order methods. Recent studies have shown that first-order optimization methods could also achieve the global minimum for some special non-convex problems (Netrapalli et al., 2014; Arora et al., 2016; Ge et al., 2016; Du et al., 2019; Liu et al., 2020), although it is in general NP-hard to find the global minima of a non-convex objective function (Murty & Kabadi, 1987). Motivated by this, some recent work focused on the structures and conditions under which non-convex optimization is tractable (Bian et al., 2017; Hazan et al., 2016a). In this paper, we investigate the stochastic $\gamma$ -weakly continuous submodular maximization problem where an unbiased gradient oracle is available under both offline and online scenarios. + +Continuous DR-Submodular Maximization has drawn much attention recently due to that it admits efficient approximate maximization routines. For instance, under the offline deterministic setting, Bian et al. (2020; 2017) proposed the vanilla Frank-Wolfe method and its variant achieving $1/2$ and $(1 - 1/e)$ approximations, respectively. When the stochastic estimates of the gradient is available, Mokhtari et al. (2018) and Hassani et al. (2020) proposed some improved variants of the Frank-Wolfe algorithm, equipped with variance reduction techniques. In (Hassani et al., 2020), assuming the Lipschitz continuity of stochastic Hessian, a $[(1 - 1/e)OPT - \varepsilon]$ solution is achieved using $O(1/\varepsilon^2)$ stochastic gradient. Such a result provides the tightest approximation as well as the optimal stochastic first-order oracle complexity. + +However, when generalizing Frank-Wolfe methods to the online setting, some other tricks should be involved, which makes the algorithm design more complicated. For example, Chen et al. (2018b) and Zhang et al. (2019) took the idea of meta actions (Streeter & Golovin, 2008) and blocking procedure to propose online Frank-Wolfe algorithms. Moreover, in these aforementioned studies, the environment/adversary reveals the reward and stochastic first-order information im + +mediately after the action is chosen by the learner/algorithm. In practice, the assumption of immediate feedback might be too restrictive. The feedback delays widely exist in many real-world applications, e.g., online advertising (Mehta et al., 2007), influence maximization problem (Chen et al., 2012; Yang et al., 2016). + +To tackle these issues, instead of Frank-Wolfe, we adopt Gradient Ascent and aim to propose a uniform algorithmic framework for both offline and online Stochastic Continuous Submodular Maximization. To make the online setting more realistic, we also consider adversarial feedback delays (Quanrud & Khashabi, 2015). Note that our online setting degenerates to the standard online setting if no delay exists. One big challenge in front of us is that the stationary points of a $\gamma$ -weakly submodular function $f$ only provide a limited $(\frac{\gamma^2}{1 + \gamma^2})$ -approximation to the global maximum (Hassani et al., 2017). As a result, we need to boost stochastic gradient ascent and its online counterpart (Hassani et al., 2017) as they only attain a $(\frac{\gamma^2}{1 + \gamma^2})$ -approximation. To tackle this challenge, we hope to devise an auxiliary function whose stationary points provide a better approximation guarantee than those of $f$ itself. Motivated by (Filmus & Ward, 2012; 2014; Feldman et al., 2011; Feldman, 2021; Harshaw et al., 2019; Mitra et al., 2021), we first consider a family of auxiliary functions whose gradient at point $\pmb{x}$ allocates different weight to the gradient $\nabla f(z * \pmb{x})$ where $z \in [0,1]$ . By solving a factor-revealing optimization problem, we select the optimal auxiliary function $F$ whose stationary points provide a tight $(1 - e^{-\gamma})$ -approximation to the global maximum of $f$ . Then, based on this optimal auxiliary function $F$ , we propose a simple first-order framework that makes it possible to boost the performance of classical gradient ascent algorithm converging to stationary points. + +Based on this boosting framework, we present a boosting gradient ascent and a boosting online gradient ascent to improve the approximation guarantees of vanilla gradient ascent and its online counterpart. To be specific, we make the following contributions: + +1. We develop a uniform boosting framework, including gradient ascent and online gradient ascent methods. The essential element behind our framework is an optimal auxiliary function $F$ derived from a factor-revealing optimization problem for each $\gamma$ -weakly DR-submodular function $f$ . The stationary points of $F$ provide a $(1 - e^{-\gamma})$ -approximation guarantee to the global maximum of $f$ . This approximation is better than the $(\frac{\gamma^2}{1 + \gamma^2})$ -approximation provided by stationary points of $f$ itself. +2. With this non-oblivious function $F$ , under the offline setting, we propose the boosting gradient ascent method achieving a $(1 - e^{-\gamma} - \epsilon^2)$ -approximation + +Table 1. Comparison of convergence guarantees for continuous DR-submodular function maximization, where the functions are monotone. Except for (Bian et al., 2017) which needs the constraint set to be convex and down-closed, other methods here need the constraint set $\mathcal{C}$ to be convex. Note that 'det.' and 'sto.' represent the deterministic and stochastic setting, respectively. 'Hess Lip' means whether the Hessian of functions needs to be Lipschitz continuous, 'OPT' is the function value at the global optimum, 'Complexity' is the gradient oracle complexity. For simplicity, we set $\gamma = 1$ for our results which reduces to the standard monotone DR-submodular setting. + +
MethodSettingHess LipUtilityComplexity
Submodular FW (Bian et al., 2017)det.No(1-1/e)OPT - εO(1/ε)
SGA (Hassani et al., 2017)sto.No(1/2)OPT - εO(1/ε2)
Classical FW (Bian et al., 2020)det.No(1/2)OPT - εO(1/ε2)
SCG (Mokhtari et al., 2018)sto.No(1-1/e)OPT - εO(1/ε3)
SCG++ (Hassani et al., 2020)sto.Yes(1-1/e)OPT - εO(1/ε2)
Non-Oblivious FW (Mitra et al., 2021)det.No(1-1/e - ε)OPT - εO(1/ε3)
Boosting GA (This paper)sto.No(1-1/e - ε2)OPT - εO(1/ε2)
+ +after $O(1 / \epsilon^2)$ iterations, which improves the $\left(\frac{\gamma^2}{1 + \gamma^2}\right)$ -approximation of the classical projected gradient ascent algorithm and weakens the assumption of high order smoothness on the objective functions (Hassani et al., 2020). + +3. Next, we consider an online submodular maximization setting with adversarial feedback delays. When an unbiased stochastic gradients estimation is available, we propose an online boosting gradient ascent algorithm that theoretically achieves the optimal $(1 - e^{-\gamma})$ -regret of $O(\sqrt{D})$ with one gradient evaluation for each $f_{t}$ where $D = \sum_{t=1}^{T} d_{t}$ and $d_{t}$ is a positive integer delay for round $t$ . To the best of our knowledge, our work is the first to investigate the adversarial delays in online submodular maximization problems. Moreover, when $D = T$ for the standard no-delay setting, our proposed online boosting gradient ascent algorithm, requiring only $O(1)$ stochastic gradient estimate at each round, yields the first result to achieve $(1 - e^{-\gamma})$ -approximation with $O(\sqrt{T})$ regret. +4. Finally, we empirically evaluate our proposed boosting methods using the special example of (Hassani et al., 2017) and the simulated non-convex/non-concave quadratic programming. Our algorithms have superior performance in the experiments. + +# 1.1. Related Work + +Submodular Set Functions: Submodular set functions originate from combinatorial optimization problems (Nemhauser et al., 1978; Fisher et al., 1978; Fujishige, 2005), which could be either exactly minimized via Lovász extension (Lovász, 1983) or approximately maximized via multilinear extension (Chekuri et al., 2014). Submodular set functions find numerous applications in machine + +Table 2. Comparison of regrets for stochastic online continuous DR-submodular function maximization with full-information feedback, where the functions are monotone and constraint set $\mathcal{C}$ is convex. Note that '# Grad. Evaluations' means the number of stochastic gradient evaluations at each round, 'Ratio' means approximation ratio, and 'Delay' indicates whether the adversarial delayed feedback is considered. For simplicity, we set $\gamma = 1$ for our results which reduces to the standard monotone DR-submodular setting, and $D = T$ which means no delay exists. + +
Method# Grad. EvaluationsRatioRegretDelay
OGA (Chen et al., 2018b)O(1)1/2O(√T)No
Meta-FW-VR (Chen et al., 2018a)T3/21 - 1/eO(√T)No
Mono-FW (Zhang et al., 2019)O(1)1 - 1/eO(T4/5)No
Boosting OGA (This paper)O(1)1 - 1/eO(√T)Yes
+ +learning and other related areas, including viral marketing (Kempe et al., 2003), document summarization (Lin & Bilmes, 2011), network monitoring (Leskovec et al., 2007), and variable selection (Das & Kempe, 2011; Elenberg et al., 2018). + +Continuous Submodular Maximization: Submodularity can be naturally extended to continuous domains. In deterministic setting, Bian et al. (2017) first proposed a variant of Frank-Wolfe (Submodular FW) for continuous DR-submodular maximization problem with $(1 - 1 / e)$ -approximation guarantee after $O(1 / \epsilon)$ iterations. As for the stochastic setting, Hassani et al. (2017) proved that the stochastic gradient ascent (SGA) guarantees a $(1 / 2)$ -approximation after $O(1 / \epsilon^2)$ iterations. Then, Mokhtari et al. (2018) proposed the stochastic continuous greedy algorithm (SCG), which achieves a $(1 - 1 / e)$ -approximation after $O(1 / \epsilon^3)$ iterations. Moreover, by assuming the Hessian of objective is Lipschitz continuous, Hassani et al. (2020) proposed the stochastic continuous greedy++ algorithm (SCG++, which guarantees a $(1 - 1 / e)$ -approximation after $O(1 / \epsilon^2)$ iterations. + +Online Continuous Submodular Maximization: Chen et al. (2018b) first investigated the online (stochastic) gradient ascent (OGA) with a $(1/2)$ -regret of $O(\sqrt{T})$ . Then, inspired by the meta actions (Streeter & Golovin, 2008), Chen et al. (2018b) also proposed the Meta-Frank-Wolfe algorithm with a $(1 - 1/e)$ -regret bound of $O(\sqrt{T})$ under the deterministic setting. Assuming that an unbiased estimation of the gradient is available, Chen et al. (2018a) proposed a variant of the Meta-Frank-Wolfe algorithm (Meta-FW-VR) having a $(1 - 1/e)$ -regret bound of $O(T^{1/2})$ and requiring $O(T^{3/2})$ stochastic gradient queries for each function. Then, in order to reduce the number of gradients evaluation, Zhang et al. (2019) presented the Mono-Frank-Wolfe taking the blocking procedure, which achieves a $(1 - 1/e)$ -regret bound of $O(T^{4/5})$ with only one stochastic gradient evaluation in each round. + +Non-Oblivious Search: In many cases, classical local search, e.g., the greedy method, may return a solution with a poor approximation ratio to the global maximum. To avoid this issue, Khanna et al. (1998) and Alimonti (1994) first proposed a technique named Non-Oblivious Search that leverages an auxiliary function to guide the search. After carefully choosing the auxiliary function, the new solution generated by the non-oblivious search, may have a better performance than the previous solution found by the classical local search. Inspired by this idea, for the maximum coverage problem over a matroid, Filmus & Ward (2012) proposed a $(1 - 1/e)$ -approximation algorithm via a non-oblivious set function allocating extra weights to the solutions that cover some element more than once, which efficiently improves the traditional $(1/2)$ -approximation greedy method. After that, Filmus & Ward (2014) extended this idea to improve the $(1/2)$ -approximation greedy method for the general submodular set maximization problem over a matroid. Recently, for the continuous submodular maximization problem with concave regularization, a variant of Frank-Wolfe algorithm (Non-Oblivious FW) based on a special auxiliary function was proposed for boosting the approximation ratio of the submodular part from $1/2$ to $(1 - 1/e)$ in (Mitra et al., 2021). Compared to the proposed algorithm in this paper, i) The Non-Oblivious Frank-Wolfe method needs $O(1/\epsilon)$ gradient evaluations at each round under the deterministic setting, while our method only needs $O(1)$ evaluations per iteration under the stochastic setting; ii) The Non-Oblivious Frank-Wolfe method is designed only for the deterministic setting, while we present a uniform boosting framework covering the stochastic gradient ascent in both offline and online settings. + +We present comparisons between this work and previous studies in Table 1 and Table 2 for offline and online settings, respectively. + +# 2. Preliminaries + +In this section, we define some concepts and notations that we will use throughout the paper. + +# 2.1. Continuous Submodularity + +Continuous Submodular Functions: A function $f: \mathcal{X} \to \mathbb{R}_+$ is a continuous submodular function if for any $x, y \in \mathcal{X}$ , + +$$ +f (\boldsymbol {x}) + f (\boldsymbol {y}) \geq f (\boldsymbol {x} \wedge \boldsymbol {y}) + f (\boldsymbol {x} \vee \boldsymbol {y}). +$$ + +Here, $\pmb{x} \wedge \pmb{y} = \min(\pmb{x}, \pmb{y})$ and $\pmb{x} \vee \pmb{y} = \max(\pmb{x}, \pmb{y})$ are component-wise minimum and component-wise maximum, respectively. $\mathcal{X} = \prod_{i=1}^{n} \mathcal{X}_i$ where each $\mathcal{X}_i$ is a compact interval in $\mathbb{R}_+$ . Without loss of generality, we assume $\mathcal{X}_i = [0, a_i]$ . If $f$ is twice differentiable, the continuous + +submodularity is equivalent to + +$$ +\forall i \neq j, \forall \boldsymbol {x} \in \mathcal {X}, \frac {\partial^ {2} f (\boldsymbol {x})}{\partial x _ {i} \partial x _ {j}} \leq 0. +$$ + +Moreover, $f$ is monotone if $f(\pmb {x})\geq f(\pmb {y})$ when $\pmb {x}\geq \pmb{y}$ + +DR-Submodularity: A continuous submodular function $f$ is $DR$ -submodular if + +$$ +f (\boldsymbol {x} + z \boldsymbol {e} _ {i}) - f (\boldsymbol {x}) \leq f (\boldsymbol {y} + z \boldsymbol {e} _ {i}) - f (\boldsymbol {y}), +$$ + +where $e_i$ is the $i$ -th basic vector, $x \geq y$ and $z \in \mathbb{R}_+$ such that $x + z e_i, y + z e_i \in \mathcal{X}$ . When the DR-submodular function $f$ is differentiable, we have $\nabla f(\pmb{x}) \leq \nabla f(\pmb{y})$ if $x \geq y$ (Bian et al., 2020). When $f$ is twice differentiable, the DR-submodularity is also equivalent to + +$$ +\forall i, j \in [ n ], \forall \boldsymbol {x} \in \mathcal {X}, \frac {\partial^ {2} f (\boldsymbol {x})}{\partial x _ {i} \partial x _ {j}} \leq 0. +$$ + +Furthermore, we call a function $f$ weakly DR-submodular with parameter $\gamma$ , if + +$$ +\gamma = \inf _ {\boldsymbol {x} \leq \boldsymbol {y}} \inf _ {i \in [ n ]} \frac {[ \nabla f (\boldsymbol {x}) ] _ {i}}{[ \nabla f (\boldsymbol {y}) ] _ {i}}. +$$ + +Note that $\gamma = 1$ indicates a differentiable and monotone DR-submodular function. + +# 2.2. Notations and Concepts + +Norm: $\| \cdot \|$ is the $\ell_2$ norm in Euclidean space. + +Radius and Diameter: For any bounded domain $\mathcal{C} \in \mathcal{X}$ , the radius $r(\mathcal{C}) = \max_{\boldsymbol{x} \in \mathcal{C}} \| \boldsymbol{x} \|$ and the diameter $\mathrm{diam}(\mathcal{C}) = \max_{\boldsymbol{x}, \boldsymbol{y} \in \mathcal{C}} \| \boldsymbol{x} - \boldsymbol{y} \|$ . + +Projection: We define the projection to the domain $\mathcal{C}$ as $\mathcal{P}_{\mathcal{C}}(\boldsymbol{x}) = \arg \min_{\boldsymbol{z} \in \mathcal{C}} \| \boldsymbol{x} - \boldsymbol{z} \|$ . + +Smoothness: A differentiable function $f$ is called $L$ -smooth if for any $x, y \in \mathcal{X}$ , + +$$ +\left\| \nabla f (\boldsymbol {x}) - \nabla f (\boldsymbol {y}) \right\| \leq L \left\| \boldsymbol {x} - \boldsymbol {y} \right\|. +$$ + +$\alpha$ -Regret: Finally, we recall the $\alpha$ -regret in (Chen et al., 2018b). For a $T$ -round game, after the algorithm $\mathcal{A}$ choose an action $\boldsymbol{x}_t \in \mathcal{X}$ in each round, the adversary reveals the utility function $f_t$ . The objective of the algorithm $\mathcal{A}$ is to minimize the gap between the accumulative reward and that of the best fixed policy in hindsight with scale parameter $\alpha$ , i.e., + +$$ +\mathcal {R} _ {\alpha} (\mathcal {A}, T) = \alpha \max _ {\boldsymbol {x} \in \mathcal {X}} \sum_ {t = 1} ^ {T} f _ {t} (\boldsymbol {x}) - \sum_ {t = 1} ^ {T} f _ {t} (\boldsymbol {x} _ {t}). +$$ + +# 3. Derivation of the Non-oblivious Function + +In this section, we present in detail how to derive our non-oblivious function, which plays an important role in our boosting framework. To begin, we recall the definition of stationary points. + +Definition 1. A point $\pmb{x} \in \mathcal{C}$ is called a stationary point for function $f: \mathcal{X} \to \mathbb{R}_+$ over the domain $\mathcal{C} \subseteq \mathcal{X}$ if + +$$ +\max _ {\boldsymbol {y} \in \mathcal {C}} \langle \nabla f (\boldsymbol {x}), \boldsymbol {y} - \boldsymbol {x} \rangle \leq 0. +$$ + +We make the following assumption throughout this paper. + +# Assumption 1. + +(i) The $f:\mathcal{X}\to \mathbb{R}_+$ is a monotone, differentiable, weakly DR-submodular function with parameter $\gamma$ . So is each $f_{t}$ in the online settings. +(ii) We also assume the knowledge of parameter $\gamma$ +(iii) Without loss of generality, $f(\mathbf{0}) = 0$ . Also, in online settings, $f_{t}(\mathbf{0}) = 0$ for $t = 1,2,\ldots ,T$ + +With this assumption, we have the following result. + +Lemma 1 (Proof in Appendix A.1). Under Assumption 1, for any stationary point $\pmb{x} \in \mathcal{C}$ of $f$ , we have + +$$ +f (\boldsymbol {x}) \geq \frac {\gamma^ {2}}{\gamma^ {2} + 1} \max _ {\boldsymbol {y} \in \mathcal {C}} f (\boldsymbol {y}). \tag {1} +$$ + +Remark 1. Lemma 1 implies any stationary point of a $\gamma$ -weakly DR-submodular function $f$ provides a $(\frac{\gamma^2}{1 + \gamma^2})$ -approximation to the global maximum. As we know, projected gradient ascent method (Hassani et al., 2017) with small step size usually converges to a stationary point of $f$ , resulting in a $(\frac{\gamma^2}{1 + \gamma^2})$ approximation guarantee. + +In order to boost these classical algorithms, a natural idea is to design some auxiliary functions whose stationary points achieve better approximation to the global maximum of the problem $\max_{\boldsymbol{x} \in \mathcal{C}} f(\boldsymbol{x})$ . That is, we want to find $F: \mathcal{X} \to \mathbb{R}_+$ based on $f$ such that $\langle \boldsymbol{y} - \boldsymbol{x}, \nabla F(\boldsymbol{x}) \rangle \geq \beta_1 f(\boldsymbol{y}) - \beta_2 f(\boldsymbol{x})$ , where $\beta_1 / \beta_2 \geq \frac{\gamma^2}{1 + \gamma^2}$ . + +Motivated by (Feldman et al., 2011; Filmus & Ward, 2012; 2014; Harshaw et al., 2019; Feldman, 2021; Mitra et al., 2021), we consider the function $F(\pmb{x}) : \mathcal{X} \to \mathbb{R}_+$ whose gradient at point $\pmb{x}$ allocates different weights to the gradient $\nabla f(z * \pmb{x})$ , i.e., $\nabla F(\pmb{x}) = \int_0^1 w(z) \nabla f(z * \pmb{x}) \, \mathrm{d}z$ , assuming that $\nabla f(z * \pmb{x})$ is Lebesgue integrable w.r.t. $z \in [0,1]$ , the weight function $w(z) \in C^1[0,1]$ , and $w(z) \geq 0$ . Then, we investigate a property of $\langle \pmb{y} - \pmb{x}, \nabla F(\pmb{x}) \rangle$ in the following lemma. + +Lemma 2 (Proof in Appendix A.2). For all $\pmb{x}, \pmb{y} \in \mathcal{X}$ , we have + +$$ +\begin{array}{l} \langle \boldsymbol {y} - \boldsymbol {x}, \nabla F (\boldsymbol {x}) \rangle \geq \left(\gamma \int_ {0} ^ {1} w (z) d z\right) \left(f (\boldsymbol {y}) - \theta (w) f (\boldsymbol {x})\right), \\ w h e r e \quad \theta (w) = \max _ {f, x} \theta (w, f, x), \quad \theta (w, f, x) = \\ \frac {w (1) + \int_ {0} ^ {1} (\gamma w (z) - w ^ {\prime} (z)) \frac {f (z * x)}{f (x)} \mathrm {d} z}{\gamma \int_ {0} ^ {1} w (z) \mathrm {d} z} a n d f (x) > 0. \\ \end{array} +$$ + +To improve the approximation ratio, we consider the follow + +ing factor-revealing optimization problem: + +$$ +\begin{array}{l} \min _ {w} \theta (w) = \min _ {w} \max _ {f, x} \frac {w (1) + \int_ {0} ^ {1} (\gamma w (z) - w ^ {\prime} (z)) \frac {f (z * x)}{f (x)} d z}{\gamma \int_ {0} ^ {1} w (z) d z} \\ \begin{array}{l} \text {s . t .} w (z) \geq 0, \end{array} \\ w (z) \in C ^ {1} [ 0, 1 ], \\ f (\boldsymbol {x}) > 0, \\ \nabla f \left(\boldsymbol {x} _ {1}\right) \geq \gamma \nabla f \left(\boldsymbol {y} _ {1}\right) \geq \mathbf {0}, \forall \boldsymbol {x} _ {1} \leq \boldsymbol {y} _ {1} \in \mathcal {X}. \tag {2} \\ \end{array} +$$ + +At first glance, problem (2) looks challenging to solve. Fortunately, we could directly find the optimal solution, which is provided in the following theorem. + +Theorem 1 (Proof in the Appendix A.3). For problem (2), we have $\hat{w}(z) = e^{\gamma(z-1)} \in \arg \min_w \theta(w)$ and $\min_w \max_{f,\pmb{x}} \theta(w, f, \pmb{x}) = \frac{1}{1-e^{-\gamma}}$ . + +In the following sections, we consider this optimal auxiliary function $F$ with $\nabla F(\pmb{x}) = \int_0^1\hat{w} (z)\nabla f(z*\pmb {x})\mathrm{d}z,$ and $\hat{w} (z) = e^{\gamma (z - 1)}$ . According to the definition of $\theta (w,f,\pmb {x})$ in Lemma 2, we could derive that $\theta (\hat{w},f,\pmb {x}) =$ $\hat{w} (1) / (\gamma \int_0^1\hat{w} (z)\mathrm{d}z) = 1 / (1 - e^{-\gamma})$ such that $\theta (\hat{w}) =$ $1 / (1 - e^{-\gamma})$ . Thus, we have $\langle \pmb {y} - \pmb {x},\nabla F(\pmb {x})\rangle \geq (1-$ $e^{-\gamma})f(\pmb {y}) - f(\pmb {x})$ which implies that any stationary point of $F$ provides a better $(1 - e^{-\gamma})$ -approximation solution to the problem $\max_{\pmb {x}\in \mathcal{C}}f(\pmb {x})$ , in contrast with the stationary points of $f$ itself. + +Next, we investigate some properties of this optimal auxiliary function $F(\pmb{x})$ . Following the same terminology in (Filmus & Ward, 2012; 2014; Mitra et al., 2021), we also call this $F$ the non-oblivious function. + +# 3.1. Properties about the Non-Oblivious Function + +Without loss of generality, in this subsection, we assume $f$ is $L$ -smooth with respect to the norm $\| \pmb{x} \|$ , i.e., $\| \nabla f(\pmb{x}) - \nabla f(\pmb{y}) \| \leq L \| \pmb{x} - \pmb{y} \|$ . Then, we establish some key properties about the boundness and smoothness of the non-oblivious function $F(\pmb{x})$ in the following theorem. + +Theorem 2 (Proof in Appendix A.4). If $f$ is $L$ -smooth, and Assumption 1 holds, we have + +(i) $f(\pmb {x})\geq (1 - e^{-\gamma})\max_{\pmb {y}\in \mathcal{C}}f(\pmb {y})$ , where $\pmb{x}$ is a stationary point for non-oblivious function $F$ over the domain $\mathcal{C}$ +(ii) $F(\pmb {x}) = \int_0^1\frac{e^{\gamma(z - 1)}}{z} f(z*\pmb {x})dz$ and $F(\pmb {x})\leq (1 + \ln (\tau))(f(\pmb {x}) + c)$ for any positive $c\leq Lr^2 (\mathcal{X})$ , where $\tau = \max \bigl (\frac{1}{\gamma},\frac{Lr^2(\mathcal{X})}{c}\bigr).$ + +(iii) $F$ is $L_{\gamma}$ -smooth where $L_{\gamma} = L\frac{\gamma + e^{-\gamma} - 1}{\gamma^2}$ . + +Remark 2. Theorem 2.(i) demonstrates that any stationary point of the non-oblivious function $F$ can attain $(1 - e^{-\gamma})$ -approximation of the global maximum of $f$ , which is better + +# Algorithm 1 Meta Boosting Protocol + +1: Initialize: any $x_{1} \in \mathcal{X}, \gamma$ . +2: for $t \in [T]$ do + +3: Sample $z_{t}$ from $\mathbf{Z}$ where $\mathrm{P}(\mathbf{Z} \leq z) = \int_{0}^{z} \frac{\gamma e^{\gamma(u - 1)}}{1 - e^{-\gamma}} I(u \in [0,1]) \, \mathrm{d}u$ . + +4: Compute $\widetilde{\nabla} F(\pmb{x}_t) = \frac{1 - e^{-\gamma}}{\gamma}\widetilde{\nabla} f(z_t*\pmb{x}_t)$ +5: Update $\pmb{x}_{t + 1} = \mathcal{A}(\widetilde{\nabla} F(\pmb{x}_t),\pmb{x}_t)\triangleright \mathcal{A}$ to be designed. +6: end for +7: Option I (Offline setting): Return $\mathbf{x}_l$ chosen from $\{\mathbf{x}_t\}_{t \in [T]}$ with a probability. +8: Option II (Online setting): Return $\mathbf{x}_t$ at each round $t \in [T]$ . + +than the $\left(\frac{\gamma^2}{1 + \gamma^2}\right)$ -approximation ratio of the stationary points of $f$ itself provided in Lemma 1. Moreover, this result sheds light on the possibility of utilizing $F$ to obtain a better approximation than classical gradient ascent method, which motivates our boosting methods in the following section. + +We also investigate how to estimate $\nabla F(\pmb{x})$ with an unbiased stochastic oracle $\widetilde{\nabla} f(\pmb{x})$ , i.e., $\mathbb{E}(\widetilde{\nabla} f(\pmb{x})|\pmb{x}) = \nabla f(\pmb{x})$ . We first introduce a new random variable $\mathbf{Z}$ where $\operatorname*{Pr}(\mathbf{Z} \leq z) = \int_0^z \frac{\gamma e^{\gamma(u - 1)}}{1 - e^{-\gamma}} I(u \in [0,1]) \, \mathrm{d}u$ where $I$ is the indicator function. When the number $z$ is sampled from r.v. $\mathbf{Z}$ , we consider $\frac{1 - e^{-\gamma}}{\gamma} \widetilde{\nabla} f(z * \pmb{x})$ as an estimator of $\nabla F(\pmb{x})$ with statistical properties given in the following proposition. + +Proposition 1 (Proof in Appendix A.5). + +(i) If $z$ is sampled from r.v. $\mathbf{Z}$ and $\mathbb{E}(\widetilde{\nabla} f(\pmb{x})|\pmb{x}) = \nabla f(\pmb{x})$ , we have + +$$ +\mathbb {E} \left(\left. \frac {1 - e ^ {- \gamma}}{\gamma} \tilde {\nabla} f (z * \boldsymbol {x}) \right| \boldsymbol {x}\right) = \nabla F (\boldsymbol {x}). +$$ + +(ii) If $z$ is sampled from r.v. $\mathbf{Z}$ , $\mathbb{E}(\widetilde{\nabla} f(\pmb{x})|\pmb{x}) = \nabla f(\pmb{x})$ , and $\mathbb{E}(\| \widetilde{\nabla} f(\pmb{x}) - \nabla f(\pmb{x})\|^2 |\pmb{x}) \leq \sigma^2$ , we have + +$$ +\mathbb {E} \left(\left\| \frac {1 - e ^ {- \gamma}}{\gamma} \widetilde {\nabla} f (z * \boldsymbol {x}) - \nabla F (\boldsymbol {x}) \right\| ^ {2} \middle | \boldsymbol {x}\right) \leq \sigma_ {\gamma} ^ {2}, +$$ + +$$ +w h e r e \sigma_ {\gamma} ^ {2} = 2 \frac {(1 - e ^ {- \gamma}) ^ {2} \sigma^ {2}}{\gamma^ {2}} + \frac {2 L ^ {2} r ^ {2} (\mathcal {X}) (1 - e ^ {- 2 \gamma})}{3 \gamma}. +$$ + +Remark 3. Proposition 1 indicates that $\frac{1 - e^{-\gamma}}{\gamma}\widetilde{\nabla} f(z*\pmb {x})$ is an unbiased estimator of $\nabla F(\pmb {x})$ with a bounded variance. + +# 4. Boosting Framework + +Up to this point, we present a boosting framework that covers both gradient ascent and online gradient ascent methods. We first present a Meta boosting protocol in Algorithm 1, highlighting the key features of the proposed algorithms. We then present several variants of the Meta protocol by employing different basic algorithms $\mathcal{A}$ . + +As shown in Algorithm 1, the core idea is to leverage the + +Algorithm 2 Boosting Gradient Ascent +Input: $T,\eta_t,c > 0,\gamma ,L,r(\mathcal{C})$ +Output: $\pmb{x}_l$ +1: Set $\triangle_{t} = 1$ when $t < T$ and $\triangle_T = 1 + \ln (\tau)$ where $\tau = \max (\frac{1}{\gamma},\frac{r^2(\mathcal{C})L}{c})$ +2: Set $\triangle = \sum_{t = 1}^{T}\triangle_{t}$ +3: Initialize any $\pmb {x}_1\in \mathcal{X}$ +4: for $t\in [T]$ do +5: Compute $\widetilde{\nabla} F(\pmb {x}_t)$ according to Algorithm 1 +6: Set $\pmb {y}_{t + 1} = \pmb {x}_t + \eta_t\widetilde{\nabla} F(\pmb {x}_t)$ +7: $\pmb{x}_{t + 1} = \arg \min_{\pmb {z}\in \mathcal{C}}\left\| \pmb {z} - \pmb{y}_{t + 1}\right\|$ +8: end for +9: Choose a number $l\in [T]$ with the distribution $\mathrm{P}(l = t) = \frac{\triangle_t}{\triangle}$ + +stochastic gradient $\widetilde{\nabla} F(\pmb{x}_t)$ of the non-oblivious function $F$ , instead of the stochastic gradient $\widetilde{\nabla} f(\pmb{x}_t)$ of the original weakly DR-submodular function $f$ . Note that $\widetilde{\nabla} F(\pmb{x}_t)$ is generated by the sampling method in Proposition 1 (line 3-4 of Algorithm 1). + +# 4.1. Boosting Gradient Ascent + +In this subsection, we propose a boosting gradient ascent method under the offline scenario for the stochastic submodular maximization problem. In particular, we employ the classical stochastic projected gradient ascent method in the Meta boosting protocol and describe the boosting gradient ascent method in Algorithm 2. + +As demonstrated in Algorithm 2, in each iteration, after calculating $\widetilde{\nabla} F(\pmb{x})$ , we make the standard projected gradient step to update $\pmb{x}$ . Finally, we return $\pmb{x}_l$ chosen from $\{\pmb{x}_t\}_{t \in [T]}$ with the given distribution. + +With the previous outcomes, we establish the convergence result for Algorithm 2. + +Theorem 3 (Proof in Appendix B). Assume $\mathcal{C} \in \mathcal{X}$ is a bounded convex set and $f$ is $L$ -smooth, and the gradient oracle $\widetilde{\nabla} f(\boldsymbol{x})$ is unbiased with $\mathbb{E}(\|\widetilde{\nabla} f(\boldsymbol{x}) - \nabla f(\boldsymbol{x})\|^2 |\boldsymbol{x}) \leq \sigma^2$ . Let $\eta_t = \frac{1}{\frac{\sigma_\gamma \sqrt{t}}{\mathrm{diam}(\mathcal{C})} + L_\gamma}$ and $c = O(1)$ in Algorithm 2, then we have + +$$ +\mathbb {E} (f (\boldsymbol {x} _ {l})) \geq \left(1 - e ^ {- \gamma} - O \left(\frac {1}{T}\right)\right) O P T - O \left(\frac {1}{\sqrt {T}}\right), +$$ + +where $OPT = \max_{\boldsymbol{x} \in \mathcal{C}} f(\boldsymbol{x})$ . + +Remark 4. Theorem 3 shows that after $O(1 / \epsilon^2)$ iterations, the boosting stochastic gradient ascent achieves $(1 - 1 / e - \epsilon^2) OPT - \epsilon$ , which efficiently improves the $(1 / 2)$ -approximation guarantee of classical stochastic gradient ascent (Hassani et al., 2017) for continuous DR-submodular maximization. Moreover, we highlight that the overall gradi + +Algorithm 3 Online Boosting Delayed Gradient Ascent +Input: $T,\eta ,\gamma$ +Output: $\pmb {x}_1,\dots ,\pmb {x}_T$ +1: Initialize: any $\pmb {x}_1\in \mathcal{C}$ +2: for $t\in [T]$ do +3: Play $\pmb {x}_t$ , then observe reward $f_{t}(\pmb{x}_{t})$ +4: Sample $z_{t}$ according to Algorithm 1 and Query $\widetilde{\nabla} F_{t}(\pmb{x}_{t}) = \frac{1 - e^{-\gamma}}{\gamma}\widetilde{\nabla} f_{t}(z_{t}*\pmb{x}_{t})$ +5:Receive feedback $\widetilde{\nabla} F_s(\mathbf{x}_s)$ , where $s\in \mathcal{F}_t$ +6: $\pmb{y}_{t + 1} = \pmb {x}_t + \eta \sum_{s\in \mathcal{F}_t}\widetilde{\nabla} F_s(\pmb {x}_s)$ +7: $\pmb{x}_{t + 1} = \arg \min_{\pmb {z}\in \mathcal{C}}\| \pmb {z} - \pmb{y}_{t + 1}\|$ +8: end for + +ent complexity is $O(1 / \epsilon^2)$ which is optimal (Hassani et al., 2020) under the stochastic setting. + +# 4.2. Online Boosting Delayed Gradient Ascent + +In this section, we consider the online setting with delayed feedback. To begin, recall the process of classical online optimization. In round $t$ , after picking an action $\boldsymbol{x}_t \in \mathcal{C}$ , the environment (adversary) gives a utility $f_t(\boldsymbol{x}_t)$ and permits the access to the stochastic gradient of $f_t$ . The objective is to minimize the $\alpha$ -regret for $T$ planned rounds. Then, we turn to the (adversarial) feedback delays phenomenon (Quanrud & Khashabi, 2015) in our online stochastic submodular maximization problem. That is, instead of the prompt feedback, the information about the stochastic gradient of $f_t$ could be delivered at the end of round $(t + d_t - 1)$ , where $d_t \in \mathbb{Z}_+$ is a positive integer delay for round $t$ . For instance, the standard online setting sets all $d_t = 1$ (Hazan et al., 2016b). + +Next, we introduce some useful notations. We denote the feedback given at the end of round $t$ as $\mathcal{F}_t = \{u \in [T] : u + d_u - 1 = t\}$ and $D = \sum_{t=1}^{T} d_t$ . Hence, at the end of round $t$ , we only have access to the stochastic gradients of past $f_s$ where $s \in \mathcal{F}_t$ . + +To improve the state-of-the-art $1/2$ approximation ratio of online gradient ascent and tackle the adversarial delays simultaneously, we employ the online delayed gradient algorithm (Quanrud & Khashabi, 2015) in the Meta boosting protocol, in which we utilize the stochastic gradient of the non-oblivious function $F$ . As shown in Algorithm 3, at each round $t$ , after querying the stochastic gradient $\widetilde{\nabla} F_t(\boldsymbol{x}_t)$ , we apply the received stochastic gradients feedback $\widetilde{\nabla} F_s(\boldsymbol{x}_s)$ ( $s \in \mathcal{F}_t$ ) in a standard projection gradient step to update $\boldsymbol{x}_t$ . + +We provide the regret bound of Algorithm 3. + +Theorem 4 (Proof in Appendix C). Assume $\mathcal{C} \subseteq \mathcal{X}$ is a bounded convex set and each $f_t$ is monotone, differentiable, and weakly DR-submodular with $\gamma$ . Meanwhile, the gradient oracle is unbiased $\mathbb{E}(\widetilde{\nabla} f_t(\boldsymbol{x})|\boldsymbol{x}) = \nabla f_t(\boldsymbol{x})$ and + +$\max_{t \in [T]} (\|\widetilde{\nabla} F_t(\boldsymbol{x}_t)\|) = \frac{1 - e^{-\gamma}}{\gamma} \max_{t \in [T]} (\|\widetilde{\nabla} f_t(\boldsymbol{x}_t)\|).$ + +Let $\eta = \frac{diam(\mathcal{C})}{\max_{t\in[T]}(\|\overline{\nabla}F_t(\boldsymbol{x}_t)\|)\sqrt{D}}$ in Algorithm 3, then we have + +$$ +(1 - e ^ {- \gamma}) \max _ {\boldsymbol {x} \in \mathcal {C}} \sum_ {t = 1} ^ {T} f _ {t} (\boldsymbol {x}) - \mathbb {E} \left(\sum_ {t = 1} ^ {T} f _ {t} \left(\boldsymbol {x} _ {t}\right)\right) = O (\sqrt {D}), +$$ + +where $D = \sum_{i=1}^{T} d_t$ and $d_t \in \mathbb{Z}_+$ is a positive delay for the information about $f_t$ . + +Remark 5. When no delay exists, i.e., $d_{t} = 1$ for all $t$ , Theorem 4 says that the online boosting gradient ascent achieves a $(1 - e^{-\gamma})$ -regret of $O(\sqrt{T})$ . To the best of our knowledge, this is the first result achieving a $(1 - e^{-\gamma})$ -regret of $O(\sqrt{T})$ with $O(1)$ stochastic gradient queries for each submodular function $f_{t}$ . + +Remark 6. Under the delays of stochastic gradients, Theorem 4 gives the first regret analysis for the online stochastic submodular maximization problem. It is worth mentioning that the $(1 - e^{-\gamma})$ -regret of $O(\sqrt{D})$ result not only achieves the optimal $(1 - e^{-\gamma})$ approximation ratio, but also matches the $O(\sqrt{D})$ regret of online convex optimization with adversarial delays (Quanrud & Khashabi, 2015). + +# 5. Numerical Experiments + +In this section, we empirically evaluate our proposed boosting algorithms in both offline and online settings by adopting continuous DR-submodular objective functions $(\gamma = 1)$ . + +# 5.1. Offline Settings + +We first consider offline DR-submodular maximization problems and compare the following algorithms: + +Boosting Gradient Ascent $(\mathbf{BGA}(B))$ : In the frame work of Algorithm 2, we use the average of $B$ independent stochastic gradients to estimate $\nabla F(x)$ in every iteration. + +Gradient Ascent (GA): We consider Algorithm 1 in Hassani et al. (2017) with step size $\eta_t = 1 / \sqrt{t}$ . + +Continuous Greedy (CG): Algorithm 1 in (Bian et al., 2017). + +Stochastic Continuous Greedy (SCG): Algorithm 1 in Mokhtari et al. (2018) with $\rho_t = 1 / (t + 3)^{2/3}$ . + +Stochastic Continuous Greedy++ (SCG++): We consider Algorithm 4.1 in Hassani et al. (2020) where we set the minibatch size $|\mathcal{M}_0| = T^2$ and $|\mathcal{M}| = T$ for $T$ -round iterations. + +# 5.1.1. SPECIAL CASE + +Hassani et al. (2017) introduced a special continuous DR-submodular function $f_{k}$ coming from the multilinear extension of a set cover function. Here, $f_{k}(\pmb{x}) = k + 1 - (1 - x_{2k + 1})\prod_{i = 1}^{k}(1 - x_{i}) - (1 - x_{2k + 1})(k - \sum_{i = 1}^{k}x_{i}) + \sum_{i = k + 1}^{2k}x_{i}$ , where $\pmb{x} = (x_{1},x_{2},\dots,x_{2k + 1})$ . Under the + +domain $\mathcal{C} = \{\pmb {x}\in [0,1]^{2k + 1}:\sum_{i = 1}^{2k + 1}x_i = k\}$ ,Hassani + +et al. (2017) also verified that $\pmb{x}_{loc} = \overbrace{(1,1,\dots,1,0,\dots,0)}^{k}$ is a local maximum with $(1/2 + 1/(2k))$ -approximation to the global maximum. Thus, if start at $\pmb{x}_{loc}$ , theoretically Gradient Ascent (Hassani et al., 2017) will get stuck at this local maximum point. In our experiment, we set $k = 15$ and consider a standard Gaussian noise, i.e., $\widetilde{\nabla} f(x) = \nabla f(x) + \mathcal{N}(0,1)$ . + +First, we set the initial point of GA, BGA(1) and BGA(10) to be $\boldsymbol{x}_{loc}$ . From Figure 1(a), we observe that GA stays at $\boldsymbol{x}_{loc}$ as expected. Instead, BGA(1) and BGA(10) escape the local maximum $\boldsymbol{x}_{loc}$ and achieve near-optimal objective values. Then, we run all algorithms from the origin and present the results in Figure 1(b). It shows that GA, starting from the origin, performs much better than from a local maximum. Compared with GA, BGA(1) and BGA(10) + +converge to the optimal point $\boldsymbol{x}^{*} = (0, \dots, 0, \overbrace{1, 1, \dots, 1})$ more rapidly. Both Figure 1(a) and Figure 1(b) show that BGA(1) and BGA(10) also perform better than Frank-Wolf-type algorithms with respect to the convergence rate and the objective value. + +# 5.1.2. NON-CONVEX/NON-CONCAVE QUADRATIC PROGRAMMING + +We consider the quadratic objective $f(\pmb{x}) = \frac{1}{2}\pmb{x}^T\pmb{H}\pmb{x} + \pmb{h}^T\pmb{x}$ and constraints $P = \{\pmb{x} \in \mathbb{R}_+^n | \pmb{A}\pmb{x} \leq \pmb{b}, \pmb{0} \leq \pmb{x} \leq \pmb{u}, \pmb{A} \in \mathbb{R}_+^{m \times n}, \pmb{b} \in \mathbb{R}_+^m\}$ . Following (Bian et al., 2017), we choose the matrix $H \in \mathbb{R}^{n \times n}$ to be a randomly generated symmetric matrix with entries uniformly distributed in $[-1,0]$ , and the matrix $A$ to be a random matrix with entries uniformly distributed in $[0,1]$ . It can be verified that $f$ is a continuous DR-submodular function. We also set $\pmb{b} = \pmb{u} = \mathbf{1}$ , $m = 12$ , and $n = 25$ . To ensure the monotonicity, we set $h = -H^T\pmb{u}$ . Thus, the objective becomes $f(x) = (\frac{1}{2}\pmb{x} - \pmb{u})^T\pmb{H}\pmb{x}$ . Similarly, we also consider the Gaussian noise for gradient, i.e., $\widetilde{\nabla}f(\pmb{x}) = \nabla f(\pmb{x}) + \delta\mathcal{N}(0,1)$ . We consider $\delta = 5$ and start all algorithms from the origin. + +As shown in Figure 1(c), BGA(1) and BGA(10) converge faster than GA and achieve nearly the same objective values as GA after 100 iterations. Similar to the previous experiment, BGA(1) and BGA(10) exceed Frank-Wolfe-type algorithms with respect to the convergence rate. + +# 5.2. Online Settings + +We also consider Online DR-submodular Maximization with/without adversarial delays. Here, we present a list of algorithms to be compared in these settings: + +Meta-Frank-Wolfe (Meta-FW(K)): We consider Algo + +![](images/7b7e6dab3b618348783a2cff3243c1cdb474353968c7dbbc39a1e391085ea87d.jpg) +(a) Special Case + +![](images/7c15a2be1fb2b410e36eb988acd5a64f3b84dd8dfe51228c5a93a54df091a90a.jpg) +(b) Special Case (origin) + +![](images/925e78d8e7820bf48f5349080aa6254c278d456618e77ff842cf74e2b379b973.jpg) +(c) Offline QP + +![](images/ae066916524b5e8f46415dc184a425220e76fcfdcd1ec3b699befb326008136c.jpg) +(d) Online QP with feedback delays + +![](images/000e25e31a9762e2dcea6d2c26d6bb8821790c8945bd89411161ebe5644bb464.jpg) +(e) Online QP without feedback delays +Figure 1. In Figure 1(a), we test the performance of the six algorithms for the special submodular function in (Hassani et al., 2017) where the GA, BGA and BGA(10) start from $x_{loc}$ . Simultaneously, we present the results for all algorithm starting from the origin in Figure 1(b). Figure 1(c) show the performance of the algorithms versus the number of iterations in a simulated Non-convex/Non-concave submodular QP. Finally, Figure 1(d) and Figure 1(e) show the $(1 - 1 / e)$ -regret of the seven algorithms, including OGA(10), OGA(50), OBGA(10), OBGA(50), Meta-FW(500), Meta-FW-VR(50), and Meta-FW-VR(500), for the simulated online submodular QP in both delayed setting and standard online setting. + +rithm 1 in (Chen et al., 2018b) and initialize $K$ online gradient descent oracles (Zinkevich, 2003; Hazan et al., 2016b) with step size $1 / \sqrt{T}$ . + +Stochastic Meta-Frank-Wolfe (Meta-FW-VR $(K)$ ): We consider Algorithm 1 in (Chen et al., 2018a) with the $\rho_{t} = 1 / (t + 3)^{2 / 3}$ and $K$ online gradient descent oracles with step size $1 / \sqrt{T}$ . + +Online Gradient Ascent (OGA(B)): The delayed gradient ascent algorithm in (Quanrud & Khashabi, 2015) with step size $1 / \sqrt{T}$ . We use $B$ independent samples to estimate $\nabla f_t(\boldsymbol{x}_t)$ at each round. + +Online Boosting Gradient Ascent (OBGA(B)): We consider Algorithm 3 with the step size $\eta_t = 1 / \sqrt{T}$ and use the average of $B$ independent samples to estimate the gradient at each round. + +The same as Section 5.1.2, we first generate $T = 100$ quadratic objective functions $f_{1}, f_{2}, \ldots, f_{T}$ . The symmetric random matrix $H_{t}$ , corresponding to $f_{t}$ , is uniformly generated from $[-1, 0]^{n \times n}$ for $t = 1, \ldots, T$ , and the matrix $A$ in constraint is randomly generated from the uniform distribution in $[0, 1]^{m \times n}$ . We also add the Gaussian noise for the gradient of each $f_{t}$ , i.e., $\widetilde{\nabla} f_{t}(\boldsymbol{x}) = \nabla f_{t}(\boldsymbol{x}) + \delta \mathcal{N}(0, 1)$ with $\delta = 5$ . To simulate the feedback delays, we generate a uniform random number $d_{t}$ from $\{1, 2, 3, 4, 5\}$ for the stochastic gradient information of $f_{t}$ . + +We present the $(1 - 1 / e)$ -regret of algorithms for the delayed setting and the standard online setting (Hazan et al., 2016b) in Figure 1(d) and Figure 1(e), respectively. Under both scenarios, our proposed OBGA with sample size $B = 50$ exhibits the lowest regret among all algorithms. With the same sample size $B = 10$ and 50, OBGA consistently achieves lower regrets than OGA, which confirms the effectiveness of our boosting framework. + +# 6. Conclusion + +In this paper, based on a novel non-oblivious function, we present a boosting framework, covering boosting gradient ascent and online boosting delayed gradient ascent, for the stochastic continuous submodular maximization problem, under both offline and online settings. In the offline scenario, our boosting gradient ascent provides $(1 - e^{-\gamma} - \epsilon^2)$ -approximation guarantees after $O(1 / \epsilon^2)$ iterations. Under the online setting, we are the first to consider delayed feedback for online submodular maximization problems. Moreover, when no delay exists, our online boosting delayed gradient ascent is the first result to guarantee $(1 - e^{-\gamma})$ -approximation with $O(\sqrt{T})$ regret, where at each round we only estimate stochastic gradient $O(1)$ times. Numerical experiments demonstrate the superior performance of our algorithms. + +# Acknowledgements + +The authors would like to thank the anonymous reviewers for their helpful comments. Zhang and Yang's research is supported in part by the Hong Kong Research Grants Council (ECS 21214720), City University of Hong Kong (Project 9610465) and Alibaba Group through Alibaba Innovative Research (AIR) Program. + +# References + +Alimonti, P. New local search approximation techniques for maximum generalized satisfiability problems. In *Italian Conference on Algorithms and Complexity*, pp. 40-53. Springer, 1994. +Arora, S., Ge, R., Kannan, R., and Moitra, A. Computing a nonnegative matrix factorization—provably. SIAM Journal on Computing, 45(4):1582-1611, 2016. +Bertsekas, D. Convex optimization algorithms. Athena Scientific, 2015. +Bian, A. A., Mirzasoleiman, B., Buhmann, J., and Krause, A. Guaranteed non-convex optimization: Submodular maximization over continuous domains. In Artificial Intelligence and Statistics, pp. 111–120. PMLR, 2017. +Bian, Y., Buhmann, J. M., and Krause, A. Continuous submodular function maximization. arXiv preprint arXiv:2006.13474, 2020. +Chekuri, C., Vondrak, J., and Zenklusen, R. Submodular function maximization via the multilinear relaxation and contention resolution schemes. SIAM Journal on Computing, 43(6):1831-1879, 2014. +Chen, L., Harshaw, C., Hassani, H., and Karbasi, A. Projection-free online optimization with stochastic gradient: From convexity to submodularity. In International Conference on Machine Learning, pp. 814-823. PMLR, 2018a. +Chen, L., Hassani, H., and Karbasi, A. Online continuous submodular maximization. In International Conference on Artificial Intelligence and Statistics, pp. 1896-1905. PMLR, 2018b. +Chen, W., Lu, W., and Zhang, N. Time-critical influence maximization in social networks with time-delayed diffusion process. In Twenty-Sixth AAAI Conference on Artificial Intelligence, 2012. +Das, A. and Kempe, D. Submodular meets spectral: greedy algorithms for subset selection, sparse approximation and dictionary selection. In Proceedings of the 28th International Conference on Machine Learning, pp. 1057-1064, 2011. + +Du, S. S., Zhai, X., Poczos, B., and Singh, A. Gradient descent provably optimizes over-parameterized neural networks. In International Conference on Learning Representations, 2019. +Elenberg, E. R., Khanna, R., Dimakis, A. G., and Negahban, S. Restricted strong convexity implies weak submodularity. The Annals of Statistics, 46(6B):3539-3568, 2018. +Feldman, M. Guess free maximization of submodular and linear sums. Algorithmica, 83(3):853-878, 2021. +Feldman, M., Naor, J., and Schwartz, R. A unified continuous greedy algorithm for submodular maximization. In 2011 IEEE 52nd Annual Symposium on Foundations of Computer Science, pp. 570-579. IEEE, 2011. +Filmus, Y. and Ward, J. The power of local search: Maximum coverage over a matroid. In 29th Symposium on Theoretical Aspects of Computer Science, volume 14, pp. 601-612. LIPics, 2012. +Filmus, Y. and Ward, J. Monotone submodular maximization over a matroid via non-oblivious local search. SIAM Journal on Computing, 43(2):514-542, 2014. +Fisher, M. L., Nemhauser, G. L., and Wolsey, L. A. An analysis of approximations for maximizing submodular set functions--ii. In *Polyhedral Combinatorics*, pp. 73-87. Springer, 1978. +Fujishige, S. Submodular functions and optimization. Elsevier, 2005. +Ge, R., Lee, J. D., and Ma, T. Matrix completion has no spurious local minimum. In Advances in Neural Information Processing Systems, pp. 2973-2981, 2016. +Harshaw, C., Feldman, M., Ward, J., and Karbasi, A. Submodular maximization beyond non-negativity: Guarantees, fast algorithms, and applications. In International Conference on Machine Learning, pp. 2634-2643. PMLR, 2019. +Hassani, H., Soltanolkotabi, M., and Karbasi, A. Gradient methods for submodular maximization. In Advances in Neural Information Processing Systems, pp. 5841-5851, 2017. +Hassani, H., Karbasi, A., Mokhtari, A., and Shen, Z. Stochastic conditional gradient++: (non) convex minimization and continuous submodular maximization. SIAM Journal on Optimization, 30(4):3315-3344, 2020. +Hazan, E., Levy, K. Y., and Shalev-Shwartz, S. On graduated optimization for stochastic non-convex problems. In International Conference on Machine Learning, pp. 1833-1841. PMLR, 2016a. + +Hazan, E. et al. Introduction to online convex optimization. Foundations and Trends® in Optimization, 2(3-4):157-325, 2016b. +Kempe, D., Kleinberg, J., and Tardos, É. Maximizing the spread of influence through a social network. In Proceedings of the ninth ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 137-146, 2003. +Khanna, S., Motwani, R., Sudan, M., and Vazirani, U. On syntactic versus computational views of approximability. SIAM Journal on Computing, 28(1):164-191, 1998. +Leskovec, J., Krause, A., Guestrin, C., Faloutsos, C., VanBriesen, J., and Glance, N. Cost-effective outbreak detection in networks. In Proceedings of the 13th ACM SIGKDD international conference on Knowledge Discovery and Data Mining, pp. 420-429, 2007. +Lin, H. and Bilmes, J. A class of submodular functions for document summarization. In Proceedings of the 49th Annual Meeting of the Association for Computational Linguistics: Human Language Technologies, pp. 510-520, 2011. +Liu, H., Deng, Z., Li, X., Chen, S., and So, A. M.-C. Nonconvex robust synchronization of rotations. In NeurIPS Annual Workshop on Optimization for Machine Learning, pp. 1-7, 2020. +Lovasz, L. Submodular functions and convexity. In Mathematical programming the state of the art, pp. 235-257. Springer, 1983. +Mehta, A., Saberi, A., Vazirani, U., and Vazirani, V. Adwords and generalized online matching. Journal of the ACM, 54(5):22-es, 2007. +Mitra, S., Feldman, M., and Karbasi, A. Submodular+ concave. In Advances in Neural Information Processing Systems, 2021. +Mokhtari, A., Hassani, H., and Karbasi, A. Conditional gradient method for stochastic submodular maximization: Closing the gap. In International Conference on Artificial Intelligence and Statistics, pp. 1886-1895. PMLR, 2018. +Murty, K. G. and Kabadi, S. N. Some np-complete problems in quadratic and nonlinear programming. Mathematical Programming, 39(2):117-129, 1987. +Nemhauser, G. L., Wolsey, L. A., and Fisher, M. L. An analysis of approximations for maximizing submodular set functions—i. Mathematical Programming, 14(1):265–294, 1978. + +Nesterov, Y. Introductory Lectures on Convex Optimization: A Basic Course, volume 87. Springer Science & Business Media, 2013. +Netrapalli, P., U N, N., Sanghavi, S., Anandkumar, A., and Jain, P. Non-convex robust pca. In Advances in Neural Information Processing Systems, pp. 1107-1115, 2014. +Quanrud, K. and Khashabi, D. Online learning with adversarial delays. In Advances in Neural Information Processing Systems, pp. 1270-1278, 2015. +Streeter, M. and Golovin, D. An online algorithm for maximizing submodular functions. In Advances in Neural Information Processing Systems, pp. 1577-1584, 2008. +Yang, Y., Mao, X., Pei, J., and He, X. Continuous influence maximization: What discounts should we offer to social network users? In Proceedings of the 2016 international conference on management of data, pp. 727-741, 2016. +Zhang, M., Chen, L., Hassani, H., and Karbasi, A. Online continuous submodular maximization: From full-information to bandit feedback. In Advances in Neural Information Processing Systems, pp. 9206-9217, 2019. +Zinkevich, M. Online convex programming and generalized infinitesimal gradient ascent. In Proceedings of the 20th International Conference on Machine Learning, pp. 928-936, 2003. + +# A. Proofs in Section 3 + +# A.1. Proof of Lemma 1 + +First, we review some basic inequalities for $\gamma$ -weakly continuous DR-submodular function $f$ . + +Lemma 3. For a monotone, differentiable, and $\gamma$ -weakly continuous $DR$ -submodular function $f$ , we have + +1. For any $\mathbf{x} \leq \mathbf{y}$ , we have $\langle \mathbf{y} - \mathbf{x}, \nabla f(\mathbf{x}) \rangle \geq \gamma (f(\mathbf{y}) - f(\mathbf{x}))$ and $\langle \mathbf{y} - \mathbf{x}, \nabla f(\mathbf{y}) \rangle \leq \frac{1}{\gamma} (f(\mathbf{y}) - f(\mathbf{x}))$ . +2. For any $\pmb{x}, \pmb{y} \in \mathcal{X}$ , we also could derive $\langle \pmb{y} - \pmb{x}, \nabla f(\pmb{x}) \rangle \geq \gamma f(\pmb{x} \vee \pmb{y}) + \frac{1}{\gamma} f(\pmb{x} \wedge \pmb{y}) - (\gamma + \frac{1}{\gamma}) f(\pmb{x})$ . + +Proof. First, according to the definition of DR-submodular function and monotone property in Section 2, we have $\nabla f(\pmb{x}) \geq \gamma \nabla f(\pmb{y})$ , if $\pmb{x} \leq \pmb{y}$ . Thus, for any $\pmb{x} \leq \pmb{y}$ , we have + +$$ +f (\boldsymbol {y}) - f (\boldsymbol {x}) = \int_ {0} ^ {1} \langle \boldsymbol {y} - \boldsymbol {x}, \nabla f (\boldsymbol {x} + z (\boldsymbol {y} - \boldsymbol {x})) \rangle d z \leq \frac {1}{\gamma} \langle \boldsymbol {y} - \boldsymbol {x}, \nabla f (\boldsymbol {x}) \rangle , \tag {3} +$$ + +$$ +f (\boldsymbol {y}) - f (\boldsymbol {x}) = \int_ {0} ^ {1} \langle \boldsymbol {y} - \boldsymbol {x}, \nabla f (\boldsymbol {x} + z (\boldsymbol {y} - \boldsymbol {x})) \rangle d z \geq \gamma \langle \boldsymbol {y} - \boldsymbol {x}, \nabla f (\boldsymbol {y}) \rangle , +$$ + +where these two inequalities follow from $\pmb{y} \geq \pmb{x} + z(\pmb{y} - \pmb{x}) \geq \pmb{x}$ such that $\frac{1}{\gamma} \nabla f(\pmb{x}) \geq \nabla f(\pmb{x} + z(\pmb{y} - \pmb{x})) \geq \gamma \nabla f(\pmb{y})$ for any $z \in [0, 1]$ . We finish the proof of the first inequality in Lemma 3. + +Then, from (3), we could derive that + +$$ +\langle \boldsymbol {y} \vee \boldsymbol {x} - \boldsymbol {x}, \nabla f (\boldsymbol {x}) \rangle \geq \gamma f (\boldsymbol {y} \vee \boldsymbol {x}) - \gamma f (\boldsymbol {x}), +$$ + +$$ +\langle \boldsymbol {x} \wedge \boldsymbol {y} - \boldsymbol {x}, \nabla f (\boldsymbol {x}) \rangle \geq \frac {1}{\gamma} (f (\boldsymbol {x} \wedge \boldsymbol {y}) - f (\boldsymbol {x})), \tag {4} +$$ + +where $\pmb {y}\lor \pmb {x}\geq \pmb{x}$ and $\pmb {x}\wedge \pmb {y}\leq \pmb{x}$ + +Merging the two equations in (4), we have, for any $\pmb{x}$ and $\pmb{y} \in \mathcal{X}$ + +$$ +\begin{array}{l} \langle \boldsymbol {y} - \boldsymbol {x}, \nabla f (\boldsymbol {x}) \rangle = \langle \boldsymbol {y} \vee \boldsymbol {x} - \boldsymbol {x}, \nabla f (\boldsymbol {x}) \rangle + \langle \boldsymbol {x} \wedge \boldsymbol {y} - \boldsymbol {x}, \nabla f (\boldsymbol {x}) \rangle \\ \geq \gamma f (\boldsymbol {x} \vee \boldsymbol {y}) + \frac {1}{\gamma} f (\boldsymbol {x} \wedge \boldsymbol {y}) - (\gamma + \frac {1}{\gamma}) f (\boldsymbol {x}), \tag {5} \\ \end{array} +$$ + +where $\pmb{x} \wedge \pmb{y} + \pmb{x} \vee \pmb{y} = \pmb{x} + \pmb{y}$ . Thus, we prove the second inequality in Lemma 3. + +Next, with the Lemma 3, we prove the Lemma 1. + +Proof. From Equation (5), if $\pmb{x}$ is a stationary point of $f$ in domain $\mathcal{C}$ , we have $(\gamma + \frac{1}{\gamma})f(\pmb{x}) \geq \gamma f(\pmb{x} \vee \pmb{y}) + \frac{1}{\gamma} f(\pmb{x} \wedge \pmb{y})$ for any $\pmb{y} \in \mathcal{C}$ . Due to the monotone and non-negative property, $f(\pmb{x}) \geq \frac{\gamma^2}{\gamma^2 + 1} \max_{\pmb{y} \in \mathcal{C}} f(\pmb{y})$ . + +# A.2. Proof of Lemma 2 + +Proof. First, we obtain an inequality about $\langle \pmb{x},\nabla F(\pmb {x})\rangle$ , i.e., + +$$ +\begin{array}{l} \langle \boldsymbol {x}, \nabla F (\boldsymbol {x}) \rangle = \int_ {0} ^ {1} w (z) \langle \boldsymbol {x}, \nabla f (z * \boldsymbol {x}) \rangle \mathrm {d} z \\ = \int_ {0} ^ {1} w (z) \mathrm {d} f (z * \boldsymbol {x}) \tag {6} \\ = w (z) f (z * \boldsymbol {x}) | _ {z = 0} ^ {z = 1} - \int_ {0} ^ {1} f (z * \boldsymbol {x}) w ^ {\prime} (z) \mathrm {d} z \\ \leq w (1) f (\boldsymbol {x}) - \int_ {0} ^ {1} f (z * \boldsymbol {x}) w ^ {\prime} (z) \mathrm {d} z. \\ \end{array} +$$ + +Then, we also prove some properties about $\langle \pmb{y}, \nabla F(\pmb{x}) \rangle$ , namely, + +$$ +\begin{array}{l} \langle \boldsymbol {y}, \nabla F (\boldsymbol {x}) \rangle = \int_ {0} ^ {1} w (z) \langle \boldsymbol {y}, \nabla f (z * \boldsymbol {x}) \rangle \mathrm {d} z \\ \geq \int_ {0} ^ {1} w (z) \langle \boldsymbol {y} \vee (z * \boldsymbol {x}) - z * \boldsymbol {x}, \nabla f (z * \boldsymbol {x}) \rangle \mathrm {d} z \\ \geq \gamma \int_ {0} ^ {1} w (z) \left(f (\boldsymbol {y} \vee (z * \boldsymbol {x})) - f (z * \boldsymbol {x})\right) d z \tag {7} \\ \geq (\gamma \int_ {0} ^ {1} w (z) d z) f (\boldsymbol {y}) - \int_ {0} ^ {1} \gamma w (z) f (z * \boldsymbol {x}) \mathrm {d} z, \\ \end{array} +$$ + +where the first inequality follows from $\pmb{y} \geq \pmb{y} \vee (z * \pmb{x}) - z * \pmb{x} \geq \mathbf{0}$ and $\nabla f(z * \pmb{x}) \geq \mathbf{0}$ ; the second one comes from the Lemma 1; and the final inequality follows from $f(\pmb{y} \vee (z * \pmb{x})) \geq f(\pmb{y})$ . + +Finally, putting above the inequality (6) and inequality (7) together, we have + +$$ +\begin{array}{l} \langle \boldsymbol {y} - \boldsymbol {x}, \nabla F (\boldsymbol {x}) \rangle \geq (\gamma \int_ {0} ^ {1} w (z) \mathrm {d} z) f (\boldsymbol {y}) - w (1) f (\boldsymbol {x}) + \int_ {0} ^ {1} \left(w ^ {\prime} (z) - \gamma w (z)\right) f (z * \boldsymbol {x}) \mathrm {d} z \\ = (\gamma \int_ {0} ^ {1} w (z) \mathrm {d} z) \left(f (\boldsymbol {y}) - \frac {w (1) + \int_ {0} ^ {1} \left(\gamma w (z) - w ^ {\prime} (z)\right) \frac {f (z * \boldsymbol {x})}{f (\boldsymbol {x})} \mathrm {d} z}{\gamma \int_ {0} ^ {1} w (z) \mathrm {d} z} f (\boldsymbol {x})\right) \tag {8} \\ = (\gamma \int_ {0} ^ {1} w (z) \mathrm {d} z) (f (\boldsymbol {y}) - \theta (w, f, \boldsymbol {x}) f (\boldsymbol {x})) \\ \geq (\gamma \int_ {0} ^ {1} w (z) \mathrm {d} z) (f (\boldsymbol {y}) - \theta (w) f (\boldsymbol {x})), \\ \end{array} +$$ + +where the final inequality follows from $\theta (w) = \max_{f,\pmb {x}}\theta (w,f,\pmb {x})$ + +# A.3. Proof of Theorem 1 + +Proof. In this proof, we investigate the optimal value and solution about the following optimization problem: + +$$ +\begin{array}{l} \min _ {w} \theta (w) = \min _ {w} \max _ {f, \mathbf {x}} \frac {w (1) + \int_ {0} ^ {1} (\gamma w (z) - w ^ {\prime} (z)) \frac {f (z * \mathbf {x})}{f (\mathbf {x})} \mathrm {d} z}{\gamma \int_ {0} ^ {1} w (z) \mathrm {d} z} \\ \text {s . t .} w (z) \geq 0, \tag {9} \\ w (z) \in C ^ {1} [ 0, 1 ], \\ f (\boldsymbol {x}) > 0, \\ \nabla f (\boldsymbol {x} _ {1}) \geq \gamma \nabla f (\boldsymbol {y} _ {1}) \geq \mathbf {0}, \forall \boldsymbol {x} _ {1} \leq \boldsymbol {y} _ {1}. \\ \end{array} +$$ + +(1) Before going into the detail, we first consider a new optimization problem as follows: + +$$ +\begin{array}{l} \min _ {w} \max _ {R} \theta (w, R) \\ \begin{array}{l} \text {s . t .} w (z) \geq 0, \end{array} \\ w (z) \in C ^ {1} [ 0, 1 ], \\ \gamma \int_ {0} ^ {1} w (z) d z = 1, \tag {10} \\ R (z) \geq 0, \\ R (1) = 1, \\ R ^ {\prime} \left(z _ {1}\right) \geq \gamma R ^ {\prime} \left(z _ {2}\right) \geq 0 (\forall z _ {1} \leq z _ {2}, z _ {1}, z _ {2} \in [ 0, 1 ]), \\ \end{array} +$$ + +where $\theta (w,R) = w(1) + \int_0^1 (\gamma w(z) - w'(z))R(z)\mathrm{d}z$ + +Next, we prove the equivalence between problem (9) and problem (10). For any fixed point $\pmb{x} \in \mathcal{C}$ , we consider the function $m(z) = \frac{f(z * \pmb{x})}{f(\pmb{x})}$ (we assume $f(\pmb{x}) > 0$ ), which is satisfied with the constraints of problem (10), i.e., $m(z) \geq 0$ , $m(1) = 1$ , + +and $m'(z_1) = \frac{\langle\pmb{x}, \nabla f(z_1 * \pmb{x}) \rangle}{f(\pmb{x})} \geq \frac{\gamma \langle\pmb{x}, \nabla f(z_2 * \pmb{x}) \rangle}{f(\pmb{x})} = \gamma m'(z_2) \geq 0$ ( $\forall z_1 \leq z_2, z_1, z_2 \in [0,1]$ ). Therefore, the optimal objective value of problem (10) is larger than that of problem (9). Moreover, for any $R(z)$ satisfying the constraints in problem (10), we can design a function $f_1(\pmb{x}) = R(x_1 / a_1)$ , where $x_1$ (we assume $x_1 \in [0, a_1]$ in the Section 2) is the first coordinate of point $\pmb{x}$ . Also, $f_1(\pmb{x}) \geq 0$ and when $\pmb{x} \leq \pmb{y}$ , we have $\nabla f_1(\pmb{x}) \geq \gamma \nabla f_1(\pmb{y})$ . Hence, $f_1$ is also satisfied with the constraints of problem (9). If we set $\pmb{x}_1 = (a_1, 0, \dots, 0) \in \mathcal{X}$ , $\frac{f_1(z * \pmb{x}_1)}{f_1(\pmb{x}_1)} = R(z)$ such that the optimal objective value of problem (9) is larger than that of problem (10). As a result, the optimization problem (10) is equivalent to the problem (9). + +(2) Then, we prove the $\min_w\max_{f,\pmb {x}}\theta (w,f,\pmb {x})\geq \frac{1}{1 - e^{-\gamma}}$ . Setting $\widehat{R} (z) = \frac{1 - e^{-\gamma z}}{1 - e^{-\gamma}}$ , we could verify that, if $\gamma \int_0^1 w(z)dz = 1$ + +$$ +\begin{array}{l} \theta (w, \widehat {R}) = w (1) + \int_ {0} ^ {1} (\gamma w (z) - w ^ {\prime} (z)) \widehat {R} (z) \mathrm {d} z \\ = w (1) + \frac {\int_ {0} ^ {1} (\gamma w (z) - w ^ {\prime} (z)) \mathrm {d} z + \int_ {0} ^ {1} e ^ {- \gamma z} (w ^ {\prime} (z) - \gamma w (z)) \mathrm {d} z}{1 - e ^ {- \gamma}} \\ = w (1) + \frac {1 - w (1) + w (0) + e ^ {- \gamma z} w (z) | _ {z = 0} ^ {z = 1}}{1 - e ^ {- \gamma}} \tag {11} \\ = w (1) + \frac {1 - w (1) + w (0) + e ^ {- \gamma} w (1) - w (0)}{1 - e ^ {- \gamma}} \\ = \frac {1}{1 - e ^ {- \gamma}}. \\ \end{array} +$$ + +Also, $\widehat{R}$ is satisfied with the constraints of optimization problem (10), i.e., for any $z\in [0,1]$ , $\widehat{R} (z)\geq 0$ , $\widehat{R} (1) = 1$ and $\widehat{R} '(x) = \frac{\gamma e^{-\gamma x}}{1 - e^{-\gamma}}\geq \frac{\gamma^2e^{-\gamma y}}{1 - e^{-\gamma}} = \gamma \widehat{R} '(y)$ where $x\leq y$ and $0\leq \gamma \leq 1$ . Therefore, $\max_R\theta (w,R)\geq \theta (w,\widehat{R}) = \frac{1}{1 - e^{-\gamma}}$ and $\min_w\max_{f,\pmb {x}}\theta (w,f,\pmb {x}) = \min_w\max_R\theta (w,R)\geq \frac{1}{1 - e^{-\gamma}}$ . + +(3) We consider $\widehat{w}(z) = e^{\gamma(z-1)}$ and observe that $\widehat{w}'(z) = \gamma \widehat{w}(z)$ such that $\theta(\widehat{w}, f, \boldsymbol{x}) = \frac{\widehat{w}(1) + \int_{0}^{1} (\gamma \widehat{w}(z) - \widehat{w}'(z)) \frac{f(z * \boldsymbol{x})}{f(\boldsymbol{x})} \mathrm{d}z}{\gamma \int_{0}^{1} \widehat{w}(z) \mathrm{d}z} = \frac{\widehat{w}(1)}{\gamma \int_{0}^{1} \widehat{w}(z) \mathrm{d}z}$ for any function $f$ . Also, $\widehat{w}(z)$ is satisfied with the constraints in optimization problem (9), namely, $\widehat{w}(z) \geq 0$ and $\widehat{w} \in C^{1}[0,1]$ . Therefore, $\frac{1}{1-e^{-\gamma}} = \min_{w} \max_{f, \boldsymbol{x}} \theta(w, f, \boldsymbol{x})$ and $e^{\gamma(z-1)} \in \arg \min_{w} \theta(w)$ . + +# A.4. Proof of Theorem 2 + +Proof. From the definition of $F$ , we have $\langle \pmb{y} - \pmb{x}, \nabla F(\pmb{x}) \rangle \geq (1 - e^{-\gamma}) f(\pmb{y}) - f(\pmb{x})$ for any point $\pmb{x}, \pmb{y} \in \mathcal{C}$ . Hence, when $\pmb{x} \in \mathcal{C}$ is a stationary point for $F$ in the domain $\mathcal{C}$ , $0 \geq \langle \pmb{y} - \pmb{x}, \nabla F(\pmb{x}) \rangle \geq (1 - e^{-\gamma}) f(\pmb{y}) - f(\pmb{x})$ for any point $\pmb{y} \in \mathcal{C}$ such that $f(\pmb{x}) \geq (1 - e^{-\gamma}) \max_{\pmb{y} \in \mathcal{C}} f(\pmb{y})$ . + +Then, for the second one, we first verify that the value $\int_0^1\frac{e^{\gamma(z - 1)}}{z} f(z*\pmb {x})\mathrm{d}z$ is controlled via $f(\pmb {x})$ for any $\pmb {x}\in \mathcal{X}$ . For any $\delta \in (0,1)$ , we first have + +$$ +\begin{array}{l} \int_ {0} ^ {1} \frac {e ^ {\gamma (z - 1)}}{z} f (z * \boldsymbol {x}) \mathrm {d} z \\ = \left(\int_ {0} ^ {\delta} + \int_ {\delta} ^ {1}\right) \frac {e ^ {\gamma (z - 1)}}{z} f (z * \boldsymbol {x}) \mathrm {d} z \\ \leq \int_ {0} ^ {\delta} \frac {f (z * x)}{z} d z + \left(\int_ {\delta} ^ {1} \frac {1}{z} d z\right) f (\boldsymbol {x}) \tag {12} \\ = \int_ {0} ^ {\delta} \frac {f (z * x)}{z} \mathrm {d} z + \ln (\frac {1}{\delta}) f (\boldsymbol {x}) \\ = \int_ {0} ^ {\delta} \frac {\int_ {0} ^ {z} \langle \boldsymbol {x} , \nabla f (u * \boldsymbol {x}) \rangle \mathrm {d} u}{z} \mathrm {d} z + \ln (\frac {1}{\delta}) f (\boldsymbol {x}), \\ \end{array} +$$ + +where the first inequality follows from $f(z * \pmb{x}) \leq f(\pmb{x})$ and $\delta \in [0,1]$ , and the final equality from $\int_0^z \langle \pmb{x}, \nabla f(u * \pmb{x}) \rangle \, \mathrm{d}u = f(z * \pmb{x}) - f(\mathbf{0}) = f(z * \pmb{x})$ . + +Next, + +$$ +\begin{array}{l} \int_ {0} ^ {\delta} \frac {\int_ {0} ^ {z} \langle \boldsymbol {x} , \nabla f (u * \boldsymbol {x}) \rangle \mathrm {d} u}{z} \mathrm {d} z = \int_ {0} ^ {\delta} \langle \boldsymbol {x}, \nabla f (u * \boldsymbol {x}) \rangle \int_ {u} ^ {\delta} \frac {1}{z} \mathrm {d} z \mathrm {d} u \\ = \int_ {0} ^ {\delta} \langle \boldsymbol {x}, \nabla f (u * \boldsymbol {x}) \rangle \ln \left(\frac {\delta}{u}\right) d u \\ = \int_ {0} ^ {\delta} \left(\left\langle \boldsymbol {x}, \nabla f (u * \boldsymbol {x}) - \nabla f (\boldsymbol {x}) \right\rangle + \left\langle \boldsymbol {x}, \nabla f (\boldsymbol {x}) \right\rangle\right) \ln \left(\frac {\delta}{u}\right) d u \tag {13} \\ \leq \int_ {0} ^ {\delta} \ln (\frac {\delta}{u}) \mathrm {d} u (L r ^ {2} (\mathcal {X}) + \frac {f (\boldsymbol {x})}{\gamma}) \\ = (u - u \ln (\frac {u}{\delta})) | _ {u = 0} ^ {\delta} \left(L r ^ {2} (\mathcal {X}) + \frac {f (\boldsymbol {x})}{\gamma}\right) \\ = \delta (L r ^ {2} (\mathcal {X}) + \frac {f (\boldsymbol {x})}{\gamma}), \\ \end{array} +$$ + +where the first equality follows from the Fubini's theorem; in the first inequality, we use $\langle \pmb{x}, \nabla f(u * \pmb{x}) - \nabla f(\pmb{x}) \rangle \leq L \| \pmb{x} \|^2$ , which is derived from the $L$ -smooth property, and $\langle \pmb{x}, \nabla f(\pmb{x}) \rangle \leq \frac{f(\pmb{x})}{\gamma}$ , following from the Lemma 1 and $f(\mathbf{0}) = 0$ ; the final equality follows from $\lim_{u \to 0_+} u \ln(u) = 0$ . + +From Equation (12) and Equation (13), for any $\delta \in (0,1)$ , we have + +$$ +\begin{array}{l} F (\boldsymbol {x}) \leq \ln \left(\frac {1}{\delta}\right) f (\boldsymbol {x}) + \delta \left(L _ {*} r ^ {2} (\mathcal {X}) + \frac {f (\boldsymbol {x})}{\gamma}\right) \tag {14} \\ \leq \ln (\frac {1}{\delta}) (f (\pmb {x}) + c) + \delta (L _ {*} r ^ {2} (\mathcal {X}) + \frac {f (\pmb {x})}{\gamma}), \\ \end{array} +$$ + +where the second inequality comes from $c > 0$ . + +If we set $\delta = \frac{f(\pmb{x}) + c}{\frac{f(\pmb{x})}{\gamma} + Lr^2(\mathcal{X})} \in [0,1]$ ( $0 \leq \gamma \leq 1$ and $0 < c \leq L_r r^2(\mathcal{X}))$ , we have + +$$ +\begin{array}{l} F (\boldsymbol {x}) \leq \ln \left(\frac {1}{\delta}\right) (f (\boldsymbol {x}) + c) + \delta \left(L _ {*} r ^ {2} (\mathcal {X}) + \frac {f (\boldsymbol {x})}{\gamma}\right) \\ = (1 + \ln (\frac {1}{\delta})) (f (\boldsymbol {x}) + c) \\ \leq (1 + \ln (\tau) (f (\boldsymbol {x}) + c), \\ \end{array} +$$ + +where the final inequality is derived from $\frac{1}{\delta} \leq \tau$ and $\tau = \max \left(\frac{1}{\gamma}, \frac{L_* r^2(\mathcal{X})}{c}\right)$ . + +As a result, the value $\int_0^1\frac{e^{\gamma(z - 1)}}{z} f(z*\pmb {x})\mathrm{d}z$ is well-defined. We also could verify that $\nabla \int_0^1\frac{e^{\gamma(z - 1)}}{z} f(z*\pmb {x})\mathrm{d}z = \int_0^1 e^{\gamma (z - 1)}\nabla f(z*\pmb {x})\mathrm{d}z$ so that we could set $F(\pmb {x}) = \int_0^1\frac{e^{\gamma(z - 1)}}{z} f(z*\pmb {x})\mathrm{d}z.$ + +For the final one, + +$$ +\begin{array}{l} \| \nabla F (\boldsymbol {x}) - \nabla F (\boldsymbol {y}) \| = \left\| \int_ {0} ^ {1} e ^ {\gamma (z - 1)} (\nabla f (z * \boldsymbol {x}) - \nabla f (z * \boldsymbol {y})) \mathrm {d} z \right\| \\ \leq \int_ {0} ^ {1} e ^ {\gamma (z - 1)} \| \nabla f (z * \boldsymbol {x}) - \nabla f (z * \boldsymbol {y}) \| \mathrm {d} z \tag {15} \\ \leq L \left(\int_ {0} ^ {1} e ^ {\gamma (z - 1)} z d z\right) \| \boldsymbol {x} - \boldsymbol {y} \| \\ = \frac {\gamma + e ^ {- \gamma} - 1}{\gamma^ {2}} L \| \boldsymbol {x} - \boldsymbol {y} \|. \\ \end{array} +$$ + +□ + +# A.5. Proof of Proposition 1 + +Proof. For the first one, fixed $z$ , $\mathbb{E}\left(\widetilde{\nabla} f(z*\pmb{x})\big|\pmb{x},z\right) = \nabla f(z*\pmb{x})$ such that $\mathbb{E}\left(\widetilde{\nabla} f(z*\pmb{x})\big|\pmb{x}\right) = \mathbb{E}_{z\sim \mathbf{Z}}\left(\mathbb{E}\left(\widetilde{\nabla} f(z*\pmb{x})\big|\pmb{x},z\right)\right) = \mathbb{E}_{z\sim \mathbf{Z}}\left(\nabla f(z*\pmb{x})\big|\pmb{x}\right) = \int_{z = 0}^{1}\frac{\gamma e^{\gamma(z - 1)}}{1 - e^{-\gamma}}\nabla f(z*\pmb{x})\mathrm{d}z = \frac{\gamma}{1 - e^{-\gamma}} F(\pmb{x})$ . For the second one, + +$$ +\begin{array}{l} \mathbb {E} \left(\left. \left\| \frac {1 - e ^ {- \gamma}}{\gamma} \widetilde {\nabla} f (z * \boldsymbol {x}) - \nabla F (\boldsymbol {x}) \right\| ^ {2} \right\rvert \boldsymbol {x}\right) \\ = \mathbb {E} \left(\left\| \frac {1 - e ^ {- \gamma}}{\gamma} (\widetilde {\nabla} f (z * \boldsymbol {x}) - \nabla f (z * \boldsymbol {x})) + \frac {1 - e ^ {- \gamma}}{\gamma} \nabla f (z * \boldsymbol {x}) - \nabla F (\boldsymbol {x}) \right\| ^ {2} \mid \boldsymbol {x}\right) \\ \leq 2 \mathbb {E} _ {z \sim \mathbf {Z}} \left(\mathbb {E} \left(\left\| \frac {1 - e ^ {- \gamma}}{\gamma} (\widetilde {\nabla} f (z * \boldsymbol {x}) - \nabla f (z * \boldsymbol {x})) \right\| ^ {2} \mid \boldsymbol {x}, z\right) + \left\| \frac {1 - e ^ {- \gamma}}{\gamma} \nabla f (z * \boldsymbol {x}) - \nabla F (\boldsymbol {x}) \right\| ^ {2}\right) \\ \leq 2 \frac {\left(1 - e ^ {- \gamma}\right) ^ {2} \sigma^ {2}}{\gamma^ {2}} + 2 \mathbb {E} _ {z \sim \mathbf {Z}} \left(\left. \left\| \frac {1 - e ^ {- \gamma}}{\gamma} \nabla f (z * \boldsymbol {x}) - \nabla F (\boldsymbol {x}) \right\| ^ {2} \right| \boldsymbol {x}\right) \\ \leq 2 \frac {\left(1 - e ^ {- \gamma}\right) ^ {2} \sigma^ {2}}{\gamma^ {2}} + 2 \mathbb {E} _ {z \sim \mathbf {Z}} \left(\left. \left| \int_ {0} ^ {1} e ^ {\gamma (u - 1)} (\nabla f (z * \boldsymbol {x}) - \nabla f (u * \boldsymbol {x})) \mathrm {d} u \right| ^ {2} \right\rvert \boldsymbol {x}\right) \\ \leq 2 \frac {\left(1 - e ^ {- \gamma}\right) ^ {2} \sigma^ {2}}{\gamma^ {2}} + 2 \mathbb {E} _ {z \sim \mathbf {Z}} \left(\left. \left(\int_ {0} ^ {1} e ^ {\gamma (u - 1)} | z - u | L \| \boldsymbol {x} \| \mathrm {d} u\right) ^ {2} \right| \boldsymbol {x}\right) \\ \leq 2 \frac {\left(1 - e ^ {- \gamma}\right) ^ {2} \sigma^ {2}}{\gamma^ {2}} + 2 \mathbb {E} _ {z \sim \mathbf {Z}} \left(\int_ {0} ^ {1} e ^ {\gamma (u - 1)} \mathrm {d} u \int_ {u = 0} ^ {1} e ^ {\gamma (u - 1)} (z - u) ^ {2} L ^ {2} \| \boldsymbol {x} \| ^ {2} \mathrm {d} u \Bigg | \boldsymbol {x}\right) \\ = 2 \frac {\left(1 - e ^ {- \gamma}\right) ^ {2} \sigma^ {2}}{\gamma^ {2}} + 2 \int_ {z = 0} ^ {1} \int_ {u = 0} ^ {1} e ^ {\gamma (u + z - 2)} (z - u) ^ {2} L ^ {2} \| \boldsymbol {x} \| ^ {2} d u d z \\ \leq 2 \frac {(1 - e ^ {- \gamma}) ^ {2} \sigma^ {2}}{\gamma^ {2}} + \frac {2 L ^ {2} r ^ {2} (\mathcal {X}) (1 - e ^ {- 2 \gamma})}{3 \gamma}, \\ \end{array} +$$ + +where the first and fifth inequalities come from Cauchy-Schwarz inequality. + +# B. Proof of Theorem 3 + +First, we recall the projection theorem from (Bertsekas, 2015) in the following lemma. + +Lemma 4. For the projection $\mathcal{P}_{\mathcal{C}}(\boldsymbol{x}) = \arg \min_{\boldsymbol{z} \in \mathcal{C}} \| \boldsymbol{z} - \boldsymbol{x} \|$ , we have + +$$ +\left\langle \mathcal {P} _ {\mathcal {C}} (\boldsymbol {x}) \right\rangle - \boldsymbol {x}, \boldsymbol {z} - \mathcal {P} _ {\mathcal {C}} (\boldsymbol {x}) \rangle \geq 0, \forall \boldsymbol {z} \in \mathcal {C}. \tag {16} +$$ + +Before verifying the Theorem 3, we first provide following lemma. + +Lemma 5. In the t-round update in Algorithm 2, if we set the $\widetilde{\nabla} F(\boldsymbol{x}_t) = \frac{1 - e^{-\gamma}}{\gamma}\widetilde{\nabla} f(z_t*\boldsymbol{x}_t)$ , for any $\boldsymbol{y} \in \mathcal{C}$ and $\mu_t > 0$ we have + +$$ +\begin{array}{l} \mathbb {E} \left(F (\boldsymbol {x} _ {t + 1}) - F (\boldsymbol {x} _ {t}) + f (\boldsymbol {x} _ {t}) - (1 - e ^ {- \gamma}) f (\boldsymbol {y})\right) \\ \geq \mathbb {E} \left(\frac {1}{2 \eta_ {t}} \left(\| \boldsymbol {y} - \boldsymbol {x} _ {t + 1} \| ^ {2} - \| \boldsymbol {y} - \boldsymbol {x} _ {t} \| ^ {2}\right) - \frac {1}{2 \mu_ {t}} \left\| \nabla F (\boldsymbol {x} _ {t}) - \tilde {\nabla} F (\boldsymbol {x} _ {t}) \right\| ^ {2} + \left(\frac {1}{2 \eta_ {t}} - \frac {\mu_ {t} + L _ {\gamma}}{2}\right) \| \boldsymbol {x} _ {t + 1} - \boldsymbol {x} _ {t}) \| ^ {2}\right). \\ \end{array} +$$ + +Proof. From the Theorem 2, when $f$ is $L$ -smooth, the non-oblivious function $F$ is $L_{\gamma}$ -smooth. Hence + +$$ +\begin{array}{l} F \left(\boldsymbol {x} _ {t + 1}\right) - F \left(\boldsymbol {x} _ {t}\right) = \int_ {z = 0} ^ {z = 1} \left\langle \boldsymbol {x} _ {t + 1} - \boldsymbol {x} _ {t}, \nabla F \left(\boldsymbol {x} _ {t} + z \left(\boldsymbol {x} _ {t + 1} - \boldsymbol {x} _ {t}\right)\right) \right\rangle d z \tag {17} \\ \geq \left\langle \boldsymbol {x} _ {t + 1} - \boldsymbol {x} _ {t}, \nabla F (\boldsymbol {x} _ {t}) \right\rangle - \frac {L _ {\gamma}}{2} \left\| \boldsymbol {x} _ {t + 1} - \boldsymbol {x} _ {t} \right\| ^ {2}. \\ \end{array} +$$ + +Then, + +$$ +\begin{array}{l} \langle \boldsymbol {x} _ {t + 1} - \boldsymbol {x} _ {t}, \nabla F (\boldsymbol {x} _ {t}) \rangle \\ = \left\langle \boldsymbol {x} _ {t + 1} - \boldsymbol {x} _ {t}, \widetilde {\nabla} F (\boldsymbol {x} _ {t}) \right\rangle + \left\langle \boldsymbol {x} _ {t + 1} - \boldsymbol {x} _ {t}, \nabla F (\boldsymbol {x} _ {t}) - \widetilde {\nabla} F (\boldsymbol {x} _ {t}) \right\rangle \tag {18} \\ \geq \langle \boldsymbol {x} _ {t + 1} - \boldsymbol {x} _ {t}, \widetilde {\nabla} F (\boldsymbol {x} _ {t}) \rangle - \frac {1}{2 \mu_ {t}} \left\| \nabla F (\boldsymbol {x} _ {t}) - \widetilde {\nabla} F (\boldsymbol {x} _ {t}) \right\| ^ {2} - \frac {\mu_ {t}}{2} \| \boldsymbol {x} _ {t + 1} - \boldsymbol {x} _ {t} \| ^ {2}, \\ \end{array} +$$ + +where the first inequality from the Young's inequality. + +It is well known $\widetilde{\nabla} F(\pmb{x}_t) = \frac{1}{\eta_t} (\pmb{y}_{t + 1} - \pmb{x}_t)$ such that + +$$ +\begin{array}{l} \langle \boldsymbol {x} _ {t + 1} - \boldsymbol {x} _ {t}, \tilde {\nabla} F (\boldsymbol {x} _ {t}) \rangle \\ = \langle \boldsymbol {x} _ {t + 1} - \boldsymbol {y}, \tilde {\nabla} F (\boldsymbol {x} _ {t}) \rangle + \langle \boldsymbol {y} - \boldsymbol {x} _ {t}, \tilde {\nabla} F (\boldsymbol {x} _ {t}) \rangle \\ = \frac {1}{\eta_ {t}} \left\langle \boldsymbol {x} _ {t + 1} - \boldsymbol {y}, \boldsymbol {y} _ {t + 1} - \boldsymbol {x} _ {t} \right\rangle + \left\langle \boldsymbol {y} - \boldsymbol {x} _ {t}, \tilde {\nabla} F (\boldsymbol {x} _ {t}) \right\rangle \\ = \frac {1}{\eta_ {t}} \left\langle \boldsymbol {x} _ {t + 1} - \boldsymbol {y}, \boldsymbol {y} _ {t + 1} - \boldsymbol {x} _ {t + 1} \right\rangle + \frac {1}{\eta_ {t}} \left\langle \boldsymbol {x} _ {t + 1} - \boldsymbol {y}, \boldsymbol {x} _ {t + 1} - \boldsymbol {x} _ {t} \right\rangle + \left\langle \boldsymbol {y} - \boldsymbol {x} _ {t}, \tilde {\nabla} F (\boldsymbol {x} _ {t}) \right\rangle \tag {19} \\ \geq \frac {1}{\eta_ {t}} \left\langle \boldsymbol {x} _ {t + 1} - \boldsymbol {y}, \boldsymbol {x} _ {t + 1} - \boldsymbol {x} _ {t} \right\rangle + \left\langle \boldsymbol {y} - \boldsymbol {x} _ {t}, \widetilde {\nabla} F (\boldsymbol {x} _ {t}) \right\rangle \\ = \frac {1}{2 \eta_ {t}} \left(\| \boldsymbol {y} - \boldsymbol {x} _ {t + 1} \| ^ {2} + \| \boldsymbol {x} _ {t + 1} - \boldsymbol {x} _ {t} \| ^ {2} - \| \boldsymbol {y} - \boldsymbol {x} _ {t} \| ^ {2}\right) + \langle \boldsymbol {y} - \boldsymbol {x} _ {t}, \tilde {\nabla} F (\boldsymbol {x} _ {t}) \rangle , \\ \end{array} +$$ + +where the first inequality follows from the Lemma 4. + +From the Equation (17)-(19), we have + +$$ +\begin{array}{l} F \left(\boldsymbol {x} _ {t + 1}\right) - F \left(\boldsymbol {x} _ {t}\right) \\ \geq \frac {1}{2 \eta_ {t}} \left(\| \boldsymbol {y} - \boldsymbol {x} _ {t + 1} \| ^ {2} + \| \boldsymbol {x} _ {t + 1} - \boldsymbol {x} _ {t} \| ^ {2} - \| \boldsymbol {y} - \boldsymbol {x} _ {t} \| ^ {2}\right) + \langle \boldsymbol {y} - \boldsymbol {x} _ {t}, \tilde {\nabla} F (\boldsymbol {x} _ {t}) \rangle \\ - \frac {1}{2 \mu_ {t}} \left\| \nabla F \left(\boldsymbol {x} _ {t}\right) - \widetilde {\nabla} F \left(\boldsymbol {x} _ {t}\right) \right\| ^ {2} - \frac {\mu_ {t} + L _ {\gamma}}{2} \| \boldsymbol {x} _ {t + 1} - \boldsymbol {x} _ {t} \| ^ {2} \tag {20} \\ \geq \frac {1}{2 \eta_ {t}} \left(\left\| \boldsymbol {y} - \boldsymbol {x} _ {t + 1} \right\| ^ {2} - \left\| \boldsymbol {y} - \boldsymbol {x} _ {t} \right\| ^ {2}\right) + \langle \boldsymbol {y} - \boldsymbol {x} _ {t}, \widetilde {\nabla} F (\boldsymbol {x} _ {t}) \rangle \\ - \frac {1}{2 \mu_ {t}} \left\| \nabla F (\boldsymbol {x} _ {t}) - \widetilde {\nabla} F (\boldsymbol {x} _ {t}) \right\| ^ {2} + \left(\frac {1}{2 \eta_ {t}} - \frac {\mu_ {t} + L _ {\gamma}}{2}\right) \| \boldsymbol {x} _ {t + 1} - \boldsymbol {x} _ {t} \| ^ {2}. \\ \end{array} +$$ + +From the Proposition 1, $\mathbb{E}(\widetilde{\nabla} F(\pmb{x}_t) | \pmb{x}_t) = \nabla F(\pmb{x}_t)$ and we also have + +$$ +\begin{array}{l} \mathbb {E} \left(F \left(\boldsymbol {x} _ {t + 1}\right) - F \left(\boldsymbol {x} _ {t}\right)\right) \\ \geq \mathbb {E} \left(\frac {1}{2 \eta_ {t}} \left(\| \boldsymbol {y} - \boldsymbol {x} _ {t + 1} \| ^ {2} - \| \boldsymbol {y} - \boldsymbol {x} _ {t} \| ^ {2}\right) + \mathbb {E} \left(\langle \boldsymbol {y} - \boldsymbol {x} _ {t}, \tilde {\nabla} F (\boldsymbol {x} _ {t}) \rangle | \boldsymbol {x} _ {t}\right) \right. \\ - \frac {1}{2 \mu_ {t}} \left\| \nabla F (\boldsymbol {x} _ {t}) - \widetilde {\nabla} F (\boldsymbol {x} _ {t}) \right\| ^ {2} + \left(\frac {1}{2 \eta_ {t}} - \frac {\mu_ {t} + L _ {\gamma}}{2}\right) \| \boldsymbol {x} _ {t + 1} - \boldsymbol {x} _ {t} \| ^ {2}) \\ = \mathbb {E} \left(\frac {1}{2 \eta_ {t}} \left(\left\| \boldsymbol {y} - \boldsymbol {x} _ {t + 1} \right\| ^ {2} - \left\| \boldsymbol {y} - \boldsymbol {x} _ {t} \right\| ^ {2}\right) + \langle \boldsymbol {y} - \boldsymbol {x} _ {t}, \nabla F (\boldsymbol {x} _ {t}) \rangle \right. \tag {21} \\ - \frac {1}{2 \mu_ {t}} \left\| \nabla F (\boldsymbol {x} _ {t}) - \widetilde {\nabla} F (\boldsymbol {x} _ {t}) \right\| ^ {2} + \left(\frac {1}{2 \eta_ {t}} - \frac {\mu_ {t} + L _ {\gamma}}{2}\right) \| \boldsymbol {x} _ {t + 1} - \boldsymbol {x} _ {t} \| ^ {2}) \\ \geq \mathbb {E} \left(\frac {1}{2 \eta_ {t}} \left(\| \boldsymbol {y} - \boldsymbol {x} _ {t + 1} \| ^ {2} - \| \boldsymbol {y} - \boldsymbol {x} _ {t} \| ^ {2}\right) + (1 - e ^ {- \gamma}) f (\boldsymbol {y}) - f (\boldsymbol {x} _ {t}) \right. \\ - \frac {1}{2 \mu_ {t}} \left\| \nabla F (\boldsymbol {x} _ {t}) - \tilde {\nabla} F (\boldsymbol {x} _ {t}) \right\| ^ {2} + \left(\frac {1}{2 \eta_ {t}} - \frac {\mu_ {t} + L _ {\gamma}}{2}\right) \| \boldsymbol {x} _ {t + 1} - \boldsymbol {x} _ {t} \| ^ {2}), \\ \end{array} +$$ + +where the final inequality from the definition of $F$ . + +Next, we prove the Theorem 3. + +Proof. From the Lemma 5, if we set $\pmb{y} = \pmb{x}^{*} = \arg \max_{\pmb{x} \in \mathcal{C}} f(\pmb{x})$ , we have + +$$ +\begin{array}{l} \sum_ {t = 1} ^ {T - 1} \mathbb {E} (F (\boldsymbol {x} _ {t + 1}) - F (\boldsymbol {x} _ {t}) + f (\boldsymbol {x} _ {t}) - (1 - e ^ {- \gamma}) f (\boldsymbol {x} ^ {*})) \\ \geq \sum_ {t = 1} ^ {T - 1} \mathbb {E} (\frac {1}{2 \eta_ {t}} (\| \pmb {x} ^ {*} - \pmb {x} _ {t + 1} \| ^ {2} - \| \pmb {x} ^ {*} - \pmb {x} _ {t} \| ^ {2}) - \sum_ {t = 1} ^ {T - 1} \frac {1}{2 \mu_ {t}} \left\| \nabla F (\pmb {x} _ {t}) - \widetilde {\nabla} F (\pmb {x} _ {t}) \right\| ^ {2}) \\ \geq - \sigma_ {\gamma} ^ {2} \sum_ {t = 1} ^ {T} \frac {1}{2 \mu_ {t}} + \sum_ {t = 2} ^ {T - 1} \mathbb {E} \left(\left\| \boldsymbol {x} ^ {*} - \boldsymbol {x} _ {t} \right\| ^ {2}\right) \left(\frac {1}{2 \eta_ {t - 1}} - \frac {1}{2 \eta_ {t}}\right) + \mathbb {E} \left(\frac {\left\| \boldsymbol {x} ^ {*} - \boldsymbol {x} _ {T} \right\| ^ {2}}{2 \eta_ {T - 1}} - \frac {\left\| \boldsymbol {x} ^ {*} - \boldsymbol {x} _ {1} \right\| ^ {2}}{2 \eta_ {1}}\right) \tag {22} \\ \geq - \frac {\mathrm {d i a m} ^ {2} (\mathcal {C})}{2 \eta_ {T - 1}} - \sigma_ {\gamma} ^ {2} \sum_ {t = 1} ^ {T} \frac {1}{\mu_ {t}} \\ \geq - (\mathrm {d i a m} ^ {2} (\mathcal {C}) L _ {\gamma} / 2 + 3 \sigma_ {\gamma} \mathrm {d i a m} (\mathcal {C}) \sqrt {T} / 2) \\ \end{array} +$$ + +where the first inequality follows from $\eta_t = \frac{1}{\mu_t + L_r}$ if we set $\mu_t = \frac{\sigma_\gamma \sqrt{t}}{\mathrm{diam}(\mathcal{C})}$ in Lemma 5; the second inequality from the Proposition 1 and the Abel's inequality; the third inequality from the definition of $\mathrm{diam}(\mathcal{C})$ . + +Finally, we have: + +$$ +\mathbb {E} \left(\sum_ {t = 1} ^ {T - 1} f (\boldsymbol {x} _ {t}) + F (\boldsymbol {x} _ {T})\right) \geq (1 - e ^ {- \gamma}) (T - 1) f \left(\boldsymbol {x} ^ {*}\right) - \left(\operatorname {d i a m} ^ {2} (\mathcal {C}) L _ {\gamma} / 2 + 3 \sigma_ {\gamma} \operatorname {d i a m} (\mathcal {C}) \sqrt {T} / 2\right) \tag {23} +$$ + +According to Theorem 2, + +$$ +\mathbb {E} \left(\sum_ {t = 1} ^ {T - 1} f (\boldsymbol {x} _ {t}) + (1 + \log (\tau)) (f (\boldsymbol {x} _ {T}) + c) \geq (1 - e ^ {- \gamma}) (T - 1) f (\boldsymbol {x} ^ {*}) - \left(\operatorname {d i a m} ^ {2} (\mathcal {C}) L _ {\gamma} / 2 + 3 \sigma_ {\gamma} \operatorname {d i a m} (\mathcal {C}) \sqrt {T} / 2\right) \right. \tag {24} +$$ + +where $\tau = \max \left(\frac{1}{\gamma}, \frac{r^2(\mathcal{X})L}{c}\right)$ . + +In Algorithm 2, we set + +$$ +\triangle_ {t} = \left\{ \begin{array}{l l} 1 & t \neq T \\ 1 + \log (\tau) & t = T \end{array} \right. \tag {25} +$$ + +and $\triangle = \sum_{t=1}^{T} \triangle_{t} = T + \log(\tau)$ . + +$$ +\mathbb {E} \left(\sum_ {t = 1} ^ {T} \frac {\triangle_ {t}}{\triangle} f \left(\boldsymbol {x} _ {t}\right)\right) \geq (1 - e ^ {- \gamma} - \frac {1 + \ln (\tau)}{T + \ln (\tau)}) f \left(\boldsymbol {x} ^ {*}\right) - \frac {\left(\operatorname {d i a m} ^ {2} (\mathcal {C}) L _ {\gamma} / 2 + 3 \sigma_ {\gamma} \operatorname {d i a m} (\mathcal {C}) \sqrt {T}\right) / 2 + (1 + \log (\tau)) c}{T + \ln (\tau)} \tag {26} +$$ + +Therefore, when $c = O(1)$ , we have + +$$ +\mathbb {E} \left(\sum_ {t = 1} ^ {T} \frac {\triangle_ {t}}{\triangle} f (\boldsymbol {x} _ {t})\right) \geq (1 - e ^ {- \gamma} - O (\frac {1}{T})) f (\boldsymbol {x} ^ {*}) - O (\frac {1}{\sqrt {T}}) +$$ + +# C. Proof of Theorem 4 + +Proof. We denote $\widetilde{\nabla} F_t(\pmb{x}_t) = \frac{1 - e^{-\gamma}}{\gamma}\widetilde{\nabla} f(z_t*\pmb{x}_t)$ and $\pmb{x}^{*} = \arg \max_{\pmb{x}\in \mathcal{C}}\sum_{t = 1}^{T}f_{t}(\pmb{x})$ . From the projection, we know that + +$$ +\left\| \boldsymbol {x} _ {t + 1} - \boldsymbol {x} ^ {*} \right\| \leq \left\| \boldsymbol {y} _ {t + 1} - \boldsymbol {x} ^ {*} \right\| = \left\| \boldsymbol {x} _ {t} + \eta \sum_ {s \in \mathcal {F} _ {t}} \widetilde {\nabla} F _ {s} \left(\boldsymbol {x} _ {s}\right) - \boldsymbol {x} ^ {*} \right\|, \tag {27} +$$ + +where the first inequality from the projection; and the first equality from $\pmb{y}_{t + 1} = \pmb{x}_t + \eta \sum_{s\in \mathcal{F}_t}\frac{1 - e^{-\gamma}}{\gamma}\widetilde{\nabla} f_s(z_s*\pmb{x}_s)$ in Algorithm 3. + +We order the set $\mathcal{F}_t = \{s_1, \ldots, s_{|\mathcal{F}_t|}\}$ , where $s_1 < s_2 < \dots < s_{|\mathcal{F}_t|}$ and $|\mathcal{F}_t| = \# \{u \in [T] : u + d_u - 1 = t\}$ . Moreover, + +we also denote $\mathcal{F}_{t,m} = \{u\in \mathcal{F}_t$ and $u < m\}$ $\pmb{x}_{t + 1,m} = x_{t} + \eta \sum_{s\in \mathcal{F}_{t,m}}\tilde{\nabla} F_{s}(\pmb{x}_{s})$ and $s_{|\mathcal{F}_t| + 1} = t + 1$ . Therefore, + +$$ +\begin{array}{l} \left\| \boldsymbol {x} _ {t + 1, s _ {k + 1}} - \boldsymbol {x} ^ {*} \right\| ^ {2} = \left\| \boldsymbol {x} _ {t + 1, s _ {k}} + \eta \widetilde {\nabla} F _ {s _ {k}} \left(\boldsymbol {x} _ {s _ {k}}\right) - \boldsymbol {x} ^ {*} \right\| ^ {2} \tag {28} \\ = \left\| \boldsymbol {x} _ {t + 1, s _ {k}} - \boldsymbol {x} ^ {*} \right\| ^ {2} + 2 \eta \langle \boldsymbol {x} _ {t + 1, s _ {k}} - \boldsymbol {x} ^ {*}, \widetilde {\nabla} F _ {s _ {k}} (\boldsymbol {x} _ {s _ {k}}) \rangle + \eta^ {2} \left\| \widetilde {\nabla} F _ {s _ {k}} (\boldsymbol {x} _ {s _ {k}}) \right\| ^ {2} \\ \end{array} +$$ + +According to Equation (28), we have + +$$ +\begin{array}{l} \left\| \boldsymbol {y} _ {t + 1} - \boldsymbol {x} ^ {*} \right\| ^ {2} - \left\| \boldsymbol {x} _ {t} - \boldsymbol {x} ^ {*} \right\| ^ {2} \\ = \sum_ {k = 1} ^ {| \mathcal {F} _ {t} |} \left(\left\| \boldsymbol {x} _ {t + 1, s _ {k + 1}} - \boldsymbol {x} ^ {*} \right\| ^ {2} - \left\| \boldsymbol {x} _ {t + 1, s _ {k}} - \boldsymbol {x} ^ {*} \right\| ^ {2}\right) \\ = 2 \eta \sum_ {s \in \mathcal {F} _ {t}} \left\langle \boldsymbol {x} _ {t + 1, s} - \boldsymbol {x} ^ {*}, \widetilde {\nabla} F _ {s} (\boldsymbol {x} _ {s}) \right\rangle + \eta^ {2} \sum_ {s \in \mathcal {F} _ {t}} \left\| \widetilde {\nabla} F _ {s} (\boldsymbol {x} _ {s}) \right\| ^ {2} \tag {29} \\ = 2 \eta \sum_ {s \in \mathcal {F} _ {t}} \left\langle \boldsymbol {x} _ {t + 1, s} - \boldsymbol {x} _ {s}, \widetilde {\nabla} F _ {s} (\boldsymbol {x} _ {s}) \right\rangle + 2 \eta \sum_ {s \in \mathcal {F} _ {t}} \left\langle \boldsymbol {x} _ {s} - \boldsymbol {x} ^ {*}, \widetilde {\nabla} F _ {s} (\boldsymbol {x} _ {s}) \right\rangle + \eta^ {2} \sum_ {s \in \mathcal {F} _ {t}} \left\| \widetilde {\nabla} F _ {s} (\boldsymbol {x} _ {s}) \right\| ^ {2} \\ \end{array} +$$ + +where the first equality follows from setting $\pmb{x}_{t + 1,|\mathcal{F}_t| + 1} = \pmb{y}_{t + 1}$ ; the second from Equation (28). + +Therefore, + +$$ +\begin{array}{l} \mathbb {E} \left(\left\| \boldsymbol {y} _ {t + 1} - \boldsymbol {x} ^ {*} \right\| ^ {2} - \left\| \boldsymbol {x} _ {t} - \boldsymbol {x} ^ {*} \right\| ^ {2}\right) \\ = 2 \eta \mathbb {E} \left(\sum_ {s \in \mathcal {F} _ {t}} \langle \boldsymbol {x} _ {t + 1, s} - \boldsymbol {x} _ {s}, \widetilde {\nabla} F _ {s} (\boldsymbol {x} _ {s}) \rangle + \sum_ {s \in \mathcal {F} _ {t}} \langle \boldsymbol {x} _ {s} - \boldsymbol {x} ^ {*}, \mathbb {E} (\widetilde {\nabla} F _ {s} (\boldsymbol {x} _ {s}) | \boldsymbol {x} _ {s}) \rangle\right) + \eta^ {2} \mathbb {E} \left(\sum_ {s \in \mathcal {F} _ {t}} \left\| \widetilde {\nabla} F _ {s} (\boldsymbol {x} _ {s}) \right\| ^ {2}\right) \\ = 2 \eta \mathbb {E} \left(\sum_ {s \in \mathcal {F} _ {t}} \left\langle \boldsymbol {x} _ {t + 1, s} - \boldsymbol {x} _ {s}, \widetilde {\nabla} F _ {s} (\boldsymbol {x} _ {s}) \right\rangle + \sum_ {s \in \mathcal {F} _ {t}} \left\langle \boldsymbol {x} _ {s} - \boldsymbol {x} ^ {*}, \nabla F _ {s} (\boldsymbol {x} _ {s}) \right\rangle\right) + \eta^ {2} \mathbb {E} \left(\sum_ {s \in \mathcal {F} _ {t}} \left\| \widetilde {\nabla} F _ {s} (\boldsymbol {x} _ {s}) \right\| ^ {2}\right) \tag {30} \\ \leq 2 \eta \mathbb {E} \left(\sum_ {s \in \mathcal {F} _ {t}} \left\langle \boldsymbol {x} _ {t + 1, s} - \boldsymbol {x} _ {s}, \widetilde {\nabla} F _ {s} (\boldsymbol {x} _ {s}) \right\rangle + \sum_ {s \in \mathcal {F} _ {t}} \left(f _ {s} (\boldsymbol {x} _ {s}) - (1 - e ^ {- \gamma}) f _ {s} (\boldsymbol {x} ^ {*})\right)\right) + \eta^ {2} \mathbb {E} \left(\sum_ {s \in \mathcal {F} _ {t}} \left\| \widetilde {\nabla} F _ {s} (\boldsymbol {x} _ {s}) \right\| ^ {2}\right) \\ \end{array} +$$ + +where the first inequality from the definition of non-oblivious function $F$ . + +Therefore, we have: + +$$ +\begin{array}{l} 2 \eta \mathbb {E} \left((1 - e ^ {- \gamma}) \sum_ {t = 1} ^ {T} f _ {t} \left(\boldsymbol {x} ^ {*}\right) - \sum_ {t = 1} ^ {T} f _ {t} \left(\boldsymbol {x} _ {t}\right)\right) \\ = 2 \eta \mathbb {E} \left(\sum_ {t = 1} ^ {T} \sum_ {s \in \mathcal {F} _ {t}} \left((1 - e ^ {- \gamma}) f _ {s} \left(\boldsymbol {x} ^ {*}\right) - f _ {s} \left(\boldsymbol {x} _ {s}\right)\right)\right) \\ \leq \sum_ {t = 1} ^ {T} \left(\mathbb {E} \left(\left\| \boldsymbol {x} _ {t} - \boldsymbol {x} ^ {*} \right\| ^ {2} - \left\| \boldsymbol {y} _ {t + 1} - \boldsymbol {x} ^ {*} \right\| ^ {2}\right) + 2 \eta \mathbb {E} \left(\sum_ {s \in \mathcal {F} _ {t}} \left\langle \boldsymbol {x} _ {t + 1, s} - \boldsymbol {x} _ {s}, \widetilde {\nabla} F _ {s} (\boldsymbol {x} _ {s}) \right\rangle\right) + \eta^ {2} \mathbb {E} \left(\sum_ {s \in \mathcal {F} _ {t}} \left\| \widetilde {\nabla} F _ {s} (\boldsymbol {x} _ {s}) \right\| ^ {2}\right)\right) \tag {31} \\ \leq \sum_ {t = 1} ^ {T} \left(\mathbb {E} \left(\left\| \boldsymbol {x} _ {t} - \boldsymbol {x} ^ {*} \right\| ^ {2} - \left\| \boldsymbol {x} _ {t + 1} - \boldsymbol {x} ^ {*} \right\| ^ {2}\right) + 2 \eta \mathbb {E} \left(\sum_ {s \in \mathcal {F} _ {t}} \left\langle \boldsymbol {x} _ {t + 1, s} - \boldsymbol {x} _ {s}, \widetilde {\nabla} F _ {s} (\boldsymbol {x} _ {s}) \right\rangle\right) + \eta^ {2} \mathbb {E} \left(\sum_ {s \in \mathcal {F} _ {t}} \left\| \widetilde {\nabla} F _ {s} (\boldsymbol {x} _ {s}) \right\| ^ {2}\right)\right) \\ \leq \operatorname {diam} ^ {2} (\mathcal {C}) + \sum_ {t = 1} ^ {T} \left(2 \eta \mathbb {E} \left(\sum_ {s \in \mathcal {F} _ {t}} \left\langle \boldsymbol {x} _ {t + 1, s} - \boldsymbol {x} _ {s}, \widetilde {\nabla} F _ {s} (\boldsymbol {x} _ {s}) \right\rangle\right) + \eta^ {2} \mathbb {E} \left(\sum_ {s \in \mathcal {F} _ {t}} \left\| \widetilde {\nabla} F _ {s} (\boldsymbol {x} _ {s}) \right\| ^ {2}\right)\right) \\ \leq \operatorname {diam} ^ {2} (\mathcal {C}) + \eta^ {2} \max _ {t \in [ T ]} \left(\left\| \widetilde {\nabla} F _ {t} \left(\boldsymbol {x} _ {t}\right) \right\| ^ {2}\right) \sum_ {t = 1} ^ {T} | \mathcal {F} _ {t} | + 2 \eta \sum_ {t = 1} ^ {T} \left(\mathbb {E} \left(\sum_ {s \in \mathcal {F} _ {t}} \left\langle \boldsymbol {x} _ {t + 1, s} - \boldsymbol {x} _ {s}, \widetilde {\nabla} F _ {s} \left(\boldsymbol {x} _ {s}\right) \right\rangle\right)\right) \\ \end{array} +$$ + +For the final part in Equation (31), + +$$ +\begin{array}{l} \left\langle \boldsymbol {x} _ {t + 1, s} - \boldsymbol {x} _ {s}, \tilde {\nabla} F _ {s} (\boldsymbol {x} _ {s}) \right\rangle \\ \leq \left\| \widetilde {\nabla} F _ {s} \left(\boldsymbol {x} _ {s}\right) \right\| \left\| \boldsymbol {x} _ {t + 1, s} - \boldsymbol {x} _ {s} \right\| \\ \leq \left\| \widetilde {\nabla} F _ {s} (\boldsymbol {x} _ {s}) \right\| \left(\| \boldsymbol {x} _ {t + 1, s} - \boldsymbol {x} _ {t} \| + \| \boldsymbol {x} _ {t} - \boldsymbol {x} _ {s} \|\right) \\ \leq \left\| \widetilde {\nabla} F _ {s} \left(\boldsymbol {x} _ {s}\right) \right\| \left(\left\| \boldsymbol {x} _ {t + 1, s} - \boldsymbol {x} _ {t} \right\| + \sum_ {m = s} ^ {t - 1} \left\| \boldsymbol {y} _ {m + 1} - \boldsymbol {x} _ {m} \right\|\right) \tag {32} \\ \leq \max _ {t \in [ T ]} \left(\left\| \tilde {\nabla} F _ {t} (\boldsymbol {x} _ {t}) \right\| ^ {2}\right) \eta \left(| \mathcal {F} _ {t, s} | + \sum_ {m = s} ^ {t - 1} | \mathcal {F} _ {m} |\right) \\ \end{array} +$$ + +where the third inequality follows from $\| \pmb{x}_t - \pmb{x}_s\| \leq \| \pmb{y}_t - \pmb{x}_s\| \leq \| \pmb{y}_t - \pmb{x}_{t - 1}\| +\| \pmb{x}_{t - 1} - \pmb{x}_s\|\leq \dots \leq$ $\sum_{m = s}^{t - 1}\| \pmb{y}_{m + 1} - \pmb{x}_m\|$ + +Finally, we have + +$$ +\begin{array}{l} \mathbb {E} \left((1 - e ^ {- \gamma}) \sum_ {t = 1} ^ {T} f _ {t} (\boldsymbol {x} ^ {*}) - \sum_ {t = 1} ^ {T} f _ {t} (\boldsymbol {x} _ {t})\right) \\ \leq \frac {\operatorname {d i a m} ^ {2} (\mathcal {C})}{2 \eta} + \max _ {t \in [ T ]} \left(\left\| \widetilde {\nabla} F _ {t} \left(\boldsymbol {x} _ {t}\right) \right\| ^ {2}\right) \left(\frac {\eta}{2} \sum_ {t = 1} ^ {T} \left| \mathcal {F} _ {t} \right| + \eta \sum_ {t = 1} ^ {T} \sum_ {s \in \mathcal {F} _ {t}} \left(\left| \mathcal {F} _ {t, s} \right| + \sum_ {m = s} ^ {t - 1} \left| \mathcal {F} _ {m} \right|\right)\right) \tag {33} \\ \end{array} +$$ + +Firstly, $\sum_{t=1}^{T} |\mathcal{F}_t| \leq T$ . Next, we investigate the $|\mathcal{F}_{t,s}| + \sum_{m=s}^{t-1} |\mathcal{F}_m|$ when $s \in \mathcal{F}_t$ . + +When $s \in \mathcal{F}_t$ , i.e., $s + d_s - 1 = t$ , for any $q \in (\mathcal{F}_{t,s} \bigcup (\cup_{m=s}^{t-1} \mathcal{F}_m))$ , if $s + 1 \leq q \leq t - 1$ , the feedback of round $q$ must be delivered before the round $t$ , namely, $q + d_q - 1 \leq t - 1$ . Moreover, if $q \leq s - 1$ , the feedback of round $q$ could be delivered between round $s$ and round $t$ . Therefore, + +$$ +\begin{array}{l} \left| \mathcal {F} _ {t, s} \right| + \sum_ {m = s} ^ {t - 1} \left| \mathcal {F} _ {m} \right| = \left| \left\{i \mid s + 1 \leq i \leq t - 1, a n d i + d _ {i} - 1 \leq t - 1 \right\} \right| \tag {34} \\ + \left| \left\{i \mid 1 \leq i \leq s - 1, a n d s \leq i + d _ {i} - 1 \leq t \right\} \right|. \\ \end{array} +$$ + +When $s \in \mathcal{F}_t$ , we can derive that $|\{i|s + 1 \leq i \leq t - 1, \text{ and } i + d_i - 1 \leq t - 1\}| \leq t - s - 1 \leq d_s$ . Thus, $\sum_{t=1}^{T} \sum_{s \in \mathcal{F}_t} |\{i|s + 1 \leq i \leq t - 1, \text{ and } i + d_i - 1 \leq t - 1\}| \leq \sum_{i=1}^{T} d_i = D$ . + +Next, for each $b \in \{i|1 \leq i \leq s - 1, \text{ and } s \leq i + d_i - 1 \leq t\}$ , we have $b \leq s \leq b + d_b - 1 \leq s + d_s - 1$ so that $\sum_{t=1}^{T} \sum_{s \in \mathcal{F}_t} |\{i|1 \leq i \leq s - 1, \text{ and } s \leq i + d_i - 1 \leq t\}| \leq \sum_{i=1}^{T} |\{s|i < s \leq i + d_i - 1 \leq s + d_s - 1\}| \leq \sum_{i=1}^{T} d_i$ . + +Hence, + +$$ +\begin{array}{l} \mathbb {E} \left(\left(1 - e ^ {- \gamma}\right) \sum_ {t = 1} ^ {T} f _ {t} \left(\boldsymbol {x} ^ {*}\right) - \sum_ {t = 1} ^ {T} f _ {t} \left(\boldsymbol {x} _ {t}\right)\right) \\ \leq \frac {\operatorname {d i a m} ^ {2} (\mathcal {C})}{2 \eta} + \max _ {t \in [ T ]} \left(\left\| \widetilde {\nabla} F _ {t} \left(\boldsymbol {x} _ {t}\right) \right\| ^ {2}\right) \left(\frac {\eta}{2} T + 2 \eta D\right) \tag {35} \\ \leq \frac {\operatorname {d i a m} ^ {2} (\mathcal {C})}{2 \eta} + \max _ {t \in [ T ]} \left(\left\| \widetilde {\nabla} F _ {t} \left(\boldsymbol {x} _ {t}\right) \right\| ^ {2}\right) 3 \eta D \\ \leq O (\sqrt {D}) \\ \end{array} +$$ + +where the final equality from $\eta = \frac{\operatorname{diam}(\mathcal{C})}{\max_{t\in[T]}(\|\nabla F_t(\boldsymbol{x}_t)\|)\sqrt{D}}$ + +□ \ No newline at end of file diff --git a/stochasticcontinuoussubmodularmaximizationboostingvianonobliviousfunction/images.zip b/stochasticcontinuoussubmodularmaximizationboostingvianonobliviousfunction/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..f8f9bac302aac43ff0cb69b71c0f3dfda2d3333f --- /dev/null +++ b/stochasticcontinuoussubmodularmaximizationboostingvianonobliviousfunction/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6aa2755e409654dc12c3fd72066ad3e3cced20bc06d913c97e66d44ef8006cd1 +size 1073500 diff --git a/stochasticcontinuoussubmodularmaximizationboostingvianonobliviousfunction/layout.json b/stochasticcontinuoussubmodularmaximizationboostingvianonobliviousfunction/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..fba92423db80594a33fad92afae2abf9b577c4a8 --- /dev/null +++ b/stochasticcontinuoussubmodularmaximizationboostingvianonobliviousfunction/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:026dcd6b4529bfc74b3f2bbf2c741fe1b557c1de452bfc2691454b7a564957f9 +size 1041859 diff --git a/stochasticdeepnetworkswithlinearcompetingunitsformodelagnosticmetalearning/9455f3f5-eafe-4fe5-85f2-03a69da29f38_content_list.json b/stochasticdeepnetworkswithlinearcompetingunitsformodelagnosticmetalearning/9455f3f5-eafe-4fe5-85f2-03a69da29f38_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..67fbcb961305d23043379060dd6a1263570d05f8 --- /dev/null +++ b/stochasticdeepnetworkswithlinearcompetingunitsformodelagnosticmetalearning/9455f3f5-eafe-4fe5-85f2-03a69da29f38_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b306a95b034d81d2ac2996ff1699e0cb5eab562c6217c81750e2fb619660a852 +size 88295 diff --git a/stochasticdeepnetworkswithlinearcompetingunitsformodelagnosticmetalearning/9455f3f5-eafe-4fe5-85f2-03a69da29f38_model.json b/stochasticdeepnetworkswithlinearcompetingunitsformodelagnosticmetalearning/9455f3f5-eafe-4fe5-85f2-03a69da29f38_model.json new file mode 100644 index 0000000000000000000000000000000000000000..8ce3a91fdf371710961a5208336201c86194b083 --- /dev/null +++ b/stochasticdeepnetworkswithlinearcompetingunitsformodelagnosticmetalearning/9455f3f5-eafe-4fe5-85f2-03a69da29f38_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3fe9934e6bda3018652a737dcf44c4e232eaa707371a488692d6135dcaf3c74a +size 108527 diff --git a/stochasticdeepnetworkswithlinearcompetingunitsformodelagnosticmetalearning/9455f3f5-eafe-4fe5-85f2-03a69da29f38_origin.pdf b/stochasticdeepnetworkswithlinearcompetingunitsformodelagnosticmetalearning/9455f3f5-eafe-4fe5-85f2-03a69da29f38_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..7483904c26a08205d5edcb74a3a408700ab09cbe --- /dev/null +++ b/stochasticdeepnetworkswithlinearcompetingunitsformodelagnosticmetalearning/9455f3f5-eafe-4fe5-85f2-03a69da29f38_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dfa71b5595489d7b1dc893d00ba2736128a68614af4649915a81c090a67537af +size 2243176 diff --git a/stochasticdeepnetworkswithlinearcompetingunitsformodelagnosticmetalearning/full.md b/stochasticdeepnetworkswithlinearcompetingunitsformodelagnosticmetalearning/full.md new file mode 100644 index 0000000000000000000000000000000000000000..9abc3fff7e4b2f4bd3bfaba4c8e9fa46c4cfd199 --- /dev/null +++ b/stochasticdeepnetworkswithlinearcompetingunitsformodelagnosticmetalearning/full.md @@ -0,0 +1,392 @@ +# Stochastic Deep Networks with Linear Competing Units for Model-Agnostic Meta-Learning + +Konstantinos Kalais1 Sotirios Chatzis1 + +# Abstract + +This work addresses meta-learning (ML) by considering deep networks with stochastic local winner-takes-all (LWTA) activations. This type of network units results in sparse representations from each model layer, as the units are organized into blocks where only one unit generates a non-zero output. The main operating principle of the introduced units rely on stochastic principles, as the network performs posterior sampling over competing units to select the winner. Therefore, the proposed networks are explicitly designed to extract input data representations of sparse stochastic nature, as opposed to the currently standard deterministic representation paradigm. Our approach produces state-of-the-art predictive accuracy on few-shot image classification and regression experiments, as well as reduced predictive error on an active learning setting; these improvements come with an immensely reduced computational cost. Code is available at: https://github.com/Kkalais/StochLWTA-ML + +# 1. Introduction + +When we train machine learning models on problems with limited amounts of training data, we cannot usually get good predictive performance (Sculley et al., 2015; Lai, 2019). This comes in contrast to the human ability to quickly derive information from a range of different tasks, and then adapt to a new task with limited available new examples (Castro et al., 2008; Kuhl et al., 2020). In essence, this capability of the mind of learning how to learn (Black et al., 2006) has inspired researchers to investigate the concept of Meta- + +$^{1}$ Dept. of Electrical Eng., Computer Eng., and Informatics, Cyprus University of Technology, Limassol, Cyprus. Correspondence to: Konstantinos Kalais , Sotirios Chatzis . + +Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s). + +Learning (ML) (Lake et al., 2017; Buysse et al., 2019). + +There is a large variety of deep learning methods for ML (Andrychowicz et al., 2016; Finn et al., 2019; Baik et al., 2020). Specifically, Finn et al. (2017) presented the Model-Agnostic Meta-Learning (MAML) algorithm that enables tuning the parameters of a trained network to quickly learn a new task with only a few gradient updates. To get away with the entailed second-order computations, that are expensive, several researchers proposed appropriate first-order approximations for MAML; such works are the First-Order MAML (FOMAML) of Finn et al. (2017) and the Reptile algorithm of Nichol et al. (2018). Recently, several researchers have also considered Bayesian inference-driven methods for deep learning ML, extending upon older works built for conventional machine learning approaches (Grant et al., 2018; Yoon et al., 2018; Finn et al., 2018; Ravi & Beatson, 2019; Patacchiola et al., 2020; Zou & Lu, 2020; Chen et al., 2020). + +This work proposes a different regard toward improving generalization capacity for deep networks in the context of ML. Specifically, our proposed approach relies on the following main concepts: + +- The concept of sparse learned representations. For the first time in the literature of deep network-driven ML, we employ a mechanism that inherently learns to extract sparse data representations. This consists in replacing standard unit nonlinearities (e.g., ReLU) with a unit competition mechanism. Specifically, (linear) units are organized into blocks. Presented with some input, the units within a block engage in a competition process with only one winner. The outputs of all units except for the winner are zeroed out; the output of the winner retains its computed value (local winner takes-all, LWTA, architecture). +- The concept of stochastic representations. We establish a stochastic formulation for the previously described competition process. Specifically, we postulate that, within a block of competing units, winner is selected via sampling from an appropriate Categorical posterior. The corresponding winning probability of each unit is proportional to its linear computation (thus depending on the layer input). Via this competition + +process, we yield stochastic representations from network layers, that is representations that may change each time we present to the network layer exactly the same input. + +Based on the results from existing approaches, we posit that the proposed treatment of the ML problem, which combines learned representation sparsity and stochasticity, will be extremely beneficial to the deep learning community. We dub our approach Stochastic LWTA for ML (StochLWTA-ML). + +We perform a variational Bayes treatment of the proposed model. We opt for a full Bayesian treatment, by also handling network weights as latent variables. That is, we elect to impose an appropriate prior over the network weights and fit approximate (variational) posteriors. As we evaluate our approach on image classification, sinusoidal regression and active learning problems, we show that StochLWTA-ML offers a variety of advantages over the current state-of-the-art methods, namely: (i) incurring reduced predictive error rate compared to the currently state-of-the-art methods in the field; (ii) obtaining this performance with networks that comprise an immensely reduced number of trainable parameters, and therefore give rise to better computational efficiency and imposed memory footprint. + +The remainder of this paper is organized as follows: In Section 2, we briefly review related work. Section 3 introduces our approach and provides the related training and prediction algorithms. In Section 4, we perform a thorough experimental evaluation of StochLWTA-ML, and compare our findings to the current state-of-the-art. In the final Section 5, we end up with the conclusions of our work, and suggest lines of further research. + +# 2. Related Work + +# 2.1. LWTA layers in Deep Learning + +LWTA layers are not new in the field of deep learning; see, e.g., Srivastava et al. (2013). Although not much work has been pursued along these lines, the recent works of Panousis et al. (2019; 2021) and Voskou et al. (2021) have spurred some fresh interest in the field. These works have presented alternative implementations of the basic concepts of LWTA units in the context of diverse deep network architectures. Specifically, Panousis et al. (2019) propose a stochastic LWTA formulation which is founded upon the Indian Buffet process (IBP) prior, borrowed from nonparametric statistics; they use this architecture to effect data-driven network compression. Panousis et al. (2021) exploit the same technique to train adversarially-robust deep networks. On the other hand, Voskou et al. (2021) consider a different incarnation of stochastic LWTA architectures, which relies on sampling + +the winner from a Categorical posterior, driven from the layer input. This layer architecture is used to replace dense ReLU layers in Transformer networks; it is then shown to yield important benefits in a Sign-Language Translation benchmark. + +This paper is different from the previous works in various ways: (i) stochasticity does not stem from utilization of the IBP; we rather adopt an approach similar to Voskou et al. (2021); (ii) we do not use the proposed architecture as a replacement for a specific type of layer in a greater network architecture (Transformer) that remains largely unchanged; instead, we build completely new networks using these layers; (iii) we perform a full Bayesian treatment, by treating network weights as random variables; we do not employ this construction as a means of compressing the weights at prediction time, contrary to Panousis et al. (2019), Voskou et al. (2021); instead, we perform weight sampling at prediction time as a means of improving accuracy; and (iv) for the first time, we examine how these principles perform in the context of deep network-driven ML. Note that, apart from LWTA architectures, other data-driven sparsity models have also been proposed recently, e.g. Lee et al. (2018), Kessler et al. (2021). However, none of these have been developed or evaluated in the context of an ML setting. + +# 2.2. Model-Agnostic Meta-Learning + +Finn et al. (2017) suggested a model-agnostic algorithm for ML, that can be applied to any model trained via gradient descent. The introduced MAML algorithm initializes model parameters in a way that can be quickly adapted to several types of new tasks. + +Let us consider a model with parameters $\pmb{\theta}$ and a parametric form $f_{\theta}$ . When the model is adapting to an unseen task $T_{i}$ , MAML runs few steps of gradient descent that yields a task-specific parameter set, $\pmb{\theta}_{i}^{\prime} = \pmb{\theta} - \alpha \nabla_{\pmb{\theta}} L_{T_{i}}(f_{\pmb{\theta}})$ ; $\alpha$ is the step size hyperparameter and $L_{T_i}$ denotes the loss on the task $T_{i}$ . Subsequently, training proceeds to optimize the function $f_{\pmb{\theta}_i'}$ with respect to the model parameters $\pmb{\theta}$ . Assuming that the batch of tasks has size $M$ , we can define the targeted meta-objective as: + +$$ +L _ {m e t a} (\boldsymbol {\theta}) = \sum_ {i = 1} ^ {M} L _ {T _ {i}} \left(f _ {\boldsymbol {\theta} _ {i} ^ {\prime}}\right) = \sum_ {i = 1} ^ {M} L _ {T _ {i}} \left(f _ {\boldsymbol {\theta} - \alpha \nabla_ {\boldsymbol {\theta}} L _ {T _ {i}} \left(f _ {\boldsymbol {\theta}}\right)}\right). \tag {1} +$$ + +Optimization of this meta-objective over $\theta$ yields the outer-loop update: + +$$ +\boldsymbol {\theta} \leftarrow \boldsymbol {\theta} - \beta \nabla_ {\boldsymbol {\theta}} \sum_ {i = 1} ^ {M} L _ {T _ {i}} \left(f _ {\boldsymbol {\theta} _ {i} ^ {\prime}}\right) \tag {2} +$$ + +where $\beta$ stands for the outer-loop learning rate. + +Finally, as MAML involves expensive computations stem + +ming from the second-order updates of Eqs. (1) and (2), Finn et al. (2017) and Nichol et al. (2018) have developed more efficient first-order approximations. + +# 3. Proposed Approach + +# 3.1. Architecture + +Let us denote as $\pmb{x} \in \mathbb{R}^I$ an input vector presented to a dense ReLU layer of a conventional deep neural network, with corresponding weights matrix $\pmb{W} \in \mathbb{R}^{I \times O}$ . The output of the layer is the vector $\pmb{y} \in \mathbb{R}^O$ and is fed to the subsequent layer. In our approach, a ReLU unit is replaced by $J$ competing linear units, organized in one block; in the following, we denote with $R$ the number of blocks in a layer. The input $\pmb{x}$ is now presented to each block through weights that are organized into a three-dimensional matrix $\pmb{W} \in \mathbb{R}^{I \times R \times J}$ . Then, the $j$ -th competing unit within $r$ -th block computes the sum $\sum_{i=1}^{I} (w_{i,r,j}) \cdot x_i$ . Competition means that, of the $J$ units in the block, one unit (the "winner") will present its linear computation to the next layer; the rest will present zero values. Traditionally in the literature, the winner unit is selected to be the unit with greatest linear computation. Recently, stochastic competition principles have been considered, e.g. Panousis et al. (2019; 2021), Voskou et al. (2021). + +Let us denote as $\pmb{y} \in \mathbb{R}^{R \cdot J}$ the output of an LWTA layer; this is composed of $R$ subvectors $\pmb{y}_r \in \mathbb{R}^J$ and is sparse, since all units except for one, in each block, yield zero values. Let us introduce the discrete latent indicator vector $\pmb{\xi} \in \mathrm{one\_hot}(J)^R$ to denote the winner units in the $R$ blocks that constitute a considered stochastic LWTA layer. This vector comprises $R$ component subvectors, where each component entails one non-zero value at the index position that corresponds to the winner unit of the respective LWTA block. On this basis, the output $\pmb{y}$ of the stochastic LWTA layer's $(r \cdot j)$ -th component $\pmb{y}_{r,j}$ is defined as: + +$$ +\boldsymbol {y} _ {r, j} = \boldsymbol {\xi} _ {r, j} \sum_ {i = 1} ^ {I} \left(w _ {i, r, j}\right) \cdot x _ {i} \in \mathbb {R} \tag {3} +$$ + +where we denote as $\pmb{\xi}_{r,j}$ the $j$ -th component of $\pmb{\xi}_r$ , and $\pmb{\xi}_r \in \mathrm{one\_hot}(J)$ holds the $r$ -th subvector of $\pmb{\xi}$ . + +In Eq. (3), we postulate that the latent winner indicator variables are drawn from a Categorical distribution which is proportional to the intermediate linear computation that each unit performs. Therefore, the stronger the linearity the higher the chance of the unit winning the stochastic competition within its block. In detail, we postulate that, a posteriori, the winner distributions yield: + +$$ +q \left(\boldsymbol {\xi} _ {r}\right) = \text {C a t e g o r i c a l} \left(\boldsymbol {\xi} _ {r} \mid \operatorname {s o f t m a x} \left(\sum_ {i = 1} ^ {I} \left[ w _ {i, r, j} \right] _ {j = 1} ^ {J} \cdot x _ {i}\right)\right) \tag {4} +$$ + +where $[w_{i,r,j}]_{j = 1}^{J}$ denotes the vector concatenation of the set $\{w_{i,r,j}\}_{j = 1}^{J}$ . A graphical illustration of the proposed stochastic architecture is provided in Fig. 1. + +As a network composed of such (StochLWTA) layers entails latent variables $\xi$ , we need to perform a Bayesian network treatment to perform effective parameter training. We opt for a (approximate) stochastic gradient variational Bayes treatment (Kingma & Welling, 2014), for scalability purposes. This means that the used objective function takes the form of an evidence lower-bound (ELBO) objective, as we describe next. In our work, we take one step further: we also elect to infer a posterior density over the network weights $W$ , as opposed to obtaining point-estimates. This results in a second source of stochasticity for our approach, which may further increase its generalization capacity under uncertain conditions arising from limited training data availability. Note that the use of these posteriors is totally different from Panousis et al. (2019) and Voskou et al. (2021): therein, posterior variance is used for compressing posterior mean bit-precision; then, predictions are performed using only the compressed posterior mean. Instead, in our work we sample multiple times from the trained weight posterior and perform model averaging (in a Bayesian sense), as a means of increasing generalization capacity. + +We postulate: + +$$ +q (\operatorname {v e c} (\boldsymbol {W})) = N (\operatorname {v e c} (\boldsymbol {W}) | \boldsymbol {\mu}, \operatorname {d i a g} (\sigma^ {2})) \tag {5} +$$ + +where $\psi \triangleq \{\pmb {\mu},\pmb{\sigma}^2\}$ are the means and variances of the Gaussian weight posteriors, respectively. + +# 3.2. A Model-Agnostic ML Algorithm + +Let us define an ML problem where we are given a training dataset $D$ of tasks, $T$ , that are governed by a distribution $P(T)$ . We consider an $N$ -way, $K$ -shot learning setting, where each task contains $K$ labelled examples for each of $N$ available classes. + +Our approach entails parameter sets $\pmb{\theta}$ which coincide with the hyperparameter sets $\psi = \{\pmb{\mu},\pmb{\sigma}^2\}$ of the weights $W\in$ $\mathbb{R}^{I\times R\times J}$ ; these sets $\psi = \{\pmb {\mu},\pmb{\sigma}^2\}$ are the target of our MAML-type training algorithm. + +Therefore, to perform model training, we have to first initialize the trainable parameters $\mu$ and $\sigma^2$ across layers. To this end, one can appropriately exploit popular initialization schemes, such as Glorot Uniform (Glorot & Bengio, 2010). Then, our approach entails an inner-outer loop scheme, in a vein similar to existing approaches, but with some crucial differences: + +1. The stochastic nature of the postulated weights, $W$ , results in the updates taking place over the posterior means, $\mu$ and variances, $\sigma^2$ . + +![](images/b0e80ccc560838c3cf72b9d7823b490b0e9f4eceaf16696852d08ba8956f68fc.jpg) +LWTA layer +Figure 1. A zoomed-in graphical illustration of the $r$ -th block of a stochastic LWTA layer. Input $\pmb{x} = [x_1, x_2, \dots, x_I]$ is presented to each unit in the block. The $j$ -th component $\pmb{y}_{r,j}$ of the block's output is obtained after computing latent variable $\pmb{\xi}_{r,j}$ . + +2. The stochastic nature of both the inferred representations and the network weights themselves implies that proper training must rely on optimization of the ELBO function of the network. Let us consider an inner-loop dealing with task $T_{i} \sim P(T)$ , with data $D_{i} = (X_{i},Y_{i}) \subset D$ . Let $\mathrm{CE}(Y_i,f_\psi (X_i;\hat{\pmb{\xi}},\hat{\pmb{W}}))$ be the categorical cross-entropy between the data labels $Y_{i}$ and the class probabilities $f_{\psi}(X_i;\hat{\pmb{\xi}},\hat{\pmb{W}})$ generated by the Softmax layer. Then, we yield: + +$$ +\begin{array}{l} L _ {T _ {i}} (\psi) = - \operatorname {C E} \left(Y _ {i}, f _ {\psi} \left(X _ {i}; \hat {\xi}, \hat {\boldsymbol {W}}\right)\right) \\ - K L [ q (\boldsymbol {\xi}) | | p (\boldsymbol {\xi}) ] - K L [ q (\boldsymbol {W}) | | p (\boldsymbol {W}) ] \tag {6} \\ \end{array} +$$ + +for task $T_{i}$ with dataset $D_{i}$ which is dealt with on the $i$ -th training iteration. + +Here, for simplicity and without harming generality, we consider that the weights prior $p(\mathrm{vec}(\mathbf{W}))$ is a Gaussian distribution $N(\mathbf{0},\mathbf{I})$ and the latent variables prior $p(\pmb {\xi})$ is a symmetric Categorical distribution Categorical(1/J). In addition, in our notation we stress that the output $f_{\psi}(X_i;\hat{\pmb{\xi}},\hat{\mathbf{W}})$ depends on the winner selection process, which is stochastic, and the outcomes of sampling the network weights. Specifically, in our work we perform Monte-Carlo (MC) sampling using one reparameterized sample of the corresponding latent variables. + +Let $\bar{\xi}$ be the unnormalized probabilities of the Categorical distribution $q(\pmb {\xi})$ (Eq. (4)). The sampled instances of $\pmb {\xi},\hat{\pmb{\xi}}_{r,j}$ are expressed as (Maddison et al., 2017): + +$$ +\begin{array}{l} \hat {\boldsymbol {\xi}} _ {r, j} = \operatorname {S o f t m a x} \left(\left(\log \bar {\boldsymbol {\xi}} _ {r, j} + g _ {r, j}\right) / \tau\right), \tag {7} \\ \forall r = 1, \dots , R, j = 1, \dots , J \\ \end{array} +$$ + +where $g_{r,j} = -\log (-\log U_{r,j}), U_{r,j} \sim \mathrm{Uniform}(0,1)$ and $\tau \in (0,\infty)$ is a temperature factor that controls how + +closely the Categorical distribution is approximated by this continuous relaxation. + +Similarly, the Gaussian weights yield: $\hat{w}_{t,r,j} = \mu_{t,r,j} + \sigma_{t,r,j}\hat{\epsilon}$ , and $\hat{\epsilon} \sim N(0,1)$ . + +On this basis, the KL divergences in Eq. (6) become: + +$$ +\begin{array}{l} K L [ q (\boldsymbol {\xi} _ {r, j} | | p (\boldsymbol {\xi} _ {r, j}) ] = \mathbb {E} _ {q (\boldsymbol {\xi} _ {r, j})} [ \log q (\boldsymbol {\xi} _ {r, j}) - \log p (\boldsymbol {\xi} _ {r, j}) ] \\ \approx \log q \left(\hat {\boldsymbol {\xi}} _ {r, j}\right) - \log p \left(\hat {\boldsymbol {\xi}} _ {r, j}\right), \forall r, j \tag {8} \\ \end{array} +$$ + +and + +$$ +\begin{array}{l} K L [ q (w _ {t, r, j}) | | p (w _ {t, r, j}) ] = \mathbb {E} _ {q (w _ {t, r, j})} [ \log q (w _ {t, r, j}) - \\ \left. \log p \left(w _ {t, r, j}\right) \right] \approx \log q \left(\hat {w} _ {t, r, j}\right) - \log p \left(\hat {w} _ {t, r, j}\right), \\ \forall t = 1, \dots , I, r, j \tag {9} \\ \end{array} +$$ + +Hence, the ELBO becomes: + +$$ +L _ {T _ {i}} (\psi) = - \operatorname {C E} \left(Y _ {i}, f _ {\psi} \left(X _ {i}; \hat {\xi}, \hat {\boldsymbol {W}}\right)\right) - \sum_ {r, j} (\log q \left(\hat {\xi} _ {r, j}\right) - \tag {10} +$$ + +$$ +\log p (\hat {\boldsymbol {\xi}} _ {r, j})) - \sum_ {t, r, j} \left(\log q (\hat {w} _ {t, r, j}) - \log p (\hat {w} _ {t, r, j})\right) +$$ + +Therefore, we establish a MAML-type algorithm, where: (i) the used networks comprise blocks of stochastic LWTA units visually depicted in Fig. 1; (ii) the trainable parameters are the means $\mu$ and variances $\sigma^2$ of the synaptic weights; and (iii) the objective function of the inner-loop process is given in Eq. (10). + +We summarize our training algorithm in Alg. 1. + +# 3.3. Prediction Algorithm + +We start our prediction algorithm (Alg. 2) by sampling a task $T' \sim P(T)$ , with data $D' = (X', Y') \subset D$ . Then, + +Algorithm 1 Model training with StochLWTA-ML +Require: $P(T)$ : distribution over tasks Initialize $\psi \coloneqq \{\pmb {\mu},\pmb{\sigma}^2\}$ Define outer-step size $\beta$ and inner learning rate $\alpha$ for $\mathrm{i} = 1,2,\ldots$ do Inner training loop: Sample task $T_{i}\sim P(T)$ Compute $L_{T_i}(\psi)$ using Eq. (10) Compute adapted parameters with SGD: $\psi_i^\prime = \psi -$ $\alpha \nabla_{\psi}L_{T_i}(f_\psi)$ Outer training loop: Derive $\psi \gets \psi +\beta (\psi_i' - \psi)$ +end for + +we draw a set of $B$ samples of the Gaussian connection weights from the trained posteriors $\mathcal{N}(\boldsymbol{\mu},\boldsymbol{\sigma}^2)$ , and select the winning units in each block of the network by similarly sampling from the posteriors $q(\xi)$ . This results in a set of $B$ output logits of the network, which we average to obtain the final predictive outcome: + +$$ +f _ {\psi} \left(X ^ {\prime}; \tilde {\xi}, \tilde {W}\right) \approx \frac {1}{B} \sum_ {s = 1} ^ {B} f _ {\psi} \left(X ^ {\prime}; \tilde {\xi} _ {s}, \tilde {W} _ {s}\right) \tag {11} +$$ + +where $\tilde{\xi}_s$ and $\tilde{W}_s$ are sampled directly from the posteriors $q(\pmb {\xi})$ and $q(W)$ , respectively. + +This concludes the formulation of the proposed model-agnostic ML approach. + +Algorithm 2 Prediction with StochLWTA-ML +Require: Learned parameters $\psi = \{\pmb {\mu},\pmb{\sigma}^2\}$ Sample task $T^{\prime}\sim P(T)$ +for $s = 1$ to $B$ do Sample $\tilde{W}_s\sim q(\boldsymbol {W})$ defined in Eq. (5) Sample $\tilde{\xi}_s\sim q(\xi)$ defined in Eq. (4), for $\boldsymbol {W} = \tilde{\boldsymbol{W}}$ and $(x_{i} = x_{i}^{\prime})\in X^{\prime}$ Compute output logits $f_{\psi}(X^{\prime};\tilde{\xi}_{s},\tilde{W}_{s})$ , given the sampled values $\hat{\xi}_s$ and $\tilde{W}_s$ +end for +Use Eq. (11) to average over the resulting set of $B$ logits and derive the final prediction. + +# 4. Experiments + +We evaluate our proposed model in various few-shot learning tasks: image classification, sinusoidal regression and active learning. After thorough exploration on the number of LWTA layers as well as the number of blocks for each layer and the competing units per block, we end up with using networks comprising 2 layers with 16 blocks and 2 competing units per block on the former layer, and 8 blocks with 2 + +units per block on the latter. The last network layer is a Softmax. Weight mean initialization, as well as point-estimate initialization for our competitors, is performed via Glorot Uniform. Weight log-variance initialization is performed via Glorot Normal, by sampling from $N(0.0005, 0.01)$ . The Gumbel-Softmax relaxation temperature is set to $\tau = 0.67$ . + +In the inner-loop updates, we use the Stochastic Gradient Descent (SGD) (Robbins, 2007) optimizer with a learning rate of 0.003. For the outer-loop, we use SGD with a linear annealed outer step size to 0, and an initial value of 0.25. Additionally, all the experiments were ran with task batch size of 50 for both training and testing mode. Prediction is carried out averaging over $B = 4$ output logits. The code was implemented in Tensorflow (Abadi et al., 2016). + +# 4.1. Classification + +We first evaluate StochLWTA-ML on popular few-shot image classification datasets, and compare its performance to state-of-the-art prior results. In Table 1, we show how StochLWTA-ML performs on Omniglot 20-way (Lake et al., 2017), Mini-Imagenet 5-way (Vinyals et al., 2016) and CIFAR-100 5-way (Krizhevsky, 2009) few-shot settings. We compare our findings to state-of-the-art ML algorithms such as LLAMA and PLATIPUS as reported in Gordon et al. (2018), Amortized Bayesian Meta-Learning (ABML), MAML, FOMAML, Reptile and others. Using the original architectures with the same hyperparameters and data preprocessing as in Finn et al. (2017), we have also locally reproduced ABML, BMAML (with 5 particles), PLATIPUS, MAML, FOMAML and Reptile (dubbed "local" in Table 1). + +For the local replicates, the results in Table 1 constitute average performance statistics and corresponding standard deviations (std's) over three runs, using different random seeds. For completeness sake, we also compare our findings to other state-of-the-art ML models as reported in Finn et al. (2017), including Matching Nets and LSTM Meta-Learner. As we observe, our method outperforms the existing state-of-the-art in both the 1-shot and 5-shot settings. Besides, the reported std statistics on the locally reproduced experiments show consistency across all methods; thus, our stochastic approach is as resilient to seed initialization as the existing approaches. + +In the following, we perform a diverse set of ablations that shed light to the characteristics and capabilities of our approach. Few more ablations are deferred to Appendix D. + +# 4.1.1. DOES STOCHASTIC COMPETITION CONTRIBUTE TO CLASSIFICATION ACCURACY? + +To check whether the accuracy improvements stem from the LWTA-induced sparsity or the proposed stochastic com + +Table 1. N-way K-shot (%) classification accuracies on Omniglot, Mini-Imagenet and CIFAR-100 + +
Omniglot 20-wayMini-Imagenet 5-wayCIFAR-100 5-way
Algorithm1-shot5-shot1-shot5-shot1-shot5-shot
Matching Nets (Santoro et al., 2016)93.8098.5043.5655.31--
LSTM Meta-Learner (Ravi & Larochelle, 2017)--43.4460.60--
MAML95.8098.9048.7063.11--
FOMAML--48.0763.15--
Reptile88.1496.6547.0762.74--
PredCP (Nalisnick et al., 2021)--49.3061.90--
Neural Statistician (Edwards & Storkey, 2016)93.2098.10----
mAP-SSVM (Triantafillou et al., 2017)95.2098.6050.3263.94--
LLAMA (Grant et al., 2018)--49.40---
PLATIPUS (Finn et al., 2018)--50.13---
GEM-BML+ (Zou & Lu, 2020)96.2498.9450.03---
DKT (Patacchiola et al., 2020)--49.7364.00--
ABML (Ravi & Beatson, 2019)--45.00-49.50-
BMAML (with 5 particles) (Yoon et al., 2018)--53.80---
ABML (local)90.21 ± 0.3493.39 ± 0.0944.23 ± 0.8152.12 ± 1.0149.23 ± 0.2353.60 ± 0.39
BMAML (local)96.92 ± 0.5898.11 ± 2.0353.10 ± 1.0564.80 ± 0.9352.60 ± 1.4065.80 ± 0.04
PLATIPUS (local)94.35 ± 0.8798.30 ± 0.4449.97 ± 0.9763.13 ± 1.1851.14 ± 0.4863.61 ± 2.16
MAML (local)95.48 ± 0.8198.61 ± 0.4948.60 ± 1.2363.01 ± 1.2850.67 ± 0.9362.89 ± 0.77
FOMAML (local)94.92 ± 0.7198.12 ± 0.9447.93 ± 0.6763.10 ± 0.5849.13 ± 0.6163.80 ± 0.83
Reptile (local)87.98 ± 1.1896.36 ± 1.5446.97 ± 0.9562.53 ± 0.6148.19 ± 0.7463.45 ± 1.63
StochLWTA-ML97.79 ± 0.4898.97 ± 0.6154.11 ± 0.8266.70 ± 0.4154.60 ± 0.3966.73 ± 0.06
+ +petition concept, we evaluate both our approach as well as MAML, FOMAML, ABML, BMAML and PLATIPUS, considering both "deterministic LWTA" and "stochastic LWTA" setups; deterministic LWTA networks have been adopted from Srivastava et al. (2013). As we see in Table 2, replacing ReLU with deterministic LWTA yields negligible differences. On the other hand, stochastic LWTA units yield a clear improvement in all cases. This improvement becomes even more important in the case of our approach, where we sample from stochastic weights. + +Table 2. Ablation study (% classification accuracy) + +
Omniglot 20-wayMini-Imagenet 5-way
AlgorithmNetwork type1-shot5-shot1-shot5-shot
MAML (local)deterministic LWTA95.5298.1548.8863.15
stochastic LWTA95.9198.7849.6164.03
FOMAML (local)deterministic LWTA95.0198.1848.1163.54
stochastic LWTA95.8098.4149.2464.54
ABML (local)deterministic LWTA90.3093.6444.3152.27
stochastic LWTA91.2193.9145.1153.31
BMAML (local)deterministic LWTA96.9698.2153.1264.84
stochastic LWTA97.1198.3053.5065.31
PLATIPUS (local)deterministic LWTA94.4898.3149.9963.21
stochastic LWTA95.1398.5651.0664.18
StochLWTA-MLdeterministic LWTA96.9598.6353.1264.93
stochastic LWTA97.7998.9754.1166.70
+ +# 4.1.2. IS THERE A COMPUTATIONAL TIME TRADE-OFF FOR THE INCREASED ACCURACY? + +It is also important to investigate whether our approach represents a trade-off between accuracy and computational time + +compared to our competitors. To facilitate this investigation, in Table 3 we provide training iteration wall-clock times for our approach and the existing locally reproduced state-of-the-art, as well as the total number of iterations each model needs to achieve the reported performance of Table 1. It appears that our methodology takes $77\%$ less training time than the less efficient algorithms ABML, BMAML, PLATI-PUS, and is comparable to other approaches. This happens because our approach yields the reported state-of-the-art performance by employing a network architecture (that is, number of LWTA layers, as well as number of blocks and block size on each layer) that result in a total number of trainable parameters that is one order of magnitude less on average than the best performing baseline methods. This can be seen in the last three columns of Table 3 (dubbed $D_A$ , $D_B$ and $D_C$ for Omniglot, Mini-Imagenet and CIFAR-100 respectively). In addition, training for our approach converges fast. + +The situation changes when it comes to prediction: our approach imposes a slight computational time overhead compared to MAML, FOMAML and Reptile, but still much less than the time-consuming PLATIPUS. BMAML and ABML. This is a rather negligible increase when we are dealing with a low number of drawn samples, $B$ . More information on the effect of sample size in our approach's performance are provided in the Supplementary. + +Finally, we provide an example of how training for our approach converges, and how this compares to the alternatives. + +Table 3. Performance comparison: average wall-clock time (in msec), training iterations for each locally reproduced method and number of baselines' trainable parameters over the considered datasets of Table 1 + +
AlgorithmTrainingPredictionTraining iterationsDA parametersDB parametersDC parameters
PLATIPUS (local)1603.39602.77333600560025615395580440
BMAML (local)1450.31514.43301800560025615395580440
ABML (local)678.48265.78138000224010246158232176
MAML (local)288.25103.2860000112005123079116088
FOMAML (local)284.49102.3460000112005123079116088
Reptile (local)284.30102.2760000113221124613117463
StochLWTA-ML282.90113.4460000545496011256745
+ +We illustrate our outcomes on the Omniglot 20-way 1-shot benchmark; similar outcomes have been observed in the rest of the considered datasets. Fig. 2(a) compares StochLWTA-ML with prior traditional ML methods: MAML, FOMAML and Reptile. It becomes apparent that our approach converges equally fast to these competitors. Further, Fig. 2(b) compares StochLWTA-ML with the probabilistic ML models ABML, BMAML, PLATIPUS. Since these methods are quite time-consuming and less efficient regarding memory consumption, StochLWTA-ML gives rise to an easier time training MAML based probabilistic model. + +# 4.1.3.EFFECT OF BLOCK SIZE $J$ + +As it is presented in Table 4, increasing the number of competing units per block to $J = 4$ or $J = 8$ does not notably improve the results of our approach. On the contrary, it increases the number of trained parameters, thus leading to higher network computational complexity. This corroborates our initial choice of using $J = 2$ competing units per block in our approach. + +Table 4. Effect of block size $J$ in StochLWTA-ML's classification (%) accuracy + +
Omniglot 20-wayMini-Imagenet 5-wayCIFAR-100 5-way
Number of units1-shot5-shot1-shot5-shot1-shot5-shot
J=297.7998.9754.1166.7054.6066.73
J=496.3398.5553.9966.6554.5166.13
J=895.3898.8353.7067.0854.4566.18
+ +# 4.1.4. HOW DOES THE TASK BATCH SIZE AFFECT STOCHLWTA-ML'S PERFORMANCE? + +For demonstration purposes, in Fig. 3(a) and 3(b) we illustrate the performance of our model on the Mini-Imagenet 5-way 1-shot setting with different task batch sizes. As we see, our model performs optimally with task batch size of 50 in terms of both training time and predictive accuracy. We have obtained similar results for all other considered datasets. + +# 4.1.5. HOW DOES THE SAMPLE SIZE $B$ AT PREDICTION TIME AFFECT STOCHLWTA-ML'S ACCURACY? + +In Fig. 3(c), we illustrate how sample size $B$ affects predictive accuracy on the Omniglot 20-way 1-shot, MiniImagenet 5-way 1-shot and CIFAR-100 5-way 5-shot settings. As we observe, an increase in sample size, $B$ , does not always yield an accuracy increase. It seems that selecting $B = 4$ allows for the best predictive accuracy/computational complexity trade-off. We have obtained similar findings for the remainder of the considered experimental settings as well. Thus, we finally choose $B = 4$ throughout our experiments. + +# 4.1.6. HOW IMPORTANT ARE THE STOCHASTIC WEIGHTS? + +We perform an ablation study on Omniglot 20-way; the goal is to discern how much of an extra improvement Gaussian weights offer. Our results are shown in Table 5. Apparently, stochastic LWTA units offer the greatest fraction of the accuracy gains, but the Gaussian weights are still indispensable. + +Table 5. Omniglot 20-way ablation study: Gaussian vs deterministic weights (point estimates). + +
Network type1-shot5-shot
ReLU (point estimates)95.6396.17
ReLU (Gaussians)95.8096.48
stochastic LWTA (point estimates)97.6898.85
stochastic LWTA (Gaussians)97.7998.97
+ +# 4.2. Regression + +In this section, we compare our approach StochLWTA-ML with the locally reproduced baselines of Section 4.1, on two sinusoidal function regression problems. In the former case, we apply the default setting used in Finn et al. (2017); in the latter, we use a more challenging setting as proposed in Yoon et al. (2018), containing more uncertainty than the setting used in Finn et al. (2017). Specifically, the + +![](images/29405fc9387453c7085cd4e79c9fa7f8637bea5c1576287be17599af6391f617.jpg) +(a) + +![](images/d4391817e3cb6b23bb3b7b569c926d649e4bfcda10d5e08b675da92d259ff286.jpg) +(b) +Figure 2. ML algorithms' training convergence comparison + +![](images/0ff2f675c03c904182a65dfa1f3121eb6fdd954e44f45e7b0a31f69447949e71.jpg) +(a) + +![](images/960595378abd653d36384746a06b1e68455ea2986fa3d6eb649537f72fc8611e.jpg) +(b) + +![](images/308ac825defb2159a51cb9d46fbdf1e65159bcbc009bd3b5345408f06d550177.jpg) +(c) +Figure 3. (a) The effect of task batch size in StochLWTA's predictive accuracy, (b) the effect of task batch size in StochLWTA's training time per iteration (in msec), and (c) the effect of sample size $B$ in StochLWTA-ML's classification (\%) accuracy + +tasks distribution $P(T)$ is defined by a sinusoidal function $y = A\sin (\omega x + b) + \epsilon$ , with amplitude $A$ , frequency $\omega$ , phase $b$ and observation noise $\epsilon$ . The parameters of each task are sampled from Uniform distributions $A \in [0.1, 5.0]$ , $b \in [0.0, 2\pi]$ , $\omega \in [0.5, 2.0]$ , and observation noise $\epsilon$ from Normal distribution $N(0, (0.01A)^2)$ . For each task, 10 input instances $x$ are sampled from $[-5.0, 5.0]$ . The network architecture employed for the baseline experiments consists of 2 hidden layers of size 64 with tanh activation. In our StochLWTA-ML case, we replace each hidden layer with a proposed stochastic LWTA one. Both architectures end up with a Softmax layer. + +In Fig. 4, we illustrate the Mean Squared Error (MSE) performance on test tasks for both settings, after training all the models for 60000 iterations. Specifically, in Fig. 4(a) we observe that StochLWTA-ML, in the default setting, adapts equally fast as MAML and Reptile; thus, its convergence speed is much higher than the other time-consuming probabilistic methods ABML, BMAML and PLATIPUS. In the challenging setting of Fig. 4(b), the Bayesian methods + +StochLWTA-ML, ABML, BMAML and PLATIPUS can still perform well in a high uncertainty setting while non-Bayesian models MAML and Reptile fail to converge; this outcome is achieved due to the ability of Bayesian methods to reduce overfitting and generalize better. It is clear that our approach yields the most time-efficient method among the baselines. + +# 4.2.1. IS THERE A COMPUTATIONAL TIME TRADE-OFF FOR THE REDUCED MSE? + +In Table 6, we report the numbers of trainable parameters as an average over the default and challenging settings of the regression experiments. In a similar vein with the classification outcomes of Section 4.1.2, it appears that our methodology takes $77\%$ less training time than the less efficient algorithms ABML, BMAML, PLATIPUS, and is comparable to other approaches. This demonstrates the effect of parameters' number reduction to the training process of a MAML based probabilistic model. + +![](images/4cd8520232d2ad644c32a05446092cd7ff55c635e7c46cd765185b1d72410f07.jpg) +(a) + +![](images/e457bacd00f873e1399e5ff56ede61447c2e5795d359f2d33571da75d57400ce.jpg) +(b) +Figure 4. Sinusoidal regression results: (a) MSE of default setting after 60000 training iterations, (b) MSE of challenging setting after 60000 training iterations, and (c) active learning setting + +![](images/f7537cde34492f0c2bbe66e5e8265f9b791f1a413866004ef6a69626fac86daa.jpg) +(c) + +Table 6. Performance comparison: average wall-clock time (in msec), and average number of baselines' trainable parameters over the two settings of regression experiments + +
AlgorithmTrainingPredictionParameters
PLATIPUS (local)359.23135.7421541
BMAML (local)323.76115.9021541
ABML (local)150.9659.758622
MAML (local)65.5423.914315
FOMAML (local)64.8023.024315
Reptile (local)64.6323.304353
StochLWTA-ML63.1125.452092
+ +# 4.3. Active learning with regression + +To further evaluate the effectiveness of the proposed stochastic LWTA network, we now consider an active learning experiment, in the challenging setting described in Section 4.2. Specifically, we provide the models with 5 input observations $x$ sampled from $[-5.0, 5.0]$ . Then, each model queries to label 5 extra instances. The Bayesian methods StochLWTA-ML, ABML, BMAML and PLATIPUS choose an item $x^{*}$ that has the maximum variance across the sampled regressors. However, the non-Bayesian models MAML and Reptile, choose points randomly, since they do not entail a utility that handles uncertainty; as we demonstrate in Fig. 4(c), they fail to converge due to their inability to adapt to a more ambiguous training environment. Considering the Bayesian methods, our approach achieves the better predictive performance compared to the other baselines. This reaffirms the prevalence of our proposed network to another experimental scenario. + +# 5. Conclusion + +In this paper, we proposed a sparse and stochastic network paradigm for ML, with novel network design principles compared to currently used model-agnostic ML models. We introduced stochastic LWTA activations in the context of a + +variational Bayesian treatment that gave rise to a doubly-stochastic ML framework, bearing the promise of stronger generalization capacity. We evaluated our approach using standard image classification benchmarks in the field, and showed that it outperformed the state-of-the-art in terms of both predictive accuracy, error rate and computational costs. The results have provided strong empirical evidence supporting our claims. In the future, we plan to study the effect of StochLWTA-ML in areas related to ML, such as Continual Learning (Javed & White, 2019) and Reinforcement Learning (Zhu et al., 2020). + +# Acknowledgements + +This work has received funding from the European Union's Horizon 2020 research and innovation program under grant agreement No 872139, project aiD. + +# References + +Abadi, M., Agarwal, A., Barham, P., Brevdo, E., Chen, Z., Citro, C., Corrado, G. S., Davis, A., Dean, J., and Devin, M. Tensorflow: Large-scale machine learning on heterogeneous distributed systems. pp. 265-283. In Proceedings of the 12th USENIX Conference on Operating Systems Design and Implementation, 2016. +Andrychowicz, M., Denil, M., Gomez, S., Hoffman, M. W., Pfau, D., Schaul, T., Shillingford, B., and de Freitas, N. Learning to learn by gradient descent by gradient descent. In Neural Information Processing Systems, 2016. +Baik, S., Choi, M., Choi, J., Kim, H., and Lee, K. M. Meta-learning with adaptive hyperparameters. In Neural Information Processing Systems, 2020. +Black, P., McCormick, R., James, M., and Pedderd, D. Learning how to learn and assessment for learning: a theoretical inquiry. Research Papers in Education, 21: 119-132, 2006. + +Buysse, H. M., Mets, K., and Latré, S. Fast task-adaptation for tasks labeled using natural language in reinforcement learning. 2019. URL https://arxiv.org/abs/1910.04040. +Castro, R., Kalish, C., Nowak, R., Qian, R., Rogers, T., and Zhu, J. Human active learning. In Neural Information Processing Systems, 2008. +Chen, Y., Friesen, A. L., Behbahani, F., Doucet, A., Budden, D., Hoffman, M., and de Freitas, N. Modular meta-learning with shrinkage. In Neural Information Processing Systems, 2020. +Edwards, H. and Storkey, A. Towards a neural statistician. 2016. URL https://arxiv.org/abs/1606.02185. +Finn, C., Abbeel, P., and Levine, S. Model-agnostic meta-learning for fast adaptation of deep networks. In International Conference on Machine Learning, 2017. +Finn, C., Xu, K., and Levine, S. Probabilistic model-agnostic meta-learning. In Neural Information Processing Systems, 2018. +Finn, C., Rajeswaran, A., Kakade, S., and Levine, S. Online meta-learning. In International Conference on Machine Learning, 2019. +Glorot, X. and Bengio, Y. Understanding the difficulty of training deep feedforward neural networks. Journal of Machine Learning Research 9, pp. 249-256, 2010. +Gordon, J., Bronskill, J., Bauer, M., Nowozin, S., and Turner, R. E. Meta-learning probabilistic inference for prediction. In International Conference on Learning Representations, 2018. +Grant, E., Finn, C., Levine, S., Darrell, T., and Griffiths, T. Recasting gradient-based meta-learning as hierarchical bayes. In International Conference on Learning Representations, 2018. +Ioffe, S. and Szegedy, C. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In International Conference on Machine Learning, 2015. +Javed, K. and White, M. Meta-learning representations for continual learning. pp. 1818-1828. In Neural Information Processing Systems, 2019. +Kessler, S., Nguyen, V., Zohren, S., and Roberts, S. Hierarchical indian buffet neural networks for bayesian continual learning. In UAI, 2021. +Kingma, D. P. and Welling, M. Auto-encoding variational bayes. In International Conference on Learning Representations, 2014. + +Krizhevsky, A. Learning multiple layers of features from tiny images. Technical report, 2009. +Kuhl, N., Goutier, M., Baier, L., Wolff, C., and Martin, D. Human vs. supervised machine learning: Who learns patterns faster? 2020. URL https://arxiv.org/abs/2012.03661. +Lai, Y. A comparison of traditional machine learning and deep learning in image recognition. Journal of Physics: Conference Series, 1314, 2019. +Lake, B. M., Ullman, T. D., Tenenbaum, J. B., and Gershman, S. J. Building machines that learn and think like people. Behavioral and Brain Sciences, 40, 2017. +Lee, J., Kim, S., Yoon, J., Lee, H. B., Yang, E., and Hwang, S. J. Adaptive network sparsification with dependent variational beta-bernoulli dropout. 2018. URL https://arxiv.org/abs/1805.10896. +Maddison, C. J., Mnih, A., and Teh, Y. W. The concrete distribution: A continuous relaxation of discrete random variables. In International Conference on Learning Representations, 2017. +Nalisnick, E., Gordon, J., and Hernández-Lobato, J. M. Predictive complexity priors. In Neural Information Processing Systems, 2021. +Nichol, A., Achiam, J., and Schulman, J. On first-order meta-learning algorithms. 2018. URL https:// arxiv.org/abs/1803.02999. +Panousis, K., Chatzis, S., Alexos, A., and Theodoridis, S. Local competition and stochasticity for adversarial robustness in deep learning. In International Conference on Artificial Intelligence and Statistics, 2021. +Panousis, K. P., Chatzis, S., and Theodoridis, S. Nonparametric bayesian deep networks with local competition. In International Conference on Machine Learning, 2019. +Patacchiola, M., Turner, J., Crowley, E. J., O'Boyle, M., and Storkey, A. Bayesian meta-learning for the few-shot setting via deep kernels. In Neural Information Processing Systems, 2020. +Ravi, S. and Beatson, A. Amortized bayesian meta-learning. In International Conference on Learning Representations, 2019. +Ravi, S. and Larochelle, H. Optimization as a model for few-shot learning. In International Conference on Learning Representations, 2017. +Robbins, H. A stochastic approximation method. Annals of Mathematical Statistics, 2007. + +Santoro, A., Bartunov, S., Botvinick, M., Wierstra, D., and Lillicrap, T. Meta-learning with memory-augmented neural networks. In International Conference on Machine Learning, 2016. +Sculley, D., Holt, G., Golovin, D., Davydov, E., and Phillips, T. Hidden technical debt in machine learning systems. In Neural Information Processing Systems, 2015. +Srivastava, R. K., Masci, J., Kazerounian, S., Gomez, F., and Schmidhube, J. Compete to compute. In Neural Information Processing Systems, 2013. +Triantafillou, E., Zemel, R., and Urtasun, R. Few-shot learning through an information retrieval lens. In Neural Information Processing Systems, 2017. +Vinyals, O., Blundell, C., Lillicrap, T., Kavukcuoglu, K., and Wierstra, D. Matching networks for one shot learning. In Neural Information Processing Systems, 2016. +Voskou, A., Panousis, K., Kosmopoulos, D., Metaxas, D., and Chatzis, S. Stochastic transformer networks with linear competing units: Application to end-to-end sl translation. In International Conference on Computer Vision, 2021. +Yoon, J., Kim, T., Dia, O., Kim, O., Bengio, Y., and Ahn, S. Bayesian model-agnostic meta-learning. In Neural Information Processing Systems, 2018. +Zhu, H., Yu, J., Gupta, A., Shah, D., Hartikainen, K., Singh, A., Kumar, V., and Levine, S. The ingredients of real-world robotic reinforcement learning. In International Conference on Learning Representations, 2020. +Zou, Y. and Lu, X. Gradient-em bayesian meta-learning. In Neural Information Processing Systems, 2020. + +# A. Further details on the used datasets + +Omniglot is a dataset of 1623 characters from different alphabets, containing 20 examples per character scaled down to $28 \times 28$ grayscale pixels. The ratio between training and testings sets is 3:2, so after shuffling the character classes we randomly choose the first 974 classes for training and the remaining are left for testing. As for the Mini-Imagenet dataset, it has color images of size $84 \times 84$ and contains 100 classes with 600 examples from the ImageNet dataset. We randomly choose 45000 examples for the training phase and the rest constitute the testing population. The CIFAR-100 dataset consists of color images of size $32 \times 32$ and contains 100 classes with 600 images per class. We randomly choose 500 images per class for training and the rest 100 images per class constitute the testing population. + +# B. Few-Shot Classification Network Architectures + +For the local replicates of prior ML algorithms in the experiments of our work, we follow the same architecture for the deep neural network as the one used by Vinyals et al. (2016). For Omniglot, the network is composed of 4 convolutional layers with 64 filters, $3 \times 3$ convolutions and $2 \times 2$ strides, followed by a Batch Normalization layer (Ioffe & Szegedy, 2015) and the final values of each layer are processed by an activation function. For both Mini-Imagenet and CIFAR-100, we use 4 convolutional layers with 32 filters to reduce overfitting like Ravi & Larochelle (2017), $3 \times 3$ convolutions followed by Batch Normalization layer and $2 \times 2$ max-pooling layer with the values of each layer finally passed again through an activation block. The activation function used for the baseline experiments is: ReLU for Tables 1, 3, 6 and D1, and LWTA for Table 2. + +# C. What parameters do we count for the outcomes of Tables 3, 6 and D1? + +The included parameters of each baseline for the outcomes of Tables 3, 6 and D1 are: + +- PLATIPUS: $\Theta = \{\pmb{\mu}_{\theta}, \pmb{\sigma}_{\theta}^{2}, \pmb{v}_{\theta}, \gamma_{p}, \gamma_{q}\}$ +- BMAML: $\Theta = \{\theta^{m}\}_{m=1}^{5}$ , for using 5 particles +- ABML: $\theta = \{\pmb{\mu}_{\theta}, \pmb{\sigma}_{\theta}^{2}\}$ +- MAML: $\theta = \{\pmb{\mu}_{\theta}\}$ +FOMAML: $\theta = \{\pmb {\mu}_\theta \}$ +- Reptile: $\theta = \{\pmb{\mu}_{\theta}\}$ +- StochLWTA-ML: $\theta = \{\pmb{\mu}_{\theta}, \pmb{\sigma}_{\theta}^{2}\}$ + +Table D1. Performance comparison: wall-clock time (in msec), training iterations for each locally reproduced method, classification accuracy and number of baselines' trainable parameters over the Omniglot 20-way 1-shot benchmark + +
AlgorithmTrainingPredictionTraining iterationsAccuracy (%)Parameters
PLATIPUS (local)490.67221.9110710091.5755817
BMAML (local)479.03200.6810356094.1156321
ABML (local)402.38170.328700087.9255312
MAML (local)272.8991.246000092.1055917
FOMAML (local)269.0191.126000092.8355917
Reptile (local)268.7290.836000085.6056525
StochLWTA-ML272.14102.566000097.7954549
+ +# D. More Ablations + +# D.1. How do the state-of-the-art methods perform with a parameter count reduced to be about the same as StochLWTA-ML? + +We repeated Omniglot 20-way 1-shot experiments to evaluate all state-of-the-art, using a deep network of the same number of parameters and similar architecture as the proposed StochLWTA-ML model. To this end, we simply replaced the stochastic LWTA layers with dense ReLU layers of the same size, and dropped the Gaussians from the weights. This yielded between $2.2\%$ and $3.5\%$ reduction in classification accuracy, as we show in Table D1. + +# D.2. How does StochLWTA-ML perform with more parameters? + +We repeated a classification experiment on Omniglot 20-way 1-shot by using a stochastic LWTA architecture of 4 convolutional layers. In this context, in each layer competition is performed among the feature maps of a convolutional kernel; this proceeds on a position-wise basis. The so-obtained convolutional deep network yields the same number of parameters as in the state-of-the-art. Our experimental outcomes are conspicuous: our approach lost accuracy (the reported $97.79\%$ accuracy reduced to $96.50\%$ ), while training time increased by four and inference time almost doubled; similar outcomes have been observed in the rest of the considered datasets. \ No newline at end of file diff --git a/stochasticdeepnetworkswithlinearcompetingunitsformodelagnosticmetalearning/images.zip b/stochasticdeepnetworkswithlinearcompetingunitsformodelagnosticmetalearning/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..e0b15fb9a498e75e36daadfd32608be35740f827 --- /dev/null +++ b/stochasticdeepnetworkswithlinearcompetingunitsformodelagnosticmetalearning/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e99ad4f59d53de2b02c95d72e2cb16a875c3125c13a16244bfe9321220957f69 +size 610974 diff --git a/stochasticdeepnetworkswithlinearcompetingunitsformodelagnosticmetalearning/layout.json b/stochasticdeepnetworkswithlinearcompetingunitsformodelagnosticmetalearning/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..96eeb7a6b559986b3966919faea8762ab22e2c60 --- /dev/null +++ b/stochasticdeepnetworkswithlinearcompetingunitsformodelagnosticmetalearning/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:011586d74c50edff162f0ee266a01306f98731f70c9fe80154cc99a90103763d +size 498778 diff --git a/stochasticreweightedgradientdescent/7f47d2fa-033d-4fd8-b944-2a0d7af0101a_content_list.json b/stochasticreweightedgradientdescent/7f47d2fa-033d-4fd8-b944-2a0d7af0101a_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..9096a56d70a962f2caba76ba62cf1393cbf8281c --- /dev/null +++ b/stochasticreweightedgradientdescent/7f47d2fa-033d-4fd8-b944-2a0d7af0101a_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9a7e23d3ca84da9fe88610109008b205a7fefa84c2bad14f164024736322bd4e +size 120932 diff --git a/stochasticreweightedgradientdescent/7f47d2fa-033d-4fd8-b944-2a0d7af0101a_model.json b/stochasticreweightedgradientdescent/7f47d2fa-033d-4fd8-b944-2a0d7af0101a_model.json new file mode 100644 index 0000000000000000000000000000000000000000..028a13f25c44ec9a5f29a6251f4d2377c0d7444d --- /dev/null +++ b/stochasticreweightedgradientdescent/7f47d2fa-033d-4fd8-b944-2a0d7af0101a_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:805024fc46ef4ddefc2dbfdf6c75ac5a92001496bd834af418ef5bd760c9254f +size 141440 diff --git a/stochasticreweightedgradientdescent/7f47d2fa-033d-4fd8-b944-2a0d7af0101a_origin.pdf b/stochasticreweightedgradientdescent/7f47d2fa-033d-4fd8-b944-2a0d7af0101a_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..aa3ef59d287ff90c97b6471aabd125be9ba5bd8d --- /dev/null +++ b/stochasticreweightedgradientdescent/7f47d2fa-033d-4fd8-b944-2a0d7af0101a_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:142ec0c5f1d01133502a8be811bde2255e71cba1bd0fc9b1e61f8c446d910562 +size 898986 diff --git a/stochasticreweightedgradientdescent/full.md b/stochasticreweightedgradientdescent/full.md new file mode 100644 index 0000000000000000000000000000000000000000..b9f88e88235fccb45e06f412c4422adfa294711c --- /dev/null +++ b/stochasticreweightedgradientdescent/full.md @@ -0,0 +1,699 @@ +# Ayoub El Hanchi $^{1}$ David A. Stephens $^{2}$ Chris J. Maddison $^{1}$ + +# Abstract + +Importance sampling is a promising strategy for improving the convergence rate of stochastic gradient methods. It is typically used to precondition the optimization problem, but it can also be used to reduce the variance of the gradient estimator. Unfortunately, this latter point of view has yet to lead to practical methods that provably improve the asymptotic error of stochastic gradient methods. In this work, we propose stochastic reweighted gradient descent (SRG), a stochastic gradient method based solely on importance sampling that can reduce the variance of the gradient estimator and improve on the asymptotic error of stochastic gradient descent (SGD) in the strongly convex and smooth case. We show that SRG can be extended to combine the benefits of both importance-sampling-based preconditioning and variance reduction. When compared to SGD, the resulting algorithm can simultaneously reduce the condition number and the asymptotic error, both by up to a factor equal to the number of component functions. We demonstrate improved convergence in practice on regularized logistic regression problems. + +# 1. Introduction + +Unconstrained optimization of finite-sum objectives is a core algorithmic problem in machine learning. The prototypical way of solving such problems is by viewing them through the lens of stochastic optimization, where the source of stochasticity resides in the choice of the index in the sum. Stochastic gradient descent (SGD) (Robbins & Monro, 1951) remains the standard algorithm for this class of problems. + +A natural way to improve on SGD is by considering importance sampling schemes. This idea is not new and dates + +1University of Toronto and Vector Institute 2McGill University. Correspondence to: Ayoub El Hanchi . + +Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s). + +back to (Needell et al., 2014) who uses importance sampling as a preconditioning technique. They propose sampling the indices with probabilities proportional to the smoothness constants of the corresponding component functions, and show that this sampling scheme provably reduces the condition number of the problem. + +In another line of work, variance-reduced methods were found to achieve linear convergence in the strongly convex and smooth case (Roux et al., 2012; Schmidt et al., 2017). Many of these methods rely on control variates to reduce the variance of the gradient estimator used by SGD (Johnson & Zhang, 2013; Defazio et al., 2014). While very successful, the applicability of these methods is limited by the large memory overhead that they introduce, or the periodic full-gradient recomputation that they require (Defazio & Bottou, 2019). Despite strong progress in this research area, an importance-sampling-based analogue to these algorithms, which is potentially free from these drawbacks, has yet to emerge. + +In this work, we propose such an analogue. We introduce stochastic reweighted gradient (SRG), an importance-sampling-based stochastic optimization algorithm that reduces the variance of the gradient estimator. Similar to SGD, SRG requires a single gradient oracle call per iteration, and only requires $O(n)$ additional memory, and $O(\log n)$ additional floating point operations per iteration. We analyze the convergence rate of SRG in the strongly-convex and smooth case, and show that it can provably improve the asymptotic error of SGD. Finally, we show how our importance sampling strategy can be combined with smoothness-based importance sampling, and prove that the resulting algorithm simultaneously performs variance reduction and preconditioning. We demonstrate improved convergence in practice on $\ell_2$ -regularized logistic regression problems. + +# 2. Preliminaries + +We consider the finite-sum optimization problem: + +$$ +\min _ {x \in \mathbb {R} ^ {d}} \left\{F (x) := \frac {1}{n} \sum_ {i = 1} ^ {n} f _ {i} (x) \right\} \tag {1} +$$ + +where $F$ is $\mu$ -strongly convex for $\mu > 0$ , and for all $i \in [n]$ , $f_i$ is convex and $L_i$ -smooth for $L_i > 0$ . Note that + +by strong-convexity, $F$ has a unique minimizer $x^{*}\in \mathbb{R}^{d}$ . We define the maximum $L_{\mathrm{max}}\coloneqq \max_{i\in [n]}L_{i}$ and average $\overline{L}\coloneqq n^{-1}\sum_{j = 1}^{n}L_{i}$ smoothness constants. Similarly, we define the maximum $\kappa_{\mathrm{max}}\coloneqq L_{\mathrm{max}} / \mu$ and average $\overline{\kappa}\coloneqq \overline{L} /\mu$ condition numbers. + +The classical way of solving (1) is by viewing it as a stochastic optimization problem where the randomness comes from the choice of the index $i \in [n]$ . Starting from some $x_0 \in \mathbb{R}^d$ , and for an iteration number $k \in \mathbb{N}$ , stochastic gradient descent (SGD) performs the following update: + +$$ +x _ {k + 1} = x _ {k} - \alpha_ {k} \nabla f _ {i _ {k}} (x _ {k}) +$$ + +for a step size $\alpha_{k} > 0$ and a random index $i_k$ drawn uniformly from $[n]$ . + +The idea behind importance sampling for SGD is to instead sample the index $i_k$ according to a chosen distribution $p_k$ on $[n]$ , and to perform the update (Needell et al., 2014): + +$$ +x _ {k + 1} = x _ {k} - \alpha_ {k} \frac {1}{n p _ {k} ^ {i _ {k}}} \nabla f _ {i _ {k}} (x _ {k}) \tag {2} +$$ + +where $p_k^i$ is the $i^{th}$ component of the probability vector $p_k$ . It is immediate to verify that the importance sampling estimator of the gradient is unbiased as long as $p_k > 0$ . + +The question that we address in this paper is how to design a sequence $\{p_k\}_{k=0}^{\infty}$ that produces more efficient gradient estimators than the ones produced by uniform sampling. One way to design such a sequence is by adopting a greedy strategy: at each iteration $k$ we choose $p_k$ to minimize the conditional variance of the gradient estimator, which is given by, up to an additive constant: + +$$ +\sigma^ {2} (x _ {k}, p) = \frac {1}{n ^ {2}} \sum_ {i = 1} ^ {n} \frac {1}{p ^ {i}} \| \nabla f _ {i} (x _ {k}) \| _ {2} ^ {2}, \tag {3} +$$ + +This conditional variance is minimized at (Zhao & Zhang, 2015): + +$$ +\underset {p} {\arg \min } \sigma^ {2} (x _ {k}, p) = \left(\frac {\| \nabla f _ {i} (x _ {k}) \| _ {2}}{\sum_ {j = 1} ^ {n} \| \nabla f _ {j} (x _ {k}) \| _ {2}}\right) _ {i = 1} ^ {n} \quad (4) +$$ + +Ideally, we would like to set $p_k$ to this minimizer. However, this requires knowledge of the gradient norms $(\| \nabla f_i(x_k) \|_2)^n$ , which, in general, requires $n$ gradient evaluations per iteration, making this approach intractable. + +# 3. Algorithm + +In this section, we show how to design a tractable sequence of importance sampling distributions for SGD that approximate the conditional-variance-minimizing distributions (4). First we construct efficient approximations of the conditional variances (3). We then state a simple bound on their + +# Algorithm 1 SRG + +1: Parameters: step sizes $(\alpha_{k})_{k = 0}^{\infty} > 0$ mixture coefficients $(\theta_{k})_{k = 0}^{\infty}\in (0,1]$ +2: Initialization: $x_0 \in \mathbb{R}^d, (\left\| g_0^i \right\|_2)_{i=1}^n \in \mathbb{R}^n$ +3: for $k = 0,1,2,\ldots$ do +4: $p_k = (1 - \theta_k) q_k + \theta_k / n$ {qk is defined in (6)} +5: $b_{k} \sim \operatorname{Bernoulli}(\theta_{k})$ +6: if $b_{k} = 1$ then $i_{k} \sim 1 / n$ else $i_{k} \sim q_{k}$ +7: $x_{k + 1} = x_{k} - \alpha_{k}\frac{1}{np_{k}^{i_{k}}}\nabla f_{i_{k}}(x_{k})$ +8: $\left\| g_{k + 1}^{i}\right\|_{2} = \begin{cases} \| \nabla f_{i}(x_{k})\|_{2} & \text{if } b_{k} = 1 \text{ and } i_{k} = i \\ \left\| g_{k}^{i}\right\|_{2} & \text{otherwise} \end{cases}$ +9: end for + +approximation errors and use it to motivate our choice of importance sampling distributions. + +To approximate the conditional variances, we follow the strategy of certain variance-reduced methods (Roux et al., 2012; Schmidt et al., 2017; Defazio et al., 2014). These methods maintain a table $(g_k^i)_{i=1}^n$ that tracks the component gradients $(\nabla f_i(x_k))_{i=1}^n$ which is updated at each iteration at the index $i_k$ used to update the iterates $x_k$ (2). Our method instead maintains an array of gradient norms, from which we construct an approximation of the conditional variance (3) of the gradient estimator: + +$$ +\tilde {\sigma} ^ {2} \left(x _ {k}, p\right) := \frac {1}{n ^ {2}} \sum_ {i = 1} ^ {n} \frac {1}{p ^ {i}} \left\| g _ {k} ^ {i} \right\| _ {2} ^ {2} \tag {5} +$$ + +this approximation is minimized at: + +$$ +q _ {k} = \underset {p} {\arg \min } \tilde {\sigma} ^ {2} (x _ {k}, p) = \left(\frac {\left\| g _ {k} ^ {i} \right\| _ {2}}{\sum_ {j = 1} ^ {n} \left\| g _ {k} ^ {j} \right\| _ {2}}\right) _ {i = 1} ^ {n} \quad (6) +$$ + +We do not directly use $q_{k}$ as an importance sampling distribution, because this approximation may be poor. In particular, we have the following bound that relates the conditional variance (3) to the approximation (5): + +$$ +\sigma^ {2} (x _ {k}, p) \leq \frac {2}{n ^ {2}} \sum_ {i = 1} ^ {n} \frac {\left\| \nabla f _ {i} (x _ {k}) - g _ {k} ^ {i} \right\| _ {2} ^ {2}}{p ^ {i}} + 2 \tilde {\sigma} ^ {2} (x _ {k}, p) \tag {7} +$$ + +Recall that our goal is to pick $p_k$ that minimizes $\sigma^2(x_k, p)$ . $q_k$ minimizes the second term on the right-hand side of 7, but we must ensure that both terms are small. Two conditions are needed to keep the first term small. The first is to control the terms $\left\| \nabla f_i(x_k) - g_k^i \right\|_2^2$ , which we can do by making sure that the historical gradients $g_k^i$ are frequently updated. The second is to ensure that the probabilities $p_k^i$ + +are lower bounded. We achieve both of these properties, as well as approximately minimize the right-hand side of (7) by mixing $q_{k}$ with the uniform distribution over $[n]$ . For a given mixture coefficient $\theta_{k} \in (0,1]$ , this yields our final importance sampling distribution: + +$$ +p _ {k} = \left(1 - \theta_ {k}\right) q _ {k} + \frac {\theta_ {k}}{n} \tag {8} +$$ + +Our analysis in section 4 clarifies the role of the sequence of mixture coefficients $(\theta_k)_{k=0}^{\infty}$ , and relates it to both the step size sequence $(\alpha_k)_{k=0}^{\infty}$ and the asymptotic error of SRG in the constant step size setting. + +Curiously, our analysis requires performing the update of the array $\left(\left\| g_k^i\right\| _2\right)_{i = 1}^n$ only when the index $i_k$ is drawn from the uniform mixture component. It is not clear to us whether this constraint is an artifact of the analysis or a property of the algorithm. We discuss this further after the statement of Lemma 4.1 in section 4. Pseudocode for our method is given in Algorithm 1. + +We briefly discuss how SRG can be efficiently implemented. To sample from $q_{k}$ , we store $\left(\left\| g_k^i\right\| _2\right)_{i = 1}^n$ in a binary indexed tree using $O(n)$ memory, along with the normalizing constant $\lambda_{k} = \sum_{i = 1}^{n}\left\| g_{k}^{i}\right\|_{2}$ . The binary indexed tree can be updated and maintained in $O(\log n)$ operations, while the normalizing constant can be maintained in constant time. We can then sample from $q_{k}$ using inverse transform sampling: we multiply a uniform random variable $u\in [0,1)$ by $\lambda_{k}$ , then return the largest index $i_{k}$ whose corresponding prefix sum $\sum_{i = 1}^{i_k}\left\| g_k^i\right\| _2$ is less than $\lambda_{k}u$ . This procedure also requires only $O(\log n)$ operations. The total overhead of SRG when compared to SGD is therefore $O(n)$ memory and $O(\log n)$ floating point operations per iteration, both of which are dimension-free. + +# 4. Theory + +In this section, we analyze the convergence rate of SRG, and show that it can achieve a better asymptotic error than SGD. Two key constants are helpful in contrasting the asymptotic errors of SRG and SGD. Recall the definition of the conditional variance $\sigma^2 (x_k,p_k)$ in (3), and define: + +$$ +\sigma^ {2} := \sigma^ {2} (x ^ {*}, 1 / n) = \frac {1}{n} \sum_ {i = 1} ^ {n} \| \nabla f _ {i} (x ^ {*}) \| _ {2} ^ {2} +$$ + +$$ +\sigma_ {*} ^ {2} := \min _ {p} \sigma^ {2} (x ^ {*}, p) = \frac {1}{n ^ {2}} \left(\sum_ {i = 1} ^ {n} \| \nabla f _ {i} (x ^ {*}) \| _ {2}\right) ^ {2} +$$ + +It is well known that the asymptotic error of SGD in the strongly-convex and smooth case depends linearly on $\sigma^2$ (Needell et al., 2014). We here show that SRG reduces this to a linear dependence on $\sigma_{*}^{2}$ , which can be up to $n$ times smaller. + +To study the convergence rate of SRG, we use the following Lyapunov function, which is similar to the one used to study the convergence rate of SAGA (Hofmann et al., 2015; Defazio, 2016): + +$$ +T ^ {k} := \frac {\alpha_ {k}}{\theta_ {k}} \frac {a}{L _ {\operatorname* {m a x}}} \sum_ {i = 1} ^ {n} \left\| g _ {k} ^ {i} - \nabla f _ {i} \left(x ^ {*}\right) \right\| _ {2} ^ {2} + \left\| x _ {k} - x ^ {*} \right\| _ {2} ^ {2} \tag {9} +$$ + +for a constant $a > 0$ that we set during the analysis. The proofs of this section can be found in Appendix B. + +# 4.1. Intermediate lemmas + +Before proceeding with the main result, let us first state two intermediate lemmas. The first studies the evolution of $(g_k^i)_{i=1}^n$ from one iteration to the next. + +Lemma 4.1. Let $k \in \mathbb{N}$ and suppose that $(g_k^i)_{i=1}^n$ evolves as in Algorithm 1. Taking expectation with respect to $(b_k, i_k)$ , conditional on $(b_t, i_t)_{t=0}^{k-1}$ , we have: + +$$ +\begin{array}{l} \mathbb {E} \left[ \sum_ {i = 1} ^ {n} \left\| g _ {k + 1} ^ {i} - \nabla f _ {i} \left(x ^ {*}\right) \right\| _ {2} ^ {2} \right] \leq 2 \theta_ {k} L _ {\max } \left[ F \left(x _ {k}\right) - F \left(x ^ {*}\right) \right] \\ + \left(1 - \frac {\theta_ {k}}{n}\right) \sum_ {i = 1} ^ {n} \left\| g _ {k} ^ {i} - \nabla f _ {i} (x ^ {*}) \right\| _ {2} ^ {2} \\ \end{array} +$$ + +The use of the Bernoulli random variable $b_{k}$ in Algorithm 1 to monitor the update of $(g_{k}^{i})_{i = 1}^{n}$ is necessary for Lemma 4.1 to hold. In particular, without the use of $b_{k}$ , the elements of $(g_{k}^{i})_{i = 1}^{n}$ may have different probabilities of being updated. In that case, the first term of Lemma 4.1 becomes a weighted average of terms which is not easily bounded. When the importance sampling distribution does not depend on the iteration number, this issue can be fixed with a slight modification of the Lyapunov function (9) (Schmidt et al., 2015). In our case however, we are dealing with time-varying importance sampling distributions, and this approach fails. Instead, we condition the update of $(g_{k}^{i})_{i = 1}^{n}$ on the Bernoulli random variable $b_{k}$ such that the probability of updating $g_{k}^{i}$ is fixed to $\theta_{k} / n$ for all $i\in [n]$ . + +The second lemma is a bound on the conditional variance of the gradient estimator used by SRG. We intentionally leave as many free parameters as possible in the bound and optimize over them in the main result of section 4.2. + +Lemma 4.2. Let $k \in \mathbb{N}$ and assume that $\theta_k \in (0,1/2]$ . Taking expectation with respect to $(b_k, i_k)$ , conditional on $(b_t, i_t)_{t=0}^{k-1}$ , we have, for all $\beta, \gamma, \delta, \eta > 0$ : + +$$ +\begin{array}{l} \underset {i _ {k} \sim p _ {k}} {\mathbb {E}} \left[ \left\| \frac {1}{n p _ {k} ^ {i _ {k}}} \nabla f _ {i _ {k}} (x _ {k}) \right\| _ {2} ^ {2} \right] \leq \frac {2 D _ {1} L _ {m a x}}{\theta_ {k}} \left[ F (x _ {k}) - F ^ {*} \right] \\ + \frac {D _ {2}}{\theta_ {k} n} \sum_ {i = 1} ^ {n} \left\| g _ {k} ^ {i} - \nabla f _ {i} (x ^ {*}) \right\| _ {2} ^ {2} + D _ {3} (1 + 2 \theta_ {k}) \sigma_ {*} ^ {2} \\ \end{array} +$$ + +where $D_{1}, D_{2}$ and $D_{3}$ are given by: + +$$ +D _ {1} := (1 + \beta + \gamma) +$$ + +$$ +D _ {2} := (1 + \beta^ {- 1} + \delta) + (1 + \gamma^ {- 1} + \delta^ {- 1}) (1 + \eta) +$$ + +$$ +D _ {3} := (1 + \gamma^ {- 1} + \delta^ {- 1}) (1 + \eta^ {- 1}) +$$ + +# 4.2. Main result + +Our main result is a bound on the evolution of the Lyapunov function $T^k$ along the steps of SRG. + +Theorem 4.3. Suppose that $(x_{k},(g_{k}^{i})_{i = 1}^{n})$ evolves according to Algorithm 1. Further, assume that for all $k\in \mathbb{N}$ (i) $\alpha_{k} / \theta_{k}$ is non-increasing. (ii) $\theta_{k}\in (0,1 / 2]$ (iii) $\alpha_{k}\leq \theta_{k} / 12L_{max}$ . Then: + +$$ +\mathbb {E} \left[ T ^ {k + 1} \right] \leq (1 - \rho_ {k}) \mathbb {E} \left[ T ^ {k} \right] + (1 + 2 \theta_ {k}) 6 \alpha_ {k} ^ {2} \sigma_ {*} ^ {2} +$$ + +for all $k\in \mathbb{N}$ , and where: + +$$ +\rho_ {k} := \min \left\{\frac {\theta_ {k}}{1 2 n}, \alpha_ {k} \mu \right\} +$$ + +The constants $(1 / 12$ in the bound on the step size and in $\rho_{k}$ , 6 in front of the $\sigma_{*}^{2}$ term) in this theorem are optimized under the following constraints. First, the parameterized form of the above bound shows that the largest allowable step size is given by $c_{2}\theta_{k} / L_{\mathrm{max}}$ . Using it we get: + +$$ +\rho_ {k} = \min \left\{c _ {1} \frac {\theta_ {k}}{n}, c _ {2} \frac {\theta_ {k}}{\kappa_ {\max}} \right\} +$$ + +for some constants $c_{1}, c_{2} > 0$ . As we do not know a priori the relative magnitudes of $n$ and $\kappa_{\mathrm{max}}$ , and since $c_{1}$ and $c_{2}$ are inversely proportional, we impose the constraint $c_{1} = c_{2}$ . Similarly, our parameterized bound gives an asymptotic error of the form $(1 + 2\theta_{k})c_{3}\alpha_{k}^{2}\sigma_{*}^{2}$ for a constant $c_{3}$ . We chose to impose the constraint $c_{3} = 6$ . $c_{1}, c_{2}$ and $c_{3}$ are all functions of the free parameters of Lemma 4.2 and the constant $a$ of the Lyapunov function (9). Numerically maximizing $c_{2}$ (and therefore the largest allowable step size) subject to these two constraints ( $c_{3} = 6$ and $c_{1} = c_{2}$ ) with respect to these parameters yields the result in Theorem 4.3. + +To give the reader an idea of the sensitivity of the result to the choice of $c_{3}$ , note that setting $c_{3} = 2$ yields $c_{2} \approx 1/20$ , whereas taking $c_{3} \gg 1$ yields $c_{2} \approx 1/10$ . We have attempted to obtain the best bound possible on the largest step size allowable, but the rather small prefactor $c_{2} = 1/12$ seems to be an inevitable consequence of the multiple (but as far as we can tell necessary) uses of Young's inequality in our analysis. Our experiments suggest that the dependence of the largest step size allowable on the mixture coefficient + +$\theta$ is real, but that the prefactor $c_{2} = 1 / 12$ may be an artifact of the analysis. + +For SRG with constant mixture coefficient and step size, its convergence rate and complexity are given by the following corollary of Theorem 4.3: + +Corollary 4.4. Suppose that $(x_{k},(g_{k}^{i})_{i = 1}^{n})$ evolves according to Algorithm 1 with a constant mixture coefficient $\theta_{k} = \theta \in (0,1 / 2]$ and a constant step size $\alpha_{k} = \alpha \leq \theta /12L_{max}$ . Then for any $k\in \mathbb{N}$ : + +$$ +\mathbb {E} \left[ T ^ {k} \right] \leq (1 - \rho) ^ {k} T ^ {0} + (1 + 2 \theta) \frac {6 \alpha^ {2} \sigma_ {*} ^ {2}}{\rho} +$$ + +where $\rho = \rho_{k}$ is as defined in Theorem 4.3. For any $\varepsilon >0$ and $\theta \in (0,1 / 2]$ , choosing: + +$$ +\alpha = \min \left\{\frac {\theta}{1 2 L _ {m a x}}, \frac {\varepsilon \mu}{(1 + 2 \theta) 1 2 \sigma_ {*} ^ {2}}, \sqrt {\frac {\theta}{1 + 2 \theta} \frac {\varepsilon}{1 4 4 n \sigma_ {*} ^ {2}}} \right\} +$$ + +and: + +$$ +k \geq \max \left\{\frac {1 2 n}{\theta}, \frac {1}{\alpha \mu} \right\} \log \left(\frac {2 T ^ {0}}{\varepsilon}\right) +$$ + +guarantees $\mathbb{E}\left[\| x_k - x^*\| _2^2\right]\leq \varepsilon$ + +Comparing the convergence rate of SRG in Corollary 4.4 with the standard result for SGD (Needell et al., 2014), we see that they are of similar form. When $\rho = \alpha \mu$ , the bound of Corollary 4.4 is better asymptotically. Indeed, in this case, and as $k \to \infty$ , the iterates of SRG stay within a ball of radius $O(\sqrt{\sigma_{*}^{2}})$ of the minimizer, while those of SGD stay within a ball of radius $O(\sqrt{\sigma^{2}})$ . The equality $\rho = \alpha \mu$ holds when $\alpha \leq 1 / n\mu$ , which is true for all allowable step sizes if the problem is dominated by its maximum condition number $\kappa_{\max} \geq n$ , and for smaller step sizes otherwise. + +In terms of complexity, we have the following comparison. Up to constants, the complexity of SRG with a constant mixture coefficient and step size is of the form: + +$$ +O \left(n + \sqrt {\frac {n \sigma_ {*} ^ {2}}{\mu^ {2} \varepsilon}} + \kappa_ {\max } + \frac {\sigma_ {*} ^ {2}}{\mu^ {2} \varepsilon}\right) \log \left(\frac {1}{\varepsilon}\right) +$$ + +We compare this to the complexity of SGD with constant step size (Needell et al., 2014): + +$$ +O \left(\kappa_ {\max } + \frac {\sigma^ {2}}{\mu^ {2} \varepsilon}\right) \log \left(\frac {1}{\varepsilon}\right) +$$ + +In the high accuracy regime, the $\varepsilon^{-1}$ terms dominate the complexities of SRG and SGD. In this case, SRG enjoys a better complexity than SGD since $\sigma_{*}^{2} \leq \sigma^{2}$ . + +# Algorithm 2 SRG+ + +Parameters: step sizes $(\alpha_{k})_{k = 0}^{\infty} > 0$ mixture coefficients $(\theta_{k})_{k = 0}^{\infty}\in (0,1]$ + +Initialization: $x_0\in \mathbb{R}^d$ $(\left\| g_0^i\right\| _2)_i^{n}\in \mathbb{R}^n$ + +for $k = 0,1,2,\ldots$ do + +$$ +p _ {k} = (1 - \theta_ {k}) q _ {k} + \theta_ {k} v +$$ + +$\{q_{k}$ is given by (6), $v$ is given by (12)} + +$b_{k}\sim$ Bernoulli $(\theta_{k})$ + +if $b_{k} = 1$ then $(i_k,j_k)\sim \pi$ else $i_k\sim q_k$ + +$\{\pi$ maximally couples $(v,1 / n)\}$ + +$$ +x _ {k + 1} = x _ {k} - \alpha_ {k} \frac {1}{n p _ {k} ^ {i _ {k}}} \nabla f _ {i _ {k}} (x _ {k}) +$$ + +$$ +\left\| g _ {k + 1} ^ {j} \right\| _ {2} = \left\{ \begin{array}{l l} \| \nabla f _ {j} (x _ {k}) \| _ {2} & \text {i f b _ {k} = 1 a n d j = j _ {k}} \\ \left\| g _ {k} ^ {j} \right\| _ {2} & \text {o t h e r w i s e} \end{array} \right. +$$ + +end for + +# 5. Extension + +In this section, we extend SRG to combine its variance reduction capacity with the preconditioning ability of smoothness-based importance sampling. + +A straightforward way to generalize the argument given in the derivation of SRG in section 3 is to consider the following bound on the conditional variance (3) of the gradient estimator, which can be derived from Young's inequality and the $L_{i}$ -smoothness of each $f_{i}$ : + +$$ +\begin{array}{l} \sigma^ {2} (x _ {k}, p) \leq \frac {3}{n ^ {2}} \sum_ {i = 1} ^ {n} \frac {L _ {i}}{p ^ {i}} \langle \nabla f _ {i} (x _ {k}) - \nabla f _ {i} (x ^ {*}), x _ {k} - x ^ {*} \rangle \\ + \frac {3}{n ^ {2}} \sum_ {i = 1} ^ {n} \frac {1}{p ^ {i}} \left\| g _ {k} ^ {i} - \nabla f _ {i} \left(x ^ {*}\right) \right\| _ {2} ^ {2} + 3 \tilde {\sigma} ^ {2} \left(x _ {k}, p\right) \tag {10} \\ \end{array} +$$ + +While the motivating bound (7) seems more intuitive, because we think of $g_{k}^{i}$ as tracking $\nabla f_{i}(x_{k})$ , it turns out that this second bound better captures the evolution of $g_{k}^{i}$ in relation to $\nabla f_{i}(x_{k})$ . At a high-level, this is because $g_{k}^{i}$ tracks $\nabla f_{i}(x_{k})$ indirectly: both hover around $\nabla f_{i}(x^{*})$ as $k$ gets large. + +Similar to our approach in section 3, our goal is to pick $p_k$ that minimizes the right-hand side of (10). We know that $q_k$ (6) minimizes the third term, but we need to make sure that the first two are also small. To minimize the first term, knowing nothing about the relative sizes of the inner product terms, it makes sense to have probabilities proportional to the smoothness constants1. On the other hand, to keep the second term small, we need to ensure that the historical + +gradients $(g_k^i)_{i=1}^n$ are frequently updated, which we can do by imposing a uniform lower bound on the probabilities. These considerations motivate us to consider the following distributions: + +$$ +p _ {k} ^ {\prime} = \left(1 - \eta_ {k} - \theta_ {k}\right) q _ {k} + \eta_ {k} v + \frac {\theta_ {k}}{n} \tag {11} +$$ + +for positive mixture coefficients $(\theta_{k},\eta_{k})$ satisfying $\theta_{k} + \eta_{k}\in (0,1]$ , and where $v$ is given by: + +$$ +v = \left(\frac {L _ {i}}{n \bar {L}}\right) _ {i = 1} ^ {n} \tag {12} +$$ + +Using these probabilities, we are able to show that the resulting algorithm does indeed achieve both variance reduction and preconditioning. However, in the worst case, its complexity is twice as much as what we would expect from simply replacing $L_{\mathrm{max}}$ with $\overline{L}$ in Corollary 4.4. Intuitively, this is because the probability assigned to the uniform component in (8) needs to be split between the uniform and the smoothness-based components in (11). + +# 5.1. Carefully decoupling the updates of $(g_k^i)_{i=1}^n$ and $x_k$ + +Here we show how to design our algorithm such that this additional factor of 2 (described above) in the complexity is reduced to: + +$$ +1 + \| v - 1 / n \| _ {T V} \leq 2 - 1 / n +$$ + +which is usually much closer to 1 in practical settings where the smoothness constants are roughly on the same scale. Following (Schmidt et al., 2015), our method is based on the observation that we can decouple the index used to update the historical gradients and the index used to update the iterates, which we refer to as $j_{k}$ and $i_{k}$ , respectively. Intuitively, to minimize (10) we would ideally want $j_{k}$ to be uniformly distributed and $i_{k}$ to be distributed according to $p_{k} = (1 - \theta_{k})q_{k} + \theta_{k}v$ . Unfortunately, sampling $(j_{k},i_{k})$ independently with these marginals does not address our issue, because we would still require an average of approximately two gradient evaluations per iteration. + +Our main observation is that we can use any coupling between $(j_{k},i_{k})$ , because the evolution of the expectation of the Lyapunov function (9) only depends on their marginal distributions and not on their joint. In particular, we obtain the same bound on the evolution of $\mathbb{E}\left[T^k\right]$ regardless of how $i_k$ and $j_{k}$ are coupled. It therefore makes sense to pick the coupling that maximizes the probability that $i_{k} = j_{k}$ , since this minimizes the number of gradient evaluations required per iteration. Such couplings are known as maximal couplings in the literature, and can easily be computed for discrete random variables (see, e.g., Algorithm 5 in Biswas et al. (2019)). With a maximal coupling, + +the expected number of gradient evaluations per iteration becomes $1 + \| v - 1 / n\|_{TV}$ . Using one such coupling leads to $\mathrm{SRG+}$ described in Algorithm 2. + +Let us briefly discuss the implementation of $\mathrm{SRG + }$ . Sampling from $\pi$ , a maximal coupling of $v$ and the uniform distribution, requires forming three probability vectors (see Algorithm 5 in Biswas et al. (2019) for details). As both $v$ and $1 / n$ are constant throughout the optimization process, we can form these vectors at the beginning of the algorithm along with their partial sums for a total initial cost of $O(n)$ operations. We can then sample from $\pi$ in $O(\log n)$ time using binary search on the partial sums at each iteration. The overhead of $\mathrm{SRG + }$ is therefore the same as that of SRG. + +# 5.2. Analysis + +The analysis of $\mathrm{SRG + }$ is similar to that of SRG. In particular, the iterates of $\mathrm{SRG + }$ also obey a slight modification of Theorem 4.3 where the bound on the largest allowable step size is loosened to $\alpha_{k}\leq \theta_{k} / 12\overline{L}$ . We refer the reader to Appendix C for more details. Due to this improvement, we get that the complexity of $\mathrm{SRG + }$ with a constant mixture coefficient and step size is given by: + +$$ +O \left(n + \sqrt {\frac {n \sigma_ {*} ^ {2}}{\mu \varepsilon}} + \overline {{\kappa}} + \frac {\sigma_ {*} ^ {2}}{\mu^ {2} \varepsilon}\right) \log \left(\frac {1}{\varepsilon}\right) +$$ + +This shows that $\mathrm{SRG+}$ performs both variance reduction as shown by the dependence of the complexity on $\sigma_{*}^{2}$ instead of $\sigma^2$ and preconditioning as shown by the dependence on $\overline{\kappa}$ instead of $\kappa_{\max}$ . + +# 6. Related work + +At a high-level, three lines of work exist that study the use of importance sampling with SGD. The first one considers fixed importance sampling distributions based on the constants of the problem (Needell et al., 2014; Zhao & Zhang, 2015; Gower et al., 2019), and shows that such a strategy leads to improved conditioning of the problem. The second considers adaptive importance sampling and similar to our work targets the variance of the gradient estimator, but generally fails at providing strong convergence rate guarantees under standard assumptions (Papa et al., 2015; Gopal, 2016; Alain et al., 2016; Canevet et al., 2016; Yuan et al., 2016; Stich et al., 2017; Katharopoulos & Fleuret, 2018; Johnson & Guestrin, 2018; Liu et al., 2021). The third line of work frames the problem as an online learning problem with bandit feedback and provides guarantees on the regret of the proposed distributions in terms of the variance of the resulting gradient estimators (Namkoong et al., 2017; Salehi et al., 2017; Borsos et al., 2018; 2019; El Hanchi & Stephens, 2020). Our main method is very closely related to the one proposed by (Papa et al., 2015); the main + +result of their analysis however is asymptotic in nature. (Liu et al., 2021) provide a non-asymptotic analysis of the algorithm proposed by (Papa et al., 2015), but under strong and non-standard assumptions. To the best of our knowledge, our work is the first to provide non-asymptotic guarantees on the suboptimality of the iterates for variance-reducing importance sampling under standard technical assumptions. + +# 7. Experiments + +In this section, we empirically verify our two main claims: (i) SRG performs variance reduction which can improve the asymptotic error of SGD. (ii) $\mathrm{SRG + }$ performs both variance reduction and preconditioning, and can both reduce the asymptotic error of SGD and allow the use of larger step sizes. We start with controlled synthetic experiments that provide direct support for our claims. We then compare SRG to other baseline optimizers on $\ell_2$ -regularized logistic regression problems. In all experiments, we ran each algorithm 10 times and present the averaged result. + +# 7.1. Synthetic experiments + +For our first experiment, we consider the following toy problem. We let $x \in \mathbb{R}$ and $f_{i}(x) = \frac{1}{2} (x - a_{i})^{2}$ where $a_{i} = 0$ for $i \in [n - 1]$ and $a_{n} = 1$ . In this case, $x^{*} = 1 / n$ , $\sigma^2 \approx 1 / n$ , and $\sigma_{*}^{2} \approx 4 / n^{2}$ . We consider five instantiations of this problem with $n \in \{8, 16, 32, 64, 128\}$ , yielding ratios $\sigma^2 / \sigma_*^2$ approximately in $\{2, 4, 8, 16, 32\}$ . For each instantiation, we ran SGD and SRG until they reached stationarity and recorded their asymptotic errors $\lim_{k \to \infty} \mathbb{E}\left[\|x_k - x^*\|_2^2\right]$ , which we denote by $\Delta_{SGD}$ and $\Delta_{SRG}$ respectively. We experimented with three different step sizes, two of them allowed by Corollary 4.4, and one larger one for which we can only prove that SRG has a similar convergence guarantee as SGD. For SRG, we used the mixture coefficient $\theta = 1 / 2$ . + +We plot $\Delta_{SGD} / \Delta_{SRG}$ against $\sigma^2 /\sigma_*^2$ in Figure 1 (left) for each of the three step sizes, from which we see that the relationship between the two ratios is linear, and very close to identity. From an asymptotic error point of view, these results support our theory in that the improvement is seen to be directly proportional to the ratio $\sigma^2 /\sigma_*^2$ . On the other hand, the constant $6(1 + 2\theta) / \rho$ in Corollary 4.4 would suggest that the proportionality constant is much smaller than 1, particularly when $n$ is large, but this is not what we observe in practice. This could be because the first term of the Lyapunov function (9) is quite large at stationarity, or because the constants in our bound are not sharp due to the multiple uses of Young's inequality. This latter possibility is further supported by the fact that we see a similar behaviour for SRG for step sizes larger than the ones allowed by our theory. We have consistently made these two observations + +![](images/e0e44c46790cc2f6d87e27c0d1b44fd49d1900e958d4ac06f06bab260d2ab0a7.jpg) +Figure 1: Left: Linear dependence of $\Delta_{SGD} / \Delta_{SRG}$ , the ratio of asymptotic errors of SGD and SRG, on $\sigma^2 / \sigma_*^2$ , the ratio of the uniform and optimal variances at the minimum. Right: $\mathrm{SRG+}$ achieves smaller asymptotic error than both SGD with $L_i$ -sampling (SGD+) and SGD with partially biased sampling (SGD++) while using large $O(1 / \overline{L})$ step sizes just like SGD+ and SGD++. + +![](images/5d7b82b0a4ebafdd9469b80be3264df4c0a7c48321e72f7d66a406ac0f72eb8b.jpg) + +in other experiments. It is however unclear to us how our analysis can be improved to match these observations. + +For our second experiment, we considered the following problem. We let $x \in \mathbb{R}$ and $f_{i}(x) = \frac{1}{2} L_{i}(x - a_{i})^{2}$ , and fixed $n = 20$ . Similar to the first experiment, we take $a_{i} = 0$ for $i \in [n - 1]$ and $a_{n} = 1$ . We then set $L_{1} = n - 1$ , $L_{n} = 1 / n$ , and $L_{i} = \frac{n - 1}{n(n - 2)}$ , so that $\overline{L} = 1$ , $L_{\max} = n - 1$ . In this case, we get $x^{*} = 1 / n^{2}$ , $\sigma_{+}^{2} := \sigma^{2}(x^{*}, v) \approx 1 / n$ , $\sigma^{2} \approx 2 / n^{2}$ , and $\sigma_{*}^{2} \approx 4 / n^{3}$ . We then ran SGD with $L_{i}$ -sampling (SGD+), SGD with partially biased sampling (SGD++, Needell et al. (2014)), and SRG+, all with the largest allowable step size $\alpha = \theta / 12\overline{L}$ from our theory for SRG+, and we use the mixture coefficient $\theta = 1 / 2$ for both SRG+ and SGD++. We have obtained very similar results when using the larger step size $\alpha = \theta / 2\overline{L}$ , which is the maximum allowable for SGD++. + +We plot the relative error $\mathbb{E}\left[\| x_k - x^*\| _2^2\right] / \| x_0 - x^*\| _2^2$ for each algorithm against the number of gradient oracle calls it makes in Figure 1 (right). We see that all three algorithms are able to converge even when using the large $O(1 / \overline{L})$ step sizes. The theory of $\mathrm{SGD + }$ allows for larger step sizes compared to SGD, but the asymptotic error of the algorithm depends on $\sigma_{+}^{2}$ (Needell et al., 2014), which can be up to $n$ times bigger than $\sigma^2$ . To solve this problem, Needell et al. (2014) proposed partially biased sampling $(\mathrm{SGD}++)$ which mixes the smoothness-based distribution with uniform sampling, allowing the use of larger step sizes just like $\mathrm{SGD + }$ , but preserving the asymptotic error of SGD. SRG+ further improves on $\mathrm{SGD + + }$ , and reduces the asymptotic error, making it proportional to $\sigma_{*}^{2}$ . + +# 7.2. $\ell_2$ -regularized logistic regression + +For our last experiment, we test SRG on $\ell_2$ -regularized logistic regression problems. In this case, the functions $f_{i}$ + +are given by: + +$$ +f _ {i} (x) := \log \left(1 + \exp \left(- y _ {i} a _ {i} ^ {T} x\right)\right) + \frac {\mu}{2} \| x \| _ {2} ^ {2} +$$ + +where $y_{i}\in \{-1,1\}$ is the label of data point $a_i\in \mathbb{R}^d$ Each $f_{i}$ is convex and $L_{i} = 0.25\| a_{i}\|_{2}^{2} + \mu$ smooth. Their average $F$ is also $\mu$ -strongly convex. As is standard, we select $\mu = 1 / n$ + +We experiment with SRG on four datasets from LIBSVM (Chang & Lin, 2011): ijCNN1, w8a, mushrooms and phishing. For each dataset, and to be able to efficiently run our experiments, we randomly select a subset of the data of size $n = 1000$ . As the datasets are normalized, we have that $\| a_i\|_2 = 1$ for all $i \in [n]$ . This makes $L_{i} = L = 0.25 + \mu$ , which reduces SGD+ to SGD, and SRG+ to SRG. + +We tested the performance of SRG against three baselines, the first of which is standard SGD. The second is SGD with the optimal conditional-variance-minimizing probabilities $p_k^i \propto \| \nabla f_i(x_k) \|_2$ , which allows us to compare SRG with the best possible variance-reducing importance sampling scheme. The last baseline is SGD with random shuffling, which is also known to improve the asymptotic error of SGD (Mishchenko et al., 2020). We evaluate the performance of the algorithms by tracking the average relative error $\mathbb{E}\left[\| x_k - x^*\|_2^2\right] / \| x_0 - x^*\|_2^2$ . We used the mixture coefficient $\theta = 1/2$ for SRG, and used the same step size $\alpha = \theta / 2L$ for all algorithms. + +The results of this experiment are shown in Figure 2. We observe that SRG consistently outperforms SGD on all datasets, and that it closely matches the performance of SGD with the variance-minimizing distributions, which it tries to approximate. We also see that SRG outperforms + +![](images/11510128abc4d277f25a193a03308e15b035122b9a13fefea5fb497bec07715b.jpg) +Figure 2: Comparison of the evolution of the average relative error $\| x_{k} - x^{*}\|_{2}^{2} / \| x_{0} - x^{*}\|_{2}^{2}$ for different optimizers on $\ell_2$ -regularized logistic regression problems using the datasets ijCNN1, w8a, mushrooms, phishing. We compare SRG (orange) with SGD (blue), SGD with random shuffling (purple), and SGD with the optimal variance-minimizing distributions at each iteration (green). + +SGD with random shuffling on two datasets, and is competitive with it on the remaining two. + +# 8. Conclusion + +We introduced SRG, a new importance-sampling based stochastic optimization algorithm for finite-sum problems that reduces the variance of the gradient estimator. We analyzed its convergence rate in the strongly convex and smooth case, and showed that it can improve on the asymptotic error of SGD. We also introduced $\mathrm{SRG + }$ , an extension of SRG which simultaneously performs variance reduction and preconditioning through importance sampling. We expect our algorithms to be most useful in the medium accuracy regime, where the required accuracy is higher than the one achieved by SGD, but low enough that the overhead of classical variance reduced methods becomes significant. Finally, an interesting future direction would be to explore non-greedy strategies for the design of importance sampling distributions for SGD that not only minimize the variance of the current gradient estimator, but also take into account the variance of the gradient estimators of subsequent iterations. + +# References + +Alain, G., Lamb, A., Sankar, C., Courville, A., and Bengio, Y. Variance Reduction in SGD by Distributed Importance Sampling. arXiv:1511.06481 [cs, stat], April 2016. arXiv: 1511.06481. +Biswas, N., Jacob, P. E., and Vanetti, P. Estimating Convergence of Markov chains with L-Lag Couplings. Advances in Neural Information Processing Systems, 32, 2019. +Borsos, Z., Krause, A., and Levy, K. Y. Online Variance Reduction for Stochastic Optimization. In Conference On Learning Theory, pp. 324-357. PMLR, July 2018. ISSN: 2640-3498. +Borsos, Z., Curi, S., Levy, K. Y., and Krause, A. Online Variance Reduction with Mixtures. In International Conference on Machine Learning, pp. 705-714. PMLR, May 2019. ISSN: 2640-3498. +Canevet, O., Jose, C., and Fleuret, F. Importance Sampling Tree for Large-scale Empirical Expectation. In International Conference on Machine Learning, pp. 1454-1462. PMLR, June 2016. ISSN: 1938-7228. +Chang, C.-C. and Lin, C.-J. Libsvm: A library for support vector machines. ACM Trans. Intell. Syst. Technol., 2(3), May 2011. +Defazio, A. A Simple Practical Accelerated Method for Finite Sums. Advances in Neural Information Processing Systems, 29:676-684, 2016. +Defazio, A. and Bottou, L. On the Ineffectiveness of Variance Reduced Optimization for Deep Learning. Advances in Neural Information Processing Systems, 32: 1755-1765, 2019. +Defazio, A., Bach, F., and Lacoste-Julien, S. SAGA: A Fast Incremental Gradient Method With Support for Non-Strongly Convex Composite Objectives. Advances in + +Neural Information Processing Systems, 27:1646-1654, 2014. +El Hanchi, A. and Stephens, D. Adaptive Importance Sampling for Finite-Sum Optimization and Sampling with Decreasing Step-Sizes. Advances in Neural Information Processing Systems, 33, 2020. +Gopal, S. Adaptive Sampling for SGD by Exploiting Side Information. In International Conference on Machine Learning, pp. 364-372. PMLR, June 2016. ISSN: 1938-7228. +Gower, R. M., Loizou, N., Qian, X., Sailanbayev, A., Shulgin, E., and Richtárik, P. SGD: General Analysis and Improved Rates. In International Conference on Machine Learning, pp. 5200-5209. PMLR, May 2019. ISSN: 2640-3498. +Hofmann, T., Lucchi, A., Lacoste-Julien, S., and McWilliams, B. Variance Reduced Stochastic Gradient Descent with Neighbors. Advances in Neural Information Processing Systems, 28:2305-2313, 2015. +Johnson, R. and Zhang, T. Accelerating Stochastic Gradient Descent using Predictive Variance Reduction. Advances in Neural Information Processing Systems, 26:315-323, 2013. +Johnson, T. B. and Guestrin, C. Training Deep Models Faster with Robust, Approximate Importance Sampling. Advances in Neural Information Processing Systems, 31: 7265-7275, 2018. +Katharopoulos, A. and Fleuret, F. Not All Samples Are Created Equal: Deep Learning with Importance Sampling. In International Conference on Machine Learning, pp. 2525-2534. PMLR, July 2018. ISSN: 2640-3498. +Liu, H., Wang, X., Li, J., and So, A. M.-C. Low-Cost Lipschitz-Independent Adaptive Importance Sampling of Stochastic Gradients. In 2020 25th International Conference on Pattern Recognition (ICPR), pp. 2150-2157, Milan, Italy, January 2021. IEEE. +Mishchenko, K., Khaled Ragab Bayoumi, A., and Richtarik, P. Random Reshuffling: Simple Analysis with Vast Improvements. Advances in Neural Information Processing Systems, 33, 2020. +Namkoong, H., Sinha, A., Yadlowsky, S., and Duchi, J. C. Adaptive Sampling Probabilities for Non-Smooth Optimization. In International Conference on Machine Learning, pp. 2574-2583. PMLR, July 2017. ISSN: 2640-3498. +Needell, D., Ward, R., and Srebro, N. Stochastic Gradient Descent, Weighted Sampling, and the Randomized Kaczmarz algorithm. Advances in Neural Information Processing Systems, 27:1017-1025, 2014. + +Nesterov, Y. Introductory Lectures on Convex Optimization: A Basic Course. Applied Optimization. Springer US, 2004. +Papa, G., Bianchi, P., and Clémenton, S. Adaptive Sampling for Incremental Optimization Using Stochastic Gradient Descent. In Chaudhuri, K., GENTILE, C., and Zilles, S. (eds.), Algorithmic Learning Theory, Lecture Notes in Computer Science, pp. 317-331, Cham, 2015. Springer International Publishing. +Robbins, H. and Monro, S. A Stochastic Approximation Method. Annals of Mathematical Statistics, 22(3):400-407, September 1951. Publisher: Institute of Mathematical Statistics. +Roux, N., Schmidt, M., and Bach, F. A Stochastic Gradient Method with an Exponential Convergence rate for Finite Training Sets. Advances in Neural Information Processing Systems, 25:2663-2671, 2012. +Salehi, F., Celis, L. E., and Thiran, P. Stochastic Optimization with Bandit Sampling. arXiv preprint arXiv:1708.02544, August 2017. +Schmidt, M., Babanezhad, R., Ahmed, M., Defazio, A., Clifton, A., and Sarkar, A. Non-Uniform Stochastic Average Gradient Method for Training Conditional Random Fields. In Artificial Intelligence and Statistics, pp. 819-828. PMLR, February 2015. ISSN: 1938-7228. +Schmidt, M., Le Roux, N., and Bach, F. Minimizing finite sums with the stochastic average gradient. Mathematical Programming, 162(1):83-112, March 2017. +Stich, S. U., Raj, A., and Jaggi, M. Safe Adaptive Importance Sampling. Advances in Neural Information Processing Systems, 30:4381-4391, 2017. +Yuan, K., Ying, B., Vlaski, S., and Sayed, A. H. Stochastic gradient descent with finite samples sizes. In 2016 IEEE 26th International Workshop on Machine Learning for Signal Processing (MLSP), pp. 1-6. IEEE, 2016. +Zhao, P. and Zhang, T. Stochastic Optimization with Importance Sampling for Regularized Loss Minimization. In International Conference on Machine Learning, pp. 1-9. PMLR, June 2015. ISSN: 1938-7228. + +# Supplementary material + +# A. Preliminaries + +Lemma A.1. For all $i \in [n]$ , assume that $f_i$ is convex and $L_i$ -smooth. Then we have: + +$$ +\frac {1}{n} \sum_ {i = 1} ^ {n} \| \nabla f _ {i} (x) - \nabla f _ {i} \left(x ^ {*}\right) \| _ {2} ^ {2} \leq 2 L _ {\max } [ F (x) - F \left(x ^ {*}\right) ] +$$ + +$$ +\frac {1}{n} \sum_ {i = 1} ^ {n} \frac {\overline {{L}}}{L _ {i}} \| \nabla f _ {i} (x) - \nabla f _ {i} (x ^ {*}) \| _ {2} ^ {2} \leq 2 \overline {{L}} [ F (x) - F (x ^ {*}) ] +$$ + +Proof. By the convexity and smoothness assumptions on the functions $\{f_i\}_{i=1}^n$ , and Theorem 2.1.5 in (Nesterov, 2004) we have for all $i \in [n]$ : + +$$ +f _ {i} (x) \geq f _ {i} (x ^ {*}) + \langle \nabla f _ {i} (x ^ {*}), x - x ^ {*} \rangle + \frac {1}{2 L _ {i}} \| \nabla f _ {i} (x) - \nabla f _ {i} (x ^ {*}) \| _ {2} ^ {2} +$$ + +Rearranging gives: + +$$ +\left\| \nabla f _ {i} (x) - \nabla f _ {i} \left(x ^ {*}\right) \right\| _ {2} ^ {2} \leq 2 L _ {i} \left[ f _ {i} (x) - f _ {i} \left(x ^ {*}\right) - \left\langle \nabla f _ {i} \left(x ^ {*}\right), x - x ^ {*} \right\rangle \right] +$$ + +Using $L_{i}\leq L_{\mathrm{max}}$ , averaging over $i\in [n]$ , and noticing that $\frac{1}{n}\sum_{i = 1}^{n}\nabla f_i(x^*) = \nabla F(x^*) = 0$ , we get the first inequality. For the second, we first divide both sides by $\overline{L} /L_{i}$ , then average over $i\in [n]$ and notice that $\frac{1}{n}\sum_{i = 1}^{n}\nabla f_i(x^*) = \nabla F(x^*) = 0$ to get the inequality. + +# B. Analysis of SRG + +We study the convergence rate of SRG by studying the one-step evolution of the Lyapunov function: + +$$ +T ^ {k} = T (x _ {k}, (g _ {k} ^ {i}) _ {i = 1} ^ {n}) := \frac {\alpha_ {k}}{\theta_ {k}} \frac {a}{L _ {\mathrm {m a x}}} \sum_ {i = 1} ^ {n} \left\| g _ {k} ^ {i} - \nabla f _ {i} (x ^ {*}) \right\| _ {2} ^ {2} + \| x _ {k} - x ^ {*} \| _ {2} ^ {2} +$$ + +We start by proving Lemma 4.1 which studies the evolution of the first term of $T^k$ . + +Lemma 4.1. Let $k \in \mathbb{N}$ and suppose that $(g_k^i)_{i=1}^n$ evolves as in Algorithm 1. Taking expectation with respect to $(b_k, i_k)$ , conditional on $(b_t, i_t)_{t=0}^{k-1}$ , we have: + +$$ +\begin{array}{l} \mathbb {E} \left[ \sum_ {i = 1} ^ {n} \left\| g _ {k + 1} ^ {i} - \nabla f _ {i} \left(x ^ {*}\right) \right\| _ {2} ^ {2} \right] \leq 2 \theta_ {k} L _ {\max } \left[ F \left(x _ {k}\right) - F \left(x ^ {*}\right) \right] \\ + \left(1 - \frac {\theta_ {k}}{n}\right) \sum_ {i = 1} ^ {n} \left\| g _ {k} ^ {i} - \nabla f _ {i} \left(x ^ {*}\right) \right\| _ {2} ^ {2} \\ \end{array} +$$ + +Proof. Taking expectation with respect to $(b_{k},i_{k})$ conditional on $(b_{t},i_{t})_{t = 1}^{k - 1}$ we have: + +$$ +\begin{array}{l} \mathbb {E} \left[ \sum_ {i = 1} ^ {n} \left| \left| g _ {k + 1} ^ {i} - \nabla f _ {i} (x ^ {*}) \right| \right| _ {2} ^ {2} \right] \\ = \mathbb {P} \left(b _ {k} = 0\right) \sum_ {j = 1} ^ {n} \mathbb {P} \left(i _ {k} = j \mid b _ {k} = 0\right) \left(\sum_ {i = 1} ^ {n} \left\| g _ {k} ^ {i} - \nabla f _ {i} \left(x ^ {*}\right) \right\| _ {2} ^ {2}\right) \\ + \mathbb {P} (b _ {k} = 1) \sum_ {j = 1} ^ {n} \mathbb {P} (i _ {k} = j \mid b _ {k} = 1) \left(\sum_ {\substack {i = 1 \\ i \neq j}} ^ {n} \left| \left| g _ {k} ^ {i} - \nabla f _ {i} (x ^ {*}) \right| \right| _ {2} ^ {2} + \| \nabla f _ {j} (x _ {k}) - \nabla f _ {j} (x ^ {*}) \| _ {2} ^ {2}\right) \\ = \left(1 - \theta_ {k}\right) \sum_ {j = 1} ^ {n} q _ {k} ^ {j} \left(\sum_ {i = 1} ^ {n} \left\| g _ {k} ^ {i} - \nabla f _ {i} \left(x ^ {*}\right) \right\| _ {2} ^ {2}\right) \\ + \theta_ {k} \sum_ {j = 1} ^ {n} \frac {1}{n} \left(\sum_ {i = 1} ^ {n} \left\| g _ {k} ^ {i} - \nabla f _ {i} \left(x ^ {*}\right) \right\| _ {2} ^ {2} - \left\| g _ {k} ^ {j} - \nabla f _ {j} \left(x ^ {*}\right) \right\| _ {2} ^ {2} + \| \nabla f _ {j} \left(x _ {k}\right) - \nabla f _ {j} \left(x ^ {*}\right) \| _ {2} ^ {2}\right) \\ = \left(1 - \frac {\theta_ {k}}{n}\right) \left(\sum_ {i = 1} ^ {n} \left\| g _ {k} ^ {i} - \nabla f _ {i} \left(x ^ {*}\right) \right\| _ {2} ^ {2}\right) + \frac {\theta_ {k}}{n} \sum_ {i = 1} ^ {n} \| \nabla f _ {i} \left(x _ {k}\right) - \nabla f _ {i} \left(x ^ {*}\right) \| _ {2} ^ {2} \\ \leq \left(1 - \frac {\theta_ {k}}{n}\right) \left(\sum_ {i = 1} ^ {n} \left\| g _ {k} ^ {i} - \nabla f _ {i} \left(x ^ {*}\right) \right\| _ {2} ^ {2}\right) + 2 \theta_ {k} L _ {\max } \left[ F \left(x _ {k}\right) - F \left(x ^ {*}\right) \right] \\ \end{array} +$$ + +where the first and second equalities follow from the update of $(g_k^i)_{i=1}^n$ in Algorithm 1, and the last inequality follows from the first inequality of Lemma A.1. + +The evolution of the second term of $T^k$ depends on the second moment of the gradient estimator. We prove Lemma 4.2 which gives us a bound on it. + +Lemma 4.2. Let $k \in \mathbb{N}$ and assume that $\theta_k \in (0,1/2]$ . Taking expectation with respect to $(b_k, i_k)$ , conditional on $(b_t, i_t)_{t=0}^{k-1}$ , we have, for all $\beta, \gamma, \delta, \eta > 0$ : + +$$ +\begin{array}{l} \underset {i _ {k} \sim p _ {k}} {\mathbb {E}} \left[ \left\| \frac {1}{n p _ {k} ^ {i _ {k}}} \nabla f _ {i _ {k}} \left(x _ {k}\right) \right\| _ {2} ^ {2} \right] \leq \frac {2 D _ {1} L _ {\max}}{\theta_ {k}} [ F (x _ {k}) - F ^ {*} ] \\ + \frac {D _ {2}}{\theta_ {k} n} \sum_ {i = 1} ^ {n} \left\| g _ {k} ^ {i} - \nabla f _ {i} (x ^ {*}) \right\| _ {2} ^ {2} + D _ {3} (1 + 2 \theta_ {k}) \sigma_ {*} ^ {2} \\ \end{array} +$$ + +where $D_{1}, D_{2}$ and $D_{3}$ are given by: + +$$ +\begin{array}{l} D _ {1} := (1 + \beta + \gamma) \\ D _ {2} := \left(1 + \beta^ {- 1} + \delta\right) + \left(1 + \gamma^ {- 1} + \delta^ {- 1}\right) (1 + \eta) \\ D _ {3} := (1 + \gamma^ {- 1} + \delta^ {- 1}) (1 + \eta^ {- 1}) \\ \end{array} +$$ + +Proof. Taking expectation with respect to $(i_k, b_k)$ conditional on $(i_t, b_t)_{t=1}^{k-1}$ we have: + +$$ +\mathbb {E} \left[ \left\| \frac {1}{n p _ {k} ^ {i _ {k}}} \nabla f _ {i _ {k}} (x _ {k}) \right\| _ {2} ^ {2} \right] = \frac {1}{n ^ {2}} \sum_ {i = 1} ^ {n} \frac {1}{p _ {k} ^ {i}} \| \nabla f _ {i} (x _ {k}) \| _ {2} ^ {2} +$$ + +Now by Young's inequality (Peter-Paul inequality): + +$$ +\begin{array}{l} \frac {1}{n ^ {2}} \sum_ {i = 1} ^ {n} \frac {1}{p _ {k} ^ {i}} \| \nabla f _ {i} (x _ {k}) \| _ {2} ^ {2} = \frac {1}{n ^ {2}} \sum_ {i = 1} ^ {n} \frac {1}{p _ {k} ^ {i}} \left\| \nabla f _ {i} (x _ {k}) - \nabla f _ {i} (x ^ {*}) + \nabla f _ {i} (x ^ {*}) - g _ {k} ^ {i} + g _ {k} ^ {i} \right\| _ {2} ^ {2} \\ \leq (1 + \beta + \gamma) \frac {1}{n ^ {2}} \sum_ {i = 1} ^ {n} \frac {1}{p _ {k} ^ {i}} \| \nabla f _ {i} \left(x _ {k}\right) - \nabla f _ {i} \left(x ^ {*}\right) \| _ {2} ^ {2} \\ + (1 + \beta^ {- 1} + \delta) \frac {1}{n ^ {2}} \sum_ {i = 1} ^ {n} \frac {1}{p _ {k} ^ {i}} \left\| g _ {k} ^ {i} - \nabla f _ {i} \left(x ^ {*}\right) \right\| _ {2} ^ {2} \\ + (1 + \gamma^ {- 1} + \delta^ {- 1}) \frac {1}{n ^ {2}} \sum_ {i = 1} ^ {n} \frac {1}{p _ {k} ^ {i}} \left\| g _ {k} ^ {i} \right\| _ {2} ^ {2} \\ \end{array} +$$ + +Let us bound each of the three terms. The first can be bound using $p_k \geq \theta_k / n$ and the first inequality of Lemma A.1: + +$$ +\frac {1}{n ^ {2}} \sum_ {i = 1} ^ {n} \frac {1}{p _ {k} ^ {i}} \| \nabla f _ {i} (x _ {k}) - \nabla f _ {i} (x ^ {*}) \| _ {2} ^ {2} \leq \frac {1}{\theta_ {k} n} \sum_ {i = 1} ^ {n} \| \nabla f _ {i} (x _ {k}) - \nabla f _ {i} (x ^ {*}) \| _ {2} ^ {2} \leq \frac {2 L _ {\max}}{\theta_ {k}} [ F (x _ {k}) - F (x ^ {*}) ] +$$ + +The second term is easily bound using $p_k \geq \theta_k / n$ : + +$$ +\frac {1}{n ^ {2}} \sum_ {i = 1} ^ {n} \frac {1}{p _ {k} ^ {i}} \left\| g _ {k} ^ {i} - \nabla f _ {i} (x ^ {*}) \right\| _ {2} ^ {2} \leq \frac {1}{\theta_ {k} n} \sum_ {i = 1} ^ {n} \left\| g _ {k} ^ {i} - \nabla f _ {i} (x ^ {*}) \right\| _ {2} ^ {2} +$$ + +Finally, the third term can be bounded by: + +$$ +\begin{array}{l} \frac {1}{n ^ {2}} \sum_ {i = 1} ^ {n} \frac {1}{p _ {k} ^ {i}} \left\| g _ {k} ^ {i} \right\| _ {2} ^ {2} \\ \leq \frac {1}{1 - \theta_ {k}} \frac {1}{n ^ {2}} \left(\sum_ {i = 1} ^ {n} \| g _ {k} ^ {i} \| _ {2}\right) ^ {2} \\ \leq \left(1 + 2 \theta_ {k}\right) \frac {1}{n ^ {2}} \left(\sum_ {i = 1} ^ {n} \left\| g _ {k} ^ {i} - \nabla f _ {i} \left(x ^ {*}\right) \right\| _ {2} + \sum_ {i = 1} ^ {n} \| \nabla f _ {i} \left(x ^ {*}\right) \| _ {2}\right) ^ {2} \\ \leq \left(1 + 2 \theta_ {k}\right) \left(1 + \eta\right) \frac {1}{n ^ {2}} \left(\sum_ {i = 1} ^ {n} \left\| g _ {k} ^ {i} - \nabla f _ {i} \left(x ^ {*}\right) \right\| _ {2}\right) ^ {2} + \left(1 + 2 \theta_ {k}\right) \left(1 + \eta^ {- 1}\right) \frac {1}{n ^ {2}} \left(\sum_ {i = 1} ^ {n} \| \nabla f _ {i} \left(x ^ {*}\right) \| _ {2}\right) ^ {2} \\ \leq \theta_ {k} (1 + 2 \theta_ {k}) (1 + \eta) \frac {1}{\theta_ {k} n} \sum_ {i = 1} ^ {n} \left\| g _ {k} ^ {i} - \nabla f _ {i} (x ^ {*}) \right\| _ {2} ^ {2} + (1 + 2 \theta_ {k}) (1 + \eta^ {- 1}) \sigma_ {*} ^ {2} \\ \leq (1 + \eta) \frac {1}{\theta_ {k} n} \sum_ {i = 1} ^ {n} \left| \left| g _ {k} ^ {i} - \nabla f _ {i} \left(x ^ {*}\right) \right| \right| _ {2} ^ {2} + (1 + 2 \theta_ {k}) (1 + \eta^ {- 1}) \sigma_ {*} ^ {2} \\ \end{array} +$$ + +Where the second line follows from the inequality $p_k \geq (1 - \theta_k) q_k$ and the definition of $q_k$ in (6), the third from the triangle inequality and the inequality $1 / (1 - \theta_k) < 1 + 2\theta_k$ which holds since $\theta_k \in (0, 1/2]$ by hypothesis. The fourth line follows by Young's inequality (Peter-Paul inequality). The fifth line follows from the definition of $\sigma_*^2$ and an application of Cauchy-Schwarz inequality: let $v$ be the vector whose $i^{th}$ component is $\left\| g_k^i - \nabla f_i(x^*) \right\|_2$ and let $1_n$ be the vector of ones. Then: + +$$ +\left(\sum_ {i = 1} ^ {n} \left\| g _ {k} ^ {i} - \nabla f _ {i} (x ^ {*}) \right\| _ {2}\right) ^ {2} = | \langle 1 _ {n}, v \rangle | ^ {2} \leq \| 1 _ {n} \| _ {2} ^ {2} \| v \| _ {2} ^ {2} = n \sum_ {i = 1} ^ {n} \left\| g _ {k} ^ {i} - \nabla f _ {i} (x ^ {*}) \right\| _ {2} ^ {2} +$$ + +Finally, line six follows from the inequality $\theta_k(1 + 2\theta_k) \leq 1$ since $\theta_k \in (0, 1/2]$ by hypothesis. The result of the lemma + +then follows after defining: + +$$ +\begin{array}{l} D _ {1} := (1 + \beta + \gamma) \\ D _ {2} := \left(1 + \beta^ {- 1} + \delta\right) + \left(1 + \gamma^ {- 1} + \delta^ {- 1}\right) (1 + \eta) \\ D _ {3} := (1 + \gamma^ {- 1} + \delta^ {- 1}) (1 + \eta^ {- 1}) \\ \end{array} +$$ + +![](images/a678f9ecf0928c5f4021bcb94eca708df3c24940cef58a8eb833382b142e8870.jpg) + +Combining these two lemmas, we arrive at our main result, which is a per-step bound on the evolution of $T^k$ under the dynamics of SRG. + +Theorem 4.3. Suppose that $(x_{k},(g_{k}^{i})_{i = 1}^{n})$ evolves according to Algorithm 1. Further, assume that for all $k\in \mathbb{N}$ .. $(i)\alpha_{k} / \theta_{k}$ is non-increasing. (ii) $\theta_{k}\in (0,1 / 2]$ . (iii) $\alpha_{k}\leq \theta_{k} / 12L_{max}$ . Then: + +$$ +\mathbb {E} \left[ T ^ {k + 1} \right] \leq (1 - \rho_ {k}) \mathbb {E} \left[ T ^ {k} \right] + (1 + 2 \theta_ {k}) 6 \alpha_ {k} ^ {2} \sigma_ {*} ^ {2} +$$ + +for all $k\in \mathbb{N}$ , and where: + +$$ +\rho_ {k} := \min \left\{\frac {\theta_ {k}}{1 2 n}, \alpha_ {k} \mu \right\} +$$ + +Proof. All the expectations in this proof are with respect to $(b_k, i_k)$ and are conditional on $(b_t, i_t)_{t=0}^{k-1}$ . Since $\alpha_k / \theta_k$ is non-increasing, Lemma 4.1 immediately gives us a bound on the first term of $\mathbb{E}[T^{k+1}]$ . The second term of $\mathbb{E}[T^{k+1}]$ expands as: + +$$ +\begin{array}{l} \mathbb {E} \left[ \| x _ {k + 1} - x ^ {*} \| _ {2} ^ {2} \right] = \mathbb {E} \left[ \left\| x _ {k} - \alpha_ {k} \frac {1}{n p _ {k} ^ {i _ {k}}} \nabla f _ {i _ {k}} (x _ {k}) - x ^ {*} \right\| _ {2} ^ {2} \right] \\ = \| x _ {k} - x ^ {*} \| _ {2} ^ {2} - 2 \alpha_ {k} \left\langle \mathbb {E} \left[ \frac {1}{n p _ {k} ^ {i _ {k}}} \nabla f _ {i _ {k}} (x _ {k}) \right], x _ {k} - x ^ {*} \right\rangle + \alpha_ {k} ^ {2} \mathbb {E} \left[ \left\| \frac {1}{n p _ {k} ^ {i _ {k}}} \nabla f _ {i _ {k}} (x _ {k}) \right\| _ {2} ^ {2} \right] \\ = \| x _ {k} - x ^ {*} \| _ {2} ^ {2} - 2 \alpha_ {k} \langle \nabla F (x _ {k}), x _ {k} - x ^ {*} \rangle + \alpha_ {k} ^ {2} \mathbb {E} \left[ \left\| \frac {1}{n p _ {k} ^ {i _ {k}}} \nabla f _ {i _ {k}} (x _ {k}) \right\| _ {2} ^ {2} \right] \\ \leq \left(1 - \alpha_ {k} \mu\right) \| x _ {k} - x ^ {*} \| _ {2} - 2 \alpha_ {k} \left[ F (x _ {k}) - F (x ^ {*}) \right] + \alpha_ {k} ^ {2} \mathbb {E} \left[ \left\| \frac {1}{n p _ {k} ^ {i _ {k}}} \nabla f _ {i _ {k}} (x _ {k}) \right\| _ {2} ^ {2} \right] \\ \end{array} +$$ + +where in the last line we use the $\mu$ -strong-convexity of $F$ to bound the inner product term. Since we are assuming $\theta_{k} \in (0,1/2]$ , we can apply Lemma 4.2 to bound the last term above. Combining the resulting bound with the one on the first term of the Lyapunov function we get: + +$$ +\begin{array}{l} \mathbb {E} \left[ T ^ {k + 1} \right] \leq \left(1 - \frac {\theta_ {k}}{n} + \frac {D _ {2} \alpha_ {k} L _ {\max}}{n a}\right) \frac {\alpha_ {k}}{\theta_ {k}} \frac {a}{L _ {\max}} \sum_ {i = 1} ^ {n} \left\| g _ {k} ^ {i} - \nabla f _ {i} (x ^ {*}) \right\| _ {2} ^ {2} + (1 - \alpha_ {k} \mu) \| x _ {k} - x ^ {*} \| _ {2} ^ {2} \\ + D _ {3} \left(1 + 2 \theta_ {k}\right) \alpha_ {k} ^ {2} \sigma_ {*} ^ {2} \\ + 2 \alpha_ {k} \left(\frac {D _ {1} \alpha_ {k} L _ {\max}}{\theta_ {k}} + a - 1\right) [ F (x _ {k}) - F (x ^ {*}) ] \\ \end{array} +$$ + +To ensure that the last parenthesis is not positive, we need: + +$$ +\alpha_ {k} \leq \frac {(1 - a)}{D _ {1}} \frac {\theta_ {k}}{L _ {\max }} \tag {13} +$$ + +Assuming $\alpha_{k}$ satisfies this condition, and replacing in the first parenthesis we get: + +$$ +1 - \frac {\theta_ {k}}{n} + \frac {D _ {2} \alpha_ {k} L _ {\max}}{n a} \leq 1 - \left(1 - \frac {1 - a}{a} \frac {D _ {2}}{D _ {1}}\right) \frac {\theta_ {k}}{n} +$$ + +It remains to choose the parameters $\beta, \gamma, \delta, \eta > 0$ , and the parameter $a > 0$ so as to maximize the largest allowable step size in (13). First however, note that we have the constraint $a < 1$ so that the step size can be allowed to be positive in (13). Furthermore, since we do not know the relative magnitudes of $n$ and $\kappa_{\max}$ , we decide to impose the equality: + +$$ +1 - \frac {1 - a}{a} \frac {D _ {2}}{D _ {1}} = \frac {1 - a}{D _ {1}} +$$ + +Finally, we choose to impose $D_{3} = 6$ . These considerations lead us to the following constrained optimization problem: + +$$ +\max _ {a, \beta , \gamma , \delta , \eta} \frac {(1 - a)}{D _ {1}} +$$ + +subject to: $1 - \frac{1 - a}{a}\frac{D_2}{D_1} = \frac{1 - a}{D_1}$ + +$$ +D _ {3} = 6 +$$ + +$$ +0 < a < 1 +$$ + +$$ +\beta , \gamma , \delta , \eta > 0 +$$ + +which we solve numerically to find the feasible point: + +$$ +a = 0. 6 7 7, \beta = 1. 0 4 7, \gamma = 1. 6 6 6, \delta = 1. 5 9 1, \eta = 0. 5 9 1 +$$ + +With this choice of parameters, we get: + +$$ +\mathbb {E} \left[ T ^ {k + 1} \right] \leq \left(1 - \rho_ {k}\right) T ^ {k} + \left(1 + 2 \theta_ {k}\right) 6 \alpha_ {k} ^ {2} \sigma_ {*} ^ {2} +$$ + +under the condition: + +$$ +\alpha_ {k} \leq \frac {1}{1 2} \frac {\theta_ {k}}{L _ {\max }} +$$ + +which ensures that (13) holds. + +From this result, we can derive the convergence rate of SRG when it is used with a constant mixture coefficient and step size. + +Corollary 4.4. Suppose that $(x_{k},(g_{k}^{i})_{i = 1}^{n})$ evolves according to Algorithm 1 with a constant mixture coefficient $\theta_{k} = \theta \in (0,1 / 2]$ and a constant step size $\alpha_{k} = \alpha \leq \theta /12L_{\max}$ . Then for any $k\in \mathbb{N}$ : + +$$ +\mathbb {E} \left[ T ^ {k} \right] \leq (1 - \rho) ^ {k} T ^ {0} + (1 + 2 \theta) \frac {6 \alpha^ {2} \sigma_ {*} ^ {2}}{\rho} +$$ + +where $\rho = \rho_{k}$ is as defined in Theorem 4.3. For any $\varepsilon >0$ and $\theta \in (0,1 / 2]$ , choosing: + +$$ +\alpha = \min \left\{\frac {\theta}{1 2 L _ {m a x}}, \frac {\varepsilon \mu}{(1 + 2 \theta) 1 2 \sigma_ {*} ^ {2}}, \sqrt {\frac {\theta}{1 + 2 \theta} \frac {\varepsilon}{1 4 4 n \sigma_ {*} ^ {2}}} \right\} +$$ + +and: + +$$ +k \geq \max \left\{\frac {1 2 n}{\theta}, \frac {1}{\alpha \mu} \right\} \log \left(\frac {2 T ^ {0}}{\varepsilon}\right) +$$ + +guarantees $\mathbb{E}\left[\| x_k - x^*\| _2^2\right]\leq \varepsilon$ + +Proof. Under the assumptions of the corollary, the conditions of Theorem 4.3 are satisfied for all $k \in \mathbb{N}$ . Starting from $\mathbb{E}\left[T^k\right]$ and repeatedly applying Theorem 4.3 we get: + +$$ +\begin{array}{l} \mathbb {E} \left[ T ^ {k} \right] \leq (1 - \rho) ^ {k} T ^ {0} + (1 + 2 \theta) 6 \alpha^ {2} \sigma_ {*} ^ {2} \sum_ {t = 0} ^ {k - 1} (1 - \rho) ^ {t} \\ \leq (1 - \rho) ^ {k} T ^ {0} + (1 + 2 \theta) 6 \alpha^ {2} \sigma_ {*} ^ {2} \sum_ {t = 0} ^ {\infty} (1 - \rho) ^ {t} \\ = (1 - \rho) ^ {k} T ^ {0} + (1 + 2 \theta) \frac {6 \alpha^ {2} \sigma_ {*} ^ {2}}{\rho} \\ \end{array} +$$ + +This proves the first part. For the complexity part, let $\varepsilon > 0$ . We choose the step size $\alpha$ so that: + +$$ +(1 + 2 \theta) \frac {6 \alpha^ {2} \sigma_ {*} ^ {2}}{\rho} \leq \frac {\varepsilon}{2} +$$ + +We solve this inequality for $\alpha$ using the definition of $\rho$ . Similarly, we need to ensure that the first term satisfies: + +$$ +(1 - \rho) ^ {k} T ^ {0} \leq \frac {\varepsilon}{2} +$$ + +using the inequality $(1 - \rho) \leq \exp(-\rho)$ , taking logarithms of both sides, and solving for $k$ we get the desired lower bound. + +Using Theorem 4.3, one can similarly derive the convergence rate of SRG when it is used with decreasing step sizes. In such a case, the mixture coefficient can also be decreased, provided that the ratio $\alpha_{k} / \theta_{k}$ remains non-increasing as required by Theorem 4.3. We do not pursue this further here. + +# C. Analysis of SRG+ + +The analysis of $\mathrm{SRG + }$ is very similar to that of SRG. The Lyapunov function needs to be modified to make use of index-specific constants: + +$$ +T ^ {k} = T (x _ {k}, (g _ {k} ^ {i}) _ {i = 1} ^ {n}) := \frac {\alpha_ {k}}{\theta_ {k}} \sum_ {i = 1} ^ {n} \frac {a}{L _ {i}} \left\| g _ {k} ^ {i} - \nabla f _ {i} (x ^ {*}) \right\| _ {2} ^ {2} + \| x _ {k} - x ^ {*} \| _ {2} ^ {2} +$$ + +Similar to Lemma 4.1, the following lemma studies the evolution of the first term of this Lyapunov function. + +Lemma C.1. Let $k \in \mathbb{N}$ . Suppose $(g_k^i)_{i=1}^n$ evolves as in Algorithm 2. Taking expectation with respect to $(b_k, j_k, i_k)$ , conditional on $(b_t, j_t, i_t)_{t=0}^{k-1}$ , we have: + +$$ +\mathbb {E} \left[ \sum_ {i = 1} ^ {n} \frac {1}{L _ {i}} \left\| g _ {k + 1} ^ {i} - \nabla f _ {i} \left(x ^ {*}\right) \right\| _ {2} ^ {2} \right] \leq \left(1 - \frac {\theta_ {k}}{n}\right) \sum_ {i = 1} ^ {n} \frac {1}{L _ {i}} \left\| g _ {k} ^ {i} - \nabla f _ {i} \left(x ^ {*}\right) \right\| _ {2} ^ {2} + 2 \theta_ {k} [ F (x _ {k}) - F (x ^ {*}) ] +$$ + +Proof. The proof is identical to that of Lemma 4.1, with the only difference being in the use of the second inequality of Lemma A.1 instead of the first. + +Similar to Lemma 4.2, the following lemma bounds the second moment of the gradient estimator of $\mathrm{SRG}+$ . + +Lemma C.2. Let $k \in \mathbb{N}$ and assume that $\theta_k \in (0, 1/2]$ . Taking expectation with respect to $(b_k, j_k, i_k)$ , conditional on $(b_t, j_t, i_t)_{t=0}^{k-1}$ , we have, for all $\beta, \gamma, \delta, \eta > 0$ : + +$$ +\underset {i _ {k} \sim p _ {k}} {\mathbb {E}} \left[ \left\| \frac {1}{n p _ {k} ^ {i _ {k}}} \nabla f _ {i _ {k}} (x _ {k}) \right\| _ {2} ^ {2} \right] \leq \frac {2 D _ {1} \overline {{L}}}{\theta_ {k}} \left[ F (x _ {k}) - F ^ {*} \right] + \frac {D _ {2}}{\theta_ {k} n} \sum_ {i = 1} ^ {n} \frac {\overline {{L}}}{L _ {i}} \left\| g _ {k} ^ {i} - \nabla f _ {i} (x ^ {*}) \right\| _ {2} ^ {2} + D _ {3} (1 + 2 \theta_ {k}) \sigma_ {*} ^ {2} +$$ + +where: + +$$ +D _ {1} := (1 + \beta + \gamma) +$$ + +$$ +D _ {2} := (1 + \beta^ {- 1} + \delta) + (1 + \gamma^ {- 1} + \delta^ {- 1}) (1 + \eta) +$$ + +$$ +D _ {3} := (1 + \gamma^ {- 1} + \delta^ {- 1}) (1 + \eta^ {- 1}) +$$ + +Proof. The proof is again very similar to that of Lemma 4.2. In particular, we use the same decomposition in three terms. The first term is bounded using the second inequality of Lemma A.1 instead of the first. The third term is also bounded using the same arguments except in the use of the Cauchy-Schwarz inequality. In particular, we use instead the following bound: + +$$ +\left(\sum_ {i = 1} ^ {n} \left\| g _ {k} ^ {i} - \nabla f _ {i} \left(x ^ {*}\right) \right\| _ {2} ^ {2}\right) ^ {2} = | \langle u, v \rangle | \leq \| u \| _ {2} ^ {2} \| v \| _ {2} ^ {2} = n \sum_ {i = 1} ^ {n} \frac {\bar {L}}{L _ {i}} \left\| g _ {k} ^ {i} - \nabla f _ {i} \left(x ^ {*}\right) \right\| _ {2} ^ {2} +$$ + +where $u$ is the vector whose $i^{th}$ component is $\sqrt{L_i}$ while $v$ is the vector whose $i^{th}$ component is $\frac{1}{\sqrt{L_i}}\left\| g_k^i -\nabla f_i(x^*)\right\| _2$ . + +Combining Lemmas C.1 and C.2, and using identical arguments to the ones used to prove Theorem 4.3, we arrive at Theorem 4.3 for the iterates of $\mathrm{SRG + }$ with the loosening of the condition $\alpha_{k}\leq \theta_{k} / 12L_{\max}$ to $\alpha_{k}\leq \theta_{k} / 12\overline{L}$ . By extension, Corollary 4.4 also holds for $\mathrm{SRG + }$ , with every occurrence of $L_{\mathrm{max}}$ replaced by $\overline{L}$ . \ No newline at end of file diff --git a/stochasticreweightedgradientdescent/images.zip b/stochasticreweightedgradientdescent/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..6e3512798a12f70bf3ae2c09d203d9bd7cafcc13 --- /dev/null +++ b/stochasticreweightedgradientdescent/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fb92f2682d170e3bcbf18c59f5d9abbd5d03dc73062d9f6922cf034bb7fc9f52 +size 750362 diff --git a/stochasticreweightedgradientdescent/layout.json b/stochasticreweightedgradientdescent/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..107b5c8d3fde628a8666045e252b33796d81c989 --- /dev/null +++ b/stochasticreweightedgradientdescent/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3ceb95e11cac5f3b02a54e5057fa469322ec86b1366841a6ff74844d09010af8 +size 796980 diff --git a/stochasticrisingbandits/af7c5270-bb78-421f-b23f-33c8e97f698c_content_list.json b/stochasticrisingbandits/af7c5270-bb78-421f-b23f-33c8e97f698c_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..d689303f3da1259f34f2cdd3c94755bd51919fa7 --- /dev/null +++ b/stochasticrisingbandits/af7c5270-bb78-421f-b23f-33c8e97f698c_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dacae8c586fb65b31afc89049d4d51e8e8bf4ad211b54cf1ab836f2bfea19383 +size 256297 diff --git a/stochasticrisingbandits/af7c5270-bb78-421f-b23f-33c8e97f698c_model.json b/stochasticrisingbandits/af7c5270-bb78-421f-b23f-33c8e97f698c_model.json new file mode 100644 index 0000000000000000000000000000000000000000..f440f166135c5341119253431940001457f323f1 --- /dev/null +++ b/stochasticrisingbandits/af7c5270-bb78-421f-b23f-33c8e97f698c_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ed57b22f71e20514863a3017d07bb0fef10fa3620d1d3496240f9171ebc6b8ce +size 293271 diff --git a/stochasticrisingbandits/af7c5270-bb78-421f-b23f-33c8e97f698c_origin.pdf b/stochasticrisingbandits/af7c5270-bb78-421f-b23f-33c8e97f698c_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..a5e37d1fd7707e108e9df877625173b025f0624f --- /dev/null +++ b/stochasticrisingbandits/af7c5270-bb78-421f-b23f-33c8e97f698c_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:484f9bf36150a118eccf8e1f797fdea47a7ea383fab2337d0c5c7cc9ab86d18f +size 996192 diff --git a/stochasticrisingbandits/full.md b/stochasticrisingbandits/full.md new file mode 100644 index 0000000000000000000000000000000000000000..55ed07d8b4b0cb2c9b98e03a9e7bcbdfaf2be2f0 --- /dev/null +++ b/stochasticrisingbandits/full.md @@ -0,0 +1,1367 @@ +# Stochastic Rising Bandits + +Alberto Maria Metelli1 Francesco Trovò1 Matteo Pirola1 Marcello Restelli1 + +# Abstract + +This paper is in the field of stochastic Multi-Armed Bandits (MABs), i.e., those sequential selection techniques able to learn online using only the feedback given by the chosen option (a.k.a. arm). We study a particular case of the rested and restless bandits in which the arms' expected payoff is monotonically non-decreasing. This characteristic allows designing specifically crafted algorithms that exploit the regularity of the payoffs to provide tight regret bounds. We design an algorithm for the rested case (R-ed-UCB) and one for the restless case (R-less-UCB), providing a regret bound depending on the properties of the instance and, under certain circumstances, of $\tilde{\mathcal{O}}(T^{\frac{2}{3}})$ . We empirically compare our algorithms with state-of-the-art methods for non-stationary MABs over several synthetically generated tasks and an online model selection problem for a real-world dataset. Finally, using synthetic and real-world data, we illustrate the effectiveness of the proposed approaches compared with state-of-the-art algorithms for the non-stationary bandits. + +# 1. Introduction + +The classical stochastic MAB framework (Lattimore & Szepesvári, 2020) has been successfully applied to a number of applications, such as advertising, recommendation, and networking. MABs model the scenario in which a learner sequentially selects (a.k.a. pulls) an option (a.k.a. arm) in a finite set, and receives a feedback (a.k.a. reward) corresponding to the chosen option. The goal of online learning algorithms is to guarantee the no-regret property, meaning that the loss due to not knowing the best arm is increasing sublinearly with the number of pulls. One of the assumptions that allows designing no-regret algorithms consists in requiring that the payoff (a.k.a. expected reward) provided + +$^{1}$ Dipartimento di Elettronica, Informazione e Bioingegneria, Politecnico di Milano, Milan, Italy. Correspondence to: Alberto Maria Metelli . + +Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s). + +by the available options is stationary, i.e., rewards come from a fixed distribution. + +However, the arms' payoff may change over time due to intrinsic modifications of the arms or the environment. A no-regret approach is offered by the adversarial algorithms, in which no assumption on the nature of the reward is required. It has been shown that, in this setting, it is possible to design effective algorithms, e.g., EXP3 (Auer et al., 1995). However, in practice, their performance is unsatisfactory because the non-stationarity of real-world cases is far from being adversarial. Instead, non-stationarity is explicitly accounted for by a surge of methods that consider either abrupt changes (e.g., Garivier & Moulines, 2011), smoothly changing environments (e.g., Trovò et al., 2020) or bounded reward variation (e.g., Besbes et al., 2014). + +While in non-stationary MABs the arms' payoff changes naturally over time, a different setting arises when the payoff changes as an effect of pulling the arm. This is the case of rotting bandits (Levine et al., 2017; Seznec et al., 2019), in which the payoff of the arms are monotonically non-increasing over the pulls, modeling degradation phenomena. Knowing the monotonicity property allows deriving more specialized algorithms, exploiting the process characteristics and further decreasing the regret w.r.t. unrestricted cases. Notably, the symmetric problem of monotonically non-decreasing payoffs cannot be addressed with the same approaches. Indeed, it was shown that it represents a significantly more complex problem, even for deterministic arms (Heidari et al., 2016). In this non-decreasing setting, a common assumption is the concavity of the payoff function that defines the rising bandits setting (Li et al., 2020). + +The goal of this paper is to study the stochastic MAB problem when the arms' payoff is monotonically non-decreasing. This setting arises in several real-world sequential selection problems. For instance, suppose we have to choose among a set of optimization algorithms to maximize an unknown stochastic concave function. In this setting, we expect that all the algorithms progressively increase (on average) the function value and eventually converge to an optimal value, possibly with different speeds. Therefore, we wonder which candidate algorithm to assign the available resources (e.g., computational power or samples) to identify the one that converges faster to the optimum. This online model selec + +tion process can be modeled as a rested MAB (Tekin & Liu, 2012), like the rotting bandits (Levine et al., 2017), but with non-decreasing payoffs. Indeed, each optimization algorithm (arms) and the function value does not evolve if we do not select (pull) it. Another example that shows a non-decreasing expected reward is the selection of athletes for competitions. Athletes train in parallel and increase (on average) their performance. However, if participation in competitions is allowed to one athlete only, the trainer should select the one who has achieved the best performance so far. This problem is akin to the restless case (Tekin & Liu, 2012), like non-stationary bandits (Besbes et al., 2014), but with the additional assumption that payoffs are nondecreasing. Indeed, the athletes (arms) are evolving even if they are not selected (pulled) to compete. + +Original Contribution In this paper, we study the stochastic rising bandits, i.e., stochastic bandits in which the payoffs are monotonically non-decreasing and concave, in both restless and rested formulations. More specifically: + +- we show that the rested bandit with non-decreasing payoffs is non-learnable, i.e., the loss due to learning is linear with the number of pulls, unless additional assumptions on the payoff functions are enforced (e.g., concavity); +- we design R-ed-UCB and R-less-UCB, optimistic algorithms for the rising rested and restless bandits; +- we show that R-ed-UCB and R-less-UCB suffer an expected regret that depends on the payoff function profile and, under some conditions, of order $\tilde{\mathcal{O}}(T^{\frac{2}{3}})$ ; +- we illustrate, using synthetic and real-world data, the effectiveness of our approaches, compared with state-of-the-art algorithms for the non-stationary (restless) bandits. + +# 2. Related Works + +Restless and Rested Bandits The rested and restless bandit settings have been introduced by Tekin & Liu (2012) and further developed by (Ortner et al., 2012; Russac et al., 2019) in the restless version and by (Mintz et al., 2020; Pike-Burke & Grunewalder, 2019) in the rested one. Originally the evolution of the payoff was modeled via a suitable process, e.g., a Markov chain with finite state space or a linear regression process. For instance, Wang et al. (2020) proposes an optimistic approach based on the estimation of the transition kernel of the underlying chain. More recently, the terms rested and restless have been employed to denote arms whose payoff changes as time passes, for restless ones, or whenever being pulled, for rested ones (Seznec et al., 2019; 2020). That is the setting we target in this work. + +Non-Stationary Bandits The restless bandits, without a fixed temporal reward evolution, are usually addressed via non-stationary MAB approaches, that include both pas + +sive (e.g., Garivier & Moulines, 2011; Besbes et al., 2014; Auer et al., 2019; Trovò et al., 2020) and active (e.g., Liu et al., 2018; Besson et al., 2019; Cao et al., 2019) methods. The former algorithms base their selection criterion on the most recent feedbacks, while the latter actively try to detect if a change in the arms' rewards occurred and use only data gathered after the last change. Garivier & Moulines (2011) employ a discounted reward approach (D-UCB) or an adaptive sliding window (SW-UCB), proving a $\tilde{\mathcal{O}} (\sqrt{T})$ regret when the number of abrupt changes is known. Similar results have been obtained by (Auer et al., 2019) without knowing the number of changes, at the price of resorting to the doubling trick. (Besbes et al., 2014) provides an algorithm, namely RExp3, a modification EXP3, originally designed for adversarial MABs, to give a regret bound of $\mathcal{O}(T^{\frac{2}{3}})$ under the assumption that the total variation $V_{T}$ of the arms' expected reward is known. The knowledge of $V_{T}$ has been removed by Chen et al. (2019) using the doubling trick. In Trovò et al. (2020), an approach in which the combined use of a sliding window on a Thompson Sampling-like algorithm provides theoretical guarantees both on abruptly and smoothly changing environments. Nonetheless, in our setting, their result might lead to linear regret for specific instances. Notably, none of the above explicitly use assumptions on the monotonicity of the payoff over time. + +Rising Bandits The rising bandit problem has been tackled in its deterministic version by (Heidari et al., 2016; Li et al., 2020). In Heidari et al. (2016), the authors design an online algorithm to minimize the regret of selecting an increasing and concave function among a finite set. This study assumes that the learner receives feedback about the true value of the reward function, i.e., no stochasticity is present. In Li et al. (2020), the authors model the problem of parameter optimization for machine learning models as a rising bandit setting. They propose an online algorithm having good empirical performance, still in the case of deterministic rewards. A case where the reward is increasing in expectation (or equivalently decreasing in loss), but no longer deterministic, is provided by Cella et al. (2021). However, the payoff follows a given parametric form known to the learner, who estimates such parameters in the best-arm identification and regret-minimization frameworks. The need for knowing the parametric form of the payoff makes these approaches hardly applicable for arbitrary increasing functions. + +Corralling Bandits It is also worth mentioning the cor- ralling bandits (Agarwal et al., 2017; Pacchiano et al., 2020b; Abbasi-Yadkori et al., 2020; Pacchiano et al., 2020a; Arora et al., 2021), a setting in which the goal is to minimize the regret of a process choosing among a finite set of bandit algorithms. This setting, close to online model selection, is characterized by particular assumptions. Indeed, each arm corresponds to a learning algorithm, operating on a bandit, endowed with a (possibly known) regret bound, sometimes + +requiring additional conditions (e.g., stability). + +# 3. Problem Setting + +A $K$ -armed MAB (Lattimore & Szepesvári, 2020) is defined as a vector of probability distributions $\pmb{\nu} = (\nu_{i})_{i\in [K]}$ , where $\nu_{i}:\mathbb{N}^{2}\to \Delta (\mathbb{R})$ depends on a pair of parameters $(t,n)\in \mathbb{N}^2$ for every $i\in [K]$ , where $[K]\coloneqq \{1,\dots ,K\}$ . Let $T\in \mathbb{N}$ be the optimization horizon, at each round $t\in [T]$ , the agent selects an arm $I_{t}\in [K]$ and observes a reward $R_{t}\sim \nu_{I_{t}}(t,N_{I_{t},t})$ where $N_{i,t} = \sum_{l = 1}^{t}\mathbb{1}\{I_{l} = i\}$ is the number of times arm $i\in [K]$ was pulled up to round $t$ . Thus, the reward depends, in general, on the current round $t$ and on the number of pulls $N_{I_t,t} = N_{I_t,t - 1} + 1$ of arm $I_{t}$ up to $t$ . For every arm $i\in [K]$ , we define its payoff $\mu_i:\mathbb{N}^2\to \mathbb{R}$ as the expectation of the reward, i.e., $\mu_i(t,n) = \mathbb{E}_{R\sim \nu_i(t,n)}[R]$ and denote the vector of payoffs as $\pmb{\mu} = (\mu_i)_{i\in [K]}$ . We assume that the payoffs are bounded in $[0,1]$ , and that the rewards are $\sigma^2$ -subgaussian, i.e., $\mathbb{E}_{R\sim \nu_i(t,n)}[e^{\lambda (R - \mu_i(t,n))}]\leqslant e^{\frac{\sigma\lambda^2}{2}}$ , for every $\lambda \in \mathbb{R}$ . + +Rested and Restless Arms We revise the definition of rested and restless arms (Tekin & Liu, 2012).2 + +Definition 3.1 (Rested and Restless Arms). Let $\nu$ be a MAB and let $i\in [K]$ be an arm, we say that: + +- $i$ is a rested arm if, for every round $t \in [T]$ and number of pulls $n \in \mathbb{N}$ , we have $\mu_i(t,n) = \mu_i(n)$ ; +- $i$ is a restless arm if, for every round $t \in [T]$ and number of pulls $n \in \mathbb{N}$ , we have $\mu_i(t,n) = \mu_i(t)$ . + +A $K$ -armed bandit is rested (resp. restless) if all of its arms are rested (resp. restless). + +Thus, the payoff of a rested arm changes when being pulled and, therefore, it models phenomena that evolve as a consequence of the agent intervention. Instead, a restless arm is in all regards a non-stationary arm (Besbes et al., 2014), and it is suitable for modeling a natural phenomenon that evolves for time passing, independently of the agent intervention. + +Rising Bandits We revise the rising bandits notion, i.e., MABs with payoffs non-decreasing and concave as a function of $(t,n)$ (Heidari et al., 2016).3 + +Assumption 3.1 (Non-Decreasing Payoff). Let $\pmb{\nu}$ be a MAB, for every arm $i\in [K]$ , number of pulls $n\in \mathbb{N}$ , and round $t\in [T]$ , functions $\mu_i(\cdot ,n)$ and $\mu_{i}(t,\cdot)$ are non-decreasing. In particular, we define the increments: + +Rested arm: $\gamma_{i}(n)\coloneqq \mu_{i}(n + 1) - \mu_{i}(n)\geqslant 0;$ + +Restless arm: $\gamma_{i}(t)\coloneqq \mu_{i}(t + 1) - \mu_{i}(t)\geqslant 0.$ + +From an economic perspective, $\gamma_{i}(\cdot)$ represents the increase of total return (or payoff) we obtain by adding a factor of production, i.e., pulling the arm (rested) or letting time evolve for a unit (restless). In the next sections, we analyze how the following assumption defines a remarkable class of bandits with non-decreasing payoffs (Heidari et al., 2016). + +Assumption 3.2 (Concave Payoff). Let $\pmb{\nu}$ be a MAB, for every arm $i\in [K]$ , number of pulls $n\in \mathbb{N}$ , and round $t\in [T]$ , functions $\mu_{i}(\cdot ,n)$ and $\mu_i(t,\cdot)$ are concave, i.e.: + +Rested arm: $\gamma_{i}(n + 1) - \gamma_{i}(n)\leqslant 0;$ + +Restless arm: $\gamma_{i}(t + 1) - \gamma_{i}(t)\leqslant 0$ + +As pointed out by Heidari et al. (2016), the concavity assumption corresponds, in economics, to the decrease of marginal returns that emerges when adding a factor of production, i.e., pulling the arm (rested) or letting time evolve for one unit (restless). + +Formally, we define rising a stochastic MAB in which both Assumption 3.1 and Assumption 3.2 hold. + +Learning Problem Let $t \in [T]$ be a round, we denote with $\mathcal{H}_t = (I_l, R_l)_{l=1}^t$ the history of observations up to $t$ . A (nonstationary) deterministic policy is a function $\pi: \mathcal{H}_{t-1} \mapsto I_t$ mapping a history to an arm, that is abbreviated as $\pi(t) := \pi(\mathcal{H}_{t-1})$ . The performance of a policy $\pi$ in a MAB with payoffs $\mu$ is the expected cumulative reward collected over the $T$ rounds, formally: + +$$ +J _ {\boldsymbol {\mu}} (\pi , T) := \mathbb {E} \left[ \sum_ {t \in [ T ]} \mu_ {I _ {t}} (t, N _ {I _ {t}, t}) \right], +$$ + +and the expectation is computed over the histories. A policy $\pi_{\mu, T}^{*}$ is optimal if it maximizes the expected cumulative reward: $\pi_{\mu, T}^{*} \in \mathrm{argmax}_{\pi} \{J_{\mu}(\pi, T)\}$ . Denoting with $J_{\mu}^{*}(T) \coloneqq J_{\mu}(\pi_{\mu, T}^{*}, T)$ the expected cumulative reward of an optimal policy, the suboptimal policies $\pi$ are evaluated via the expected cumulative regret: + +$$ +R _ {\boldsymbol {\mu}} (\pi , T) := J _ {\boldsymbol {\mu}} ^ {*} (T) - J _ {\boldsymbol {\mu}} (\pi , T). \tag {1} +$$ + +Problem Characterization To characterize the problem instance, we introduce the following quantity, namely the cumulative increment, defined for $q \in [0,1]$ and $M \in [T]$ as: + +$$ +\Upsilon_ {\boldsymbol {\mu}} (M, q) := \max _ {i \in [ K ]} \left\{\sum_ {l = 1} ^ {M - 1} \gamma_ {i} (l) ^ {q} \right\}. \tag {2} +$$ + +The cumulative increment accounts for how fast the payoffs reach their asymptotic value, i.e., become stationary. Intuitively, small values of $\Upsilon_{\mu}(M,q)$ lead to simpler problems, as they are closer to stationary bandits. Table 1 reports + +Table 1. $\mathcal{O}$ rates of $\Upsilon_{\mu}(M,q)$ in the case $\gamma_i(l) \leqslant f(l)$ for all $i \in [K]$ and $l \in \mathbb{N}$ (see also Lemma C.6). + +
f(l)e- cll-c(cq>1)l-c(cq=1)l-c(cq≤1)
Yμ(M,q)e-cq/cq1/cq-1logMM1-cq/1-cq
+ +some bounds on $\Upsilon_{\mu}(M,q)$ for particular choices of $\gamma_{i}(l)$ and $q$ . When $q = 1$ , the cumulative increment resembles the bounded variation $V_{T} \coloneqq \sum_{l=1}^{T-1} \max_{i \in [K]} \{\gamma_{i}(l)\}$ (Besbes et al., 2014), but $\Upsilon_{\mu}(T,1)$ is smaller than $V_{T}$ as the maximization over the arms appears outside the summation. + +In the next sections, we devise and analyze learning algorithms for rested (Section 4) and restless (Section 5) rising bandits. We will present optimistic algorithms, whose structure is summarized in Algorithm 1 and parametrized by an exploration index $B_{i}(t)$ that will be designed case by case. + +# 4. Stochastic Rising Rested Bandits + +In this section, we consider the Rising rested bandits (R-ed) setting in which the arms' expected payoff increases only when it is pulled, i.e., $\mu_{i}(t,N_{i,t})\equiv \mu_{i}(N_{i,t})$ + +Oracle Policy We recall that the oracle constant policy, that always plays at each round $t \in [T]$ the arm that maximizes the sum of the payoffs over the horizon $T$ , is optimal for the non-increasing rested bandits. + +Theorem 4.1 (Heidari et al., 2016). Let $\pi_{\mu, T}^{c}$ be the oracle constant policy: + +$$ +\pi_ {\pmb {\mu}, T} ^ {c} (t) \in \underset {i \in [ K ]} {\arg \max} \left\{\sum_ {l \in [ T ]} \mu_ {i} (l) \right\}, \quad \forall t \in [ T ]. +$$ + +Then, $\pi_{\mu,T}^{c}$ is optimal for the rested non-decreasing bandits (i.e., under Assumption 3.1). + +The result holds under the non-decreasing property (Assumption 3.1) only, without requiring concavity (Assumption 3.2). However, this policy cannot be used in practice as it requires knowing the full function $\mu_{i}(\cdot)$ in advance. + +# 4.1. Non-Learnability + +We now prove a result highlighting the "hardness" of the non-decreasing rested bandits. We show that with no assumptions on the payoff $\mu_i(n)$ (e.g., concavity), it is impossible to devise a no-regret algorithm. + +Theorem 4.2 (Non-Learnability). There exists a 2-armed + +# Algorithm 1 R-□-UCB (□∈{less,ed}) + +Input: $K$ , $(B_{i})_{i\in [K]}$ + +Initialize $N_{i}\gets 0$ for all $i\in [K]$ + +for $t\in (1,\dots ,T)$ do + +Pull $I_{t}\in \mathrm{argmax}_{i\in [K]}\{B_{i}(t)\}$ + +Observe $R_{t}\sim \nu_{I_{t}}(\dot{t},\dot{N}_{I_{t}} + 1)$ + +Update $B_{I_t}$ and $N_{I_t} \gets N_{I_t} + 1$ + +end for + +non-decreasing (non-concave) deterministic rested bandit with $\gamma_{i}(n)\leqslant \gamma_{\mathrm{max}}\leqslant 1$ for all $i\in [K]$ and $n\in \mathbb{N}$ , such that any learning policy $\pi$ suffers regret: + +$$ +R _ {\boldsymbol {\mu}} (\pi , T) \geqslant \left\lfloor \frac {\gamma_ {\max}}{1 2} T \right\rfloor . +$$ + +The intuition behind this result is that, if we enforce no condition on the increment $\gamma_{i}(n)$ we cannot predict how much the arm payoff will increase in the future. Therefore, we face the dilemma of whether or not to pull an arm that is currently believed to be suboptimal, hoping its payoff will increase. If we decide to pull it and its payoff will not actually increase, or if we decide not to pull it and its payoff will actually increase, becoming optimal, we will suffer linear regret. Thus, Theorem 4.2 highlights the importance of the concavity assumption (Assumption 3.2), providing an answer to an open question posed in (Heidari et al., 2016). + +Remark 4.1 (About the Concavity Assumption). While without additional structure, e.g., concavity, the non-decreasing rested bandits are non-learnable (Theorem 4.2), the assumption is not necessary in other related settings. In particular, non-decreasing restless bandits are in all regard non-stationary bandits, for which no-regret algorithms exist under different assumptions about the number of change points (Garivier & Moulines, 2011) or a bounded total variation (Besbes et al., 2014). Furthermore, for non-increasing rested (rotting) bandits (Levine et al., 2017), a bounded payoff decrement between consecutive pulls is sufficient to devise a no-regret algorithm. + +# 4.2. Deterministic Setting + +To progressively introduce the core ideas, we begin with the case of deterministic arms $(\sigma = 0)$ . We devise an optimistic estimator of $\mu_{i}(t)$ , namely $\overline{\mu_i^{\mathrm{R - ed}}(t)}$ , having observed the exact payoffs $(\mu_{i}(n))_{n = 1}^{N_{i,t - 1}}$ . Differently from the rotting setting, these payoffs are an underestimation of $\mu_{i}(t)$ . Therefore, we exploit the non-decreasing assumption (Assumption 3.1) to derive the identity: + +$$ +\mu_ {i} (t) = \underbrace {\mu_ {i} \left(N _ {i , t - 1}\right)} _ {\text {(m o s t r e c e n t p a y o f f)}} + \underbrace {\sum_ {n = N _ {i , t - 1}} ^ {t - 1} \gamma_ {i} (n)} _ {\text {(3)}}. \tag {3} +$$ + +(sum of future increments) + +![](images/75364520b418bc28b3afd77099d6b600e5ebfb88149bdcfa5e557fb57b3a0529.jpg) +Figure 1. Graphical representation of the estimator construction $\overline{\mu}_i^{\mathrm{R - ed}}(t)$ for the rested deterministic setting. + +By exploiting the concavity (Assumption 3.2), we upper bound the sum of future increments with the last experienced increment $\gamma_{i}(N_{i,t - 1} - 1)$ that is projected for the future $t - N_{i,t - 1}$ pulls, leading to the following estimator: + +$$ +\overline {{\mu}} _ {i} ^ {\mathrm {R - e d}} (t) := \underbrace {\mu_ {i} \left(N _ {i , t - 1}\right)} _ {\text {(m o s t r e c e n t p a y o f f)}} + \left(t - N _ {i, t - 1}\right) \underbrace {\gamma_ {i} \left(N _ {i , t - 1} - 1\right)} _ {\text {(m o s t r e c e n t i n c r e m e n t)}} \tag {4} +$$ + +if $N_{i,t - 1}\geqslant 2$ else $\overline{\mu}_i^{\mathrm{R - ed}}(t)\coloneqq +\infty$ . Figure 1 illustrates the construction of the estimator. The optimism of $\overline{\mu}_i^{\mathrm{R - ed}}$ and a bias bound are proved in Lemma A.2. + +Regret Analysis We are now ready to provide the regret analysis of R-ed-UCB, i.e., Algorithm 1 when we employ as exploration index $B_{i}(t) \equiv \overline{\mu}_{i}^{\mathrm{R - ed}}(t)$ . + +Theorem 4.3. Let $T \in \mathbb{N}$ , then $R$ -ed-UCB (Algorithm 1) with $B_{i}(t) \equiv \overline{\mu}_{i}^{R - ed}(t)$ suffers an expected regret bounded, for every $q \in [0,1]$ , as: + +$$ +R _ {\boldsymbol {\mu}} (R - e d - U C B, T) \leqslant 2 K + K T ^ {q} \Upsilon_ {\boldsymbol {\mu}} \left(\left\lceil \frac {T}{K} \right\rceil , q\right). +$$ + +The regret depends on a parameter $q \in [0,1]$ that can be selected to tighten the bound, whose optimal value depends on $\Upsilon_{\mu}(\cdot ,q)$ , that is a function on the horizon $T$ . Some examples, when $\gamma_{i}(t) \leqslant l^{-c}$ for $c > 0$ , are reported in Figure 2. + +# 4.3. Stochastic Setting + +Moving to the R-ed stochastic setting $(\sigma >0)$ , we cannot directly exploit the estimator in Equation (4). Indeed, we only observe the sequence of noisy rewards $(R_{t_{i,n}})^{N_{i,t - 1}}$ where $t_{i,n}\in [T]$ is the round at which arm $i\in [K]$ was pulled for the $n$ -th time. To cope with stochasticity, we need to employ an $h$ -wide window made of the $h$ most recent samples, similarly to what has been proposed by Seznec et al. (2020). The choice of $h$ represents a bias-variance trade-off between employing few recent observations (less biased), compared to many past observations (less variance). For + +![](images/5987f13b8fc3d947d0e5d1af69047675a4d0ece56b782732e105626f0ee78ba2.jpg) +Figure 2. Regret bounds $\tilde{\mathcal{O}}$ rates optimized over $q$ for R-less and R-ed deterministic bandits when $\gamma_{i}(l)\leqslant l^{-c}$ for $c > 0$ . + +![](images/1848967d977e4a1a29f0a43d200591e15a34f876a84fa80de5ccda9162d99a99.jpg) + +$h\in [N_{i,t - 1}]$ , the resulting estimator $\hat{\mu}_i^{\mathrm{R - ed},h}(t)$ is given by: + +$$ +\begin{array}{l} \widehat{\mu}_{i}^{\text{R - ed},h}(t):= \frac{1}{h}\sum_{l = N_{i,t - 1} - h + 1}^{N_{i,t - 1}}\Bigg( \underbrace{R_{t_{i,l}}}_{(\text{estimatedpayoff})} \\ + (t - l) \underbrace {\frac {R _ {t _ {i , l}} - R _ {t _ {i , l - h}}}{h}} _ {(\text {e s t i m a t e d i n c r e m e n t})}, \\ \end{array} +$$ + +if $h \leqslant \lfloor N_{i,t-1} / 2 \rfloor$ , else $\hat{\mu}_i^{\mathbb{R}^{-\mathrm{ed}},h}(t) \coloneqq +\infty$ . The construction of the estimator is shown in Appendix A.1 and relies on the idea of averaging several estimators of the form of Equation (4) instantiated using as starting points different number of pulls $N_{i,t-1} - l + 1$ for $l \in [h]$ and replacing the true payoff with the corresponding reward sample. An efficient way to compute this estimator is reported in Appendix D. + +Regret Analysis By making use of the presented estimator, we build the following optimistic exploration index: + +$$ +B _ {i} (t) \equiv \hat {\mu} _ {i} ^ {\mathrm {R - e d}, h _ {i, t}} (t) + \beta_ {i} ^ {\mathrm {R - e d}, h _ {i, t}} (t), \quad \text {w h e r e} +$$ + +$$ +\beta_ {i} ^ {\text {R - e d}, h _ {i, t}} (t, \delta_ {t}) := \sigma (t - N _ {i, t - 1} + h _ {i, t} - 1) \sqrt {\frac {1 0 \log \frac {1}{\delta_ {t}}}{h _ {i , t} ^ {3}}}, +$$ + +and $h_{i,t}$ are arm-and-time-dependent window sizes and $\delta_t$ is a time-dependent confidence parameter. By choosing the window size depending linearly on the number of pulls, we are able to provide the following regret bound. + +Theorem 4.4. Let $T \in \mathbb{N}$ , then $R$ -ed-UCB (Algorithm 1) with $B_{i}(t) \equiv \hat{\mu}_{i}^{R - ed, h_{i,t}}(t) + \beta_{i}^{R - ed, h_{i,t}}(t)$ , $h_{i,t} = \lfloor \epsilon N_{i,t - 1} \rfloor$ for $\epsilon \in (0,1/2)$ and $\delta_t = t^{-\alpha}$ for $\alpha > 2$ , suffers an expected regret bounded, for every $q \in [0,1]$ , as: + +$$ +\begin{array}{l} R _ {\boldsymbol {\mu}} (R - e d - U C B, T) \leqslant \mathcal {O} \left(\frac {K}{\epsilon} (\sigma T) ^ {\frac {2}{3}} (\alpha \log T) ^ {\frac {1}{3}} \right. \\ + \frac {K T ^ {q}}{1 - 2 \epsilon} \Upsilon_ {\mu} \left(\left\lceil (1 - 2 \epsilon) \frac {T}{K} \right\rceil , q\right)\left. \right). \\ \end{array} +$$ + +This result deserves some comments. First, compared with the corresponding deterministic R-ed regret bound (Theorem 4.3), it reflects a similar dependence of the cumulative + +increment $\Upsilon_{\mu}$ , although it now involves the $\epsilon$ parameter defining the window size $h_{i,t} = \lfloor \epsilon N_{i,t - 1}\rfloor$ . Second, it includes an additional term of order $\tilde{\mathcal{O}} (T^{\frac{2}{3}})$ that is due to the noise $\sigma$ presence that increases inversely w.r.t. the $\epsilon$ . Thus, we visualize a trade-off in the choice of $\epsilon$ : larger windows $(\epsilon \approx 1)$ are beneficial for the first term, but they enlarge the constant $1 / (1 - 2\epsilon)$ multiplying the second component. + +Remark 4.2 (Comparison with Adversarial Bandits). The $R$ -ed setting can be mapped to an adversarial bandit (Auer et al., 2002) with an adaptive (i.e., non-oblivious) adversary. Indeed, the arm payoff $\mu_{i}(N_{i,t})$ can be thought to as selected by an adversary who has access to the previous learner choices (i.e., the history $\mathcal{H}_{t-1}$ ), specifically to the number of pulls $N_{i,t}$ . However, although adversarial bandit algorithms, such as EXP3 (Auer et al., 2002) and OSMD (Audibert et al., 2014), suffer $\tilde{\mathcal{O}}(\sqrt{T})$ regret, these results are not comparable with ours. Indeed, while these correspond to guarantees on the external regret, the regret definition we employ in Section 3 is a notion of policy regret (Dekel et al., 2012). + +# 5. Stochastic Rising Restless Bandits + +In this section, we consider the Rising restless bandits (R-less) in which the payoff increases at every round regardless the arm is pulled, i.e., $\mu_i(t,N_{i,t})\equiv \mu_i(t)$ . + +Oracle Policy We start recalling that the oracle greedy policy, i.e., the policy selecting at each round $t \in [T]$ the arm with largest payoff, is optimal for the non-decreasing restless bandit setting. + +Theorem 5.1 (Seznec et al., 2020). Let $\pi_{\mu}^{g}$ be the oracle greedy policy: + +$$ +\pi_{\boldsymbol{\mu}}^{g}(t)\in \operatorname *{argmax}_{i\in [K]}\{\mu_{i}(t)\} ,\quad \forall t\in [T]. +$$ + +Then, $\pi_{\mu}^{g}$ is optimal for the restless non-decreasing bandits (i.e., under Assumption 3.1). + +Notice that $\pi_{\mu}^{g}$ is optimal under the non-decreasing payoff assumption (Assumption 3.1) only, without requiring the concavity (Assumption 3.2). We can now first appreciate an important difference between rising and rotting bandits. While for the rotting bandits the oracle greedy policy is optimal for both the rested and restless settings, for the rising bandits it remains optimal in the restless case only. Indeed, for the rising rested case, as shown in Theorem 4.1, the oracle constant policy is needed to achieve optimality. + +# 5.1. Deterministic Setting + +We begin with the case of deterministic arms $(\sigma = 0)$ . Similarly to the rested case, we design an optimistic estimator of $\mu_{i}(t)$ , namely $\overline{\mu}_{i}^{\mathrm{R - less}}(t)$ , employing the exact payoffs $(\mu_{i}(t_{i,n}))_{n = 1}^{N_{i,t - 1}}$ . To this end, we exploit the non-decreasing assumption (Assumption 3.1) to derive the identity: + +$$ +\mu_ {i} (t) = \underbrace {\mu_ {i} \left(t _ {i , N _ {i , t - 1}}\right)} _ {\text {(m o s t r e c e n t p a y o f f)}} + \underbrace {\sum_ {l = t _ {i , N _ {i , t - 1}}} ^ {t - 1} \gamma_ {i} (l)} _ {\text {(s u m o f f u t u r e i n c r e m e n t s)}}. +$$ + +Then, we leverage the concavity (Assumption 3.2) to upper bound the sum of future increments with the last experienced increment that will be projected in the future for $t - t_{i,N_{i,t-1}}$ rounds, leading to the estimator: + +$$ +\begin{array}{l} \overline {{\mu}} _ {i} ^ {\mathrm {R - l e s s}} (t) := \underbrace {\mu_ {i} \left(t _ {i , N _ {i , t - 1}}\right)} _ {\text {(m o s t r e c e n t p a y o f f)}} \\ + \left(t - t _ {i, N _ {i, t - 1}}\right) \underbrace {\frac {\mu_ {i} \left(t _ {i , N _ {i , t - 1}}\right) - \mu_ {i} \left(t _ {i , N _ {i , t - 1}} - 1\right)}{t _ {i , N _ {i , t - 1}} - t _ {i , N _ {i , t - 1}} - 1}} _ {\text {(m o s t r e c e n t i n c r e m e n t)}}, \tag {5} \\ \end{array} +$$ + +if $N_{i,t - 1}\geqslant 2$ , else $\overline{\mu}_i^{\mathrm{R - less}}(t)\coloneqq +\infty$ . Lemma A.5 shows that $\overline{\mu}_i^{\mathrm{R - less}}$ is optimistic and provides a bias bound. + +Regret Analysis We now provide the regret analysis of R-less-UCB that is obtained from Algorithm 1, when setting $B_{i}(t) \equiv \overline{\mu}_{i}^{\mathrm{R - less}}(t)$ . + +Theorem 5.2. Let $T \in \mathbb{N}$ , then $R$ -less-UCB (Algorithm 1) with $B_{i}(t) \equiv \overline{\mu}_{i}^{R - less}(t)$ suffers an expected regret bounded, for every $q \in [0,1]$ , as: + +$$ +R _ {\boldsymbol {\mu}} \left(R - l e s s - U C B, T\right) \leqslant 2 K + K T ^ {\frac {q}{q + 1}} \Upsilon_ {\boldsymbol {\mu}} \left(\left\lceil \frac {T}{K} \right\rceil , q\right) ^ {\frac {1}{q + 1}}. +$$ + +Similarly to Theorem 4.3, the result depends on the free parameter $q \in [0,1]$ , that can be chosen to tighten the bound. It is worth noting that the regret bound of the R-less deterministic case (Theorem 5.2) is always smaller than that of the R-ed deterministic case (Theorem 4.3). Indeed, ignoring the dependence on $K$ , we have $R_{\mu}(\mathbb{R}\text{-less - UCB},T) = \mathcal{O}\Big(R_{\mu}(\mathbb{R}\text{-ed - UCB},T)^{\frac{1}{q + 1}}\Big)$ . The following example clarifies the role of $q$ for both the restless and rested case. + +Example 5.1. Suppose that for all $i \in [K]$ , we have $\gamma_i(l) \leqslant l^{-c}$ for $c > 0$ . The expressions of bounds on $\Upsilon_{\mu}(\cdot, q)$ have been shown in Table 1. Different values of $q \in [0,1]$ should be selected to tighten the regret bounds depending on the value of $c$ . Figure 2 reports the optimized bounds for the deterministic $R$ -less and $R$ -ed (derivation in Appendix B). + +# 5.2. Stochastic Setting + +In the stochastic setting $(\sigma >0)$ , we have access to noisy versions of $\mu_{i}$ only, i.e., $(R_{t_{i,n}})^{N_{i,t - 1}}$ . Intuitively, we might be tempted to straightforwardly extend the derivation of the rested case by averaging $h$ estimators like the ones in Equation (5), instanced with different time instants $t_{i,N_i,t - 1}$ . Unfortunately, this approach is unsuccessful for technical issues since the increment term would include the difference of time instants $t_{i,N_{i,t - 1}} - t_{i,N_{i,t - 1} - 1}$ that, in the stochastic setting, are random variables correlated with the observed rewards $R_{t_{i,n}}$ . For this reason, at the price of a larger bias, we employ the same estimator used in the stochastic rested case, defined for $h\in [N_{i,t - 1}]$ : + +$$ +\begin{array}{l} \hat {\mu} _ {i} ^ {\mathrm {R} - \text {l e s s}, h} (t) := \frac {1}{h} \sum_ {l = N _ {i, t - 1} - h + 1} ^ {N _ {i, t - 1}} \left(\underbrace {R _ {t _ {i , l}}} _ {\text {(e s t i m a t e d p a y o f f)}}\right) \\ + (t - l) \underbrace {\frac {R _ {t _ {i , l}} - R _ {t _ {i , l - h}}}{h}} _ {(\text {e s t i m a t e d i n c r e m e n t})}, \\ \end{array} +$$ + +if $h_{i,t} \leqslant \lfloor N_{i,t-1}/2 \rfloor$ , else $\hat{\mu}_i^{\mathrm{R - less},h}(t) \coloneqq +\infty$ . Additional details on the estimator construction is reported in Appendix A.2 together with its analysis. + +Regret Analysis We provide the regret analysis of R-less-UCB when we employ the exploration index analogous to that of the rested case: + +$$ +\begin{array}{l} B _ {i} (t) \equiv \widehat {\mu} _ {i} ^ {\mathrm {R - l e s s}, h _ {i, t}} (t) + \beta_ {i} ^ {\mathrm {R - l e s s}, h _ {i, t}} (t), \quad \text {w h e r e} \\ \beta_ {i} ^ {\mathrm {R - l e s s}, h _ {i, t}} (t, \delta_ {t}) := \sigma (t - N _ {i, t - 1} + h _ {i, t} - 1) \sqrt {\frac {1 0 \log \frac {1}{\delta_ {t}}}{h _ {i , t} ^ {3}}}, \\ \end{array} +$$ + +and $h_{i,t}$ are a arm-and-time-dependent window sizes and $\delta_t$ is a time-dependent confidence. The regret bound is given by the following result. + +Theorem 5.3. Let $T \in \mathbb{N}$ , then $R$ -less-UCB (Algorithm 1) with $B_{i}(t) \equiv \hat{\mu}_{i}^{R - less, h_{i,t}}(t) + \beta_{i}^{R - less, h_{i,t}}(t)$ , $h_{i,t} = \lfloor \epsilon N_{i,t - 1} \rfloor$ for $\epsilon \in (0,1/2)$ , and $\delta_t = t^{-\alpha}$ for $\alpha > 2$ , suffices an expected regret bounded, for every $q \in [0,1]$ , as: + +$$ +\begin{array}{l} R _ {\mu} (R - l e s s - U C B, T) \leqslant \mathcal {O} \left(\frac {K}{\epsilon} (\sigma T) ^ {\frac {2}{3}} (\alpha \log T) ^ {\frac {1}{3}} \right. \\ + \frac {K T ^ {\frac {2 q}{1 + q}} (\log T) ^ {\frac {q}{1 + q}}}{\epsilon (1 - 2 \epsilon)} \Upsilon_ {\mu} \left(\left\lceil (1 - 2 \epsilon) \frac {T}{K} \right\rceil , q\right) ^ {\frac {1}{1 + q}}\left. \right). \\ \end{array} +$$ + +Some observations are in order. First, compared to the bound for the rested case in Theorem 4.4, we note the same dependence of $\tilde{\mathcal{O}}(T^{\frac{2}{3}})$ due to the noise presence $\sigma$ . Concerning the second term, compared with the one of the deterministic case (Theorem 5.2), we worsen the dependence on $T$ and an inverse dependence on the $\epsilon$ and $1 - 2\epsilon$ + +parameters appear. This is due to the usage of the $h$ -wide window instead of the last sample and that, all other things being equal, the estimator employed for the stochastic case, as already discussed, is looser compared to the one for the deterministic case. Finally, our result is not fully comparable with (Besbes et al., 2014) for generic non-stationary bandits with bounded variation because, as already mentioned, $\Upsilon_{\mu}([T / K],q)$ may be smaller than $V_{T}$ . Moreover, we achieve such a bound with no knowledge about $\Upsilon_{\mu}$ , while the work by (Besbes et al., 2014) requires knowing $V_{T}$ . + +# 6. Numerical Simulations + +We numerically tested R-less-UCB and R-ed-UCB w.r.t. state-of-the-art algorithms for non-stationary MABs in the restless and rested settings, respectively. $^6$ + +Algorithms We consider the following baseline algorithms: Rexp3 (Besbes et al., 2014), a non-stationary MAB algorithm based on variation budget, KL-UCB (Garivier & Cappé, 2011), one of the most effective stationary MAB algorithms, Ser4 (Allesiardo et al., 2017), which considers best arm switches during the process, and sliding-window algorithms such as SW-UCB (Garivier & Moulines, 2011), SW-KL-UCB (Combes & Proutiere, 2014), and SW-TS (Trovò et al., 2020) that are generally able to deal with non-stationary restless settings. The parameters for all the baseline algorithms have been set as recommended in the corresponding papers (see also Appendix E). For our algorithms, the window is set as $h_{i,t} = \lfloor \epsilon N_{i,t - 1} \rfloor$ (as prescribed by Theorems 4.4 and 5.3). We remark that while the baseline algorithms are suited for the restless case, in the rested case, no algorithm has been designed to cope with the stochastic rising setting, provided that no knowledge on the payoff function is available. We compare the algorithms in terms of empirical cumulative regret $\widehat{R}_{\mu}(\pi ,t)$ , which is the empirical counterpart of the expected cumulative regret $R_{\mu}(\pi ,t)$ at round $t$ averaged over multiple independent runs. + +# 6.1. Restless setting + +To evaluate R-less-UCB in the restless setting, we run the aforementioned algorithms on a problem with $K = 15$ arms over a time horizon of $T = 200,000$ rounds, setting $\epsilon = 1/4$ . The payoff functions $\mu_i(\cdot)$ are chosen in these families: $F_{\mathrm{exp}} = \{f(t) = c(1 - e^{-at})\}$ and $F_{\mathrm{poly}} = \{f(t) = c(1 - b(t + b^{1/\rho})^{-\rho})\}$ , where $a, c, \rho \in (0,1]$ and $b \in \mathbb{R}_{\geqslant 0}$ are parameters, whose values have been selected randomly. By construction all functions $f \in F_{\mathrm{exp}} \cup F_{\mathrm{poly}}$ satisfy + +![](images/ef93b89abe1a435a0ba2be46e2e7fb9d46e66a16e00f1fdd95640ad2480ca609.jpg) +Figure 3. 15 arms bandit setting: (a) first 6000 rounds/pulls of the payoff functions, (b) cumulative regret in the R-less scenario, (c) cumulative regret in the R-ed scenario (100 runs $95\%$ c.i.). + +![](images/3978d12f8926fd610c87b810244f2329da4477e40162f15d14c4e8af5978ba85.jpg) + +![](images/9ea154e2b5c202382b5a5e2beb42a15b456f7f48d258829fa818b223a9c05b00.jpg) + +![](images/94185e79630f193f8cb0217745c884e5d04ff669d585c806f3427f4dec2c12d5.jpg) +Figure 4.2 arms R-ed bandit setting: (a) payoff functions, (b) cumulative regret (100 runs, $95\%$ c.i.). + +![](images/06881e51ee2e3e956bc2f72a70407b094297abbef10627a9e82b3f363a639c27.jpg) +Figure 5. Cumulative regret in the online model selection on IMDB dataset (30 runs, $95\%$ c.i.). + +![](images/32f87b4207262ec594ba200520f6317f40e2a9566fdacb70c1ff52c21555f114.jpg) + +Assumptions 3.1 and 3.2. The functions coming from $F_{\mathrm{exp}}$ (exponential functions) have a sudden increase, while ones from $F_{\mathrm{poly}}$ (polynomial functions) have a slower growth rate, leading to different cumulative increments $\Upsilon_{\mu}$ . The stochasticity is realized by adding a Gaussian noise with $\sigma = 0.1$ . The generated functions are shown in Figure 3a. + +The empirical cumulative regret $\widehat{R}_{\mu}(\pi, t)$ is provided in Figure 3b. The results show that SW-TS is the algorithm that achieves the lowest regret at the horizon, even though its performance at the beginning is worse than the other algorithms. As commonly happening in practice, TS-based approaches tend to outperform UCB ones. Indeed, R-less-UCB displays the second-best curve overall and achieves the best performance among the UCB-like algorithms. + +# 6.2. Rested setting + +We employ the same arms generated for the restless case to evaluate R-ed-UCB in the rested setting. We plot the empirical cumulative regret in Figure 3c. SW-TS is confirmed as the best algorithm at the end of the time horizon, although other algorithms (SW-UCB and SW-KL-UCB) suffer less regret at the beginning of learning. R-ed-UCB pays the price of the initial exploration, but at the end of the horizon, it manages to achieve the second-best performance. Notice + +that, besides R-ed-UCB, all other baseline algorithms are designed for the restless setting and are not endowed with any guarantee on the regret in the rested scenario. + +To highlight this fact, we designed a particular 2-arms rising rested bandit in which the optimal arm reveals only when pulled a sufficient number of times (linear in $T$ ). The payoff functions, fulfilling Assumptions 3.1 and 3.2, are shown in Figure 4a and the algorithms' empirical regrets in Figure 4b. Note that in this setting the expected (instantaneous) regret may be negative for $t < \frac{19T}{400}$ , and this is the case for most of the algorithms for $t < 20,000$ . While for the first $\approx 20,000$ rounds R-ed-UCB is on par with the other algorithms, it outperforms all the other policies over a longer run. Note that the regret for Rexp3 and Ser4 is decreasing the slope for $t > 40,000$ , meaning that they are somehow reacting to the change in the reward of the two arms. SW-TS starts reacting even later, at around $t \approx 100,000$ . However, they are not prompt to detect such a change in the rewards and, therefore, collect a large regret in the first part of the learning process. The other algorithms suffer a linear regret at the end of the time horizon since they do not employ forgetting mechanisms or because the sliding window should be tuned knowing the characteristics of the expected reward. + +# 6.3. IMDB dataset (rested) + +We investigate the performance of R-ed-UCB on an online model selection task for a real-world dataset. We employ the IMDB dataset, made of 50,000 reviews of movies (scores from 0 to 10). We preprocessed the data as done by Maas et al. (2011) to obtain a binary classification problem. Each review $x_{t}$ lies in a $d = 10,000$ dimensional feature space, where each feature is the frequency of the most common English words. Each arm corresponds to a different online optimization algorithm, i.e., two of them are Online Logistic Regression algorithms with different learning rate schemes, and the other five are Neural Networks with different topologies. We provide additional information on the arms of the bandit in Appendix E.2. At each round, a sample $x_{t}$ is randomly selected from the dataset, a reward of 1 is generated for a correct classification, 0 otherwise, and, finally, the online update step is performed for the chosen algorithm. + +The empirical regret is plotted in Figure 5. We can see that $\mathsf{R} - \mathsf{ed} - \mathsf{UCB}$ , with $\epsilon = 1 / 32$ outperforms the considered baselines. Compared to the synthetic simulations, the smaller window choice is justified by the fact that we need to take into account that the average learning curves of the classification algorithms are not guaranteed to be non-decreasing nor concave on the single run. However, keeping the window linear in $N_{i,t-1}$ is crucial for the regret guarantees of Theorem 4.4. + +# 7. Discussion and Conclusions + +This paper studied the MAB problem when the payoffs are non-decreasing functions that evolve either when pulling the corresponding arm (rested) or for time passing (restless). We showed that, for the rested case, an assumption on the payoff (e.g., concavity) is essential to make the problem learnable. We presented novel algorithms that suitably employ the concavity assumption to build proper estimators for both settings. These algorithms are proven to suffer a regret made of a first instance-independent component of $\tilde{\mathcal{O}}(T^{\frac{2}{3}})$ and an instance-dependent component involving the cumulative increment function $\Upsilon_{\mu}(\cdot, q)$ . For the rested setting, ours represent the first no-regret algorithm for the stochastic rising bandits. The experimental evaluation confirmed our theoretical findings showing advantages over state-of-the-art algorithms designed for non-stationary bandits, especially in the rested setting. The natural future research direction consists of studying the complexity of the learning problem in stochastic rising rested and restless bandits, focusing on deriving suitable regret lower bounds. Other future works include investigating the best-arm identification setting and, motivated by the online model selection, analysing the alternative case in which the optimization algorithms associated with the arms act on a shared vector of parameters. + +# References + +Abbasi-Yadkori, Y., Pacchiano, A., and Phan, M. Regret balancing for bandit and RL model selection. CoRR, abs/2006.05491, 2020. +Agarwal, A., Luo, H., Neyshabur, B., and Schapire, R. E. Corralling a band of bandit algorithms. In Kale, S. and Shamir, O. (eds.), Proceedings of the Conference on Learning Theory (COLT), volume 65, pp. 12-38, 2017. +Allesiardo, R., Féraud, R., and Maillard, O.-A. The nonstationary stochastic multi-armed bandit problem. International Journal of Data Science and Analytics, 3(4): 267-283, 2017. +Arora, R., Marinov, T. V., and Mohri, M. Corralling stochastic bandit algorithms. In Banerjee, A. and Fukumizu, K. (eds.), Proceedings of the international conference on Artificial Intelligence and Statistics (AISTATS), volume 130, pp. 2116-2124, 2021. +Audibert, J., Bubeck, S., and Lugosi, G. Regret in online combinatorial optimization. Math. Oper. Res., 39(1):31-45, 2014. +Auer, P., Cesa-Bianchi, N., Freund, Y., and Schapire, R. E. Gambling in a rigged casino: The adversarial multi-armed bandit problem. In Proceedings of the IEEE annual symposium on Foundations of Computer Science (FOCS), pp. 322-331, 1995. +Auer, P., Cesa-Bianchi, N., Freund, Y., and Schapire, R. E. The nonstochastic multiarmed bandit problem. SIAM J. Comput., 32(1):48-77, 2002. +Auer, P., Gajane, P., and Ortner, R. Adaptively tracking the best bandit arm with an unknown number of distribution changes. In Beygelzimer, A. and Hsu, D. (eds.), Proceedings of the Conference on Learning Theory (COLT), volume 99, pp. 138-158, 2019. +Besbes, O., Gur, Y., and Zeevi, A. Stochastic multi-armed-bandit problem with non-stationary rewards. In Proceedings of the conference on Neural Information Processing Systems (NeurIPS), volume 27, pp. 199–207, 2014. +Besson, L., Kaufmann, E., Maillard, O.-A., and Seznec, J. Efficient change-point detection for tackling piecewise-stationary bandits. arXiv preprint arXiv:1902.01575, 2019. +Bubeck, S., Munos, R., Stoltz, G., and Szepesvári, C. Online optimization in x-armed bandits. In Advances in Neural Information Processing Systems 21 (NIPS), pp. 201-208, 2008. + +Cao, Y., Wen, Z., Kveton, B., and Xie, Y. Nearly optimal adaptive procedure with change detection for piecewise-stationary bandit. In The international conference on Artificial Intelligence and Statistics (AISTATS), pp. 418-427, 2019. +Cella, L., Pontil, M., and Gentile, C. Best model identification: A rested bandit formulation. In Meila, M. and Zhang, T. (eds.), Proceedings of the International Conference on Machine Learning (ICML), volume 139, pp. 1362-1372, 2021. +Chen, Y., Lee, C., Luo, H., and Wei, C. A new algorithm for non-stationary contextual bandits: Efficient, optimal and parameter-free. In Proceedings of the Conference on Learning Theory (COLT), volume 99, pp. 696-726, 2019. +Combes, R. and Proutiere, A. Unimodal bandits: Regret lower bounds and optimal algorithms. In Proceedings of the International Conference on Machine Learning (ICML), pp. 521-529, 2014. +Dekel, O., Tewari, A., and Arora, R. Online bandit learning against an adaptive adversary: from regret to policy regret. In Proceedings of the 29th International Conference on Machine Learning (ICML), 2012. +Doob, J. L. Stochastic processes, volume 7. Wiley New York, 1953. +Garivier, A. and Cappé, O. The kl-ucb algorithm for bounded stochastic bandits and beyond. In Proceedings of the Conference on Learning Theory (COLT), pp. 359-376, 2011. +Garivier, A. and Moulines, E. On upper-confidence bound policies for switching bandit problems. In Proceedings of the international conference on Algorithmic Learning Theory (ALT), pp. 174-188, 2011. +Heidari, H., Kearns, M. J., and Roth, A. Tight policy regret bounds for improving and decaying bandits. In Kambhampati, S. (ed.), Proceedings of the International Joint Conference on Artificial Intelligence (IJCAI), pp. 1562-1570, 2016. +Lattimore, T. and Szepesvári, C. Bandit algorithms. Cambridge University Press, 2020. +Levine, N., Crammer, K., and Mannor, S. Rotting bandits. In Guyon, I., von Luxburg, U., Bengio, S., Wallach, H. M., Fergus, R., Vishwanathan, S. V. N., and Garnett, R. (eds.), Proceedings of the conference on Neural Information Processing Systems (NeurIPS), pp. 3074-3083, 2017. +Li, Y., Jiang, J., Gao, J., Shao, Y., Zhang, C., and Cui, B. Efficient automatic CASH via rising bandits. In Proceedings of the Conference on Artificial Intelligence (AAAI), pp. 4763-4771, 2020. + +Liu, F., Lee, J., and Shroff, N. A change-detection based framework for piecewise-stationary multi-armed bandit problem. In Proceedings of the Conference on Artificial Intelligence (AAAI), volume 32, 2018. +Maas, A., Daly, R. E., Pham, P. T., Huang, D., Ng, A. Y., and Potts, C. Learning word vectors for sentiment analysis. In Proceedings of the annual meeting of the association for computational linguistics: Human Language Technologies (HLT), pp. 142-150, 2011. +Mintz, Y., Aswani, A., Kaminsky, P., Flowers, E., and Fukuoka, Y. Nonstationary bandits with habituation and recovery dynamics. Operations Research, 68(5):1493-1516, 2020. +Ortner, R., Ryabko, D., Auer, P., and Munos, R. Regret bounds for restless markov bandits. In Proceedings of the international conference on Algorithmic Learning Theory (ALT), pp. 214-228, 2012. +Pacchiano, A., Dann, C., Gentile, C., and Bartlett, P. Regret bound balancing and elimination for model selection in bandits and rl. arXiv preprint arXiv:2012.13045, 2020a. +Pacchiano, A., Phan, M., Abbasi-Yadkori, Y., Rao, A., Zimmert, J., Lattimore, T., and Szepesvári, C. Model selection in contextual stochastic bandit problems. In Proceedings of the conference on Neural Information Processing Systems (NeurIPS), 2020b. +Pike-Burke, C. and Grunewalder, S. Recovering bandits Proceedings of the conference on Neural Information Processing Systems (NeurIPS), 32:14122-14131, 2019. +Russac, Y., Vernade, C., and Cappé, O. Weighted linear bandits for non-stationary environments. In Proceedings of the conference on Neural Information Processing Systems (NeurIPS), 2019. +Seznec, J., Locatelli, A., Carpentier, A., Lazaric, A., and Valko, M. Rotting bandits are no harder than stochastic ones. In Proceedings of the international conference on Artificial Intelligence and Statistics (AISTATS), volume 89, pp. 2564-2572, 2019. +Seznec, J., Ménard, P., Lazaric, A., and Valko, M. A single algorithm for both restless and rested rotting bandits. In Proceedings of the international conference on Artificial Intelligence and Statistics (AISTATS), volume 108, pp. 3784-3794, 2020. +Tekin, C. and Liu, M. Online learning of rested and restless bandits. IEEE Transaction on Information Theory, 58(8): 5588-5611, 2012. +Trovò, F., Paladino, S., Restelli, M., and Gatti, N. Sliding-window Thompson sampling for non-stationary settings. + +Journal of Artificial Intelligence Research, 68:311-364, 2020. +Wang, S., Huang, L., and Lui, J. C. S. Restless-ucb, an efficient and low-complexity algorithm for online restless bandits. In Advances in Neural Information Processing Systems (NeurIPS), volume 33, pp. 11878-11889. Curran Associates, Inc., 2020. + +# A. Proofs and Derivations + +In this section, we provide the proof of the results presented in the main paper. + +# A.1. Proofs of Section 4 + +Theorem 4.1 (Heidari et al., 2016). Let $\pi_{\mu,T}^c$ be the oracle constant policy: + +$$ +\pi_ {\boldsymbol {\mu}, T} ^ {c} (t) \in \operatorname * {a r g m a x} _ {i \in [ K ]} \left\{\sum_ {l \in [ T ]} \mu_ {i} (l) \right\}, \quad \forall t \in [ T ]. +$$ + +Then, $\pi_{\mu,T}^{c}$ is optimal for the rested non-decreasing bandits (i.e., under Assumption 3.1). + +Proof. The proof is reported in Proposition 1 of (Heidari et al., 2016). + +Lemma A.1. In the noiseless $(\sigma = 0)$ setting, there exists a 2-armed non-increasing non-concave bandit such that any learning policy $\pi$ suffers regret: + +$$ +R _ {\mu} (\pi , T) \geqslant \left\lfloor \frac {T}{1 2} \right\rfloor . +$$ + +Proof. Let $\pmb{\mu}^{A}$ and $\pmb{\mu}^{B}$ be two non-concave non-decreasing rested bandits, defined as: + +$$ +\mu_ {1} ^ {A} (n) = \mu_ {1} ^ {B} (n) = \frac {1}{2}, +$$ + +$$ +\mu_ {2} ^ {A} (n) = \left\{ \begin{array}{l l} 0 & \text {i f} n \leqslant \left\lfloor \frac {T}{3} \right\rfloor , \\ 1 & \text {o t h e r w i s e}, \end{array} \right. +$$ + +$$ +\mu_ {2} ^ {B} (n) = 0. +$$ + +It is clear that for $\pmb{\mu}^{A}$ the optimal arm is 2, whereas for bandit $\pmb{\mu}^{B}$ the optimal arm is 1, having optimal performance respectively $J_{\pmb{\mu}^{A}}^{*}(T) = \left\lceil \frac{2}{3} T\right\rceil$ and $J_{\pmb{\mu}^{B}}^{*}(T) = \frac{T}{2}$ . + +![](images/a7d255254161bc9b721c874f73364a3fa068f3aaf05ec579182309396ec83194.jpg) + +![](images/58bbf3ebdac3827b6bd5b643b8be64988a4f7b23050397cc55c5dc259bd80194.jpg) + +Let $\pi$ be an arbitrary policy. Since the learner will receive the same rewards for both bandits until at least $\left\lfloor \frac{T}{3} \right\rfloor$ . Thus, we have: + +$$ +\pi (\mathcal {H} _ {t} (\boldsymbol {\mu} ^ {A})) = \pi (\mathcal {H} _ {t} (\boldsymbol {\mu} ^ {B})) \Longrightarrow \underset {\boldsymbol {\mu} ^ {A}} {\mathbb {E}} \left[ N _ {1, \lfloor \frac {T}{3} \rfloor} \right] = \underset {\boldsymbol {\mu} ^ {B}} {\mathbb {E}} \left[ N _ {1, \lfloor \frac {T}{3} \rfloor} \right] =: n _ {1}. +$$ + +Let us now compute the performance of policy $\pi$ in the two bandits and the corresponding regrets. Let us start with $\mu^A$ : + +$$ +\begin{array}{l} J _ {\boldsymbol {\mu} ^ {A}} (\pi , T) = \frac {1}{2} \underset {\boldsymbol {\mu} ^ {A}} {\mathbb {E}} [ N _ {1, T} ] + \max \left\{0, \underset {\boldsymbol {\mu} ^ {A}} {\mathbb {E}} [ N _ {2, T} ] - \left\lfloor \frac {T}{3} \right\rfloor \right\} (6) \\ = \frac {1}{2} \underset {\boldsymbol {\mu} ^ {A}} {\mathbb {E}} [ N _ {1, T} ] + \max \left\{0, \left\lceil \frac {2}{3} T \right\rceil - \underset {\boldsymbol {\mu} ^ {A}} {\mathbb {E}} [ N _ {1, T} ] \right\}, (7) \\ \end{array} +$$ + +where Equation (6) follows from observing that we get reward from arm 2 only if we pull it more than $\left\lfloor \frac{T}{3} \right\rfloor$ times and Equation (7) derives from observing that $T = \mathbb{E}_{\mu^A}[N_{1,T}] + \mathbb{E}_{\mu^A}[N_{2,T}]$ . Now, consider the two cases: + +Case (i): $\mathbb{E}_{\mu^A}[N_{1,T}]\geqslant \left\lceil \frac{2}{3} T\right\rceil$ + +$$ +J _ {\boldsymbol {\mu} ^ {A}} (\pi , T) = \frac {1}{2} \underset {\boldsymbol {\mu} ^ {A}} {\mathbb {E}} \left[ N _ {1, T} \right], +$$ + +that is maximized by taking $\mathbb{E}_{\pmb{\mu}^A}[N_{1,T}] = T$ + +Case (ii): $\mathbb{E}_{\mu^A}[N_{1,T}] < \left[\frac{2}{3} T\right]$ + +$$ +J _ {\boldsymbol {\mu} ^ {A}} (\pi , T) = \left\lceil \frac {2}{3} T \right\rceil - \frac {1}{2} \mathbb {E} _ {\boldsymbol {\mu} ^ {A}} [ N _ {1, T} ], +$$ + +that is maximized by taking the minimum value of \(\mathbb{E}_{\mu^A}[N_{1,T}]\) possible, that is \(\mathbb{E}_{\mu^A}[N_{1,T}] \geqslant \mathbb{E}_{\mu^A}[N_{1,\left[\frac{T}{3}\right]}\] = n1. Putting all together, we have: + +$$ +J _ {\boldsymbol {\mu} ^ {A}} (\pi , T) \leqslant \max \left\{\frac {T}{2}, \left\lceil \frac {2}{3} T \right\rceil - \frac {n _ {1}}{2} \right\} = \left\lceil \frac {2}{3} T \right\rceil - \frac {n _ {1}}{2}, +$$ + +having observed that $n_1 \leqslant \left\lfloor \frac{T}{3} \right\rfloor$ . Let us now focus on the regret: + +$$ +R _ {\boldsymbol {\mu} ^ {A}} (\pi , T) = J _ {\boldsymbol {\mu} ^ {A}} ^ {*} (T) - J _ {\boldsymbol {\mu} ^ {A}} (\pi , T) = \left\lceil \frac {2}{3} T \right\rceil - \left\lceil \frac {2}{3} T \right\rceil + \frac {n _ {1}}{2} = \frac {n _ {1}}{2}. +$$ + +Consider now bandit $\pmb{\mu}^{B}$ , we have: + +$$ +J _ {\boldsymbol {\mu} ^ {B}} (\pi , T) = \frac {1}{2} \underset {\boldsymbol {\mu} ^ {B}} {\mathbb {E}} [ N _ {1, T} ] \leqslant \frac {n _ {1}}{2} + \left\lfloor \frac {T}{3} \right\rfloor , +$$ + +having observed that $\mathbb{E}_{\pmb{\mu}^B}[N_{1,T}] = n_1 + \mathbb{E}_{\pmb{\mu}^B}[N_{1,T}] - \mathbb{E}_{\pmb{\mu}^B}[N_{1,\lfloor \frac{T}{3}\rfloor}] \leqslant n_1 + \lceil \frac{2}{3} T\rceil$ . Let us now compute the regret: + +$$ +R _ {\boldsymbol {\mu} ^ {B}} (\pi , T) = J _ {\boldsymbol {\mu} ^ {B}} ^ {*} (T) - J _ {\boldsymbol {\mu} ^ {B}} (\pi , T) = \frac {T}{2} - \frac {n _ {1}}{2} - \left\lfloor \frac {T}{3} \right\rfloor = \left\lceil \frac {T}{6} \right\rceil - \frac {n _ {1}}{2}. +$$ + +Finally, the worst-case regret can be lower bounded as follows: + +$$ +\inf_{\pi}\sup_{\boldsymbol{\mu}}R_{\boldsymbol{\mu}}(\pi ,T)\geqslant \inf_{\pi}\max \left\{R_{\boldsymbol{\mu}^{A}}(\pi ,T),R_{\boldsymbol{\mu}^{B}}(\pi ,T)\right\} = \inf_{n_{1}\in \left[0,\lfloor \frac{T}{3}\rfloor \right]} \max \left\{\frac{n_{1}}{2},\left\lceil \frac{T}{6}\right\rceil -\frac{n_{1}}{2}\right\} \geqslant \frac{1}{2}\left\lceil \frac{T}{6}\right\rceil \geqslant \left\lfloor \frac{T}{12}\right\rfloor , +$$ + +having minimized over $n_1$ . + +Theorem 4.2 (Non-Learnability). There exists a 2-armed non-decreasing (non-concave) deterministic rested bandit with $\gamma_{i}(n)\leqslant \gamma_{\mathrm{max}}\leqslant 1$ for all $i\in [K]$ and $n\in \mathbb{N}$ , such that any learning policy $\pi$ suffers regret: + +$$ +R _ {\boldsymbol {\mu}} (\pi , T) \geqslant \left\lfloor \frac {\gamma_ {\max}}{1 2} T \right\rfloor . +$$ + +Proof. It is sufficient to rescale the mean function of the proof of Lemma A.1 by the quantity $\gamma_{\mathrm{max}}$ . + +Lemma A.2. For every arm $i\in [K]$ and every round $t\in [T]$ , let us define: + +$$ +\bar {\mu} _ {i} ^ {R - e d} (t) := \mu_ {i} \left(N _ {i, t - 1}\right) + \left(t - N _ {i, t - 1}\right) \gamma_ {i} \left(N _ {i, t - 1} - 1\right), +$$ + +if $N_{i,t - 1}\geqslant 2$ else $\overline{\mu}_i^{R - ed}(t)\coloneqq +\infty$ . Then, $\overline{\mu}_i^{R - ed}(t)\geqslant \mu_i(t)$ and, if $N_{i,t - 1}\geqslant 2$ , it holds that: + +$$ +\bar {\mu} _ {i} ^ {R - e d} (t) - \mu_ {i} \left(N _ {i, t}\right) \leqslant \left(t - N _ {i, t - 1}\right) \gamma_ {i} \left(N _ {i, t - 1} - 1\right). +$$ + +Proof. Let us consider the following derivation: + +$$ +\mu_ {i} (t) = \mu_ {i} \left(N _ {i, t - 1}\right) + \sum_ {n = N _ {i, t - 1}} ^ {t - 1} \gamma_ {i} (n) \leqslant \mu_ {i} \left(N _ {i, t - 1}\right) + (t - N _ {i, t - 1}) \gamma_ {i} \left(N _ {i, t - 1} - 1\right) =: \bar {\mu} _ {i} ^ {\mathrm {R} - \mathrm {e d}} (t), +$$ + +where the inequality holds thanks to Assumption 3.2, having observed that $\sum_{n = N_{i,t - 1}}^{t - 1}\gamma_i(n)\leqslant (t - N_{i,t - 1})\gamma_i(N_{i,t - 1})\leqslant$ $(t - N_{i,t - 1})\gamma_i(N_{i,t - 1} - 1)$ . For the bias bound, when $N_{i,t - 1}\geqslant 2$ , we consider the following derivation: + +$$ +\overline {{\mu}} _ {i} ^ {\text {R - e d}} (t) - \mu_ {i} \left(N _ {i, t}\right) = \mu_ {i} \left(N _ {i, t - 1}\right) + (t - N _ {i, t - 1}) \gamma_ {i} \left(N _ {i, t - 1} - 1\right) - \mu_ {i} \left(N _ {i, t}\right) \leqslant \left(t - N _ {i, t - 1}\right) \gamma_ {i} \left(N _ {i, t - 1} - 1\right). +$$ + +having observed that $\mu_i(N_{i,t-1}) \leqslant \mu_i(N_{i,t})$ by Assumption 3.1. + +Theorem 4.3. Let $T \in \mathbb{N}$ , then $R$ -ed-UCB (Algorithm 1) with $B_{i}(t) \equiv \overline{\mu}_{i}^{R - ed}(t)$ suffers an expected regret bounded, for every $q \in [0,1]$ , as: + +$$ +R _ {\boldsymbol {\mu}} (R - e d - U C B, T) \leqslant 2 K + K T ^ {q} \Upsilon_ {\boldsymbol {\mu}} \left(\left\lceil \frac {T}{K} \right\rceil , q\right). +$$ + +Proof. We have to analyze the following expression: + +$$ +R _ {\boldsymbol {\mu}} (\mathbb {R} \text {- e d - U C B}, T) = \sum_ {t = 1} ^ {T} \mu_ {i *} (t) - \mu_ {I _ {t}} (N _ {i, t}), +$$ + +where $i^{*} \in \arg \max_{i \in [K]} \left\{ \sum_{l \in [T]} \mu_{i}(l) \right\}$ . We consider a term at a time, use $B_{i}(t) \equiv \overline{\mu}_{i}^{\mathbb{R} - \mathrm{ed}}(t)$ , and we exploit the optimism, i.e., $B_{i^{*}}(t) \leqslant B_{I_{t}}(t)$ : + +$$ +\begin{array}{l} \mu_ {i} * (t) - \mu_ {I _ {t}} (N _ {I _ {t}, t}) + B _ {I _ {t}} (t) - B _ {I _ {t}} (t) \leqslant \min \left\{1, \underbrace {\mu_ {i} * (t) - B _ {i} * (t)} _ {\leqslant 0} + B _ {I _ {t}} (t) - \mu_ {I _ {t}} (N _ {I _ {t}, t}) \right\} \\ \leqslant \min \left\{1, B _ {I _ {t}} (t) - \mu_ {I _ {t}} \left(N _ {I _ {t}, t}\right) \right\}. \\ \end{array} +$$ + +Now we work on the term inside the minimum when $N_{I_t,t - 1}\geqslant 2$ + +$$ +B _ {I _ {t}} (t) - \mu_ {I _ {t}} \left(N _ {I _ {t}, t}\right) = \bar {\mu} _ {i} ^ {\mathrm {R} - \mathrm {e d}} (t) - \mu_ {I _ {t}} \left(N _ {I _ {t}, t}\right) \leqslant \left(t - N _ {i, t - 1}\right) \gamma_ {I _ {t}} \left(N _ {i, t - 1} - 1\right), +$$ + +where the inequality follows from Lemma A.2. We are going to decompose the summation of this term over the $K$ arms: + +$$ +\begin{array}{l} R _ {\mu} (\mathbb {R} - \operatorname {e d} - \operatorname {U C B}, T) \leqslant \sum_ {t = 1} ^ {T} \min \left\{1, (t - N _ {i, t - 1}) \gamma_ {I _ {t}} \left(N _ {i, t - 1} - 1\right) \right\} \\ \leqslant 2 K + \sum_ {i \in [ K ]} \sum_ {j = 3} ^ {N _ {i, T}} \min \left\{1, \left(t _ {i, j} - (j - 1)\right) \gamma_ {i} (j - 2) \right\}, \\ \end{array} +$$ + +where $t_{i,j} \in [T]$ is the round at which arm $i \in [K]$ was pulled for the $j$ -th time. Now, $q \in [0,1]$ , then for any $x \geqslant 0$ it holds that + +$\min \{1,x\} \leqslant \min \{1,x\} ^q\leqslant x^q$ . By applying this latter inequality to the inner summation, we get: + +$$ +\sum_ {j = 3} ^ {N _ {i, T}} \min \left\{1, \left(t _ {i, j} - (j - 1)\right) \gamma_ {i} (j - 2) \right\} \leqslant \sum_ {j = 3} ^ {N _ {i, T}} \min \left\{1, T \gamma_ {i} (j - 2) \right\} \leqslant T ^ {q} \sum_ {j = 3} ^ {N _ {i, T}} \gamma_ {i} (j - 2) ^ {q}, +$$ + +having used $t_{i,j} - (j - 1)\leqslant T$ . Summing over the arms, we obtain: + +$$ +T ^ {q} \sum_ {i \in [ K ]} \sum_ {j = 3} ^ {N _ {i, T}} \gamma_ {i} (j - 2) ^ {q} \leqslant T ^ {q} \sum_ {i \in [ K ]} \Upsilon_ {\boldsymbol {\mu}} (N _ {i, T}, q) \leqslant T ^ {q} K \Upsilon_ {\boldsymbol {\mu}} \left(\left\lceil \frac {T}{K} \right\rceil , q\right), +$$ + +where the last inequality is obtained from Lemma C.2. + +Estimator Construction for the Stochastic Rising Rested Setting Before moving to the proofs, we provide some intuition behind the estimator construction. We start observing that for every $l \in \{2, \dots, N_{i,t-1}\}$ , we have that: + +$$ +\mu_ {i} (t) = \underbrace {\mu_ {i} (l)} _ {\text {(p a s t p a y o f f)}} + \sum_ {j = l} ^ {t - 1} \gamma_ {i} (j) \leqslant \underbrace {\mu_ {i} (l)} _ {\text {(p a s t p a y o f f)}} + (t - l) \underbrace {\gamma_ {i} (l - 1)} _ {\text {(p a s t i n c r e m e n t)}}, +$$ + +where the inequality follows from Assumption 3.2. Since we do not have access to the exact payoffs $\mu_i(l)$ and exact increments $\gamma_i(l - 1) = \mu_i(l) - \mu_i(l - 1)$ , one may be tempted to directly replace them with the corresponding point estimates $R_{t_{i,l}}$ and $R_{t_{i,l}} - R_{t_{i,l - 1}}$ and average the resulting estimators for a window of the most recent $h$ values of $l$ . Unfortunately, while replacing $\mu_i(l)$ with $R_{t_{i,l}}$ is a viable option, replacing $\gamma_i(l - 1)$ with $R_{t_{i,l}} - R_{t_{i,l - 1}}$ will prevent concentration since the estimate $R_{i,t_l} - R_{i,t_{l - 1}}$ is too unstable. To this end, before moving to the estimator, we need a further bounding step to get a more stable, although looser, quantity. Based on Lemma C.3, we bound for every $l\in \{2,\dots,N_{i,t - 1}\}$ and $h\in [l - 1]$ : + +$$ +\underbrace {\gamma_ {i} (l - 1)} _ {\text {(p a s t i n c r e m e n t a t l)}} \leqslant \underbrace {\frac {\mu_ {i} (l) - \mu_ {i} (l - h)}{h}} _ {\text {(a v e r a g e p a s t i n c r e m e n t o v e r \{l - h , \dots , l \})}}. +$$ + +We can now introduce the optimistic approximation of $\mu_{i}(t)$ , i.e., $\widetilde{\mu}_{i}^{\mathrm{R - ed},h}(t)$ , and the corresponding estimator, i.e., $\widehat{\mu}_i^{\mathrm{R - ed},h}(t)$ that are defined in terms of a window of size $1\leqslant h\leqslant \lfloor N_{i,t - 1} / 2\rfloor$ + +$$ +\widetilde{\mu}_{i}^{\text{R - ed},h}(t):= \frac{1}{h}\sum_{l = N_{i,t - 1} - h + 1}^{N_{i,t - 1}}\Bigg(\underbrace{\mu_{i}(l)}_{(\text{past payoff})} + (t - l)\underbrace{\frac{\mu_{i}(l) - \mu_{i}(l - h)}{h}}_{(\text{average past increment})}\Bigg), +$$ + +$$ +\widehat{\mu}_{i}^{\text{R - ed},h}(t):= \frac{1}{h}\sum_{l = N_{i,t - 1} - h + 1}^{N_{i,t - 1}}\left(\underbrace{R_{t_{i,l}}} _ {(\text{estimated past payoff})} + (t - l)\quad \underbrace{\frac{R_{t_{i,l}} - R_{t_{i,l - h}}}{h}}_{(\text{estimated average past increment})}\right). +$$ + +The proof is composed of the following steps: + +(i) Lemma A.3 shows that $\widetilde{\mu}_i^{\mathbb{R} - \mathrm{ed},h}(t)$ is an upper-bound for $\mu_i(t)$ and provides a bound to its bias w.r.t. $\mu_{i}(N_{i,t})$ for every value of $h$ ; +(ii) Lemma A.4 analyzes the concentration of $\hat{\mu}_i^{\mathrm{R - ed},h}(t)$ around $\tilde{\mu}_i^{\mathrm{R - ed},h}(t)$ for a specific choice of $\delta_t = t^{-\alpha}$ and when $h_{i,h}:= h(N_{i,t - 1})$ is a function of the number of pulls $N_{i,t - 1}$ only; +(iii) Theorem 4.4 bounds the expected regret of $\mathbb{R} - \mathrm{ed} - \mathrm{UCB}$ when $h_{i,h} = |\epsilon N_{i,t-1}|$ , for $\epsilon \in (0,1/2)$ . + +Lemma A.3. For every arm $i\in [K]$ , every round $t\in [T]$ , and window width $1\leqslant h\leqslant \lfloor N_{i,t - 1} / 2\rfloor$ , let us define: + +$$ +\widetilde {\mu} _ {i} ^ {R - e d, h} (t) := \frac {1}{h} \sum_ {l = N _ {i, t - 1} - h + 1} ^ {N _ {i, t - 1}} \left(\mu_ {i} (l) + (t - l) \frac {\mu_ {i} (l) - \mu_ {i} (l - h)}{h}\right), +$$ + +otherwise if $h = 0$ , we set $\widetilde{\mu}_i^{R\text{-ed},h}(t) \coloneqq +\infty$ . Then, $\widetilde{\mu}_i^{R\text{-ed},h}(t) \geqslant \mu_i(t)$ and, if $N_{i,t-1} \geqslant 2$ , it holds that: + +$$ +\widetilde {\mu} _ {i} ^ {R - e d, h} (t) - \mu_ {i} \left(N _ {i, t}\right) \leqslant \frac {1}{2} \left(2 t - 2 N _ {i, t - 1} + h - 1\right) \gamma_ {i} \left(N _ {i, t - 1} - 2 h + 1\right). +$$ + +Proof. Following the derivation provided above, we have for every $l \in \{2, \dots, N_{i,t-1}\}$ : + +$$ +\begin{array}{l} \mu_ {i} (t) = \mu_ {i} (l) + \sum_ {j = l} ^ {t - 1} \gamma_ {i} (j) \\ \leqslant \mu_ {i} (l) + (t - l) \gamma_ {i} (l - 1) (8) \\ \leqslant \mu_ {i} (l) + (t - l) \frac {\mu_ {i} (l) - \mu_ {i} (l - h)}{h}, (9) \\ \end{array} +$$ + +where line (8) follows from Assumption 3.2, line (9) is obtained from Lemma C.3. By averaging over the most recent $1 \leqslant h \leqslant \lfloor N_{i,t-1}/2 \rfloor$ pulls, we obtain: + +$$ +\mu_ {i} (t) \leqslant \frac {1}{h} \sum_ {l = N _ {i, t - 1} - h + 1} ^ {N _ {i, t - 1}} \left(\mu_ {i} (l) + (t - l) \frac {\mu_ {i} (l) - \mu_ {i} (l - h)}{h}\right) =: \widetilde {\mu} _ {i} ^ {\mathrm {R - e d}, h} (t). +$$ + +For the bias bound, when $N_{i,t - 1}\geqslant 2$ we have: + +$$ +\begin{array}{l} \widetilde {\mu} _ {i} ^ {\mathrm {R} - \mathrm {e d}, h} (t) - \mu_ {i} \left(N _ {i, t}\right) = \frac {1}{h} \sum_ {l = N _ {i, t - 1} - h + 1} ^ {N _ {i, t - 1}} \left(\mu_ {i} (l) + (t - l) \frac {\mu_ {i} (l) - \mu_ {i} (l - h)}{h}\right) - \mu_ {i} \left(N _ {i, t}\right) (10) \\ \leqslant \frac {1}{h} \sum_ {l = N _ {i, t - 1} - h + 1} ^ {N _ {i, t - 1}} (t - l) \frac {\mu_ {i} (l) - \mu_ {i} (l - h)}{h} \\ = \frac {1}{h} \sum_ {l = N _ {i, t - 1} - h + 1} ^ {N _ {i, t - 1}} (t - l) \frac {1}{h} \sum_ {j = l - h} ^ {l - 1} \gamma_ {j} (l) \\ \leqslant \frac {1}{h} \sum_ {l = N _ {i, t - 1} - h + 1} ^ {N _ {i, t - 1}} (t - l) \gamma_ {i} (l - h) (11) \\ \leqslant \frac {1}{2} (2 t - 2 N _ {i, t - 1} + h - 1) \gamma_ {i} (N _ {i, t - 1} - 2 h + 1). (12) \\ \end{array} +$$ + +where line (10) follows from Assumption 3.1 applied as $\mu_i(l) \leqslant \mu_i(N_{i,t})$ , line (11) follows from Assumption 3.2 and bounding $\frac{1}{h} \sum_{j=l-h}^{l-1} \gamma_j(l) \leqslant \gamma_i(l-h)$ and line (12) is derived still from Assumption 3.2, $\gamma_i(l-h) \leqslant \gamma_i(N_{i,t-1}-2h+1)$ and computing the summation. + +Lemma A.4. For every arm $i\in [K]$ , every round $t\in [T]$ , and window width $1\leqslant h\leqslant \lfloor N_{i,t - 1} / 2\rfloor$ , let us define: + +$$ +\hat {\mu} _ {i} ^ {R - e d, h} (t) := \frac {1}{h} \sum_ {l = N _ {i, t - 1} - h + 1} ^ {N _ {i, t - 1}} \left(R _ {t _ {i, l}} + (t - l) \frac {R _ {t _ {i , l}} - R _ {t _ {i , l - h}}}{h}\right), +$$ + +$$ +\beta_ {i} ^ {R - e d, h} (t, \delta) := \sigma (t - N _ {i, t - 1} + h - 1) \sqrt {\frac {1 0 \log \frac {1}{\delta}}{h ^ {3}}}, +$$ + +otherwise if $h = 0$ , we set $\hat{\mu}_i^{R - ed,h}(t) \coloneqq +\infty$ and $\beta_i^{R - ed,h}(t,\delta) \coloneqq +\infty$ . Then, if the window size depends on the number of pulls only $h_{i,t} = h(N_{i,t - 1})$ and if $\delta_t = t^{-\alpha}$ for some $\alpha > 2$ , it holds for every round $t \in [T]$ that: + +$$ +\Pr \left(\left| \hat {\mu} _ {i} ^ {R - e d, h _ {i, t}} (t) - \tilde {\mu} _ {i} ^ {R - e d, h _ {i, t}} (t) \right| > \beta_ {i} ^ {R - e d, h _ {i, t}} (t, \delta_ {t})\right) \leqslant 2 t ^ {1 - \alpha}. +$$ + +Proof. First of all, we observe under the event $\{h_{i,t} = 0\}$ , then $\hat{\mu}_i^{\mathrm{R - ed},h_i,t}(t) = \tilde{\mu}_i^{\mathrm{R - ed},h_i,t}(t) = \beta_i^{\mathrm{R - ed},h_i,t}(t,\delta_t) = +\infty$ . By convening that $(+\infty) - (+\infty) = 0$ , we have that $0 > \beta_i^{\mathrm{R - ed},h_i,t}(t,\delta_t)$ is not satisfied. Thus, we perform the analysis under the event $\{h_{i,t}\geqslant 1\}$ . We first get rid of the dependence on the random number of pulls $N_{i,t - 1}$ : + +$$ +\begin{array}{l} \Pr \left(\left| \hat {\mu} _ {i} ^ {\mathrm {R - e d}, h _ {i, t}} (t) - \tilde {\mu} _ {i} ^ {\mathrm {R - e d}, h _ {i, t}} (t) \right| > \beta_ {i} ^ {\mathrm {R - e d}, h _ {i, t}} (t, \delta_ {t})\right) \\ = \Pr \left(\left| \hat {\mu} _ {i} ^ {\mathrm {R} - \mathrm {e d}, h \left(N _ {i, t - 1}\right)} (t) - \tilde {\mu} _ {i} ^ {\mathrm {R} - \mathrm {e d}, h \left(N _ {i, t - 1}\right)} (t) \right| > \beta_ {i} ^ {\mathrm {R} - \mathrm {e d}, h \left(N _ {i, t - 1}\right)} (t, \delta_ {t})\right) (13) \\ \leqslant \Pr \left(\exists n \in \{0, \dots , t - 1 \} \text {s . t .} h (n) \geqslant 1: \left| \hat {\mu} _ {i} ^ {\mathrm {R} - \mathrm {e d}, h (n)} (t) - \tilde {\mu} _ {i} ^ {\mathrm {R} - \mathrm {e d}, h (n)} (t) \right| > \beta_ {i} ^ {\mathrm {R} - \mathrm {e d}, h (n)} (t, \delta_ {t})\right) \\ \leqslant \sum_ {n \in \{0, \dots , t - 1 \}: h (n) \geqslant 1} \Pr \left(\left| \hat {\mu} _ {i} ^ {\mathrm {R} - \mathrm {e d}, h (n)} (t) - \widetilde {\mu} _ {i} ^ {\mathrm {R} - \mathrm {e d}, h (n)} (t) \right| > \beta_ {i} ^ {\mathrm {R} - \mathrm {e d}, h (n)} \left(t, \delta_ {t}\right)\right), (14) \\ \end{array} +$$ + +where line (13) derives from the definition of $h_{i,t} = h(N_{i,t - 1})$ and line (14) follows from a union bound over the possible values of $N_{i,t - 1}$ . Now, having fixed the value of $n$ , we rewrite the quantity to be bounded: + +$$ +\begin{array}{l} h (n) \left(\widehat {\mu} _ {i} ^ {\mathrm {R - e d}, h (n)} (t) - \widetilde {\mu} _ {i} ^ {\mathrm {R - e d}, h (n)} (t)\right) = \sum_ {l = n - h (n) + 1} ^ {n} \left(X _ {l} + (t - l) \frac {X _ {l} - X _ {l - h (n)}}{h (n)}\right) \\ = \sum_ {l = n - h (n) + 1} ^ {n} \left(1 + \frac {t - l}{h (n)}\right) X _ {l} - \sum_ {l = n - h (n) + 1} ^ {n} \frac {t - l}{h (n)} \cdot X _ {l - h (n)}, \\ \end{array} +$$ + +where $X_{l} \coloneqq R_{t_{i,l}} - \mu_{i}(l)$ . It is worth noting that we can index $X_{l}$ with the number of pulls $l$ only as the distribution of $R_{t_{i,l}}$ is fully determined by $l$ and $n$ (that are non-random quantities now) and, consequently, all variables $X_{l}$ and $X_{l - h(n)}$ are independent. + +Now we apply Azuma-Hoeffding's inequality of Lemma C.5 for weighted sums of subgaussian martingale difference sequences. To this purpose, we compute the sum of the square weights: + +$$ +\begin{array}{l} \sum_ {l = n - h (n) + 1} ^ {n} \left(1 + \frac {t - l}{h (n)}\right) ^ {2} + \sum_ {l = n - h (n) + 1} ^ {n} \left(\frac {t - l}{h (n)}\right) ^ {2} \\ \leqslant h (n) \left(1 + \frac {t - n + h (n) - 1}{h (n)}\right) ^ {2} + h (n) \left(\frac {t - n + h (n) - 1}{h (n)}\right) ^ {2} (15) \\ \leqslant \frac {5 (t - n + h (n) - 1) ^ {2}}{h (n)}, (16) \\ \end{array} +$$ + +where line (15) follows from bounding $t - l \leqslant t - n + h(n) - 1$ and line (16) from observing that $\frac{t - n + h(n) - 1}{h(n)} \geqslant 1$ . Thus, we have: + +$$ +\operatorname * {P r} \left(\left| \hat {\mu} _ {i} ^ {\text {R - e d}, h (n)} (t) - \tilde {\mu} _ {i} ^ {\text {R - e d}, h (n)} (t) \right| > \beta_ {i} ^ {\text {R - e d}, h (n)} (t, \delta_ {t})\right) +$$ + +$$ +\begin{array}{l} \leqslant \Pr \left(\left| \sum_ {l = n - h (n) + 1} ^ {n} \left(1 + \frac {t - l}{h (n)}\right) X _ {l} - \sum_ {l = n - h (n) + 1} ^ {n} \frac {t - l}{h (n)} \cdot X _ {l - h (n)} \right| > h (n) \beta_ {i} ^ {\text {R - e d}, h (n)} (t, \delta_ {t})\right) \\ 2 \exp \left(- \frac {\left(h (n) \beta_ {i} ^ {\mathbb {R} - \mathrm {e d} , h (n)} (t , \delta_ {t})\right) ^ {2}}{2 \sigma^ {2} \left(\frac {5 (t - n + h (n) - 1) ^ {2}}{h (n)}\right)}\right) = 2 \delta_ {t}. \\ \end{array} +$$ + +By replacing this result into Equation (14), and recalling the value of $\delta_t$ , we obtain: + +$$ +\sum_ {n \in \{0, \dots , t - 1 \}: h (n) \geqslant 1} 2 \delta_ {t} \leqslant \sum_ {n = 0} ^ {t - 1} 2 \delta_ {t} = \sum_ {n = 0} ^ {t - 1} 2 t ^ {- \alpha} \leqslant 2 t ^ {1 - \alpha}. +$$ + +Theorem 4.4. Let $T \in \mathbb{N}$ , then $R$ -ed-UCB (Algorithm 1) with $B_{i}(t) \equiv \hat{\mu}_{i}^{R - ed, h_{i,t}}(t) + \beta_{i}^{R - ed, h_{i,t}}(t)$ , $h_{i,t} = \lfloor \epsilon N_{i,t-1} \rfloor$ for $\epsilon \in (0,1/2)$ and $\delta_{t} = t^{-\alpha}$ for $\alpha > 2$ , suffers an expected regret bounded, for every $q \in [0,1]$ , as: + +$$ +\begin{array}{l} R _ {\mu} (R - e d - U C B, T) \leqslant \mathcal {O} \left(\frac {K}{\epsilon} (\sigma T) ^ {\frac {2}{3}} (\alpha \log T) ^ {\frac {1}{3}} \right. \\ + \frac {K T ^ {q}}{1 - 2 \epsilon} \Upsilon_ {\mu} \left(\left\lceil (1 - 2 \epsilon) \frac {T}{K} \right\rceil , q\right)\left. \right). \\ \end{array} +$$ + +Proof. Let us define the good events $\mathcal{E}_t = \bigcap_{i\in [K]}\mathcal{E}_{i,t}$ that correspond to the event in which all confidence intervals hold: + +$$ +\mathcal {E} _ {i, t} := \left\{\left| \tilde {\mu} _ {i} ^ {\text {R - e d}, h _ {i, t}} (t) - \hat {\mu} _ {i} ^ {\text {R - e d}, h _ {i, t}} (t) \right| \leqslant \beta_ {i} ^ {\text {R - e d}, h _ {i, t}} (t) \right\} \quad \forall i \in [ T ], i \in [ K ] +$$ + +We have to analyze the following expression: + +$$ +R _ {\boldsymbol {\mu}} (\mathbb {R} - \operatorname {e d} - \operatorname {U C B}, T) = \mathbb {E} \left[ \sum_ {t = 1} ^ {T} \mu_ {i} * (t) - \mu_ {I _ {t}} (N _ {i, t}) \right], +$$ + +where $i^{*} \in \arg \max_{i \in [K]} \left\{ \sum_{l \in [T]} \mu_{i}(l) \right\}$ . We decompose the above expression according to the good events $\mathcal{E}_{t}$ : + +$$ +\begin{array}{l} R _ {\mu} (\mathbb {R} - \operatorname {e d} - \operatorname {U C B}, T) = \sum_ {t = 1} ^ {T} \mathbb {E} \left[ \left(\mu_ {i} * (t) - \mu_ {I _ {t}} \left(N _ {I _ {t}, t}\right)\right) \mathbb {1} \left\{\mathcal {E} _ {t} \right\} \right] + \sum_ {t = 1} ^ {T} \mathbb {E} \left[ \left(\mu_ {i} * (t) - \mu_ {I _ {t}} \left(N _ {I _ {t}, t}\right)\right) \mathbb {1} \left\{- \mathcal {E} _ {t} \right\} \right] (17) \\ \leqslant \sum_ {t = 1} ^ {T} \mathbb {E} \left[ \left(\mu_ {i} * (t) - \mu_ {I _ {t}} \left(N _ {I _ {t}, t}\right)\right) \mathbb {1} \left\{\mathcal {E} _ {t} \right\} \right] + \sum_ {t = 1} ^ {T} \mathbb {E} \left[ \mathbb {1} \left\{- \mathcal {E} _ {t} \right\} \right], (18) \\ \end{array} +$$ + +where we exploited $\mu_{i}*(t) - \mu_{I_{t}}(N_{I_{t},t})\leqslant 1$ in line (18). Now, we bound the second summation, recalling that $\alpha >2$ + +$$ +\sum_ {t = 1} ^ {T} \mathbb {E} \left[ \mathbb {1} \left\{\neg \mathcal {E} _ {t} \right\} \right] = \sum_ {t = 1} ^ {T} \Pr (\neg \mathcal {E} _ {t}) = 1 + \sum_ {t = 2} ^ {T} \Pr \left(- \bigcap_ {i \in [ K ]} \mathcal {E} _ {i, t}\right) = 1 + \sum_ {t = 2} ^ {T} \Pr \left(\bigcup_ {i \in [ K ]} \neg \mathcal {E} _ {i, t}\right) \leqslant 1 + \sum_ {i \in [ K ]} \sum_ {t = 2} ^ {T} \Pr (\neg \mathcal {E} _ {i, t}), +$$ + +where the first inequality is obtained with $\operatorname{Pr}(\neg \mathcal{E}_1) \leqslant 1$ and the second with a union bound over $[K]$ . Recalling $\operatorname{Pr}(\neg \mathcal{E}_{i,t})$ + +![](images/0e2a8dcd809cf204cae7434e1472ed16da5fa440396518827b2ee9e7ffeedc32.jpg) + +was bounded in Lemma A.4, we bound the summation with the integral as in Lemma C.4 to get: + +$$ +\sum_ {i \in [ K ]} \sum_ {t = 2} ^ {T} \Pr (\neg \mathcal {E} _ {i, t}) \leqslant \sum_ {i \in [ K ]} \sum_ {t = 2} ^ {T} 2 t ^ {1 - \alpha} \leqslant 2 K \int_ {x = 1} ^ {+ \infty} x ^ {1 - \alpha} d x = \frac {2 K}{\alpha - 2}. +$$ + +From now on, we proceed the analysis under the good events $\mathcal{E}_t$ , recalling that $B_i(t) \equiv \hat{\mu}_i^{\mathrm{R - ed},h_{i,t}}(t) + \beta_i^{\mathrm{R - ed},h_{i,t}}(t,\delta_t)$ . We consider each addendum of the summation and we exploit the optimism, i.e., $B_{i*}(t) \leqslant B_{I_t}(t)$ : + +$$ +\begin{array}{l} \mu_ {i} * (t) - \mu_ {I _ {t}} \left(N _ {I _ {t}, t}\right) + B _ {I _ {t}} (t) - B _ {I _ {t}} (t) \leqslant \min \left\{1, \underbrace {\mu_ {i} * (t) - B _ {i} * (t)} _ {\leqslant 0} + B _ {I _ {t}} (t) - \mu_ {I _ {t}} \left(N _ {I _ {t}, t}\right) \right\} \\ \leqslant \min \left\{1, B _ {I _ {t}} (t) - \mu_ {I _ {t}} \left(N _ {I _ {t}, t}\right) \right\}. \\ \end{array} +$$ + +Now, we work on the term inside the minimum: + +$$ +\begin{array}{l} B _ {I _ {t}} (t) - \mu_ {I _ {t}} \left(N _ {I _ {t}, t}\right) = \hat {\mu} _ {I _ {t}} ^ {\mathrm {R} - \mathrm {e d}, h _ {I _ {t}, t}} (t) + \beta_ {I _ {t}} ^ {\mathrm {R} - \mathrm {e d}, h _ {I _ {t}, t}} (t, \delta_ {t}) - \mu_ {I _ {t}} \left(N _ {I _ {t}, t}\right) (19) \\ \leqslant \underbrace {\tilde {\mu} _ {I _ {t}} ^ {\mathrm {R} - \mathrm {e d} , h _ {I _ {t} , t}} (t) - \mu_ {I _ {t}} \left(N _ {I _ {t} , t}\right)} _ {\text {(a)}} + \underbrace {2 \beta_ {I _ {t}} ^ {\mathrm {R} - \mathrm {e d} , h _ {I _ {t} , t}} (t , \delta_ {t})} _ {\text {(b)}}, (20) \\ \end{array} +$$ + +where line (19) follows from the definition of $B_{i}(t)$ , and line (20) derives from the fact that we are under the good event $\mathcal{E}_t$ . We now decompose over the arms and consider one term at a time. We start with (a): + +$$ +\begin{array}{l} \sum_ {t = 1} ^ {T} \min \left\{1, \tilde {\mu} _ {I _ {t}} ^ {\mathrm {R} - \mathrm {e d}, h _ {I _ {t}, t}} (t) - \mu_ {I _ {t}} \left(N _ {I _ {t}, t}\right) \right\} \leqslant 2 K + \sum_ {i \in [ K ]} \sum_ {j = 3} ^ {N _ {i, T}} \min \left\{1, \tilde {\mu} _ {i} ^ {\mathrm {R} - \mathrm {e d}, h _ {i, t _ {i, j}}} \left(t _ {i, j}\right) - \mu_ {i} (j) \right\} \\ \leqslant 2 K + \sum_ {i \in [ K ]} \sum_ {j = 3} ^ {N _ {i, T}} \min \left\{1, \frac {1}{2} \left(2 t _ {i, j} - 2 (j - 1) + h _ {i, t _ {i, j}} - 1\right) \gamma_ {i} \left(\left(j - 1\right) - 2 h _ {i, t _ {i, j}} + 1\right) \right\} (21) \\ \leqslant 2 K + \sum_ {i \in [ K ]} \sum_ {j = 3} ^ {N _ {i, T}} \min \left\{1, T \gamma_ {i} (j - 2 \lfloor \epsilon (j - 1) \rfloor) \right\} (22) \\ \leqslant 2 K + \sum_ {i \in [ K ]} \sum_ {j = 3} ^ {N _ {i, T}} \min \left\{1, T \gamma_ {i} \left(\left\lfloor (1 - 2 \epsilon) j \right]\right) \right\} (23) \\ \leqslant 2 K + T ^ {q} \sum_ {i \in [ K ]} \sum_ {j = 3} ^ {N _ {i, T}} \gamma_ {i} (\left\lfloor (1 - 2 \epsilon) j \right\rfloor) ^ {q} (24) \\ \leqslant 2 K + T ^ {q} \left[ \frac {1}{1 - 2 \epsilon} \right] \sum_ {i \in [ K ]} \sum_ {j = \lfloor 3 (1 - 2 \epsilon) \rfloor} ^ {\lfloor (1 - 2 \epsilon) N _ {i, T} \rfloor} \gamma_ {i} (j) (25) \\ \leqslant 2 K + T ^ {q} \left[ \frac {1}{1 - 2 \epsilon} \right] \sum_ {i \in [ K ]} \Upsilon_ {\boldsymbol {\mu}} \left(\left\lfloor (1 - 2 \epsilon) N _ {i, T} \right\rfloor , q\right) (26) \\ \leqslant 2 K + K T ^ {q} \left[ \frac {1}{1 - 2 \epsilon} \right] \Upsilon_ {\mu} \left(\left[ (1 - 2 \epsilon) \frac {T}{K} \right], q\right), (27) \\ \end{array} +$$ + +where line (21) follows from Lemma A.3, line (22) is obtained by bounding $2t_{i,j} - 2(j - 1) + h_{i,t_i,j} - 1 \leqslant 2T$ and exploiting the definition of $h_{i,t} = \lfloor \epsilon N_{i,t-1} \rfloor$ , line (23) follows from the observation $j - 2\lfloor \epsilon (j - 1)\rfloor \geqslant j - 2\epsilon (j - 1) \geqslant \lfloor (1 - 2\epsilon)j\rfloor$ , line (24) is obtained from the already exploited inequality $\min \{1,x\} \leqslant \min \{1,x\}^q \leqslant x^q$ for $q \in [0,1]$ , line (25) is an application of Lemma C.1, line (26) applies the definition of $\Upsilon_{\mu}(\cdot ,q)$ , and line (27) follows from Lemma C.2 recalling that $\sum_{i\in [K]}(1 -$ + +$$ +2 \epsilon) N _ {i, T} ] \leqslant (1 - 2 \epsilon) T. +$$ + +Let us now move to the concentration term (b). We decompose over the arms as well, taking care of the pulls in which $h_{i,j} = 0$ , that are at most $1 + \left\lceil \frac{1}{\epsilon} \right\rceil$ : + +$$ +\begin{array}{l} \sum_ {t = 1} ^ {T} \min \left\{1, 2 \beta_ {I _ {t}} ^ {\mathrm {R - e d}, h _ {I _ {t}, t}} (t, \delta_ {t}) \right\} \leqslant K + K \left\lceil \frac {1}{\epsilon} \right\rceil + \sum_ {i \in [ K ]} \sum_ {j = \left\lceil \frac {1}{\epsilon} \right\rceil + 1} ^ {N _ {i, T}} \min \left\{1, 2 \sigma (t _ {i, t} - (j - 1) + h _ {i, t _ {i, t}} - 1) \sqrt {\frac {1 0 \log (t ^ {\alpha})}{h _ {i , t _ {i , t}} ^ {3}}} \right\}. \\ = K + K \left[ \frac {1}{\epsilon} \right] + \sum_ {i \in [ K ]} \sum_ {j = \left\lceil \frac {1}{\epsilon} \right\rceil + 1} ^ {N _ {i, T}} \min \left\{ \right.1, 2 \sigma T \sqrt {\frac {1 0 \alpha \log (T)}{\left\lfloor \right. \epsilon (j - 1) \left. \right] ^ {3}}} \left. \right\}, \tag {28} \\ \end{array} +$$ + +where line (28) follows from bounding $t^\alpha \leqslant T^\alpha$ and from the definition of $h_{i,t} = \lfloor \epsilon N_{i,t - 1}\rfloor$ . To bound the summation, we compute the minimum integer value $j^*$ (that turns out to be independent of $i$ ) of $j$ such that the minimum is attained by its second argument: + +$$ +\begin{array}{l} 2 \sigma T \sqrt {\frac {1 0 \alpha \log (T)}{\left\lfloor \epsilon (j - 1) \right] ^ {3}}} \leqslant 1 \Longrightarrow \left\lfloor \epsilon (j - 1) \right\rfloor \geqslant (2 \sigma T) ^ {\frac {2}{3}} (1 0 \alpha \log T) ^ {\frac {1}{3}} \\ \Longrightarrow j ^ {*} = \left[ \frac {1 + \epsilon + (2 \sigma T) ^ {\frac {2}{3}} (1 0 \alpha \log T) ^ {\frac {1}{3}}}{\epsilon} \right]. \\ \end{array} +$$ + +Thus, we have: + +$$ +\begin{array}{l} K + K \left[ \frac {1}{\epsilon} \right] + \sum_ {i \in [ K ]} \sum_ {j = \left\lceil \frac {1}{\epsilon} \right\rceil + 1} ^ {N _ {i, T}} \min \left\{ \right.1, 2 \sigma T \sqrt {\frac {1 0 \alpha \log (T)}{\left\lfloor \right. \epsilon (j - 1) \left. \right] ^ {3}}} \left. \right\} \leqslant K + K \left[ \frac {1}{\epsilon} \right] + \sum_ {i \in [ K ]} \left( \right.\sum_ {j = \left\lceil \frac {1}{\epsilon} \right\rceil + 1} ^ {j ^ {*}} 1 + \sum_ {j = j ^ {*} + 1} ^ {N _ {i, T}} 2 \sigma T \sqrt {\frac {1 0 \alpha \log (T)}{\left\lfloor \right. \epsilon (j - 1) \left. \right] ^ {3}}}\left. \right) (29) \\ \leqslant K + K \left[ \frac {1}{\epsilon} \right] + K \left(j ^ {*} - 1 - \left\lceil \frac {1}{\epsilon} \right\rceil + 1\right) + 2 K \sigma T \sqrt {1 0 \alpha \log (T)} \int_ {x = j ^ {*}} ^ {+ \infty} \frac {1}{(\epsilon (x - 1) - 1) ^ {\frac {3}{2}}} d x (30) \\ = K + K j ^ {*} + \frac {4 K \sigma T \sqrt {1 0 \alpha \log (T)}}{\epsilon (\epsilon (j ^ {*} - 1) - 1) ^ {\frac {1}{2}}} \\ = K \left(3 + \frac {1}{\epsilon}\right) + \frac {3 K}{\epsilon} (2 \sigma T) ^ {\frac {2}{3}} (1 0 \alpha \log T) ^ {\frac {1}{3}}, (31) \\ \end{array} +$$ + +where line (29) is obtained by splitting the summation based on the value of $j^*$ , line (30) comes from bounding the summation with the integral (Lemma C.4), and line (31) follows from substituting the value of $j^*$ and simple algebraic manipulations. Putting all together, we obtain: + +$$ +\begin{array}{l} R _ {\mu} (\mathrm {R - e d - U C B}, T) \leqslant 1 + \frac {2 K}{\alpha - 2} + 5 K + \frac {K}{\epsilon} + \frac {3 K}{\epsilon} (2 \sigma T) ^ {\frac {2}{3}} (1 0 \alpha \log T) ^ {\frac {1}{3}} + K T ^ {q} \left[ \frac {1}{1 - 2 \epsilon} \right] \Upsilon_ {\mu} \left(\left[ (1 - 2 \epsilon) \frac {T}{K} \right], q\right) \\ = \mathcal {O} \left(K T ^ {q} \left\lceil \frac {1}{1 - 2 \epsilon} \right\rceil \Upsilon_ {\mu} \left(\left\lceil (1 - 2 \epsilon) \frac {T}{K} \right\rceil , q\right) + \frac {K}{\epsilon} (\sigma T) ^ {\frac {2}{3}} (\alpha \log T) ^ {\frac {1}{3}}\right). \\ \end{array} +$$ + +![](images/29209cc9bff9cb4dadbef9aaa8688712e1ffc1eda933b5fbf000773d74ad90b7.jpg) + +# A.2. Proofs of Section 5 + +Theorem 5.1 (Seznec et al., 2020). Let $\pi_{\mu}^{g}$ be the oracle greedy policy: + +$$ +\pi_ {\boldsymbol {\mu}} ^ {g} (t) \in \underset {i \in [ K ]} {\arg \max} \{\mu_ {i} (t) \}, \quad \forall t \in [ T ]. +$$ + +Then, $\pi_{\mu}^{q}$ is optimal for the restless non-decreasing bandits (i.e., under Assumption 3.1). + +Proof. Trivially follows from the fact that the greedy policy at each round $t$ is selecting the largest expected reward, therefore any optimal policy other than the greedy one should select a larger expected reward at least for a single round $t'$ , which is in contradiction with the definition of greedy policy. + +Lemma A.5. For every arm $i\in [K]$ and every round $t\in [T]$ , let us define: + +$$ +\overline {{\mu}} _ {i} ^ {R - l e s s} (t) := \mu_ {i} (t _ {i, N _ {i, t - 1}}) + (t - t _ {i, N _ {i, t - 1}}) \frac {\mu_ {i} (t _ {i , N _ {i , t - 1}}) - \mu_ {i} (t _ {i , N _ {i , t - 1} - 1})}{t _ {i , N _ {i , t - 1}} - t _ {i , N _ {i , t - 1} - 1}}, +$$ + +if $N_{i,t - 1}\geqslant 2$ else $\overline{\mu}_i^{R - less}(t)\coloneqq +\infty$ . Then, $\overline{\mu}_i^{R - less}(t)\geqslant \mu_i(t)$ and, if $N_{i,t - 1}\geqslant 2$ , it holds that: + +$$ +\overline {{\mu}} _ {i} ^ {R - l e s s} (t) - \mu_ {i} (t) \leqslant \left(t - t _ {i, N _ {i, t - 1}}\right) \gamma_ {i} \big (t _ {i, N _ {i, t - 1} - 1} \big). +$$ + +Proof. Let us consider the following derivation: + +$$ +\begin{array}{l} \mu_ {i} (t) = \mu_ {i} \left(t _ {i, N _ {i, t - 1}}\right) + \sum_ {l = t _ {i, N _ {i, t - 1}}} ^ {t - 1} \gamma_ {i} (l) \\ \leqslant \mu_ {i} \left(t _ {i, N _ {i, t - 1}}\right) + \left(t - t _ {i, N _ {i, t - 1}}\right) \gamma_ {i} \left(t _ {i, N _ {i, t - 1}}\right) (32) \\ \leqslant \mu_ {i} \left(t _ {i, N _ {i, t - 1}}\right) + \left(t - t _ {i, N _ {i, t - 1}}\right) \frac {\mu_ {i} \left(t _ {i , N _ {i , t - 1}}\right) - \mu_ {i} \left(t _ {i , N _ {i , t - 1} - 1}\right)}{t _ {i , N _ {i , t - 1}} - t _ {i , N _ {i , t - 1} - 1}} =: \bar {\mu} _ {i} ^ {\mathrm {R} - \text {l e s s}} (t), (33) \\ \end{array} +$$ + +where line (32) follows from Assumption 3.2 and line (33) from Lemma C.3. Moreover, if $N_{i,t - 1}\geqslant 2$ we have: + +$$ +\begin{array}{l} \overline {{\mu}} _ {i} ^ {\mathrm {R - l e s s}} (t) - \mu_ {i} (t) = (t - t _ {i, N _ {i, t - 1}}) \frac {\mu_ {i} (t _ {i , N _ {i , t - 1}}) - \mu_ {i} (t _ {i , N _ {i , t - 1} - 1})}{t _ {i , N _ {i , t - 1}} - t _ {i , N _ {i , t - 1} - 1}} + \underbrace {\mu_ {i} (t _ {i , N _ {i , t - 1}}) - \mu_ {i} (t)} _ {\leqslant 0} \\ \leqslant \left(t - t _ {i, N _ {i, t - 1}}\right) \frac {\mu_ {i} \left(t _ {i , N _ {i , t - 1}}\right) - \mu_ {i} \left(t _ {i , N _ {i , t - 1} - 1}\right)}{t _ {i , N _ {i , t - 1}} - t _ {i , N _ {i , t - 1} - 1}} \\ = \frac {t - t _ {i , N _ {i , t - 1}}}{t _ {i , N _ {i , t - 1}} - t _ {i , N _ {i , t - 1} - 1}} \sum_ {l = t _ {i, N _ {i, t - 1} - 1}} ^ {t _ {i, N _ {i, t - 1}} - 1} \gamma_ {i} (l), \\ \leqslant \left(t - t _ {i, N _ {i, t - 1}}\right) \gamma_ {i} \left(t _ {i, N _ {i, t - 1} - 1}\right), \\ \end{array} +$$ + +where we employed Assumption 3.2 in the last line, noting $\frac{1}{t_{i,N_{i,t-1}} - t_{i,N_{i,t-1}-1}}\sum_{l=t_{i,N_{i,t-1}-1}}^{t_{i,N_{i,t-1}}-1}\gamma_i(l) \leqslant \gamma_i(t_{i,N_{i,t-1}-1})$ . + +Theorem 5.2. Let $T \in \mathbb{N}$ , then $R$ -less-UCB (Algorithm 1) with $B_{i}(t) \equiv \overline{\mu}_{i}^{R - less}(t)$ suffers an expected regret bounded, for every $q \in [0,1]$ , as: + +$$ +R _ {\boldsymbol {\mu}} (R - l e s s - U C B, T) \leqslant 2 K + K T ^ {\frac {q}{q + 1}} \Upsilon_ {\boldsymbol {\mu}} \left(\left\lceil \frac {T}{K} \right\rceil , q\right) ^ {\frac {1}{q + 1}}. +$$ + +Proof. We have to analyze the following expression: + +$$ +R _ {\boldsymbol {\mu}} (\mathbb {R} \mathrm {- l e s s - U C B}, T) = \sum_ {t = 1} ^ {T} \mu_ {i _ {t} ^ {*}} (t) - \mu_ {I _ {t}} (t), +$$ + +where $i_t^* \in \arg\max_{i \in [K]} \{ \mu_i(t) \}$ for all $t \in [T]$ . We consider each round at a time, recalling that $B_i(t) \equiv \overline{\mu}_i^{R-1}$ (less), and using optimism, i.e., $B_{i_t^*}(t) \leqslant B_{I_t}(t)$ , we have: + +$$ +\begin{array}{l} \mu_ {i ^ {*}} (t) - \mu_ {I _ {t}} (t) + B _ {I _ {t}} (t) - B _ {I _ {t}} (t) \leqslant \min \left\{1, \underbrace {\mu_ {i _ {t} ^ {*}} (t) - B _ {i _ {t} ^ {*}} (t)} _ {\leqslant 0} + B _ {I _ {t}} (t) - \mu_ {I _ {t}} (t) \right\} \\ \leqslant \min \left\{1, B _ {I _ {t}} (t) - \mu_ {I _ {t}} (t) \right\}. \tag {34} \\ \end{array} +$$ + +Now we consider the term inside the minimum, when $N_{I_t,t - 1}\geqslant 2$ + +$$ +\begin{array}{l} B _ {I _ {t}} (t) - \mu_ {I _ {t}} (t) = \bar {\mu} I _ {t} ^ {\mathrm {R} - 1 \text {l e s s}} (t) - \mu_ {I _ {t}} (t) (35) \\ \leqslant \left(t - t _ {i, N _ {i, t - 1}}\right) \gamma_ {i} \left(t _ {i, N _ {i, t - 1} - 1}\right), (36) \\ \end{array} +$$ + +where to get line (36) we applied Lemma A.5. Let us plug the expression derived in Equation (34) and decompose the summation of this term w.r.t. the $K$ arms: + +$$ +\begin{array}{l} R _ {\boldsymbol {\mu}} (\mathrm {R} - \text {l e s s} - \mathrm {U C B}, T) \leqslant \sum_ {t = 1} ^ {T} \min \left\{1, (t - t _ {i, N _ {i, t - 1}}) \gamma_ {i} (t _ {i, N _ {i, t - 1} - 1}), \right\} \\ = 2 K + \sum_ {i \in [ K ]} \sum_ {j = 3} ^ {N _ {i, T}} \min \left\{1, \left(t _ {i, j} - t _ {i, j - 1}\right) \gamma_ {i} \left(t _ {i, j - 2}\right) \right\} \\ \leqslant 2 K + \sum_ {i \in [ K ]} \sum_ {j = 3} ^ {N _ {i, T}} \left(t _ {i, j} - t _ {i, j - 1}\right) ^ {y} \gamma_ {i} \left(t _ {i, j - 2}\right) ^ {y} (37) \\ \leqslant 2 K + \sum_ {i \in [ K ]} \left(\sum_ {j = 3} ^ {N _ {i, T}} \left(t _ {i, j} - t _ {i, j - 1}\right)\right) ^ {y} \left(\sum_ {j = 3} ^ {N _ {i, T}} \gamma_ {i} \left(t _ {i, j - 2}\right) ^ {\frac {y}{1 - y}}\right) ^ {1 - y} (38) \\ \leqslant 2 K + T ^ {y} \sum_ {i \in [ K ]} \left(\sum_ {j = 3} ^ {N _ {i, T}} \gamma_ {i} (j - 2) ^ {\frac {y}{1 - y}}\right) ^ {1 - y} (39) \\ \leqslant 2 K + T ^ {y} \sum_ {i \in [ K ]} \Upsilon_ {\boldsymbol {\mu}} \left(N _ {i, T}, \frac {y}{1 - y}\right) ^ {1 - y} \\ \leqslant 2 K + T ^ {y} K ^ {y} \left(\sum_ {i \in [ K ]} \Upsilon_ {\mu} \left(N _ {i, T}, \frac {y}{1 - y}\right)\right) ^ {1 - y} (40) \\ \leqslant 2 K + T ^ {y} K \Upsilon_ {\mu} \left(\left\lceil \frac {T}{K} \right\rceil , \frac {y}{1 - y}\right) ^ {1 - y}, (41) \\ \end{array} +$$ + +line (37) follows from the inequality $\min \{1,x\} \leqslant \min \{1,x\}^y\leqslant x^y$ for $y\in \left[0,\frac{1}{2}\right]$ , line (38) follows from Hölder's inequality with powers $\frac{1}{y}\geqslant 1$ and $\frac{1}{1 - y}\geqslant 1$ (since $y\in \left[0,\frac{1}{2}\right]$ ), line (39) is obtained from observing that $\sum_{j = 3}^{N_{i,T}}(t_{i,j} - t_{i,j - 1})\leqslant T$ and $\gamma_i(t_{i,j - 2})\leqslant \gamma_i(j - 2)$ from Assumption 3.2, line (40) follows from Jensen's inequality as $y\in \left[0,\frac{1}{2}\right]$ and observing: + +$$ +\sum_ {i \in [ K ]} \Upsilon_ {\boldsymbol {\mu}} \left(N _ {i, T}, \frac {y}{1 - y}\right) ^ {1 - y} = K \sum_ {i \in [ K ]} \frac {1}{K} \Upsilon_ {\boldsymbol {\mu}} \left(N _ {i, T}, \frac {y}{1 - y}\right) ^ {1 - y} \leqslant K ^ {y} \left(\sum_ {i \in [ K ]} \Upsilon_ {\boldsymbol {\mu}} \left(N _ {i, T}, \frac {y}{1 - y}\right)\right) ^ {1 - y}, +$$ + +where line (41) is obtained from Lemma C.2. The final theorem statement is obtained by defining $q \coloneqq \frac{y}{1 - y} \in [0,1]$ and substituting it to the above equation. + +![](images/fc716b836f46960e369011d723c7d59e63f3ecc1cf44a0deb320eaeca1795c64.jpg) + +Estimator Construction for the Stochastic Rising Restless Setting We provide the intuition behind the estimator construction and explain why it differs significantly from the one employed for the deterministic case. We start observing that for every $l \in \{2, \dots, N_{i,t-1}\}$ , we have that: + +$$ +\mu_ {i} (t) = \underbrace {\mu_ {i} \left(t _ {i , l}\right)} _ {\text {(p a s t p a y o f f)}} + \sum_ {j = t _ {l}} ^ {t - 1} \gamma_ {i} (j) \leqslant \underbrace {\mu_ {i} (l)} _ {\text {(p a s t p a y o f f)}} + (t - t _ {i, l}) \underbrace {\gamma_ {i} \left(t _ {i , l - 1}\right)} _ {\text {(p a s t i n c r e m e n t)}}, +$$ + +where the inequality follows from Assumption 3.2. Since do not have access to $\gamma_{i}(t_{i,l - 1})$ and we cannot directly estimate it, we need to perform a further bounding step. Specifically, based on Lemma C.3, we bound for every $l\in \{2,\dots ,N_{i,t - 1}\}$ and $h\in [l - 1]$ : + +$$ +\underbrace {\gamma_ {i} \left(t _ {i , l - 1}\right)} _ {\text {(p a s t i n c r e m e n t a t} t _ {i, l})} \leqslant \underbrace {\frac {\mu_ {i} \left(t _ {i , l}\right) - \mu_ {i} \left(t _ {i , l - h}\right)}{t _ {i , l} - t _ {i , l - h}}} _ {\text {(a v e r a g e p a s t i n c r e m e n t o v e r} \left\{t _ {i, l - h}, \dots , t _ {i, l} \right\})}. +$$ + +We report a first proposal of optimistic approximation of $\mu_{i}(t)$ , i.e., $\widetilde{\hat{\mu}}_i^{\mathrm{R - ed},h}(t)$ , and the corresponding estimator, i.e., $\widehat{\hat{\mu}}_i^{\mathrm{R - ed},h}(t)$ , that are defined in terms of a window of size $1\leqslant h\leqslant \lfloor N_{i,t - 1} / 2\rfloor$ + +$$ +\widetilde{\widetilde{\mu}}_{i}^{\text{R - less},h}(t):= \frac{1}{h}\sum_{l = N_{i,t - 1} - h + 1}^{N_{i,t - 1}}\Bigg(\underbrace{\mu_{i}(t_{i,l})}_{\text{(past payoff)}} + (t - t_{i,l})\underbrace{\frac{\mu_{i}(t_{i,l}) - \mu_{i}(t_{i,l - h})}{t_{i,l} - t_{i,l - h}}}_{\text{(average past increment)}}\Bigg), +$$ + +$$ +\widehat{\mu}_{i}^{\text{R - less},h}(t):= \frac{1}{h}\sum_{l = N_{i,t - 1} - h + 1}^{N_{i,t - 1}}\Bigg( \underbrace{R_{t_{i,l}}} _ {(\text{estimated past payoff})} + (t - t_{i,l})\quad \underbrace{\frac{R_{t_{i,l}} - R_{t_{i,l - h}}}{t_{i,l} - t_{i,l - h}}} _ {(\text{estimated average past increment})}\Bigg). +$$ + +Unfortunately, this estimator, although intuitive, does not enjoy desirable concentration properties due to the presence of the denominator $t_{i,l} - t_{i,l - h}$ that is inconveniently correlated with the numerator $R_{t_{i,l}} - R_{t_{i,l - h}}$ . For this reason, we resort to different estimators, with better concentration properties but larger bias: + +$$ +\widetilde{\mu}_{i}^{\text{R - less},h}(t):= \frac{1}{h}\sum_{l = N_{i,t - 1} - h + 1}^{N_{i,t - 1}}\Bigg(\underbrace{\mu_{i}(t_{i,l})}_{\text{(past payoff)}} + (t - l)\underbrace{\frac{\mu_{i}(t_{i,l}) - \mu_{i}(t_{i,l - h})}{h}}_{\text{(average past increment)}}\Bigg), +$$ + +$$ +\widehat{\mu}_{i}^{\text{R - less},h}(t):= \frac{1}{h}\sum_{l = N_{i,t - 1} - h + 1}^{N_{i,t - 1}}\Bigg( \underbrace{R_{t_{i,l}}} _ {(\text{estimated past payoff})} + (t - l) \underbrace{\frac{R_{t_{i,l}} - R_{t_{i,l - h}}}{h}}_{(\text{estimated average past increment})}\Bigg). +$$ + +These estimators are actually upper-bounds of the previous ones since $t_{i,l} - t_{i,l - h} \geqslant h$ and $t_{i,l} \geqslant l$ . + +The proof is composed of the following steps: + +(i) Lemma A.6 shows that $\widetilde{\mu}_i^{\mathrm{R - less},h}(t)$ is an upper-bound for $\mu_{i}(t)$ and provides a bound to its bias for every value of $h$ +(ii) Lemma A.7 analyzes the concentration of $\hat{\mu}_i^{\mathrm{R - less},h}(t)$ around $\tilde{\mu}_i^{\mathrm{R - less},h}(t)$ for a specific choice of $\delta_t = t^{-\alpha}$ and when $h_{i,h}:= h(N_{i,t - 1})$ is a function of the number of pulls $N_{i,t - 1}$ only; +(iii) Theorem 5.3 bounds the expected regret of R-less-UCB when $h_{i,h} = \lfloor \epsilon N_{i,t - 1}\rfloor$ for $\epsilon \in (0,1 / 2)$ . + +Lemma A.6. For every arm $i\in [K]$ , every round $t\in [T]$ , and window width $1\leqslant h\leqslant \lfloor N_{i,t - 1} / 2\rfloor$ , let us define: + +$$ +\widetilde {\mu} _ {i} ^ {R - l e s s, h} (t) := \frac {1}{h} \sum_ {l = N _ {i, t - 1} - h + 1} ^ {N _ {i, t - 1}} \left(\mu_ {i} (t _ {i, l}) + (t - l) \frac {\mu_ {i} (t _ {i , l}) - \mu_ {i} (t _ {i , l - h})}{h}\right), +$$ + +otherwise if $h = 0$ , we set $\widetilde{\mu}_i^{R - less,h}(t) \coloneqq +\infty$ . Then, $\widetilde{\mu}_i^{R - less,h}(t) \geqslant \mu_i(t_{i,N_{i,t-1}})$ and, if $N_{i,t-1} \geqslant 2$ it holds that: + +$$ +\widetilde {\mu} _ {i} ^ {R - l e s s, h} (t) - \mu_ {i} (t) \leqslant \frac {(2 t - 2 N _ {i , t - 1} + h - 1) (t _ {i , N _ {i , t - 1}} - t _ {i , N _ {i , t - 1} - 2 h + 1})}{2 h} \gamma_ {i} (t _ {i, N _ {i, t - 1} - 2 h + 1}). +$$ + +Proof. Let us start by observing the following equality holding for every $l \in \{2, \dots, N_{i,t-1}\}$ : + +$$ +\mu_ {i} (t) = \mu_ {i} (t _ {i, l}) + \sum_ {j = t _ {i, l}} ^ {t - 1} \gamma_ {i} (j). +$$ + +By averaging over a window of length $h$ , we obtain: + +$$ +\begin{array}{l} \mu_ {i} (t) = \frac {1}{h} \sum_ {l = N _ {i, t - 1} - h + 1} ^ {N _ {i, t - 1}} \left(\mu_ {i} \left(t _ {i, l}\right) + \sum_ {j = t _ {i, l}} ^ {t - 1} \gamma_ {i} (j)\right) \\ \leqslant \frac {1}{h} \sum_ {l = N _ {i, t - 1} - h + 1} ^ {N _ {i, t - 1}} \left(\mu_ {i} \left(t _ {i, l}\right) + \left(t - t _ {i, l}\right) \gamma_ {i} \left(t _ {i, l} - 1\right)\right) (42) \\ \leqslant \frac {1}{h} \sum_ {l = N _ {i, t - 1} - h + 1} ^ {N _ {i, t - 1}} \left(\mu_ {i} \left(t _ {i, l}\right) + \frac {t - t _ {i , l}}{t _ {i , l} - t _ {i , l - h}} \sum_ {j = t _ {i, l - h}} ^ {t _ {i, l} - 1} \gamma_ {i} (j)\right) (43) \\ = \frac {1}{h} \sum_ {l = N _ {i, t - 1} - h + 1} ^ {N _ {i, t - 1}} \left(\mu_ {i} (t _ {i, l}) + (t - t _ {i, l}) \frac {\mu_ {i} (t _ {i , l}) - \mu_ {i} (t _ {i , l - h})}{t _ {i , l} - t _ {i , l - h}}\right) \\ \leqslant \frac {1}{h} \sum_ {l = N _ {i, t - 1} - h + 1} ^ {N _ {i, t - 1}} \left(\mu_ {i} \left(t _ {i, l}\right) + (t - l) \frac {\mu_ {i} \left(t _ {i , l}\right) - \mu_ {i} \left(t _ {i , l - h}\right)}{h}\right) =: \widetilde {\mu} _ {i} ^ {\mathrm {R} - \text {l e s s}, h} (t), (44) \\ \end{array} +$$ + +where lines (42) and (43) follow from Assumption 3.2, and line (44) is obtained from observing that $t_{i,l} \geqslant l$ and $t_{i,l} - t_{i,l-h} \geqslant h$ . Concerning the bias, when $N_{i,t-1} \geqslant 2$ , we have: + +$$ +\begin{array}{l} \widetilde {\mu} _ {i} ^ {\mathrm {R - l e s s}, h} (t) - \mu_ {i} (t) = \frac {1}{h} \sum_ {l = N _ {i, t - 1} - h + 1} ^ {N _ {i, t - 1}} \left(\mu_ {i} (t _ {i, l}) + (t - l) \frac {\mu_ {i} (t _ {i , l}) - \mu_ {i} (t _ {i , l - h})}{h}\right) - \mu_ {i} (t) \\ \leqslant \frac {1}{h} \sum_ {l = N _ {i, t - 1} - h + 1} ^ {N _ {i, t - 1}} (t - l) \frac {\mu_ {i} \left(t _ {i , l}\right) - \mu_ {i} \left(t _ {i , l - h}\right)}{h} (45) \\ = \frac {1}{h} \sum_ {l = N _ {i, t - 1} - h + 1} ^ {N _ {i, t - 1}} (t - l) \frac {\mu_ {i} \left(t _ {i , l}\right) - \mu_ {i} \left(t _ {i , l - h}\right)}{t _ {i , l} - t _ {i , l - h}} \cdot \frac {t _ {i , l} - t _ {i , l - h}}{h} \\ \leqslant \frac {1}{h} \sum_ {l = N _ {i, t - 1} - h + 1} ^ {N _ {i, t - 1}} (t - l) \gamma_ {i} \left(t _ {i, l - h}\right) \cdot \frac {t _ {i , l} - t _ {i , l - h}}{h} (46) \\ \leqslant \frac {t _ {i , N _ {i , t - 1}} - t _ {i , N _ {i , t - 1} - 2 h + 1}}{h ^ {2}} \gamma_ {i} \left(t _ {i, N _ {i, t - 1} - 2 h + 1}\right) \sum_ {l = N _ {i, t - 1} - h + 1} ^ {N _ {i, t - 1}} (t - l) (47) \\ \end{array} +$$ + +$$ += \frac {\left(2 t - 2 N _ {i , t - 1} + h - 1\right) \left(t _ {i , N _ {i , t - 1}} - t _ {i , N _ {i , t - 1} - 2 h + 1}\right)}{2 h} \gamma_ {i} \left(t _ {i, N _ {i, t - 1} - 2 h + 1}\right), \tag {48} +$$ + +where line (45) follows from observing that $\mu_i(t_{i,l})\leqslant \mu_i(t)$ , line (46) derives from Assumption 3.2 and bounding $\frac{\mu_i(t_{i,l}) - \mu_i(t_{i,l - h})}{t_{i,l} - t_{i,l - h}}\leqslant \gamma_i(t_{i,l - h})$ , line (47) is obtained by bounding $t_{i,l} - t_{i,l - h}\leqslant t_{i,N_{i,t - 1}} - t_{i,N_{i,t - 1} - 2h + 1}$ and $\gamma_i(t_{i,l - h})\leqslant \gamma_i(t_{i,N_{i,t - 1} - 2h + 1})$ , and line (48) follows from computing the summation. + +Lemma A.7. For every arm $i\in [K]$ , every round $t\in [T]$ , and window width $1\leqslant h\leqslant \lfloor N_{i,t - 1} / 2\rfloor$ , let us define: + +$$ +\widehat {\mu} _ {i} ^ {R - l e s s, h} (t) := \frac {1}{h} \sum_ {l = N _ {i, t - 1} - h + 1} ^ {N _ {i, t - 1}} \left(R _ {t _ {i, l}} + (t - l) \frac {R _ {t _ {i , l}} - R _ {t _ {i , l - h}}}{h}\right), +$$ + +$$ +\beta_ {i} ^ {R - 1 e s s, h} (t, \delta) := \sigma (t - N _ {i, t - 1} + h - 1) \sqrt {\frac {1 0 \log \frac {1}{\delta}}{h ^ {3}}}, +$$ + +otherwise if $h = 0$ , we set $\hat{\mu}_i^{R - less,h}(t) \coloneqq +\infty$ and $\beta_i^{R - less,h}(t,\delta) \coloneqq +\infty$ . Then, if the window size depends on the number of pulls only $h_{i,t} = h(N_{i,t-1})$ and if $\delta_t = t^{-\alpha}$ for some $\alpha > 2$ , it holds for every round $t \in [T]$ that: + +$$ +\Pr \left(\left| \hat {\mu} _ {i} ^ {R - l e s s, h _ {i, t}} (t) - \tilde {\mu} _ {i} ^ {R - l e s s, h _ {i, t}} (t) \right| > \beta_ {i} ^ {R - l e s s, h _ {i, t}} (t, \delta_ {t})\right) \leqslant 2 t ^ {1 - \alpha}. +$$ + +Proof. Under the event $\{h_{i,t} = 0\}$ , we have that $\hat{\mu}_i^{\mathrm{R - less},h_{i,t}}(t) = \hat{\mu}_i^{\mathrm{R - less},h_{i,t}}(t) = \beta_i^{\mathrm{R - less},h_{i,t}}(t,\delta) = +\infty$ and, under the convention $(+\infty) - (+\infty) = 0$ the event $0 > \beta_i^{\mathrm{R - less},h}(t,\delta)$ does not hold. Therefore, we conduct the proof under the event $\{h_{i,t}\geqslant 1\}$ . Hence: + +$$ +\begin{array}{l} \Pr \left(\left| \hat {\mu} _ {i} ^ {\mathrm {R} - \text {l e s s}, h _ {i, t}} (t) - \tilde {\mu} _ {i} ^ {\mathrm {R} - \text {l e s s}, h _ {i, t}} (t) \right| > \beta_ {i} ^ {\mathrm {R} - \text {l e s s}, h _ {i, t}} (t, \delta_ {t})\right) (49) \\ = \Pr \left(\left| \hat {\mu} _ {i} ^ {\mathrm {R} - \text {l e s s}, h \left(N _ {i, t - 1}\right)} (t) - \tilde {\mu} _ {i} ^ {\mathrm {R} - \text {l e s s}, h \left(N _ {i, t - 1}\right)} (t) \right| > \beta_ {i} ^ {\mathrm {R} - \text {l e s s}, h \left(N _ {i, t - 1}\right)} (t, \delta_ {t})\right) (50) \\ \leqslant \Pr \left(\exists n \in \{0, \dots , t - 1 \} \text {s . t .} h (n) \geqslant 1: \left| \hat {\mu} _ {i} ^ {\mathrm {R} - \text {l e s s}, h (n)} (t) - \tilde {\mu} _ {i} ^ {\mathrm {R} - \text {l e s s}, h (n)} (t) \right| > \beta_ {i} ^ {\mathrm {R} - \text {l e s s}, h (n)} \left(t, \delta_ {t}\right)\right) \\ \leqslant \sum_ {n \in \{0, \dots , t - 1 \}: h (n) \geqslant 1} \Pr \left(\left| \hat {\mu} _ {i} ^ {\mathrm {R} - \text {l e s s}, h (n)} (t) - \tilde {\mu} _ {i} ^ {\mathrm {R} - \text {l e s s}, h (n)} (t) \right| > \beta_ {i} ^ {\mathrm {R} - \text {l e s s}, h (n)} (t, \delta_ {t})\right), (51) \\ \end{array} +$$ + +where line (50) follows from the definition of $h_{i,t} = h(N_{i,t - 1})$ , and line (51) derives from a union bound over $n$ . Differently from the rested case, in which the distribution of all random variable involved is fully determined having fixed $N_{i,t - 1}$ , in the restless case this is no longer the case. Indeed, the distribution of the rewards does not depend on the number of pulls, but on the round in which the arm was pulled. Thus, we need a more articulated argument. We start rewriting the estimator with a summation over rounds: + +$$ +h (n) \left(\widehat {\mu} _ {i} ^ {\mathrm {R} - \text {l e s s}, h (n)} (t) - \widetilde {\mu} _ {i} ^ {\mathrm {R} - \text {l e s s}, h (n)} (t)\right) = \sum_ {l = n - h (n) + 1} ^ {n} \left(X _ {t _ {i, l}} + (t - l) \frac {X _ {t _ {i , l}} - X _ {t _ {i , l - h (n)}}}{h (n)}\right) = \sum_ {s = 1} ^ {t - 1} \epsilon_ {s} Y _ {s} X _ {s}, \tag {52} +$$ + +where: + +$$ +\epsilon_ {s} = \mathbb {1} \left\{I _ {s} = i \right\}, +$$ + +$$ +Y _ {s} = \left(\mathbb {1} \left\{N _ {i, s} \in \{n - h (n) + 1, \dots , n \} \right\} \left(1 + \frac {t - N _ {i , s}}{h (n)}\right) - \mathbb {1} \left\{N _ {i, s} \in \{n - 2 h (n) + 1, \dots , n - h (n) \} \right\} \frac {t - N _ {i , s} - h (n)}{h (n)}\right), +$$ + +$$ +X _ {s} = R _ {s} - \mu_ {i} (s). +$$ + +The rationale behind this decomposition is to use random variable $\epsilon_{s}$ to select the pulls of arm $i$ , $Y_{s}$ to define the quantity by which $X_{s}$ is multiplied. In particular, if the pull belongs to the set of the most recent $h(n)$ pulls, i.e., + +$N_{i,s} \in \{n - h(n) + 1, \dots, n\}$ , we multiply $X_s$ by the constant $1 + \frac{t - N_{i,s}}{h(n)}$ . Instead, if the pull belongs to less recent $h(n)$ pulls, i.e., $N_{i,s} \in \{n - 2h(n) + 1, \dots, n - h(n)\}$ , we multiply $X_s$ by $\frac{t - N_{i,s} - h(n)}{h(n)}$ . Now, we define the sequence of random times at which arm $i$ was pulled for the $j$ -th time: + +$$ +t _ {i, j} := \min _ {t \in [ T ]} \left\{N _ {i, t} = j \right\}, \quad j \in [ n ], +$$ + +and we introduce the random variables $\widetilde{X}_j\coloneqq X_{t_{i,j}}$ and $\widetilde{Y}_j\coloneqq Y_{t_{i,j}}$ . To prove that $\widetilde{Y}_j\widetilde{X}_j$ is a martingale difference sequence w.r.t. to the filtration it generates, we apply a Doob's optional skipping argument (Doob, 1953; Bubeck et al., 2008). We introduce the filtration $\mathcal{F}_{\tau -1} = \sigma (I_1,R_1,\dots,I_{\tau -1},R_{\tau -1},I_\tau)$ and we need to show that: (i) $Z_{\tau} = \sum_{s = 1}^{\tau}\epsilon_{s}Y_{s}X_{s}$ is a martingale, and (ii) $\{t_{i,j} = \tau \} \in \mathcal{F}_{\tau -1}$ for $\tau \in [t - 1]$ . Concerning (i), we have: + +$$ +\mathbb {E} \left[ Z _ {\tau} \mid \mathcal {F} _ {\tau - 1} \right] = Z _ {\tau - 1} + \epsilon_ {\tau} Y _ {\tau} \mathbb {E} \left[ X _ {\tau} \mid \mathcal {F} _ {\tau - 1} \right] = Z _ {\tau - 1}, +$$ + +since $\epsilon_{\tau}Y_{\tau}$ is fully determined by $\mathcal{F}_{\tau -1}$ and either $\epsilon_{\tau} = 0$ or $I_{\tau} = i$ , thus, $\epsilon_{\tau}\mathbb{E}[X_{\tau}|\mathcal{F}_{\tau -1}] = \epsilon_{\tau}\mathbb{E}[R_{\tau} - \mu_i(\tau)|\mathcal{F}_{\tau -1}] = 0$ . Concerning (ii), $\{t_{i,j} = \tau \} \in \mathcal{F}_{\tau -1}$ is trivially verified. We recall that, since $\tilde{Y}_j = Y_{t_{i,j}}$ we have that $N_{i,t_{i,j}} = j$ : + +$$ +\widetilde {Y} _ {j} = \left(\mathbb {1} \left\{j \in \{n - h (n) + 1, \dots , n \} \right\} \left(1 + \frac {t - j}{h (n)}\right) - \mathbb {1} \left\{j \in \{n - 2 h (n) + 1, \dots , n - h (n) \} \right\} \frac {t - j - h (n)}{h (n)}\right). +$$ + +From which, by substituting into Equation (52) and properly solving the indicator functions, we have: + +$$ +\sum_ {j = 1} ^ {n} \widetilde {X} _ {j} \widetilde {Y} _ {j} = \sum_ {j = n - h (n) + 1} ^ {n} \left(1 + \frac {t - j}{h (n)}\right) \widetilde {X} _ {j} - \sum_ {j = n - 2 h (n) + 1} ^ {n - h (n)} \frac {t - j}{h (n)} \cdot \widetilde {X} _ {j}. +$$ + +We compute the square of the weights and apply a derivation similar to that of Lemma A.4: + +$$ +\sum_ {j = n - h (n) + 1} ^ {n} \left(1 + \frac {t - j}{h (n)}\right) ^ {2} + \sum_ {j = n - 2 h (n) + 1} ^ {n - h (n)} \left(\frac {t - j}{h (n)}\right) ^ {2} \leqslant \frac {5 (t - n + h (n) - 1) ^ {2}}{h (n)}. +$$ + +Thus, we can now apply Azuma-Hoeffding's inequality (Lemma C.5): + +$$ +\begin{array}{l} \Pr \left(\left| \hat {\mu} _ {i} ^ {\mathrm {R - l e s s}, h (n)} (t) - \tilde {\mu} _ {i} ^ {\mathrm {R - l e s s}, h (n)} (t) \right| > \beta_ {i} ^ {\mathrm {R - l e s s}, h (n)} (t, \delta_ {t})\right) \\ = \Pr \left(\left| \sum_ {s = 1} ^ {t} \epsilon_ {s} X _ {s} Y _ {s} \right| > h (n) \beta_ {i} ^ {\mathrm {R} - \text {l e s s}, h (n)} (t, \delta_ {t})\right) \\ = \Pr \left(\left| \sum_ {j = 1} ^ {n} \widetilde {X} _ {j} \widetilde {Y} _ {j} \right| > h (n) \beta_ {i} ^ {\mathrm {R} - \text {l e s s}, h (n)} \left(t, \delta_ {t}\right)\right) \\ \leqslant 2 \exp \left(- \frac {\left(h (n) \beta_ {i} ^ {\mathsf {R - e d} , h (n)} (t , \delta_ {t})\right) ^ {2}}{2 \sigma^ {2} \left(\frac {5 (t - n + h (n) - 1) ^ {2}}{h (n)}\right)}\right) = 2 \delta_ {t}. \\ \end{array} +$$ + +By replacing into Equation (51) and summing over $n$ , we obtain: + +$$ +\sum_ {n \in \{0, \dots , t - 1 \}: h (n) \geqslant 1} 2 \delta_ {t} \leqslant \sum_ {n = 0} ^ {t - 1} 2 \delta_ {t} = 2 t ^ {1 - \alpha}. +$$ + +Theorem 5.3. Let $T \in \mathbb{N}$ , then $R-less-UCB$ (Algorithm 1) with $B_{i}(t) \equiv \hat{\mu}_{i}^{R-less, h_{i,t}}(t) + \beta_{i}^{R-less, h_{i,t}}(t)$ , $h_{i,t} = \lfloor \epsilon N_{i,t-1} \rfloor$ . + +□ + +for $\epsilon \in (0,1 / 2)$ , and $\delta_t = t^{-\alpha}$ for $\alpha > 2$ , suffers an expected regret bounded, for every $q \in [0,1]$ , as: + +$$ +\begin{array}{l} R _ {\mu} (R - l e s s - U C B, T) \leqslant \mathcal {O} \left(\frac {K}{\epsilon} (\sigma T) ^ {\frac {2}{3}} (\alpha \log T) ^ {\frac {1}{3}} \right. \\ + \frac {K T ^ {\frac {2 q}{1 + q}} (\log T) ^ {\frac {q}{1 + q}}}{\epsilon (1 - 2 \epsilon)} \Upsilon_ {\mu} \left(\left\lceil (1 - 2 \epsilon) \frac {T}{K} \right\rceil , q\right) ^ {\frac {1}{1 + q}}\left. \right). \\ \end{array} +$$ + +Proof. Let us define the good events $\mathcal{E}_t = \bigcap_{i\in [K]}\mathcal{E}_{i,t}$ that correspond to the event in which all confidence intervals hold: + +$$ +\mathcal {E} _ {i, t} := \left\{\left| \tilde {\mu} _ {i} ^ {\mathrm {R} - \text {l e s s}, h _ {i, t}} (t) - \hat {\mu} _ {i} ^ {\mathrm {R} - \text {l e s s}, h _ {i, t}} (t) \right| \leqslant \beta_ {i} ^ {\mathrm {R} - \text {l e s s}, h _ {i, t}} (t) \right\} \quad \forall i \in [ T ], i \in [ K ]. +$$ + +We have to analyze the following expression: + +$$ +R _ {\pmb {\mu}} (\mathbb {R} \mathrm {- l e s s - U C B}, T) = \mathbb {E} \left[ \sum_ {t = 1} ^ {T} \mu_ {i _ {t} ^ {*}} (t) - \mu_ {I _ {t}} (t) \right], +$$ + +where $i_t^* \in \mathrm{argmax}_{i \in [K]} \{\mu_i(t)\}$ for all $t \in [T]$ . We decompose according to the good events $\mathcal{E}_t$ : + +$$ +\begin{array}{l} R _ {\boldsymbol {\mu}} (\mathbb {R} \mathrm {- l e s s - U C B}, T) = \sum_ {t = 1} ^ {T} \mathbb {E} \Big [ \Big (\mu_ {i _ {t} ^ {*}} (t) - \mu_ {I _ {t}} (t) \Big) \mathbb {1} \{\mathcal {E} _ {t} \} \Big ] + \sum_ {t = 1} ^ {T} \mathbb {E} \Big [ \Big (\mu_ {i _ {t} ^ {*}} (t) - \mu_ {I _ {t}} (t) \Big) \mathbb {1} \{\neg \mathcal {E} _ {t} \} \Big ] \\ \leqslant \sum_ {t = 1} ^ {T} \mathbb {E} \left[ \left(\mu_ {i _ {t} ^ {*}} (t) - \mu_ {I _ {t}} (t)\right) \mathbb {1} \left\{\mathcal {E} _ {t} \right\} \right] + \sum_ {t = 1} ^ {T} \mathbb {E} \left[ \mathbb {1} \left\{\neg \mathcal {E} _ {t} \right\} \right], \\ \end{array} +$$ + +where we exploited $\mu_{i_t^*}(t) - \mu_{I_t}(t)\leqslant 1$ in the inequality. Now, we bound the second summation, as done in Theorem 4.4: + +$$ +\sum_ {t = 1} ^ {T} \mathbb {E} \left[ \mathbb {1} \left\{\neg \mathcal {E} _ {t} \right\} \right] \leqslant 1 + \frac {2 K}{\alpha - 2}. +$$ + +From now on, we will proceed the analysis under the good event $\mathcal{E}_t$ , recalling that $B_i(t) \equiv \hat{\mu}_i^{\mathrm{R - less},h_{i,t}}(t) + \beta_i^{\mathrm{R - less},h_{i,t}}(t)$ . Let $t \in [T]$ , and we exploit the optimism, i.e., $B_{i_t^*}(t) \leqslant B_{I_t}(t)$ : + +$$ +\begin{array}{l} \mu_ {i} * (t) - \mu_ {I _ {t}} (t) + B _ {I _ {t}} (t) - B _ {I _ {t}} (t) \leqslant \min \left\{1, \underbrace {\mu_ {i _ {t} ^ {*}} (t) - B _ {i _ {t} ^ {*}} (t)} _ {\leqslant 0} + B _ {I _ {t}} (t) - \mu_ {I _ {t}} (t) \right\} \\ \leqslant \min \left\{1, B _ {I _ {t}} (t) - \mu_ {I _ {t}} (t) \right\}. \\ \end{array} +$$ + +Now, we work on the term inside the minimum: + +$$ +\begin{array}{l} B _ {I _ {t}} (t) - \mu_ {I _ {t}} (t) = \hat {\mu} _ {I _ {t}} ^ {\mathrm {R} - \text {l e s s}, h _ {I _ {t}, t}} (t) + \beta_ {I _ {t}} ^ {\mathrm {R} - \text {l e s s}, h _ {I _ {t}, t}} (t) - \mu_ {I _ {t}} (t) (53) \\ \leqslant \underbrace {\tilde {\mu} _ {I _ {t}} ^ {\mathrm {R} - \text {l e s s} , h _ {I _ {t} , t}} (t) - \mu_ {I _ {t}} (t)} _ {\text {(a)}} + \underbrace {2 \beta_ {I _ {t}} ^ {\mathrm {R} - \text {l e s s} , h _ {I _ {t} , t}} (t)} _ {\text {(b)}}, (54) \\ \end{array} +$$ + +where line (53) follows from the definition of $B_{i}(t)$ and line (54) from the good event $\mathcal{E}_t$ . We proceed decomposing over the + +arms, starting with (a): + +$$ +\begin{array}{l} \sum_ {t = 1} ^ {T} \min \left\{1, \widetilde {\mu} _ {I _ {t}} ^ {\mathrm {R - l e s s}, h _ {I _ {t}, t}} (t) - \mu_ {I _ {t}} (t) \right\} \leqslant 2 K + \sum_ {i \in [ K ]} \sum_ {j = 3} ^ {N _ {i, T}} \min \left\{1, \widetilde {\mu} _ {i} ^ {\mathrm {R - l e s s}, h _ {i, t _ {i, j}}} (t _ {i, j}) - \mu_ {i} (t _ {i, j}) \right\} \\ \leqslant 2 K + \sum_ {i \in [ K ]} \sum_ {j = 3} ^ {N _ {i, T}} \min \left\{1, \frac {\left(2 t _ {i , j} - 2 (j - 1) + h _ {i , t _ {i , j}} - 1\right) \left(t _ {i , j - 1} - t _ {i , j - 2 h _ {i , t} + 1}\right)}{2 h _ {i , t}} \gamma_ {i} \left(t _ {i, (j - 1) - 2 h _ {i, t _ {i, j}} + 1}\right) \right\} (55) \\ \leqslant 2 K + \sum_ {i \in [ K ]} \sum_ {j = 3} ^ {N _ {i, T}} \min \left\{1, \frac {T ^ {2}}{\lfloor \epsilon (j - 1) \rfloor} \gamma_ {i} \left(t _ {i, j - 2 \lfloor \epsilon (j - 1) \rfloor}\right) \right\} (56) \\ \leqslant 2 K + \sum_ {i \in [ K ]} \sum_ {j = 3} ^ {N _ {i, T}} \min \left\{1, \frac {T ^ {2}}{\lfloor \epsilon (j - 1) \rfloor} \gamma_ {i} (\lfloor (1 - 2 \epsilon) j \rfloor) \right\} (57) \\ \leqslant 2 K + T ^ {2 z} \sum_ {i \in [ K ]} \sum_ {j = 3} ^ {N _ {i, T}} \left(\frac {\gamma_ {i} (\lfloor (1 - 2 \epsilon) j \rfloor)}{\lfloor \epsilon (j - 1) \rfloor}\right) ^ {z} (58) \\ \leqslant 2 K + T ^ {2 z} \sum_ {i \in [ K ]} \left(\sum_ {j = 3} ^ {N _ {i, T}} \frac {1}{\lfloor \epsilon (j - 1) \rfloor}\right) ^ {z} \left(\sum_ {j = 3} ^ {N _ {i, T}} \gamma_ {i} (\lfloor (1 - 2 \epsilon) j \rfloor) ^ {\frac {z}{1 - z}}\right) ^ {1 - z} (59) \\ \leqslant 2 K + T ^ {2 z} \left[ \frac {1}{\epsilon} \right] \left[ \frac {1}{1 - 2 \epsilon} \right] \sum_ {i \in [ K ]} \binom {\lfloor \epsilon (N _ {i, T} - 1) \rfloor} {\sum_ {j = \lfloor 2 \epsilon \rfloor} \frac {1}{j}} ^ {z} \binom {\lfloor (1 - 2 \epsilon) N _ {i, T} \rfloor} {\sum_ {j = \lfloor 3 (1 - 2 \epsilon) \rfloor} \gamma_ {i} (j) ^ {\frac {z}{1 - z}}} ^ {1 - z} (60) \\ \leqslant 2 K + T ^ {2 z} \left(1 + \log (\epsilon T)\right) ^ {z} \left[ \frac {1}{\epsilon} \right] \left[ \frac {1}{1 - 2 \epsilon} \right] \sum_ {i \in [ K ]} \left(\sum_ {j = \lfloor 3 (1 - 2 \epsilon) \rfloor} ^ {\lfloor (1 - 2 \epsilon) N _ {i, T} \rfloor} \gamma_ {i} (j) ^ {\frac {z}{1 - z}}\right) ^ {1 - z} (61) \\ \leqslant 2 K + T ^ {2 z} (1 + \log (\epsilon T)) ^ {z} \left\lceil \frac {1}{\epsilon} \right\rceil \left\lceil \frac {1}{1 - 2 \epsilon} \right\rceil \sum_ {i \in [ K ]} \Upsilon_ {\mu} \left(\left\lfloor (1 - 2 \epsilon) N _ {i, T} \right\rfloor , \frac {z}{1 - z}\right) ^ {1 - z} \\ \leqslant 2 K + T ^ {2 z} \left(1 + \log (\epsilon T)\right) ^ {z} \left[ \frac {1}{\epsilon} \right] \left[ \frac {1}{1 - 2 \epsilon} \right] K ^ {z} \left(\sum_ {i \in [ K ]} \Upsilon_ {\mu} \left(\left\lfloor (1 - 2 \epsilon) N _ {i, T} \right\rfloor , \frac {z}{1 - z}\right)\right) ^ {1 - z} (62) \\ \leqslant 2 K + T ^ {2 z} \left(1 + \log (\epsilon T)\right) ^ {z} \left[ \frac {1}{\epsilon} \right] \left[ \frac {1}{1 - 2 \epsilon} \right] K \Upsilon_ {\mu} \left(\left[ (1 - 2 \epsilon) \frac {T}{K} \right], \frac {z}{1 - z}\right) ^ {1 - z}. (63) \\ \end{array} +$$ + +where line (55) follows from the bias bound of Lemma A.6, line (56) is obtained from bounding $(2t_{i,j} - 2(j - 1) + h_{i,t_i,j} - 1)(t_{i,j - 1} - t_{i,j - 2h_{i,t + 1}})\leqslant 2T^2$ and using the definition of $h_{i,t}$ , line (57) derives from observing that $\gamma_{i}(t_{i,j})\leqslant \gamma_{i}(j)$ for Assumption 3.2 and having bounded the floor analogously as done in Theorem 4.4, line (58) from the inequality $\min \{1,x\} \leqslant \min \{1,x\} ^z\leqslant x^z$ for $z\in [0,1 / 2]$ , line (59) is obtained from Hölder's inequality with exponents $\frac{1}{z}\geqslant 1$ and $\frac{1}{1 - z}\geqslant 1$ respectively, line (60) is an application of Lemma C.1 to independently to both inner summations, line (61) derives from bounding the harmonic sum, i.e., $\sum_{[2\epsilon ]}^{[\epsilon (N_{i,T} - 1)]}\frac{1}{j}\leqslant 1 + \log (\epsilon (N_{i,T} - 1))\leqslant 1 + \log (\epsilon T)$ , line (62) follows from Jensen's inequality, line (63) is obtained from Lemma C.2. By recalling $q = \frac{z}{1 - z}\in [0,1]$ , we obtain: + +$$ +2 K + T ^ {\frac {2 q}{1 + q}} \left(1 + \log (\epsilon T)\right) ^ {\frac {q}{1 + q}} \left\lceil \frac {1}{\epsilon} \right\rceil \left\lceil \frac {1}{1 - 2 \epsilon} \right\rceil K \Upsilon_ {\mu} \left(\left\lceil (1 - 2 \epsilon) \frac {T}{K} \right\rceil , q\right) ^ {\frac {1}{1 + q}}. +$$ + +Concerning the term (b), we recall that $\beta_{I_t}^{\mathrm{R - less},h_{I_t,t}}(t)$ equals the bonus term used in the rested setting and, consequently + +from Theorem 4.4: + +$$ +\sum_ {t = 1} ^ {T} \min \left\{1, 2 \beta_ {I _ {t}} ^ {\mathrm {R - e d}, h _ {I _ {t}, t}} (t, \delta_ {t}) \right\} \leqslant K \left(3 + \frac {1}{\epsilon}\right) + \frac {3 K}{\epsilon} (2 \sigma T) ^ {\frac {2}{3}} (1 0 \alpha \log T) ^ {\frac {1}{3}}. +$$ + +Putting all together, we obtain: + +$$ +\begin{array}{l} R _ {\mu} (\mathrm {R - l e s s - U C B}, T) \leqslant 1 + \frac {2 K}{\alpha - 2} + 5 K + \frac {K}{\epsilon} + \frac {3 K}{\epsilon} (2 \sigma T) ^ {\frac {2}{3}} (1 0 \alpha \log T) ^ {\frac {1}{3}} \\ + T ^ {\frac {2 q}{1 + q}} \left(1 + \log (\epsilon T)\right) ^ {\frac {q}{1 + q}} \left\lceil \frac {1}{\epsilon} \right\rceil \left\lceil \frac {1}{1 - 2 \epsilon} \right\rceil K \Upsilon_ {\mu} \left(\left\lceil (1 - 2 \epsilon) \frac {T}{K} \right\rceil , q\right) ^ {\frac {1}{1 + q}}. \\ \end{array} +$$ + +![](images/53107d7e00f72fce88845de1b91df444fa411bb6aa7586288ecf2f653fa7d0e7.jpg) + +# B. Bounding the Cumulative Increment + +Let us consider the case in which $\gamma_{i}(l) \leqslant l^{-c}$ for all $i \in [K]$ and $l \in [T]$ . We bound the cumulative increment with the corresponding integral using Lemma C.4, depending on the value of $cq$ : + +$$ +\Upsilon_{\mu}\left(\left\lceil \frac{T}{K}\right\rceil ,q\right) = \sum_{l = 1}^{\left\lceil \frac{T}{K}\right\rceil}\gamma_{i}(l)^{q}\leqslant 1 + \int_{x = 1}^{\frac{T}{K}}x^{-cq}\mathrm{d}x\leqslant 1 + \left\{\begin{array}{ll}\left(\frac{T}{K}\right)^{1 - cq}\frac{1}{1 - cq}&\text{if} cq < 1\\\log \frac{T}{K}&\text{if} cq = 1 .\\\frac{1}{cq - 1}&\text{if} cq > 1\end{array}\right. +$$ + +Thus, depending on the value of $c$ , there will be different optimal values for $q$ in the rested and restless cases that optimize the regret upper bound. + +# B.1. Rested Setting + +Let us start with the rested case. From Theorem 4.3, we have: + +$$ +\begin{array}{l} R _ {\boldsymbol {\mu}} \leqslant 2 K + T ^ {q} K \Upsilon_ {\boldsymbol {\mu}} \left(\left\lceil \frac {T}{K} \right\rceil , q\right) \leqslant 2 K + K T ^ {q} + K \left\{\begin{array}{l l}\frac {T ^ {1 - c q + q}}{K ^ {1 - q c} (1 - c q)}&\text {i f} c q < 1\\T ^ {q} \log \frac {T}{K}&\text {i f} c q = 1\\\frac {T ^ {q}}{c q - 1}&\text {i f} c q > 1\end{array}\right. \\ \leqslant \mathcal {O} \left( \right.K \left\{ \right.\begin{array}{l l}\frac {T ^ {1 - c q + q}}{K ^ {1 - q c} (1 - c q)}&\text {i f} c q < 1\\T ^ {q} \log \frac {T}{K}&\text {i f} c q = 1\\\frac {T ^ {q}}{\min \{1 , c q - 1 \}}&\text {i f} c q > 1\end{array}\left. \right) \quad \forall q \in [ 0, 1 ], \\ \end{array} +$$ + +where we have highlighted the dominant term. For the case $c \in (0,1)$ we consider the first case only and minimize over $q$ : + +$$ +R _ {\mu} \leqslant \mathcal {O} \left(K \min _ {q \in [ 0, 1 ]} \frac {T ^ {1 - c q + q}}{K ^ {1 - q c} (1 - c q)}\right) = \mathcal {O} (T). +$$ + +For the case $c = 1$ , we still obtain $R_{\mu} \leqslant \mathcal{O}(T)$ . Instead, for $c \in (1, +\infty)$ , we have the three cases: + +$$ +R _ {\boldsymbol {\mu}} \leqslant \mathcal {O} \left(K \min \left\{ \begin{array}{l} K \min _ {q \in [ 0, 1 / c)} \frac {T ^ {1 - c q + q}}{K ^ {1 - q c} (1 - c q)} \\ T ^ {\frac {1}{c}} \log \frac {T}{K} \\ \min _ {q \in (1 / c, 1 ]} \frac {T ^ {q}}{\min \{1 , c q - 1 \}} \end{array} \right.\right) = \mathcal {O} \left(K T ^ {\frac {1}{c}} \log \frac {T}{K}\right). +$$ + +# B.2. Restless Setting + +Let us now move to the restless setting. From Theorem 5.2, we have: + +$$ +\begin{array}{l} R _ {\mu} \leqslant 2 K + T ^ {\frac {q}{q + 1}} K \Upsilon_ {\mu} \left(\left\lceil \frac {T}{K} \right\rceil , q\right) ^ {\frac {1}{1 + q}} \leqslant 2 K + K T ^ {\frac {q}{q + 1}} + K \left\{\begin{array}{l l}\frac {T ^ {\frac {1 - c q + q}{q + 1}}}{K ^ {\frac {1 - g c}{q + 1}} (1 - c q)}&\text {i f} c q < 1\\T ^ {\frac {q}{q + 1}} (\log \frac {T}{K}) ^ {\frac {1}{q + 1}}&\text {i f} c q = 1\\\frac {T ^ {\frac {q}{q + 1}}}{c q - 1}&\text {i f} c q > 1\end{array}\right. \\ \leqslant \mathcal {O} \left(K \left\{ \begin{array}{l l} \frac {T ^ {\frac {1 - c q + q}{q + 1}}}{K ^ {\frac {1 - q c}{q + 1}} (1 - c q)} & \text {i f} c q < 1 \\ T ^ {\frac {q}{q + 1}} \left(\log \frac {T}{K}\right) ^ {\frac {1}{q + 1}} & \text {i f} c q = 1 \\ \frac {T ^ {\frac {q}{q + 1}}}{\min \{1 , c q - 1 \}} & \text {i f} c q > 1 \end{array} \right.\right), \quad \forall q \in [ 0, 1 ]. \\ \end{array} +$$ + +For the case $c \in (0,1)$ , we consider the first case only and minimize over $q$ : + +$$ +R _ {\mu} \leqslant \mathcal {O} \left(K \min _ {q \in [ 0, 1 ]} \frac {T ^ {\frac {1 - c q + q}{q + 1}}}{K ^ {\frac {1 - q c}{q + 1}} (1 - c q)}\right) \leqslant \mathcal {O} \left(\frac {K ^ {\frac {1 + c}{2}} T ^ {1 - \frac {c}{2}}}{1 - c}\right), +$$ + +for sufficiently large $T \gg K$ . For the case $c = 1$ , it is simple to prove that the case $cq = 1$ leads to the smallest regret: + +$$ +R _ {\mu} \leqslant K T ^ {\frac {1}{c + 1}} \left(\log \frac {T}{K}\right) ^ {\frac {c}{c + 1}}. +$$ + +Finally, for the case $c \in (1, +\infty)$ , we have to consider all the three cases: + +$$ +R _ {\mu} \leqslant \mathcal {O} \left(K \left\{ \begin{array}{l} \min _ {q \in [ 0, 1 / c)} \frac {T ^ {\frac {1 - c q + q}{q + 1}}}{K ^ {\frac {1 - q c}{q + 1}} (1 - c q)} \\ T ^ {\frac {1}{c + 1}} \left(\log \frac {T}{K}\right) ^ {\frac {c}{c + 1}} \\ \min _ {q \in (1 / c, 1 ]} \frac {T ^ {\frac {q}{q + 1}}}{\min \{1 , c q - 1 \}} \end{array} \right.\right) = K T ^ {\frac {1}{c + 1}} \left(\log \frac {T}{K}\right) ^ {\frac {c}{c + 1}}. +$$ + +# C. Technical Lemmas + +Lemma C.1. Let $M\geqslant 3$ , and let $f:\mathbb{N}\to \mathbb{R}$ , and $\beta \in (0,1)$ . Then it holds that: + +$$ +\sum_ {j = 3} ^ {M} f (\lfloor \beta j \rfloor) \leqslant \left\lceil \frac {1}{\beta} \right\rceil \sum_ {l = \lfloor 3 \beta \rfloor} ^ {\lfloor \beta M \rfloor} f (l). +$$ + +Proof. We simply observe that the minimum value of $\lfloor \beta j\rfloor$ is $\lfloor 3\beta \rfloor$ and its maximum value is $\lfloor \beta M\rfloor$ . Each element $\lfloor \beta j\rfloor$ changes value at least one time every $\left\lceil \frac{1}{\beta}\right\rceil$ times. + +Lemma C.2. Under Assumption 3.2, it holds that: + +$$ +\max_{\substack{(N_{i,T})_{i\in [K]}\\N_{i,T}\geqslant 0,\sum_{i\in [K]}N_{i,T} = T}}\sum_{i\in [K]}\Upsilon_{\boldsymbol{\mu}}(N_{i,T},q)\leqslant K\Upsilon_{\boldsymbol{\mu}}\left(\left\lceil \frac{T}{K}\right\rceil ,q\right). +$$ + +Proof. We first claim that there exists an optimal assignment of $N_{i,T}^{*}$ are such that $|N_{i,T}^{*} - N_{i',T}^{*}| \leqslant 1$ for all $i, i' \in [K]$ . By contradiction, suppose that the only optimal assignments are such that there exists a pair $i_1, i_2 \in [K]$ such that $\Delta := N_{i_2,T}^* - N_{i_1,T}^* > 1$ . In such a case, we have: + +$$ +\begin{array}{l} \Upsilon_ {\boldsymbol {\mu}} \left(N _ {i _ {1}, T} ^ {*}, q\right) + \Upsilon_ {\boldsymbol {\mu}} \left(N _ {i _ {2}, T} ^ {*}, q\right) = 2 \Upsilon_ {\boldsymbol {\mu}} \left(N _ {i _ {1}, T} ^ {*}, q\right) + \sum_ {j = 1} ^ {\Delta} \gamma_ {i *} \left(N _ {i _ {1}, T} ^ {*} + l - 1\right) \\ \leqslant 2 \Upsilon_ {\boldsymbol {\mu}} \left(N _ {i _ {1}, T} ^ {*}, q\right) + \sum_ {j = 0} ^ {[ \Delta / 2 ]} \gamma_ {i *} \left(N _ {i _ {1}, T} ^ {*} + l - 1\right) + \sum_ {j = 1} ^ {[ \Delta / 2 ]} \gamma_ {i *} \left(N _ {i _ {1}, T} ^ {*} + l - 1\right) \\ = \Upsilon_ {\boldsymbol {\mu}} \left(N _ {i _ {1}, T} ^ {*}, + \lceil \Delta / 2 \rceil , q\right) + \Upsilon_ {\boldsymbol {\mu}} \left(N _ {i _ {1}, T} ^ {*}, + \lfloor \Delta / 2 \rfloor , q\right). \\ \end{array} +$$ + +where the inequality follows from Assumption 3.2. By redefining $\widetilde{N}_{i_1,T}^* \coloneqq N_{i_1,T}^* + \lfloor \Delta / 2 \rfloor$ and $\widetilde{N}_{i_2,T}^* \coloneqq N_{i_1,T}^* + \lceil \Delta / 2 \rceil$ , we have that $\widetilde{N}_{i_1,T}^* + \widetilde{N}_{i_2,T}^* = N_{i_1,T}^* + N_{i_2,T}^*$ and $|\widetilde{N}_{i_1,T}^* - \widetilde{N}_{i_2,T}^*| \leqslant 1$ . Thus, we have found a better solution to the optimization problem, contradicting the hypothesis. Since the optimal assignment fulfills $|N_{i,T}^* - N_{i',T}^*| \leqslant 1$ , it must be that $N_{i,T}^* \leqslant \left\lceil \frac{T}{K} \right\rceil$ for all $i \in [K]$ . + +Lemma C.3. Under Assumptions 3.1 and 3.2, for every $i \in [K]$ , $k, k' \in \mathbb{N}$ with $k' < k$ , for both rested and restless bandits, it holds that: + +$$ +\gamma_ {i} (k) \leqslant \frac {\mu_ {i} (k) - \mu_ {i} \left(k ^ {\prime}\right)}{k - k ^ {\prime}}. +$$ + +Proof. Using Assumption 3.2, we have: + +$$ +\gamma_ {i} (k) = \frac {1}{k - k ^ {\prime}} \sum_ {l = k ^ {\prime}} ^ {k - 1} \gamma_ {i} (k) \leqslant \frac {1}{k - k ^ {\prime}} \sum_ {l = k ^ {\prime}} ^ {k - 1} \gamma_ {i} (l) = \frac {1}{k - k ^ {\prime}} \sum_ {l = k ^ {\prime}} ^ {k - 1} (\mu_ {i} (l + 1) - \mu_ {i} (l)) = \frac {\mu_ {i} (k) - \mu_ {i} (k ^ {\prime})}{k - k ^ {\prime}}, +$$ + +where the first inequality comes from the concavity of the reward function, and the second equality from the definition of increment. + +Lemma C.4. Let $a, b \in \mathbb{N}$ and let $f: [a, b] \to \mathbb{R}$ . If $f$ is monotonically non-decreasing function, then: + +$$ +\sum_ {n = a} ^ {b} f (n) \leqslant \int_ {x = a} ^ {b} f (x) \mathrm {d} x + f (b) \leqslant \int_ {x = a} ^ {b + 1} f (x). +$$ + +If $f$ is monotonically non-increasing, then: + +$$ +\sum_ {n = a} ^ {b} f (n) \leqslant f (a) + \int_ {x = a} ^ {b} f (x) \mathrm {d} x \leqslant \int_ {x = a - 1} ^ {b} f (x) \mathrm {d} x. +$$ + +Proof. Let us consider the intervals $I_{i} = [x_{i - 1}, x_{i}]$ with $x_{0} = a$ and $x_{i} = x_{i - 1} + 1$ for $i \in [b - a]$ . If $f$ is monotonically non-decreasing, we have that for all $i \in [b - a]$ and $x \in I_{i}$ it holds that $f(x) \geqslant f(x_{i - 1})$ and consequently $\int_{I_i} f(x) \mathrm{d}x \geqslant f(x_{i - 1}) \mathrm{vol}(I_i) = f(x_{i - 1})$ . Thus: + +$$ +\sum_ {n = a} ^ {b} f (n) = \sum_ {i = 1} ^ {b - a} f \left(x _ {i - 1}\right) + f (b) \leqslant \sum_ {i = 1} ^ {b - a} \int_ {I _ {i}} f (x) \mathrm {d} x + f (b) = \int_ {x = a} ^ {b} f (x) \mathrm {d} x + f (b). +$$ + +Recalling that $f(b) \leqslant \int_{x = b}^{b + 1} f(x) \, \mathrm{d}x$ , we get the second inequality. Conversely, if $f$ is monotonically non-increasing, then for all $i \in [b - a]$ and $x \in I_i$ , it holds that $f(x) \geqslant f(x_i)$ and consequently $\int_{I_i} f(x) \, \mathrm{d}x \geqslant f(x_i)$ . Thus: + +$$ +\sum_ {n = a} ^ {b} f (n) = f (a) + \sum_ {i = 1} ^ {b - a} f \left(x _ {i}\right) \leqslant f (a) + \sum_ {i = 1} ^ {b - a} \int_ {I _ {i}} f (x) \mathrm {d} x = f (a) + \int_ {x = a} ^ {b} f (x) \mathrm {d} x. +$$ + +Recalling that $f(a) \leqslant \int_{x=a-1}^{a} f(x) \, \mathrm{d}x$ , we get the second inequality. + +Theorem C.5 (Höeffding-Azuma's inequality for weighted martingales). Let $\mathcal{F}_1\subset \dots \subset \mathcal{F}_n$ be a filtration and $X_{1},\ldots ,X_{n}$ be real random variables such that $X_{t}$ is $\mathcal{F}_t$ -measurable, $\mathbb{E}[X_t|\mathcal{F}_{t - 1}] = 0$ (i.e., a martingale difference sequence), and $\mathbb{E}[\exp (\lambda X_t)|\mathcal{F}_{t - 1}]\leqslant \exp \left(\frac{\lambda^2\sigma^2}{2}\right)$ for any $\lambda >0$ (i.e., $\sigma^2$ -subgaussian). Let $\alpha_{1},\ldots ,\alpha_{n}$ be non-negative real numbers. Then, for every $\kappa \geqslant 0$ it holds that: + +$$ +\operatorname * {P r} \left(\left| \sum_ {t = 1} ^ {n} \alpha_ {t} X _ {t} \right| > \kappa\right) \leqslant 2 \exp \left(- \frac {\kappa^ {2}}{2 \sigma^ {2} \sum_ {t = 1} ^ {n} \alpha_ {i} ^ {2}}\right). +$$ + +Proof. It is a straightforward extension of Azuma-Hoeffding inequality for subgaussian random variables. We apply the Chernoff's method for some $s > 0$ : + +$$ +\operatorname * {P r} \left(\sum_ {t = 1} ^ {n} \alpha_ {t} X _ {t} > \kappa\right) = \operatorname * {P r} \left(e ^ {s \sum_ {t = 1} ^ {n} \alpha_ {t} X _ {t}} > e ^ {s \kappa}\right) \leqslant \frac {\mathbb {E} \left[ e ^ {s \sum_ {t = 1} ^ {n} \alpha_ {t} X _ {t}} \right]}{e ^ {s \kappa}}, +$$ + +where the last inequality follows from the application of Markov's inequality. We use the martingale property to deal with the expectation. By the law of total expectation, we have: + +$$ +\mathbb {E} \left[ e ^ {s \sum_ {t = 1} ^ {n} \alpha_ {t} X _ {t}} \right] = \mathbb {E} \left[ e ^ {s \sum_ {t = 1} ^ {n - 1} \alpha_ {t} X _ {t}} \mathbb {E} \left[ e ^ {s \alpha_ {n} X _ {n}} | \mathcal {F} _ {t - 1} \right] \right]. +$$ + +Using now the subgaussian property, we have: + +$$ +\mathbb {E} \left[ e ^ {s \alpha_ {n} X _ {n}} | \mathcal {F} _ {t - 1} \right] \leqslant \exp \left(\frac {s ^ {2} \alpha_ {n} ^ {2} \sigma^ {2}}{2}\right). +$$ + +An inductive argument, leads to: + +$$ +\mathbb {E} \left[ e ^ {s \sum_ {t = 1} ^ {n} \alpha_ {t} X _ {t}} \right] \leqslant \exp \left(\frac {s ^ {2} \sigma^ {2}}{2} \sum_ {t = 1} ^ {n} \alpha_ {n} ^ {2}\right). +$$ + +Thus, minimizing w.r.t. $s > 0$ , we have: + +$$ +\operatorname * {P r} \left(\sum_ {t = 1} ^ {n} \alpha_ {t} X _ {t} > \kappa\right) \leqslant \min _ {s \geqslant 0} \exp \left(\frac {s ^ {2} \sigma^ {2}}{2} \sum_ {t = 1} ^ {n} \alpha_ {n} ^ {2} - s \kappa\right) = \exp \left(- \frac {\kappa^ {2}}{2 \sigma^ {2} \sum_ {t = 1} ^ {n} \alpha_ {n} ^ {2}}\right), +$$ + +being the minimum attained by $s = \frac{\kappa}{\sigma^2 \sum_{t=1}^{n} \alpha_n^2}$ . The reverse inequality can be derived analogously. A union bound completes the proof. + +Lemma C.6. Let $\Upsilon_{\mu}(T,q)$ be as defined in Equation (2) for some $q\in [0,1]$ . Then, for all $i\in [K]$ and $l\in \mathbb{N}$ the following statements hold: + +- if $\gamma_i(l) \leqslant be^{-cl}$ , then $\Upsilon_{\mu}(T,q) \leqslant \mathcal{O}\left(b^q\frac{e^{-cq}}{cq}\right)$ ; +- if $\gamma_i(l) \leqslant b l^{-c}$ with $c q > 1$ , then $\Upsilon_{\mu}(T, q) \leqslant \mathcal{O}\left(\frac{b^q}{c q - 1}\right)$ ; +- if $\gamma_{i}(l) \leqslant bl^{-c}$ with $cq = 1$ , then $\Upsilon_{\mu}(T,q) \leqslant \mathcal{O}(b^{q}\log T)$ ; +- if $\gamma_i(l) \leqslant b l^{-c}$ with $c q < 1$ , then $\Upsilon_{\mu}(T, q) \leqslant \mathcal{O}\left(b^q \frac{T^{1 - c q}}{1 - c q}\right)$ . + +Proof. The proofs of all the statements are obtained by bounding the summation defining $\Upsilon_{\mu}(T,q)$ with the corresponding integrals, as in Lemma C.4. Let us start with $\gamma_i(l) \leqslant be^{-cl}$ : + +$$ +\Upsilon_ {\boldsymbol {\mu}} (T, q) = \sum_ {l = 1} ^ {T} \gamma_ {i} (l) ^ {q} \leqslant b ^ {q} e ^ {- c q} + \int_ {x = 1} ^ {T} b ^ {q} e ^ {- c q x} d x \leqslant b ^ {q} e ^ {- c q} + \frac {b ^ {q}}{c q} e ^ {- c q} = \mathcal {O} \left(b ^ {q} \frac {e ^ {- c q}}{c q}\right). +$$ + +We now move to $\gamma_{i}(l)\leqslant bl^{-c}$ . If $cq < 1$ , we have: + +$$ +\Upsilon_ {\boldsymbol {\mu}} (T, q) = \sum_ {l = 1} ^ {T} \gamma_ {i} (l) ^ {q} \leqslant b ^ {q} + \int_ {x = 1} ^ {T} b ^ {q} x ^ {- c q} \mathrm {d} x = b ^ {q} + \frac {b ^ {q}}{c q - 1} = \mathcal {O} \left(\frac {b ^ {q}}{c q - 1}\right). +$$ + +For $cq = 1$ , we obtain: + +$$ +\Upsilon_ {\boldsymbol {\mu}} (T, q) = \sum_ {l = 1} ^ {T} \gamma_ {i} (l) ^ {q} \leqslant b ^ {q} + \int_ {x = 1} ^ {T} \frac {b ^ {q}}{x} d x = b ^ {q} + b ^ {q} \log T = \mathcal {O} (b ^ {q} \log T). +$$ + +Finally, for $cq < 1$ , we have: + +$$ +\Upsilon_ {\boldsymbol {\mu}} (T, q) = \sum_ {l = 1} ^ {T} \gamma_ {i} (l) ^ {q} \leqslant b ^ {q} + \int_ {x = 1} ^ {T} b ^ {q} x ^ {- c q} \mathrm {d} x = b ^ {q} + b ^ {q} \frac {T ^ {1 - c q}}{1 - c q} = \mathcal {O} \left(b ^ {q} \frac {T ^ {1 - c q}}{1 - c q}\right). +$$ + +The results of Table 1 are obtained by setting $b = 1$ . + +# D. Efficient Update + +Under the assumption that the window size depends on the number of pulls only and that $0 \leqslant h(n + 1) - h(n) \leqslant 1$ , we can employ the following efficient $\mathcal{O}(1)$ update for R-ed-UCB and R-less-UCB. Denoting with $n$ the number of pulls of arm $i$ , we update the estimator at every time step $t \in [T]$ as: + +$$ +\hat {\mu} _ {i} ^ {h (n)} (t) = \frac {1}{h (n)} \left(a _ {n} + \frac {t (a _ {n} - b _ {n})}{h (n)} - \frac {c _ {n} - d _ {n}}{h (n)}\right), +$$ + +where the following sequences are updated only when the arm is pulled: + +$$ +\begin{array}{l} a _ {n} = \left\{ \begin{array}{l l} a _ {n - 1} + r _ {i} (n) - r _ {i} (n - h (n)) & \text {i f} h (n) = h (n - 1) \\ a _ {n - 1} + r _ {i} (n) & \text {o t h e r w i s e} \end{array} \right., \\ b _ {n} = \left\{ \begin{array}{l l} b _ {n - 1} + r _ {i} (n - h (n)) - r _ {i} (n - 2 h (n)) & \text {i f} h (n) = h (n - 1) \\ b _ {n - 1} + r _ {i} (n - 2 h (n) + 1) & \text {o t h e r w i s e} \end{array} \right., \\ c _ {n} = \left\{ \begin{array}{l l} c _ {n - 1} + n r _ {i} (n) - (n - h (n)) r _ {i} (n - h (n)) & \text {i f} h (n) = h (n - 1) \\ c _ {n - 1} + n r _ {i} (n) & \text {o t h e r w i s e} \end{array} \right., \\ d _ {n} = \left\{ \begin{array}{l l} d _ {n - 1} + (n - h (n)) r _ {i} (n - h (n)) - (n - 2 h (n)) r _ {i} (n - 2 h (n)) & \text {i f} h (n) = h (n - 1) \\ d _ {n - 1} + (n - 2 h (n) + 1) r _ {i} (n - 2 h (n) + 1) & \text {o t h e r w i s e} \end{array} \right., \\ \end{array} +$$ + +where we have abbreviated $r_i(n) \coloneqq R_{t_{i,n}}$ . + +# E. Experimental Setting and Additional Results + +# E.1. Parameter Setting + +The choices of the parameters of the algorithms we compared R-less/ed-UCB with are the following: + +- Rexp3: $V_{T} = K$ since in our experiments we consider the reward of each arm to evolve from 0 to 1, thus the maximum global variation possible is equal the number of arms of the bandit; $\gamma = \min \left\{1, \sqrt{\frac{K \log K}{(e - 1) \Delta_{T}}}\right\}$ , $\Delta_{T} = [(K \log K)^{1/3}(T / V_{T})^{2/3}]$ as recommended by Besbes et al. (2014); +- KL-UCB: $c = 3$ as required by the theoretical results on the regret provided by Garivier & Cappé (2011); +- Ser4: according to what suggested by Allesiardo et al. (2017) we selected $\delta = 1 / T$ , $\epsilon = \frac{1}{KT}$ , and $\phi = \sqrt{\frac{N}{TK\log(KT)}}$ ; +- SW-UCB: as suggested by Garivier & Moulines (2011) we selected the sliding-window $\tau = 4\sqrt{T\log T}$ and the constant $\xi = 0.6$ ; +- SW-KL-UCB as suggested by Garivier & Moulines (2011) we selected the sliding-window $\tau = \sigma^{-4/5}$ ; +- SW-TS: as suggested by Trovò et al. (2020) for the smoothly changing environment we set $\beta = 1/2$ and sliding-window $\tau = T^{1 - \beta} = \sqrt{T}$ . + +# E.2. IMDB Experiment + +We created a bandit environment in which each of the classification algorithms is an arm of the bandit. The interaction for each round $t \in T$ of the real-world experiment is composed by the following: + +- the agent decides to pull arm $I_{t}$ ; +- a random point $x_{t}$ of the IMDB dataset is selected and supplied to the classification algorithm associated to arm $I_{t}$ ; +- the "base" algorithm classifies the sample, i.e., it provides the prediction $\hat{y}_t \in \{0,1\}$ for the selected sample $x_t$ ; +- the environment generates the reward comparing the prediction $\hat{y}_t$ to the target class $y_t$ using the following function $R_t = 1 - |y_t - \hat{y}_t|$ ; +- the base algorithm is updated using $(x_{t},y_{t})$ ; + +Since the base algorithms are trained only if their arm is selected, this is a problem which belongs to the rested scenario. + +For the classification task we decided to employ: + +![](images/4608c6eef24cb85b601a7a73581eea00ea40d113b77b9cadefaa507bd3808575.jpg) +Figure 6. Empirical learning curves of the classification algorithms (arms) of the IMDB experiment + +![](images/df3d730d8f1609d565c40eb96540ada0f54903e670a7028a421fbf5c35e3ad79.jpg) +Figure 7. Cumulative regret in a 2-arms online model selection on IMDB dataset (30 runs, $95\%$ c.i.). + +- 2 Online Logistic Regression (LR) methods with different schemes used for the learning rate $\lambda_{t}$ ; +- 5 Neural Networks (NNs) different in terms of shape and number of neurons + +Specifically, we adopt a decreasing scheme for the learning rate of $\lambda_t = \frac{\beta}{t}$ (denoted with $\mathbb{L}\mathbb{R}(t)$ from now on) and a constant learning rate $\lambda_t = \beta$ (denoted as $\mathbb{L}\mathbb{R}$ from now on). Moreover, the NNs use as activation functions the rectified linear unit, i.e., $relu(x) = \max(0,x)$ , a constant learning rate $\alpha = 0.001$ and the "adam" stochastic gradient optimizer for fitting. Two of the chosen nets have only one hidden layer, with 1 and 2 neurons, respectively, the third net has 2 hidden layers, with 2 neurons each, and two nets have 3 layers with 2, 2, 2 and 1, 1, 2 neurons, respectively. We refer to a specific NN denoting in curve brackets the cardinalities of the layers, e.g., the one having 2 layers with 2 neurons each is denoted by $\mathrm{NN}(2,2)$ . + +We analyzed their global performance on the IMDB dataset by averaging 1,000 independent runs in which each strategy is sequentially fed with all the available 50,000 samples. The goal was to determine, at each step, the value of the payoff $\mu_i(n)$ . Figure 6a provides the average learning curves of the selected algorithms. As we expected, from a qualitative perspective, the average learning curves are increasing and concave, however, due to the limited number of simulations, Assumptions 3.1 and 3.2 are not globally satisfied. + +We also perform an experiment using only $\mathsf{LR}(t)$ and LR as arms. Figure 7a reports the result of a run of the MAB algorithms over the IMDB scenario. The analogy between this result and the one of the 2-arms synthetic rested bandit (Figure 4b) is clear, indeed R-ed-UCB outperforms the other baselines when the learning curves of the base algorithms at some point intersects one another. + +# E.3. Pulls of each arm + +Figure 8 presents the average number of pulls for each arm for each one of the algorithm analysed in the synthetic experiments of Section 6. Figure 8a shows how R-less-UCB is able to identify and discard the majority of the suboptimal arms using a few pulls, and it is second only to SW-TS, which seems to commit to a single arm which turns out to be the optimal one (arm 13). Figure 8b shows that R-ed-UCB explored arms 13 and 1 more than the others, which are respectively the best and the second-best, and most likely needs a longer time horizon to select which one is the best among the twos. Figure 8c highlights the fact that R-ed-UCB undoubtedly identified which arm is the best (arm 2), while KL-UCB, SW-UCB, SW-KL-UCB do not identify the best arm. Ser4, Rexp3 and SW-TS pulled the best arm slightly more than $50\%$ of the times, paying the already discussed initial learning phase. + +# E.4. Additional Experimental Results + +We evaluated the performance of the algorithms over 50 different bandits with $K \in \{2, \dots, 15\}$ randomly generated arms over a time horizon of $T = 200,000$ rounds. We averaged the run of each algorithm on a single scenario over 10 independent experiments and compared the expected value of the ranking of the considered algorithms in order to draw up a leaderboard: in every scenario we ranked the algorithms based on their empirical regret, giving the first placement to the one with the lowest value. We report the summarized results of the rank of the algorithms averaged over the 50 experiments in Table 2. In the rested case R-ed-UCB is among the worse ones (4.98 on average), however this is again due to the fact that on average the algorithm is not superior to the baselines, which conversely do not provide any theoretical guarantees in some + +![](images/7d3ab933be67e825c393344606097ede2d1d60543d43ce6302adc22709186f1b.jpg) +Figure 8. Average number of pulls: (a) 15 arms R-less, (b) 15 arms R-ed, (c) 2 arms R-ed. + +![](images/4cb27b84a7be8d155d38e8df0be691c382ba7a5f932c559c259cb098cd375865.jpg) + +![](images/e11ad1bc6ddcd2a2697e9f8129cbd4ff66ad987bb6b584cdaec909a9b34d1d1c.jpg) + +Table 2. Ranking of the algorithms (50 bandits, 10 runs, $95\%$ c.i. in brackets). + +
AlgorithmRested Setting RankingRestless Setting RankingRestless Setting Ranking Heuristic
R-ed-UCB4.98 (0.34)--
R-less-UCB-5.14 (0.38)-
R-less-UCB-H--1.90 (0.30)
KL-UCB2.56 (0.43)2.54 (0.34)2.46 (0.31)
Rexp35.10 (0.26)5.20 (0.26)6.08 (0.16)
SW-TS2.84 (0.35)2.86 (0.39)4.76 (0.19)
SW-UCB2.12 (0.44)2.58 (0.47)3.08 (0.30)
Ser46.84 (0.15)6.60 (0.28)6.66 (0.18)
SW-KL-UCB3.56 (0.38)3.08 (0.45)3.06 (0.48)
+ +specific settings (see the 2 arm experiment). In the restless case R-less-UCB achieves a worse-than-average performance, probably influenced by the characteristics of the randomly generated bandits. Due to this unsatisfactory results, we propose a slight modification of the R-less-UCB upper bound as follows: + +$$ +\hat {\mu} _ {i} ^ {\mathrm {R - l e s s}, h} (t) := \frac {1}{h} \sum_ {l = N _ {i, t - 1} - h + 1} ^ {N _ {i, t - 1}} \left(R _ {t _ {i, l}} + (t - t _ {i, l}) \frac {R _ {t _ {i , l}} - R _ {t _ {i , l - h}}}{t _ {i , l} - t _ {i , l - h}}\right), +$$ + +which we call R-less-UCB-H to denote it is an heuristic method, i.e., not having theoretical results on the regret. While the performance of the heuristic seems good in practice (it achieves the best overall result), its downside is that the theoretical guarantees on the regret will have to be reconsidered. \ No newline at end of file diff --git a/stochasticrisingbandits/images.zip b/stochasticrisingbandits/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..612ddeabb0bc3f50ea41cd8ec059c1465d54d373 --- /dev/null +++ b/stochasticrisingbandits/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:00d044320ae026428ff3d56a187398393ede0ee2670e7279ed58c5e20d8fe09d +size 2275878 diff --git a/stochasticrisingbandits/layout.json b/stochasticrisingbandits/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..fbcf07ea4ac0581eca16872cd5d5d26d0cf4e83e --- /dev/null +++ b/stochasticrisingbandits/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3925f58862811377da6e3902671c8d5aeb0786e0de1ffd14fcc16cacb0421f6a +size 1534159